class UserDistro

Public Instance Methods

avatar_url() click to toggle source
# File lib/models/user_distro.rb, line 22
def avatar_url 
  avatar = ""
  if self.avatar != nil
    avatar = self.avatar
  else
    hash = Digest::MD5.hexdigest(self.email)
    default = "https://images-backstitch.s3.amazonaws.com/next/logos/backstitch_purple_icon.png"
    avatar = "https://www.gravatar.com/avatar/#{hash}?d=#{default}"
    # "http://unicornify.appspot.com/avatar/#{hash}?s=128"
  end
  avatar
end
managed_feeds() click to toggle source
# File lib/models/user_distro.rb, line 16
def managed_feeds
  self.managed_organizations
      .select("team_feeds.id, feeds.id AS feed_id, teams.id AS team_id, organizations.id AS organization_id, feeds.name, organizations.highlight_color, team_feeds.feed_type")
      .joins({:teams => {:team_feeds => :feed}}).where("team_feeds.feed_type = 'manual'").uniq
end