class WinewooCore::Repositories::Mongo::Queries::UserQuery
Public Class Methods
new(relation = User)
click to toggle source
Calls superclass method
# File lib/winewoo_core/repositories/mongo/queries/user_query.rb, line 5 def initialize(relation = User) super relation end
Public Instance Methods
with_role(role) { |user| ... }
click to toggle source
# File lib/winewoo_core/repositories/mongo/queries/user_query.rb, line 10 def with_role(role) @relation = @relation.where(user_roles: role) block_given? ? @relation.each { |user| yield user } : self end