2

Is there a way of completely disabling the MassAssignmentSecurity feature in Rails3?

We're busy with an upgrade and need to disable it for a while :)

Simone Carletti
  • 173,507
  • 49
  • 363
  • 364
Gazza
  • 3,051
  • 1
  • 20
  • 22

1 Answers1

1

In the config/application.rb you can set the config.active_record.whitelist_attributes to false so you have the opposite situation, you have to blacklsit attributes that shouldnt be accessible. On the bottom line that would do what you want,...

davidb
  • 8,884
  • 4
  • 36
  • 72
  • 1
    I must be honest. I've found this feature of Rails to be really temperamental. We've set that flag to both true and false with absolutely no change in behaviour... – Gazza Oct 15 '12 at 14:54
  • 1
    Note: for rails 4 migrators.. If you're using the protected_attributes gem, that gem sets whitelist_attributes = true and overrides the setting in application.rb [link](https://github.com/rails/protected_attributes/blob/b24a10e90e74fc4ce4af8ab1ce7c251e05356bed/lib/protected_attributes/railtie.rb) – daslicious Apr 28 '15 at 23:01