Sha256: db2362c3e0befc08c732f0228e0b1aabc64f742e9ba20dc80f10c8f2641c8351
Contents?: true
Size: 593 Bytes
Versions: 44
Compression:
Stored size: 593 Bytes
Contents
# frozen_string_literal: true require "attr_extras" require_dependency "renalware/hd" module Renalware module HD module SessionForms class Batch < ApplicationRecord include Accountable enum status: { queued: 0, processing: 10, awaiting_printing: 15, failure: 20, success: 30 } has_many( :items, dependent: :restrict_with_exception, class_name: "BatchItem" ) def percent_complete ((items.where(status: :compiled).count.to_f / batch_items_count) * 100).ceil end end end end end
Version data entries
44 entries across 44 versions & 1 rubygems