ぼざクリタグ広場 https://hub.nizika.monster
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

22 lines
564 B

  1. class WikiVersionRecorder < VersionRecorder
  2. def self.record! page:, event_type:, reason: nil, created_by_user:
  3. new(page:, event_type:, reason:, created_by_user:).record!
  4. end
  5. def initialize page:, event_type:, reason: nil, created_by_user:
  6. @reason = reason
  7. super(record: page, event_type:, created_by_user:)
  8. end
  9. private
  10. def version_class = WikiVersion
  11. def version_association = :wiki_versions
  12. def record_key = :wiki_page
  13. def snapshot_attributes = {
  14. title: @record.title,
  15. body: @record.body,
  16. reason: @reason }
  17. end