added analytics to user/band details

This commit is contained in:
Brian Smith 2012-11-05 23:47:50 -05:00
parent 4536cdc4eb
commit 78445ba25b
2 changed files with 16 additions and 0 deletions

View File

@ -28,6 +28,10 @@ module JamRuby
@logo_url = "http://www.jamkazam.com/images/bands/logos/#{self.id}.gif"
end
def follower_count
return self.followers.size
end
# helper method for creating / updating a Band
def self.save(params)
if params[:id].nil?

View File

@ -83,6 +83,18 @@ module JamRuby
return self.friends.exists?(user)
end
def friend_count
return self.friends.size
end
def follower_count
return self.followers.size
end
def following_count
return self.followings.size
end
def to_s
return email unless email.nil?
return name unless name.nil?