action-store
action-store copied to clipboard
There are compatibility issues with Rails 7.2
Upgrading to Rails 7.2 gives you an error, which may be a problem with the 'constantize' method.
Please give more error log, I have test in PR #20, it looks like Rails 7.2 can work.
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
Do you have models/star.rb, please show me you models folder
Yes it has.
class Star < Action
self.table_name = "stars"
end