Permalink
Browse files

minor refatoring

  • Loading branch information...
yannlugrin committed Mar 7, 2012
1 parent d5fbb47 commit aabc2f789efda7684fd027485d52b4c02c074425
Showing with 3 additions and 3 deletions.
  1. +3 −3 app/controllers/timer_controller.rb
@@ -24,12 +24,12 @@ def update
if @timer.update_attributes(options, as: :admin)
render nothing: true, status: 200
else
- render nothing: true, status: 500
+ render nothing: true, status: :not_acceptable
end
end
def event
- if publish_timer_action(params[:id], params[:timer])
+ if publish_timer_event(params[:id], params[:timer])
render nothing: true, status: 200
else
render nothing: true, status: :not_acceptable
@@ -45,7 +45,7 @@ def event
# Send event to all registred timer
#
# @return [Boolean] return false if params is invalid
- def publish_timer_action(url_key, timer = {})
+ def publish_timer_event(url_key, timer = {})
if !%(start stop reset).include?(timer[:event]) || (timer[:time] && !timer[:time].is_a?(Hash))
false
else

0 comments on commit aabc2f7

Please sign in to comment.