From d24e6407a7f5d662cb52ed57efc4d8ee11758170 Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Mon, 9 Jun 2014 13:27:15 -0600 Subject: Rename `type_cast` to `type_cast_from_database` In some cases there is a difference between the two, we should always be doing one or the other. For convenience, `type_cast` is still a private method on type, so new types that do not need different behavior don't need to implement two methods, but it has been moved to private so it cannot be used accidentally. --- .../active_record/connection_adapters/postgresql/oid/json.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'activerecord/lib/active_record/connection_adapters/postgresql/oid/json.rb') 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 c64cf27797..b4fed1bcab 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/oid/json.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/oid/json.rb @@ -8,15 +8,15 @@ module ActiveRecord end def type_cast_from_user(value) - type_cast(type_cast_for_database(value)) + type_cast_from_database(type_cast_for_database(value)) end - def type_cast_for_database(value) - ConnectionAdapters::PostgreSQLColumn.json_to_string(value) + def type_cast_from_database(value) + ConnectionAdapters::PostgreSQLColumn.string_to_json(value) end - def cast_value(value) - ConnectionAdapters::PostgreSQLColumn.string_to_json value + def type_cast_for_database(value) + ConnectionAdapters::PostgreSQLColumn.json_to_string(value) end def accessor -- cgit v1.2.3