diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-10 14:02:14 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-10 16:31:08 -0800 |
commit | b9bb240a2b5abc0b6704b1a1552a31c4f1d96f34 (patch) | |
tree | 1f5579f77e74b9fdadbc08828684157d8fae981b /activerecord | |
parent | c6612d2bb34e7104a7b1be0dedb0e1ad9596f160 (diff) | |
download | rails-b9bb240a2b5abc0b6704b1a1552a31c4f1d96f34.tar.gz rails-b9bb240a2b5abc0b6704b1a1552a31c4f1d96f34.tar.bz2 rails-b9bb240a2b5abc0b6704b1a1552a31c4f1d96f34.zip |
just mutate the ast, fewer lasgns
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 08b61c9752..dce9ac4808 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -225,14 +225,13 @@ module ActiveRecord test = eqls.inject(eqls.shift) do |memo, expr| memo.or(expr) end - arel = arel.where(test) + arel.where(test) end (wheres - equalities).each do |where| where = Arel.sql(where) if String === where - arel = arel.where(Arel::Nodes::Grouping.new(where)) + arel.where(Arel::Nodes::Grouping.new(where)) end - arel end def build_where(opts, other = []) |