From de71b5e19296e2e0fbafb0f561df3a54bb261a4e Mon Sep 17 00:00:00 2001 From: xxq250 Date: Tue, 19 Nov 2024 10:29:50 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20EduSetting=E5=88=A0=E9=99=A4=E6=97=B6?= =?UTF-8?q?=E6=B8=85=E9=99=A4=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/edu_setting.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/edu_setting.rb b/app/models/edu_setting.rb index dcb299d4c..708aa625e 100644 --- a/app/models/edu_setting.rb +++ b/app/models/edu_setting.rb @@ -16,8 +16,8 @@ class EduSetting < ApplicationRecord - after_commit :expire_value_cache - after_destroy :clear_value_cache + after_commit :expire_value_cache, on: [:create, :update] + after_commit :clear_value_cache, on: :destroy scope :by_search, -> (keyword){ where("name LIKE :keyword OR value LIKE :keyword", keyword: "%#{strip_param(keyword)}%") unless strip_param(keyword).blank? }