From 722ee6982c8d92a0a751de74a254d34962dcff7c Mon Sep 17 00:00:00 2001 From: Ye Min Date: Thu, 28 Dec 2017 09:46:48 +0630 Subject: [PATCH 1/3] Ruby 2.4.1 --- Capfile | 31 +++++++++++++++++++++++++++++++ Gemfile | 2 +- config/deploy.rb | 2 +- config/deploy/production.rb | 2 +- 4 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 Capfile diff --git a/Capfile b/Capfile new file mode 100644 index 00000000..9cfa1807 --- /dev/null +++ b/Capfile @@ -0,0 +1,31 @@ +# Load DSL and set up stages +require "capistrano/setup" + +# Include default deployment tasks +require "capistrano/deploy" + +# Include tasks from other gems included in your Gemfile +# +# For documentation on these, see for example: +# +# https://github.com/capistrano/rvm +# https://github.com/capistrano/rbenv +# https://github.com/capistrano/chruby +# https://github.com/capistrano/bundler +# https://github.com/capistrano/rails +# https://github.com/capistrano/passenger +# +# require "capistrano/rvm" +require "capistrano/rbenv" +# require "capistrano/chruby" +require "capistrano/bundler" +require "capistrano/rails" +require "capistrano/rails/assets" +require "capistrano/rails/migrations" +# require "capistrano/passenger" + +# Load custom tasks from `lib/capistrano/tasks` if you have any defined +Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r } +Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r } +Dir.glob('lib/capistrano/**/*.rb').each { |r| import r } + diff --git a/Gemfile b/Gemfile index de22a68c..0fb5f323 100755 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,5 @@ source 'https://rubygems.org' -ruby '2.4.0' +ruby '2.4.1' git_source(:github) do |repo_name| repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") "https://github.com/#{repo_name}.git" diff --git a/config/deploy.rb b/config/deploy.rb index a2144cd1..82cbb71e 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -1,6 +1,6 @@ lock "3.10.1" -set :application, "sxrestaurant" +set :application, "zsai" set :repo_url, 'git@bitbucket.org:code2lab/sxrestaurant.git' set :deploy_user, 'deploy' diff --git a/config/deploy/production.rb b/config/deploy/production.rb index 9a498da8..7fed1a97 100644 --- a/config/deploy/production.rb +++ b/config/deploy/production.rb @@ -5,5 +5,5 @@ set :full_app_name, "#{fetch(:application)}_#{fetch(:stage)}" server '192.168.1.27', user: 'deploy', roles: %w{web app db}, primary: true set :deploy_to, "/home/#{fetch(:deploy_user)}/apps/#{fetch(:full_app_name)}" -set :rbenv_ruby, '2.4.0' +set :rbenv_ruby, '2.4.1' set :rails_env, :production From 86d7eabfc6527c29512f5878e540c4c5ef69aa05 Mon Sep 17 00:00:00 2001 From: Ye Min Date: Fri, 29 Dec 2017 11:17:36 +0630 Subject: [PATCH 2/3] cap shop.json --- Gemfile.lock | 2 +- config/deploy.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index b7804803..05be67ea 100755 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -336,7 +336,7 @@ DEPENDENCIES whenever RUBY VERSION - ruby 2.4.0p0 + ruby 2.4.1p111 BUNDLED WITH 1.16.1 diff --git a/config/deploy.rb b/config/deploy.rb index 82cbb71e..3020554f 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -12,7 +12,7 @@ set :rbenv_map_bins, %w{rake gem bundle ruby rails} set :keep_releases, 5 -set :linked_files, %w{config/database.yml config/secrets.yml config/puma.rb config/sidekiq.yml} +set :linked_files, %w{config/database.yml config/secrets.yml config/puma.rb config/sidekiq.yml config/shops.json} set :linked_dirs, %w{bin log tmp/puma tmp/pids tmp/cache tmp/sockets vendor/bundle public/system pids sockets} From 30dac06c8a43853f931d506b1a9d1f5b70a7ab15 Mon Sep 17 00:00:00 2001 From: phyusin Date: Fri, 29 Dec 2017 12:02:40 +0630 Subject: [PATCH 3/3] add membership type in customer --- app/controllers/crm/customers_controller.rb | 2 ++ app/controllers/origami/customers_controller.rb | 3 ++- app/views/crm/customers/index.html.erb | 10 ++++++++++ app/views/origami/customers/index.html.erb | 12 +++++++++++- 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/app/controllers/crm/customers_controller.rb b/app/controllers/crm/customers_controller.rb index 51ddc9eb..f917538e 100755 --- a/app/controllers/crm/customers_controller.rb +++ b/app/controllers/crm/customers_controller.rb @@ -37,6 +37,8 @@ class Crm::CustomersController < BaseCrmController @crm_customer = Customer.new @count_customer = Customer.count_customer + @membership_types = Lookup.collection_of("member_group_type") + @taxes = TaxProfile.all.order("order_by asc") @filter = filter diff --git a/app/controllers/origami/customers_controller.rb b/app/controllers/origami/customers_controller.rb index 58f70faa..d84dac92 100755 --- a/app/controllers/origami/customers_controller.rb +++ b/app/controllers/origami/customers_controller.rb @@ -75,7 +75,8 @@ class Origami::CustomersController < BaseOrigamiController # if flash["errors"] # @crm_customer.valid? # end - + @membership_types = Lookup.collection_of("member_group_type") + respond_to do |format| # format.html { render :template => "crm/customers/index" } format.html { render action: "index"} diff --git a/app/views/crm/customers/index.html.erb b/app/views/crm/customers/index.html.erb index 2682f203..d05af387 100755 --- a/app/views/crm/customers/index.html.erb +++ b/app/views/crm/customers/index.html.erb @@ -52,6 +52,7 @@ <%= t("views.right_panel.detail.sr_no") %> <%= t("views.right_panel.detail.name") %> <%= t("views.right_panel.detail.card_no") %> + <%= t("views.right_panel.detail.membership_type") %> <%= t("views.right_panel.detail.contact_no") %> <%= t("views.right_panel.detail.email") %> <%= t("views.right_panel.detail.action") %> @@ -75,6 +76,15 @@ <%= crm_customer.name %> <%= crm_customer.card_no rescue '-' %> + + <% if !@membership_types.nil? %> + <% @membership_types.each do |member_type| %> + <% if member_type[1] == crm_customer.membership_type %> + <%= member_type[0] %> + <% end %> + <% end %> + <% end %> + <%= crm_customer.contact_no %> <%= crm_customer.email %> <%= link_to t("views.btn.show"), crm_customer_path(crm_customer) %> diff --git a/app/views/origami/customers/index.html.erb b/app/views/origami/customers/index.html.erb index 03c73fea..80f90a2d 100755 --- a/app/views/origami/customers/index.html.erb +++ b/app/views/origami/customers/index.html.erb @@ -54,6 +54,7 @@ <%= t("views.right_panel.detail.sr_no") %> <%= t("views.right_panel.detail.name") %> <%= t("views.right_panel.detail.card_no") %> + <%= t("views.right_panel.detail.membership_type") %> <%= t("views.right_panel.detail.contact_no") %> <%= t("views.right_panel.detail.email") %> @@ -76,7 +77,16 @@ <% end %> <%= crm_customer.name %> - <%= crm_customer.company rescue '-' %> + <%= crm_customer.card_no rescue '-' %> + + <% if !@membership_types.nil? %> + <% @membership_types.each do |member_type| %> + <% if member_type[1] == crm_customer.membership_type %> + <%= member_type[0] %> + <% end %> + <% end %> + <% end %> + <%= crm_customer.contact_no %> <%= crm_customer.email %>