Sha256: 824ec8846854dd3539fa7a3c8901b1ab5a2a016d7a2a85008839c0aa84f815f9

Contents?: true

Size: 456 Bytes

Versions: 142

Compression:

Stored size: 456 Bytes

Contents

# frozen_string_literal: true

require "document/enum"

module Renalware
  class DatedTest < NestedAttribute
    attribute :result, Document::Enum, enums: %i(negative positive not_done)
    attribute :recorded_on, Date

    validates :recorded_on, timeliness: { type: :date, allow_blank: true }

    def to_s
      datestamp = recorded_on.present? ? "(#{I18n.l(recorded_on)})" : nil
      [result.try(:text), datestamp].compact.join(" ")
    end
  end
end

Version data entries

142 entries across 142 versions & 1 rubygems

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