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

There are compatibility issues with Rails 7.2 #19

Open
szluyufeng opened this issue Aug 25, 2024 · 4 comments
Open

There are compatibility issues with Rails 7.2 #19

szluyufeng opened this issue Aug 25, 2024 · 4 comments

Comments

@szluyufeng
Copy link

Upgrading to Rails 7.2 gives you an error, which may be a problem with the 'constantize' method.

@huacnlee
Copy link
Member

Please give more error log, I have test in PR #20, it looks like Rails 7.2 can work.

@szluyufeng
Copy link
Author

OK. Thanks for your effort on this.

After upgrading to 7.2, running bin/dev throws this error:

00:58:45 web.1    | => Booting Puma
00:58:45 web.1    | => Rails 7.2.0 application starting in development 
00:58:45 web.1    | => Run `bin/rails server --help` for more startup options
00:58:45 web.1    | Exiting
00:58:45 web.1    | /Users/macbookm2/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activesupport-7.2.0/lib/active_support/inflector/methods.rb:290:in `const_get': uninitialized constant Star (NameError)
00:58:45 web.1    | 
00:58:45 web.1    |       Object.const_get(camel_cased_word)
00:58:45 web.1    |             ^^^^^^^^^^
00:58:45 web.1    |     from /Users/macbookm2/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activesupport-7.2.0/lib/active_support/inflector/methods.rb:290:in `constantize'
00:58:45 web.1    |     from /Users/macbookm2/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activesupport-7.2.0/lib/active_support/core_ext/string/inflections.rb:74:in `constantize'
00:58:45 web.1    |     from /Users/macbookm2/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/action-store-1.1.3/lib/action_store/mixin.rb:41:in `action_store'
00:58:45 web.1    |     from /Users/macbookm2/dev/webtest/app/models/user.rb:69:in `<class:User>'

The code at user.rb:69 is as follows:

class User < ApplicationRecord
  action_store :star, :post, counter_cache: true, action_class_name: 'Star'
end

@huacnlee
Copy link
Member

Do you have models/star.rb, please show me you models folder

@szluyufeng
Copy link
Author

Yes it has.

class Star < Action
  self.table_name = "stars"
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants