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

has_role? does not work for new_records #593

Open
akefeli opened this issue Aug 14, 2023 · 0 comments
Open

has_role? does not work for new_records #593

akefeli opened this issue Aug 14, 2023 · 0 comments

Comments

@akefeli
Copy link

akefeli commented Aug 14, 2023

irb(main):045:0> u=User.new
irb(main):046:0> u.add_role :admin
irb(main):047:0> u.has_role? :admin


.../lib/ruby/gems/3.2.0/gems/activemodel-7.0.6/lib/active_model/attribute_methods.rb:450:in `method_missing': undefined method `resource' for #<Role id: 1, name: "ad
min", resource_type: nil, resource_id: nil, created_at: "2023-07-09 22:46:05.337459000 +0000", updated_at: "2023-07-09 22:46:05.337459000 +0000"> (NoMethodError)
Did you mean?  resource_id

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

No branches or pull requests

1 participant