summaryrefslogtreecommitdiff
path: root/app/models/cdr.rb
blob: ff9198fe78c943bd52ca3076f8a3583775ad4597 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
class Cdr < ActiveRecord::Base
  self.table_name = 'cdrs'
  self.primary_key = 'uuid'

  belongs_to :account
  belongs_to :bleg_account
  belongs_to :forwarding_account


  def self.seconds_to_minutes_seconds(call_seconds)
    if call_seconds.to_i > 0
      minutes = (call_seconds / 1.minutes).to_i
      seconds = call_seconds - minutes.minutes.seconds
      return '%i:%02i' % [minutes, seconds]
    end
  end
end