aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/base.rb
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2007-08-06 00:18:50 +0000
committerMichael Koziarski <michael@koziarski.com>2007-08-06 00:18:50 +0000
commitbb94ce92fc1486f7a3d2077e073dd50ce758567d (patch)
treee722204fd88662a3b3dc69180c9027f3930b0f88 /activerecord/lib/active_record/base.rb
parentb59e3d1897fd8701995d9b2dc31b5a4e5c1ebe9d (diff)
downloadrails-bb94ce92fc1486f7a3d2077e073dd50ce758567d.tar.gz
rails-bb94ce92fc1486f7a3d2077e073dd50ce758567d.tar.bz2
rails-bb94ce92fc1486f7a3d2077e073dd50ce758567d.zip
Let inspect on AR classes work when the table doesn't exist. Closes #9194 [tarmo, nzkoz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7278 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rwxr-xr-xactiverecord/lib/active_record/base.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 135d2288bf..1b554b650a 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -912,9 +912,11 @@ module ActiveRecord #:nodoc:
super
elsif abstract_class?
"#{super}(abstract)"
- else
+ elsif table_exists?
attr_list = columns.map { |c| "#{c.name}: #{c.type}" } * ', '
"#{super}(#{attr_list})"
+ else
+ "#{super}(Table doesn't exist)"
end
end