app/models/edition.rb in govuk_content_models-23.0.0 vs app/models/edition.rb in govuk_content_models-24.0.0
- old
+ new
@@ -1,11 +1,13 @@
+require "traits/recordable_actions"
require "workflow"
class Edition
include Mongoid::Document
include Mongoid::Timestamps
include Workflow
+ include RecordableActions
field :panopticon_id, type: String
field :version_number, type: Integer, default: 1
field :sibling_in_progress, type: Integer, default: nil
field :business_proposition, type: Boolean, default: false
@@ -26,10 +28,12 @@
field :assignee, type: String
field :creator, type: String
field :publisher, type: String
field :archiver, type: String
+ field :major_change, type: Boolean, default: false
+ field :change_note, type: String
GOVSPEAK_FIELDS = []
belongs_to :assigned_to, class_name: "User"
@@ -50,9 +54,10 @@
validates :version_number, presence: true, uniqueness: {scope: :panopticon_id}
validates :panopticon_id, presence: true
validates_with SafeHtml
validates_with LinkValidator, on: :update
validates_with TopicValidator, BrowsePageValidator
+ validates_presence_of :change_note, if: :major_change
before_save :check_for_archived_artefact
before_destroy :destroy_artefact
index "assigned_to_id"