提交 357672c9 编写于 作者: R Rafael Mendonça França

Merge pull request #15801 from sgrif/sg-column-defaults

Don't use column object when calculating type cast defaults
......@@ -236,8 +236,8 @@ def type_for_attribute(attr_name) # :nodoc:
# 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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册