Sha256: 6675287c20dc8bd774df2e7febb237344797cbd2aa68736daa0cf6e07c4dff62

Contents?: true

Size: 737 Bytes

Versions: 49

Compression:

Stored size: 737 Bytes

Contents

require "safe_html"
require 'govspeak_smart_quotes_fixer'

class Part
  include Mongoid::Document

  embedded_in :guide_edition
  embedded_in :programme_edition
  embedded_in :business_support_edition

  scope :in_order, order_by(:order, :asc)

  field :order,      type: Integer
  field :title,      type: String
  field :body,       type: String
  field :slug,       type: String
  field :created_at, type: DateTime, default: lambda { Time.zone.now }

  GOVSPEAK_FIELDS = [:body]

  include GovspeakSmartQuotesFixer

  validates_presence_of :title
  validates_presence_of :slug
  validates_exclusion_of :slug, in: ["video"], message: "Can not be video"
  validates_format_of :slug, with: /^[a-z0-9\-]+$/i
  validates_with SafeHtml
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
govuk_content_models-12.0.0 app/models/part.rb
govuk_content_models-11.4.0 app/models/part.rb
govuk_content_models-11.3.0 app/models/part.rb
govuk_content_models-11.2.0 app/models/part.rb
govuk_content_models-11.1.0 app/models/part.rb
govuk_content_models-11.0.1 app/models/part.rb
govuk_content_models-11.0.0 app/models/part.rb
govuk_content_models-10.5.0 app/models/part.rb
govuk_content_models-10.4.2 app/models/part.rb
govuk_content_models-10.4.1 app/models/part.rb
govuk_content_models-10.4.0 app/models/part.rb
govuk_content_models-10.3.0 app/models/part.rb
govuk_content_models-10.2.2 app/models/part.rb
govuk_content_models-10.2.1 app/models/part.rb
govuk_content_models-10.2.0 app/models/part.rb
govuk_content_models-10.1.2 app/models/part.rb
govuk_content_models-10.1.1 app/models/part.rb
govuk_content_models-10.1.0 app/models/part.rb
govuk_content_models-10.0.0 app/models/part.rb
govuk_content_models-9.0.1 app/models/part.rb