instance method
column_defaults
Ruby on Rails 8.1.2
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 Active Record object for this table.
Source
# File activerecord/lib/active_record/model_schema.rb, line 488
def column_defaults
load_schema
@column_defaults ||= _default_attributes.deep_dup.to_hash.freeze
end
Defined in activerecord/lib/active_record/model_schema.rb line 488
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ModelSchema::ClassMethods