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.84 app/documents/renalware/dated_test.rb
renalware-core-2.0.83 app/documents/renalware/dated_test.rb
renalware-core-2.0.82 app/documents/renalware/dated_test.rb
renalware-core-2.0.81 app/documents/renalware/dated_test.rb
renalware-core-2.0.80 app/documents/renalware/dated_test.rb
renalware-core-2.0.79 app/documents/renalware/dated_test.rb
renalware-core-2.0.78 app/documents/renalware/dated_test.rb
renalware-core-2.0.77 app/documents/renalware/dated_test.rb
renalware-core-2.0.76 app/documents/renalware/dated_test.rb
renalware-core-2.0.75 app/documents/renalware/dated_test.rb
renalware-core-2.0.74 app/documents/renalware/dated_test.rb
renalware-core-2.0.73 app/documents/renalware/dated_test.rb
renalware-core-2.0.72 app/documents/renalware/dated_test.rb
renalware-core-2.0.71 app/documents/renalware/dated_test.rb
renalware-core-2.0.70 app/documents/renalware/dated_test.rb
renalware-core-2.0.69 app/documents/renalware/dated_test.rb
renalware-core-2.0.68 app/documents/renalware/dated_test.rb
renalware-core-2.0.67 app/documents/renalware/dated_test.rb
renalware-core-2.0.64 app/documents/renalware/dated_test.rb
renalware-core-2.0.63 app/documents/renalware/dated_test.rb