diff options
author | schneems <richard.schneeman@gmail.com> | 2013-11-11 15:56:09 -0500 |
---|---|---|
committer | schneems <richard.schneeman@gmail.com> | 2013-12-23 10:23:48 -0500 |
commit | 0ec45cd15d0a2f5aebc75e23d841b6c12f3ba763 (patch) | |
tree | e1993de87e010ba4c917c605d8b85fc0fe6bad5a /activerecord/CHANGELOG.md | |
parent | b4d7be95e635da64b99e833a93c345bb4d6f2ba2 (diff) | |
download | rails-0ec45cd15d0a2f5aebc75e23d841b6c12f3ba763.tar.gz rails-0ec45cd15d0a2f5aebc75e23d841b6c12f3ba763.tar.bz2 rails-0ec45cd15d0a2f5aebc75e23d841b6c12f3ba763.zip |
Tell how to Create a Database in Error Message
Currently if you attempt to use a database that does not exist you get an error:
```
PG::ConnectionBad FATAL: database "db_error" does not exist
```
The solution is easy, create and migrate your database however new developers may not know these commands by memory. Instead of requiring the developer to search for a solution, tell them how to fix the problem in the error message:
```
ActiveRecord::NoDatabase: FATAL: database "db_error" does not exist
Run `$ bin/rake db:create db:migrate` to create your database
```
Active Record should not know about `rake db:migrate` so this additional information needs to come from the railtie. Potential alternative implementation suggestions are welcome.
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r-- | activerecord/CHANGELOG.md | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 4e61a33fa1..6d130ab4d6 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,3 +1,10 @@ +* When connecting to a non-existant postgresql database, the error: + `ActiveRecord::NoDatabaseError` will now be raised. When being used with Rails + the error message will include information on how to create a database: + `rake db:create` + + *Richard Schneeman* + * Do not raise `'can not touch on a new record object'` exception on destroying already destroyed `belongs_to` association with `touch: true` option |