diff options
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 |