Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ignore all exceptions for validates_acceptance_of columns fetch so it…
… can run even without a database connection Signed-off-by: Michael Koziarski <michael@koziarski.com>
- Loading branch information
ea609b2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m not sure catching Exception is such a good idea, it might mask all kinds of bugs like syntax errors thrown while executing the column_names method.
Why not just catch the errors thrown by ActiveRecord?
ea609b2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it’s definitely less than ideal, but the problem is the variety of exceptions that get thrown when this thing is missing. There’s one for each of the adapters, and several different ones depending on the ‘backing gem’ i.e. pg vs postgres.
Hopefully for 2.3 we can tidy the boundaries between adapter and driver and make sure that only AR errors are thrown by the Adapters, but right now that line’s too fuzzy and making a far reaching change for this one case didn’t quite seem worth it.