diff --git a/app/controllers/api_music_sessions_controller.rb b/app/controllers/api_music_sessions_controller.rb index 5c6b7497f..86427da98 100644 --- a/app/controllers/api_music_sessions_controller.rb +++ b/app/controllers/api_music_sessions_controller.rb @@ -114,7 +114,7 @@ class ApiMusicSessionsController < ApiController # send out notification to queue to the rest of the session # TODO: also this isn't necessarily a user leaving; it's a client leaving' - user_joined = @message_factory.user_joined_music_session(@music_session.id, current_user.id, current_user.name) + user_joined = @message_factory.user_joined_music_session(@music_session.id, current_user.id, current_user.first_name + " " + current_user.last_name) @mq_router.server_publish_to_session(@music_session, user_joined, sender = {:client_id => @connection.client_id}) respond_with @connection, responder: ApiResponder, :location => api_session_participant_detail_url(@connection.client_id) @@ -145,7 +145,7 @@ class ApiMusicSessionsController < ApiController # send out notification to queue to the rest of the session # TODO: we should rename the notification to music_session_participants_change or something # TODO: also this isn't necessarily a user leaving; it's a client leaving' - user_left = @message_factory.user_left_music_session(@music_session.id, current_user.id, current_user.name) + user_left = @message_factory.user_left_music_session(@music_session.id, current_user.id, current_user.first_name + " " + current_user.last_name) @mq_router.server_publish_to_session(@music_session, user_left, sender = {:client_id => @connection.client_id}) end diff --git a/app/views/api_bands/follower_index.rabl b/app/views/api_bands/follower_index.rabl index 3408346cd..c58c0c9ab 100644 --- a/app/views/api_bands/follower_index.rabl +++ b/app/views/api_bands/follower_index.rabl @@ -2,8 +2,12 @@ object @band.followers attributes :follower_id => :user_id -node :name do |follower| - follower.user.name +node :first_name do |follower| + follower.user.first_name +end + +node :last_name do |follower| + follower.user.last_name end node :city do |follower| diff --git a/app/views/api_bands/show.rabl b/app/views/api_bands/show.rabl index 0a942d3c3..1091dfd88 100644 --- a/app/views/api_bands/show.rabl +++ b/app/views/api_bands/show.rabl @@ -4,7 +4,7 @@ attributes :id, :name, :city, :state, :country, :website, :biography, :photo_url unless @band.users.nil? || @band.users.size == 0 child :users => :musicians do - attributes :id, :name, :photo_url + attributes :id, :first_name, :last_name, :photo_url # TODO: figure out how to omit empty arrays node :instruments do |user| diff --git a/app/views/api_search/index.rabl b/app/views/api_search/index.rabl index 05a954b28..92f48b4db 100644 --- a/app/views/api_search/index.rabl +++ b/app/views/api_search/index.rabl @@ -5,11 +5,11 @@ child(:bands => :bands) { } child(:musicians => :musicians) { - attributes :id, :name, :location, :photo_url + attributes :id, :first_name, :last_name :location, :photo_url } child(:fans => :fans) { - attributes :id, :name, :location, :photo_url + attributes :id, :first_name, :last_name, :location, :photo_url } child(:recordings => :recordings) { diff --git a/app/views/api_users/follower_index.rabl b/app/views/api_users/follower_index.rabl index 35122bee5..0d82e3b56 100644 --- a/app/views/api_users/follower_index.rabl +++ b/app/views/api_users/follower_index.rabl @@ -2,8 +2,12 @@ object @user.followers attributes :follower_id => :user_id -node :name do |follower| - follower.user.name +node :first_name do |follower| + follower.user.first_name +end + +node :last_name do |follower| + follower.user.last_name end node :city do |follower| diff --git a/app/views/api_users/following_index.rabl b/app/views/api_users/following_index.rabl index d1a31401b..12afb07f4 100644 --- a/app/views/api_users/following_index.rabl +++ b/app/views/api_users/following_index.rabl @@ -2,8 +2,12 @@ object @user.followings attributes :user_id -node :name do |following| - following.user.name +node :first_name do |following| + following.user.first_name +end + +node :last_name do |following| + following.user.last_name end node :city do |following| diff --git a/app/views/api_users/friend_index.rabl b/app/views/api_users/friend_index.rabl index 3e5c75cd2..9a2f27e74 100644 --- a/app/views/api_users/friend_index.rabl +++ b/app/views/api_users/friend_index.rabl @@ -1,3 +1,3 @@ object @user.friends -attributes :id, :name, :city, :state, :country, :email, :online \ No newline at end of file +attributes :id, :first_name, :last_name, :city, :state, :country, :email, :online \ No newline at end of file diff --git a/app/views/api_users/index.rabl b/app/views/api_users/index.rabl index 34558346d..3064a1366 100644 --- a/app/views/api_users/index.rabl +++ b/app/views/api_users/index.rabl @@ -1,4 +1,4 @@ collection @users # do not retrieve all child collections when showing a list of users -attributes :id, :name, :city, :state, :country, :email, :online, :musician, :photo_url \ No newline at end of file +attributes :id, :first_name, :last_name, :city, :state, :country, :email, :online, :musician, :photo_url \ No newline at end of file diff --git a/app/views/api_users/show.rabl b/app/views/api_users/show.rabl index a4589cac9..809637732 100644 --- a/app/views/api_users/show.rabl +++ b/app/views/api_users/show.rabl @@ -1,10 +1,10 @@ object @user -attributes :id, :name, :city, :state, :country, :email, :online, :photo_url, :friend_count, :follower_count, :following_count +attributes :id, :first_name, :last_name, :city, :state, :country, :email, :online, :photo_url, :friend_count, :follower_count, :following_count unless @user.friends.nil? || @user.friends.size == 0 child :friends => :friends do - attributes :id, :name, :online + attributes :id, :first_name, :last_name, :online end end diff --git a/config/routes.rb b/config/routes.rb index c861a0482..1a38f3a13 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -74,11 +74,7 @@ SampleApp::Application.routes.draw do # band followers match '/bands/:id/followers' => 'api_bands#follower_index', :via => :get -=begin - # band followings - match '/bands/:id/followings' => 'api_bands#following_create', :via => :post - match '/bands/:id/followings/:user_id' => 'api_bands#following_destroy', :via => :delete -=end + # invitations match '/invitations/:id' => 'api_invitations#show', :via => :get, :as => 'api_invitation_detail' match '/invitations/:id' => 'api_invitations#delete', :via => :delete