negos_app/app/models/commission.rb
Nicolas Bally 772e87ffb7 initial
2015-11-14 00:08:54 +01:00

16 lines
370 B
Ruby

class Commission < ActiveRecord::Base
belongs_to :customer
has_one :order_solde, :class_name => "Order"
belongs_to :order
belongs_to :count_part_com
has_one :virement
after_create do
if self.commission_type_id == 1 or self.commission_type_id == 2 or self.commission_type_id == 3
CustomerMailer.new_commission(self).deliver
end
end
end