jam-cloud/web/app/views/api_jam_tracks/show.rabl

19 lines
500 B
Ruby

object @jam_track
attributes :id, :name, :description, :recording_type, :original_artist, :songwriter, :publisher, :sales_region, :price, :version
node :genres do |item|
[item.genre.description] # XXX: need to return single genre; not array
end
node :added_cart do |item|
current_user.shopping_carts.where("cart_id='?'",item.id).count != 0
end
child(:jam_track_tracks => :tracks) {
attributes :id, :part, :instrument, :track_type
}
child(:licensor => :licensor) {
attributes :id, :name
}