client_side_validations 9.3.3 → 9.3.4
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bceb161a57c46e4dfe0e6a6885551507ccc7711
|
4
|
+
data.tar.gz: 27e9454b3c119a965a412b5e0324819b39640215
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 297c1c2cded360d5352fff89fb797d180afcbb3ff7b0e2cbeeb3c7e534d9d19a034f2e1150a7511108e6cdabad125715e215de974f0d9685d1aacda260706fa7
|
7
|
+
data.tar.gz: 9160c9702b3c47d26450d49ce408a5e2e2319e6f2ba617b49d7856c0eaaa7094050f00738450a54dfd48fccee60944a49cee281a89235d2dfafad29bb3e7b704
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 9.3.4 / 2017-07-15
|
4
|
+
|
5
|
+
* [BUGFIX] Validate will_save_change_to? conditionals
|
6
|
+
* [ENHANCEMENT] Test against jQuery slim 3.x
|
7
|
+
|
3
8
|
## 9.3.3 / 2017-06-01
|
4
9
|
|
5
10
|
* [BUGFIX] Fix JavaScript confirmation validator ([#706](https://github.com/DavyJonesLocker/client_side_validations/issues/706))
|
data/README.md
CHANGED
@@ -133,7 +133,7 @@ In the above case only the `presence` validator will be passed to the client.
|
|
133
133
|
This is also the case with [other supported conditional validations](http://guides.rubyonrails.org/v4.2.0/active_record_validations.html#conditional-validation) (such as Procs, Arrays or Strings).
|
134
134
|
|
135
135
|
**NOTE:** when `:if` conditional includes a symbol or a string with
|
136
|
-
`changed?` in it
|
136
|
+
`changed?` in it or start with `will_save_change_to`, validator will forced automatically.
|
137
137
|
|
138
138
|
```ruby
|
139
139
|
class Person < ActiveRecord::Base
|
@@ -83,8 +83,12 @@ module ClientSideValidations
|
|
83
83
|
(respond_to?(:new_record?) && validator.options[:on] == (new_record? ? :create : :update)) || validator.options[:on].nil?
|
84
84
|
end
|
85
85
|
|
86
|
+
def will_save_change?(options)
|
87
|
+
options =~ /changed\?/ || options =~ /will_save_change_to/
|
88
|
+
end
|
89
|
+
|
86
90
|
def check_conditionals(attr, validator, force)
|
87
|
-
return true if validator.options[:if] && validator.options[:if]
|
91
|
+
return true if validator.options[:if] && will_save_change?(validator.options[:if])
|
88
92
|
|
89
93
|
result = can_force_validator?(attr, validator, force)
|
90
94
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
|
2
2
|
/*!
|
3
|
-
* Client Side Validations - v9.3.
|
3
|
+
* Client Side Validations - v9.3.4 (https://github.com/DavyJonesLocker/client_side_validations)
|
4
4
|
* Copyright (c) 2017 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: 9.3.
|
4
|
+
version: 9.3.4
|
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: 2017-
|
12
|
+
date: 2017-07-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|