aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-07-25 18:15:00 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-07-25 18:15:00 -0700
commitb0bef671e883eb4fba01d0295069e4b52d3328b1 (patch)
treee85708115bb9925835b75dd008aa06157ea5b843 /lib
parent3db95ef6a1bc26540d6908ef47b8d44818a8c305 (diff)
downloadrails-b0bef671e883eb4fba01d0295069e4b52d3328b1.tar.gz
rails-b0bef671e883eb4fba01d0295069e4b52d3328b1.tar.bz2
rails-b0bef671e883eb4fba01d0295069e4b52d3328b1.zip
the rest of the unfactoring!
Diffstat (limited to 'lib')
-rw-r--r--lib/arel/engines/memory/relations/array.rb15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/arel/engines/memory/relations/array.rb b/lib/arel/engines/memory/relations/array.rb
index 9f69618186..7f881dd849 100644
--- a/lib/arel/engines/memory/relations/array.rb
+++ b/lib/arel/engines/memory/relations/array.rb
@@ -2,12 +2,21 @@ module Arel
class Array
include Relation
- attributes :array, :attribute_names_and_types
+ attr_reader :array, :attribute_names_and_types
include Recursion::BaseCase
- deriving :==
def initialize(array, attribute_names_and_types)
- @array, @attribute_names_and_types = array, attribute_names_and_types
+ @array = array
+ @attribute_names_and_types = attribute_names_and_types
+ @engine = nil
+ @attributes = nil
+ end
+
+ def == other
+ super ||
+ Array === other &&
+ array == other.array &&
+ attribute_names_and_types == other.attribute_names_and_types
end
def engine