collection @musicians

attributes :id, :first_name, :last_name, :name, :city, :state, :country, :location, :online, :photo_url, :musician, :gender, :birth_date, :internet_service_provider, :friend_count, :liker_count, :like_count, :follower_count, :following_count, :recording_count, :session_count, :biography

node :band_admin do |musician|
  musician.respond_to?(:band_admin) && 't' == musician.band_admin ? true : false
end

node :invitation_id do |musician|
  musician.respond_to?(:invitation_id) ? musician.invitation_id : nil
end

node :instruments do |musician|
  unless musician.instruments.nil? || musician.instruments.size == 0
    child :musician_instruments => :instruments do
      attributes :description, :proficiency_level, :priority, :instrument_id
    end
  end
end

node :biography do |musician|
  musician.biography.nil? ? "" : musician.biography
end

if current_user
  node :is_following do |musician|
    current_user.following?(musician)
  end
  
  node :is_liking do |musician|
    current_user.likes?(musician)
  end
end
