Sha256: 3496268e135c8f4933877ab8817249f06bfe5bf14cf9a5b495415e9a6fda8aff

Contents?: true

Size: 422 Bytes

Versions: 19

Compression:

Stored size: 422 Bytes

Contents

require_dependency "renalware/drugs"

module Renalware
  module Drugs
    class Type < ApplicationRecord
      self.table_name = "drug_types"

      has_many :classifications, foreign_key: :drug_type_id, dependent: :destroy
      has_many :drugs, through: :classifications

      include OrderedSetScope

      def self.for(*codes)
        includes(:drugs)
          .ordered_set(:code, codes)
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
renalware-core-2.0.8 app/models/renalware/drugs/type.rb
renalware-core-2.0.7 app/models/renalware/drugs/type.rb
renalware-core-2.0.5 app/models/renalware/drugs/type.rb
renalware-core-2.0.4 app/models/renalware/drugs/type.rb
renalware-core-2.0.3 app/models/renalware/drugs/type.rb
renalware-core-2.0.2 app/models/renalware/drugs/type.rb
renalware-core-2.0.1 app/models/renalware/drugs/type.rb
renalware-core-2.0.0 app/models/renalware/drugs/type.rb
renalware-core-2.0.0.pre.rc13 app/models/renalware/drugs/type.rb
renalware-core-2.0.0.pre.rc11 app/models/renalware/drugs/type.rb
renalware-core-2.0.0.pre.rc10 app/models/renalware/drugs/type.rb
renalware-core-2.0.0.pre.rc9 app/models/renalware/drugs/type.rb
renalware-core-2.0.0.pre.rc8 app/models/renalware/drugs/type.rb
renalware-core-2.0.0.pre.rc7 app/models/renalware/drugs/type.rb
renalware-core-2.0.0.pre.rc6 app/models/renalware/drugs/type.rb
renalware-core-2.0.0.pre.rc5 app/models/renalware/drugs/type.rb
renalware-core-2.0.0.pre.rc4 app/models/renalware/drugs/type.rb
renalware-core-2.0.0.pre.rc3 app/models/renalware/drugs/type.rb
renalware-core-2.0.0.pre.rc1 app/models/renalware/drugs/type.rb