diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 13de03e6..f1d5f79a 100755 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -17,10 +17,6 @@ class ApplicationController < ActionController::Base flash[:warning] = exception.message redirect_to root_path end - - def shop_detail - @shop = Shop.first - end end diff --git a/app/controllers/base_controller.rb b/app/controllers/base_controller.rb index aad5c676..1bf5b4d4 100755 --- a/app/controllers/base_controller.rb +++ b/app/controllers/base_controller.rb @@ -1,12 +1,5 @@ class BaseController < ActionController::Base layout "installation" protect_from_forgery with: :exception - - helper_method :shop_detail - - #Shop Name in Navbor - def shop_detail - @shop = Shop.first - end end diff --git a/app/controllers/base_crm_controller.rb b/app/controllers/base_crm_controller.rb index 65350605..00b5cf98 100755 --- a/app/controllers/base_crm_controller.rb +++ b/app/controllers/base_crm_controller.rb @@ -7,8 +7,6 @@ class BaseCrmController < ActionController::Base #before_action :check_installation protect_from_forgery with: :exception - helper_method :shop_detail - rescue_from CanCan::AccessDenied do |exception| flash[:warning] = exception.message redirect_to root_path @@ -29,9 +27,4 @@ class BaseCrmController < ActionController::Base redirect_to root_path end end - - #Shop Name in Navbor - def shop_detail - @shop = Shop.first - end end diff --git a/app/controllers/base_inventory_controller.rb b/app/controllers/base_inventory_controller.rb index ebbd32e3..8ee82777 100755 --- a/app/controllers/base_inventory_controller.rb +++ b/app/controllers/base_inventory_controller.rb @@ -7,8 +7,6 @@ class BaseInventoryController < ActionController::Base #before_action :check_installation protect_from_forgery with: :exception - helper_method :shop_detail - rescue_from CanCan::AccessDenied do |exception| flash[:warning] = exception.message redirect_to root_path @@ -19,9 +17,4 @@ class BaseInventoryController < ActionController::Base redirect_to root_path end end - - #Shop Name in Navbor - def shop_detail - @shop = Shop.first - end end diff --git a/app/controllers/base_oqs_controller.rb b/app/controllers/base_oqs_controller.rb index 2b621cf1..9b337b69 100755 --- a/app/controllers/base_oqs_controller.rb +++ b/app/controllers/base_oqs_controller.rb @@ -6,8 +6,6 @@ class BaseOqsController < ActionController::Base #before_action :check_installation protect_from_forgery with: :exception - - helper_method :shop_detail rescue_from CanCan::AccessDenied do |exception| flash[:warning] = exception.message @@ -29,9 +27,4 @@ class BaseOqsController < ActionController::Base redirect_to root_path end end - - #Shop Name in Navbor - def shop_detail - @shop = Shop.first - end end diff --git a/app/controllers/base_origami_controller.rb b/app/controllers/base_origami_controller.rb index 61cbac84..dc93b2de 100755 --- a/app/controllers/base_origami_controller.rb +++ b/app/controllers/base_origami_controller.rb @@ -7,7 +7,7 @@ class BaseOrigamiController < ActionController::Base #before_action :check_installation protect_from_forgery with: :exception - helper_method :shop_detail, :current_token + helper_method :current_token rescue_from CanCan::AccessDenied do |exception| flash[:warning] = exception.message @@ -38,11 +38,6 @@ class BaseOrigamiController < ActionController::Base @cashier = Employee.where("role = 'cashier' AND token_session <> ''") end - #Shop Name in Navbor - def shop_detail - @shop = Shop.first - end - #check webview def check_mobile status = false diff --git a/app/controllers/base_report_controller.rb b/app/controllers/base_report_controller.rb index 51c250f8..0875fda5 100755 --- a/app/controllers/base_report_controller.rb +++ b/app/controllers/base_report_controller.rb @@ -1,18 +1,16 @@ class BaseReportController < ActionController::Base include LoginVerification - layout "application" + layout "application" - before_action :check_user + before_action :check_user - #before_action :check_installation - protect_from_forgery with: :exception - - helper_method :shop_detail + #before_action :check_installation + protect_from_forgery with: :exception rescue_from CanCan::AccessDenied do |exception| - flash[:warning] = exception.message - redirect_to root_path - end + flash[:warning] = exception.message + redirect_to root_path + end PERIOD = { "today" => 0, @@ -90,9 +88,4 @@ class BaseReportController < ActionController::Base redirect_to root_path end end - - #Shop Name in Navbor - def shop_detail - @shop = Shop.first - end end diff --git a/app/controllers/base_waiter_controller.rb b/app/controllers/base_waiter_controller.rb index 94d1cd45..580de0f9 100755 --- a/app/controllers/base_waiter_controller.rb +++ b/app/controllers/base_waiter_controller.rb @@ -7,16 +7,9 @@ class BaseWaiterController < ActionController::Base #before_action :check_installation protect_from_forgery with: :exception - helper_method :shop_detail - def check_user if current_user.nil? redirect_to root_path end end - - #Shop Name in Navbor - def shop_detail - @shop = Shop.first - end end diff --git a/app/controllers/concerns/login_verification.rb b/app/controllers/concerns/login_verification.rb index 72d621b3..8eb719cb 100755 --- a/app/controllers/concerns/login_verification.rb +++ b/app/controllers/concerns/login_verification.rb @@ -3,7 +3,7 @@ module LoginVerification included do before_action :authenticate_session_token - helper_method :current_company,:current_shop, :current_login_employee, :current_user, :get_cashier, :order_reservation, :bank_integration + helper_method :current_company,:current_shop, :current_login_employee, :current_user, :get_cashier, :order_reservation, :bank_integration, :shop_detail end #this is base api base controller to need to inherit. @@ -38,6 +38,12 @@ module LoginVerification @cashier = Employee.where("role = 'cashier' AND token_session <> ''") end + + #Shop Name in Navbor + def shop_detail + @shop = Shop.first + end + #check order reservation used def order_reservation order_reserve = Lookup.collection_of('order_reservation') diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index ba1292a2..32344c77 100755 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -4,8 +4,6 @@ class HomeController < ApplicationController before_action :check_user, only: :dashboard - helper_method :shop_detail - # Special check for only dashboard def check_user if current_user.nil? @@ -251,9 +249,4 @@ class HomeController < ApplicationController return from, to, from_time, to_time end - - #Shop Name in Navbor - def shop_detail - @shop = Shop.first - end end diff --git a/app/controllers/install_controller.rb b/app/controllers/install_controller.rb index ccc1bf3e..1ff003db 100755 --- a/app/controllers/install_controller.rb +++ b/app/controllers/install_controller.rb @@ -3,8 +3,6 @@ class InstallController < BaseController skip_before_action :verify_authenticity_token # before_action :check_license - helper_method :shop_detail - def index end @@ -77,9 +75,4 @@ class InstallController < BaseController # return nil # end # end - - #Shop Name in Navbor - def shop_detail - @shop = Shop.first - end end diff --git a/app/controllers/print_settings_controller.rb b/app/controllers/print_settings_controller.rb index dcb670db..db6c8848 100755 --- a/app/controllers/print_settings_controller.rb +++ b/app/controllers/print_settings_controller.rb @@ -2,8 +2,6 @@ class PrintSettingsController < ApplicationController load_and_authorize_resource except: [:create] before_action :set_print_setting, only: [:show, :edit, :update, :destroy] - helper_method :shop_detail - # GET /print_settings # GET /print_settings.json def index @@ -85,9 +83,4 @@ class PrintSettingsController < ApplicationController def print_setting_params params.require(:print_setting).permit(:name, :unique_code, :template, :printer_name, :font,:header_font_size, :item_font_size, :api_settings, :page_width, :page_height, :print_copies,:precision,:delimiter,:heading_space) end - - #Shop Name in Navbor - def shop_detail - @shop = Shop.first - end end diff --git a/app/controllers/sym_control_controller.rb b/app/controllers/sym_control_controller.rb index d2923bf2..f2a39b6f 100644 --- a/app/controllers/sym_control_controller.rb +++ b/app/controllers/sym_control_controller.rb @@ -2,8 +2,6 @@ class SymControlController < BaseController skip_before_action :verify_authenticity_token http_basic_authenticate_with name: "vip", password: "!abcABC01" - helper_method :shop_detail - def run sym_path = File.expand_path("~/symmetric/") check_sym_proc_str = `#{"sudo service SymmetricDS status"}` @@ -44,10 +42,4 @@ class SymControlController < BaseController flash[:notice] = "Not Get!" end end - - #Shop Name in Navbor - def shop_detail - @shop = Shop.first - end - end \ No newline at end of file diff --git a/db/migrate/20180406080240_create_order_reservations.rb b/db/migrate/20180406080240_create_order_reservations.rb index db3cde8e..6a8e386c 100644 --- a/db/migrate/20180406080240_create_order_reservations.rb +++ b/db/migrate/20180406080240_create_order_reservations.rb @@ -23,8 +23,8 @@ class CreateOrderReservations < ActiveRecord::Migration[5.1] t.decimal :grand_total, :precision => 10, :scale => 2, :null => false, :default => 0.00 t.decimal :transaction_fee, :precision => 10, :scale => 2, :null => false, :default => 0.00 t.string :status, :null => false, :default => "new" - t.string :order_remark - t.string :remark + t.longtext :order_remark + t.longtext :remark t.json :action_times t.timestamps end diff --git a/db/migrate/20180406080436_create_deliveries.rb b/db/migrate/20180406080436_create_deliveries.rb index 4c66ada0..d6b56ce6 100644 --- a/db/migrate/20180406080436_create_deliveries.rb +++ b/db/migrate/20180406080436_create_deliveries.rb @@ -5,10 +5,10 @@ class CreateDeliveries < ActiveRecord::Migration[5.1] t.string :provider, :null => false t.string :delivery_type, :null => false t.string :township - t.string :address - t.string :direction_address + t.longtext :address + t.longtext :direction_address t.string :delivery_fee - t.string :remark + t.longtext :remark t.timestamps end end