Skip to content

Conversation

@raghubetina
Copy link

@raghubetina raghubetina commented Jul 24, 2025

Hi! Thank you for the library. I've been using it with the updates included in this PR, and thought I would share them back in case they're useful for you too.

  • Fix app name detection for Rails' underscore patterns (e.g., rails_8_template vs rails8_template) by reading database.yml
  • Add support for Rails 8 files: Kamal deploy.yml, PWA manifest, Dockerfile, and multi-database configurations
  • Add safe_replace_into_file() for optional file handling
  • Update file search patterns to include .yml and .json.erb
  • Handle humanized app names in layout titles
  • Update README with Rails 8.0.2 and Ruby 3.4.5 compatibility

The name detection fix addresses the case where a module name like Rails8Template can map to either rails8_template or rails_8_template. The name in database.yml is more reliable.

The generator was incorrectly preventing rename operations when the new folder name matched the current folder name. This change allows the rename to proceed by checking if the new path is different from the current Rails root path before throwing an error.
- Fix app name detection for Rails' underscore patterns (e.g.,
  rails_8_template vs rails8_template) by reading database.yml
- Add support for Rails 8 files: Kamal deploy.yml, PWA manifest,
  Dockerfile, and multi-database configurations
- Add safe_replace_into_file() for optional file handling
- Update file search patterns to include .yml and .json.erb
- Handle humanized app names in layout titles
- Update README with Rails 8.0.2 and Ruby 3.4.5 compatibility

The name detection fix addresses the case where a module name like
`Rails8Template` can map to either `rails8_template` or
`rails_8_template`. The name in `database.yml` is more reliable.
@raghubetina raghubetina force-pushed the rails-8-compatibility branch from e77577c to c95f399 Compare July 24, 2025 13:45
When renaming apps with hyphens (e.g., "api-proxy"), the gem now properly
handles the conversion to underscores in database names. Uses ActiveSupport's
parameterize method to normalize directory names and checks both the original
detected name and the normalized directory name when replacing in config files.

- Added @old_app_name_from_dir to track normalized directory name
- Database replacements now check both variants when they differ
- Also applies to cable.yml, deploy.yml, and production.rb configs
- Added comprehensive tests for hyphen handling scenarios
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