Class: ProgrammeEdition

Inherits:
Edition show all
Includes:
Parted
Defined in:
app/models/programme_edition.rb

Constant Summary collapse

GOVSPEAK_FIELDS =
[]
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"},
]

Instance Method Summary collapse

Methods included from Parted

#build_clone, included, #order_parts, #whole_body

Methods inherited from Edition

#artefact, #broadcast_action, #build_clone, #can_create_new_edition?, #check_for_archived_artefact, #clone_whole_body_from, #cloning_between_parted_types?, #destroy_artefact, #fields_to_copy, find_and_identify, find_or_create_from_panopticon_data, #first_edition_of_published, #format, #format_name, #get_next_version_number, #has_ever_been_published?, #has_sibling_in_progress?, #has_video?, #history, #in_progress_sibling, #indexable_content, #indexable_content_with_parts, #indexable_content_without_parts, #latest_change_note, #latest_edition?, #latest_major_update, #major_updates_in_series, #meta_data, #previous_published_edition, #previous_siblings, #public_updated_at, #published_edition, #retired_format?, #safe_to_preview?, #series, #siblings, #subsequent_siblings, #update_slug_from_artefact, #was_published

Methods included from Workflow

#can_destroy?, #check_can_delete_and_notify, #denormalise_users!, #error_description, #fact_checked?, #important_note, #in_progress?, #locked_for_edits?, #mark_as_rejected, #notify_siblings_of_new_edition, #perform_event_without_validations, #previous_edition, #status_text

Instance Method Details

#setup_default_partsObject



19
20
21
22
23
24
25
# File 'app/models/programme_edition.rb', line 19

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