diff options
author | Emilio Tagua <miloops@gmail.com> | 2009-04-23 13:01:18 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2009-04-23 13:01:18 -0300 |
commit | 7978b69948c4fe38911932766d45026467f45e52 (patch) | |
tree | fc410bfe209e1abc98ae2f0cf1247f55efb0471a /lib/arel/relations | |
parent | b29268d5b64bbd7383bfcebc6fcc5e97a657885b (diff) | |
download | rails-7978b69948c4fe38911932766d45026467f45e52.tar.gz rails-7978b69948c4fe38911932766d45026467f45e52.tar.bz2 rails-7978b69948c4fe38911932766d45026467f45e52.zip |
Use the engine not the engine.connection, the engine may not even respond to connection
Diffstat (limited to 'lib/arel/relations')
-rw-r--r-- | lib/arel/relations/table.rb | 12 |
1 files changed, 6 insertions, 6 deletions
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 |