diff options
author | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-05-14 20:33:23 -0700 |
---|---|---|
committer | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-05-14 20:33:23 -0700 |
commit | 9376459a7186b794b29e11c55186135004e8f3b8 (patch) | |
tree | 37b2905882277e25be9c6d1940be5bc625724711 /lib/arel/primitives | |
parent | 16730fdbd0ab630320aba225314aa6a1a3b450fe (diff) | |
download | rails-9376459a7186b794b29e11c55186135004e8f3b8.tar.gz rails-9376459a7186b794b29e11c55186135004e8f3b8.tar.bz2 rails-9376459a7186b794b29e11c55186135004e8f3b8.zip |
fixed defect with select inside of alias joined to the same table (yikes)
Diffstat (limited to 'lib/arel/primitives')
-rw-r--r-- | lib/arel/primitives/attribute.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/arel/primitives/attribute.rb b/lib/arel/primitives/attribute.rb index 5f8618ddfc..22ee37524e 100644 --- a/lib/arel/primitives/attribute.rb +++ b/lib/arel/primitives/attribute.rb @@ -47,11 +47,7 @@ module Arel module Transformations def self.included(klass) - alias_method :eql?, :== - end - - def hash - name.hash + history.size.hash + klass.hash_on :name end def as(aliaz = nil) @@ -70,7 +66,7 @@ module Arel module Congruence def history - @history ||= [self] + (ancestor ? [ancestor, ancestor.history].flatten : []) + @history ||= [self] + (ancestor ? ancestor.history : []) end def match?(other) |