From f9d4e298ea8051c9bfde4fb834eab003ee463260 Mon Sep 17 00:00:00 2001 From: Markus Doits Date: Tue, 15 Jun 2021 16:59:15 +0200 Subject: [PATCH] allow to manually make role query strict --- lib/rolify/finders.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/rolify/finders.rb b/lib/rolify/finders.rb index c7306ac4..c7110a80 100644 --- a/lib/rolify/finders.rb +++ b/lib/rolify/finders.rb @@ -1,7 +1,7 @@ module Rolify module Finders - def with_role(role_name, resource = nil) - strict = self.strict_rolify and resource and resource != :any + def with_role(role_name, resource = nil, strict = nil) + strict = self.strict_rolify and resource and resource != :any if strict.nil? self.adapter.scope( self, { :name => role_name, :resource => resource }, @@ -46,4 +46,4 @@ def parse_args(args, users, &block) block.call(users_to_add) end end -end \ No newline at end of file +end