method
writer_method
writer_method(name, class_name, mapping)
private
Hide source
# File activerecord/lib/active_record/aggregations.rb, line 158 def writer_method(name, class_name, mapping) module_eval "def \#{name}=(part)\n@\#{name} = part.freeze\n\#{(Array === mapping.first ? mapping : [ mapping ]).collect{ |pair| \"@attributes[\\\"\#{pair.first}\\\"] = part.\#{pair.last}\" }.join(\"\\n\")}\nend\n" end