2015-09-08 17:30:13 +02:00
|
|
|
class TransactionDatatable < AjaxDatatablesRails::Base
|
|
|
|
|
|
|
|
def sortable_columns
|
2015-09-08 17:46:07 +02:00
|
|
|
@sortable_columns ||= ['Transaction.id']
|
2015-09-08 17:30:13 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def searchable_columns
|
|
|
|
@searchable_columns ||= []
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def data
|
|
|
|
records.map do |record|
|
2015-09-08 17:46:07 +02:00
|
|
|
[ record.id, record.debtor.name, record.creditor.name, record.amount ]
|
2015-09-08 17:30:13 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def get_raw_records
|
|
|
|
Transaction.all.eager_load(:debtor, :creditor)
|
|
|
|
end
|
|
|
|
end
|