rails/rails — pull request #14975 by BroiSatse (2014-05-04 18:38:43+00:00)
Title: Allow to pass dynamic conditions for has_sacure_password validations

In current implementation developer can only disable has_secure_password validations within class definition with `has_secure_password validations: false`. This is not enough in some cases, as those validations may be dependent on a dynamic state of the model.

This pull request adds an option to pass a hash of options with `has_secure_password validations: options`. All the typical validations options like `if: ` or `unless` are accepted and provides dynamic integration with HSP validation.