activerecord 6.1.5 → 6.1.6

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of activerecord might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 726b98d501c1bb19481f8961894653a362e7ee0bd9993c35ef25e9ad4d76ccf4
4
- data.tar.gz: f479e8a86f16437cf977c04a0bb6f69783281176eeedb955348634114876b6c4
3
+ metadata.gz: 54622177a779de0ac72e77ff40350f3da47eb92b97cffcd94cf549e6763fe885
4
+ data.tar.gz: 52e2705225e9b01f78a1138035f714b45858a8ad54a563abbb79f789cf8e2fdf
5
5
  SHA512:
6
- metadata.gz: 917b3e5292fa4e7927994fcab3f6b6c07d9615c8c755e1f4950a55bcf5d9232c53f116ceee41ba63d7f6bdf23bc9b3f0e778edfd102aa6327808374fdb8e1ba0
7
- data.tar.gz: e772cf960f0a2c361cd2701b7ac765cefc86336bcf353741dc8dd4c56937db0392ba41b762ca9d26879702fbf74f2ff10197235715b0b7aa3b69e83e2fba1ca8
6
+ metadata.gz: b4bb57d1557725397dc7ac759baeccc90f7c5e682d8aaf2a002504ad9146623337c1fa1fa066f4494ffa81873b832379b07e76393649ff74197b6297a54c46f8
7
+ data.tar.gz: aefdefba9747cf9bb6399bfa84aa24f521a8f34274089411d8cb7c7c0b0c5c0749607c0a68dff123ec6fadca80d597f19d71dabb802bc71c37d5e2927ed535ca
data/CHANGELOG.md CHANGED
@@ -1,15 +1,20 @@
1
+ ## Rails 6.1.5.1 (April 26, 2022) ##
2
+
3
+ * No changes.
4
+
5
+
1
6
  ## Rails 6.1.5 (March 09, 2022) ##
2
7
 
3
8
  * Fix `ActiveRecord::ConnectionAdapters::SchemaCache#deep_deduplicate` for Ruby 2.6.
4
9
 
5
- Ruby 2.6 and 2.7 have slightly different implementations of the `String#@-` method.
6
- In Ruby 2.6, the receiver of the `String#@-` method is modified under certain circumstances.
10
+ Ruby 2.6 and 2.7 have slightly different implementations of the `String#-@` method.
11
+ In Ruby 2.6, the receiver of the `String#-@` method is modified under certain circumstances.
7
12
  This was later identified as a bug (https://bugs.ruby-lang.org/issues/15926) and only
8
13
  fixed in Ruby 2.7.
9
14
 
10
15
  Before the changes in this commit, the
11
16
  `ActiveRecord::ConnectionAdapters::SchemaCache#deep_deduplicate` method, which internally
12
- calls the `String#@-` method, could also modify an input string argument in Ruby 2.6 --
17
+ calls the `String#-@` method, could also modify an input string argument in Ruby 2.6 --
13
18
  changing a tainted, unfrozen string into a tainted, frozen string.
14
19
 
15
20
  Fixes #43056
@@ -198,6 +198,10 @@ module ActiveRecord
198
198
 
199
199
  def index_options(table_name)
200
200
  index_options = as_options(index)
201
+
202
+ # legacy reference index names are used on versions 6.0 and earlier
203
+ return index_options if options[:_uses_legacy_reference_index_name]
204
+
201
205
  index_options[:name] ||= polymorphic_index_name(table_name) if polymorphic
202
206
  index_options
203
207
  end
@@ -207,8 +207,8 @@ module ActiveRecord
207
207
  value.map { |i| deep_deduplicate(i) }
208
208
  when String
209
209
  if value.tainted?
210
- # Ruby 2.6 and 2.7 have slightly different implementations of the String#@- method.
211
- # In Ruby 2.6, the receiver of the String#@- method is modified under certain
210
+ # Ruby 2.6 and 2.7 have slightly different implementations of the String#-@ method.
211
+ # In Ruby 2.6, the receiver of the String#-@ method is modified under certain
212
212
  # circumstances, and this was later identified as a bug
213
213
  # (https://bugs.ruby-lang.org/issues/15926) and only fixed in Ruby 2.7.
214
214
  value = value.dup
@@ -9,7 +9,7 @@ module ActiveRecord
9
9
  module VERSION
10
10
  MAJOR = 6
11
11
  MINOR = 1
12
- TINY = 5
12
+ TINY = 6
13
13
  PRE = nil
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
@@ -22,27 +22,10 @@ module ActiveRecord
22
22
  end
23
23
  end
24
24
 
25
- module SQLite3
26
- module TableDefinition
27
- def references(*args, **options)
28
- args.each do |ref_name|
29
- ReferenceDefinition.new(ref_name, type: :integer, **options).add_to(self)
30
- end
31
- end
32
- alias :belongs_to :references
33
-
34
- def column(name, type, index: nil, **options)
35
- options[:precision] ||= nil
36
- super
37
- end
38
- end
39
- end
40
-
41
25
  module TableDefinition
42
26
  def references(*args, **options)
43
- args.each do |ref_name|
44
- ReferenceDefinition.new(ref_name, **options).add_to(self)
45
- end
27
+ options[:_uses_legacy_reference_index_name] = true
28
+ super
46
29
  end
47
30
  alias :belongs_to :references
48
31
  end
@@ -73,12 +56,11 @@ module ActiveRecord
73
56
 
74
57
  def add_reference(table_name, ref_name, **options)
75
58
  if connection.adapter_name == "SQLite"
76
- reference_definition = ReferenceDefinition.new(ref_name, type: :integer, **options)
77
- else
78
- reference_definition = ReferenceDefinition.new(ref_name, **options)
59
+ options[:type] = :integer
79
60
  end
80
61
 
81
- reference_definition.add_to(connection.update_table_definition(table_name, self))
62
+ options[:_uses_legacy_reference_index_name] = true
63
+ super
82
64
  end
83
65
  alias :add_belongs_to :add_reference
84
66
 
@@ -86,7 +68,6 @@ module ActiveRecord
86
68
  def compatible_table_definition(t)
87
69
  class << t
88
70
  prepend TableDefinition
89
- prepend SQLite3::TableDefinition
90
71
  end
91
72
  t
92
73
  end
@@ -148,7 +129,7 @@ module ActiveRecord
148
129
  class << t
149
130
  prepend TableDefinition
150
131
  end
151
- t
132
+ super
152
133
  end
153
134
 
154
135
  def command_recorder
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.5
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: 2022-03-10 00:00:00.000000000 Z
11
+ date: 2022-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 6.1.5
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.5
26
+ version: 6.1.6
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activemodel
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 6.1.5
33
+ version: 6.1.6
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 6.1.5
40
+ version: 6.1.6
41
41
  description: Databases on Rails. Build a persistent domain model by mapping database
42
42
  tables to Ruby classes. Strong conventions for associations, validations, aggregations,
43
43
  migrations, and testing come baked-in.
@@ -390,12 +390,12 @@ licenses:
390
390
  - MIT
391
391
  metadata:
392
392
  bug_tracker_uri: https://github.com/rails/rails/issues
393
- changelog_uri: https://github.com/rails/rails/blob/v6.1.5/activerecord/CHANGELOG.md
394
- documentation_uri: https://api.rubyonrails.org/v6.1.5/
393
+ changelog_uri: https://github.com/rails/rails/blob/v6.1.6/activerecord/CHANGELOG.md
394
+ documentation_uri: https://api.rubyonrails.org/v6.1.6/
395
395
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
396
- source_code_uri: https://github.com/rails/rails/tree/v6.1.5/activerecord
396
+ source_code_uri: https://github.com/rails/rails/tree/v6.1.6/activerecord
397
397
  rubygems_mfa_required: 'true'
398
- post_install_message:
398
+ post_install_message:
399
399
  rdoc_options:
400
400
  - "--main"
401
401
  - README.rdoc
@@ -413,7 +413,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
413
413
  version: '0'
414
414
  requirements: []
415
415
  rubygems_version: 3.3.7
416
- signing_key:
416
+ signing_key:
417
417
  specification_version: 4
418
418
  summary: Object-relational mapper framework (part of Rails).
419
419
  test_files: []