diff options
author | Jeremy Kemper <jeremykemper@gmail.com> | 2014-04-01 16:45:15 -0500 |
---|---|---|
committer | Jeremy Kemper <jeremykemper@gmail.com> | 2014-04-01 16:49:52 -0500 |
commit | 9aa7c25c28325f62815b6625bdfcc6dd7565165b (patch) | |
tree | 344e8c2b156e279ac2476f1222dbf40c33e04c55 /activerecord/lib/active_record/errors.rb | |
parent | 5d0a4e0cb6134b86fc2795047aacb335c978e02e (diff) | |
download | rails-9aa7c25c28325f62815b6625bdfcc6dd7565165b.tar.gz rails-9aa7c25c28325f62815b6625bdfcc6dd7565165b.tar.bz2 rails-9aa7c25c28325f62815b6625bdfcc6dd7565165b.zip |
Clarify 'database does not exist' message and implementation.
* Clarify what the situation is and what to do.
* Advise loading schema using `rake db:setup` instead of migrating.
* Use a rescue in the initializer rather than extending the error
message in-place.
* Preserve the original backtrace of other errors by using `raise`
rather than raising again with `raise error`.
References 0ec45cd15d0a2f5aebc75e23d841b6c12f3ba763
Diffstat (limited to 'activerecord/lib/active_record/errors.rb')
-rw-r--r-- | activerecord/lib/active_record/errors.rb | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/activerecord/lib/active_record/errors.rb b/activerecord/lib/active_record/errors.rb index 7f6228131f..71efbb8f93 100644 --- a/activerecord/lib/active_record/errors.rb +++ b/activerecord/lib/active_record/errors.rb @@ -95,15 +95,7 @@ module ActiveRecord end # Raised when a given database does not exist - class NoDatabaseError < ActiveRecordError - def initialize(message) - super extend_message(message) - end - - # can be over written to add additional error information. - def extend_message(message) - message - end + class NoDatabaseError < StatementInvalid end # Raised on attempt to save stale record. Record is stale when it's being saved in another query after |