提交 539ce8b6 编写于 作者: A Arun Agrawal

Changed message for Model.inspect

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

see more #12804
上级 675304b4
......@@ -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})"
......
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册