aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2014-06-29 13:02:49 -0600
committerSean Griffin <sean@thoughtbot.com>2014-06-29 15:50:28 -0600
commit228aa4fff8d91a179abc81be7891d5a8772257c3 (patch)
tree71ce57d0a1de5f2d4bf3cb078fa7b63e1974f48b /activerecord
parent7a52d6bba0f3db1d1f145e80d161446668393410 (diff)
downloadrails-228aa4fff8d91a179abc81be7891d5a8772257c3.tar.gz
rails-228aa4fff8d91a179abc81be7891d5a8772257c3.tar.bz2
rails-228aa4fff8d91a179abc81be7891d5a8772257c3.zip
Remove array workaround in PG quoting
We no longer need to do fancy legwork to make sure arrays use a type object, now that schema methods use a real type object.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb24
1 files changed, 0 insertions, 24 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb b/activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb
index 07171a75d5..f2f2a3023f 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb
@@ -27,8 +27,6 @@ module ActiveRecord
else
super
end
- when Array
- super(value, array_column(column))
when Hash
case sql_type
when 'hstore' then super(PostgreSQLColumn.hstore_to_string(value), column)
@@ -83,8 +81,6 @@ module ActiveRecord
else
super(value, column)
end
- when Array
- super(value, array_column(column))
when Hash
case column.sql_type
when 'hstore' then PostgreSQLColumn.hstore_to_string(value, array_member)
@@ -165,26 +161,6 @@ module ActiveRecord
super
end
end
-
- def array_column(column)
- if column.array && !column.respond_to?(:cast_type)
- Column.new('', nil, OID::Array.new(AdapterProxyType.new(column, self)))
- else
- column
- end
- end
-
- class AdapterProxyType < SimpleDelegator # :nodoc:
- def initialize(column, adapter)
- @column = column
- @adapter = adapter
- super(column)
- end
-
- def type_cast_for_database(value)
- @adapter.type_cast(value, @column)
- end
- end
end
end
end