title: Rails/ActiveModel passing arguments to EachValidator
body: <p>I have a very generic validator and I want to pass it arguments.  </p>
  
  <p>Here is an example model:</p>
  
  <pre><code>class User
    include Mongoid::Document
  
    field :order_type
    has_many :orders, inverse_of :user
    validates: orders, generic: true #i want to pass argument (order_type)
  
    field :task_type
    has_many :tasks, inverse_of :user
    validates: tasks, generic: true #i want to pass argument (task_type)
  end
  </code></pre>
  
  <p>and Example validator:</p>
  
  <pre><code>class GenericValidator &lt; ActiveModel::EachValidator
    def validate_each(object, attribute, value)
      if some_validation?(object)
        object.errors[attribute] &lt;&lt; (options[:message] || "is not formatted properly") 
      end
    end
  end
  </code></pre>
  
  <p>Is there any way to pass arguments to the validator dependant on which field it is validating?</p>
  
  <p>thanks</p>