Class: WorkAccount

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/work_account.rb

Instance Method Summary collapse

Instance Method Details

#enable_invoicing?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'app/models/work_account.rb', line 10

def enable_invoicing?
  invoice_code && invoice_code.length > 0
end

#total_hoursObject



14
15
16
# File 'app/models/work_account.rb', line 14

def total_hours
  works.inject(BigDecimal('0')) {|total, work| total + work.hours}
end