diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/arel/engines/sql/relations/table.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/arel/engines/sql/relations/table.rb b/lib/arel/engines/sql/relations/table.rb index f56fd7d813..8266897098 100644 --- a/lib/arel/engines/sql/relations/table.rb +++ b/lib/arel/engines/sql/relations/table.rb @@ -13,6 +13,8 @@ module Arel end attr_reader :name, :engine, :table_alias, :options, :christener + attr_reader :table_exists + alias :table_exists? :table_exists def initialize(name, options = {}) @name = name.to_s @@ -45,6 +47,8 @@ module Arel end @@tables ||= engine.connection.tables + @table_exists = @@tables.include?(name) || + @engine.connection.table_exists?(name) end end @@ -52,10 +56,6 @@ module Arel Table.new(name, options.merge(:as => table_alias)) end - def table_exists? - @table_exists ||= @@tables.include?(name) || engine.connection.table_exists?(name) - end - def attributes return @attributes if defined?(@attributes) if table_exists? |