Sha256: 3e601c367c4944129d4a22f0ccee9cff545d3cd53d70949b8a43777d117b8b29

Contents?: true

Size: 793 Bytes

Versions: 30

Compression:

Stored size: 793 Bytes

Contents

require "safe_html"

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

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

  embedded_in :artefact

  # 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

30 entries across 30 versions & 1 rubygems

Version Path
govuk_content_models-32.2.0 app/models/artefact_action.rb
govuk_content_models-32.1.0 app/models/artefact_action.rb
govuk_content_models-32.0.0 app/models/artefact_action.rb
govuk_content_models-31.4.0 app/models/artefact_action.rb
govuk_content_models-31.3.0 app/models/artefact_action.rb
govuk_content_models-31.2.2 app/models/artefact_action.rb
govuk_content_models-31.2.1 app/models/artefact_action.rb
govuk_content_models-31.2.0 app/models/artefact_action.rb
govuk_content_models-31.1.0 app/models/artefact_action.rb
govuk_content_models-31.0.0 app/models/artefact_action.rb
govuk_content_models-30.0.0 app/models/artefact_action.rb
govuk_content_models-29.1.2 app/models/artefact_action.rb
govuk_content_models-29.1.1 app/models/artefact_action.rb
govuk_content_models-29.1.0 app/models/artefact_action.rb
govuk_content_models-29.0.1 app/models/artefact_action.rb
govuk_content_models-29.0.0 app/models/artefact_action.rb
govuk_content_models-28.10.0 app/models/artefact_action.rb
govuk_content_models-28.9.0 app/models/artefact_action.rb
govuk_content_models-28.8.0 app/models/artefact_action.rb
govuk_content_models-28.7.1 app/models/artefact_action.rb