diff options
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 4342dde5c8..b941231a65 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -143,18 +143,18 @@ module ActiveRecord end end - arel = arel.having(*@having_values.uniq.select{|h| h.present?}) if @having_values.present? + arel = arel.having(*@having_values.uniq.select{|h| h.present?}) unless @having_values.empty? arel = arel.take(@limit_value) if @limit_value - arel = arel.skip(@offset_value) if @offset_value.present? + arel = arel.skip(@offset_value) if @offset_value - arel = arel.group(*@group_values.uniq.select{|g| g.present?}) if @group_values.present? + arel = arel.group(*@group_values.uniq.select{|g| g.present?}) unless @group_values.empty? - arel = arel.order(*@order_values.uniq.select{|o| o.present?}) if @order_values.present? + arel = arel.order(*@order_values.uniq.select{|o| o.present?}) unless @order_values.empty? arel = build_select(arel, @select_values.uniq) - arel = arel.from(@from_value) if @from_value.present? + arel = arel.from(@from_value) if @from_value arel = arel.lock(@lock_value) if @lock_value arel |