@@ -491,13 +491,6 class ApplicationController < ActionController::Base | |||
|
491 | 491 | render_error "An error occurred while executing the query and has been logged. Please report this error to your Redmine administrator." |
|
492 | 492 | end |
|
493 | 493 | |
|
494 | # Converts the errors on an ActiveRecord object into a common JSON format | |
|
495 | def object_errors_to_json(object) | |
|
496 | object.errors.collect do |attribute, error| | |
|
497 | { attribute => error } | |
|
498 | end.to_json | |
|
499 | end | |
|
500 | ||
|
501 | 494 | # Renders API response on validation failure |
|
502 | 495 | def render_validation_errors(object) |
|
503 | 496 | options = { :status => :unprocessable_entity, :layout => false } |
General Comments 0
You need to be logged in to leave comments.
Login now