Treat missing marshal files as empty record sets#7
Merged
Conversation
MarshalLoader#read_raw raised Errno::ENOENT when the dump file did not exist, which prevented bootstrapping a dataset before any dump was produced. Align the behavior with QueryLoader's empty-table fallback so loading a missing table yields an empty record set instead. Also realign the inner-block indentation in queryable.rb so newer RuboCop (Layout/IndentationWidth) stops flagging it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Newer RuboCop releases activated Style/OneClassPerFile by default, which flags two intentional patterns in this codebase: - The ActiveRecord::Associations::Preloader::Association reopen in lib/simple_master.rb, which is a monkey-patch and not a new class. - STI subclass families colocated in a single model file in the rails_sample. Both patterns are deliberate, so disable the cop project-wide. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
f19cfb7 to
f6e434e
Compare
Patch release covering the MarshalLoader missing-file fix. No public API changes; behavior change is limited to gracefully handling a previously-unhandled error path (missing dump file -> empty record set), matching QueryLoader's existing fallback. Adds CHANGELOG.md (Keep a Changelog format) starting from v1.0.0 so future entries have a home. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
f6e434e to
b437d49
Compare
ysugiyama12
approved these changes
May 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Patch release v1.0.1.
Fix
MarshalLoader#read_rawraisedErrno::ENOENTwhen the dump file was absent, blocking dataset bootstrap before any dump existed.nilfromread_rawand treat it as an empty record set inbuild_records, matchingQueryLoader's empty-table fallback.nil.hash), so a later-appearing file is picked up on the nextload_records.Chore
CHANGELOG.md(Keep a Changelog format) starting from v1.0.0.SimpleMaster::VERSIONto1.0.1.lib/simple_master/master/queryable.rbto satisfy newer RuboCop'sLayout/IndentationWidth(pre-existing offense surfaced after RuboCop updated).Style/OneClassPerFilein.rubocop.yml— the AR preloader monkey-patch inlib/simple_master.rband STI subclass families inrails_sampleare intentional.Compatibility
Errno::ENOENTbeing raised will now receive an empty record set instead. Safe under SemVer patch semantics.Test plan
bundle exec rspec spec/simple_master/loader/marshal_loader_spec.rb— 2 examples, 0 failures (includes the new missing-file case)bundle exec rspecfull suite — 48 examples, 0 failures🤖 Generated with Claude Code