Skip to content
Snippets Groups Projects
Commit fa0bf54f authored by Israel Barreto Sant'Anna's avatar Israel Barreto Sant'Anna
Browse files

Merge branch 'issue/294' into 'master'

SCRUM#294: delete CollectionItems only activate really_destroy

See merge request portalmec/portalmec!479
parents e30809d7 b9e8b224
No related branches found
No related tags found
No related merge requests found
......@@ -95,7 +95,7 @@ class V1::CollectionsController < ApplicationController
# DELETE /v1/collections/1/items
def delete_object
return render nothing: true, status: :unprocessable_entity if extra_params.blank? || extra_params[:items].blank?
@collection.delete_items(extra_params[:items])
@collection.really_delete_items(extra_params[:items])
render json: @collection, status: :ok
end
......
......@@ -131,6 +131,12 @@ class Collection < ApplicationRecord
end
end
def really_delete_items(items)
items.each do |item|
CollectionItem.find(item[:id]).really_destroy!
end
end
## score methods
def user_category
owner.try('user_category')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment