Class: RailsDrips::DeliveriesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/rails_drips/deliveries_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



5
6
7
8
9
10
11
12
# File 'app/controllers/rails_drips/deliveries_controller.rb', line 5

def show
  @delivery = Delivery.includes(enrollment: :recipient).find(params[:id])
  @show_snapshot = params[:snapshot] == "1"
  return unless @show_snapshot

  allowed = RailsDrips.configuration.snapshot_authorizer.call(controller: self, delivery: @delivery)
  head(:forbidden) unless allowed
end