unpoly-rails 3.2.2 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -143,16 +143,20 @@ module Unpoly
143
143
  # the validation.
144
144
  #
145
145
  # Note that multiple validating form fields may be batched into a single request.
146
- def validate_names
146
+ memoize def validate_names
147
147
  validate_names_from_request
148
148
  end
149
149
 
150
- memoize def validate_name
150
+ def validate_name
151
151
  if validating?
152
- validates_names.first
152
+ validate_names.first
153
153
  end
154
154
  end
155
155
 
156
+ def validate_name?(name)
157
+ !!validate_names&.include?(name.to_s)
158
+ end
159
+
156
160
  ##
157
161
  # Returns whether the current form submission should be
158
162
  # [validated](https://unpoly.com/input-up-validate) (and not be saved to the database).
@@ -4,6 +4,6 @@ module Unpoly
4
4
  # The current version of the unpoly-rails gem.
5
5
  # This version number is also used for releases of the Unpoly
6
6
  # frontend code.
7
- VERSION = '3.2.2'
7
+ VERSION = '3.3.0'
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unpoly-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.2
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henning Koch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-05 00:00:00.000000000 Z
11
+ date: 2023-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties