client_side_validations 9.2.0 → 9.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/client_side_validations.rb +1 -0
- data/lib/client_side_validations/action_view.rb +1 -0
- data/lib/client_side_validations/action_view/form_builder.rb +3 -2
- data/lib/client_side_validations/action_view/form_helper.rb +1 -0
- data/lib/client_side_validations/active_model.rb +4 -3
- data/lib/client_side_validations/active_model/absence.rb +1 -0
- data/lib/client_side_validations/active_model/acceptance.rb +1 -0
- data/lib/client_side_validations/active_model/conditionals.rb +1 -0
- data/lib/client_side_validations/active_model/exclusion.rb +1 -0
- data/lib/client_side_validations/active_model/format.rb +1 -0
- data/lib/client_side_validations/active_model/inclusion.rb +1 -0
- data/lib/client_side_validations/active_model/length.rb +1 -0
- data/lib/client_side_validations/active_model/numericality.rb +1 -0
- data/lib/client_side_validations/active_model/presence.rb +1 -0
- data/lib/client_side_validations/active_record.rb +2 -1
- data/lib/client_side_validations/active_record/uniqueness.rb +1 -0
- data/lib/client_side_validations/config.rb +1 -0
- data/lib/client_side_validations/core_ext.rb +1 -0
- data/lib/client_side_validations/core_ext/range.rb +1 -0
- data/lib/client_side_validations/core_ext/regexp.rb +1 -0
- data/lib/client_side_validations/engine.rb +1 -0
- data/lib/client_side_validations/extender.rb +1 -0
- data/lib/client_side_validations/files.rb +1 -0
- data/lib/client_side_validations/generators.rb +1 -0
- data/lib/client_side_validations/generators/rails_validations.rb +1 -0
- data/lib/client_side_validations/version.rb +2 -1
- data/lib/generators/client_side_validations/copy_assets_generator.rb +1 -0
- data/lib/generators/client_side_validations/install_generator.rb +1 -0
- data/vendor/assets/javascripts/rails.validations.js +1 -1
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6b77331b3536bcd7e1214fd8e05f8d4dfe91a89
|
4
|
+
data.tar.gz: 75fb4f99e2e07497749b04f3a317d627c139d632
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 156e5c0aca368ed98b822936b0a7f5dee806e486e52665c7f3e3cb6ad810564cd7f3977abb5cad9aea5519b2f928679d5e29592fe1f97a5772b948c71e9a7d68
|
7
|
+
data.tar.gz: 21ac1feb8a8fc5ecae7d04f504e07f1129faa04e487236f9f7a75c77f6a2bb2b278558f9dbabf1bb21d0af9958eb012c3f68008edce9044432133f6312d8104d
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 9.3.0 / 2017-04-24
|
4
|
+
|
5
|
+
* [ENHANCEMENT] Code cleanup
|
6
|
+
* [ENHANCEMENT] Test against Ruby 2.2.7 and 2.3.4, Rails 5.1.0.rc2
|
7
|
+
* [ENHANCEMENT] Update development dependencies
|
8
|
+
|
3
9
|
## 9.2.0 / 2017-03-23
|
4
10
|
|
5
11
|
* [ENHANCEMENT] Use Ruby 2.3's Frozen String Literal Pragma
|
@@ -1,10 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module ClientSideValidations
|
3
4
|
module ActionView
|
4
5
|
module Helpers
|
5
6
|
module FormBuilder
|
6
7
|
def self.prepended(base)
|
7
|
-
(base.field_helpers - %i
|
8
|
+
(base.field_helpers - %i[label check_box radio_button fields_for hidden_field file_field]).each do |selector|
|
8
9
|
base.class_eval <<-RUBY_EVAL
|
9
10
|
def #{selector}(method, options = {})
|
10
11
|
build_validation_options(method, options)
|
@@ -71,7 +72,7 @@ module ClientSideValidations
|
|
71
72
|
super(method, collection, value_method, text_method, options, html_options)
|
72
73
|
end
|
73
74
|
|
74
|
-
%i
|
75
|
+
%i[collection_check_boxes collection_radio_buttons].each do |method_name|
|
75
76
|
define_method method_name do |method, collection, value_method, text_method, options = {}, html_options = {}, &block|
|
76
77
|
build_validation_options(method, html_options.merge(name: options[:name]))
|
77
78
|
html_options.delete(:validate)
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require 'client_side_validations/core_ext'
|
3
4
|
require 'client_side_validations/extender'
|
4
5
|
require 'client_side_validations/active_model/conditionals'
|
@@ -11,13 +12,13 @@ module ClientSideValidations
|
|
11
12
|
end
|
12
13
|
|
13
14
|
def copy_conditional_attributes(to, from)
|
14
|
-
[
|
15
|
+
%i[if unless].each { |key| to[key] = from[key] if from[key].present? }
|
15
16
|
end
|
16
17
|
|
17
18
|
private
|
18
19
|
|
19
20
|
def build_client_side_hash(model, attribute, options)
|
20
|
-
{ message: model.errors.generate_message(attribute, message_type, options) }.merge(options.except(*::ActiveModel::Errors::CALLBACKS_OPTIONS - [
|
21
|
+
{ message: model.errors.generate_message(attribute, message_type, options) }.merge(options.except(*::ActiveModel::Errors::CALLBACKS_OPTIONS - %i[allow_blank if unless]))
|
21
22
|
end
|
22
23
|
|
23
24
|
def message_type
|
@@ -161,4 +162,4 @@ end
|
|
161
162
|
ActiveModel::Validator.send(:include, ClientSideValidations::ActiveModel::Validator)
|
162
163
|
ActiveModel::Validations.send(:include, ClientSideValidations::ActiveModel::Validations)
|
163
164
|
|
164
|
-
ClientSideValidations::Extender.extend 'ActiveModel', %w
|
165
|
+
ClientSideValidations::Extender.extend 'ActiveModel', %w[Absence Acceptance Exclusion Format Inclusion Length Numericality Presence]
|
@@ -1,7 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require 'client_side_validations/active_model'
|
3
4
|
require 'client_side_validations/extender'
|
4
5
|
|
5
6
|
ActiveRecord::Base.send(:include, ClientSideValidations::ActiveModel::Validations)
|
6
7
|
|
7
|
-
ClientSideValidations::Extender.extend 'ActiveRecord', %w
|
8
|
+
ClientSideValidations::Extender.extend 'ActiveRecord', %w[Uniqueness]
|
@@ -1,6 +1,6 @@
|
|
1
1
|
|
2
2
|
/*!
|
3
|
-
* Client Side Validations - v9.
|
3
|
+
* Client Side Validations - v9.3.0 (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.
|
4
|
+
version: 9.3.0
|
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-04-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -65,14 +65,14 @@ dependencies:
|
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '2.
|
68
|
+
version: '2.2'
|
69
69
|
type: :development
|
70
70
|
prerelease: false
|
71
71
|
version_requirements: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '2.
|
75
|
+
version: '2.2'
|
76
76
|
- !ruby/object:Gem::Dependency
|
77
77
|
name: byebug
|
78
78
|
requirement: !ruby/object:Gem::Requirement
|
@@ -93,14 +93,14 @@ dependencies:
|
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 0.8.
|
96
|
+
version: 0.8.20
|
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.8.
|
103
|
+
version: 0.8.20
|
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.
|
166
|
+
version: 0.48.1
|
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.
|
173
|
+
version: 0.48.1
|
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.
|
180
|
+
version: 0.14.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.
|
187
|
+
version: 0.14.1
|
188
188
|
- !ruby/object:Gem::Dependency
|
189
189
|
name: sqlite3
|
190
190
|
requirement: !ruby/object:Gem::Requirement
|