diff --git a/app/controllers/api/shops_controller.rb b/app/controllers/api/shops_controller.rb index b41fe03d..108c4104 100644 --- a/app/controllers/api/shops_controller.rb +++ b/app/controllers/api/shops_controller.rb @@ -3,7 +3,7 @@ class Api::ShopsController < Api::ApiController skip_before_action :set_current_tenant_by_subdomain_or_name, only: [:index, :show] def index - @shops = Shop.select('id,logo,name,shop_code,address,phone_no').all + @shops = Shop.select('id, logo, name, shop_code').all end def show @@ -11,6 +11,6 @@ class Api::ShopsController < Api::ApiController end def get_tax_profiles - @inclusive_tax,@exclusive_tax = TaxProfile.calculate_tax("online_order") + @inclusive_tax, @exclusive_tax = TaxProfile.calculate_tax("online_order") end end diff --git a/app/controllers/settings/shops_controller.rb b/app/controllers/settings/shops_controller.rb index 82fd7e06..ae9ef72b 100644 --- a/app/controllers/settings/shops_controller.rb +++ b/app/controllers/settings/shops_controller.rb @@ -57,9 +57,9 @@ class Settings::ShopsController < ApplicationController delete_path = Rails.root.join("public/#{audio_data}") if File.exists?(delete_path) - File.delete(delete_path) - end - end + File.delete(delete_path) + end + end save_path = Rails.root.join("public/#{current_shop.shop_code}_#{a.original_filename}") File.open(save_path, 'wb') do |f| f.write a.read diff --git a/app/models/application_record.rb b/app/models/application_record.rb index a90167f1..c19491c8 100755 --- a/app/models/application_record.rb +++ b/app/models/application_record.rb @@ -5,7 +5,6 @@ class ApplicationRecord < ActiveRecord::Base super return unless subclass.superclass == self - return unless subclass.name != "Shop" return unless subclass.column_names.include? 'shop_code' subclass.class_eval do