diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-03 16:01:36 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-03 16:01:36 -0800 |
commit | 8a5680e4a75eb6ac877c1c9687a99e021cbba74e (patch) | |
tree | ddd395eab62184cd8554828539ff5ed24afe8902 /lib/arel/table.rb | |
parent | 40603729cc1d9a8e636a887446d051390d15fcd8 (diff) | |
download | rails-8a5680e4a75eb6ac877c1c9687a99e021cbba74e.tar.gz rails-8a5680e4a75eb6ac877c1c9687a99e021cbba74e.tar.bz2 rails-8a5680e4a75eb6ac877c1c9687a99e021cbba74e.zip |
declawing connection from the Table class
Diffstat (limited to 'lib/arel/table.rb')
-rw-r--r-- | lib/arel/table.rb | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/arel/table.rb b/lib/arel/table.rb index c2db388fd4..79c9b60945 100644 --- a/lib/arel/table.rb +++ b/lib/arel/table.rb @@ -94,8 +94,8 @@ module Arel def columns if $VERBOSE warn <<-eowarn -(#{caller.first}) Arel::Table#columns is deprecated and will be removed in -Arel 2.2.0 with no replacement. +(#{caller.first}) Arel::Table#columns is deprecated and will be removed in +Arel 2.2.0 with no replacement. PEW PEW PEW!!! eowarn end @columns ||= @@ -124,16 +124,14 @@ Arel 2.2.0 with no replacement. end end - def table_exists? - @table_exists ||= tables.key?(@name) || engine.connection.table_exists?(name) - end - - def tables - self.class.table_cache(@engine) - end - @@table_cache = nil def self.table_cache engine # :nodoc: + if $VERBOSE + warn <<-eowarn +(#{caller.first}) Arel::Table.table_cache is deprecated and will be removed in +Arel 2.2.0 with no replacement. PEW PEW PEW!!! + eowarn + end @@table_cache ||= Hash[engine.connection.tables.map { |x| [x,true] }] end end |