Skip to content
This repository
Browse code

minor rewriting

  • Loading branch information...
commit 2a6165c37c62fdb1cc0d9105cfc5c71841a90fbd 1 parent 7042591
Yann Lugrin yannlugrin authored

Showing 1 changed file with 2 additions and 4 deletions. Show diff stats Hide diff stats

  1. +2 4 app/controllers/timer_controller.rb
6 app/controllers/timer_controller.rb
@@ -10,13 +10,11 @@ def index
10 10 end
11 11
12 12 def show
13   - @timer = Timer.where('url_key = ?', params[:id]).first
14   - raise ActiveRecord::RecordNotFound unless @timer
  13 + @timer = Timer.where('url_key = ?', params[:id]).first || raise(ActiveRecord::RecordNotFound)
15 14 end
16 15
17 16 def update
18   - @timer = Timer.where('url_key = ?', params[:id]).first
19   - raise ActiveRecord::RecordNotFound unless @timer
  17 + @timer = Timer.where('url_key = ?', params[:id]).first || raise(ActiveRecord::RecordNotFound)
20 18
21 19 options = params[:timer]
22 20 options[:time] &&= options[:time][:hours].to_i.hours + options[:time][:minutes].to_i.minutes + options[:time][:seconds].to_i.seconds

0 comments on commit 2a6165c

Please sign in to comment.
Something went wrong with that request. Please try again.