class Rack::MongoidAdapter::Controllers::UpdateController

Private Instance Methods

response_body() click to toggle source
# File lib/rack/mongoid_adapter/controllers/update_controller.rb, line 15
def response_body
  if resource
    attributes = resource.merge(params)
    connection.find(_id: id).update(attributes)
    JSON.pretty_generate(attributes, pretty: true) + "\n"
  else
    response_body_for_not_found
  end
end
response_status() click to toggle source
# File lib/rack/mongoid_adapter/controllers/update_controller.rb, line 7
def response_status
  if resource
    200
  else
    404
  end
end