|
|
|
|
@ -3,7 +3,7 @@ class Doctrine::AnnotationsController < ApplicationController
|
|
|
|
|
load_and_authorize_resource :annotation, class: "Annotation", through: :doctrine |
|
|
|
|
|
|
|
|
|
def create |
|
|
|
|
attrs = resource_params.to_unsafe_h |
|
|
|
|
attrs = resource_params.to_unsafe_h.deep_symbolize_keys |
|
|
|
|
document_id = attrs.delete(:document_id) |
|
|
|
|
|
|
|
|
|
@annotation = @doctrine.annotations.new(attrs) |
|
|
|
|
@ -22,7 +22,7 @@ class Doctrine::AnnotationsController < ApplicationController
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def update |
|
|
|
|
attrs = resource_params.to_unsafe_h |
|
|
|
|
attrs = resource_params.to_unsafe_h.deep_symbolize_keys |
|
|
|
|
document_id = attrs.delete(:document_id) |
|
|
|
|
|
|
|
|
|
attrs[:document] = Cdao::Jurisprudence.find(document_id) if document_id.present? |
|
|
|
|
|