Module: Entangled::Model::InstanceMethods

Includes:
Helpers
Defined in:
lib/entangled/model.rb

Instance Method Summary collapse

Methods included from Helpers

#redis

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(options = {})
  attributes.merge(errors: errors).as_json
end