diff --git a/app/models/user.rb b/app/models/user.rb index f29c0af..8a318e9 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -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