Method: ActiveModel::Error#message
- Defined in:
- activemodel/lib/active_model/error.rb
#message ⇒ Object
Returns the error message.
error = ActiveModel::Error.new(person, :name, :too_short, count: 5)
error.
# => "is too short (minimum is 5 characters)"
135 136 137 138 139 140 141 142 |
# File 'activemodel/lib/active_model/error.rb', line 135 def case raw_type when Symbol self.class.(attribute, raw_type, @base, .except(*CALLBACKS_OPTIONS)) else raw_type end end |