From 2f562b7df3327b329bd697991a3b997ccacfa8f5 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Tue, 9 Jun 2015 07:27:07 -0500 Subject: [PATCH] * working through build issues --- web/app/controllers/api_users_controller.rb | 15 ++++++++++++++- .../views/api_users/broadcast_notification.rabl | 3 +++ web/build | 4 +++- 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 web/app/views/api_users/broadcast_notification.rabl diff --git a/web/app/controllers/api_users_controller.rb b/web/app/controllers/api_users_controller.rb index 09b891261..52b475875 100644 --- a/web/app/controllers/api_users_controller.rb +++ b/web/app/controllers/api_users_controller.rb @@ -13,7 +13,7 @@ class ApiUsersController < ApiController :band_invitation_index, :band_invitation_show, :band_invitation_update, # band invitations :set_password, :begin_update_email, :update_avatar, :delete_avatar, :generate_filepicker_policy, :share_session, :share_recording, - :affiliate_report, :audio_latency] + :affiliate_report, :audio_latency, :broadcast_notification] respond_to :json @@ -804,6 +804,19 @@ class ApiUsersController < ApiController end end + def broadcast_notification + @broadcast = BroadcastNotification.next_broadcast(current_user) + + if @broadcast + # mark it as viewed + @broadcast.did_view(current_user) + respond_with_model(@broadcast) + else + render json: { message: 'Not Found'}, status: 404 + end + + end + ###################### RECORDINGS ####################### # def recording_index # @recordings = User.recording_index(current_user, params[:id]) diff --git a/web/app/views/api_users/broadcast_notification.rabl b/web/app/views/api_users/broadcast_notification.rabl new file mode 100644 index 000000000..6fd4faabf --- /dev/null +++ b/web/app/views/api_users/broadcast_notification.rabl @@ -0,0 +1,3 @@ +object @broadcast + +attributes :message, :button_label, :button_url \ No newline at end of file diff --git a/web/build b/web/build index 264b59d9f..18f6eebdf 100755 --- a/web/build +++ b/web/build @@ -37,8 +37,10 @@ bundle install --path vendor/bundle npm install set +e +echo "cleaning assets from last build" # clean assets, because they may be lingering from last build -bundle exec rake assets:clean +# bundle exec rake assets:clean +rm -rf $DIR/public/assets if [ "$?" = "0" ]; then echo "success: updated dependencies"