Module: ActiveModelExtensions::ValidationAlertable
- Extended by:
- ActiveModel::Callbacks, ActiveSupport::Concern
- Defined in:
- lib/active_model_extensions/validation_alertable.rb
Instance Method Summary collapse
Instance Method Details
#alerts ⇒ Object
12 13 14 |
# File 'lib/active_model_extensions/validation_alertable.rb', line 12 def alerts @alerts ||= ActiveModel::Errors.new(self) end |
#has_alerts? ⇒ Boolean
16 17 18 19 20 |
# File 'lib/active_model_extensions/validation_alertable.rb', line 16 def has_alerts? clear_alerts valid? alerts.count > 0 end |