activerecord 6.0.5.1 → 6.0.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 +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/active_record/coders/yaml_column.rb +15 -5
- data/lib/active_record/core.rb +1 -1
- data/lib/active_record/gem_version.rb +2 -2
- data/lib/active_record/railtie.rb +0 -18
- 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: c6ce12f937513b9efe3578fdbe01cdeee38dbb3d16d38058099f2ab1e1c7e71a
|
4
|
+
data.tar.gz: ec06c07afcbdd62043bce7bb57c0e3fca32658404088b706a2b4188e919e5bf7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d77444fd1cafdcf149d0e64da878e9f756b5a836720fa49145f93520168ed709c52e6e03d7081c2a7916b11cd3f9a4973859257b3f02765c9e504253dbb85783
|
7
|
+
data.tar.gz: 1ef9d00fc16e11d028a464e437f285a3f3d4300295c6d947ef0c9b0e51f377f2015e60166ae4c0ef719f8593f3af151c275cc1377e982405df9dd978736c43cd
|
data/CHANGELOG.md
CHANGED
@@ -45,14 +45,24 @@ module ActiveRecord
|
|
45
45
|
raise ArgumentError, "Cannot serialize #{object_class}. Classes passed to `serialize` must have a 0 argument constructor."
|
46
46
|
end
|
47
47
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
else
|
52
|
-
if YAML.respond_to?(:unsafe_load)
|
48
|
+
if YAML.respond_to?(:unsafe_load)
|
49
|
+
def yaml_load(payload)
|
50
|
+
if ActiveRecord::Base.use_yaml_unsafe_load
|
53
51
|
YAML.unsafe_load(payload)
|
52
|
+
elsif YAML.method(:safe_load).parameters.include?([:key, :permitted_classes])
|
53
|
+
YAML.safe_load(payload, permitted_classes: ActiveRecord::Base.yaml_column_permitted_classes, aliases: true)
|
54
54
|
else
|
55
|
+
YAML.safe_load(payload, ActiveRecord::Base.yaml_column_permitted_classes, [], true)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
else
|
59
|
+
def yaml_load(payload)
|
60
|
+
if ActiveRecord::Base.use_yaml_unsafe_load
|
55
61
|
YAML.load(payload)
|
62
|
+
elsif YAML.method(:safe_load).parameters.include?([:key, :permitted_classes])
|
63
|
+
YAML.safe_load(payload, permitted_classes: ActiveRecord::Base.yaml_column_permitted_classes, aliases: true)
|
64
|
+
else
|
65
|
+
YAML.safe_load(payload, ActiveRecord::Base.yaml_column_permitted_classes, [], true)
|
56
66
|
end
|
57
67
|
end
|
58
68
|
end
|
data/lib/active_record/core.rb
CHANGED
@@ -136,7 +136,7 @@ module ActiveRecord
|
|
136
136
|
|
137
137
|
# Application configurable array that provides additional permitted classes
|
138
138
|
# to Psych safe_load in the YAML Coder
|
139
|
-
mattr_accessor :yaml_column_permitted_classes, instance_writer: false, default: []
|
139
|
+
mattr_accessor :yaml_column_permitted_classes, instance_writer: false, default: [Symbol]
|
140
140
|
|
141
141
|
class_attribute :default_connection_handler, instance_writer: false
|
142
142
|
|
@@ -259,23 +259,5 @@ To keep using the current cache store, you can turn off cache versioning entirel
|
|
259
259
|
self.filter_attributes += Rails.application.config.filter_parameters
|
260
260
|
end
|
261
261
|
end
|
262
|
-
|
263
|
-
initializer "active_record.use_yaml_unsafe_load" do |app|
|
264
|
-
config.after_initialize do
|
265
|
-
unless app.config.active_record.use_yaml_unsafe_load.nil?
|
266
|
-
ActiveRecord::Base.use_yaml_unsafe_load =
|
267
|
-
app.config.active_record.use_yaml_unsafe_load
|
268
|
-
end
|
269
|
-
end
|
270
|
-
end
|
271
|
-
|
272
|
-
initializer "active_record.yaml_column_permitted_classes" do |app|
|
273
|
-
config.after_initialize do
|
274
|
-
unless app.config.active_record.yaml_column_permitted_classes.nil?
|
275
|
-
ActiveRecord::Base.yaml_column_permitted_classes =
|
276
|
-
app.config.active_record.yaml_column_permitted_classes
|
277
|
-
end
|
278
|
-
end
|
279
|
-
end
|
280
262
|
end
|
281
263
|
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: 6.0.
|
4
|
+
version: 6.0.6
|
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: 2022-
|
11
|
+
date: 2022-09-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.0.
|
19
|
+
version: 6.0.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.0.
|
26
|
+
version: 6.0.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.0.
|
33
|
+
version: 6.0.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.0.
|
40
|
+
version: 6.0.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.
|
@@ -391,10 +391,10 @@ licenses:
|
|
391
391
|
- MIT
|
392
392
|
metadata:
|
393
393
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
394
|
-
changelog_uri: https://github.com/rails/rails/blob/v6.0.
|
395
|
-
documentation_uri: https://api.rubyonrails.org/v6.0.
|
394
|
+
changelog_uri: https://github.com/rails/rails/blob/v6.0.6/activerecord/CHANGELOG.md
|
395
|
+
documentation_uri: https://api.rubyonrails.org/v6.0.6/
|
396
396
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
397
|
-
source_code_uri: https://github.com/rails/rails/tree/v6.0.
|
397
|
+
source_code_uri: https://github.com/rails/rails/tree/v6.0.6/activerecord
|
398
398
|
rubygems_mfa_required: 'true'
|
399
399
|
post_install_message:
|
400
400
|
rdoc_options:
|