28 lines
859 B
Ruby
28 lines
859 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,
|
|
:original_fpfile_photo, :cropped_fpfile_photo, :crop_selection_photo
|
|
|
|
child :users => :musicians do
|
|
attributes :id, :first_name, :last_name, :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
|
|
|
|
child :genres => :genres do
|
|
attributes :id, :description
|
|
#partial('api_genres/index', :object => @band.genres)
|
|
end
|
|
|
|
if current_user
|
|
node :is_following do |uu|
|
|
current_user.following_band?(@band)
|
|
end
|
|
end |