rafaels88/pinfluence

View on GitHub
apps/admin/controllers/moments/destroy.rb

Summary

Maintainability
A
15 mins
Test Coverage
module Admin::Controllers::Moments
  class Destroy
    include Admin::Action

    def call(params)
      DestroyMoment.call(params[:id])
    rescue StandardError => e
      flash[:error] = e.message
    ensure
      redirect_to routes.moments_path
    end
  end
end