28 lines
854 B
Ruby
28 lines
854 B
Ruby
object @user
|
|
|
|
attributes :id, :first_name, :last_name, :city, :state, :country, :online, :photo_url, :musician, :gender, :birth_date, :internet_service_provider, :friend_count, :follower_count, :following_count, :favorite_count
|
|
|
|
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
|
|
end
|
|
end
|
|
end
|
|
|
|
unless @user.instruments.nil? || @user.instruments.size == 0
|
|
child :musician_instruments => :instruments do
|
|
attributes :description, :proficiency_level, :priority
|
|
node :instrument_id do |instrument|
|
|
instrument.id
|
|
end
|
|
end
|
|
end |