Skip to content

Instantly share code, notes, and snippets.

@sprite2005
Created April 13, 2009 05:44
Show Gist options
  • Save sprite2005/94298 to your computer and use it in GitHub Desktop.
Save sprite2005/94298 to your computer and use it in GitHub Desktop.
class CallLog < ActiveRecord::Base
has_one :transaction, :as => :transaction_object
composed_of :rate, :class_name => "Money", :mapping => [%w(rate_cents cents), %w(currency currency) ]
def update_call_time(session)
if session.in_conference?
time = Time.now - last_billed_time
self.last_billed_time = Time.now
self.billable_time = billable_time + time
save!
session.transaction.update_phone_transaction
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment