Add created_by to invoice and show it

This commit is contained in:
Patrick Gansterer 2016-02-17 16:11:01 +01:00 committed by wvengen
parent 76ea0cc411
commit 3d6f908102
10 changed files with 28 additions and 3 deletions

View file

@ -3,6 +3,7 @@ class Invoice < ActiveRecord::Base
belongs_to :supplier
belongs_to :delivery
belongs_to :order
belongs_to :created_by, :class_name => 'User', :foreign_key => 'created_by_user_id'
validates_presence_of :supplier_id
validates_numericality_of :amount, :deposit, :deposit_credit
@ -17,5 +18,3 @@ class Invoice < ActiveRecord::Base
amount - deposit + deposit_credit
end
end