diff options
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb | 5 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/mysql_adapter.rb | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb index 41d410e062..460745fba0 100644 --- a/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb @@ -591,8 +591,9 @@ module ActiveRecord '__active_record_temp' ) - subselect = Arel::SelectManager.new(select.engine, subsubselect) - subselect.project(Arel::Table.new('__active_record_temp')[update.ast.key.name]) + subselect = Arel::Nodes::SelectCore.new + subselect.from = subsubselect + subselect.projections << Arel::Table.new('__active_record_temp')[update.ast.key.name] update.where update.ast.key.in(subselect) else diff --git a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb index d4aaf26bf3..4581c16d25 100644 --- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb @@ -505,8 +505,9 @@ module ActiveRecord '__active_record_temp' ) - subselect = Arel::SelectManager.new(select.engine, subsubselect) - subselect.project(Arel::Table.new('__active_record_temp')[update.ast.key.name]) + subselect = Arel::Nodes::SelectCore.new + subselect.from = subsubselect + subselect.projections << Arel::Table.new('__active_record_temp')[update.ast.key.name] update.where update.ast.key.in(subselect) else |