From 7978b69948c4fe38911932766d45026467f45e52 Mon Sep 17 00:00:00 2001 From: Emilio Tagua Date: Thu, 23 Apr 2009 13:01:18 -0300 Subject: Use the engine not the engine.connection, the engine may not even respond to connection --- lib/arel/relations/table.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/arel/relations') diff --git a/lib/arel/relations/table.rb b/lib/arel/relations/table.rb index 087028fb55..0433abbbb2 100644 --- a/lib/arel/relations/table.rb +++ b/lib/arel/relations/table.rb @@ -3,9 +3,9 @@ module Arel include Recursion::BaseCase cattr_accessor :engine - attr_reader :name, :engine + attr_reader :name, :engine hash_on :name - + def initialize(name, engine = Table.engine) @name, @engine = name.to_s, engine end @@ -19,18 +19,18 @@ module Arel def column_for(attribute) has_attribute?(attribute) and columns.detect { |c| c.name == attribute.name.to_s } end - + def columns @columns ||= engine.columns(name, "#{name} Columns") end - + def reset @attributes = @columns = nil end - + def ==(other) Table === other and name == other.name end end -end \ No newline at end of file +end -- cgit v1.2.3