activemodel 6.1.4.6 → 6.1.6.1

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
  SHA256:
3
- metadata.gz: 0e7a4ed58a99f6c30cf533fdf7bee9f9ba73e6a8b6cc67975edc8676e5311c47
4
- data.tar.gz: 3dae9a4656e3828b7868c5dd1d2b4a7a5f4e0cd7c70a3043fef9efcb0a39454a
3
+ metadata.gz: ae24a33b1bbfa6eb1e4c5e55f14a7bb92631f3c16b894fe516e01507f3a3354f
4
+ data.tar.gz: fa7badebe0d2d6213db0e1122bb94fbff72cbc11fe1e8bce870ed1b340a8f31b
5
5
  SHA512:
6
- metadata.gz: 6a574b7e597927a1177b3448c946566bd0546ee888572aa69abbfe95bc41337f7a9ace548cc783c630a69d3b96bd12add61dd71e32c7c39c44b3a17caf0d8bb8
7
- data.tar.gz: e38f2244209c854b41d4deaf95774d2d9af6c58d039f2118e4c642d61954390e667b3051c185f9d5ba074b0adc40d3f5461bdd5f049aab903a2b24b11e47a46c
6
+ metadata.gz: dd715570f3cba8ebe323210ac537b2ca5852cf1827cd791cd8b023f01d848047d0b0e52d205a99a49f310ea81fb9accbc404de5d7d53f2c629a83cd7a5ae7d7f
7
+ data.tar.gz: 80284508ce715c8335715acff27814c89e40036d2c107f3684cf97741a50e7cc188b25636ee5c3f01ea4ec0c74c34367aa4eb3daa1ebc7a93ad2946c568670a9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,49 @@
1
+ ## Rails 6.1.6.1 (July 12, 2022) ##
2
+
3
+ * No changes.
4
+
5
+
6
+ ## Rails 6.1.5.1 (April 26, 2022) ##
7
+
8
+ * No changes.
9
+
10
+
11
+ ## Rails 6.1.5 (March 09, 2022) ##
12
+
13
+ * Clear secure password cache if password is set to `nil`
14
+
15
+ Before:
16
+
17
+ user.password = 'something'
18
+ user.password = nil
19
+
20
+ user.password # => 'something'
21
+
22
+ Now:
23
+
24
+ user.password = 'something'
25
+ user.password = nil
26
+
27
+ user.password # => nil
28
+
29
+ *Markus Doits*
30
+
31
+ * Fix delegation in `ActiveModel::Type::Registry#lookup` and `ActiveModel::Type.lookup`
32
+
33
+ Passing a last positional argument `{}` would be incorrectly considered as keyword argument.
34
+
35
+ *Benoit Daloze*
36
+
37
+ * Fix `to_json` after `changes_applied` for `ActiveModel::Dirty` object.
38
+
39
+ *Ryuta Kamizono*
40
+
41
+
42
+ ## Rails 6.1.4.7 (March 08, 2022) ##
43
+
44
+ * No changes.
45
+
46
+
1
47
  ## Rails 6.1.4.6 (February 11, 2022) ##
2
48
 
3
49
  * No changes.
@@ -123,6 +169,10 @@
123
169
  some edge cases won’t be covered, like `errors#first` will return `ActiveModel::Error` and manipulating
124
170
  `errors.messages` and `errors.details` hashes directly will have no effect. Moving forward,
125
171
  please convert those direct manipulations to use provided API methods instead.
172
+ Please note that `errors#add` now accepts `options` as keyword arguments instead of `Hash` which
173
+ introduced a change in Ruby 3 to [keyword arguments][kwargs-ann].
174
+
175
+ [kwargs-ann]: https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/
126
176
 
127
177
  The list of deprecated methods and their planned future behavioral changes at the next major release are:
128
178
 
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2004-2020 David Heinemeier Hansson
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 6.2.
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)
@@ -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"].flatten
143
+ options[:except] = [*options[:except], "mutations_from_database", "mutations_before_last_save"]
144
144
  super(options)
145
145
  end
146
146
 
@@ -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 6.2.
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 6.2.
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 6.2."
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
@@ -9,8 +9,8 @@ module ActiveModel
9
9
  module VERSION
10
10
  MAJOR = 6
11
11
  MINOR = 1
12
- TINY = 4
13
- PRE = "6"
12
+ TINY = 6
13
+ PRE = "1"
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
@@ -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, **kwargs)
25
- registration = find_registration(symbol, *args, **kwargs)
24
+ def lookup(symbol, *args)
25
+ registration = find_registration(symbol, *args)
26
26
 
27
27
  if registration
28
- registration.call(self, symbol, *args, **kwargs)
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, **kwargs)
54
- if kwargs.any? # https://bugs.ruby-lang.org/issues/10856
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
@@ -29,9 +29,10 @@ module ActiveModel
29
29
  registry.register(type_name, klass, **options, &block)
30
30
  end
31
31
 
32
- def lookup(*args, **kwargs) # :nodoc:
33
- registry.lookup(*args, **kwargs)
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-2020 David Heinemeier Hansson
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.6
4
+ version: 6.1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-11 00:00:00.000000000 Z
11
+ date: 2022-07-12 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.4.6
19
+ version: 6.1.6.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.4.6
26
+ version: 6.1.6.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,10 +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.4.6/activemodel/CHANGELOG.md
108
- documentation_uri: https://api.rubyonrails.org/v6.1.4.6/
107
+ changelog_uri: https://github.com/rails/rails/blob/v6.1.6.1/activemodel/CHANGELOG.md
108
+ documentation_uri: https://api.rubyonrails.org/v6.1.6.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.4.6/activemodel
110
+ source_code_uri: https://github.com/rails/rails/tree/v6.1.6.1/activemodel
111
+ rubygems_mfa_required: 'true'
111
112
  post_install_message:
112
113
  rdoc_options: []
113
114
  require_paths:
@@ -123,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
124
  - !ruby/object:Gem::Version
124
125
  version: '0'
125
126
  requirements: []
126
- rubygems_version: 3.2.22
127
+ rubygems_version: 3.3.3
127
128
  signing_key:
128
129
  specification_version: 4
129
130
  summary: A toolkit for building modeling frameworks (part of Rails).