Sha256: b052828e85283451896d8525b99f9019a50eb6b92555657cc9a144632d5ad321

Contents?: true

Size: 490 Bytes

Versions: 15

Compression:

Stored size: 490 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware/hd"

module Renalware
  module HD
    class Station < ApplicationRecord
      include Accountable
      include Sortable
      belongs_to :location, class_name: "HD::StationLocation"
      validates :hospital_unit_id, presence: true
      validates :name, uniqueness: { scope: :hospital_unit_id }

      scope :for_unit, ->(id) { where(hospital_unit_id: id) }
      scope :ordered, -> { order(position: :asc) }
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
renalware-core-2.1.1 app/models/renalware/hd/station.rb
renalware-core-2.1.0 app/models/renalware/hd/station.rb
renalware-core-2.0.167 app/models/renalware/hd/station.rb
renalware-core-2.0.166 app/models/renalware/hd/station.rb
renalware-core-2.0.165 app/models/renalware/hd/station.rb
renalware-core-2.0.164 app/models/renalware/hd/station.rb
renalware-core-2.0.163 app/models/renalware/hd/station.rb
renalware-core-2.0.162 app/models/renalware/hd/station.rb
renalware-core-2.0.161 app/models/renalware/hd/station.rb
renalware-core-2.0.160 app/models/renalware/hd/station.rb
renalware-core-2.0.159 app/models/renalware/hd/station.rb
renalware-core-2.0.158 app/models/renalware/hd/station.rb
renalware-core-2.0.157 app/models/renalware/hd/station.rb
renalware-core-2.0.156 app/models/renalware/hd/station.rb
renalware-core-2.0.155 app/models/renalware/hd/station.rb