diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-28 17:32:38 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-28 17:32:38 -0700 |
commit | dec3a759d189c3acb812bef3aebcc5a2e061c28a (patch) | |
tree | efe7997db6ab451feabd7ace44c49d1dc7474ca5 /activerecord | |
parent | 8d9f7b5b9987cccd392442b92c3945fc20a12fff (diff) | |
download | rails-dec3a759d189c3acb812bef3aebcc5a2e061c28a.tar.gz rails-dec3a759d189c3acb812bef3aebcc5a2e061c28a.tar.bz2 rails-dec3a759d189c3acb812bef3aebcc5a2e061c28a.zip |
removing more useless code! yay!
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 182c293d30..2e0a2effc2 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -175,12 +175,8 @@ module ActiveRecord arel = build_joins(arel, @joins_values) unless @joins_values.empty? (@where_values - ['']).uniq.each do |where| - case where - when String - arel = arel.where(Arel.sql("(#{where})")) - else - arel = arel.where(Arel::Nodes::Grouping.new(where)) - end + where = Arel.sql(where) if String === where + arel = arel.where(Arel::Nodes::Grouping.new(where)) end arel = arel.having(*@having_values.uniq.reject{|h| h.blank?}) unless @having_values.empty? |