Skip to content

Commit

Permalink
minor rewriting
Browse files Browse the repository at this point in the history
  • Loading branch information
yannlugrin committed Mar 7, 2012
1 parent 7042591 commit 2a6165c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/controllers/timer_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2a6165c

Please sign in to comment.