method
reader_method
reader_method(name, class_name, mapping)
private
Hide source
# File activerecord/lib/active_record/aggregations.rb, line 144 def reader_method(name, class_name, mapping) module_eval "def \#{name}(force_reload = false)\nif @\#{name}.nil? || force_reload\n@\#{name} = \#{class_name}.new(\#{(Array === mapping.first ? mapping : [ mapping ]).collect{ |pair| \"read_attribute(\\\"\#{pair.first}\\\")\"}.join(\", \")})\nend\n\nreturn @\#{name}\nend\n" end