diff options
author | Tarmo Tänav <tarmo@itech.ee> | 2008-05-07 02:08:23 +0300 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2008-05-07 13:01:46 +1200 |
commit | 8877ab5852d9a1133eb9a730ae47dde214bafe55 (patch) | |
tree | b712ec73b9a7f0c76304a6857f40bd7d4d2317e6 /activerecord/lib/active_record/base.rb | |
parent | e520fd5db7cb839b862c03647effee50f9223d98 (diff) | |
download | rails-8877ab5852d9a1133eb9a730ae47dde214bafe55.tar.gz rails-8877ab5852d9a1133eb9a730ae47dde214bafe55.tar.bz2 rails-8877ab5852d9a1133eb9a730ae47dde214bafe55.zip |
Added AbstractAdapter#table_exists? and made AbstractAdapter#table implementation non-optional
Signed-off-by: Michael Koziarski <michael@koziarski.com>
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index ffefc3cef3..12234184c1 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1118,18 +1118,7 @@ module ActiveRecord #:nodoc: # Indicates whether the table associated with this class exists def table_exists? - if connection.respond_to?(:tables) - connection.tables.include? table_name - else - # if the connection adapter hasn't implemented tables, there are two crude tests that can be - # used - see if getting column info raises an error, or if the number of columns returned is zero - begin - reset_column_information - columns.size > 0 - rescue ActiveRecord::StatementInvalid - false - end - end + connection.table_exists?(table_name) end # Returns an array of column objects for the table associated with this class. |