Module: Renalware::AccountablePresentation
- Extended by:
- ActiveSupport::Concern
- Included in:
- Clinics::VisitPresenter, Events::EventPresenter
- Defined in:
- app/presenters/concerns/renalware/accountable_presentation.rb
Overview
Helper methods to mix in to a Presenter class when displaying objects which include the Accountable module - ie they have updated_by/at properties.
Instance Method Summary collapse
- #been_updated? ⇒ Boolean
- #effective_updated_at ⇒ Object
- #effective_updated_at_date ⇒ Object
- #effective_updated_by ⇒ Object
Instance Method Details
#been_updated? ⇒ Boolean
29 30 31 |
# File 'app/presenters/concerns/renalware/accountable_presentation.rb', line 29 def been_updated? updated_at > created_at end |
#effective_updated_at ⇒ Object
23 24 25 26 27 |
# File 'app/presenters/concerns/renalware/accountable_presentation.rb', line 23 def effective_updated_at return unless been_updated? updated_at end |
#effective_updated_at_date ⇒ Object
17 18 19 20 21 |
# File 'app/presenters/concerns/renalware/accountable_presentation.rb', line 17 def effective_updated_at_date return unless been_updated? updated_at&.to_date end |
#effective_updated_by ⇒ Object
11 12 13 14 15 |
# File 'app/presenters/concerns/renalware/accountable_presentation.rb', line 11 def effective_updated_by return unless been_updated? updated_by&.full_name end |