diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-06-10 11:43:53 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-06-10 11:43:53 -0300 |
commit | d5f480c5324c02d89b23e24a92a7a4ea58de59bc (patch) | |
tree | f3b952c874117626eda72622d2cdf09d4437639a /activemodel/lib | |
parent | be5d648a16436370568382b10cbb7a2ad716cf01 (diff) | |
parent | e5cc892ce66968d4e15ea3fbf62a9fdd43b410d9 (diff) | |
download | rails-d5f480c5324c02d89b23e24a92a7a4ea58de59bc.tar.gz rails-d5f480c5324c02d89b23e24a92a7a4ea58de59bc.tar.bz2 rails-d5f480c5324c02d89b23e24a92a7a4ea58de59bc.zip |
Merge pull request #15603 from kuldeepaggarwal/remove-deprecation-method
remove depricated Validatior#setup
Diffstat (limited to 'activemodel/lib')
-rw-r--r-- | activemodel/lib/active_model/validator.rb | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/activemodel/lib/active_model/validator.rb b/activemodel/lib/active_model/validator.rb index bddacc8c45..65cb1e5a88 100644 --- a/activemodel/lib/active_model/validator.rb +++ b/activemodel/lib/active_model/validator.rb @@ -106,7 +106,6 @@ module ActiveModel # Accepts options that will be made available through the +options+ reader. def initialize(options = {}) @options = options.except(:class).freeze - deprecated_setup(options) end # Returns the kind for this validator. @@ -122,21 +121,6 @@ module ActiveModel def validate(record) raise NotImplementedError, "Subclasses must implement a validate(record) method." end - - private - def deprecated_setup(options) # TODO: remove me in 4.2. - return unless respond_to?(:setup) - ActiveSupport::Deprecation.warn "The `Validator#setup` instance method is deprecated and will be removed on Rails 4.2. Do your setup in the constructor instead: - -class MyValidator < ActiveModel::Validator - def initialize(options={}) - super - options[:class].send :attr_accessor, :custom_attribute - end -end -" - setup(options[:class]) - end end # +EachValidator+ is a validator which iterates through the attributes given |