instance method
attributes_from_column_definition
Ruby on Rails 3.1.12
Since v3.0.20 Last seen in v3.1.12 PrivateAvailable in: v3.0.20 v3.1.12
Signature
attributes_from_column_definition()
Initializes the attributes array with keys matching the columns from the linked table and the values matching the corresponding default value of that column, so that a new instance, or one populated from a passed-in Hash, still has all the attributes that instances loaded from the database would.
Source
# File activerecord/lib/active_record/persistence.rb, line 326
def attributes_from_column_definition
self.class.column_defaults.dup
end
Defined in activerecord/lib/active_record/persistence.rb line 326
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Persistence