Skip to content

Commit

Permalink
Changed message for Model.inspect
Browse files Browse the repository at this point in the history
(No database connection) sounds not be
able to connect database.

see more #12804
  • Loading branch information
arunagw committed Nov 9, 2013
1 parent 675304b commit 539ce8b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/core.rb
Expand Up @@ -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})"
Expand Down
2 changes: 1 addition & 1 deletion activerecord/test/cases/invalid_connection_test.rb
Expand Up @@ -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.