From cae95fc02af1fff885dca4a29b2fd3711b809cab Mon Sep 17 00:00:00 2001 From: Nick Kallen Date: Sun, 16 Mar 2008 17:49:06 -0700 Subject: projections now support string passthrough - there is a weird inconsistency in where bind is called on values; this needs to be resolved --- lib/active_relation/relations/relation.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/active_relation/relations') diff --git a/lib/active_relation/relations/relation.rb b/lib/active_relation/relations/relation.rb index fa66bd039b..88d1bce4a8 100644 --- a/lib/active_relation/relations/relation.rb +++ b/lib/active_relation/relations/relation.rb @@ -42,7 +42,7 @@ module ActiveRelation end def project(*attributes) - Projection.new(self, *attributes.collect {|a| a.bind(self)}) + Projection.new(self, *attributes) end def as(aliaz) @@ -103,7 +103,7 @@ module ActiveRelation def to_sql(formatter = Sql::SelectStatement.new(engine)) formatter.select [ - "SELECT #{attributes.collect { |a| a.to_sql(Sql::SelectExpression.new(engine)) }.join(', ')}", + "SELECT #{attributes.collect { |a| a.to_sql(Sql::SelectClause.new(engine)) }.join(', ')}", "FROM #{table_sql}", (joins unless joins.blank? ), ("WHERE #{selects.collect { |s| s.to_sql(Sql::WhereClause.new(engine)) }.join("\n\tAND ")}" unless selects.blank? ), -- cgit v1.2.3