class Hermod::Validators::NonZero

Checks the value is not zero

Private Instance Methods

message(value, attributes) click to toggle source
# File lib/hermod/validators/non_zero.rb, line 14
def message(value, attributes)
  "cannot be zero"
end
test(value, attributes) click to toggle source
# File lib/hermod/validators/non_zero.rb, line 10
def test(value, attributes)
  value.blank? || value.to_i != 0
end