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

Eager autoloading required to avoid errors #2

Open
mach-kernel opened this issue Jul 17, 2018 · 0 comments
Open

Eager autoloading required to avoid errors #2

mach-kernel opened this issue Jul 17, 2018 · 0 comments

Comments

@mach-kernel
Copy link
Owner

[2] pry(main)> Ability.new(User.first)
D, [2018-07-16T21:31:37.434025 #13581] DEBUG -- :   User Load (0.4ms)  SELECT  "users".* FROM "use
rs" ORDER BY "users"."id" ASC LIMIT $1  [["LIMIT", 1]]
D, [2018-07-16T21:31:37.435883 #13581] DEBUG -- :    (0.3ms)  SELECT "roles"."name" FROM "roles" I
NNER JOIN "roles_users" ON "roles"."id" = "roles_users"."role_id" WHERE "roles_users"."user_id" =
$1  [["user_id", 1]]
NoMethodError: undefined method `permissions' for nil:NilClass
from /Users/mach/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/bundler/gems/warhol-206ccd0bdd0b/lib/wa
rhol/router.rb:37:in `block in apply_permissions'

Can be resolved with, but needs documentation:

Policy.constants.each { |c| Policy.const_get(c)
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