better broadcasting for user

This commit is contained in:
2012-12-01 16:12:04 +01:00
parent a14687d568
commit 926be8ec48
7 changed files with 50 additions and 17 deletions
+2 -4
View File
@@ -213,9 +213,7 @@ class UserController < ApplicationController
respond_to do |format|
format.json do
render json: {list_active: false} and return unless list.present?
list.needs_help = true
list.save
broadcast_supplier(list.supplier_id, 'list_needs_help', id: list.id)
list.needs_help!
render json: list.as_json.merge(list_active: list.active?)
end
end
@@ -299,7 +297,7 @@ class UserController < ApplicationController
if @table.occupied?
render json: {occupied: true}
else
list.move_to_table @table
list.move_to_table! @table
render json: {occupied: false}
end
end