aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/primitives/attribute.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/arel/primitives/attribute.rb')
-rw-r--r--lib/arel/primitives/attribute.rb12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/arel/primitives/attribute.rb b/lib/arel/primitives/attribute.rb
index 5e769ac0eb..cb564c1587 100644
--- a/lib/arel/primitives/attribute.rb
+++ b/lib/arel/primitives/attribute.rb
@@ -38,16 +38,14 @@ module Arel
end
def original_relation
- @original_relation ||= relation.relation_for(self)
+ original_attribute.relation
end
def original_attribute
- @original_attribute ||= original_relation[self]
+ @original_attribute ||= history.detect { |a| !a.join? }
end
- module Transformations
- delegate :size, :to => :history
-
+ module Transformations
def self.included(klass)
klass.send :alias_method, :eql?, :==
end
@@ -75,8 +73,8 @@ module Arel
@history ||= [self] + (ancestor ? ancestor.history : [])
end
- def match?(other)
- history.last == other.history.last
+ def join?
+ relation.join?
end
def root