Permalink
Browse files

minor rewriting

  • Loading branch information...
1 parent 7042591 commit 2a6165c37c62fdb1cc0d9105cfc5c71841a90fbd @yannlugrin yannlugrin committed Mar 7, 2012
Showing with 2 additions and 4 deletions.
  1. +2 −4 app/controllers/timer_controller.rb
View
6 app/controllers/timer_controller.rb
@@ -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

0 comments on commit 2a6165c

Please sign in to comment.