instance method deprecated_setup

Ruby on Rails 4.1.16

Since v4.1.16 Last seen in v4.1.16 Private

Signature

deprecated_setup(options)

No documentation comment.

Parameters

options req
Source
# File activemodel/lib/active_model/validator.rb, line 127
    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

Defined in activemodel/lib/active_model/validator.rb line 127 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveModel::Validator

Type at least 2 characters to search.

↑↓ navigate · open · esc close