diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-04 16:04:28 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-04 16:04:28 -0700 |
commit | fa12b394ff6240358a32ecff63700f85084da5ac (patch) | |
tree | eb8aa26038bcfc9968f8aa4add636f9679b55601 | |
parent | a7e0d6e85a9d4562a3e16e7fdc2dbd0719ae36ed (diff) | |
download | rails-fa12b394ff6240358a32ecff63700f85084da5ac.tar.gz rails-fa12b394ff6240358a32ecff63700f85084da5ac.tar.bz2 rails-fa12b394ff6240358a32ecff63700f85084da5ac.zip |
removing Group#==, improving Group test
-rw-r--r-- | lib/arel/algebra/relations/operations/group.rb | 7 | ||||
-rw-r--r-- | spec/algebra/unit/relations/relation_spec.rb | 5 |
2 files changed, 4 insertions, 8 deletions
diff --git a/lib/arel/algebra/relations/operations/group.rb b/lib/arel/algebra/relations/operations/group.rb index f3666cacf8..16a2963c93 100644 --- a/lib/arel/algebra/relations/operations/group.rb +++ b/lib/arel/algebra/relations/operations/group.rb @@ -7,13 +7,6 @@ module Arel @groupings = groupings.collect { |g| g.bind(relation) } end - def == other - super || - self.class === other && - @relation == other.relation && - @groupings == other.groupings - end - def eval raise NotImplementedError end diff --git a/spec/algebra/unit/relations/relation_spec.rb b/spec/algebra/unit/relations/relation_spec.rb index 1a15471f9a..4a7d9be0dc 100644 --- a/spec/algebra/unit/relations/relation_spec.rb +++ b/spec/algebra/unit/relations/relation_spec.rb @@ -160,7 +160,10 @@ module Arel describe '#group' do it 'manufactures a group relation' do - @relation.group(@attribute1, @attribute2).should == Group.new(@relation, [@attribute1, @attribute2]) + group = @relation.group(@attribute1, @attribute2) + group.relation.should == @relation + group.groupings.should == [@attribute1, @attribute2] + group.should be_kind_of Group end describe 'when given blank groupings' do |