diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-05-23 10:00:52 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-05-23 10:00:54 -0300 |
commit | 9e5b8e3831552a103b2dcf8de75fb6a2337d42ba (patch) | |
tree | ef7f47142b07726fc2c7a954d400a9c1ef7558e5 /activerecord/lib/active_record | |
parent | 30d28b19584783218e842ce2fd7bfe2bc1dccf66 (diff) | |
parent | 7d84c3a2f7ede0e8d04540e9c0640de7378e9b3a (diff) | |
download | rails-9e5b8e3831552a103b2dcf8de75fb6a2337d42ba.tar.gz rails-9e5b8e3831552a103b2dcf8de75fb6a2337d42ba.tar.bz2 rails-9e5b8e3831552a103b2dcf8de75fb6a2337d42ba.zip |
Merge branch 'deprecate-validator-setup'
Closes #10716
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/validations/uniqueness.rb | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/validations/uniqueness.rb b/activerecord/lib/active_record/validations/uniqueness.rb index a705d8c2c4..52e46e1ffe 100644 --- a/activerecord/lib/active_record/validations/uniqueness.rb +++ b/activerecord/lib/active_record/validations/uniqueness.rb @@ -7,11 +7,7 @@ module ActiveRecord "Pass a callable instead: `conditions: -> { where(approved: true) }`" end super({ case_sensitive: true }.merge!(options)) - end - - # Unfortunately, we have to tie Uniqueness validators to a class. - def setup(klass) - @klass = klass + @klass = options[:class] end def validate_each(record, attribute, value) @@ -34,7 +30,6 @@ module ActiveRecord end protected - # The check for an existing value should be run from a class that # isn't abstract. This means working down from the current class # (self), to the first non-abstract class. Since classes don't know |