activerecord 7.1.0.rc2 → 7.1.0
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 +5 -0
- data/lib/active_record/associations/preloader.rb +1 -1
- data/lib/active_record/connection_adapters/abstract/transaction.rb +11 -7
- data/lib/active_record/connection_adapters/postgresql/quoting.rb +1 -0
- data/lib/active_record/connection_adapters/postgresql_adapter.rb +1 -3
- data/lib/active_record/gem_version.rb +1 -1
- data/lib/active_record/model_schema.rb +14 -14
- data/lib/active_record/validations/uniqueness.rb +1 -1
- metadata +11 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c1c4576a55f62b03c5c65f85726c7a054dcf2265c0596ab2b836366f70de537
|
4
|
+
data.tar.gz: 8e1a2827cfc53bef1deaba5901134b589bac138711e37ac34fcf95254372b875
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13a36c3bbd80622c3a266fd79883baa35dec93e3624d92718cc0fa56f6f4c23dfab83e6fd702e4a8e35b6e4a6f2e81fcc24f8c9e7a71c8d9e791f71bccb9536e
|
7
|
+
data.tar.gz: 0b132373d4dda124cc61707c5cd9e08e5cabb68815ed8650de2250becc5d0856610b3622a0d18434bd5182d84cf31fb6b20117d5b0d8ef28ef7698fdcfcc28b4
|
data/CHANGELOG.md
CHANGED
@@ -75,7 +75,7 @@ module ActiveRecord
|
|
75
75
|
# for an Author.
|
76
76
|
# - an Array which specifies multiple association names. This array
|
77
77
|
# is processed recursively. For example, specifying <tt>[:avatar, :books]</tt>
|
78
|
-
# allows this method to preload an author's avatar as well as all of
|
78
|
+
# allows this method to preload an author's avatar as well as all of their
|
79
79
|
# books.
|
80
80
|
# - a Hash which specifies multiple association names, as well as
|
81
81
|
# association names for the to-be-preloaded association objects. For
|
@@ -82,8 +82,11 @@ module ActiveRecord
|
|
82
82
|
@base_payload = payload
|
83
83
|
end
|
84
84
|
|
85
|
+
class InstrumentationNotStartedError < ActiveRecordError; end
|
86
|
+
class InstrumentationAlreadyStartedError < ActiveRecordError; end
|
87
|
+
|
85
88
|
def start
|
86
|
-
|
89
|
+
raise InstrumentationAlreadyStartedError.new("Called start on an already started transaction") if @started
|
87
90
|
@started = true
|
88
91
|
|
89
92
|
@payload = @base_payload.dup
|
@@ -92,7 +95,7 @@ module ActiveRecord
|
|
92
95
|
end
|
93
96
|
|
94
97
|
def finish(outcome)
|
95
|
-
|
98
|
+
raise InstrumentationNotStartedError.new("Called finish on a transaction that hasn't started") unless @started
|
96
99
|
@started = false
|
97
100
|
|
98
101
|
@payload[:outcome] = outcome
|
@@ -166,7 +169,7 @@ module ActiveRecord
|
|
166
169
|
end
|
167
170
|
|
168
171
|
def incomplete!
|
169
|
-
@instrumenter.finish(:incomplete)
|
172
|
+
@instrumenter.finish(:incomplete) if materialized?
|
170
173
|
end
|
171
174
|
|
172
175
|
def materialize!
|
@@ -180,6 +183,7 @@ module ActiveRecord
|
|
180
183
|
|
181
184
|
def restore!
|
182
185
|
if materialized?
|
186
|
+
incomplete!
|
183
187
|
@materialized = false
|
184
188
|
materialize!
|
185
189
|
end
|
@@ -348,13 +352,13 @@ module ActiveRecord
|
|
348
352
|
connection.rollback_to_savepoint(savepoint_name) if materialized?
|
349
353
|
end
|
350
354
|
@state.rollback!
|
351
|
-
@instrumenter.finish(:rollback)
|
355
|
+
@instrumenter.finish(:rollback) if materialized?
|
352
356
|
end
|
353
357
|
|
354
358
|
def commit
|
355
359
|
connection.release_savepoint(savepoint_name) if materialized?
|
356
360
|
@state.commit!
|
357
|
-
@instrumenter.finish(:commit)
|
361
|
+
@instrumenter.finish(:commit) if materialized?
|
358
362
|
end
|
359
363
|
|
360
364
|
def full_rollback?; false; end
|
@@ -389,13 +393,13 @@ module ActiveRecord
|
|
389
393
|
def rollback
|
390
394
|
connection.rollback_db_transaction if materialized?
|
391
395
|
@state.full_rollback!
|
392
|
-
@instrumenter.finish(:rollback)
|
396
|
+
@instrumenter.finish(:rollback) if materialized?
|
393
397
|
end
|
394
398
|
|
395
399
|
def commit
|
396
400
|
connection.commit_db_transaction if materialized?
|
397
401
|
@state.full_commit!
|
398
|
-
@instrumenter.finish(:commit)
|
402
|
+
@instrumenter.finish(:commit) if materialized?
|
399
403
|
end
|
400
404
|
end
|
401
405
|
|
@@ -553,6 +553,20 @@ module ActiveRecord
|
|
553
553
|
initialize_find_by_cache
|
554
554
|
end
|
555
555
|
|
556
|
+
def load_schema # :nodoc:
|
557
|
+
return if schema_loaded?
|
558
|
+
@load_schema_monitor.synchronize do
|
559
|
+
return if @columns_hash
|
560
|
+
|
561
|
+
load_schema!
|
562
|
+
|
563
|
+
@schema_loaded = true
|
564
|
+
rescue
|
565
|
+
reload_schema_from_cache # If the schema loading failed half way through, we must reset the state.
|
566
|
+
raise
|
567
|
+
end
|
568
|
+
end
|
569
|
+
|
556
570
|
protected
|
557
571
|
def initialize_load_schema_monitor
|
558
572
|
@load_schema_monitor = Monitor.new
|
@@ -594,20 +608,6 @@ module ActiveRecord
|
|
594
608
|
defined?(@schema_loaded) && @schema_loaded
|
595
609
|
end
|
596
610
|
|
597
|
-
def load_schema
|
598
|
-
return if schema_loaded?
|
599
|
-
@load_schema_monitor.synchronize do
|
600
|
-
return if @columns_hash
|
601
|
-
|
602
|
-
load_schema!
|
603
|
-
|
604
|
-
@schema_loaded = true
|
605
|
-
rescue
|
606
|
-
reload_schema_from_cache # If the schema loading failed half way through, we must reset the state.
|
607
|
-
raise
|
608
|
-
end
|
609
|
-
end
|
610
|
-
|
611
611
|
def load_schema!
|
612
612
|
unless table_name
|
613
613
|
raise ActiveRecord::TableNotSpecified, "#{self} has no table configured. Set one with #{self}.table_name="
|
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: 7.1.0
|
4
|
+
version: 7.1.0
|
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-
|
11
|
+
date: 2023-10-05 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: 7.1.0
|
19
|
+
version: 7.1.0
|
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.0
|
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: 7.1.0
|
33
|
+
version: 7.1.0
|
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: 7.1.0
|
40
|
+
version: 7.1.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: timeout
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -469,10 +469,10 @@ licenses:
|
|
469
469
|
- MIT
|
470
470
|
metadata:
|
471
471
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
472
|
-
changelog_uri: https://github.com/rails/rails/blob/v7.1.0
|
473
|
-
documentation_uri: https://api.rubyonrails.org/v7.1.0
|
472
|
+
changelog_uri: https://github.com/rails/rails/blob/v7.1.0/activerecord/CHANGELOG.md
|
473
|
+
documentation_uri: https://api.rubyonrails.org/v7.1.0/
|
474
474
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
475
|
-
source_code_uri: https://github.com/rails/rails/tree/v7.1.0
|
475
|
+
source_code_uri: https://github.com/rails/rails/tree/v7.1.0/activerecord
|
476
476
|
rubygems_mfa_required: 'true'
|
477
477
|
post_install_message:
|
478
478
|
rdoc_options:
|
@@ -487,9 +487,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
487
487
|
version: 2.7.0
|
488
488
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
489
489
|
requirements:
|
490
|
-
- - "
|
490
|
+
- - ">="
|
491
491
|
- !ruby/object:Gem::Version
|
492
|
-
version:
|
492
|
+
version: '0'
|
493
493
|
requirements: []
|
494
494
|
rubygems_version: 3.4.18
|
495
495
|
signing_key:
|