Sha256: a146f28d000f1c8458c15b2ca580e26d17988b28e4a3f18a5e4403ea90666ac2

Contents?: true

Size: 649 Bytes

Versions: 19

Compression:

Stored size: 649 Bytes

Contents

require "edition"
require "parted"

class ProgrammeEdition < Edition
  include Parted

  before_save :setup_default_parts, on: :create

  GOVSPEAK_FIELDS = []
  @fields_to_clone = []

  DEFAULT_PARTS = [
    {title: "Overview", slug: "overview"},
    {title: "What you'll get", slug: "what-youll-get"},
    {title: "Eligibility", slug: "eligibility"},
    {title: "How to claim", slug: "how-to-claim"},
    {title: "Further information", slug: "further-information"},
  ]

  def setup_default_parts
    if parts.empty?
      DEFAULT_PARTS.each { |part|
        parts.build(title: part[:title], slug: part[:slug], body: "")
      }
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
govuk_content_models-29.1.2 app/models/programme_edition.rb
govuk_content_models-29.1.1 app/models/programme_edition.rb
govuk_content_models-29.1.0 app/models/programme_edition.rb
govuk_content_models-29.0.1 app/models/programme_edition.rb
govuk_content_models-29.0.0 app/models/programme_edition.rb
govuk_content_models-28.10.0 app/models/programme_edition.rb
govuk_content_models-28.9.0 app/models/programme_edition.rb
govuk_content_models-28.8.0 app/models/programme_edition.rb
govuk_content_models-28.7.1 app/models/programme_edition.rb
govuk_content_models-28.7.0 app/models/programme_edition.rb
govuk_content_models-28.6.2 app/models/programme_edition.rb
govuk_content_models-28.6.1 app/models/programme_edition.rb
govuk_content_models-28.6.0 app/models/programme_edition.rb
govuk_content_models-28.5.0 app/models/programme_edition.rb
govuk_content_models-28.4.0 app/models/programme_edition.rb
govuk_content_models-28.3.0 app/models/programme_edition.rb
govuk_content_models-28.2.0 app/models/programme_edition.rb
govuk_content_models-28.1.0 app/models/programme_edition.rb
govuk_content_models-28.0.1 app/models/programme_edition.rb