diff options
| author | mo khan <mo@mokhan.ca> | 2015-01-27 22:04:39 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2015-01-27 22:04:39 -0700 |
| commit | 582ccde8ade413283117a57d57e39880f202b609 (patch) | |
| tree | ffa73d0cc04e7790cd8fc1faed0d8c1d7d007bf9 /app/controllers/api | |
| parent | 1ee34aa1a47b61d4bba126ad436d16bf1a4cd3da (diff) | |
collapse conditional logic.
Diffstat (limited to 'app/controllers/api')
| -rw-r--r-- | app/controllers/api/v1/cakes_controller.rb | 6 |
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 |
