From ea6f28c8a114396376bafe26e1af5d2ca3df6fdb Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Tue, 10 Jun 2014 11:17:09 -0600 Subject: [PATCH] Remove unused column types override --- activerecord/lib/active_record/core.rb | 3 --- activerecord/lib/active_record/persistence.rb | 10 ++-------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb index 6c089b243e..d39e5fddfe 100644 --- a/activerecord/lib/active_record/core.rb +++ b/activerecord/lib/active_record/core.rb @@ -256,7 +256,6 @@ module ActiveRecord end @attributes = defaults - @column_types_override = nil @column_types = self.class.column_types init_internals @@ -283,7 +282,6 @@ module ActiveRecord # 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 @@ module ActiveRecord # 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 diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb index c69a83c125..5c744762d9 100644 --- a/activerecord/lib/active_record/persistence.rb +++ b/activerecord/lib/active_record/persistence.rb @@ -53,12 +53,7 @@ module ActiveRecord 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 @@ module ActiveRecord @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