Generates all the attribute related methods for columns in the database
accessors, mutators and query methods.
# File activerecord/lib/active_record/attribute_methods.rb, line 104
def define_attribute_methods # :nodoc:
return false if @attribute_methods_generated
# Use a mutex; we don't want two threads simultaneously trying to define
# attribute methods.
GeneratedAttributeMethods::LOCK.synchronize do
return false if @attribute_methods_generated
superclass.define_attribute_methods unless base_class?
unless abstract_class?
load_schema
super(attribute_names)
alias_attribute :id_value, :id if _has_attribute?("id")
end
@attribute_methods_generated = true
generate_alias_attributes
end
true
end