diff options
Diffstat (limited to 'lib/arel/algebra/relations/operations/join.rb')
-rw-r--r-- | lib/arel/algebra/relations/operations/join.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/arel/algebra/relations/operations/join.rb b/lib/arel/algebra/relations/operations/join.rb index e47d9fa9e0..e9320f28e1 100644 --- a/lib/arel/algebra/relations/operations/join.rb +++ b/lib/arel/algebra/relations/operations/join.rb @@ -3,12 +3,19 @@ module Arel attributes :relation1, :relation2, :predicates deriving :== delegate :name, :to => :relation1 - hash_on :relation1 def initialize(relation1, relation2 = Nil.instance, *predicates) @relation1, @relation2, @predicates = relation1, relation2, predicates end + def hash + @hash ||= :relation1.hash + end + + def eql?(other) + self == other + end + def attributes @attributes ||= (relation1.externalize.attributes + relation2.externalize.attributes).collect { |a| a.bind(self) } |