This commit is contained in:
BoHung Chiu 2022-05-23 13:43:22 +08:00
parent 10f7e57270
commit 379f26c771
1 changed files with 3 additions and 1 deletions

View File

@ -107,7 +107,9 @@ class Bulletin
before_create :set_expire
before_save :check_limit
before_save do
@is_hidden_changed = self.is_hidden_changed?
if @is_hidden_changed.nil? || @is_hidden_changed != true
@is_hidden_changed = self.is_hidden_changed?
end
if self.is_top_changed? && !self.is_top
self.sort_number = nil
end