Rails 5 has the relation now (closes #1)
This commit is contained in:
parent
ac64fed6a8
commit
13bf57d132
1 changed files with 1 additions and 1 deletions
|
@ -32,7 +32,7 @@ class User < ActiveRecord::Base
|
||||||
scope :humans, -> { where.not(id: self.zeus) }
|
scope :humans, -> { where.not(id: self.zeus) }
|
||||||
|
|
||||||
def transactions
|
def transactions
|
||||||
Transaction.where("creditor_id = ? OR debtor_id = ?", id, id)
|
Transaction.where('creditor_id = ?', id).or(Transaction.where('debtor_id = ?', id))
|
||||||
end
|
end
|
||||||
|
|
||||||
def calculate_balance!
|
def calculate_balance!
|
||||||
|
|
Loading…
Reference in a new issue