instance method
column_defaults
Ruby on Rails 4.2.9
Since v3.2.22.5Signature
column_defaults()
Returns a hash where the keys are column names and the values are default values when instantiating the AR object for this table.
Source
# File activerecord/lib/active_record/model_schema.rb, line 249
def column_defaults
_default_attributes.dup.to_hash
end
Defined in activerecord/lib/active_record/model_schema.rb line 249
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ModelSchema::ClassMethods