Created
May 10, 2012 22:20
-
-
Save jraczak/2656268 to your computer and use it in GitHub Desktop.
Calculating social cues for venue scores
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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