From b218ced077025df66155af5e06c7246694fdf00f Mon Sep 17 00:00:00 2001 From: "sylor_huang@126.com" Date: Fri, 17 Apr 2020 17:47:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0laboratory=5Fsetting=5Fid=5Fi?= =?UTF-8?q?ndex?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admins/save_laboratory_setting_service.rb | 11 +---------- .../20200417094626_add_laboratory_setting_id_index.rb | 5 +++++ 2 files changed, 6 insertions(+), 10 deletions(-) create mode 100644 db/migrate/20200417094626_add_laboratory_setting_id_index.rb diff --git a/app/services/admins/save_laboratory_setting_service.rb b/app/services/admins/save_laboratory_setting_service.rb index 7383016f6..c29e374bd 100644 --- a/app/services/admins/save_laboratory_setting_service.rb +++ b/app/services/admins/save_laboratory_setting_service.rb @@ -15,16 +15,7 @@ class Admins::SaveLaboratorySettingService < ApplicationService laboratory_setting.footer = strip params[:footer] laboratory.save! - - begin - unless laboratory_setting.save! - Rails.logger.info("######__ddddd________#######{laboratory_setting.errors.messages}") - end - rescue => e - Rails.logger.info("######__________#######{e}") - end - - + laboratory_setting.save! deal_image_file end diff --git a/db/migrate/20200417094626_add_laboratory_setting_id_index.rb b/db/migrate/20200417094626_add_laboratory_setting_id_index.rb new file mode 100644 index 000000000..142e8924e --- /dev/null +++ b/db/migrate/20200417094626_add_laboratory_setting_id_index.rb @@ -0,0 +1,5 @@ +class AddLaboratorySettingIdIndex < ActiveRecord::Migration[5.2] + def change + execute "ALTER TABLE laboratory_settings ADD PRIMARY KEY (id);" + end +end