diff options
author | Bogdan Gusiev <agresso@gmail.com> | 2011-06-17 14:42:16 +0300 |
---|---|---|
committer | Bogdan Gusiev <agresso@gmail.com> | 2011-07-07 10:24:05 +0300 |
commit | 0fab8c388ea9cfcace0907102697c78a68762be3 (patch) | |
tree | 7ae9feb94eff9d94ca73e63c42f15b5fc438c5d2 | |
parent | f2c0fb32c0dce7f8da0ce446e2d2f0cba5fd44b3 (diff) | |
download | rails-0fab8c388ea9cfcace0907102697c78a68762be3.tar.gz rails-0fab8c388ea9cfcace0907102697c78a68762be3.tar.bz2 rails-0fab8c388ea9cfcace0907102697c78a68762be3.zip |
Rails app template: setup different mass assignment sanitizer for envs
For production - leave the default
For test and dev: :strict.
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt | 3 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt index ffd9058238..afd7a31f02 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt @@ -22,6 +22,9 @@ # Only use best-standards-support built into browsers config.action_dispatch.best_standards_support = :builtin + # Raise exception on mass assignment protection for ActiveRecord models + config.active_record.mass_assignment_sanitizer = :strict + # Do not compress assets config.assets.compress = false end diff --git a/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt index ee068b0202..9e83f5a336 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt @@ -34,6 +34,9 @@ # like if you have constraints or database-specific column types # config.active_record.schema_format = :sql + # Raise exception on mass assignment protection for ActiveRecord models + config.active_record.mass_assignment_sanitizer = :strict + # Print deprecation notices to the stderr config.active_support.deprecation = :stderr end |