Class: WinewooCore::Repositories::Mongo::Queries::UserQuery
- Inherits:
-
WinewooQuery
- Object
- WinewooQuery
- WinewooCore::Repositories::Mongo::Queries::UserQuery
- Defined in:
- lib/winewoo_core/repositories/mongo/queries/user_query.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(relation = User) ⇒ UserQuery
constructor
A new instance of UserQuery.
- #with_role(role) ⇒ Object
Methods inherited from WinewooQuery
#method_missing, #respond_to?, #respond_to_missing?
Constructor Details
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class WinewooCore::Repositories::Mongo::Queries::WinewooQuery
Instance Method Details
#with_role(role) ⇒ Object
10 11 12 13 |
# 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 |