Module: Entangled::Model::InstanceMethods
- Includes:
- Helpers
- Defined in:
- lib/entangled/model.rb
Instance Method Summary collapse
-
#as_json(options = {}) ⇒ Object
Override the as_json method so that the JSON representation of the resource includes its errors.
Methods included from Helpers
Instance Method Details
#as_json(options = {}) ⇒ Object
Override the as_json method so that the JSON representation of the resource includes its errors. This is necessary so that errors are sent back to the client along with the resource on create and update
78 79 80 |
# File 'lib/entangled/model.rb', line 78 def as_json( = {}) attributes.merge(errors: errors).as_json end |