summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2015-01-27 22:04:39 -0700
committermo khan <mo@mokhan.ca>2015-01-27 22:04:39 -0700
commit582ccde8ade413283117a57d57e39880f202b609 (patch)
treeffa73d0cc04e7790cd8fc1faed0d8c1d7d007bf9 /app/controllers
parent1ee34aa1a47b61d4bba126ad436d16bf1a4cd3da (diff)
collapse conditional logic.
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/api/v1/cakes_controller.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/app/controllers/api/v1/cakes_controller.rb b/app/controllers/api/v1/cakes_controller.rb
index 9fb422c4..3069eebf 100644
--- a/app/controllers/api/v1/cakes_controller.rb
+++ b/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