diff options
author | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-05-12 15:40:06 -0700 |
---|---|---|
committer | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-05-12 15:40:06 -0700 |
commit | fff47a5a5e92eccf949785231d1f6953d6fdc640 (patch) | |
tree | e7e651d680bacc1542883b6a1c6c2ef21c3f2d1d /lib/arel/relations | |
parent | ea111521b7eb7456934a283d96f6eb986322baf2 (diff) | |
download | rails-fff47a5a5e92eccf949785231d1f6953d6fdc640.tar.gz rails-fff47a5a5e92eccf949785231d1f6953d6fdc640.tar.bz2 rails-fff47a5a5e92eccf949785231d1f6953d6fdc640.zip |
some memoizing and hash equality performance optimizations
Diffstat (limited to 'lib/arel/relations')
-rw-r--r-- | lib/arel/relations/compound.rb | 2 | ||||
-rw-r--r-- | lib/arel/relations/relation.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/arel/relations/compound.rb b/lib/arel/relations/compound.rb index 7b6f3a46f8..663711760c 100644 --- a/lib/arel/relations/compound.rb +++ b/lib/arel/relations/compound.rb @@ -8,7 +8,7 @@ module Arel :to => :relation def attributes - relation.attributes.collect { |a| a.bind(self) } + @attributes ||= relation.attributes.collect { |a| a.bind(self) } end end end
\ No newline at end of file diff --git a/lib/arel/relations/relation.rb b/lib/arel/relations/relation.rb index 4653323514..b2f811cea2 100644 --- a/lib/arel/relations/relation.rb +++ b/lib/arel/relations/relation.rb @@ -136,7 +136,7 @@ module Arel end def find_attribute_matching_name(name) - attributes.detect { |a| a.alias_or_name.to_s == name.to_s } + attributes.detect { |a| a.named?(name) } end # TESTME - added relation_for(x)[x] because of AR |