Project

General

Profile

« Previous | Next » 

Revision 988a1f4d

Added by Tomáš Strachota almost 11 years ago

  • ID 988a1f4d8ff80f8e3ccde3cf287dd6a5293a3964

fixes #2757 - show model validation errors in production.log

View differences:

app/controllers/api/base_controller.rb
if resource.permission_failed?
deny_access
else
log_resource_errors resource
render_error 'unprocessable_entity', :status => :unprocessable_entity
end
end
......
end
end
def log_resource_errors(resource)
logger.error "Unprocessable entity #{resource.class.name} (id: #{resource.try(:id) || "new"}):\n #{resource.errors.full_messages.join("\n ")}\n"
end
def authorize
auth = Api::Authorization.new self

Also available in: Unified diff