diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2010-01-03 21:24:09 +0530 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2010-01-03 21:25:19 +0530 |
commit | 00f3f6dc3145f2d7e8b8dadd966008cd0fa54636 (patch) | |
tree | 4b0fb5d2df9e8cbefdc17abfb90e0459fff7737c /activerecord/lib | |
parent | 3db876cb761837ebf9b02d22846353e277ff14cd (diff) | |
download | rails-00f3f6dc3145f2d7e8b8dadd966008cd0fa54636.tar.gz rails-00f3f6dc3145f2d7e8b8dadd966008cd0fa54636.tar.bz2 rails-00f3f6dc3145f2d7e8b8dadd966008cd0fa54636.zip |
Relation#merge and Relation#except should respect locks
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/relation/spawn_methods.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/spawn_methods.rb b/activerecord/lib/active_record/relation/spawn_methods.rb index ea58812faa..a637e97155 100644 --- a/activerecord/lib/active_record/relation/spawn_methods.rb +++ b/activerecord/lib/active_record/relation/spawn_methods.rb @@ -24,7 +24,8 @@ module ActiveRecord offset(arel.skipped). select(arel.send(:select_clauses)). from(arel.sources). - having(arel.havings) + having(arel.havings). + lock(arel.locked) end relation_order = r.send(:order_clause) @@ -65,6 +66,7 @@ module ActiveRecord result = result.order(order_clause) unless skips.include?(:order) result = result.where(*@relation.wheres) unless skips.include?(:where) result = result.having(*@relation.havings) unless skips.include?(:having) + result = result.lock(@relation.locked) unless skips.include?(:lock) result end |