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.62 app/documents/renalware/dated_test.rb
renalware-core-2.0.61 app/documents/renalware/dated_test.rb
renalware-core-2.0.60 app/documents/renalware/dated_test.rb
renalware-core-2.0.58 app/documents/renalware/dated_test.rb
renalware-core-2.0.57 app/documents/renalware/dated_test.rb
renalware-core-2.0.56 app/documents/renalware/dated_test.rb
renalware-core-2.0.55 app/documents/renalware/dated_test.rb
renalware-core-2.0.54 app/documents/renalware/dated_test.rb
renalware-core-2.0.53 app/documents/renalware/dated_test.rb
renalware-core-2.0.52 app/documents/renalware/dated_test.rb
renalware-core-2.0.51 app/documents/renalware/dated_test.rb
renalware-core-2.0.50 app/documents/renalware/dated_test.rb
renalware-core-2.0.48 app/documents/renalware/dated_test.rb
renalware-core-2.0.47 app/documents/renalware/dated_test.rb
renalware-core-2.0.46 app/documents/renalware/dated_test.rb
renalware-core-2.0.45 app/documents/renalware/dated_test.rb
renalware-core-2.0.44 app/documents/renalware/dated_test.rb
renalware-core-2.0.43 app/documents/renalware/dated_test.rb
renalware-core-2.0.42 app/documents/renalware/dated_test.rb
renalware-core-2.0.41 app/documents/renalware/dated_test.rb