Class: AdminWebHookSerializer

Inherits:
ApplicationSerializer show all
Defined in:
app/serializers/admin_web_hook_serializer.rb

Instance Method Summary collapse

Methods inherited from ApplicationSerializer

expire_cache_fragment!, fragment_cache

Methods inherited from ActiveModel::Serializer

#include!

Instance Method Details

#last_delivery_statusObject



27
28
29
# File 'app/serializers/admin_web_hook_serializer.rb', line 27

def last_delivery_status
  object.active ? object.last_delivery_status : WebHook.last_delivery_statuses[:disabled]
end

#web_hook_event_typesObject



23
24
25
# File 'app/serializers/admin_web_hook_serializer.rb', line 23

def web_hook_event_types
  ActiveModel::ArraySerializer.new(object.web_hook_event_types).as_json
end