Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

minor rewriting

  • Loading branch information...
commit 2a6165c37c62fdb1cc0d9105cfc5c71841a90fbd 1 parent 7042591
Yann Lugrin yannlugrin authored
Showing with 2 additions and 4 deletions.
  1. +2 −4 app/controllers/timer_controller.rb
6 app/controllers/timer_controller.rb
View
@@ -10,13 +10,11 @@ def index
end
def show
- @timer = Timer.where('url_key = ?', params[:id]).first
- raise ActiveRecord::RecordNotFound unless @timer
+ @timer = Timer.where('url_key = ?', params[:id]).first || raise(ActiveRecord::RecordNotFound)
end
def update
- @timer = Timer.where('url_key = ?', params[:id]).first
- raise ActiveRecord::RecordNotFound unless @timer
+ @timer = Timer.where('url_key = ?', params[:id]).first || raise(ActiveRecord::RecordNotFound)
options = params[:timer]
options[:time] &&= options[:time][:hours].to_i.hours + options[:time][:minutes].to_i.minutes + options[:time][:seconds].to_i.seconds
Please sign in to comment.
Something went wrong with that request. Please try again.