diff options
author | Arun Agrawal <arunagw@gmail.com> | 2013-11-09 13:13:15 +0100 |
---|---|---|
committer | Arun Agrawal <arunagw@gmail.com> | 2013-11-09 20:57:09 +0100 |
commit | 539ce8b68368698315475dcf20d35ad2fdd0f133 (patch) | |
tree | 4199548fbd10e5ae01645533a85a83508a690bb6 | |
parent | 675304b478dd36eacd3bac96c9eef96890d4aa91 (diff) | |
download | rails-539ce8b68368698315475dcf20d35ad2fdd0f133.tar.gz rails-539ce8b68368698315475dcf20d35ad2fdd0f133.tar.bz2 rails-539ce8b68368698315475dcf20d35ad2fdd0f133.zip |
Changed message for Model.inspect
(No database connection) sounds not be
able to connect database.
see more #12804
-rw-r--r-- | activerecord/lib/active_record/core.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/invalid_connection_test.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb index d93c26c130..96b5686ae0 100644 --- a/activerecord/lib/active_record/core.rb +++ b/activerecord/lib/active_record/core.rb @@ -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})" diff --git a/activerecord/test/cases/invalid_connection_test.rb b/activerecord/test/cases/invalid_connection_test.rb index f2d8f18ec7..f6774d7ef4 100644 --- a/activerecord/test/cases/invalid_connection_test.rb +++ b/activerecord/test/cases/invalid_connection_test.rb @@ -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 |