govuk_design_system_formbuilder 0.7.3 → 0.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3c247c34794b087d27148758c3f540b38e241afbf42d7a4692b0043bd950518d
4
- data.tar.gz: 8644e39ebe2339b34b41feea5c73f3de67888d4b89dc847a3ba332233cf163b2
3
+ metadata.gz: 710a2a4f81368b3b026823105a426206bf2c6e2cef00ed72a2c14537b06d0268
4
+ data.tar.gz: 53ba16a4fd6b35bc25314aab6e403e544960d4c430861ec4d44ea9d69c3b9eea
5
5
  SHA512:
6
- metadata.gz: 770f26c8ccddb0704b9e7f366cb122bc670ceec87e7e556d8a38dc9a55b1340c92aa6558dddb6224133efed153f72da1c659c0570994c6975e45d730042cd916
7
- data.tar.gz: 498191263c697030b558bf5cfdec236c68ff4f77d66ee0285423489b123e3720e4f83c1eab87f8f124a9c9adf2489cbf524d6d132bc0e1e3701b9b90f80d3a39
6
+ metadata.gz: 429f609f0ba2d9d59a3d979a28cb7fc493339bb9fc98114ec498a8d3c6cce2b7d15c8ac9fba46d479e6ca514c6332af1d0884dfb168075a52442f8595078b3a2
7
+ data.tar.gz: a8d94f36ca911511155093d6fbd3be05a2dfdcf51fe65a9a85e543fdb1eca11e4eaff7f7f291a1b9ce374f0c5243a1ce63538bed35afded7e4c6dc6d67925018
@@ -31,7 +31,7 @@ module GOVUKDesignSystemFormBuilder
31
31
  end
32
32
 
33
33
  def has_errors?
34
- @builder.object.invalid? &&
34
+ @builder.object.errors.any? &&
35
35
  @builder.object.errors.messages.keys.include?(@attribute_name)
36
36
  end
37
37
 
@@ -132,7 +132,7 @@ module GOVUKDesignSystemFormBuilder
132
132
  # @option label weight [String] the weight of the label font, can be +bold+ or +regular+
133
133
  # @param max_words [Integer] adds the GOV.UK max word count
134
134
  # @param max_chars [Integer] adds the GOV.UK max characters count
135
- # @param threshold [Integer] only show the {max_words} and {max_chars} warnings once a threshold (percentage) is reached
135
+ # @param threshold [Integer] only show the +max_words+ and +max_chars+ warnings once a threshold (percentage) is reached
136
136
  # @param rows [Integer] sets the initial number of rows
137
137
  # @option args [Hash] args additional arguments are applied as attributes to the +textarea+ element
138
138
  # @return [ActiveSupport::SafeBuffer] HTML output
@@ -56,7 +56,7 @@ module GOVUKDesignSystemFormBuilder
56
56
  @builder.tag.input(
57
57
  id: date_attribute_descriptor(segment),
58
58
  class: date_input_classes(width),
59
- for: date_attribute_identifier(segment),
59
+ name: date_attribute_identifier(segment),
60
60
  type: 'number',
61
61
  min: min,
62
62
  max: max,
@@ -48,7 +48,7 @@ module GOVUKDesignSystemFormBuilder
48
48
  end
49
49
 
50
50
  def object_has_errors?
51
- @builder.object.invalid?
51
+ @builder.object.errors.any?
52
52
  end
53
53
 
54
54
  def error_summary_attributes
@@ -1,3 +1,3 @@
1
1
  module GOVUKDesignSystemFormBuilder
2
- VERSION = '0.7.3'.freeze
2
+ VERSION = '0.7.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_design_system_formbuilder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.3
4
+ version: 0.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Yates
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-30 00:00:00.000000000 Z
11
+ date: 2019-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails