Created
April 8, 2016 17:52
-
-
Save adkron/c41734d970f32441b3b32b218f4ddddb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PasswordFormatValidator < ActiveModel::EachValidator | |
def validate_each(record, attr_name, value) | |
PasswordValidationRules.new(value).errors.each do |error| | |
record.errors.add(attr_name, error) | |
end | |
#if value != record.password_confirmation | |
#record.errors.add(:password_confirmation, I18n.t('views.project.flash_messages.password_does_not_match_confirmation')) | |
#end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment