Sha256: ac70cb63610f52c61e1d86bbbbf4a3ad59aebc76a1219da2d89b657cdf936a5c

Contents?: true

Size: 425 Bytes

Versions: 35

Compression:

Stored size: 425 Bytes

Contents

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

35 entries across 35 versions & 1 rubygems

Version Path
renalware-core-2.0.16 app/documents/renalware/dated_test.rb
renalware-core-2.0.15 app/documents/renalware/dated_test.rb
renalware-core-2.0.14 app/documents/renalware/dated_test.rb
renalware-core-2.0.13 app/documents/renalware/dated_test.rb
renalware-core-2.0.12 app/documents/renalware/dated_test.rb
renalware-core-2.0.11 app/documents/renalware/dated_test.rb
renalware-core-2.0.9 app/documents/renalware/dated_test.rb
renalware-core-2.0.8 app/documents/renalware/dated_test.rb
renalware-core-2.0.7 app/documents/renalware/dated_test.rb
renalware-core-2.0.5 app/documents/renalware/dated_test.rb
renalware-core-2.0.4 app/documents/renalware/dated_test.rb
renalware-core-2.0.3 app/documents/renalware/dated_test.rb
renalware-core-2.0.2 app/documents/renalware/dated_test.rb
renalware-core-2.0.1 app/documents/renalware/dated_test.rb
renalware-core-2.0.0 app/documents/renalware/dated_test.rb
renalware-core-2.0.0.pre.rc13 app/documents/renalware/dated_test.rb
renalware-core-2.0.0.pre.rc11 app/documents/renalware/dated_test.rb
renalware-core-2.0.0.pre.rc10 app/documents/renalware/dated_test.rb
renalware-core-2.0.0.pre.rc9 app/documents/renalware/dated_test.rb
renalware-core-2.0.0.pre.rc8 app/documents/renalware/dated_test.rb