Skip to content

Commit 65f2eea

Browse files
committed
Remove Marshal support from SchemaCache
YAML has been used to serialize the schema cache ever since 2016 with Rails 5.1: 4c00c6e
1 parent 386e2c7 commit 65f2eea

File tree

2 files changed

+0
-26
lines changed

2 files changed

+0
-26
lines changed

activerecord/lib/active_record/connection_adapters/schema_cache.rb

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,6 @@ def clear_data_source_cache!(name)
103103
@data_sources.delete name
104104
end
105105

106-
def marshal_dump
107-
# if we get current version during initialization, it happens stack over flow.
108-
@version = connection.migration_context.current_version
109-
[@version, @columns, @columns_hash, @primary_keys, @data_sources]
110-
end
111-
112-
def marshal_load(array)
113-
@version, @columns, @columns_hash, @primary_keys, @data_sources = array
114-
end
115-
116106
private
117107

118108
def prepare_data_sources

activerecord/test/cases/connection_adapters/schema_cache_test.rb

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,6 @@ def test_clearing
6666
assert_equal 0, @cache.size
6767
end
6868

69-
def test_dump_and_load
70-
@cache.columns("posts")
71-
@cache.columns_hash("posts")
72-
@cache.data_sources("posts")
73-
@cache.primary_keys("posts")
74-
75-
@cache = Marshal.load(Marshal.dump(@cache))
76-
77-
assert_no_queries do
78-
assert_equal 12, @cache.columns("posts").size
79-
assert_equal 12, @cache.columns_hash("posts").size
80-
assert @cache.data_sources("posts")
81-
assert_equal "id", @cache.primary_keys("posts")
82-
end
83-
end
84-
8569
def test_data_source_exist
8670
assert @cache.data_source_exists?("posts")
8771
assert_not @cache.data_source_exists?("foo")

0 commit comments

Comments
 (0)