aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/column.rb
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2014-05-30 09:29:22 -0700
committerSean Griffin <sean@thoughtbot.com>2014-06-01 11:33:58 -0600
commit90c8be76a7d00475be5ff4db2eeedde5cc936c2d (patch)
tree1b02b3ccffbef9296aaa6660caed5c64fcb362aa /activerecord/lib/active_record/connection_adapters/column.rb
parent260c384bdb539265b31d3937df48e528acb50800 (diff)
downloadrails-90c8be76a7d00475be5ff4db2eeedde5cc936c2d.tar.gz
rails-90c8be76a7d00475be5ff4db2eeedde5cc936c2d.tar.bz2
rails-90c8be76a7d00475be5ff4db2eeedde5cc936c2d.zip
Remove most code related to serialized properties
Nearly completely implemented in terms of custom properties. `_before_type_cast` now stores the raw serialized string consistently, which removes the need to keep track of "state". The following is now consistently true: - `model.serialized == model.reload.serialized` - A model can be dumped and loaded infinitely without changing - A model can be saved and reloaded infinitely without changing
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/column.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/column.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/column.rb b/activerecord/lib/active_record/connection_adapters/column.rb
index 4fbc55a07e..60da541e3d 100644
--- a/activerecord/lib/active_record/connection_adapters/column.rb
+++ b/activerecord/lib/active_record/connection_adapters/column.rb
@@ -17,7 +17,7 @@ module ActiveRecord
delegate :type, :precision, :scale, :limit, :klass, :accessor,
:text?, :number?, :binary?, :serialized?,
- :type_cast, :type_cast_for_write, :raw_type_cast_for_write, :type_cast_for_database,
+ :type_cast, :type_cast_for_write, :type_cast_for_database,
:type_cast_for_schema,
to: :cast_type
@@ -52,7 +52,7 @@ module ActiveRecord
end
def extract_default(default)
- type_cast(default)
+ type_cast_for_write(type_cast(default))
end
end
end