-
Notifications
You must be signed in to change notification settings - Fork 31
Change way of finding policy for scopes #29
Change way of finding policy for scopes #29
Conversation
c148320
to
897b253
Compare
Codecov Report
@@ Coverage Diff @@
## master #29 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 6 6
Lines 315 344 +29
=====================================
+ Hits 315 344 +29
Continue to review full report at Codecov.
|
But |
Hm, but I wouldn't want to force someone to use the active_model plugin just for this, so I think handling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I include this in the backend, I get:
1) Rest::RepositoriesController successful action: index
Failure/Error: old_resolve.call(resource, arguments, context)
NameError:
uninitialized constant RepositoryPolicy::Scope::Scope
# graphql-pundit/lib/graphql-pundit/instrumenters/scope.rb:43:in `find_scope'
if !inferred?(scope) | ||
scope::Scope | ||
else | ||
infer_from = if root.respond_to?(:model) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment why we do this.
e4a144e
to
7bef11a
Compare
e4f9187 should have fixed the backend error. I think it was some strange interplay with some lazy code (the lambda). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should fix #28. It's not as straight forward as it could be, but unfortunately Pundit only recognizes
model_name
, which is not defined by Sequel.