Commit b2294d44fea9ff58a4014298c1ff1ededaf9ae36
1 parent
ab843111
Exists in
master
and in
29 other branches
person: simplifying memberships_by_role
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
app/models/person.rb
... | ... | @@ -47,7 +47,7 @@ class Person < Profile |
47 | 47 | end |
48 | 48 | |
49 | 49 | def memberships_by_role(role) |
50 | - Profile.memberships_of(self).all(:conditions => ['role_assignments.role_id = ?', role.id]) | |
50 | + memberships.where('role_assignments.role_id = ?', role.id) | |
51 | 51 | end |
52 | 52 | |
53 | 53 | has_many :friendships, :dependent => :destroy | ... | ... |