Skip to content

Commit

Permalink
Make sure to call strict where
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrjaco12 committed May 30, 2020
1 parent 3d75c65 commit 71dcbec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/rolify/adapters/mongoid/role_adapter.rb
Expand Up @@ -91,7 +91,8 @@ def exists?(relation, column)
end

def scope(relation, conditions, strict)
roles = where(role_class, conditions).map { |role| role.id }
query = strict ? where_strict(role_class, conditions) : where(role_class, conditions)
roles = query.map { |role| role.id }
return [] if roles.size.zero?
query = relation.any_in(:role_ids => roles)
query
Expand Down

0 comments on commit 71dcbec

Please sign in to comment.