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: e7d041ab065c1bf76d5821f53c555f1a2613c346
4
- data.tar.gz: d80356d958759a8ede9f4edaf56f69bc5eebd182
3
+ metadata.gz: 8bceb161a57c46e4dfe0e6a6885551507ccc7711
4
+ data.tar.gz: 27e9454b3c119a965a412b5e0324819b39640215
5
5
  SHA512:
6
- metadata.gz: 142b5125281e09a757aca7fc7368b2d4ee85db85dfb2f62e53486f2fd23da10f50f45be2d20aea0b77e55d30170a6ea701ded1aed4dbdfd8467c2a5969af7ad4
7
- data.tar.gz: 6e8824481312c213980ba2264f59b0ec3e59a0e78183dd767e16d01534a40a1659c86a1031cf9a23589ab15b35baf7c21a4b2603895c517cf6a483efe5337a47
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, validator will forced automatically.
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] =~ /changed\?/
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,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ClientSideValidations
4
- VERSION = '9.3.3'.freeze
4
+ VERSION = '9.3.4'.freeze
5
5
  end
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*!
3
- * Client Side Validations - v9.3.3 (https://github.com/DavyJonesLocker/client_side_validations)
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.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-06-01 00:00:00.000000000 Z
12
+ date: 2017-07-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails