diff options
author | Matthew Draper <matthew@trebex.net> | 2014-06-14 05:51:13 +0930 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2014-06-14 05:51:13 +0930 |
commit | 49fee3d271e52a44a7bc7fcbbcb00792b613b7df (patch) | |
tree | 7a2ffd1363c276f139e45f51cc1690ab69eb3bdb /activerecord/lib/active_record/connection_adapters | |
parent | 1dcb8e997e388cecc75d141812303d42c79a8481 (diff) | |
parent | 4bf8ffc6516312e68fb0d2b4ac97505f8d0cf192 (diff) | |
download | rails-49fee3d271e52a44a7bc7fcbbcb00792b613b7df.tar.gz rails-49fee3d271e52a44a7bc7fcbbcb00792b613b7df.tar.bz2 rails-49fee3d271e52a44a7bc7fcbbcb00792b613b7df.zip |
Merge pull request #15674 from sgrif/sg-mutable-attributes
Detect in-place changes on mutable AR attributes
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql/oid/hstore.rb | 6 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql/oid/json.rb | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/oid/hstore.rb b/activerecord/lib/active_record/connection_adapters/postgresql/oid/hstore.rb index 88de816d4f..0dd4b65333 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/oid/hstore.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/oid/hstore.rb @@ -3,14 +3,12 @@ module ActiveRecord module PostgreSQL module OID # :nodoc: class Hstore < Type::Value + include Type::Mutable + def type :hstore end - def type_cast_from_user(value) - type_cast_from_database(type_cast_for_database(value)) - end - def type_cast_from_database(value) ConnectionAdapters::PostgreSQLColumn.string_to_hstore(value) end diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/oid/json.rb b/activerecord/lib/active_record/connection_adapters/postgresql/oid/json.rb index b4fed1bcab..d1347c7bb5 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/oid/json.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/oid/json.rb @@ -3,14 +3,12 @@ module ActiveRecord module PostgreSQL module OID # :nodoc: class Json < Type::Value + include Type::Mutable + def type :json end - def type_cast_from_user(value) - type_cast_from_database(type_cast_for_database(value)) - end - def type_cast_from_database(value) ConnectionAdapters::PostgreSQLColumn.string_to_json(value) end |