From b0bef671e883eb4fba01d0295069e4b52d3328b1 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Sun, 25 Jul 2010 18:15:00 -0700 Subject: the rest of the unfactoring! --- lib/arel/engines/memory/relations/array.rb | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'lib/arel/engines') 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 -- cgit v1.2.3