diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2019-03-12 22:26:45 +0100 |
---|---|---|
committer | Kasper Timm Hansen <kaspth@gmail.com> | 2019-03-12 22:26:49 +0100 |
commit | 65f2eeaaf5774f0891fff700f4defb0b90a05789 (patch) | |
tree | b346236d109eea6d007ce94f9558fa0596f80f21 /activerecord | |
parent | 386e2c7357d8e15ab52f63c7d79101458561fbb1 (diff) | |
download | rails-65f2eeaaf5774f0891fff700f4defb0b90a05789.tar.gz rails-65f2eeaaf5774f0891fff700f4defb0b90a05789.tar.bz2 rails-65f2eeaaf5774f0891fff700f4defb0b90a05789.zip |
Remove Marshal support from SchemaCache
YAML has been used to serialize the schema cache ever since 2016 with
Rails 5.1: 4c00c6ed
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/schema_cache.rb | 10 | ||||
-rw-r--r-- | activerecord/test/cases/connection_adapters/schema_cache_test.rb | 16 |
2 files changed, 0 insertions, 26 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/schema_cache.rb b/activerecord/lib/active_record/connection_adapters/schema_cache.rb index c10765f42d..fd7de1ccf2 100644 --- a/activerecord/lib/active_record/connection_adapters/schema_cache.rb +++ b/activerecord/lib/active_record/connection_adapters/schema_cache.rb @@ -103,16 +103,6 @@ module ActiveRecord @data_sources.delete name end - def marshal_dump - # if we get current version during initialization, it happens stack over flow. - @version = connection.migration_context.current_version - [@version, @columns, @columns_hash, @primary_keys, @data_sources] - end - - def marshal_load(array) - @version, @columns, @columns_hash, @primary_keys, @data_sources = array - end - private def prepare_data_sources diff --git a/activerecord/test/cases/connection_adapters/schema_cache_test.rb b/activerecord/test/cases/connection_adapters/schema_cache_test.rb index 727cab77f5..79067c0f8a 100644 --- a/activerecord/test/cases/connection_adapters/schema_cache_test.rb +++ b/activerecord/test/cases/connection_adapters/schema_cache_test.rb @@ -66,22 +66,6 @@ module ActiveRecord assert_equal 0, @cache.size end - def test_dump_and_load - @cache.columns("posts") - @cache.columns_hash("posts") - @cache.data_sources("posts") - @cache.primary_keys("posts") - - @cache = Marshal.load(Marshal.dump(@cache)) - - assert_no_queries do - assert_equal 12, @cache.columns("posts").size - assert_equal 12, @cache.columns_hash("posts").size - assert @cache.data_sources("posts") - assert_equal "id", @cache.primary_keys("posts") - end - end - def test_data_source_exist assert @cache.data_source_exists?("posts") assert_not @cache.data_source_exists?("foo") |