# Accepts options that will be made available through the +options+ reader.
definitialize(options={})
@options=options.except(:class).freeze
deprecated_setup(options)
end
# Returns the kind for this validator.
...
...
@@ -122,21 +121,6 @@ def kind
defvalidate(record)
raiseNotImplementedError,"Subclasses must implement a validate(record) method."
end
private
defdeprecated_setup(options)# TODO: remove me in 4.2.
returnunlessrespond_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: