Promotion Relation with PromotionProduct

This commit is contained in:
Phyo
2017-08-21 17:46:16 +06:30
parent e3c1dd216a
commit 5a1c161771

View File

@@ -1,2 +1,12 @@
class Promotion < ApplicationRecord
validates_presence_of :promo_code,:promo_start_date,:promo_end_date,:promo_start_hour,:promo_end_hour,:promo_day,:promo_type,:original_product,:min_qty
has_many :promotion_products
accepts_nested_attributes_for :promotion_products , :allow_destroy => true
PROMO_TYPE1 = "Quantity"
PROMO_TYPE2 = "Net_off"
PROMO_TYPE3 = "Net_price"
PROMO_TYPE4 = "Percentage"
end