Browse Source

add page destroy callback

pull/347/head
呱呱呱 2 years ago
parent
commit
5aff334054
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      app/models/page.rb

+ 4
- 0
app/models/page.rb 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)


Loading…
Cancel
Save