Browse files

Changed message for Model.inspect

(No database connection) sounds not be
able to connect database.

see more #12804
  • Loading branch information...
1 parent 675304b commit 539ce8b68368698315475dcf20d35ad2fdd0f133 @arunagw arunagw committed Nov 9, 2013
Showing with 2 additions and 2 deletions.
  1. +1 −1 activerecord/lib/active_record/core.rb
  2. +1 −1 activerecord/test/cases/invalid_connection_test.rb
View
2 activerecord/lib/active_record/core.rb
@@ -109,7 +109,7 @@ def inspect
elsif abstract_class?
"#{super}(abstract)"
elsif !connected?
- "#{super}(no database connection)"
+ "#{super} (call '#{super}.connection' to establish a connection)"
elsif table_exists?
attr_list = columns.map { |c| "#{c.name}: #{c.type}" } * ', '
"#{super}(#{attr_list})"
View
2 activerecord/test/cases/invalid_connection_test.rb
@@ -17,6 +17,6 @@ def teardown
end
test "inspect on Model class does not raise" do
- assert_equal "#{Bird.name}(no database connection)", Bird.inspect
+ assert_equal "#{Bird.name} (call '#{Bird.name}.connection' to establish a connection)", Bird.inspect
end
end

0 comments on commit 539ce8b

Please sign in to comment.