crown_marketplace_utils 0.1.0.beta.7 → 0.1.0.beta.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab401ec177fe7672eec50c0bd05a41663ac0bd1b163f27ffd1112ac077d70af1
4
- data.tar.gz: ddfdfaa105ff9c5680255d15bf9e2ce7924585c990cbcbd5fba6402c9539a9a9
3
+ metadata.gz: c8ff7350d450cf26c0a9c0e0c5f215c8b0b79768081899bd3bd0abbbf40a3a16
4
+ data.tar.gz: 8d45b24b65f109bafc768b632410914efc7226f55b9e8903d9460780e9c80486
5
5
  SHA512:
6
- metadata.gz: 168c70a445d81be6119155c65715c522de6af4a6ef4e04cd8965f43db7bcb03fa4960ca8144c2d3d6edafe73273c680c99c205a07b1760b67e24d9d367091ed9
7
- data.tar.gz: 8d070853427625e6e191d449cf4165d69573785b66580d29fa7dada93f1c85a49b1431853c3ab7d8a36b72d1f2fd919b208a5ecc9004978114ea694034d745f1
6
+ metadata.gz: f560935447ef4b6171da259337d13843fa46331c37a5d3838695753fe38252b47f3af64dacc9aa4cc59f065296f78f63f595df6d3ea0ec03a1b855848b44ae61
7
+ data.tar.gz: f5430c2deb151ae09a4b6d3f6dad2dbeb2e32f6393d69a31a45f9697567197b2367fbf88487108e1615fa15363d4dd5e2ddaf659c0ff485014d17146e63fcdd6
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- crown_marketplace_utils (0.1.0.beta.7)
4
+ crown_marketplace_utils (0.1.0.beta.8)
5
5
  actionview (>= 6.0)
6
6
 
7
7
  GEM
@@ -50,10 +50,15 @@ module CrownMarketplaceUtils
50
50
  #
51
51
  # @option (see #govuk_error_message)
52
52
  #
53
- # @return (see #govuk_error_message)
53
+ # @return [NilClass, ActiveSupport::SafeBuffer] if the error message is not on the model it will return nil,
54
+ # otherwise the HTML for the GOV.UK Error message
55
+ # which can then be rendered on the page is returned
54
56
 
55
57
  def govuk_error_message_with_model(model, attribute, **govuk_error_message_options)
56
- govuk_error_message(model.errors[attribute].first, attribute, **govuk_error_message_options)
58
+ error_message = model.errors[attribute].first
59
+ return unless error_message
60
+
61
+ govuk_error_message(error_message, attribute, **govuk_error_message_options)
57
62
  end
58
63
  end
59
64
  end
@@ -134,7 +134,7 @@ module CrownMarketplaceUtils
134
134
  govuk_pagination_next_options[:attributes][:class] = "govuk-link govuk-pagination__link #{'pagination--button_as_link' if govuk_pagination_next_options[:form]}".rstrip
135
135
  govuk_pagination_next_options[:attributes][:rel] = 'next'
136
136
 
137
- pagination_next_content = govuk_pagination_next_content(block_is_level, govuk_pagination_next_options)
137
+ pagination_next_content = govuk_pagination_next_content(block_is_level, **govuk_pagination_next_options)
138
138
 
139
139
  tag.div(class: 'govuk-pagination__next') do
140
140
  if govuk_pagination_next_options[:form]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CrownMarketplaceUtils
4
- VERSION = '0.1.0.beta.7'
4
+ VERSION = '0.1.0.beta.8'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crown_marketplace_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.beta.7
4
+ version: 0.1.0.beta.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - tim-s-ccs
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-12 00:00:00.000000000 Z
11
+ date: 2023-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview