aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-08-11 08:45:42 +0100
committerJon Leighton <j@jonathanleighton.com>2011-08-15 23:10:16 +0100
commitcc206a3507699e2c94b2d62ec5226fd20d5d98b3 (patch)
tree057e6b46ae4391a1b1f9a4a8c7aa806ac26175cd /activerecord/lib/active_record/connection_adapters
parent12aaad0848fb29bf64025043a855b0c0b497a6b8 (diff)
downloadrails-cc206a3507699e2c94b2d62ec5226fd20d5d98b3.tar.gz
rails-cc206a3507699e2c94b2d62ec5226fd20d5d98b3.tar.bz2
rails-cc206a3507699e2c94b2d62ec5226fd20d5d98b3.zip
Use new SelectManager#projections= method
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb4
-rw-r--r--activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb2
-rw-r--r--activerecord/lib/active_record/connection_adapters/mysql_adapter.rb2
3 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
index bfbf953a37..dc4a53034b 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
@@ -310,8 +310,8 @@ module ActiveRecord
# on mysql (even when aliasing the tables), but mysql allows using JOIN directly in
# an UPDATE statement, so in the mysql adapters we redefine this to do that.
def join_to_update(update, select) #:nodoc:
- subselect = select.ast.clone
- subselect.cores.last.projections = [update.key]
+ subselect = select.clone
+ subselect.projections = [update.key]
update.where update.key.in(subselect)
end
diff --git a/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb
index 379ba162ed..cba00dc625 100644
--- a/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb
@@ -585,7 +585,7 @@ module ActiveRecord
def join_to_update(update, select) #:nodoc:
if select.limit || select.offset || select.orders.any?
subsubselect = select.clone
- subsubselect.ast.cores.last.projections = [update.key]
+ subsubselect.projections = [update.key]
subselect = Arel::SelectManager.new(select.engine)
subselect.project Arel.sql(update.key.name)
diff --git a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
index a33e2d8cb0..c3a066a622 100644
--- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
@@ -499,7 +499,7 @@ module ActiveRecord
def join_to_update(update, select) #:nodoc:
if select.limit || select.offset || select.orders.any?
subsubselect = select.clone
- subsubselect.ast.cores.last.projections = [update.key]
+ subsubselect.projections = [update.key]
subselect = Arel::SelectManager.new(select.engine)
subselect.project Arel.sql(update.key.name)