govuk_content_models 13.3.0 → 13.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.md +4 -0
- data/app/models/artefact.rb +4 -2
- data/app/validators/slug_validator.rb +14 -1
- data/lib/govuk_content_models/version.rb +1 -1
- metadata +3 -3
data/CHANGELOG.md
CHANGED
data/app/models/artefact.rb
CHANGED
|
@@ -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" => ["
|
|
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?(
|
|
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
|
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.
|
|
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:
|
|
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:
|
|
480
|
+
hash: -3402198857840524506
|
|
481
481
|
requirements: []
|
|
482
482
|
rubyforge_project:
|
|
483
483
|
rubygems_version: 1.8.23
|