aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/serializers
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2015-01-30 11:42:54 -0700
committerSean Griffin <sean@thoughtbot.com>2015-01-30 11:42:54 -0700
commitb93b39eff6829ee05ffec1cc8c505f69cbb53fdc (patch)
tree5b37fc7c7d36cc6e0abc2530606ea3acad05362c /activerecord/lib/active_record/serializers
parent155b1b7fe3a1d231fb98a6fb04a21f6eb190b98f (diff)
downloadrails-b93b39eff6829ee05ffec1cc8c505f69cbb53fdc.tar.gz
rails-b93b39eff6829ee05ffec1cc8c505f69cbb53fdc.tar.bz2
rails-b93b39eff6829ee05ffec1cc8c505f69cbb53fdc.zip
Remove most type related predicates from `Column`
Remaining are `limit`, `precision`, `scale`, and `type` (the symbol version). These will remain on the column, since they mirror the options to the `column` method in the schema definition DSL
Diffstat (limited to 'activerecord/lib/active_record/serializers')
-rw-r--r--activerecord/lib/active_record/serializers/xml_serializer.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/serializers/xml_serializer.rb b/activerecord/lib/active_record/serializers/xml_serializer.rb
index c2484d02ed..89b7e0be82 100644
--- a/activerecord/lib/active_record/serializers/xml_serializer.rb
+++ b/activerecord/lib/active_record/serializers/xml_serializer.rb
@@ -180,9 +180,9 @@ module ActiveRecord #:nodoc:
class Attribute < ActiveModel::Serializers::Xml::Serializer::Attribute #:nodoc:
def compute_type
klass = @serializable.class
- column = klass.columns_hash[name] || Type::Value.new
+ cast_type = klass.type_for_attribute(name)
- type = ActiveSupport::XmlMini::TYPE_NAMES[value.class.name] || column.type
+ type = ActiveSupport::XmlMini::TYPE_NAMES[value.class.name] || cast_type.type
{ :text => :string,
:time => :datetime }[type] || type