diff options
author | Michael Koziarski <michael@koziarski.com> | 2012-03-05 11:12:01 +1300 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2012-03-05 11:12:01 +1300 |
commit | 06a3a8a458e70c1b6531ac53c57a302b162fd736 (patch) | |
tree | 2580b09e645f4e34945a13db836970dc94e6981d /railties/lib/rails/generators | |
parent | 864d755177d6cb9c46a64c6d55e7c48122f1d453 (diff) | |
download | rails-06a3a8a458e70c1b6531ac53c57a302b162fd736.tar.gz rails-06a3a8a458e70c1b6531ac53c57a302b162fd736.tar.bz2 rails-06a3a8a458e70c1b6531ac53c57a302b162fd736.zip |
Whitelist all attribute assignment by default.
Change the default for newly generated applications to whitelist all attribute assignment. Also update the generated model classes so users are reminded of the importance of attr_accessible.
Diffstat (limited to 'railties/lib/rails/generators')
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/config/application.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/config/application.rb b/railties/lib/rails/generators/rails/app/templates/config/application.rb index c6dfa1f2dd..41e2d5dcc5 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/application.rb +++ b/railties/lib/rails/generators/rails/app/templates/config/application.rb @@ -58,7 +58,7 @@ module <%= app_const_base %> # This will create an empty whitelist of attributes available for mass-assignment for all models # in your app. As such, your models will need to explicitly whitelist or blacklist accessible # parameters by using an attr_accessible or attr_protected declaration. - # config.active_record.whitelist_attributes = true + config.active_record.whitelist_attributes = true <% unless options.skip_sprockets? -%> # Enable the asset pipeline |