activemodel 6.1.4.7 → 6.1.5
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 +35 -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 +2 -2
- 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: fa1374c8ad08249d841d95a4cb181adfba7603e7db398ad5acc1d469cc651d4b
|
4
|
+
data.tar.gz: 781c692d2d1bdcb09ab8b9958b25be20826bcd720814142f74d62cb3bd617466
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf65a865cd62f0b68ec5e12548cfef4c51463dc1985b9452994eaaad934e21f9d1f148cdd8409d15e3b489fffd4dd052263dd640db74d066b45d88f3da75a083
|
7
|
+
data.tar.gz: 9ad9756a581ccb6c76b6973778d9a9352f245b3a450687456ab03747f949ad1afa8b727f85d13b51115cbcc24f281bb641af78a2238a2f5089885d5a4e0d6f24
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,34 @@
|
|
1
|
+
## Rails 6.1.5 (March 09, 2022) ##
|
2
|
+
|
3
|
+
* Clear secure password cache if password is set to `nil`
|
4
|
+
|
5
|
+
Before:
|
6
|
+
|
7
|
+
user.password = 'something'
|
8
|
+
user.password = nil
|
9
|
+
|
10
|
+
user.password # => 'something'
|
11
|
+
|
12
|
+
Now:
|
13
|
+
|
14
|
+
user.password = 'something'
|
15
|
+
user.password = nil
|
16
|
+
|
17
|
+
user.password # => nil
|
18
|
+
|
19
|
+
*Markus Doits*
|
20
|
+
|
21
|
+
* Fix delegation in `ActiveModel::Type::Registry#lookup` and `ActiveModel::Type.lookup`
|
22
|
+
|
23
|
+
Passing a last positional argument `{}` would be incorrectly considered as keyword argument.
|
24
|
+
|
25
|
+
*Benoit Daloze*
|
26
|
+
|
27
|
+
* Fix `to_json` after `changes_applied` for `ActiveModel::Dirty` object.
|
28
|
+
|
29
|
+
*Ryuta Kamizono*
|
30
|
+
|
31
|
+
|
1
32
|
## Rails 6.1.4.7 (March 08, 2022) ##
|
2
33
|
|
3
34
|
* No changes.
|
@@ -128,6 +159,10 @@
|
|
128
159
|
some edge cases won’t be covered, like `errors#first` will return `ActiveModel::Error` and manipulating
|
129
160
|
`errors.messages` and `errors.details` hashes directly will have no effect. Moving forward,
|
130
161
|
please convert those direct manipulations to use provided API methods instead.
|
162
|
+
Please note that `errors#add` now accepts `options` as keyword arguments instead of `Hash` which
|
163
|
+
introduced a change in Ruby 3 to [keyword arguments][kwargs-ann].
|
164
|
+
|
165
|
+
[kwargs-ann]: https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/
|
131
166
|
|
132
167
|
The list of deprecated methods and their planned future behavioral changes at the next major release are:
|
133
168
|
|
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.5
|
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: 2022-03-
|
11
|
+
date: 2022-03-10 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.5
|
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.5
|
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.5/activemodel/CHANGELOG.md
|
108
|
+
documentation_uri: https://api.rubyonrails.org/v6.1.5/
|
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.5/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: []
|