26 lines
825 B
Ruby
26 lines
825 B
Ruby
object @band
|
|
|
|
attributes :id, :name, :city, :state, :country, :location, :website, :biography, :photo_url, :logo_url, :liker_count, :follower_count, :recording_count, :session_count
|
|
|
|
unless @band.users.nil? || @band.users.size == 0
|
|
child :users => :musicians do
|
|
attributes :id, :first_name, :last_name, :photo_url
|
|
|
|
# TODO: figure out how to omit empty arrays
|
|
node :instruments do |user|
|
|
unless user.instruments.nil? || user.instruments.size == 0
|
|
child :musician_instruments => :instruments do
|
|
attributes :instrument_id, :description, :proficiency_level, :priority
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
unless @band.genres.nil? || @band.genres.size == 0
|
|
child :genres => :genres do
|
|
attributes :id, :description
|
|
#partial('api_genres/index', :object => @band.genres)
|
|
end
|
|
end
|