diff options
author | Camil Staps <info@camilstaps.nl> | 2019-01-25 23:53:00 +0300 |
---|---|---|
committer | Camil Staps <info@camilstaps.nl> | 2019-08-07 21:49:13 +0300 |
commit | 59976090b52d401dc4d23b726b2168186524f269 (patch) | |
tree | 503fb6f0563c866ea1776be3f5ad6bf88672ae92 /app/models | |
parent | 5b20df0a9276bc1250dc8b307adb161b24d9c255 (diff) |
Add /starrers view for projects
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/user.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 4630552e02e..f772e3f6907 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -282,6 +282,7 @@ class User < ApplicationRecord scope :for_todos, -> (todos) { where(id: todos.select(:user_id)) } scope :with_emails, -> { preload(:emails) } scope :with_dashboard, -> (dashboard) { where(dashboard: dashboard) } + scope :has_starred, ->(project) { joins(:users_star_projects).where('users_star_projects.project_id': project.id) } # Limits the users to those that have TODOs, optionally in the given state. # |