Promotion Relation with PromotionProduct
This commit is contained in:
@@ -1,2 +1,12 @@
|
|||||||
class Promotion < ApplicationRecord
|
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
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user