aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2015-01-27 10:03:25 -0700
committerSean Griffin <sean@thoughtbot.com>2015-01-27 10:03:25 -0700
commitc2c95cd279c988e7bd94008264e956e30b78c9ec (patch)
tree0d7ca279010d706a99a3904fcf5dd614a4ea2feb /activerecord
parenta5fcdae0a04d97dbd8fd05af6f352d3e09b2815f (diff)
downloadrails-c2c95cd279c988e7bd94008264e956e30b78c9ec.tar.gz
rails-c2c95cd279c988e7bd94008264e956e30b78c9ec.tar.bz2
rails-c2c95cd279c988e7bd94008264e956e30b78c9ec.zip
Use the `WhereClause` ast building logic for having
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/relation/query_methods.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb
index c8b74490c4..9bd55de347 100644
--- a/activerecord/lib/active_record/relation/query_methods.rb
+++ b/activerecord/lib/active_record/relation/query_methods.rb
@@ -853,12 +853,9 @@ module ActiveRecord
build_joins(arel, joins_values.flatten) unless joins_values.empty?
arel.where(where_clause.ast) unless where_clause.empty?
-
- arel.having(*having_clause.predicates.uniq.reject(&:blank?)) if having_clause.any?
-
+ arel.having(having_clause.ast) unless having_clause.empty?
arel.take(connection.sanitize_limit(limit_value)) if limit_value
arel.skip(offset_value.to_i) if offset_value
-
arel.group(*group_values.uniq.reject(&:blank?)) unless group_values.empty?
build_order(arel)