jam-cloud/web/app/views/api_music_sessions/history_show.rabl

33 lines
688 B
Ruby

object @history
attributes :id, :music_session_id, :description, :fan_access, :genres, :like_count, :comment_count, :created_at
node :share_url do |history|
unless history.share_token.nil?
share_token_url(history.share_token.token)
end
end
child(:user => :creator) {
attributes :name, :photo_url
}
child(:band => :band) {
attributes :name, :photo_url
}
child(:music_session_user_histories => :users) {
attributes :instruments
child(:user => :user) {
attributes :name, :photo_url
}
}
child(:comments => :comments) {
attributes :comment, :created_at
child(:user => :creator) {
attributes :id, :first_name, :last_name, :name, :photo_url, :musician
}
}