24 lines
630 B
Ruby
24 lines
630 B
Ruby
object @music_session
|
|
|
|
attributes :id, :description, :musician_access
|
|
|
|
node :genres do |item|
|
|
item.genres.map(&:description)
|
|
end
|
|
|
|
child(:connections => :participants) {
|
|
collection @music_sessions, :object_root => false
|
|
attributes :ip_address, :client_id
|
|
node(:user_id, :if => lambda { |connection| connection.user.friends?(current_user) }) do |connection|
|
|
connection.user_id
|
|
end
|
|
child(:connection_tracks => :tracks) {
|
|
attributes :id, :instrument_id, :sound
|
|
}
|
|
}
|
|
|
|
child(:invitations => :invitations) {
|
|
collection @music_sessions, :object_root => false
|
|
attributes :id, :sender_id
|
|
}
|