activemodel 6.1.0 → 6.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/active_model/callbacks.rb +1 -1
- data/lib/active_model/gem_version.rb +1 -1
- data/lib/active_model/validations/callbacks.rb +15 -15
- metadata +11 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1937df0b1af18e0326626c8f858a6e6501813cba660f2188fbba100e18f81b29
|
4
|
+
data.tar.gz: 040232f4c019839db999ebe1ab4d9b30a3544225e803347044c9b389a16ad09b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a4d9196a4c73873b521dde3bca04bf26203299dcfa3532bc21f7d3996f29c7cbc1bc5d32037a4526a40e56927ab2d6eb1c5624c8804c9c67454db1b2f952941
|
7
|
+
data.tar.gz: 3a7965fe5d4fae322d1914b4d52479b39fad097c73258240a5cd7d889229e9235328e86f49f23e38b1c3dc21b6ed02e0caf723fb27214e7d5c36c8593286ee1d
|
data/CHANGELOG.md
CHANGED
@@ -147,7 +147,7 @@ module ActiveModel
|
|
147
147
|
conditional = ActiveSupport::Callbacks::Conditionals::Value.new { |v|
|
148
148
|
v != false
|
149
149
|
}
|
150
|
-
options[:if] = Array(options[:if])
|
150
|
+
options[:if] = Array(options[:if]) + [conditional]
|
151
151
|
set_callback(:"#{callback}", :after, *args, options, &block)
|
152
152
|
end
|
153
153
|
end
|
@@ -56,14 +56,7 @@ module ActiveModel
|
|
56
56
|
def before_validation(*args, &block)
|
57
57
|
options = args.extract_options!
|
58
58
|
|
59
|
-
|
60
|
-
options = options.dup
|
61
|
-
options[:on] = Array(options[:on])
|
62
|
-
options[:if] = Array(options[:if])
|
63
|
-
options[:if].unshift ->(o) {
|
64
|
-
!(options[:on] & Array(o.validation_context)).empty?
|
65
|
-
}
|
66
|
-
end
|
59
|
+
set_options_for_callback(options)
|
67
60
|
|
68
61
|
set_callback(:validation, :before, *args, options, &block)
|
69
62
|
end
|
@@ -99,16 +92,23 @@ module ActiveModel
|
|
99
92
|
options = options.dup
|
100
93
|
options[:prepend] = true
|
101
94
|
|
102
|
-
|
103
|
-
options[:on] = Array(options[:on])
|
104
|
-
options[:if] = Array(options[:if])
|
105
|
-
options[:if].unshift ->(o) {
|
106
|
-
!(options[:on] & Array(o.validation_context)).empty?
|
107
|
-
}
|
108
|
-
end
|
95
|
+
set_options_for_callback(options)
|
109
96
|
|
110
97
|
set_callback(:validation, :after, *args, options, &block)
|
111
98
|
end
|
99
|
+
|
100
|
+
private
|
101
|
+
def set_options_for_callback(options)
|
102
|
+
if options.key?(:on)
|
103
|
+
options[:on] = Array(options[:on])
|
104
|
+
options[:if] = [
|
105
|
+
->(o) {
|
106
|
+
!(options[:on] & Array(o.validation_context)).empty?
|
107
|
+
},
|
108
|
+
*options[:if]
|
109
|
+
]
|
110
|
+
end
|
111
|
+
end
|
112
112
|
end
|
113
113
|
|
114
114
|
private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activemodel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.1.
|
4
|
+
version: 6.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 6.1.
|
19
|
+
version: 6.1.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 6.1.
|
26
|
+
version: 6.1.1
|
27
27
|
description: A toolkit for building modeling frameworks like Active Record. Rich support
|
28
28
|
for attributes, callbacks, validations, serialization, internationalization, and
|
29
29
|
testing.
|
@@ -104,11 +104,11 @@ licenses:
|
|
104
104
|
- MIT
|
105
105
|
metadata:
|
106
106
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
107
|
-
changelog_uri: https://github.com/rails/rails/blob/v6.1.
|
108
|
-
documentation_uri: https://api.rubyonrails.org/v6.1.
|
107
|
+
changelog_uri: https://github.com/rails/rails/blob/v6.1.1/activemodel/CHANGELOG.md
|
108
|
+
documentation_uri: https://api.rubyonrails.org/v6.1.1/
|
109
109
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
110
|
-
source_code_uri: https://github.com/rails/rails/tree/v6.1.
|
111
|
-
post_install_message:
|
110
|
+
source_code_uri: https://github.com/rails/rails/tree/v6.1.1/activemodel
|
111
|
+
post_install_message:
|
112
112
|
rdoc_options: []
|
113
113
|
require_paths:
|
114
114
|
- lib
|
@@ -123,8 +123,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
requirements: []
|
126
|
-
rubygems_version: 3.
|
127
|
-
signing_key:
|
126
|
+
rubygems_version: 3.2.3
|
127
|
+
signing_key:
|
128
128
|
specification_version: 4
|
129
129
|
summary: A toolkit for building modeling frameworks (part of Rails).
|
130
130
|
test_files: []
|