aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/postgresql/oid/json.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql/oid/json.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql/oid/json.rb6
1 files changed, 5 insertions, 1 deletions
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 c87422fe32..c64cf27797 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql/oid/json.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql/oid/json.rb
@@ -7,7 +7,11 @@ module ActiveRecord
:json
end
- def type_cast_for_write(value)
+ def type_cast_from_user(value)
+ type_cast(type_cast_for_database(value))
+ end
+
+ def type_cast_for_database(value)
ConnectionAdapters::PostgreSQLColumn.json_to_string(value)
end