Skip to content

Commit

Permalink
Ignore all exceptions for validates_acceptance_of columns fetch so it…
Browse files Browse the repository at this point in the history
… can run even without a database connection

Signed-off-by: Michael Koziarski <michael@koziarski.com>
  • Loading branch information
tarmo authored and NZKoz committed Sep 26, 2008
1 parent 7d2201d commit 4526e35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/validations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
Expand Down

0 comments on commit 4526e35

Please sign in to comment.