attr = DS.attr
App.User = DS.Model.extend
  facebook_id: attr('string')
  email: attr('string')
  name: attr('string')
  list: DS.belongsTo('list') # in ember scope not many to many (yet)
  join_requests: DS.hasMany('join_request')
  facebook_image_tag: (->
    facebook_id = @get('facebook_id')
    return '' unless facebook_id
    url = "http://graph.facebook.com/#{facebook_id}/picture?type=square"
    name = @get('name')
    new Handlebars.SafeString "<img src=\"#{url}\" alt=\"#{name}\" title=\"#{name}\" class=\"user-facebook-image\">"
  ).property('facebook_id', 'name')
