aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/algebra/relations/relation.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-07-27 17:22:40 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-07-27 17:22:40 -0700
commit3aaac5b646ecd73a2fc684896402b1456e5238d8 (patch)
treeedfc10f176f9127443489e42d18e7cfebb1d9324 /lib/arel/algebra/relations/relation.rb
parent1a1e5c144b3192c552b6398607622c3d10e417ca (diff)
downloadrails-3aaac5b646ecd73a2fc684896402b1456e5238d8.tar.gz
rails-3aaac5b646ecd73a2fc684896402b1456e5238d8.tar.bz2
rails-3aaac5b646ecd73a2fc684896402b1456e5238d8.zip
PERF: fewer objects
Diffstat (limited to 'lib/arel/algebra/relations/relation.rb')
-rw-r--r--lib/arel/algebra/relations/relation.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/arel/algebra/relations/relation.rb b/lib/arel/algebra/relations/relation.rb
index b3dccaf8be..af97aa8344 100644
--- a/lib/arel/algebra/relations/relation.rb
+++ b/lib/arel/algebra/relations/relation.rb
@@ -71,7 +71,14 @@ module Arel
end
def where_clauses
- wheres.collect { |w| w.to_sql(Sql::WhereClause.new(self)) }
+ wheres.collect { |w|
+ case w
+ when Value
+ w.value
+ else # FIXME: why do we have to pass in a whereclause?
+ w.to_sql(Sql::WhereClause.new(self))
+ end
+ }
end
def group_clauses