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 /spec/arel | |
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 'spec/arel')
-rw-r--r-- | spec/arel/unit/relations/join_spec.rb | 12 | ||||
-rw-r--r-- | spec/arel/unit/relations/relation_spec.rb | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/spec/arel/unit/relations/join_spec.rb b/spec/arel/unit/relations/join_spec.rb index fa6bbbe216..0e3e6ef16b 100644 --- a/spec/arel/unit/relations/join_spec.rb +++ b/spec/arel/unit/relations/join_spec.rb @@ -10,20 +10,20 @@ module Arel describe 'hashing' do it 'implements hash equality' do - Join.new("INNER JOIN", @relation1, @relation2, @predicate) \ - .should hash_the_same_as(Join.new("INNER JOIN", @relation1, @relation2, @predicate)) + InnerJoin.new(@relation1, @relation2, @predicate) \ + .should hash_the_same_as(InnerJoin.new(@relation1, @relation2, @predicate)) end end describe '#engine' do it "delegates to a relation's engine" do - Join.new("INNER JOIN", @relation1, @relation2, @predicate).engine.should == @relation1.engine + InnerJoin.new(@relation1, @relation2, @predicate).engine.should == @relation1.engine end end describe '#attributes' do it 'combines the attributes of the two relations' do - join = Join.new("INNER JOIN", @relation1, @relation2, @predicate) + join = InnerJoin.new(@relation1, @relation2, @predicate) join.attributes.should == (@relation1.attributes + @relation2.attributes).collect { |a| a.bind(join) } end @@ -32,7 +32,7 @@ module Arel describe '#to_sql' do describe 'when joining with another relation' do it 'manufactures sql joining the two tables on the predicate' do - sql = Join.new("INNER JOIN", @relation1, @relation2, @predicate).to_sql + sql = InnerJoin.new(@relation1, @relation2, @predicate).to_sql adapter_is :mysql do sql.should be_like(%Q{ @@ -54,7 +54,7 @@ module Arel describe 'when joining with a string' do it "passes the string through to the where clause" do - sql = Join.new("INNER JOIN asdf ON fdsa", @relation1).to_sql + sql = StringJoin.new(@relation1, "INNER JOIN asdf ON fdsa").to_sql adapter_is :mysql do sql.should be_like(%Q{ diff --git a/spec/arel/unit/relations/relation_spec.rb b/spec/arel/unit/relations/relation_spec.rb index 7df10be59c..6a61f39966 100644 --- a/spec/arel/unit/relations/relation_spec.rb +++ b/spec/arel/unit/relations/relation_spec.rb @@ -34,7 +34,7 @@ module Arel describe 'when given a relation' do it "manufactures an inner join operation between those two relations" do @relation.join(@relation).on(@predicate). \ - should == Join.new("INNER JOIN", @relation, @relation, @predicate) + should == InnerJoin.new(@relation, @relation, @predicate) end end @@ -54,7 +54,7 @@ module Arel describe '#outer_join' do it "manufactures a left outer join operation between those two relations" do @relation.outer_join(@relation).on(@predicate). \ - should == Join.new("LEFT OUTER JOIN", @relation, @relation, @predicate) + should == OuterJoin.new(@relation, @relation, @predicate) end end end |