This commit is contained in:
2026-04-09 23:33:18 +09:00
parent b2d72ffcb0
commit 625507abf6
4 changed files with 83 additions and 61 deletions
+5 -2
View File
@@ -11,9 +11,12 @@ class PostVersion < ApplicationRecord
belongs_to :parent, class_name: 'Post', optional: true
belongs_to :created_by_user, class_name: 'User', optional: true
enum :event_type, create: 'create', update: 'update', discard: 'discard', restore: 'restore'
enum :event_type, { create: 'create',
update: 'update',
discard: 'discard',
restore: 'restore' }, prefix: true, validate: true
validates :version_no, presence: true, numerically: { only_integer: true, greater_than: 0 }
validates :version_no, presence: true, numericality: { only_integer: true, greater_than: 0 }
validates :event_type, presence: true, inclusion: { in: event_types.keys }
validates :url, presence: true