Flowdock
method

validates_with

Importance_1
Ruby on Rails latest stable (v3.2.13) - 0 notes - Class: ActiveModel::Validations::ClassMethods
validates_with(*args, &block) public

If you pass any additional configuration options, they will be passed to the class and available as options:

class Person
  include ActiveModel::Validations
  validates_with MyValidator, :my_custom_key => "my custom value"
end

class MyValidator < ActiveModel::Validator
  def validate(record)
    options[:my_custom_key] # => "my custom value"
  end
end
Show source
Register or log in to add new notes.