diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-04-13 09:42:31 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-04-13 09:42:51 -0700 |
commit | eebb19c954d64760c232cda10263200f32fcf036 (patch) | |
tree | aa9d760d7680c75fd930c6032a50090c630d68d2 /activerecord/lib/active_record/connection_adapters | |
parent | 48fb6b338061c80deda92fd935992cee86a3b368 (diff) | |
download | rails-eebb19c954d64760c232cda10263200f32fcf036.tar.gz rails-eebb19c954d64760c232cda10263200f32fcf036.tar.bz2 rails-eebb19c954d64760c232cda10263200f32fcf036.zip |
use index based substitution for bind parameters
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract_adapter.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb index b0e6136e12..d24cce0a3c 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb @@ -105,7 +105,7 @@ module ActiveRecord # Returns a bind substitution value given a +column+ and list of current # +binds+ - def substitute_for(column, binds) + def substitute_at(column, index) Arel.sql '?' end diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index 1c2cc7d5fa..05f0e5ebe1 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -511,8 +511,8 @@ module ActiveRecord end end - def substitute_for(column, current_values) - Arel.sql("$#{current_values.length + 1}") + def substitute_at(column, index) + Arel.sql("$#{index + 1}") end def exec_query(sql, name = 'SQL', binds = []) |