remove use of #all in policy scopes

This commit is contained in:
James Smith committed 2025-02-27 10:26:30 +00:00
1 parent 8b18374db2
commit a052d46f96
6 files changed
+6 -6

No files matched your search

@@ -10,7 +10,7 @@ class ActsAsTaggableOn::TagPolicy < ApplicationPolicy
end
def resolve
scope.all
scope
end
end
end
@@ -10,7 +10,7 @@ class ActsAsTaggableOn::TaggingPolicy < ApplicationPolicy
end
def resolve
scope.all
scope
end
end
end
+1 -1
View File
@@ -61,7 +61,7 @@ class ApplicationPolicy
end
def resolve
return scope.all if user&.is_moderator? || !scope.respond_to?(:granted_to)
return scope if user&.is_moderator? || !scope.respond_to?(:granted_to)
result = scope.granted_to(["view", "edit", "own"], [user, nil])
result = result.or(scope.granted_to(["view", "edit", "own"], user.roles)) if user
+1 -1
View File
@@ -8,7 +8,7 @@ class LinkPolicy < ApplicationPolicy
end
def resolve
scope.all
scope
end
end
end
+1 -1
View File
@@ -13,7 +13,7 @@ class ProblemPolicy < ApplicationPolicy
class Scope < ApplicationPolicy::Scope
def resolve
scope.all
scope
end
end
end
+1 -1
View File
@@ -59,7 +59,7 @@ class UserPolicy < ApplicationPolicy
end
def resolve
scope.all
scope
end
end
end