Class: ValidatesDecencyOf::DecencyValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- ValidatesDecencyOf::DecencyValidator
- Defined in:
- lib/validates_decency_of.rb
Instance Method Summary collapse
Instance Method Details
#validate(record) ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/validates_decency_of.rb', line 36 def validate(record) = [:message] || 'is indecent' attributes.each do |name| if ValidatesDecencyOf.indecent? record.send(name) record.errors.add name, end end end |