Sha256: 34cd7ed21bb966cf87074a789cdd7bd56c246953d29cd7ee5fd0316a923aa7ce
Contents?: true
Size: 963 Bytes
Versions: 1
Compression:
Stored size: 963 Bytes
Contents
require "local_service" require "edition" class LocalTransactionEdition < Edition field :lgsl_code, type: Integer field :lgil_override, type: Integer field :introduction, type: String field :more_information, type: String field :need_to_know, type: String GOVSPEAK_FIELDS = Edition::GOVSPEAK_FIELDS + [:introduction, :more_information, :need_to_know] @fields_to_clone = [ :lgsl_code, :introduction, :more_information, :need_to_know ] validate :valid_lgsl_code def valid_lgsl_code if ! self.service errors.add(:lgsl_code, "#{lgsl_code} not recognised") end end def format_name "Local transaction" end def search_format "transaction" end def service LocalService.find_by_lgsl_code(lgsl_code) end def service_provided_by?(snac) authority = LocalAuthority.find_by_snac(snac) authority && authority.provides_service?(lgsl_code) end def whole_body self.introduction end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
govuk_content_models-28.0.0 | app/models/local_transaction_edition.rb |