govuk_content_models 26.0.0 → 26.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,6 @@
1
+ ## 26.1.0
2
+ - Adds `review_requested_at` `DateTime` field to `Edition` class.
3
+
1
4
  ## 26.0.0
2
5
 
3
6
  - Removes `Expectation` model and introduces `need_to_know` `String` field on
@@ -31,6 +31,7 @@ class Edition
31
31
  field :archiver, type: String
32
32
  field :major_change, type: Boolean, default: false
33
33
  field :change_note, type: String
34
+ field :review_requested_at, type: DateTime
34
35
 
35
36
  GOVSPEAK_FIELDS = []
36
37
 
@@ -32,6 +32,10 @@ module Workflow
32
32
  edition.was_published
33
33
  end
34
34
 
35
+ before_transition on: :request_review do |edition, transition|
36
+ edition.review_requested_at = Time.zone.now
37
+ end
38
+
35
39
  event :request_review do
36
40
  transition [:draft, :amends_needed] => :in_review
37
41
  end
@@ -86,6 +90,10 @@ module Workflow
86
90
  transition all => :archived, :unless => :archived?
87
91
  end
88
92
 
93
+ state :in_review do
94
+ validates_presence_of :review_requested_at
95
+ end
96
+
89
97
  state :scheduled_for_publishing do
90
98
  validates_presence_of :publish_at
91
99
  validate :publish_at_is_in_the_future
@@ -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 = "26.0.0"
3
+ VERSION = "26.1.0"
4
4
  end
@@ -112,8 +112,10 @@ class WorkflowTest < ActiveSupport::TestCase
112
112
  guide = template_guide
113
113
  user = User.create(name:"Ben")
114
114
  refute guide.in_review?
115
+ refute guide.review_requested_at
115
116
  request_review(user, guide)
116
117
  assert guide.in_review?
118
+ assert_in_delta Time.zone.now.to_f, guide.review_requested_at.to_f, 1.0
117
119
  end
118
120
 
119
121
  test "guide workflow" do
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: 26.0.0
4
+ version: 26.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-12-02 00:00:00.000000000 Z
12
+ date: 2014-12-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bson_ext
@@ -474,7 +474,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
474
474
  version: '0'
475
475
  segments:
476
476
  - 0
477
- hash: -3896108249963512199
477
+ hash: 3310978517269698520
478
478
  required_rubygems_version: !ruby/object:Gem::Requirement
479
479
  none: false
480
480
  requirements:
@@ -483,7 +483,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
483
483
  version: '0'
484
484
  segments:
485
485
  - 0
486
- hash: -3896108249963512199
486
+ hash: 3310978517269698520
487
487
  requirements: []
488
488
  rubyforge_project:
489
489
  rubygems_version: 1.8.23