Module: Shared::Loanable

Extended by:
ActiveSupport::Concern
Included in:
CollectionObject, Container, Otu
Defined in:
app/models/concerns/shared/loanable.rb

Overview

Shared code for data classes that can be loaned (used in LoanItem).

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary (collapse)

Instance Method Details

- (Object) loan_return_date



18
19
20
# File 'app/models/concerns/shared/loanable.rb', line 18

def loan_return_date
  loan_item.try(:loan).try(:date_return_expected) ? loan_item.loan.date_return_expected : false
end

- (Boolean) on_loan?

Returns:

  • (Boolean)


14
15
16
# File 'app/models/concerns/shared/loanable.rb', line 14

def on_loan?
  !loan_item.blank?
end