mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #15801 from sgrif/sg-column-defaults
Don't use column object when calculating type cast defaults
This commit is contained in:
commit
357672c94c
1 changed files with 2 additions and 2 deletions
|
@ -236,8 +236,8 @@ module ActiveRecord
|
|||
# Returns a hash where the keys are column names and the values are
|
||||
# default values when instantiating the AR object for this table.
|
||||
def column_defaults
|
||||
@column_defaults ||= Hash[columns_hash.map { |name, column|
|
||||
[name, column.type_cast_from_database(column.default)]
|
||||
@column_defaults ||= Hash[raw_column_defaults.map { |name, default|
|
||||
[name, type_for_attribute(name).type_cast_from_database(default)]
|
||||
}]
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue