Merge pull request '增加page删除后的回调' (#244) from KingChan/forgeplus:standalone_develop into standalone_develop

This commit is contained in:
KingChan 2023-12-21 15:10:13 +08:00
commit 2f68da74cb
1 changed files with 4 additions and 0 deletions

View File

@ -34,6 +34,10 @@ class Page < ApplicationRecord
PageService.genernate_user(user_id)
end
before_destroy do
PageService.close_site(user_id, identifier)
end
before_save do
if state_changed? && state == false
PageService.close_site(user_id, identifier)