dribbble/allowed — pull request #2 by pbyrne (2014-09-10 20:00:46+00:00)
Title: Ensure throttle callbacks are always called

This corrects an edge case we discovered in which records created with `find_or_create_by` which failed this validation did not call the failure callbacks. Adding `handle_throttles` to trigger on `after_validation` returns to the logic we had in place before this code was extracted out of our core app and into a gem.

----------

This also corrects a failure in handle_throttles if @_throttle_failures has not been assigned as an array. When occurring within a rollback, this exception was silently discarded. This is not true for other callbacks:

> If any exceptions are raised within [after_commit or after_rollback],
> they will be ignored so that they don’t interfere with the other
> callbacks.

[Rails Guides: Active Record Validations and Callbacks](http://guides.rubyonrails.org/v3.2.18/active_record_validations_callbacks.html#transaction-callbacks)