govuk_content_models 13.3.0 → 13.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 13.4.0
2
+
3
+ * Allow new formats for aaib_report and cma_case for an Artefact
4
+
1
5
  ## 13.3.0
2
6
 
3
7
  * Adds a `state` field to `Tag`.
@@ -82,10 +82,12 @@ class Artefact
82
82
  "smartanswers" => ["smart-answer"],
83
83
  "custom-application" => ["custom-application"], # In this case the owning_app is overriden. eg calendars, licencefinder
84
84
  "travel-advice-publisher" => ["travel-advice"],
85
- "specialist-publisher" => ["manual",
85
+ "specialist-publisher" => ["aaib_report",
86
+ "cma_case",
87
+ "manual",
86
88
  "manual-change-history",
87
89
  "manual-section",
88
- "specialist-document"],
90
+ "specialist-document"], # Deprecated: Leaving in place for legacy reasons. In future use explicit document_type
89
91
  "finder-api" => ["finder"],
90
92
  "whitehall" => ["announcement",
91
93
  "authored_article",
@@ -177,7 +177,7 @@ protected
177
177
 
178
178
  class SpecialistDocumentPageValidator < InstanceValidator
179
179
  def applicable?
180
- of_kind?('specialist-document')
180
+ of_kind?(acceptable_formats)
181
181
  end
182
182
 
183
183
  def validate!
@@ -188,6 +188,19 @@ protected
188
188
  record.errors[attribute] << "must be usable in a URL"
189
189
  end
190
190
  end
191
+
192
+ private
193
+ def acceptable_formats
194
+ Artefact::FORMATS_BY_DEFAULT_OWNING_APP["specialist-publisher"] - unacceptable_formats
195
+ end
196
+
197
+ def unacceptable_formats
198
+ [
199
+ "manual",
200
+ "manual-change-history",
201
+ "manual-section",
202
+ ]
203
+ end
191
204
  end
192
205
 
193
206
  class BrowsePageValidator < InstanceValidator
@@ -1,4 +1,4 @@
1
1
  module GovukContentModels
2
2
  # Changing this causes Jenkins to tag and release the gem into the wild
3
- VERSION = "13.3.0"
3
+ VERSION = "13.4.0"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_content_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 13.3.0
4
+ version: 13.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -468,7 +468,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
468
468
  version: '0'
469
469
  segments:
470
470
  - 0
471
- hash: 199219386487384018
471
+ hash: -3402198857840524506
472
472
  required_rubygems_version: !ruby/object:Gem::Requirement
473
473
  none: false
474
474
  requirements:
@@ -477,7 +477,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
477
477
  version: '0'
478
478
  segments:
479
479
  - 0
480
- hash: 199219386487384018
480
+ hash: -3402198857840524506
481
481
  requirements: []
482
482
  rubyforge_project:
483
483
  rubygems_version: 1.8.23