diff options
author | Yves Senn <yves.senn@gmail.com> | 2013-12-23 07:28:40 -0800 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2013-12-23 07:28:40 -0800 |
commit | f4f496dfeb8ff1a9e78d12d943235c0a630ff55c (patch) | |
tree | e1993de87e010ba4c917c605d8b85fc0fe6bad5a /activerecord/lib/active_record/railtie.rb | |
parent | b4d7be95e635da64b99e833a93c345bb4d6f2ba2 (diff) | |
parent | 0ec45cd15d0a2f5aebc75e23d841b6c12f3ba763 (diff) | |
download | rails-f4f496dfeb8ff1a9e78d12d943235c0a630ff55c.tar.gz rails-f4f496dfeb8ff1a9e78d12d943235c0a630ff55c.tar.bz2 rails-f4f496dfeb8ff1a9e78d12d943235c0a630ff55c.zip |
Merge pull request #13427 from schneems/schneems/cannot-connect-postgres-error
Tell how to Create a Database in Error Message
Diffstat (limited to 'activerecord/lib/active_record/railtie.rb')
-rw-r--r-- | activerecord/lib/active_record/railtie.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/railtie.rb b/activerecord/lib/active_record/railtie.rb index eef08aea88..ff98c829f4 100644 --- a/activerecord/lib/active_record/railtie.rb +++ b/activerecord/lib/active_record/railtie.rb @@ -122,6 +122,14 @@ module ActiveRecord # and then establishes the connection. initializer "active_record.initialize_database" do |app| ActiveSupport.on_load(:active_record) do + + class ActiveRecord::NoDatabaseError + def extend_message(message) + message << "Run `$ bin/rake db:create db:migrate` to create your database" + message + end + end + self.configurations = app.config.database_configuration || {} establish_connection end |