activerecord 8.0.0.rc2 → 8.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/active_record/attribute_methods.rb +1 -1
- data/lib/active_record/connection_adapters/abstract/database_statements.rb +1 -1
- data/lib/active_record/gem_version.rb +1 -1
- data/lib/active_record/insert_all.rb +1 -1
- data/lib/active_record/persistence.rb +1 -1
- data/lib/active_record/query_cache.rb +4 -1
- data/lib/active_record/relation/query_methods.rb +15 -9
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fdca074c8ca76d0768b2989fb21aaafa5c31f3b80ce1d22275ccfd9d88dd6910
|
4
|
+
data.tar.gz: a282424df2605d4c5239f8eedbeb129fe4190e387e7da03292b6ad13e8b2e0ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f636c65b58ab040b9d820854f97f16df201d08142e50c609bb6acbd1f4817d55c2eeeb3859541c9b26ec47c48b20e01a7ec4e5736a68e6c8ce8d4ecb6342d39a
|
7
|
+
data.tar.gz: 7768bdbf0ff1b8dc3c369fc3168c0c66a56fcf21c00502043f846b1531a8e5962067987e33e43015172a8f346829362598838df197f5fa59f02ed44e9cb6a583
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## Rails 8.0.0 (November 07, 2024) ##
|
2
|
+
|
3
|
+
* Fix support for `query_cache: false` in `database.yml`.
|
4
|
+
|
5
|
+
`query_cache: false` would no longer entirely disable the Active Record query cache.
|
6
|
+
|
7
|
+
*zzak*
|
8
|
+
|
1
9
|
## Rails 8.0.0.rc2 (October 30, 2024) ##
|
2
10
|
|
3
11
|
* NULLS NOT DISTINCT works with UNIQUE CONSTRAINT as well as UNIQUE INDEX.
|
@@ -84,7 +84,7 @@ module ActiveRecord
|
|
84
84
|
attribute_method_patterns_cache.clear
|
85
85
|
end
|
86
86
|
|
87
|
-
def alias_attribute_method_definition(code_generator, pattern, new_name, old_name)
|
87
|
+
def alias_attribute_method_definition(code_generator, pattern, new_name, old_name) # :nodoc:
|
88
88
|
old_name = old_name.to_s
|
89
89
|
|
90
90
|
if !abstract_class? && !has_attribute?(old_name)
|
@@ -674,7 +674,7 @@ module ActiveRecord
|
|
674
674
|
raise AsynchronousQueryInsideTransactionError, "Asynchronous queries are not allowed inside transactions"
|
675
675
|
end
|
676
676
|
|
677
|
-
# We make sure to run query transformers on the
|
677
|
+
# We make sure to run query transformers on the original thread
|
678
678
|
sql = preprocess_query(sql)
|
679
679
|
future_result = async.new(
|
680
680
|
pool,
|
@@ -240,7 +240,7 @@ module ActiveRecord
|
|
240
240
|
|
241
241
|
values_list = insert_all.map_key_with_value do |key, value|
|
242
242
|
next value if Arel::Nodes::SqlLiteral === value
|
243
|
-
|
243
|
+
ActiveModel::Type::SerializeCastValue.serialize(type = types[key], type.cast(value))
|
244
244
|
end
|
245
245
|
|
246
246
|
connection.visitor.compile(Arel::Nodes::ValuesList.new(values_list))
|
@@ -930,7 +930,7 @@ module ActiveRecord
|
|
930
930
|
)
|
931
931
|
|
932
932
|
returning_columns.zip(returning_values).each do |column, value|
|
933
|
-
_write_attribute(column, value) if !_read_attribute(column)
|
933
|
+
_write_attribute(column, type_for_attribute(column).deserialize(value)) if !_read_attribute(column)
|
934
934
|
end if returning_values
|
935
935
|
end
|
936
936
|
|
@@ -35,7 +35,10 @@ module ActiveRecord
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def self.run
|
38
|
-
ActiveRecord::Base.connection_handler.each_connection_pool.reject(&:query_cache_enabled).each
|
38
|
+
ActiveRecord::Base.connection_handler.each_connection_pool.reject(&:query_cache_enabled).each do |pool|
|
39
|
+
next if pool.db_config&.query_cache == false
|
40
|
+
pool.enable_query_cache!
|
41
|
+
end
|
39
42
|
end
|
40
43
|
|
41
44
|
def self.complete(pools)
|
@@ -1914,8 +1914,6 @@ module ActiveRecord
|
|
1914
1914
|
return if with_values.empty?
|
1915
1915
|
|
1916
1916
|
with_statements = with_values.map do |with_value|
|
1917
|
-
raise ArgumentError, "Unsupported argument type: #{with_value} #{with_value.class}" unless with_value.is_a?(Hash)
|
1918
|
-
|
1919
1917
|
build_with_value_from_hash(with_value)
|
1920
1918
|
end
|
1921
1919
|
|
@@ -1966,10 +1964,10 @@ module ActiveRecord
|
|
1966
1964
|
table_name = table_name.name if table_name.is_a?(Symbol)
|
1967
1965
|
case columns
|
1968
1966
|
when Symbol, String
|
1969
|
-
arel_column_with_table(table_name, columns
|
1967
|
+
arel_column_with_table(table_name, columns)
|
1970
1968
|
when Array
|
1971
1969
|
columns.map do |column|
|
1972
|
-
arel_column_with_table(table_name, column
|
1970
|
+
arel_column_with_table(table_name, column)
|
1973
1971
|
end
|
1974
1972
|
else
|
1975
1973
|
raise TypeError, "Expected Symbol, String or Array, got: #{columns.class}"
|
@@ -1979,8 +1977,13 @@ module ActiveRecord
|
|
1979
1977
|
|
1980
1978
|
def arel_column_with_table(table_name, column_name)
|
1981
1979
|
self.references_values |= [Arel.sql(table_name, retryable: true)]
|
1982
|
-
|
1983
|
-
|
1980
|
+
|
1981
|
+
if column_name.is_a?(Symbol) || !column_name.match?(/\W/)
|
1982
|
+
predicate_builder.resolve_arel_attribute(table_name, column_name) do
|
1983
|
+
lookup_table_klass_from_join_dependencies(table_name)
|
1984
|
+
end
|
1985
|
+
else
|
1986
|
+
Arel.sql("#{model.adapter_class.quote_table_name(table_name)}.#{column_name}")
|
1984
1987
|
end
|
1985
1988
|
end
|
1986
1989
|
|
@@ -1996,6 +1999,8 @@ module ActiveRecord
|
|
1996
1999
|
arel_column_with_table(table, column)
|
1997
2000
|
elsif block_given?
|
1998
2001
|
yield field
|
2002
|
+
elsif Arel.arel_node?(field)
|
2003
|
+
field
|
1999
2004
|
else
|
2000
2005
|
Arel.sql(is_symbol ? model.adapter_class.quote_table_name(field) : field)
|
2001
2006
|
end
|
@@ -2138,7 +2143,7 @@ module ActiveRecord
|
|
2138
2143
|
arg.expr.relation.name
|
2139
2144
|
end
|
2140
2145
|
end
|
2141
|
-
end.
|
2146
|
+
end.filter_map { |ref| Arel.sql(ref, retryable: true) if ref }
|
2142
2147
|
end
|
2143
2148
|
|
2144
2149
|
def extract_table_name_from(string)
|
@@ -2232,12 +2237,12 @@ module ActiveRecord
|
|
2232
2237
|
case columns_aliases
|
2233
2238
|
when Hash
|
2234
2239
|
columns_aliases.map do |column, column_alias|
|
2235
|
-
arel_column_with_table(table_name, column
|
2240
|
+
arel_column_with_table(table_name, column)
|
2236
2241
|
.as(model.adapter_class.quote_column_name(column_alias.to_s))
|
2237
2242
|
end
|
2238
2243
|
when Array
|
2239
2244
|
columns_aliases.map do |column|
|
2240
|
-
arel_column_with_table(table_name, column
|
2245
|
+
arel_column_with_table(table_name, column)
|
2241
2246
|
end
|
2242
2247
|
when String, Symbol
|
2243
2248
|
arel_column(key)
|
@@ -2248,6 +2253,7 @@ module ActiveRecord
|
|
2248
2253
|
|
2249
2254
|
def process_with_args(args)
|
2250
2255
|
args.flat_map do |arg|
|
2256
|
+
raise ArgumentError, "Unsupported argument type: #{arg} #{arg.class}" unless arg.is_a?(Hash)
|
2251
2257
|
arg.map { |k, v| { k => v } }
|
2252
2258
|
end
|
2253
2259
|
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: 8.0.0
|
4
|
+
version: 8.0.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: 2024-
|
11
|
+
date: 2024-11-07 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: 8.0.0
|
19
|
+
version: 8.0.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: 8.0.0
|
26
|
+
version: 8.0.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: 8.0.0
|
33
|
+
version: 8.0.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: 8.0.0
|
40
|
+
version: 8.0.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: timeout
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -475,10 +475,10 @@ licenses:
|
|
475
475
|
- MIT
|
476
476
|
metadata:
|
477
477
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
478
|
-
changelog_uri: https://github.com/rails/rails/blob/v8.0.0
|
479
|
-
documentation_uri: https://api.rubyonrails.org/v8.0.0
|
478
|
+
changelog_uri: https://github.com/rails/rails/blob/v8.0.0/activerecord/CHANGELOG.md
|
479
|
+
documentation_uri: https://api.rubyonrails.org/v8.0.0/
|
480
480
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
481
|
-
source_code_uri: https://github.com/rails/rails/tree/v8.0.0
|
481
|
+
source_code_uri: https://github.com/rails/rails/tree/v8.0.0/activerecord
|
482
482
|
rubygems_mfa_required: 'true'
|
483
483
|
post_install_message:
|
484
484
|
rdoc_options:
|
@@ -497,7 +497,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
497
497
|
- !ruby/object:Gem::Version
|
498
498
|
version: '0'
|
499
499
|
requirements: []
|
500
|
-
rubygems_version: 3.5.
|
500
|
+
rubygems_version: 3.5.22
|
501
501
|
signing_key:
|
502
502
|
specification_version: 4
|
503
503
|
summary: Object-relational mapper framework (part of Rails).
|