diff options
author | Guillermo Iguaran <guilleiguaran@gmail.com> | 2012-09-01 22:36:27 -0500 |
---|---|---|
committer | Guillermo Iguaran <guilleiguaran@gmail.com> | 2012-09-16 23:58:21 -0500 |
commit | 9bfa13bb06d510b95f9af27bf12abf031f9af0a5 (patch) | |
tree | 59ac0ae191f1f0350d73d477841c6c2bf35cff59 /activemodel/lib/active_model | |
parent | 91bcebbdef0e31d38622785a064d023272f712db (diff) | |
download | rails-9bfa13bb06d510b95f9af27bf12abf031f9af0a5.tar.gz rails-9bfa13bb06d510b95f9af27bf12abf031f9af0a5.tar.bz2 rails-9bfa13bb06d510b95f9af27bf12abf031f9af0a5.zip |
attr_accessible and attr_protected raise an exception pointing to use plugin or new protection model
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r-- | activemodel/lib/active_model/deprecated_mass_assignment_security.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/activemodel/lib/active_model/deprecated_mass_assignment_security.rb b/activemodel/lib/active_model/deprecated_mass_assignment_security.rb new file mode 100644 index 0000000000..16b8466e55 --- /dev/null +++ b/activemodel/lib/active_model/deprecated_mass_assignment_security.rb @@ -0,0 +1,19 @@ +module ActiveModel + module DeprecatedMassAssignmentSecurity + extend ActiveSupport::Concern + + module ClassMethods + def attr_protected(*args) + raise "`attr_protected` is extracted out of Rails into a gem. " \ + "Please use new recommended protection model for params " \ + "or add `protected_attributes` to your Gemfile to use old one." + end + + def attr_accessible(*args) + raise "`attr_accessible` is extracted out of Rails into a gem. " \ + "Please use new recommended protection model for params " \ + "or add `protected_attributes` to your Gemfile to use old one." + end + end + end +end |