Hello,
is there a mongoid equivalent of the activerecord config flag
config.active_record.whitelist_attributes = true
|
in Mongoid?
I found a fairly old post on the group, but I could not find a clear answer nor example.
What AR is doing is not very special (basically passing nil to Active Model if my understanding is correct).
ActiveSupport.on_load(:active_record) do
if app.config.active_record.delete(:whitelist_attributes)
attr_accessible(nil)
end
app.config.active_record.each do |k,v|
send "#{k}=", v
end
end
As Mongoid is very tight to Active Model, it should be possible to implement a similar configuration parameter.
Thanks,
Marco