Commit 582ccde8
Changed files (1)
app
controllers
api
app/controllers/api/v1/cakes_controller.rb
@@ -20,11 +20,7 @@ module Api
def update
@cake = current_user.creations.find(params[:id])
current_user.tag(@cake, with: params[:cake][:tags], on: :tags)
- if @cake.update(cake_params.reject { |key, value| key == "tags" })
- @cake
- else
- @cake
- end
+ @cake.update!(cake_params.reject { |key, value| key == "tags" })
end
def destroy