govuk_content_models 22.0.0 → 22.1.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
+ ## 22.1.0
2
+
3
+ * Add default values for collection associations on Edition
4
+
1
5
  ## 22.0.0
2
6
 
3
7
  * Remove old unused `tags` field from Edition
@@ -21,9 +21,9 @@ class Edition
21
21
  field :rejected_count, type: Integer, default: 0
22
22
  field :important_note, type: String
23
23
 
24
- field :browse_pages, type: Array
24
+ field :browse_pages, type: Array, default: []
25
25
  field :primary_topic, type: String
26
- field :additional_topics, type: Array
26
+ field :additional_topics, type: Array, default: []
27
27
 
28
28
  field :assignee, type: String
29
29
  field :creator, type: String
@@ -251,11 +251,11 @@ class Edition
251
251
  def check_for_archived_artefact
252
252
  if panopticon_id
253
253
  a = Artefact.find(panopticon_id)
254
- if a.state == "archived" and changed_attributes.any?
254
+ if a.state == "archived" and changes.any?
255
255
  # If we're only changing the state to archived, that's ok
256
256
  # Any other changes are not allowed
257
257
  allowed_keys = ["state", "updated_at"]
258
- unless ((changed_attributes.keys - allowed_keys).empty?) and state == "archived"
258
+ unless ((changes.keys - allowed_keys).empty?) and state == "archived"
259
259
  raise "Editing of an edition with an Archived artefact is not allowed"
260
260
  end
261
261
  end
@@ -34,6 +34,7 @@ Gem::Specification.new do |gem|
34
34
  gem.add_development_dependency "webmock", "1.8.7"
35
35
  gem.add_development_dependency "shoulda-context", "1.0.0"
36
36
  gem.add_development_dependency "timecop", "0.5.9.2"
37
+ gem.add_development_dependency "debugger"
37
38
 
38
39
  # The following are added to help bundler resolve dependencies
39
40
  gem.add_development_dependency "rack", "~> 1.4.4"
@@ -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 = "22.0.0"
3
+ VERSION = "22.1.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: 22.0.0
4
+ version: 22.1.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: 2014-10-13 00:00:00.000000000 Z
12
+ date: 2014-10-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bson_ext
@@ -273,6 +273,22 @@ dependencies:
273
273
  - - '='
274
274
  - !ruby/object:Gem::Version
275
275
  version: 0.5.9.2
276
+ - !ruby/object:Gem::Dependency
277
+ name: debugger
278
+ requirement: !ruby/object:Gem::Requirement
279
+ none: false
280
+ requirements:
281
+ - - ! '>='
282
+ - !ruby/object:Gem::Version
283
+ version: '0'
284
+ type: :development
285
+ prerelease: false
286
+ version_requirements: !ruby/object:Gem::Requirement
287
+ none: false
288
+ requirements:
289
+ - - ! '>='
290
+ - !ruby/object:Gem::Version
291
+ version: '0'
276
292
  - !ruby/object:Gem::Dependency
277
293
  name: rack
278
294
  requirement: !ruby/object:Gem::Requirement
@@ -448,7 +464,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
448
464
  version: '0'
449
465
  segments:
450
466
  - 0
451
- hash: 2932545422585521271
467
+ hash: -3250701866585656813
452
468
  required_rubygems_version: !ruby/object:Gem::Requirement
453
469
  none: false
454
470
  requirements:
@@ -457,7 +473,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
457
473
  version: '0'
458
474
  segments:
459
475
  - 0
460
- hash: 2932545422585521271
476
+ hash: -3250701866585656813
461
477
  requirements: []
462
478
  rubyforge_project:
463
479
  rubygems_version: 1.8.23