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.0.pre.rc7 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.0.pre.rc6 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.0.pre.rc5 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.0.pre.rc4 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.0.pre.rc3 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.0.pre.rc1 app/controllers/renalware/reporting/audit_refreshments_controller.rb
renalware-core-2.0.0.pre.beta12 app/controllers/renalware/reporting/audit_refreshments_controller.rb