aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2014-06-13 17:04:04 -0600
committerSean Griffin <sean@thoughtbot.com>2014-06-13 17:04:04 -0600
commitf61d9755964af3c1812e75238e34b53ffb1f0b6a (patch)
tree5a487892e7e4a3d4c33e6794d70d8680a3bbe2a6 /activerecord
parentb0f07abbe385463cb03cfc890b85bb8ce3d5ccef (diff)
downloadrails-f61d9755964af3c1812e75238e34b53ffb1f0b6a.tar.gz
rails-f61d9755964af3c1812e75238e34b53ffb1f0b6a.tar.bz2
rails-f61d9755964af3c1812e75238e34b53ffb1f0b6a.zip
Remove `serialized?` from the type interface
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/connection_adapters/column.rb2
-rw-r--r--activerecord/lib/active_record/serializers/xml_serializer.rb6
-rw-r--r--activerecord/lib/active_record/type/serialized.rb4
-rw-r--r--activerecord/lib/active_record/type/value.rb4
4 files changed, 2 insertions, 14 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/column.rb b/activerecord/lib/active_record/connection_adapters/column.rb
index 72c6990ba5..d629fca911 100644
--- a/activerecord/lib/active_record/connection_adapters/column.rb
+++ b/activerecord/lib/active_record/connection_adapters/column.rb
@@ -16,7 +16,7 @@ module ActiveRecord
attr_reader :name, :cast_type, :null, :sql_type, :default_function
delegate :type, :precision, :scale, :limit, :klass, :accessor,
- :text?, :number?, :binary?, :serialized?, :changed?,
+ :text?, :number?, :binary?, :changed?,
:type_cast_from_user, :type_cast_from_database, :type_cast_for_database,
:type_cast_for_schema,
to: :cast_type
diff --git a/activerecord/lib/active_record/serializers/xml_serializer.rb b/activerecord/lib/active_record/serializers/xml_serializer.rb
index 019fe2218e..c2484d02ed 100644
--- a/activerecord/lib/active_record/serializers/xml_serializer.rb
+++ b/activerecord/lib/active_record/serializers/xml_serializer.rb
@@ -182,11 +182,7 @@ module ActiveRecord #:nodoc:
klass = @serializable.class
column = klass.columns_hash[name] || Type::Value.new
- type = if column.serialized?
- super
- else
- column.type
- end
+ type = ActiveSupport::XmlMini::TYPE_NAMES[value.class.name] || column.type
{ :text => :string,
:time => :datetime }[type] || type
diff --git a/activerecord/lib/active_record/type/serialized.rb b/activerecord/lib/active_record/type/serialized.rb
index ebde14634c..42bbed7103 100644
--- a/activerecord/lib/active_record/type/serialized.rb
+++ b/activerecord/lib/active_record/type/serialized.rb
@@ -26,10 +26,6 @@ module ActiveRecord
end
end
- def serialized?
- true
- end
-
def accessor
ActiveRecord::Store::IndifferentHashAccessor
end
diff --git a/activerecord/lib/active_record/type/value.rb b/activerecord/lib/active_record/type/value.rb
index b34d1697cd..875fb98c4b 100644
--- a/activerecord/lib/active_record/type/value.rb
+++ b/activerecord/lib/active_record/type/value.rb
@@ -44,10 +44,6 @@ module ActiveRecord
false
end
- def serialized?
- false
- end
-
def klass # :nodoc:
end