module ActiveModelExtensions::ValidationAlertable
Public Instance Methods
alerts()
click to toggle source
# File lib/active_model_extensions/validation_alertable.rb, line 12 def alerts @alerts ||= ActiveModel::Errors.new(self) end
has_alerts?()
click to toggle source
# File lib/active_model_extensions/validation_alertable.rb, line 16 def has_alerts? clear_alerts valid? alerts.count > 0 end
Private Instance Methods
clear_alerts()
click to toggle source
# File lib/active_model_extensions/validation_alertable.rb, line 24 def clear_alerts alerts.clear end