method
define_method_attribute
v3.0.0 -
Show latest stable
- Class:
ActiveRecord::AttributeMethods::Read::ClassMethods
define_method_attribute(attr_name)protected
No documentation available.
# File activerecord/lib/active_record/attribute_methods/read.rb, line 39
def define_method_attribute(attr_name)
if self.serialized_attributes[attr_name]
define_read_method_for_serialized_attribute(attr_name)
else
define_read_method(attr_name.to_sym, attr_name, columns_hash[attr_name])
end
if attr_name == primary_key && attr_name != "id"
define_read_method(:id, attr_name, columns_hash[attr_name])
end
end