Created
April 13, 2009 05:44
-
-
Save sprite2005/94298 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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