提交 ea6f28c8 编写于 作者: S Sean Griffin

Remove unused column types override

上级 584498a6
......@@ -256,7 +256,6 @@ def initialize(attributes = nil, options = {})
end
@attributes = defaults
@column_types_override = nil
@column_types = self.class.column_types
init_internals
......@@ -283,7 +282,6 @@ def initialize(attributes = nil, options = {})
# post.title # => 'hello world'
def init_with(coder)
@attributes = coder['attributes']
@column_types_override = coder['column_types']
@column_types = self.class.column_types
init_internals
......@@ -357,7 +355,6 @@ def encode_with(coder)
# FIXME: Remove this when we better serialize attributes
coder['raw_attributes'] = attributes_before_type_cast
coder['attributes'] = @attributes
coder['column_types'] = @column_types_override
coder['new_record'] = new_record?
end
......
......@@ -53,12 +53,7 @@ def instantiate(attributes, column_types = {})
type = column_types.fetch(name) { klass.type_for_attribute(name) }
h[name] = Attribute.from_database(value, type)
end
klass.allocate.init_with(
'attributes' => attributes,
'column_types' => column_types,
'new_record' => false,
)
klass.allocate.init_with('attributes' => attributes, 'new_record' => false)
end
private
......@@ -406,8 +401,7 @@ def reload(options = nil)
@attributes.update(fresh_object.instance_variable_get('@attributes'))
@column_types = self.class.column_types
@column_types_override = fresh_object.instance_variable_get('@column_types_override')
@column_types = self.class.column_types
self
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册