Skip to content
This repository
Browse code

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...
commit 4526e35af89bc8db9d6ba13e4392f3f851a59bb9 1 parent 7d2201d
Tarmo Tänav tarmo authored NZKoz committed

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  activerecord/lib/active_record/validations.rb
2  activerecord/lib/active_record/validations.rb
@@ -428,7 +428,7 @@ def validates_acceptance_of(*attr_names)
428 428
429 429 db_cols = begin
430 430 column_names
431   - rescue ActiveRecord::StatementInvalid
  431 + rescue Exception # To ignore both statement and connection errors
432 432 []
433 433 end
434 434 names = attr_names.reject { |name| db_cols.include?(name.to_s) }

0 comments on commit 4526e35

Please sign in to comment.
Something went wrong with that request. Please try again.