Sha256: f7b56515a00f3a9fc523df01e4e2d718d04cf9f209745bcc517f98ab54342f62

Contents?: true

Size: 844 Bytes

Versions: 99

Compression:

Stored size: 844 Bytes

Contents

require "safe_html"

class ArtefactAction
  include Mongoid::Document
  include Mongoid::Timestamps::Created

  field "action_type", type: String
  field "snapshot", type: Hash

  GOVSPEAK_FIELDS = []

  embedded_in :artefact

  validates_with SafeHtml

  # Ideally we would like to use the UID field here, since that will be the
  # same across all applications, but Mongoid doesn't yet support using a
  # custom primary key on a related field
  belongs_to :user

  # Not validating presence of a user just yet, since there may be some
  # circumstances where we can't reliably determine the user. As an example
  # of this, requests made through the API are not yet tied to a user. If we
  # find out that there are no such circumstances in practice, we can add a
  # validator for :user.
  validates_presence_of :action_type, :snapshot
end

Version data entries

99 entries across 99 versions & 1 rubygems

Version Path
govuk_content_models-28.0.0 app/models/artefact_action.rb
govuk_content_models-27.2.0 app/models/artefact_action.rb
govuk_content_models-27.1.0 app/models/artefact_action.rb
govuk_content_models-27.0.0 app/models/artefact_action.rb
govuk_content_models-26.2.0 app/models/artefact_action.rb
govuk_content_models-26.1.0 app/models/artefact_action.rb
govuk_content_models-26.0.0 app/models/artefact_action.rb
govuk_content_models-25.0.0 app/models/artefact_action.rb
govuk_content_models-24.2.0 app/models/artefact_action.rb
govuk_content_models-24.1.0 app/models/artefact_action.rb
govuk_content_models-24.0.1 app/models/artefact_action.rb
govuk_content_models-24.0.0 app/models/artefact_action.rb
govuk_content_models-23.0.0 app/models/artefact_action.rb
govuk_content_models-22.2.0 app/models/artefact_action.rb
govuk_content_models-22.1.2 app/models/artefact_action.rb
govuk_content_models-22.1.1 app/models/artefact_action.rb
govuk_content_models-22.1.0 app/models/artefact_action.rb
govuk_content_models-22.0.0 app/models/artefact_action.rb
govuk_content_models-21.0.0 app/models/artefact_action.rb
govuk_content_models-20.2.0 app/models/artefact_action.rb