Class: ActiveModel::Validations::GatesOfHeavenValidator

Inherits:
EachValidator
  • Object
show all
Defined in:
lib/active_model/validations/gates_of_heaven_validator.rb

Instance Method Summary collapse

Instance Method Details

#validate_each(record, attribute, value) ⇒ Object



6
7
8
9
10
11
# File 'lib/active_model/validations/gates_of_heaven_validator.rb', line 6

def validate_each(record, attribute, value)
  pass = GatesOfHeaven::Doorman.new(record.password)
  if pass.guard.present?
    record.errors.add(:password, pass.guard)
  end
end