Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 7.1 support #349

Closed
simchikoops opened this issue Sep 29, 2023 · 1 comment · Fixed by #352
Closed

Rails 7.1 support #349

simchikoops opened this issue Sep 29, 2023 · 1 comment · Fixed by #352
Labels
bug Something isn't working help wanted Community assistance requested to be implemented in v1 This issue or pull request will be resolved in the v1 rework, but has not yet been completed.

Comments

@simchikoops
Copy link

Configuration

  • Sorcery Version: 2.0.9
  • Ruby Version: 3.2.2
  • Framework: Rails
  • Platform: Mac

Expected Behavior

Generator

Generator should run successfully.

Actual Behavior

/Users/koops/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activerecord-7.1.0.rc1/lib/active_record/dynamic_matchers.rb:22:in method_missing': undefined method timestamped_migrations' for ActiveRecord::Base:Class (NoMethodError) from /Users/koops/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sorcery-0.16.5/lib/generators/sorcery/install_generator.rb:78:in next_migration_number'
from /Users/koops/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/railties-7.1.0.rc1/lib/rails/generators/migration.rb:43:in set_migration_assigns!' from /Users/koops/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/railties-7.1.0.rc1/lib/rails/generators/migration.rb:59:in migration_template'
from /Users/koops/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sorcery-0.16.5/lib/generators/sorcery/install_generator.rb:65:in copy_migration_files'

Steps to Reproduce

  1. Run rails generate sorcery:install
@joshbuker joshbuker added bug Something isn't working help wanted Community assistance requested to be implemented in v1 This issue or pull request will be resolved in the v1 rework, but has not yet been completed. labels Oct 1, 2023
@whyczz
Copy link

whyczz commented Oct 6, 2023

I got the same issue:

➜ rails g sorcery:install
      create  config/initializers/sorcery.rb
    generate  model User --skip-migration
       rails  generate model User --skip-migration 
      invoke  active_record
      create    app/models/user.rb
      invoke    test_unit
      create      test/models/user_test.rb
      create      test/fixtures/users.yml
      insert  app/models/user.rb
File unchanged! Either the supplied flag value not found or the content has already been inserted!  app/models/user.rb
/Users/a/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activerecord-7.1.0/lib/active_record/dynamic_matchers.rb:22:in `method_missing': undefined method `timestamped_migrations' for ActiveRecord::Base:Class (NoMethodError)
	from /Users/a/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sorcery-0.16.5/lib/generators/sorcery/install_generator.rb:78:in `next_migration_number'
	from /Users/a/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/railties-7.1.0/lib/rails/generators/migration.rb:43:in `set_migration_assigns!'
	from /Users/a/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/railties-7.1.0/lib/rails/generators/migration.rb:59:in `migration_template'
	from /Users/a/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sorcery-0.16.5/lib/generators/sorcery/install_generator.rb:65:in `copy_migration_files'

It seems that 'timestamped_migrations' is deprecated/removed as of rails 5.
That happens in the install generator.

Guess

Closest thing I can find is a configuration value of the same name,
So a change to that should be the fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Community assistance requested to be implemented in v1 This issue or pull request will be resolved in the v1 rework, but has not yet been completed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants