activerecord 7.1.0.rc1 → 7.1.0.rc2
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 +15 -0
- data/lib/active_record/associations.rb +3 -3
- data/lib/active_record/connection_adapters/schema_cache.rb +2 -2
- data/lib/active_record/gem_version.rb +1 -1
- data/lib/active_record/nested_attributes.rb +0 -5
- data/lib/active_record/persistence.rb +1 -1
- data/lib/active_record/querying.rb +2 -2
- data/lib/active_record/railtie.rb +1 -1
- data/lib/active_record/relation/calculations.rb +8 -8
- data/lib/active_record/tasks/sqlite_database_tasks.rb +1 -0
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 105b6eb9b1f55cf060da5abef79eff897bc6cc4ffae4213d00bb60919716de1d
|
4
|
+
data.tar.gz: b2001af69a5d854f66b1f3fd5fc3b2b96161e3185c1b0d11bbcfa606a0a8e3cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a65041e41aa694c421cb83cc41969088ec8c08f5d839fe87b7d9b43c91de2b72d3adb7419858e88fe711654d98b06bf9dad4d8bd6375f4370ff5e40e92782ffb
|
7
|
+
data.tar.gz: 5b821a9ab05cd006337411118066eaf3e46219d8969a414406919a9725927b95e51d70f79d2723e165db58e93417354a697420c531cc53d435b8dd8405d502b1
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
## Rails 7.1.0.rc2 (October 01, 2023) ##
|
2
|
+
|
3
|
+
* Remove -shm and -wal SQLite files when `rails db:drop` is run.
|
4
|
+
|
5
|
+
*Niklas Häusele*
|
6
|
+
|
7
|
+
* Revert the change to raise an `ArgumentError` when `#accepts_nested_attributes_for` is declared more than once for
|
8
|
+
an association in the same class.
|
9
|
+
|
10
|
+
The reverted behavior broke the case where the `#accepts_nested_attributes_for` was defined in a concern and
|
11
|
+
where overridden in the class that included the concern.
|
12
|
+
|
13
|
+
*Rafael Mendonça França*
|
14
|
+
|
15
|
+
|
1
16
|
## Rails 7.1.0.rc1 (September 27, 2023) ##
|
2
17
|
|
3
18
|
* Better naming for unique constraints support.
|
@@ -1505,7 +1505,7 @@ module ActiveRecord
|
|
1505
1505
|
# [+:query_constraints+]
|
1506
1506
|
# Serves as a composite foreign key. Defines the list of columns to be used to query the associated object.
|
1507
1507
|
# This is an optional option. By default Rails will attempt to derive the value automatically.
|
1508
|
-
# When the value is set the Array size must match associated model's primary key or
|
1508
|
+
# When the value is set the Array size must match associated model's primary key or +query_constraints+ size.
|
1509
1509
|
#
|
1510
1510
|
# Option examples:
|
1511
1511
|
# has_many :comments, -> { order("posted_on") }
|
@@ -1689,7 +1689,7 @@ module ActiveRecord
|
|
1689
1689
|
# [+:query_constraints+]
|
1690
1690
|
# Serves as a composite foreign key. Defines the list of columns to be used to query the associated object.
|
1691
1691
|
# This is an optional option. By default Rails will attempt to derive the value automatically.
|
1692
|
-
# When the value is set the Array size must match associated model's primary key or
|
1692
|
+
# When the value is set the Array size must match associated model's primary key or +query_constraints+ size.
|
1693
1693
|
#
|
1694
1694
|
# Option examples:
|
1695
1695
|
# has_one :credit_card, dependent: :destroy # destroys the associated credit card
|
@@ -1866,7 +1866,7 @@ module ActiveRecord
|
|
1866
1866
|
# [+:query_constraints+]
|
1867
1867
|
# Serves as a composite foreign key. Defines the list of columns to be used to query the associated object.
|
1868
1868
|
# This is an optional option. By default Rails will attempt to derive the value automatically.
|
1869
|
-
# When the value is set the Array size must match associated model's primary key or
|
1869
|
+
# When the value is set the Array size must match associated model's primary key or +query_constraints+ size.
|
1870
1870
|
#
|
1871
1871
|
# Option examples:
|
1872
1872
|
# belongs_to :firm, foreign_key: "client_of"
|
@@ -66,7 +66,7 @@ module ActiveRecord
|
|
66
66
|
cache(connection).indexes(connection, table_name)
|
67
67
|
end
|
68
68
|
|
69
|
-
def database_version(connection)
|
69
|
+
def database_version(connection) # :nodoc:
|
70
70
|
cache(connection).database_version(connection)
|
71
71
|
end
|
72
72
|
|
@@ -196,7 +196,7 @@ module ActiveRecord
|
|
196
196
|
@schema_reflection.indexes(@connection, table_name)
|
197
197
|
end
|
198
198
|
|
199
|
-
def database_version
|
199
|
+
def database_version # :nodoc:
|
200
200
|
@schema_reflection.database_version(@connection)
|
201
201
|
end
|
202
202
|
|
@@ -355,17 +355,12 @@ module ActiveRecord
|
|
355
355
|
options.update(attr_names.extract_options!)
|
356
356
|
options.assert_valid_keys(:allow_destroy, :reject_if, :limit, :update_only)
|
357
357
|
options[:reject_if] = REJECT_ALL_BLANK_PROC if options[:reject_if] == :all_blank
|
358
|
-
options[:class] = self
|
359
358
|
|
360
359
|
attr_names.each do |association_name|
|
361
360
|
if reflection = _reflect_on_association(association_name)
|
362
361
|
reflection.autosave = true
|
363
362
|
define_autosave_validation_callbacks(reflection)
|
364
363
|
|
365
|
-
if nested_attributes_options.dig(association_name.to_sym, :class) == self
|
366
|
-
raise ArgumentError, "Already declared #{association_name} as an accepts_nested_attributes association for this class."
|
367
|
-
end
|
368
|
-
|
369
364
|
nested_attributes_options = self.nested_attributes_options.dup
|
370
365
|
nested_attributes_options[association_name.to_sym] = options
|
371
366
|
self.nested_attributes_options = nested_attributes_options
|
@@ -1272,7 +1272,7 @@ module ActiveRecord
|
|
1272
1272
|
def _raise_record_not_destroyed
|
1273
1273
|
@_association_destroy_exception ||= nil
|
1274
1274
|
key = self.class.primary_key
|
1275
|
-
raise @_association_destroy_exception || RecordNotDestroyed.new("Failed to destroy #{self.class} with #{key}=#{
|
1275
|
+
raise @_association_destroy_exception || RecordNotDestroyed.new("Failed to destroy #{self.class} with #{key}=#{id}", self)
|
1276
1276
|
ensure
|
1277
1277
|
@_association_destroy_exception = nil
|
1278
1278
|
end
|
@@ -51,7 +51,7 @@ module ActiveRecord
|
|
51
51
|
_load_from_sql(_query_by_sql(sql, binds, preparable: preparable), &block)
|
52
52
|
end
|
53
53
|
|
54
|
-
# Same as <tt>#find_by_sql</tt> but perform the query asynchronously and returns an ActiveRecord::Promise
|
54
|
+
# Same as <tt>#find_by_sql</tt> but perform the query asynchronously and returns an ActiveRecord::Promise.
|
55
55
|
def async_find_by_sql(sql, binds = [], preparable: nil, &block)
|
56
56
|
_query_by_sql(sql, binds, preparable: preparable, async: true).then do |result|
|
57
57
|
_load_from_sql(result, &block)
|
@@ -102,7 +102,7 @@ module ActiveRecord
|
|
102
102
|
connection.select_value(sanitize_sql(sql), "#{name} Count").to_i
|
103
103
|
end
|
104
104
|
|
105
|
-
# Same as <tt>#count_by_sql</tt> but perform the query asynchronously and returns an ActiveRecord::Promise
|
105
|
+
# Same as <tt>#count_by_sql</tt> but perform the query asynchronously and returns an ActiveRecord::Promise.
|
106
106
|
def async_count_by_sql(sql)
|
107
107
|
connection.select_value(sanitize_sql(sql), "#{name} Count", async: true).then(&:to_i)
|
108
108
|
end
|
@@ -67,7 +67,7 @@ module ActiveRecord
|
|
67
67
|
unless ActiveSupport::Logger.logger_outputs_to?(Rails.logger, STDERR, STDOUT)
|
68
68
|
console = ActiveSupport::Logger.new(STDERR)
|
69
69
|
console.level = Rails.logger.level
|
70
|
-
Rails.logger
|
70
|
+
Rails.logger.broadcast_to(console)
|
71
71
|
end
|
72
72
|
ActiveRecord.verbose_query_logs = false
|
73
73
|
end
|
@@ -93,7 +93,7 @@ module ActiveRecord
|
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
96
|
-
# Same as <tt>#count</tt> but perform the query asynchronously and returns an ActiveRecord::Promise
|
96
|
+
# Same as <tt>#count</tt> but perform the query asynchronously and returns an ActiveRecord::Promise.
|
97
97
|
def async_count(column_name = nil)
|
98
98
|
async.count(column_name)
|
99
99
|
end
|
@@ -106,7 +106,7 @@ module ActiveRecord
|
|
106
106
|
calculate(:average, column_name)
|
107
107
|
end
|
108
108
|
|
109
|
-
# Same as <tt>#average</tt> but perform the query asynchronously and returns an ActiveRecord::Promise
|
109
|
+
# Same as <tt>#average</tt> but perform the query asynchronously and returns an ActiveRecord::Promise.
|
110
110
|
def async_average(column_name)
|
111
111
|
async.average(column_name)
|
112
112
|
end
|
@@ -120,7 +120,7 @@ module ActiveRecord
|
|
120
120
|
calculate(:minimum, column_name)
|
121
121
|
end
|
122
122
|
|
123
|
-
# Same as <tt>#minimum</tt> but perform the query asynchronously and returns an ActiveRecord::Promise
|
123
|
+
# Same as <tt>#minimum</tt> but perform the query asynchronously and returns an ActiveRecord::Promise.
|
124
124
|
def async_minimum(column_name)
|
125
125
|
async.minimum(column_name)
|
126
126
|
end
|
@@ -134,7 +134,7 @@ module ActiveRecord
|
|
134
134
|
calculate(:maximum, column_name)
|
135
135
|
end
|
136
136
|
|
137
|
-
# Same as <tt>#maximum</tt> but perform the query asynchronously and returns an ActiveRecord::Promise
|
137
|
+
# Same as <tt>#maximum</tt> but perform the query asynchronously and returns an ActiveRecord::Promise.
|
138
138
|
def async_maximum(column_name)
|
139
139
|
async.maximum(column_name)
|
140
140
|
end
|
@@ -152,7 +152,7 @@ module ActiveRecord
|
|
152
152
|
end
|
153
153
|
end
|
154
154
|
|
155
|
-
# Same as <tt>#sum</tt> but perform the query asynchronously and returns an ActiveRecord::Promise
|
155
|
+
# Same as <tt>#sum</tt> but perform the query asynchronously and returns an ActiveRecord::Promise.
|
156
156
|
def async_sum(identity_or_column = nil)
|
157
157
|
async.sum(identity_or_column)
|
158
158
|
end
|
@@ -287,7 +287,7 @@ module ActiveRecord
|
|
287
287
|
end
|
288
288
|
end
|
289
289
|
|
290
|
-
# Same as <tt>#pluck</tt> but perform the query asynchronously and returns an ActiveRecord::Promise
|
290
|
+
# Same as <tt>#pluck</tt> but perform the query asynchronously and returns an ActiveRecord::Promise.
|
291
291
|
def async_pluck(*column_names)
|
292
292
|
async.pluck(*column_names)
|
293
293
|
end
|
@@ -315,7 +315,7 @@ module ActiveRecord
|
|
315
315
|
limit(1).pluck(*column_names).then(&:first)
|
316
316
|
end
|
317
317
|
|
318
|
-
# Same as <tt>#pick</tt> but perform the query asynchronously and returns an ActiveRecord::Promise
|
318
|
+
# Same as <tt>#pick</tt> but perform the query asynchronously and returns an ActiveRecord::Promise.
|
319
319
|
def async_pick(*column_names)
|
320
320
|
async.pick(*column_names)
|
321
321
|
end
|
@@ -358,7 +358,7 @@ module ActiveRecord
|
|
358
358
|
result.then { |result| type_cast_pluck_values(result, columns) }
|
359
359
|
end
|
360
360
|
|
361
|
-
# Same as <tt>#ids</tt> but perform the query asynchronously and returns an ActiveRecord::Promise
|
361
|
+
# Same as <tt>#ids</tt> but perform the query asynchronously and returns an ActiveRecord::Promise.
|
362
362
|
def async_ids
|
363
363
|
async.ids
|
364
364
|
end
|
@@ -23,6 +23,7 @@ module ActiveRecord
|
|
23
23
|
db_path = db_config.database
|
24
24
|
file = File.absolute_path?(db_path) ? db_path : File.join(root, db_path)
|
25
25
|
FileUtils.rm(file)
|
26
|
+
FileUtils.rm_f(["#{file}-shm", "#{file}-wal"])
|
26
27
|
rescue Errno::ENOENT => error
|
27
28
|
raise NoDatabaseError.new(error.message)
|
28
29
|
end
|
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.rc2
|
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-
|
11
|
+
date: 2023-10-01 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.rc2
|
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.rc2
|
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.rc2
|
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.rc2
|
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.rc2/activerecord/CHANGELOG.md
|
473
|
+
documentation_uri: https://api.rubyonrails.org/v7.1.0.rc2/
|
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.rc2/activerecord
|
476
476
|
rubygems_mfa_required: 'true'
|
477
477
|
post_install_message:
|
478
478
|
rdoc_options:
|