Sha256: e000cb549039eaa38dcb690863bd5267e5b0f506ad26ebe83780a6f848734575

Contents?: true

Size: 788 Bytes

Versions: 43

Compression:

Stored size: 788 Bytes

Contents

require "edition"

class TransactionEdition < Edition
  field :introduction, type: String
  field :will_continue_on, type: String
  field :link, type: String
  field :more_information, type: String
  field :need_to_know, type: String
  field :department_analytics_profile, type: String
  field :alternate_methods, type: String

  GOVSPEAK_FIELDS = [:introduction, :more_information, :alternate_methods, :need_to_know]

  validates_format_of :department_analytics_profile, with: /UA-\d+-\d+/i, allow_blank: true

  def indexable_content
    "#{super} #{Govspeak::Document.new(introduction).to_text} #{Govspeak::Document.new(more_information).to_text}".strip
  end

  def whole_body
    [ self.link, self.introduction, self.more_information, self.alternate_methods ].join("\n\n")
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
govuk_content_models-47.0.0 app/models/transaction_edition.rb
govuk_content_models-46.0.1 app/models/transaction_edition.rb
govuk_content_models-46.0.0 app/models/transaction_edition.rb
govuk_content_models-45.0.0 app/models/transaction_edition.rb
govuk_content_models-44.4.0 app/models/transaction_edition.rb
govuk_content_models-44.3.0 app/models/transaction_edition.rb
govuk_content_models-44.2.1 app/models/transaction_edition.rb
govuk_content_models-44.2.0 app/models/transaction_edition.rb
govuk_content_models-44.1.0 app/models/transaction_edition.rb
govuk_content_models-44.0.1 app/models/transaction_edition.rb
govuk_content_models-44.0.0 app/models/transaction_edition.rb
govuk_content_models-43.2.0 app/models/transaction_edition.rb
govuk_content_models-43.1.0 app/models/transaction_edition.rb
govuk_content_models-43.0.1 app/models/transaction_edition.rb
govuk_content_models-43.0.0 app/models/transaction_edition.rb
govuk_content_models-42.1.0 app/models/transaction_edition.rb
govuk_content_models-42.0.1 app/models/transaction_edition.rb
govuk_content_models-42.0.0 app/models/transaction_edition.rb
govuk_content_models-41.1.1 app/models/transaction_edition.rb
govuk_content_models-41.1.0 app/models/transaction_edition.rb