about summary refs log tree commit diff
path: root/config/environments
diff options
context:
space:
mode:
authorJean byroot Boussier <jean.boussier+github@shopify.com>2023-03-17 13:37:30 +0000
committerGitHub <noreply@github.com>2023-03-17 14:37:30 +0100
commit160f38f03d821b026ea62b09e1c817eb311507e1 (patch)
treec0322430031f5a721c169a9708c8ef87d6e3ac7b /config/environments
parentb22b4bac03182aecdc09e2e6b896ff7ec67d7dd6 (diff)
Workaround the ActiveRecord / Marshal serialization bug on Ruby 3.2 (#24142)
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
Diffstat (limited to 'config/environments')
-rw-r--r--config/environments/test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/config/environments/test.rb b/config/environments/test.rb
index 1328e155a..493b041eb 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -51,6 +51,12 @@ Rails.application.configure do
 
   config.i18n.default_locale = :en
   config.i18n.fallbacks = true
+
+  config.to_prepare do
+    # Force Status to always be SHAPE_TOO_COMPLEX
+    # Ref: https://github.com/mastodon/mastodon/issues/23644
+    10.times { |i| Status.allocate.instance_variable_set(:"@ivar_#{i}", nil) }
+  end
 end
 
 Paperclip::Attachment.default_options[:path] = "#{Rails.root}/spec/test_files/:class/:id_partition/:style.:extension"