From eb4309355de75979a671a17ffe52de67fabc4bbe Mon Sep 17 00:00:00 2001 From: Myat Zin Wai Maw Date: Thu, 16 May 2019 12:09:48 +0630 Subject: [PATCH] un comment puma --- app/controllers/crm/customers_controller.rb | 2 +- .../menu_item_attributes_controller.rb | 21 ++++++++++++++++++- app/models/sale_payment.rb | 3 ++- config/puma.rb | 20 +++++++++--------- 4 files changed, 33 insertions(+), 13 deletions(-) diff --git a/app/controllers/crm/customers_controller.rb b/app/controllers/crm/customers_controller.rb index 5979ce21..8133968a 100644 --- a/app/controllers/crm/customers_controller.rb +++ b/app/controllers/crm/customers_controller.rb @@ -17,7 +17,7 @@ class Crm::CustomersController < BaseCrmController @crm_customers = Customer.all else @crm_customers = Customer.search(filter) - paymal_customer = Customer.search_paypar_account_no(filter) + # paymal_customer = Customer.search_paypar_account_no(filter) # search account no from paypar if type == "card" diff --git a/app/controllers/settings/menu_item_attributes_controller.rb b/app/controllers/settings/menu_item_attributes_controller.rb index 8187d2a9..4ac48542 100755 --- a/app/controllers/settings/menu_item_attributes_controller.rb +++ b/app/controllers/settings/menu_item_attributes_controller.rb @@ -55,7 +55,26 @@ class Settings::MenuItemAttributesController < ApplicationController # DELETE /settings/menu_item_attributes/1 # DELETE /settings/menu_item_attributes/1.json def destroy - @settings_menu_item_attribute.destroy + item_attribute_id =@settings_menu_item_attribute.id + item_attribute_id_string=""+item_attribute_id.to_s+"" + if @settings_menu_item_attribute.destroy + menu_items =MenuItem.all + menu_items.each do |item| + if item.item_attributes.include?(item_attribute_id) + item_update =item.item_attributes.reject { |i| i == item_attribute_id } + item.item_code =item.item_code + item.item_attributes =item_update + item.save + end + if item.item_attributes.include?(item_attribute_id_string) + item_update =item.item_attributes.reject { |i| i == item_attribute_id_string } + item.item_code =item.item_code + item.item_attributes =item_update + item.save + end + end + end + # @settings_menu_item_attribute.destroy flash[:notice] = 'Menu item attribute was successfully destroyed.' render :json => {:status=> "Success", :url => settings_menu_item_attributes_path }.to_json # respond_to do |format| diff --git a/app/models/sale_payment.rb b/app/models/sale_payment.rb index 9d418f7b..f3c076ae 100755 --- a/app/models/sale_payment.rb +++ b/app/models/sale_payment.rb @@ -178,7 +178,8 @@ class SalePayment < ApplicationRecord def self.redeem(paypar_url,token,membership_id,received_amount,sale_id) # membership_actions_data = MembershipAction.find_by_membership_type("redeem"); membership_actions_data = PaymentMethodSetting.find_by_payment_method("Redeem") - + puts "This is membership_actions_data" + puts membership_actions_data.to_json if !membership_actions_data.nil? url = paypar_url.to_s + membership_actions_data.gateway_url.to_s diff --git a/config/puma.rb b/config/puma.rb index 6a545bed..fd89392f 100755 --- a/config/puma.rb +++ b/config/puma.rb @@ -1,10 +1,10 @@ -# application_path="#{File.expand_path("../..", __FILE__)}" -# directory application_path -# #environment ENV.fetch("RAILS_ENV") { "production" } -# environment "production" -# pidfile "#{application_path}/tmp/puma/pid" -# state_path "#{application_path}/tmp/puma/state" -# stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log" -# port ENV.fetch("PORT") { 62158 } -# workers 2 -# preload_app! +application_path="#{File.expand_path("../..", __FILE__)}" +directory application_path +#environment ENV.fetch("RAILS_ENV") { "production" } +environment "production" +pidfile "#{application_path}/tmp/puma/pid" +state_path "#{application_path}/tmp/puma/state" +stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log" +port ENV.fetch("PORT") { 62158 } +workers 2 +preload_app!