--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: Adds an error message (<tt>messsage</tt>) to the <tt>attribute</tt>, which will be returned on a call to <tt>on(attribute)</tt> for the same attribute and ensure that this error object returns false when asked if <tt>empty?</tt>. More than one error can be added to the same <tt>attribute</tt> in which case an array will be returned on a call to <tt>on(attribute)</tt>. If no <tt>messsage</tt> is supplied, :invalid is assumed. If <tt>message</tt> is a Symbol, it will be translated, using the appropriate scope (see translate_error). def add(attribute, message = nil, options = {})
- !ruby/struct:SM::Flow::VERB 
  body: "  message ||= :invalid\n  message = generate_message(attribute, message, options)) if message.is_a?(Symbol)\n  @errors[attribute.to_s] ||= []\n  @errors[attribute.to_s] &lt;&lt; message\n"
- !ruby/struct:SM::Flow::P 
  body: end
full_name: ActiveRecord::Errors#add
is_singleton: false
name: add
params: (error_or_attr, message = nil, options = {})
visibility: public
