Sha256: deaffa94c2c01bae58f28a47cd1068e91dada88eef24669786af94cf4e90a76e

Contents?: true

Size: 1.25 KB

Versions: 114

Compression:

Stored size: 1.25 KB

Contents

# frozen_string_literal: true

require_dependency "renalware/pathology"

# This class used to include https://github.com/softace/activerecord-tableless but that does not
# support Rails 5. The alternative I have used here is to massage this class to get the specs to
# pass by stubbing out various methods.
# I'm not really sure yet how this class works and why its tableless.
module Renalware
  module Pathology
    module Requests
      class HighRiskRuleSet
        def self.rules
          GlobalRule.where(rule_set_type: name)
        end

        def self.primary_key
          :id
        end

        # NOTE: required so ActiveRecord doesn't try to create a new associated HighRiskRuleSet
        #       record with the audit
        def new_record?
          false
        end

        def to_model
          # noop
        end

        def id
          nil
        end

        def _read_attribute(name)
          # noop
        end

        def self.base_class
          Renalware::Pathology::Requests::HighRiskRuleSet
        end

        # Required for Rails 5.2
        def self.polymorphic_name
          name
        end

        def marked_for_destruction?
          false
        end

        def destroyed?
          false
        end
      end
    end
  end
end

Version data entries

114 entries across 114 versions & 1 rubygems

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