Added Zeus user
This commit is contained in:
parent
d48f5ffa2a
commit
1233431d14
1 changed files with 4 additions and 1 deletions
|
@ -18,7 +18,6 @@ class User < ActiveRecord::Base
|
|||
class_name: 'Transaction', foreign_key: 'debtor_id'
|
||||
|
||||
validates :name, presence: true, uniqueness: true
|
||||
validates :balance, presence: true
|
||||
|
||||
def transactions
|
||||
Transaction.where("creditor_id = ? OR debtor_id = ?", id, id)
|
||||
|
@ -35,4 +34,8 @@ class User < ActiveRecord::Base
|
|||
user.name = auth.uid
|
||||
end
|
||||
end
|
||||
|
||||
def self.zeus
|
||||
@@zeus ||= find_or_create_by name: 'Zeus'
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue