govuk_content_models 28.10.0 → 29.0.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,15 @@
1
+ # CHANGELOG
2
+
3
+ ## 29.0.0
4
+
5
+ - Remove fields from Artefact:
6
+ - `department`
7
+ - `business_proposition`
8
+ - `fact_checkers`
9
+ - Remove fields from Edition:
10
+ - `business_proposition`
11
+ - `department`
12
+
1
13
  ## 28.10.0
2
14
 
3
15
  - Add conversion from LicenceEdition to AnswerEdition in `Edition#build_clone`
@@ -20,11 +20,6 @@ class Artefact
20
20
  :keywords, :legacy_sources, :specialist_sectors, :organisations
21
21
  has_primary_tag_for :section
22
22
 
23
- # NOTE: these fields are deprecated, and soon to be replaced with a
24
- # tag-based implementation
25
- field "department", type: String
26
- field "business_proposition", type: Boolean, default: false
27
-
28
23
  field "name", type: String
29
24
  field "slug", type: String
30
25
  field "paths", type: Array, default: []
@@ -39,7 +34,6 @@ class Artefact
39
34
  field "need_id", type: String
40
35
 
41
36
  field "need_ids", type: Array, default: []
42
- field "fact_checkers", type: String
43
37
  field "publication_id", type: String
44
38
  field "description", type: String
45
39
  field "state", type: String, default: "draft"
@@ -10,7 +10,6 @@ class Edition
10
10
  field :panopticon_id, type: String
11
11
  field :version_number, type: Integer, default: 1
12
12
  field :sibling_in_progress, type: Integer, default: nil
13
- field :business_proposition, type: Boolean, default: false
14
13
 
15
14
  field :title, type: String
16
15
  field :in_beta, type: Boolean, default: false
@@ -18,7 +17,6 @@ class Edition
18
17
  field :publish_at, type: DateTime
19
18
  field :overview, type: String
20
19
  field :slug, type: String
21
- field :department, type: String
22
20
  field :rejected_count, type: Integer, default: 0
23
21
 
24
22
  field :browse_pages, type: Array, default: []
@@ -196,7 +194,6 @@ class Edition
196
194
  :panopticon_id,
197
195
  :overview,
198
196
  :slug,
199
- :department,
200
197
  :browse_pages,
201
198
  :primary_topic,
202
199
  :additional_topics
@@ -242,9 +239,7 @@ class Edition
242
239
  importing_user.create_edition(metadata.kind.to_sym,
243
240
  panopticon_id: metadata.id,
244
241
  slug: metadata.slug,
245
- title: metadata.name,
246
- department: metadata.department,
247
- business_proposition: metadata.business_proposition)
242
+ title: metadata.name)
248
243
  end
249
244
 
250
245
  def self.find_and_identify(slug, edition)
@@ -204,7 +204,7 @@ module Workflow
204
204
  end
205
205
 
206
206
  def disallowable_change?
207
- allowed_to_change = %w(slug publish_at department business_proposition)
207
+ allowed_to_change = %w(slug publish_at)
208
208
  (changes.keys - allowed_to_change).present?
209
209
  end
210
210
  end
@@ -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 = "28.10.0"
3
+ VERSION = "29.0.0"
4
4
  end
@@ -18,7 +18,6 @@ end
18
18
  class ArtefactActionTest < ActiveSupport::TestCase
19
19
 
20
20
  DEFAULTS = {
21
- "business_proposition" => false,
22
21
  "active" => false,
23
22
  "tag_ids" => [],
24
23
  "tags" => [],
@@ -376,7 +376,6 @@ class ArtefactTest < ActiveSupport::TestCase
376
376
  name: "Foo bar",
377
377
  primary_section: "test-section",
378
378
  sections: ["test-section"],
379
- department: "Test dept",
380
379
  owning_app: "publisher",
381
380
  )
382
381
 
@@ -16,7 +16,6 @@ class EditionTest < ActiveSupport::TestCase
16
16
  name: "Foo bar",
17
17
  # primary_section: "test-section",
18
18
  # sections: ["test-section"],
19
- # department: "Test dept",
20
19
  owning_app: "publisher")
21
20
 
22
21
  AnswerEdition.create(state: "ready", slug: "childcare", panopticon_id: artefact.id,
@@ -153,12 +152,10 @@ class EditionTest < ActiveSupport::TestCase
153
152
  state: "published",
154
153
  panopticon_id: @artefact.id,
155
154
  version_number: 1,
156
- department: "Test dept",
157
155
  overview: "I am a test overview")
158
156
  clone_edition = edition.build_clone
159
- assert_equal clone_edition.department, "Test dept"
160
- assert_equal clone_edition.overview, "I am a test overview"
161
- assert_equal clone_edition.version_number, 2
157
+ assert_equal "I am a test overview", clone_edition.overview
158
+ assert_equal 2, clone_edition.version_number
162
159
  end
163
160
 
164
161
  test "cloning can only occur from a published edition" do
@@ -197,7 +194,7 @@ class EditionTest < ActiveSupport::TestCase
197
194
  version_number: 2)
198
195
 
199
196
  clone1 = edition.build_clone
200
- assert_equal clone1.version_number, 3
197
+ assert_equal 3, clone1.version_number
201
198
  end
202
199
 
203
200
  # test cloning into different edition types
@@ -207,19 +204,17 @@ class EditionTest < ActiveSupport::TestCase
207
204
  state: "published",
208
205
  panopticon_id: @artefact.id,
209
206
  version_number: 1,
210
- department: "Test dept",
211
207
  overview: "I am a test overview",
212
208
  video_url: "http://www.youtube.com/watch?v=dQw4w9WgXcQ"
213
209
  )
214
210
  new_edition = edition.build_clone AnswerEdition
215
211
 
216
- assert_equal new_edition.class, AnswerEdition
217
- assert_equal new_edition.version_number, 2
218
- assert_equal new_edition.panopticon_id, @artefact.id.to_s
219
- assert_equal new_edition.state, "draft"
220
- assert_equal new_edition.department, "Test dept"
221
- assert_equal new_edition.overview, "I am a test overview"
222
- assert_equal new_edition.whole_body, edition.whole_body
212
+ assert_equal AnswerEdition, new_edition.class
213
+ assert_equal 2, new_edition.version_number
214
+ assert_equal @artefact.id.to_s, new_edition.panopticon_id
215
+ assert_equal "draft", new_edition.state
216
+ assert_equal "I am a test overview", new_edition.overview
217
+ assert_equal edition.whole_body, new_edition.whole_body
223
218
  end
224
219
 
225
220
  test "Cloning from LicenceEdition into AnswerEdition" do
@@ -228,7 +223,6 @@ class EditionTest < ActiveSupport::TestCase
228
223
  state: "published",
229
224
  panopticon_id: @artefact.id,
230
225
  version_number: 1,
231
- department: "Test dept",
232
226
  licence_overview: "I am a test overview",
233
227
  licence_identifier: "Test identifier",
234
228
  licence_short_description: "I am a test short description",
@@ -241,7 +235,6 @@ class EditionTest < ActiveSupport::TestCase
241
235
  assert_equal 2, new_edition.version_number
242
236
  assert_equal @artefact.id.to_s, new_edition.panopticon_id
243
237
  assert_equal "draft", new_edition.state
244
- assert_equal "Test dept", new_edition.department
245
238
  assert_equal "I am a test overview", new_edition.overview
246
239
  assert_equal edition.whole_body, new_edition.body
247
240
  end
@@ -252,18 +245,16 @@ class EditionTest < ActiveSupport::TestCase
252
245
  state: "published",
253
246
  panopticon_id: @artefact.id,
254
247
  version_number: 1,
255
- department: "Test dept",
256
248
  overview: "I am a test overview"
257
249
  )
258
250
  new_edition = edition.build_clone AnswerEdition
259
251
 
260
- assert_equal new_edition.class, AnswerEdition
261
- assert_equal new_edition.version_number, 2
262
- assert_equal new_edition.panopticon_id, @artefact.id.to_s
263
- assert_equal new_edition.state, "draft"
264
- assert_equal new_edition.department, "Test dept"
265
- assert_equal new_edition.overview, "I am a test overview"
266
- assert_equal new_edition.whole_body, edition.whole_body
252
+ assert_equal AnswerEdition, new_edition.class
253
+ assert_equal 2, new_edition.version_number
254
+ assert_equal @artefact.id.to_s, new_edition.panopticon_id
255
+ assert_equal "draft", new_edition.state
256
+ assert_equal "I am a test overview", new_edition.overview
257
+ assert_equal edition.whole_body, new_edition.whole_body
267
258
  end
268
259
 
269
260
  test "Cloning from TransactionEdition into AnswerEdition" do
@@ -272,20 +263,18 @@ class EditionTest < ActiveSupport::TestCase
272
263
  state: "published",
273
264
  panopticon_id: @artefact.id,
274
265
  version_number: 1,
275
- department: "Test dept",
276
266
  overview: "I am a test overview",
277
267
  more_information: "More information",
278
268
  alternate_methods: "Alternate methods"
279
269
  )
280
270
  new_edition = edition.build_clone AnswerEdition
281
271
 
282
- assert_equal new_edition.class, AnswerEdition
283
- assert_equal new_edition.version_number, 2
284
- assert_equal new_edition.panopticon_id, @artefact.id.to_s
285
- assert_equal new_edition.state, "draft"
286
- assert_equal new_edition.department, "Test dept"
287
- assert_equal new_edition.overview, "I am a test overview"
288
- assert_equal new_edition.whole_body, edition.whole_body
272
+ assert_equal AnswerEdition, new_edition.class
273
+ assert_equal 2, new_edition.version_number
274
+ assert_equal @artefact.id.to_s, new_edition.panopticon_id
275
+ assert_equal "draft", new_edition.state
276
+ assert_equal "I am a test overview", new_edition.overview
277
+ assert_equal edition.whole_body, new_edition.whole_body
289
278
  end
290
279
 
291
280
  test "Cloning from AnswerEdition into TransactionEdition" do
@@ -294,19 +283,17 @@ class EditionTest < ActiveSupport::TestCase
294
283
  state: "published",
295
284
  panopticon_id: @artefact.id,
296
285
  version_number: 1,
297
- department: "Test dept",
298
286
  overview: "I am a test overview",
299
287
  body: "Test body"
300
288
  )
301
289
  new_edition = edition.build_clone TransactionEdition
302
290
 
303
- assert_equal new_edition.class, TransactionEdition
304
- assert_equal new_edition.version_number, 2
305
- assert_equal new_edition.panopticon_id, @artefact.id.to_s
306
- assert_equal new_edition.state, "draft"
307
- assert_equal new_edition.department, "Test dept"
308
- assert_equal new_edition.overview, "I am a test overview"
309
- assert_equal new_edition.more_information, "Test body"
291
+ assert_equal TransactionEdition, new_edition.class
292
+ assert_equal 2, new_edition.version_number
293
+ assert_equal @artefact.id.to_s, new_edition.panopticon_id
294
+ assert_equal "draft", new_edition.state
295
+ assert_equal "I am a test overview", new_edition.overview
296
+ assert_equal "Test body", new_edition.more_information
310
297
  end
311
298
 
312
299
  test "Cloning from AnswerEdition into SimpleSmartAnswerEdition" do
@@ -315,19 +302,17 @@ class EditionTest < ActiveSupport::TestCase
315
302
  state: "published",
316
303
  panopticon_id: @artefact.id,
317
304
  version_number: 1,
318
- department: "Test dept",
319
305
  overview: "I am a test overview",
320
306
  body: "Test body"
321
307
  )
322
308
  new_edition = edition.build_clone SimpleSmartAnswerEdition
323
309
 
324
- assert_equal new_edition.class, SimpleSmartAnswerEdition
325
- assert_equal new_edition.version_number, 2
326
- assert_equal new_edition.panopticon_id, @artefact.id.to_s
327
- assert_equal new_edition.state, "draft"
328
- assert_equal new_edition.department, "Test dept"
329
- assert_equal new_edition.overview, "I am a test overview"
330
- assert_equal new_edition.body, "Test body"
310
+ assert_equal SimpleSmartAnswerEdition, new_edition.class
311
+ assert_equal 2, new_edition.version_number
312
+ assert_equal @artefact.id.to_s, new_edition.panopticon_id
313
+ assert_equal "draft", new_edition.state
314
+ assert_equal "I am a test overview", new_edition.overview
315
+ assert_equal "Test body", new_edition.body
331
316
  end
332
317
 
333
318
  test "Cloning from GuideEdition into TransactionEdition" do
@@ -336,19 +321,17 @@ class EditionTest < ActiveSupport::TestCase
336
321
  state: "published",
337
322
  panopticon_id: @artefact.id,
338
323
  version_number: 1,
339
- department: "Test dept",
340
324
  overview: "I am a test overview",
341
325
  video_url: "http://www.youtube.com/watch?v=dQw4w9WgXcQ"
342
326
  )
343
327
  new_edition = edition.build_clone TransactionEdition
344
328
 
345
- assert_equal new_edition.class, TransactionEdition
346
- assert_equal new_edition.version_number, 2
347
- assert_equal new_edition.panopticon_id, @artefact.id.to_s
348
- assert_equal new_edition.state, "draft"
349
- assert_equal new_edition.department, "Test dept"
350
- assert_equal new_edition.overview, "I am a test overview"
351
- assert_equal new_edition.more_information, edition.whole_body
329
+ assert_equal TransactionEdition, new_edition.class
330
+ assert_equal 2, new_edition.version_number
331
+ assert_equal @artefact.id.to_s, new_edition.panopticon_id
332
+ assert_equal "draft", new_edition.state
333
+ assert_equal "I am a test overview", new_edition.overview
334
+ assert_equal edition.whole_body, new_edition.more_information
352
335
  end
353
336
 
354
337
  test "Cloning from ProgrammeEdition into TransactionEdition" do
@@ -357,18 +340,16 @@ class EditionTest < ActiveSupport::TestCase
357
340
  state: "published",
358
341
  panopticon_id: @artefact.id,
359
342
  version_number: 1,
360
- department: "Test dept",
361
343
  overview: "I am a test overview",
362
344
  )
363
345
  new_edition = edition.build_clone TransactionEdition
364
346
 
365
- assert_equal new_edition.class, TransactionEdition
366
- assert_equal new_edition.version_number, 2
367
- assert_equal new_edition.panopticon_id, @artefact.id.to_s
368
- assert_equal new_edition.state, "draft"
369
- assert_equal new_edition.department, "Test dept"
370
- assert_equal new_edition.overview, "I am a test overview"
371
- assert_equal new_edition.more_information, edition.whole_body
347
+ assert_equal TransactionEdition, new_edition.class
348
+ assert_equal 2, new_edition.version_number
349
+ assert_equal @artefact.id.to_s, new_edition.panopticon_id
350
+ assert_equal "draft", new_edition.state
351
+ assert_equal "I am a test overview", new_edition.overview
352
+ assert_equal edition.whole_body, new_edition.more_information
372
353
  end
373
354
 
374
355
  test "Cloning from AnswerEdition into GuideEdition" do
@@ -377,17 +358,15 @@ class EditionTest < ActiveSupport::TestCase
377
358
  state: "published",
378
359
  panopticon_id: @artefact.id,
379
360
  version_number: 1,
380
- department: "Test dept",
381
361
  overview: "I am a test overview",
382
362
  )
383
363
  new_edition = edition.build_clone GuideEdition
384
364
 
385
- assert_equal new_edition.class, GuideEdition
386
- assert_equal new_edition.version_number, 2
387
- assert_equal new_edition.panopticon_id, @artefact.id.to_s
388
- assert_equal new_edition.state, "draft"
389
- assert_equal new_edition.department, "Test dept"
390
- assert_equal new_edition.overview, "I am a test overview"
365
+ assert_equal GuideEdition, new_edition.class
366
+ assert_equal 2, new_edition.version_number
367
+ assert_equal @artefact.id.to_s, new_edition.panopticon_id
368
+ assert_equal "draft", new_edition.state
369
+ assert_equal "I am a test overview", new_edition.overview
391
370
  end
392
371
 
393
372
  test "Cloning between types with parts" do
@@ -446,7 +425,6 @@ class EditionTest < ActiveSupport::TestCase
446
425
  slug: "foo-bar",
447
426
  kind: "answer",
448
427
  name: "Foo bar",
449
- department: "Test dept",
450
428
  owning_app: "publisher",
451
429
  )
452
430
  artefact.save!
@@ -459,7 +437,6 @@ class EditionTest < ActiveSupport::TestCase
459
437
  assert_kind_of AnswerEdition, publication
460
438
  assert_equal artefact.name, publication.title
461
439
  assert_equal artefact.id.to_s, publication.panopticon_id.to_s
462
- assert_equal artefact.department, publication.department
463
440
  end
464
441
 
465
442
  test "should not change edition metadata if archived" do
@@ -470,7 +447,6 @@ class EditionTest < ActiveSupport::TestCase
470
447
  name: "Foo bar",
471
448
  primary_section: "test-section",
472
449
  sections: ["test-section"],
473
- department: "Test dept",
474
450
  owning_app: "publisher",
475
451
  )
476
452
 
@@ -907,7 +883,6 @@ class EditionTest < ActiveSupport::TestCase
907
883
  name: "Foo bar",
908
884
  primary_section: "test-section",
909
885
  sections: ["test-section"],
910
- department: "Test dept",
911
886
  owning_app: "publisher",
912
887
  )
913
888
 
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: 28.10.0
4
+ version: 29.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-07-15 00:00:00.000000000 Z
12
+ date: 2015-07-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bson_ext
@@ -478,7 +478,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
478
478
  version: '0'
479
479
  segments:
480
480
  - 0
481
- hash: -2559664419333283544
481
+ hash: 3770262996979564918
482
482
  required_rubygems_version: !ruby/object:Gem::Requirement
483
483
  none: false
484
484
  requirements:
@@ -487,7 +487,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
487
487
  version: '0'
488
488
  segments:
489
489
  - 0
490
- hash: -2559664419333283544
490
+ hash: 3770262996979564918
491
491
  requirements: []
492
492
  rubyforge_project:
493
493
  rubygems_version: 1.8.23