diff options
author | Bryan Helmkamp <bryan@brynary.com> | 2009-05-17 14:49:56 -0400 |
---|---|---|
committer | Bryan Helmkamp <bryan@brynary.com> | 2009-05-17 14:49:56 -0400 |
commit | 3a6e8e5a3f99841691b70b89b0a10f836e6ec071 (patch) | |
tree | 89e59775b729616ca9cb4a4f1f70415af35ce3d7 /lib/arel/engines/sql/primitives.rb | |
parent | 892337509b2bd269920dc567bc48c6a28c7222d2 (diff) | |
download | rails-3a6e8e5a3f99841691b70b89b0a10f836e6ec071.tar.gz rails-3a6e8e5a3f99841691b70b89b0a10f836e6ec071.tar.bz2 rails-3a6e8e5a3f99841691b70b89b0a10f836e6ec071.zip |
join sql stuff moved into sql adapter
Conflicts:
lib/arel/algebra/primitives/value.rb
lib/arel/algebra/relations/operations/join.rb
lib/arel/algebra/relations/relation.rb
spec/arel/unit/relations/join_spec.rb
Diffstat (limited to 'lib/arel/engines/sql/primitives.rb')
-rw-r--r-- | lib/arel/engines/sql/primitives.rb | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/arel/engines/sql/primitives.rb b/lib/arel/engines/sql/primitives.rb index c4968558a2..6f89723afe 100644 --- a/lib/arel/engines/sql/primitives.rb +++ b/lib/arel/engines/sql/primitives.rb @@ -3,7 +3,7 @@ module Arel def column original_relation.column_for(self) end - + def format(object) object.to_sql(Sql::Attribute.new(self)) end @@ -14,6 +14,8 @@ module Arel end class Value + delegate :inclusion_predicate_sql, :equality_predicate_sql, :to => :value + def to_sql(formatter = Sql::WhereCondition.new(relation)) formatter.value value end @@ -22,33 +24,33 @@ module Arel object.to_sql(Sql::Value.new(relation)) end end - + class Expression < Attribute def to_sql(formatter = Sql::SelectClause.new(relation)) formatter.expression self end end - + class Count < Expression def function_sql; 'COUNT' end end - + class Distinct < Expression def function_sql; 'DISTINCT' end end - + class Sum < Expression def function_sql; 'SUM' end end - + class Maximum < Expression def function_sql; 'MAX' end end - + class Minimum < Expression def function_sql; 'MIN' end end - + class Average < Expression def function_sql; 'AVG' end end |