Permalink
Browse files

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...
1 parent 7d2201d commit 4526e35af89bc8db9d6ba13e4392f3f851a59bb9 @tarmo tarmo committed with NZKoz Sep 26, 2008
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/validations.rb
@@ -428,7 +428,7 @@ def validates_acceptance_of(*attr_names)
db_cols = begin
column_names
- rescue ActiveRecord::StatementInvalid
+ rescue Exception # To ignore both statement and connection errors
[]
end
names = attr_names.reject { |name| db_cols.include?(name.to_s) }

0 comments on commit 4526e35

Please sign in to comment.