diff options
author | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-03-16 17:49:06 -0700 |
---|---|---|
committer | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-03-16 17:49:06 -0700 |
commit | cae95fc02af1fff885dca4a29b2fd3711b809cab (patch) | |
tree | e177c3721d20596b4cc60e336b0999060e6e82a6 /lib/active_relation/relations | |
parent | 2d3681bb3c9ed8136fc46857828b74ae39b6d990 (diff) | |
download | rails-cae95fc02af1fff885dca4a29b2fd3711b809cab.tar.gz rails-cae95fc02af1fff885dca4a29b2fd3711b809cab.tar.bz2 rails-cae95fc02af1fff885dca4a29b2fd3711b809cab.zip |
projections now support string passthrough
- there is a weird inconsistency in where bind is called on values; this needs to be resolved
Diffstat (limited to 'lib/active_relation/relations')
-rw-r--r-- | lib/active_relation/relations/relation.rb | 4 |
1 files changed, 2 insertions, 2 deletions
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? ), |