Skip to content

Fix serialization error when caching get_all results#978

Merged
jnunemaker merged 1 commit intomainfrom
debug-dalli-meta-error
Feb 19, 2026
Merged

Fix serialization error when caching get_all results#978
jnunemaker merged 1 commit intomainfrom
debug-dalli-meta-error

Conversation

@jnunemaker
Copy link
Collaborator

Summary

Fix TypeError: can't dump hash with default proc error when caching get_all results with ActiveSupportCacheStore.

The active_record, mongo, and sequel adapters create result hashes with Hash.new { } for convenient auto-initialization during construction. However, the default_proc prevents Marshal.dump serialization when the cache layer tries to persist the results.

Changes

Remove default_proc from result hashes before returning from get_all in all three affected adapters. The default_proc is only needed during construction and is no longer necessary once the hash is fully populated.

🤖 Generated with Claude Code

@jnunemaker jnunemaker force-pushed the debug-dalli-meta-error branch from f339641 to 8b2cc62 Compare February 19, 2026 03:39
Remove default_proc from result hashes in active_record, mongo, and sequel
adapters before returning from get_all. The default_proc is used as a
convenience during hash construction but prevents Marshal.dump serialization
when results are cached by ActiveSupportCacheStore.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@jnunemaker jnunemaker force-pushed the debug-dalli-meta-error branch from 8b2cc62 to 0f3ba42 Compare February 19, 2026 03:40
@jnunemaker jnunemaker merged commit 8c4ee2f into main Feb 19, 2026
46 checks passed
@jnunemaker jnunemaker deleted the debug-dalli-meta-error branch February 19, 2026 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant