Commit f299244099136607fb8da50f39894efbfdfe3a20

Authored by Larissa Reis
1 parent 7f3c26b0

Only shows distinct followers in profile.followers

Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
app/models/profile.rb
... ... @@ -250,7 +250,7 @@ class Profile < ApplicationRecord
250 250 has_many :email_templates, :foreign_key => :owner_id
251 251  
252 252 has_many :profile_followers
253   - has_many :followers, :class_name => 'Person', :through => :profile_followers, :source => :person
  253 + has_many :followers, -> { uniq }, :class_name => 'Person', :through => :profile_followers, :source => :person
254 254  
255 255 # Although this should be a has_one relation, there are no non-silly names for
256 256 # a foreign key on article to reference the template to which it is
... ...