From 0a223a03f588f78210530eb0892c45ef92984f2f Mon Sep 17 00:00:00 2001 From: Nweni Date: Thu, 1 Jun 2017 13:12:36 +0630 Subject: [PATCH 1/4] remove order_queue_item --- app/models/order_queue_item.rb | 2 -- .../20170531070951_create_order_queue_items.rb | 13 ------------- 2 files changed, 15 deletions(-) delete mode 100644 app/models/order_queue_item.rb delete mode 100644 db/migrate/20170531070951_create_order_queue_items.rb diff --git a/app/models/order_queue_item.rb b/app/models/order_queue_item.rb deleted file mode 100644 index 7f94fbec..00000000 --- a/app/models/order_queue_item.rb +++ /dev/null @@ -1,2 +0,0 @@ -class OrderQueueItem < ApplicationRecord -end diff --git a/db/migrate/20170531070951_create_order_queue_items.rb b/db/migrate/20170531070951_create_order_queue_items.rb deleted file mode 100644 index 1ebc1c94..00000000 --- a/db/migrate/20170531070951_create_order_queue_items.rb +++ /dev/null @@ -1,13 +0,0 @@ -class CreateOrderQueueItems < ActiveRecord::Migration[5.1] - def change - create_table :order_queue_items do |t| - t.string :item_code, :null => false, :index => true - t.references :order_queue_station, foreign_key: true - t.references :order, foreign_key: true - t.boolean :print_status - t.boolean :delivery_status - t.boolean :queue_status - t.timestamps - end - end -end From ad38a0a708abdabbaa7fe59fea17ed8f17347c61 Mon Sep 17 00:00:00 2001 From: Nweni Date: Thu, 1 Jun 2017 17:13:30 +0630 Subject: [PATCH 2/4] gem lock --- Gemfile | 4 ++-- Gemfile.lock | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 08464196..7668adad 100644 --- a/Gemfile +++ b/Gemfile @@ -9,10 +9,10 @@ end # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.1.0' # Use mysql as the database for Active Record -gem 'mysql2', '>= 0.3.18', '< 0.5' +#gem 'mysql2', '>= 0.3.18', '< 0.5' #Use PosgreSQL -#gem 'pg' +gem 'pg' # redis server for cable gem 'redis', '~> 3.0' diff --git a/Gemfile.lock b/Gemfile.lock index 0c3a3a27..24527519 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -114,7 +114,6 @@ GEM mini_portile2 (2.1.0) minitest (5.10.2) multi_json (1.12.1) - mysql2 (0.4.6) nio4r (2.1.0) nokogiri (1.7.2) mini_portile2 (~> 2.1.0) @@ -252,7 +251,6 @@ DEPENDENCIES jquery-rails kaminari! listen (~> 3.0.5) - mysql2 (>= 0.3.18, < 0.5) pg prawn prawn-table From a9259ca845f4802348cf7a3c6f01ed3a0b00184b Mon Sep 17 00:00:00 2001 From: Nweni Date: Fri, 2 Jun 2017 11:30:10 +0630 Subject: [PATCH 3/4] order --- app/controllers/api/orders_controller.rb | 4 ++-- app/models/order.rb | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/controllers/api/orders_controller.rb b/app/controllers/api/orders_controller.rb index 57f2e48c..607a7bef 100644 --- a/app/controllers/api/orders_controller.rb +++ b/app/controllers/api/orders_controller.rb @@ -36,8 +36,8 @@ class Api::OrdersController < Api::ApiController #Create Table Booking or Room Booking if !params["booking_id"].nil? && params[:booking_id].to_i > 0 - @order.new_booking = false - # @order.new_booking = true + #@order.new_booking = false + @order.new_booking = true @order.booking_id = params[:booking_id] end diff --git a/app/models/order.rb b/app/models/order.rb index 3f74284f..4bbe4a28 100644 --- a/app/models/order.rb +++ b/app/models/order.rb @@ -16,6 +16,7 @@ class Order < ApplicationRecord # option_values : [], # sub_order_items : [], # } + def generate booking = nil @@ -200,7 +201,7 @@ class Order < ApplicationRecord #Process order items and send to order queue def process_order_queue - #Send to background job for processing + #Send to background job for processing OrderQueueProcessorJob.perform_later(self.id) end @@ -220,7 +221,7 @@ class Order < ApplicationRecord left join dining_facilities on dining_facilities.id = bookings.dining_facility_id left join order_items on order_items.order_id = orders.id") .where("dining_facilities.type=? and orders.order_type=? and dining_facilities.is_active=?",DiningFacility::TABLE_TYPE,"dine_in",true) - .group("orders.id") + .group("orders.id") end #Origami: Cashier : to view order type Room def self.get_order_rooms From 4dbf52d5a42cb88458bd9927c128ae3b6e8502ea Mon Sep 17 00:00:00 2001 From: Min Zeya Phyo Date: Sat, 3 Jun 2017 12:48:05 +0630 Subject: [PATCH 4/4] remove ignore for gemfile and gemfile.lock, re-add mysql2 --- .gitignore | 4 ++-- Gemfile | 2 +- Gemfile.lock | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index c29faad2..02338531 100644 --- a/.gitignore +++ b/.gitignore @@ -43,5 +43,5 @@ config/deploy/config/* .byebug_history # Gem files -Gemfile -Gemfile.lock \ No newline at end of file +#Gemfile +#Gemfile.lock diff --git a/Gemfile b/Gemfile index 7668adad..29843573 100644 --- a/Gemfile +++ b/Gemfile @@ -9,7 +9,7 @@ end # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.1.0' # Use mysql as the database for Active Record -#gem 'mysql2', '>= 0.3.18', '< 0.5' +gem 'mysql2', '>= 0.3.18', '< 0.5' #Use PosgreSQL gem 'pg' diff --git a/Gemfile.lock b/Gemfile.lock index 24527519..0c3a3a27 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -114,6 +114,7 @@ GEM mini_portile2 (2.1.0) minitest (5.10.2) multi_json (1.12.1) + mysql2 (0.4.6) nio4r (2.1.0) nokogiri (1.7.2) mini_portile2 (~> 2.1.0) @@ -251,6 +252,7 @@ DEPENDENCIES jquery-rails kaminari! listen (~> 3.0.5) + mysql2 (>= 0.3.18, < 0.5) pg prawn prawn-table