aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation/query_methods.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-09-28 17:32:38 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-09-28 17:32:38 -0700
commitdec3a759d189c3acb812bef3aebcc5a2e061c28a (patch)
treeefe7997db6ab451feabd7ace44c49d1dc7474ca5 /activerecord/lib/active_record/relation/query_methods.rb
parent8d9f7b5b9987cccd392442b92c3945fc20a12fff (diff)
downloadrails-dec3a759d189c3acb812bef3aebcc5a2e061c28a.tar.gz
rails-dec3a759d189c3acb812bef3aebcc5a2e061c28a.tar.bz2
rails-dec3a759d189c3acb812bef3aebcc5a2e061c28a.zip
removing more useless code! yay!
Diffstat (limited to 'activerecord/lib/active_record/relation/query_methods.rb')
-rw-r--r--activerecord/lib/active_record/relation/query_methods.rb8
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?