client_side_validations 11.1.0 → 11.1.1

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: b77f89ee672faa4271cf1a614822a579e6e04d75892830e52cdac63cf15218f2
4
- data.tar.gz: 92f66d7e69220221bbe2a46b3b0926cd1e56c5ad3b75460fcf273eb44a7e312f
3
+ metadata.gz: 2814c3e8e47cf46a9418974c2cf94a415a5b607cbf77ce794b3aa7fe3d947c44
4
+ data.tar.gz: e0fd3b7974fa316ae2436116e405ad53b415884211bb13ac986bda0dc2be6aa8
5
5
  SHA512:
6
- metadata.gz: cae55380d0420d3a9fce634c42878ef37c33b47bada9a60e0c40dcc3383908854cd6b60e58ae6d87468e32ffb3dadd9b53f8d14a22c7e0adef829e3d32406253
7
- data.tar.gz: 922fb5f338fd08f8caa6124639f65ce5a0c8f765e97273e7a077b232c62830432042b94eaa627273b0731f5a55ca5307d5e10f3072cc168a8d783b9df741ab0e
6
+ metadata.gz: 00c9db5b1d80737509678f76b14cf90238ed1ead0f065f96251c410dda5e359660a84c74f88e7c175869572acdb245e403ac88050453831b678c006a2af85948
7
+ data.tar.gz: d21f2bd80335c5f20f387a3aa2a8cdb9991a76bee16b04d5c1186112b768daf7cb8b68761b970b505fe3a1690d55b980d68f3e1c087357066b6723a797e165e9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 11.1.1 / 2018-03-19
4
+
5
+ * [ENHANCEMENT] Update dependencies
6
+
3
7
  ## 11.1.0 / 2018-02-02
4
8
 
5
9
  * [FEATURE] Rails 5.2 support
data/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2017 Geremia Taglialatela, Brian Cardarella
3
+ Copyright (c) 2018 Geremia Taglialatela, Brian Cardarella
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -407,6 +407,31 @@ ClientSideValidations::Config.disabled_validators = [:presence]
407
407
 
408
408
  Note that the `FormBuilder` will automatically skip building validators that are disabled.
409
409
 
410
+ ## Manual validation ##
411
+
412
+ By default, ClientSideValidations will automatically validate the form.
413
+
414
+ If for some reason you would like to manually validate the form (for example you're working with a multi-step form), you can use the following approach:
415
+
416
+ ```js
417
+ $input = $('#myInputField');
418
+ $form = $input.closest('form');
419
+ validators = $form[0].ClientSideValidations.settings.validators;
420
+
421
+ // Validate a single field
422
+ // It might not work for multiple inputs selected at once by `$input`
423
+ $input.isValid(validators);
424
+
425
+ // Validate the whole form
426
+ $form.isValid(validators);
427
+ ```
428
+
429
+ To manually validate a single field, you may also trigger a focusout event:
430
+
431
+ ```js
432
+ $('#myInputField').trigger('focusout');
433
+ ```
434
+
410
435
  ## Authors ##
411
436
 
412
437
  [Brian Cardarella](https://twitter.com/bcardarella)
@@ -11,8 +11,8 @@ module ClientSideValidations
11
11
  build_client_side_hash(model, attribute, options.dup)
12
12
  end
13
13
 
14
- def copy_conditional_attributes(to, from)
15
- %i[if unless].each { |key| to[key] = from[key] if from[key].present? }
14
+ def copy_conditional_attributes(attribute_to, attribute_from)
15
+ %i[if unless].each { |key| attribute_to[key] = attribute_from[key] if attribute_from[key].present? }
16
16
  end
17
17
 
18
18
  private
@@ -5,7 +5,7 @@ module ClientSideValidations
5
5
  class RailsValidations
6
6
  def self.assets
7
7
  [{
8
- path: File.expand_path('../../../../vendor/assets/javascripts', __FILE__),
8
+ path: File.expand_path('../../../vendor/assets/javascripts', __dir__),
9
9
  file: 'rails.validations.js'
10
10
  }]
11
11
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ClientSideValidations
4
- VERSION = '11.1.0'.freeze
4
+ VERSION = '11.1.1'.freeze
5
5
  end
@@ -6,7 +6,7 @@ module ClientSideValidations
6
6
  module Generators
7
7
  class InstallGenerator < CopyAssetsGenerator
8
8
  def copy_initializer
9
- source_paths << File.expand_path('../../templates/client_side_validations', __FILE__)
9
+ source_paths << File.expand_path('../templates/client_side_validations', __dir__)
10
10
  copy_file 'initializer.rb', 'config/initializers/client_side_validations.rb'
11
11
  end
12
12
 
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*!
3
- * Client Side Validations - v11.1.0 (https://github.com/DavyJonesLocker/client_side_validations)
3
+ * Client Side Validations - v11.1.1 (https://github.com/DavyJonesLocker/client_side_validations)
4
4
  * Copyright (c) 2018 Geremia Taglialatela, Brian Cardarella
5
5
  * Licensed under MIT (http://opensource.org/licenses/mit-license.php)
6
6
  */
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: client_side_validations
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.1.0
4
+ version: 11.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geremia Taglialatela
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-02-03 00:00:00.000000000 Z
12
+ date: 2018-03-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -51,14 +51,14 @@ dependencies:
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '2.1'
54
+ version: '2.2'
55
55
  type: :runtime
56
56
  prerelease: false
57
57
  version_requirements: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '2.1'
61
+ version: '2.2'
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: appraisal
64
64
  requirement: !ruby/object:Gem::Requirement
@@ -93,14 +93,14 @@ dependencies:
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 0.10.0
96
+ version: 0.11.0
97
97
  type: :development
98
98
  prerelease: false
99
99
  version_requirements: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 0.10.0
103
+ version: 0.11.0
104
104
  - !ruby/object:Gem::Dependency
105
105
  name: m
106
106
  requirement: !ruby/object:Gem::Requirement
@@ -163,28 +163,28 @@ dependencies:
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: 0.52.1
166
+ version: 0.53.0
167
167
  type: :development
168
168
  prerelease: false
169
169
  version_requirements: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: 0.52.1
173
+ version: 0.53.0
174
174
  - !ruby/object:Gem::Dependency
175
175
  name: simplecov
176
176
  requirement: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: 0.15.1
180
+ version: 0.16.1
181
181
  type: :development
182
182
  prerelease: false
183
183
  version_requirements: !ruby/object:Gem::Requirement
184
184
  requirements:
185
185
  - - "~>"
186
186
  - !ruby/object:Gem::Version
187
- version: 0.15.1
187
+ version: 0.16.1
188
188
  - !ruby/object:Gem::Dependency
189
189
  name: sqlite3
190
190
  requirement: !ruby/object:Gem::Requirement
@@ -316,7 +316,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
316
316
  version: '0'
317
317
  requirements: []
318
318
  rubyforge_project:
319
- rubygems_version: 2.7.3
319
+ rubygems_version: 2.7.6
320
320
  signing_key:
321
321
  specification_version: 4
322
322
  summary: Client Side Validations