vita_app/app/models/commission.rb
Nicolas Bally d52c017848 suite
2016-04-28 22:41:58 +02:00

19 lines
443 B
Ruby

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