From b47ac80a17d7a74e1b5deac0e63a72960a4da453 Mon Sep 17 00:00:00 2001 From: Nick Kallen Date: Wed, 16 Jan 2008 22:55:06 -0800 Subject: adding grouping functionality; added some dummy code ("Schmoin") for experimenting with aggregate joins. need to resolve the ambiguity in the #as operator between (SELECT * FROM foo AS bar) vs. (SELECT * FROM foo) AS bar --- spec/active_relation/primitives/attribute_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'spec/active_relation/primitives/attribute_spec.rb') diff --git a/spec/active_relation/primitives/attribute_spec.rb b/spec/active_relation/primitives/attribute_spec.rb index 6078da08f3..543217b9cf 100644 --- a/spec/active_relation/primitives/attribute_spec.rb +++ b/spec/active_relation/primitives/attribute_spec.rb @@ -12,6 +12,12 @@ module ActiveRelation @relation1[:id].as(:alias).should == Attribute.new(@relation1, :id, :alias) end end + + describe '#substitute' do + it "manufactures an attribute with the relation substituted" do + @relation1[:id].substitute(@relation2).should == Attribute.new(@relation2, :id) + end + end describe '#qualified_name' do it "manufactures an attribute name prefixed with the relation's name" do -- cgit v1.2.3