aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/primitives
diff options
context:
space:
mode:
authorNick Kallen <nkallen@nick-kallens-computer-2.local>2008-05-17 23:03:56 -0700
committerNick Kallen <nkallen@nick-kallens-computer-2.local>2008-05-17 23:03:56 -0700
commit6e1450a2a646e416aaea003eff19b7703c563bed (patch)
tree5caa324b2d33d1b48d7e440bf36fc9fe8efa5405 /lib/arel/primitives
parent724a2684139342eb4613f78bfae723ef00911ff7 (diff)
downloadrails-6e1450a2a646e416aaea003eff19b7703c563bed.tar.gz
rails-6e1450a2a646e416aaea003eff19b7703c563bed.tar.bz2
rails-6e1450a2a646e416aaea003eff19b7703c563bed.zip
performance enhancements
Diffstat (limited to 'lib/arel/primitives')
-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