Sha256: bf72e7a7f5ffb01db5c6e7dae5978e6f0a192ea2dd467f852871786e658b33e9

Contents?: true

Size: 1.18 KB

Versions: 26

Compression:

Stored size: 1.18 KB

Contents

# frozen_string_literal: true

# generado con pg_rails

module Admin
  class EmailLogsController < AdminController
    include PgEngine::Resource

    self.clase_modelo = EmailLog

    before_action(only: :index) { authorize EmailLog }

    before_action :set_instancia_modelo, only: %i[new create show edit update destroy]

    before_action do
      @actions = [
        ["Mailgun sync: #{ENV.fetch('MAILGUN_DOMAIN', nil)}", mailgun_sync_admin_email_logs_path, {
          'data-turbo-method': :post, class: 'me-2 btn btn-primary btn-sm'
        }]
      ]
    end

    def mailgun_sync
      @new_items = PgEngine::Mailgun::LogSync.download
      flash[:success] = "#{@new_items.length} nuevos items"

      redirect_to admin_email_logs_path
    end

    private

    def atributos_permitidos
      %i[email_id log_id event log_level severity timestamp message_id]
    end

    def atributos_para_buscar
      %i[email log_id event log_level severity timestamp message_id]
    end

    def atributos_para_listar
      %i[email log_id event log_level severity timestamp message_id]
    end

    def atributos_para_mostrar
      %i[email log_id event log_level severity timestamp message_id]
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
pg_rails-7.6.17 pg_engine/app/controllers/admin/email_logs_controller.rb
pg_rails-7.6.16 pg_engine/app/controllers/admin/email_logs_controller.rb
pg_rails-7.6.15 pg_engine/app/controllers/admin/email_logs_controller.rb
pg_rails-7.6.14 pg_engine/app/controllers/admin/email_logs_controller.rb
pg_rails-7.6.13 pg_engine/app/controllers/admin/email_logs_controller.rb
pg_rails-7.6.12 pg_engine/app/controllers/admin/email_logs_controller.rb
pg_rails-7.6.11 pg_engine/app/controllers/admin/email_logs_controller.rb
pg_rails-7.6.10 pg_engine/app/controllers/admin/email_logs_controller.rb
pg_rails-7.6.9 pg_engine/app/controllers/admin/email_logs_controller.rb
pg_rails-7.6.8 pg_engine/app/controllers/admin/email_logs_controller.rb
pg_rails-7.6.7 pg_engine/app/controllers/admin/email_logs_controller.rb
pg_rails-7.6.6 pg_engine/app/controllers/admin/email_logs_controller.rb
pg_rails-7.6.5 pg_engine/app/controllers/admin/email_logs_controller.rb
pg_rails-7.6.4 pg_engine/app/controllers/admin/email_logs_controller.rb
pg_rails-7.6.3 pg_engine/app/controllers/admin/email_logs_controller.rb
pg_rails-7.6.2 pg_engine/app/controllers/admin/email_logs_controller.rb
pg_rails-7.6.1 pg_engine/app/controllers/admin/email_logs_controller.rb
pg_rails-7.6.0 pg_engine/app/controllers/admin/email_logs_controller.rb
pg_rails-7.5.7 pg_engine/app/controllers/admin/email_logs_controller.rb
pg_rails-7.5.6 pg_engine/app/controllers/admin/email_logs_controller.rb