Skip to content

Commit 89d8ff4

Browse files
committed
add scope for team members
1 parent e0db393 commit 89d8ff4

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Gemfile.lock

+3
Original file line numberDiff line numberDiff line change
@@ -803,3 +803,6 @@ DEPENDENCIES
803803
uglifier!
804804
vcr!
805805
webmock (< 1.16)!
806+
807+
BUNDLED WITH
808+
1.10.5

app/models/teams/member.rb

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ class Teams::Member < ActiveRecord::Base
3030
scope :pending, -> { where(state: 'pending') }
3131
scope :sorted, -> { active.joins(:user).order('users.score_cache DESC') }
3232
scope :top, ->(limit= 1) { sorted.limit(limit) }
33+
scope :members, -> { where(role: 'member') }
34+
scope :admins, -> { where(role: 'admin') }
3335

3436
def score
3537
badges.all.sum(&:weight)

0 commit comments

Comments
 (0)