aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/postgresql/oid
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2014-06-04 06:43:30 -0600
committerSean Griffin <sean@thoughtbot.com>2014-06-04 06:43:30 -0600
commitc3bd7b57e359788b26674683fb5b1518c75f6bb1 (patch)
tree779f73e9319dedede9ee5c557be91a7cb92fec4a /activerecord/lib/active_record/connection_adapters/postgresql/oid
parent0329d59a65a5afbf57de83670e3e05e4a73815e4 (diff)
downloadrails-c3bd7b57e359788b26674683fb5b1518c75f6bb1.tar.gz
rails-c3bd7b57e359788b26674683fb5b1518c75f6bb1.tar.bz2
rails-c3bd7b57e359788b26674683fb5b1518c75f6bb1.zip
Bring type casting behavior of hstore/json in line with serialized
`@raw_attributes` should not contain the type-cast, mutable version of the value.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql/oid')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql/oid/hstore.rb6
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql/oid/json.rb6
2 files changed, 0 insertions, 12 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 bf680b6624..a65ca83f77 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql/oid/hstore.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql/oid/hstore.rb
@@ -8,12 +8,6 @@ module ActiveRecord
end
def type_cast_for_write(value)
- # roundtrip to ensure uniform uniform types
- # TODO: This is not an efficient solution.
- cast_value(type_cast_for_database(value))
- end
-
- def type_cast_for_database(value)
ConnectionAdapters::PostgreSQLColumn.hstore_to_string(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 42a5110ffd..c87422fe32 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql/oid/json.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql/oid/json.rb
@@ -8,12 +8,6 @@ module ActiveRecord
end
def type_cast_for_write(value)
- # roundtrip to ensure uniform uniform types
- # TODO: This is not an efficient solution.
- cast_value(type_cast_for_database(value))
- end
-
- def type_cast_for_database(value)
ConnectionAdapters::PostgreSQLColumn.json_to_string(value)
end