diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-06-19 16:57:25 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-06-19 16:57:25 -0300 |
commit | 8996fc307a8340b175a1e9f126d485a124d7806c (patch) | |
tree | b1224b427ee7be1232a1a413b11fbf83af433fce /activerecord/lib | |
parent | 197364f8fd34373bb032220f39a98f7c63a67ee3 (diff) | |
parent | 0336efaae8f4942037a31652bce96d9e93eae0ae (diff) | |
download | rails-8996fc307a8340b175a1e9f126d485a124d7806c.tar.gz rails-8996fc307a8340b175a1e9f126d485a124d7806c.tar.bz2 rails-8996fc307a8340b175a1e9f126d485a124d7806c.zip |
Merge pull request #15802 from sgrif/sg-column-quoting
Don't use column object for type casting in `quoting`
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/quoting.rb | 8 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb b/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb index 04ae67234f..ff92375820 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb @@ -14,8 +14,8 @@ module ActiveRecord # value. Is this really the only case? Are we missing tests for other types? # We should have a real column object passed (or nil) here, and check for that # instead - if column.respond_to?(:type_cast_for_database) - value = column.type_cast_for_database(value) + if column.respond_to?(:cast_type) + value = column.cast_type.type_cast_for_database(value) end _quote(value) @@ -34,8 +34,8 @@ module ActiveRecord # value. Is this really the only case? Are we missing tests for other types? # We should have a real column object passed (or nil) here, and check for that # instead - if column.respond_to?(:type_cast_for_database) - value = column.type_cast_for_database(value) + if column.respond_to?(:cast_type) + value = column.cast_type.type_cast_for_database(value) end _type_cast(value) diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb b/activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb index 17fabe5af6..3fea8f490d 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb @@ -179,8 +179,8 @@ module ActiveRecord end def array_column(column) - if column.array && !column.respond_to?(:type_cast_for_database) - OID::Array.new(AdapterProxyType.new(column, self)) + if column.array && !column.respond_to?(:cast_type) + Column.new('', nil, OID::Array.new(AdapterProxyType.new(column, self))) else column end |