Sha256: 5bea38393d7e6da5b6d28ce5a655c6fdf78a293116ed729dea1312324eb898f4

Contents?: true

Size: 852 Bytes

Versions: 27

Compression:

Stored size: 852 Bytes

Contents

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

27 entries across 27 versions & 1 rubygems

Version Path
renalware-core-2.0.16 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.15 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.14 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.13 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.12 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.11 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.9 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.8 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.7 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.5 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.4 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.3 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.2 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.1 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.0 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.0.pre.rc13 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.0.pre.rc11 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.0.pre.rc10 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.0.pre.rc9 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.0.pre.rc8 app/controllers/renalware/reporting/audit_refreshments_controller.rb