Fix require_relative path in railtie generators block - #23
Merged
sebscholl merged 1 commit intoMay 5, 2026
Merged
Conversation
The generators block went up three directory levels but the target registry_generator.rb lives only two levels up under lib/generators/. This caused every `rails generate` command to crash with a LoadError in apps that bundle the gem. Fixes zarpay#22.
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.
Fixes #22.
The
generators do ... endblock inAmount::ActiveRecord::Railtiehad an extra..segment in itsrequire_relative, causing allrails generatecommands to crash in apps that bundle the gem.The railtie lives at
gem/lib/amount/active_record/railtie.rb. The target file is atgem/lib/generators/amount/active_record/registry_generator.rb— two levels up and across intogenerators/, not three levels up.Diff is one character (drop one
..):Verification
Reproduced the LoadError on amounts 0.0.7 in a host Rails 8.1 app via
bundle exec rails generate migration FooBar. Patched the railtie in place inside the bundle's gem directory and reran the same command — succeeded, file generated correctly. No other generator paths or app behaviour change.