Skip to content

Update codebase for modern Ruby/Rails compatibility#56

Merged
fusion94 merged 1 commit intomasterfrom
fix/52-modern-gemspec
Mar 15, 2026
Merged

Update codebase for modern Ruby/Rails compatibility#56
fusion94 merged 1 commit intomasterfrom
fix/52-modern-gemspec

Conversation

@fusion94
Copy link
Collaborator

Summary

Update deprecated APIs and dependencies throughout the codebase to support Ruby 3.1+ and Rails 6.1-7.1.

Changes

  • factory_girl → factory_botfactory_girl_rails was renamed to factory_bot_rails in 2017. Updated require, constant references in all specs.
  • RSpec syntax — Replaced legacy .should syntax with modern expect().to throughout.
  • Pagination initializer — Replaced ActionView::Base.send(:alias_method, ...) (removed in Ruby 3.x) with .define_method.
  • Validation syntaxvalidates_presence_ofvalidates :attr, presence: true in app template.
  • Rakefile — Updated rails new generator flags for Rails 7 (removed --skip-yarn, --skip-coffee, --skip-turbolinks, --skip-listen; added --skip-hotwire, --skip-jbuilder, etc.).
  • App template — Added guard for existing files, modernized generator commands.

Test Plan

  • All FactoryBot references resolve correctly
  • RSpec specs use modern expect syntax
  • App template generates a valid Rails 7 dummy app
  • Pagination initializer works without send(:alias_method)

Dependencies

Depends on #51 (CI matrix) being merged first for CI to pass.

Closes #52

- Replace factory_girl_rails with factory_bot_rails
- Replace FactoryGirl with FactoryBot in all specs
- Replace .send(:alias_method) with .define_method for pagination
- Replace validates_presence_of with validates :attr, presence: true
- Replace old rspec 'should' syntax with 'expect' syntax
- Update Rakefile generator flags for Rails 7 compatibility
- Update app_template.rb for Rails 7 generator changes

Refs #52
@fusion94 fusion94 merged commit f0e3b9f into master Mar 15, 2026
0 of 24 checks passed
@fusion94 fusion94 deleted the fix/52-modern-gemspec branch March 15, 2026 04:18
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.

Update gemspec for modern Ruby/Rails compatibility

1 participant