32 lines
1.1 KiB
Ruby
32 lines
1.1 KiB
Ruby
object @user
|
|
|
|
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, :band_like_count, :follower_count, :following_count, :band_following_count, :recording_count, :session_count, :show_whats_next
|
|
|
|
# give back more info if the user being fetched is yourself
|
|
if @user == current_user
|
|
attributes :email, :original_fpfile, :cropped_fpfile, :crop_selection, :session_settings
|
|
end
|
|
|
|
unless @user.friends.nil? || @user.friends.size == 0
|
|
child :friends => :friends do
|
|
attributes :id, :first_name, :last_name, :online
|
|
end
|
|
end
|
|
|
|
unless @user.bands.nil? || @user.bands.size == 0
|
|
child :band_musicians => :bands do
|
|
attributes :id, :name, :admin, :photo_url, :logo_url
|
|
|
|
child :genres => :genres do
|
|
attributes :id, :description
|
|
#partial('api_genres/index', :object => @user.bands.genres)
|
|
end
|
|
end
|
|
end
|
|
|
|
unless @user.instruments.nil? || @user.instruments.size == 0
|
|
child :musician_instruments => :instruments do
|
|
attributes :description, :proficiency_level, :priority, :instrument_id
|
|
end
|
|
end
|