28 lines
740 B
Ruby
28 lines
740 B
Ruby
object @user
|
|
|
|
attributes :id, :name, :city, :state, :country, :online, :photo_url, :friend_count, :follower_count, :following_count
|
|
|
|
unless @user.friends.nil? || @user.friends.size == 0
|
|
child :friends => :friends do
|
|
attributes :id, :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 :id do |instrument|
|
|
instrument.instrument_id
|
|
end
|
|
end
|
|
end |