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.0.127 app/documents/renalware/dated_test.rb
renalware-core-2.0.126 app/documents/renalware/dated_test.rb
renalware-core-2.0.125 app/documents/renalware/dated_test.rb
renalware-core-2.0.124 app/documents/renalware/dated_test.rb
renalware-core-2.0.123 app/documents/renalware/dated_test.rb
renalware-core-2.0.121 app/documents/renalware/dated_test.rb
renalware-core-2.0.120 app/documents/renalware/dated_test.rb
renalware-core-2.0.119 app/documents/renalware/dated_test.rb
renalware-core-2.0.118 app/documents/renalware/dated_test.rb
renalware-core-2.0.117 app/documents/renalware/dated_test.rb
renalware-core-2.0.116 app/documents/renalware/dated_test.rb
renalware-core-2.0.115 app/documents/renalware/dated_test.rb
renalware-core-2.0.113 app/documents/renalware/dated_test.rb
renalware-core-2.0.112 app/documents/renalware/dated_test.rb
renalware-core-2.0.111 app/documents/renalware/dated_test.rb
renalware-core-2.0.110 app/documents/renalware/dated_test.rb
renalware-core-2.0.109 app/documents/renalware/dated_test.rb
renalware-core-2.0.108 app/documents/renalware/dated_test.rb
renalware-core-2.0.106 app/documents/renalware/dated_test.rb
renalware-core-2.0.105 app/documents/renalware/dated_test.rb