From d51b1a0b9e7218adc8b122a6728a608583462ff6 Mon Sep 17 00:00:00 2001 From: Yan Date: Tue, 4 Jul 2017 18:56:52 +0630 Subject: [PATCH] disable cable and oqs qty can 0 --- app/assets/javascripts/cable.js | 8 +++--- .../channels/order_queue_station.js | 24 +++++++++--------- app/controllers/home_controller.rb | 1 + app/controllers/oqs/edit_controller.rb | 1 + app/models/order_item.rb | 2 +- config/environments/development.rb | 2 +- config/routes.rb | 2 +- dump.rdb | Bin 819 -> 819 bytes lib/tasks/menu_import.rake | 8 +++--- 9 files changed, 25 insertions(+), 23 deletions(-) diff --git a/app/assets/javascripts/cable.js b/app/assets/javascripts/cable.js index 43efe3f2..ce5ac871 100644 --- a/app/assets/javascripts/cable.js +++ b/app/assets/javascripts/cable.js @@ -6,9 +6,9 @@ //= require_tree ./channels // Temp Disable -(function() { - this.App || (this.App = {}); +// (function() { +// this.App || (this.App = {}); - App.cable = ActionCable.createConsumer(); +// App.cable = ActionCable.createConsumer(); -}).call(this); +// }).call(this); diff --git a/app/assets/javascripts/channels/order_queue_station.js b/app/assets/javascripts/channels/order_queue_station.js index 00151e5e..85706bb5 100644 --- a/app/assets/javascripts/channels/order_queue_station.js +++ b/app/assets/javascripts/channels/order_queue_station.js @@ -1,18 +1,18 @@ -App.order_queue_station = App.cable.subscriptions.create("OrderQueueStationChannel", { - connected: function() {}, +// App.order_queue_station = App.cable.subscriptions.create("OrderQueueStationChannel", { +// connected: function() {}, - disconnected: function() {}, +// disconnected: function() {}, - received: function(message) { - alert(message); - }, +// received: function(message) { +// alert(message); +// }, - order: function(message) { - return this.perform('order', { - message: message - }); - } -}); +// order: function(message) { +// return this.perform('order', { +// message: message +// }); +// } +// }); // $(function(){ // $("#submit_order").on('click', function(event) { diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index f2a8676c..f7c0e516 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -34,6 +34,7 @@ class HomeController < ApplicationController if @employee != nil if @employee.role == "administrator" session[:session_token] = @employee.token_session + puts "ADDDDDD" redirect_to dashboard_path elsif @employee.role == "cashier" session[:session_token] = @employee.token_session diff --git a/app/controllers/oqs/edit_controller.rb b/app/controllers/oqs/edit_controller.rb index d2236caa..3c087aa9 100644 --- a/app/controllers/oqs/edit_controller.rb +++ b/app/controllers/oqs/edit_controller.rb @@ -11,6 +11,7 @@ class Oqs::EditController < BaseOqsController remarks = params[:remarks] order_item = OrderItem.find(order_items_id); + order_item.item_order_by = current_user.name order_item.qty = qty_weight order_item.remark = remarks order_item.save diff --git a/app/models/order_item.rb b/app/models/order_item.rb index 109665d0..897a4b1e 100644 --- a/app/models/order_item.rb +++ b/app/models/order_item.rb @@ -9,7 +9,7 @@ class OrderItem < ApplicationRecord #Validation validates_presence_of :item_code, :item_name, :qty - validates :qty, numericality: { :greater_than => 0 } + # validates :qty, numericality: { :greater_than => 0 } validates_associated :order #This Method - handle how items is added into order diff --git a/config/environments/development.rb b/config/environments/development.rb index f5ab7304..4d8fc580 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -53,5 +53,5 @@ Rails.application.configure do config.file_watcher = ActiveSupport::EventedFileUpdateChecker # Set Cable URL - config.action_cable.url = "ws://192.168.1.140:3002/cable" + # config.action_cable.url = "ws://192.168.1.140:3002/cable" end diff --git a/config/routes.rb b/config/routes.rb index 19c35e2b..2b7db5eb 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -6,7 +6,7 @@ Rails.application.routes.draw do mount Sidekiq::Web => '/kiq' # Action Cable Creation - mount ActionCable.server => "/cable" + # mount ActionCable.server => "/cable" #--------- SmartSales Installation ------------# get 'install' => 'install#index' diff --git a/dump.rdb b/dump.rdb index b61a13926d0a53b0ccf2c6172b0eae0f221cd191..c0500eabbfda27fd4f7de246bd2618b7cf5df992 100644 GIT binary patch delta 87 zcmV-d0I2`72D1i`FcC+ITUq)Db#rB8Ep26O!ho=`K|cWuzykbCAdwAS0RR95lRp6# t83Y7kWnpv@F*G?jF*h+WG%+qPIXN{lG&Qrk0d4^bE&rl#s5M;A%V^#X8~*?R delta 87 zcmdnYwwY~$f#8*t=*V9jrNyZ!y1A*jhdKl{I@&YxY-jr8dWeZPmXU#hWwJe^m?R5J rQfgv}kfDjCrJ