Sha256: 3d597ae22f6dcf27408b367a4498a175ea57bb335ad832fa82169b229489cff5

Contents?: true

Size: 853 Bytes

Versions: 8

Compression:

Stored size: 853 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

8 entries across 8 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.beta11 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.0.pre.beta10 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.0.pre.beta9 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.0.pre.beta8 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.0.pre.beta7 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.0.pre.beta6 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.0.pre.beta5 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.0.pre.beta4 app/controllers/renalware/reporting/audit_refreshments_controller.rb