govuk_content_models 16.1.0 → 16.1.1

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
+ ## 16.1.1
2
+
3
+ * Make Tag#parent return the tag's parent even if it is draft.
4
+
1
5
  ## 16.1.0
2
6
 
3
7
  * Add new format for international_development_fund for an Artefact
data/app/models/tag.rb CHANGED
@@ -63,7 +63,7 @@ class Tag
63
63
  end
64
64
 
65
65
  def parent
66
- Tag.by_tag_id(parent_id, self.tag_type) if has_parent?
66
+ Tag.by_tag_id(parent_id, type: self.tag_type, draft: true) if has_parent?
67
67
  end
68
68
 
69
69
  def unique_title
@@ -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 = "16.1.0"
3
+ VERSION = "16.1.1"
4
4
  end
@@ -128,6 +128,13 @@ class TagTest < ActiveSupport::TestCase
128
128
  assert_includes Tag.validators.map(&:class), TagIdValidator
129
129
  end
130
130
 
131
+ test "#parent returns the parent even if the parent is draft" do
132
+ parent = FactoryGirl.create(:tag, state: 'draft')
133
+ child = FactoryGirl.create(:tag, state: 'draft', parent_id: parent.tag_id)
134
+
135
+ assert_equal parent, child.parent
136
+ end
137
+
131
138
  context "state" do
132
139
  setup do
133
140
  @atts = { tag_type: 'section', tag_id: 'test', title: 'Test' }
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: 16.1.0
4
+ version: 16.1.1
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-07-24 00:00:00.000000000 Z
12
+ date: 2014-07-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bson_ext
@@ -466,7 +466,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
466
466
  version: '0'
467
467
  segments:
468
468
  - 0
469
- hash: -669024731182328575
469
+ hash: -3793855121358721402
470
470
  required_rubygems_version: !ruby/object:Gem::Requirement
471
471
  none: false
472
472
  requirements:
@@ -475,7 +475,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
475
475
  version: '0'
476
476
  segments:
477
477
  - 0
478
- hash: -669024731182328575
478
+ hash: -3793855121358721402
479
479
  requirements: []
480
480
  rubyforge_project:
481
481
  rubygems_version: 1.8.23