Module: Interactor::Validation::Validators::Presence
- Defined in:
- lib/interactor/validation/validators/presence.rb
Instance Method Summary collapse
Instance Method Details
#validate_presence(param, value, rule) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/interactor/validation/validators/presence.rb', line 7 def validate_presence(param, value, rule) return if value.present? || value == false msg = rule.is_a?(::Hash) ? rule[:message] : nil errors.add(param, :blank, message: msg || "can't be blank") end |