activemodel 7.1.0 → 7.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 156594baf9ec8cdbae4cca56c53a593a3f13e79d7c7b51bac0008a84e8246644
4
- data.tar.gz: 760fe2137cf6c7c76526d3e7f9c51bf741c461dbb1e07bc1c8f47695faa5995a
3
+ metadata.gz: 8d422c81f75030bb5e3d60be5a7d8790304fd16f272b79e9b7a0db8062fe2cf0
4
+ data.tar.gz: 1210ef5f7d3dc8f14fcc5367d54b1200d829cf94675892c8e184a16fa6948a04
5
5
  SHA512:
6
- metadata.gz: cf421a509b2dfd9e92789a3d3ecb101a66f0fd93a5b43ae1a16d9f43bdd0863c64f3ac75c8009d6ec37a199ee51cf4f1ff0328c4e4dd7fc79e294f6659dd421e
7
- data.tar.gz: 28791c59f2045f08ed7aff0c71ed4f34164128a26442af87a2f72486f0f5d2be7f6b3a4028f6ae19221b4f1c3da94bc8db6257cecdb5b640fcf7bffb5f0da851
6
+ metadata.gz: 91cef29372bf12f285bacc1f54c0916838f5ad7edf171d310c07ce9172b498615793f7699e58a183216caae83eb5e127e4b994a07e9c6b60185da470f857fd4e
7
+ data.tar.gz: 85e338ecc5720d7ddd066c6bb0e91e8f72b41ea89efb322221da2c80c20a023f3c343e475e611d275c5ef983368fe61448cd7cfd6104347792e7ee572dc11bfb
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## Rails 7.1.2 (November 10, 2023) ##
2
+
3
+ * Make `==(other)` method of AttributeSet safe.
4
+
5
+ *Dmitry Pogrebnoy*
6
+
7
+
8
+ ## Rails 7.1.1 (October 11, 2023) ##
9
+
10
+ * No changes.
11
+
12
+
1
13
  ## Rails 7.1.0 (October 05, 2023) ##
2
14
 
3
15
  * No changes.
@@ -178,11 +178,11 @@ module ActiveModel
178
178
  def forgetting_assignment
179
179
  # If this attribute was not persisted (with a `value_for_database`
180
180
  # that might differ from `value_before_type_cast`) and `value` has not
181
- # changed in place, we can simply dup this attribute to avoid
182
- # deserialize / cast / serialize calls from computing the new
181
+ # changed in place, we can use the existing `value_before_type_cast`
182
+ # to avoid deserialize / cast / serialize calls from computing the new
183
183
  # attribute's `value_before_type_cast`.
184
184
  if !defined?(@value_for_database) && !changed_in_place?
185
- dup
185
+ with_value_from_database(value_before_type_cast)
186
186
  else
187
187
  super
188
188
  end
@@ -104,7 +104,7 @@ module ActiveModel
104
104
  end
105
105
 
106
106
  def ==(other)
107
- attributes == other.attributes
107
+ other.is_a?(AttributeSet) && attributes == other.send(:attributes)
108
108
  end
109
109
 
110
110
  protected
@@ -289,7 +289,7 @@ module ActiveModel
289
289
  mutations_from_database.changed_attribute_names
290
290
  end
291
291
 
292
- # Dispatch target for {*_changed}[rdoc-label:method-i-2A_changed-3F] attribute methods.
292
+ # Dispatch target for {*_changed?}[rdoc-label:method-i-2A_changed-3F] attribute methods.
293
293
  def attribute_changed?(attr_name, **options)
294
294
  mutations_from_database.changed?(attr_name.to_s, **options)
295
295
  end
@@ -299,7 +299,7 @@ module ActiveModel
299
299
  mutations_from_database.original_value(attr_name.to_s)
300
300
  end
301
301
 
302
- # Dispatch target for {*_previously_changed}[rdoc-label:method-i-2A_previously_changed-3F] attribute methods.
302
+ # Dispatch target for {*_previously_changed?}[rdoc-label:method-i-2A_previously_changed-3F] attribute methods.
303
303
  def attribute_previously_changed?(attr_name, **options)
304
304
  mutations_before_last_save.changed?(attr_name.to_s, **options)
305
305
  end
@@ -9,7 +9,7 @@ module ActiveModel
9
9
  module VERSION
10
10
  MAJOR = 7
11
11
  MINOR = 1
12
- TINY = 0
12
+ TINY = 2
13
13
  PRE = nil
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
@@ -42,7 +42,8 @@ module ActiveModel
42
42
  end
43
43
 
44
44
  def number_to_non_number?(old_value, new_value_before_type_cast)
45
- old_value != nil && non_numeric_string?(new_value_before_type_cast.to_s)
45
+ old_value != nil && !new_value_before_type_cast.is_a?(::Numeric) &&
46
+ non_numeric_string?(new_value_before_type_cast.to_s)
46
47
  end
47
48
 
48
49
  def non_numeric_string?(value)
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: 7.1.0
4
+ version: 7.1.2
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: 2023-10-05 00:00:00.000000000 Z
11
+ date: 2023-11-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: 7.1.0
19
+ version: 7.1.2
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: 7.1.0
26
+ version: 7.1.2
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.
@@ -112,10 +112,10 @@ licenses:
112
112
  - MIT
113
113
  metadata:
114
114
  bug_tracker_uri: https://github.com/rails/rails/issues
115
- changelog_uri: https://github.com/rails/rails/blob/v7.1.0/activemodel/CHANGELOG.md
116
- documentation_uri: https://api.rubyonrails.org/v7.1.0/
115
+ changelog_uri: https://github.com/rails/rails/blob/v7.1.2/activemodel/CHANGELOG.md
116
+ documentation_uri: https://api.rubyonrails.org/v7.1.2/
117
117
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
118
- source_code_uri: https://github.com/rails/rails/tree/v7.1.0/activemodel
118
+ source_code_uri: https://github.com/rails/rails/tree/v7.1.2/activemodel
119
119
  rubygems_mfa_required: 'true'
120
120
  post_install_message:
121
121
  rdoc_options: []