Class: Compass::NotificationController

Inherits:
ApplicationController show all
Defined in:
app/controllers/compass/notification_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#authenticate, #context_modified_at, #current_context, #current_context_id, #validate_context_id

Instance Method Details

#indexObject



5
6
7
8
9
10
11
12
13
# File 'app/controllers/compass/notification_controller.rb', line 5

def index
  expires_in(*Array(Compass.config.notification.cache), public: true)

  providers = Compass::Notification::Provider.global_notifications(current_context)

  return unless stale?(providers, etag: "compass-notification")

  render json: providers
end