Module: DespamilatorRails::ActiveRecordValidator
- Defined in:
- lib/despamilator_rails/active_record_validator.rb
Instance Method Summary collapse
- #default_despamilator_detection_response ⇒ Object
- #setup_despamilation_detection_for(attribute) ⇒ Object
Instance Method Details
#default_despamilator_detection_response ⇒ Object
8 9 10 11 12 |
# File 'lib/despamilator_rails/active_record_validator.rb', line 8 def default_despamilator_detection_response lambda { |attribute, value, dspam| errors.add(attribute, "looks like spam") } end |
#setup_despamilation_detection_for(attribute) ⇒ Object
4 5 6 |
# File 'lib/despamilator_rails/active_record_validator.rb', line 4 def setup_despamilation_detection_for attribute validates attribute, :despamilator_active_record => true end |