activemodel 6.1.4 → 6.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +75 -0
- data/MIT-LICENSE +1 -2
- data/lib/active_model/attribute_set/builder.rb +1 -1
- data/lib/active_model/dirty.rb +1 -1
- data/lib/active_model/errors.rb +3 -3
- data/lib/active_model/gem_version.rb +1 -1
- data/lib/active_model/secure_password.rb +1 -0
- data/lib/active_model/type/registry.rb +7 -9
- data/lib/active_model/type.rb +3 -2
- data/lib/active_model.rb +1 -1
- metadata +12 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15ef1039a8a4a01a81a57c80d8975ea6e389ebf877e798c2a5ddc1fab89424f4
|
4
|
+
data.tar.gz: 1c7f70389ee698d87c8ec352a87caeab6aa6d79c5875dada5c26aa58ee7b3f29
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1769b3fd1e97c2a33e8bda08cf82449942f5ba6d41066299b63fab616ea8d97e9b7b6c445e313108fb0aa86c77a7a74a22604aa379fe54e932334e17858d61f
|
7
|
+
data.tar.gz: 10d653af9fff2fc2f0c65abd0bcfb4f42e0bbeef8b4d03493511e7691d8a948ccf7109bbb9e35fea4e1309e15d40157d70fa481c647d68ede0d86e5168030bcf
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,74 @@
|
|
1
|
+
## Rails 6.1.5.1 (April 26, 2022) ##
|
2
|
+
|
3
|
+
* No changes.
|
4
|
+
|
5
|
+
|
6
|
+
## Rails 6.1.5 (March 09, 2022) ##
|
7
|
+
|
8
|
+
* Clear secure password cache if password is set to `nil`
|
9
|
+
|
10
|
+
Before:
|
11
|
+
|
12
|
+
user.password = 'something'
|
13
|
+
user.password = nil
|
14
|
+
|
15
|
+
user.password # => 'something'
|
16
|
+
|
17
|
+
Now:
|
18
|
+
|
19
|
+
user.password = 'something'
|
20
|
+
user.password = nil
|
21
|
+
|
22
|
+
user.password # => nil
|
23
|
+
|
24
|
+
*Markus Doits*
|
25
|
+
|
26
|
+
* Fix delegation in `ActiveModel::Type::Registry#lookup` and `ActiveModel::Type.lookup`
|
27
|
+
|
28
|
+
Passing a last positional argument `{}` would be incorrectly considered as keyword argument.
|
29
|
+
|
30
|
+
*Benoit Daloze*
|
31
|
+
|
32
|
+
* Fix `to_json` after `changes_applied` for `ActiveModel::Dirty` object.
|
33
|
+
|
34
|
+
*Ryuta Kamizono*
|
35
|
+
|
36
|
+
|
37
|
+
## Rails 6.1.4.7 (March 08, 2022) ##
|
38
|
+
|
39
|
+
* No changes.
|
40
|
+
|
41
|
+
|
42
|
+
## Rails 6.1.4.6 (February 11, 2022) ##
|
43
|
+
|
44
|
+
* No changes.
|
45
|
+
|
46
|
+
|
47
|
+
## Rails 6.1.4.5 (February 11, 2022) ##
|
48
|
+
|
49
|
+
* No changes.
|
50
|
+
|
51
|
+
|
52
|
+
## Rails 6.1.4.4 (December 15, 2021) ##
|
53
|
+
|
54
|
+
* No changes.
|
55
|
+
|
56
|
+
|
57
|
+
## Rails 6.1.4.3 (December 14, 2021) ##
|
58
|
+
|
59
|
+
* No changes.
|
60
|
+
|
61
|
+
|
62
|
+
## Rails 6.1.4.2 (December 14, 2021) ##
|
63
|
+
|
64
|
+
* No changes.
|
65
|
+
|
66
|
+
|
67
|
+
## Rails 6.1.4.1 (August 19, 2021) ##
|
68
|
+
|
69
|
+
* No changes.
|
70
|
+
|
71
|
+
|
1
72
|
## Rails 6.1.4 (June 24, 2021) ##
|
2
73
|
|
3
74
|
* Fix `to_json` for `ActiveModel::Dirty` object.
|
@@ -93,6 +164,10 @@
|
|
93
164
|
some edge cases won’t be covered, like `errors#first` will return `ActiveModel::Error` and manipulating
|
94
165
|
`errors.messages` and `errors.details` hashes directly will have no effect. Moving forward,
|
95
166
|
please convert those direct manipulations to use provided API methods instead.
|
167
|
+
Please note that `errors#add` now accepts `options` as keyword arguments instead of `Hash` which
|
168
|
+
introduced a change in Ruby 3 to [keyword arguments][kwargs-ann].
|
169
|
+
|
170
|
+
[kwargs-ann]: https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/
|
96
171
|
|
97
172
|
The list of deprecated methods and their planned future behavioral changes at the next major release are:
|
98
173
|
|
data/MIT-LICENSE
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c) 2004-
|
1
|
+
Copyright (c) 2004-2022 David Heinemeier Hansson
|
2
2
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining
|
4
4
|
a copy of this software and associated documentation files (the
|
@@ -18,4 +18,3 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
18
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
19
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
20
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
-
|
@@ -146,7 +146,7 @@ module ActiveModel
|
|
146
146
|
def marshal_load(values)
|
147
147
|
if values.is_a?(Hash)
|
148
148
|
ActiveSupport::Deprecation.warn(<<~MSG)
|
149
|
-
Marshalling load from legacy attributes format is deprecated and will be removed in Rails
|
149
|
+
Marshalling load from legacy attributes format is deprecated and will be removed in Rails 7.0.
|
150
150
|
MSG
|
151
151
|
empty_hash = {}.freeze
|
152
152
|
initialize(empty_hash, empty_hash, empty_hash, empty_hash, values)
|
data/lib/active_model/dirty.rb
CHANGED
@@ -140,7 +140,7 @@ module ActiveModel
|
|
140
140
|
end
|
141
141
|
|
142
142
|
def as_json(options = {}) # :nodoc:
|
143
|
-
options[:except] = [options[:except], "mutations_from_database"]
|
143
|
+
options[:except] = [*options[:except], "mutations_from_database", "mutations_before_last_save"]
|
144
144
|
super(options)
|
145
145
|
end
|
146
146
|
|
data/lib/active_model/errors.rb
CHANGED
@@ -249,7 +249,7 @@ module ActiveModel
|
|
249
249
|
|
250
250
|
You are passing a block expecting two parameters,
|
251
251
|
so the old hash behavior is simulated. As this is deprecated,
|
252
|
-
this will result in an ArgumentError in Rails
|
252
|
+
this will result in an ArgumentError in Rails 7.0.
|
253
253
|
MSG
|
254
254
|
@errors.
|
255
255
|
sort { |a, b| a.attribute <=> b.attribute }.
|
@@ -325,7 +325,7 @@ module ActiveModel
|
|
325
325
|
|
326
326
|
def to_h
|
327
327
|
ActiveSupport::Deprecation.warn(<<~EOM)
|
328
|
-
ActiveModel::Errors#to_h is deprecated and will be removed in Rails
|
328
|
+
ActiveModel::Errors#to_h is deprecated and will be removed in Rails 7.0.
|
329
329
|
Please use `ActiveModel::Errors.to_hash` instead. The values in the hash
|
330
330
|
returned by `ActiveModel::Errors.to_hash` is an array of error messages.
|
331
331
|
EOM
|
@@ -583,7 +583,7 @@ module ActiveModel
|
|
583
583
|
end
|
584
584
|
|
585
585
|
def deprecation_removal_warning(method_name, alternative_message = nil)
|
586
|
-
message = +"ActiveModel::Errors##{method_name} is deprecated and will be removed in Rails
|
586
|
+
message = +"ActiveModel::Errors##{method_name} is deprecated and will be removed in Rails 7.0."
|
587
587
|
if alternative_message
|
588
588
|
message << "\n\nTo achieve the same use:\n\n "
|
589
589
|
message << alternative_message
|
@@ -94,6 +94,7 @@ module ActiveModel
|
|
94
94
|
|
95
95
|
define_method("#{attribute}=") do |unencrypted_password|
|
96
96
|
if unencrypted_password.nil?
|
97
|
+
instance_variable_set("@#{attribute}", nil)
|
97
98
|
self.public_send("#{attribute}_digest=", nil)
|
98
99
|
elsif !unencrypted_password.empty?
|
99
100
|
instance_variable_set("@#{attribute}", unencrypted_password)
|
@@ -21,15 +21,16 @@ module ActiveModel
|
|
21
21
|
registrations << registration_klass.new(type_name, block, **options)
|
22
22
|
end
|
23
23
|
|
24
|
-
def lookup(symbol, *args
|
25
|
-
registration = find_registration(symbol, *args
|
24
|
+
def lookup(symbol, *args)
|
25
|
+
registration = find_registration(symbol, *args)
|
26
26
|
|
27
27
|
if registration
|
28
|
-
registration.call(self, symbol, *args
|
28
|
+
registration.call(self, symbol, *args)
|
29
29
|
else
|
30
30
|
raise ArgumentError, "Unknown type #{symbol.inspect}"
|
31
31
|
end
|
32
32
|
end
|
33
|
+
ruby2_keywords(:lookup) if respond_to?(:ruby2_keywords, true)
|
33
34
|
|
34
35
|
private
|
35
36
|
attr_reader :registrations
|
@@ -50,13 +51,10 @@ module ActiveModel
|
|
50
51
|
@block = block
|
51
52
|
end
|
52
53
|
|
53
|
-
def call(_registry, *args
|
54
|
-
|
55
|
-
block.call(*args, **kwargs)
|
56
|
-
else
|
57
|
-
block.call(*args)
|
58
|
-
end
|
54
|
+
def call(_registry, *args)
|
55
|
+
block.call(*args)
|
59
56
|
end
|
57
|
+
ruby2_keywords(:call) if respond_to?(:ruby2_keywords, true)
|
60
58
|
|
61
59
|
def matches?(type_name, *args, **kwargs)
|
62
60
|
type_name == name
|
data/lib/active_model/type.rb
CHANGED
@@ -29,9 +29,10 @@ module ActiveModel
|
|
29
29
|
registry.register(type_name, klass, **options, &block)
|
30
30
|
end
|
31
31
|
|
32
|
-
def lookup(*args
|
33
|
-
registry.lookup(*args
|
32
|
+
def lookup(*args) # :nodoc:
|
33
|
+
registry.lookup(*args)
|
34
34
|
end
|
35
|
+
ruby2_keywords(:lookup) if respond_to?(:ruby2_keywords, true)
|
35
36
|
|
36
37
|
def default_value # :nodoc:
|
37
38
|
@default_value ||= Value.new
|
data/lib/active_model.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
#--
|
4
|
-
# Copyright (c) 2004-
|
4
|
+
# Copyright (c) 2004-2022 David Heinemeier Hansson
|
5
5
|
#
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining
|
7
7
|
# a copy of this software and associated documentation files (the
|
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.6
|
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: 2022-05-09 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.6
|
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.6
|
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,12 @@ 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.6/activemodel/CHANGELOG.md
|
108
|
+
documentation_uri: https://api.rubyonrails.org/v6.1.6/
|
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
|
-
|
110
|
+
source_code_uri: https://github.com/rails/rails/tree/v6.1.6/activemodel
|
111
|
+
rubygems_mfa_required: 'true'
|
112
|
+
post_install_message:
|
112
113
|
rdoc_options: []
|
113
114
|
require_paths:
|
114
115
|
- lib
|
@@ -123,8 +124,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
124
|
- !ruby/object:Gem::Version
|
124
125
|
version: '0'
|
125
126
|
requirements: []
|
126
|
-
rubygems_version: 3.
|
127
|
-
signing_key:
|
127
|
+
rubygems_version: 3.3.7
|
128
|
+
signing_key:
|
128
129
|
specification_version: 4
|
129
130
|
summary: A toolkit for building modeling frameworks (part of Rails).
|
130
131
|
test_files: []
|