aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/engines/memory
diff options
context:
space:
mode:
authorCarl Lerche <carllerche@mac.com>2010-04-02 19:04:23 -0700
committerCarl Lerche <carllerche@mac.com>2010-04-02 19:04:23 -0700
commita46922e4a1089c9880c30b389e1e1d9dfbab02ae (patch)
tree2115e291ff1799d662bbb445b96060f2d029cc0d /lib/arel/engines/memory
parent233ee77f4511255ff2ff7c0b0ebf1cee13e7fc10 (diff)
downloadrails-a46922e4a1089c9880c30b389e1e1d9dfbab02ae.tar.gz
rails-a46922e4a1089c9880c30b389e1e1d9dfbab02ae.tar.bz2
rails-a46922e4a1089c9880c30b389e1e1d9dfbab02ae.zip
Create an Arel::Header class representing a relation's attributes
Diffstat (limited to 'lib/arel/engines/memory')
-rw-r--r--lib/arel/engines/memory/relations/array.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/arel/engines/memory/relations/array.rb b/lib/arel/engines/memory/relations/array.rb
index 6486dcbcc1..d8751fa626 100644
--- a/lib/arel/engines/memory/relations/array.rb
+++ b/lib/arel/engines/memory/relations/array.rb
@@ -15,9 +15,12 @@ module Arel
end
def attributes
- @attributes ||= @attribute_names_and_types.collect do |attribute, type|
- attribute = type.new(self, attribute) if Symbol === attribute
- attribute
+ @attributes ||= begin
+ attrs = @attribute_names_and_types.collect do |attribute, type|
+ attribute = type.new(self, attribute) if Symbol === attribute
+ attribute
+ end
+ Header.new(attrs)
end
end