Class: Telephony::Voicemail
- Defined in:
- app/models/telephony/voicemail.rb
Class Method Summary collapse
Instance Method Summary collapse
- #as_json(attributes = {}) ⇒ Object
- #loan_id ⇒ Object
- #transferee_id ⇒ Object
- #transferer_id ⇒ Object
Class Method Details
.filter(args) ⇒ Object
7 8 9 10 11 12 13 |
# File 'app/models/telephony/voicemail.rb', line 7 def self.filter(args) paged = page args[:page] if args[:csr_id].present? paged = paged.where csr_id: args[:csr_id] end paged.per 10 end |
.most_recent ⇒ Object
15 16 17 |
# File 'app/models/telephony/voicemail.rb', line 15 def self.most_recent order("created_at DESC") end |
Instance Method Details
#as_json(attributes = {}) ⇒ Object
19 20 21 22 |
# File 'app/models/telephony/voicemail.rb', line 19 def as_json(attributes = {}) super attributes.merge(only: [:id, :url, :created_at, :duration], methods: %w(loan_id transferer_id transferee_id)) end |
#loan_id ⇒ Object
24 25 26 |
# File 'app/models/telephony/voicemail.rb', line 24 def loan_id call.conversation.loan_id end |
#transferee_id ⇒ Object
32 33 34 |
# File 'app/models/telephony/voicemail.rb', line 32 def transferee_id csr_id end |
#transferer_id ⇒ Object
28 29 30 |
# File 'app/models/telephony/voicemail.rb', line 28 def transferer_id call.conversation.initiator_id end |