Skip to content

Instantly share code, notes, and snippets.

@jraczak
Created May 10, 2012 22:20
Show Gist options
  • Save jraczak/2656268 to your computer and use it in GitHub Desktop.
Save jraczak/2656268 to your computer and use it in GitHub Desktop.
Calculating social cues for venue scores
# Find count of users followed by current user that have submitted scores to Venue
def find_social_scores(venue)
followed_user_ids = self.follows.map { |user|
user.id
}
venue_score_ids = venue.venue_scores.map { |score|
score.user_id
}
(followed_user_ids & venue_score_ids).count
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment