Class: Lightrail::Models::Errors::Errors
- Inherits:
-
ActiveModel::Errors
- Object
- ActiveModel::Errors
- Lightrail::Models::Errors::Errors
- Defined in:
- lib/lightrail/models/errors.rb
Instance Method Summary collapse
-
#as_json(options = nil) ⇒ Object
Only show one message per error key.
Instance Method Details
#as_json(options = nil) ⇒ Object
Only show one message per error key.
12 13 14 15 16 17 |
# File 'lib/lightrail/models/errors.rb', line 12 def as_json(=nil) hash = ActiveSupport::OrderedHash.new target = @messages || self target.each_key { |k| hash[k] = target[k][0] } hash end |