Commit 790373996df1772d432f255c80cc456d9bbf5047
1 parent
37e4ba3e
Exists in
master
and in
29 other branches
Using proper ActiveRecord relationships
All related tests still pass. (ActionItem1659)
Showing
2 changed files
with
2 additions
and
3 deletions
Show diff stats
app/models/environment_mailing.rb
app/models/organization_mailing.rb
... | ... | @@ -5,8 +5,7 @@ class OrganizationMailing < Mailing |
5 | 5 | end |
6 | 6 | |
7 | 7 | def recipient(offset=0) |
8 | - environment_id = source.environment_id | |
9 | - Person.find(:first, :conditions => ['environment_id = ? and role_assignments.resource_type = ? and role_assignments.resource_id = ?', environment_id, 'Profile', source.id], :include => :role_assignments, :order => "profiles.id", :offset => offset) | |
8 | + source.members.first(:order => :id, :offset => offset) | |
10 | 9 | end |
11 | 10 | |
12 | 11 | def each_recipient | ... | ... |