aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation/spawn_methods.rb
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2010-01-03 20:50:04 +0530
committerPratik Naik <pratiknaik@gmail.com>2010-01-03 20:50:04 +0530
commit3db876cb761837ebf9b02d22846353e277ff14cd (patch)
tree26570b18225c42e7a5d09060f56fe2511b7a0e76 /activerecord/lib/active_record/relation/spawn_methods.rb
parentaf5e1b4cc6fd3ae5f5e175751373a5e60934385b (diff)
downloadrails-3db876cb761837ebf9b02d22846353e277ff14cd.tar.gz
rails-3db876cb761837ebf9b02d22846353e277ff14cd.tar.bz2
rails-3db876cb761837ebf9b02d22846353e277ff14cd.zip
Relation#merge and Relation#except should respect havings
Diffstat (limited to 'activerecord/lib/active_record/relation/spawn_methods.rb')
-rw-r--r--activerecord/lib/active_record/relation/spawn_methods.rb4
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 b9e3457aac..ea58812faa 100644
--- a/activerecord/lib/active_record/relation/spawn_methods.rb
+++ b/activerecord/lib/active_record/relation/spawn_methods.rb
@@ -23,7 +23,8 @@ module ActiveRecord
limit(arel.taken).
offset(arel.skipped).
select(arel.send(:select_clauses)).
- from(arel.sources)
+ from(arel.sources).
+ having(arel.havings)
end
relation_order = r.send(:order_clause)
@@ -63,6 +64,7 @@ module ActiveRecord
result = result.from(@relation.sources) unless skips.include?(:from)
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
end