Commit 582ccde8

mo khan <mo@mokhan.ca>
2015-01-28 05:04:39
collapse conditional logic.
1 parent 1ee34aa
Changed files (1)
app
controllers
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