Creating and then updating the new override updates the same override instead of creating a duplicate

This commit is contained in:
Rohan Mitchell
2014-12-12 12:06:55 +11:00
parent 31823f2dbd
commit 84b607433c
6 changed files with 56 additions and 3 deletions

View File

@@ -23,7 +23,8 @@ module Admin
vo_set.collection.each { |vo| authorize! :update, vo }
if vo_set.save
render json: {}
# Return saved VOs with IDs
render json: vo_set.collection, each_serializer: Api::Admin::VariantOverrideSerializer
else
if vo_set.errors.present?
render json: { errors: vo_set.errors }, status: 400