From 30fb25d3abfc002b85f290587b979d54c35a2e98 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Mon, 22 Mar 2010 16:26:00 -0700 Subject: Switch Arel::Relation to a module. This will allow for classes with Relation extended on them to represent relations themselves (as opposed to their instances being relations). --- lib/arel/engines/memory/relations/array.rb | 4 +++- lib/arel/engines/memory/relations/compound.rb | 2 +- lib/arel/engines/memory/relations/operations.rb | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/arel/engines/memory') diff --git a/lib/arel/engines/memory/relations/array.rb b/lib/arel/engines/memory/relations/array.rb index 577e327b19..6486dcbcc1 100644 --- a/lib/arel/engines/memory/relations/array.rb +++ b/lib/arel/engines/memory/relations/array.rb @@ -1,5 +1,7 @@ module Arel - class Array < Relation + class Array + include Relation + attributes :array, :attribute_names_and_types include Recursion::BaseCase deriving :==, :initialize diff --git a/lib/arel/engines/memory/relations/compound.rb b/lib/arel/engines/memory/relations/compound.rb index 6dda92a6a1..0f3c24f9ec 100644 --- a/lib/arel/engines/memory/relations/compound.rb +++ b/lib/arel/engines/memory/relations/compound.rb @@ -1,5 +1,5 @@ module Arel - class Compound < Relation + class Compound delegate :array, :to => :relation def unoperated_rows diff --git a/lib/arel/engines/memory/relations/operations.rb b/lib/arel/engines/memory/relations/operations.rb index a5082715a1..5d7b7670b6 100644 --- a/lib/arel/engines/memory/relations/operations.rb +++ b/lib/arel/engines/memory/relations/operations.rb @@ -50,7 +50,7 @@ module Arel end end - class Join < Relation + class Join def eval result = [] relation1.call.each do |row1| -- cgit v1.2.3