mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Changed message for Model.inspect
(No database connection) sounds not be able to connect database. see more #12804
This commit is contained in:
parent
675304b478
commit
539ce8b683
2 changed files with 2 additions and 2 deletions
|
@ -109,7 +109,7 @@ module ActiveRecord
|
|||
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})"
|
||||
|
|
|
@ -17,6 +17,6 @@ class TestAdapterWithInvalidConnection < ActiveRecord::TestCase
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue