activemodel 7.1.4.1 → 7.1.5

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: 244c56485f6b507cadace603d736b30bcab923144e9a556d3f79add20b790935
4
- data.tar.gz: 172f280d76e2f60d35db0ccee50ee8f25dbd0c366e3f51e2a3522253c947795d
3
+ metadata.gz: 47edf9505c3471e453e228f0f5df53f81f4ef35f124245e2fa3fe21a4fe98e83
4
+ data.tar.gz: 4c693d298afbfed8f0cd722d33f2426e0f3edb7305bb581e0c4ee2a3fa1203b1
5
5
  SHA512:
6
- metadata.gz: 769239956a7f534c54f41e473271c586c8c9c7b190e24e10dbed1c7485dfde885c10afe89ab92f1e6870a04f39f1851691891025bbb77431349e93a97571ed64
7
- data.tar.gz: 38f5d2bb2659f616791dfe9266725fb56a12fabbcaa8b7e659794ede4812e7fb95a59ac3f702a80e0ebaca0519a484b2a577a52bfece685ff5c1793716af00ab
6
+ metadata.gz: 59b03357543036b2856fdec81f20ae784e4af91a5229caa9651ca689e1d62b85a5a1cb27a1767ce7865535344f986c7c2759f3efbf31a0665e13da5b53831dcd
7
+ data.tar.gz: 1a1a03cf6c4ed8f6d3f6462a9037a6d56343accb8c1aaf39e4320f32b359fe2f14339b498b67e2a59c1be1f796bcbee79ad36641bbefac22542f10597d8b2751
data/CHANGELOG.md CHANGED
@@ -1,3 +1,30 @@
1
+ ## Rails 7.1.5 (October 30, 2024) ##
2
+
3
+ * Fix regression in `alias_attribute` to work with user defined methods.
4
+
5
+ `alias_attribute` would wrongly assume the attribute accessor was generated by Active Model.
6
+
7
+ ```ruby
8
+ class Person
9
+ include ActiveModel::AttributeMethods
10
+
11
+ define_attribute_methods :name
12
+ attr_accessor :name
13
+
14
+ alias_attribute :full_name, :name
15
+ end
16
+
17
+ person.full_name # => NoMethodError: undefined method `attribute' for an instance of Person
18
+ ```
19
+
20
+ *Jean Boussier*
21
+
22
+
23
+ ## Rails 7.1.4.2 (October 23, 2024) ##
24
+
25
+ * No changes.
26
+
27
+
1
28
  ## Rails 7.1.4.1 (October 15, 2024) ##
2
29
 
3
30
  * No changes.
@@ -216,7 +216,12 @@ module ActiveModel
216
216
  end
217
217
 
218
218
  def generate_alias_attribute_methods(code_generator, new_name, old_name) # :nodoc:
219
- define_attribute_method(old_name, _owner: code_generator, as: new_name)
219
+ ActiveSupport::CodeGenerator.batch(code_generator, __FILE__, __LINE__) do |owner|
220
+ attribute_method_patterns.each do |pattern|
221
+ alias_attribute_method_definition(code_generator, pattern, new_name, old_name)
222
+ end
223
+ attribute_method_patterns_cache.clear
224
+ end
220
225
  end
221
226
 
222
227
  def alias_attribute_method_definition(code_generator, pattern, new_name, old_name) # :nodoc:
@@ -9,8 +9,8 @@ module ActiveModel
9
9
  module VERSION
10
10
  MAJOR = 7
11
11
  MINOR = 1
12
- TINY = 4
13
- PRE = "1"
12
+ TINY = 5
13
+ PRE = nil
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
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.4.1
4
+ version: 7.1.5
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: 2024-10-15 00:00:00.000000000 Z
11
+ date: 2024-10-31 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.4.1
19
+ version: 7.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: 7.1.4.1
26
+ version: 7.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.
@@ -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.4.1/activemodel/CHANGELOG.md
116
- documentation_uri: https://api.rubyonrails.org/v7.1.4.1/
115
+ changelog_uri: https://github.com/rails/rails/blob/v7.1.5/activemodel/CHANGELOG.md
116
+ documentation_uri: https://api.rubyonrails.org/v7.1.5/
117
117
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
118
- source_code_uri: https://github.com/rails/rails/tree/v7.1.4.1/activemodel
118
+ source_code_uri: https://github.com/rails/rails/tree/v7.1.5/activemodel
119
119
  rubygems_mfa_required: 'true'
120
120
  post_install_message:
121
121
  rdoc_options: []