Sha256: 2c3ab3eec64bf4341a901a5d2d1b0b88167a4742faaca01ef98ea80a99527a42

Contents?: true

Size: 883 Bytes

Versions: 142

Compression:

Stored size: 883 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware/reporting"

# An Audit Refreshment is a nominal sql-only activity. Its a REST #create action for consistency,
# though nothing is physically created other than an ActiveJob which is queued and which will
# asynchronously refresh the materialized view associated with the audit.
module Renalware
  module Reporting
    class AuditRefreshmentsController < BaseController
      # TODO: Move to Job
      def create
        authorize audit
        RefreshAuditDataJob.perform_later(audit)
        flash.now[:notice] = "Data will be refreshed in the background, please check back later"
        render locals: { audit_id: audit.id }
      end

      private

      def audit
        @audit ||= Audit.find(secure_params[:audit_id])
      end

      def secure_params
        params.permit(:audit_id)
      end
    end
  end
end

Version data entries

142 entries across 142 versions & 1 rubygems

Version Path
renalware-core-2.1.1 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.1.0 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.167 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.166 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.165 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.164 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.163 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.162 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.161 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.160 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.159 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.158 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.157 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.156 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.155 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.153 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.152 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.151 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.149 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.148 app/controllers/renalware/reporting/audit_refreshments_controller.rb