From dfe79da73e13d44294ce5b167d6519b394cefa1b Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 29 Jul 2010 13:47:44 -0700 Subject: PERF: fewer objects, pass through on values --- lib/arel/algebra/relations/relation.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/arel/algebra/relations/relation.rb b/lib/arel/algebra/relations/relation.rb index dd0684b88e..eeb5918f4b 100644 --- a/lib/arel/algebra/relations/relation.rb +++ b/lib/arel/algebra/relations/relation.rb @@ -65,7 +65,14 @@ module Arel end def select_clauses - attributes.collect { |a| a.to_sql(Sql::SelectClause.new(self)) } + attributes.map { |a| + case a + when Value + a.value + else + a.to_sql(Sql::SelectClause.new(self)) + end + } end def from_clauses -- cgit v1.2.3