commission update

This commit is contained in:
Zin Lin Phyo
2017-08-23 11:14:24 +06:30
parent b53db9b08b
commit 3132bc7c34
13 changed files with 204 additions and 166 deletions

View File

@@ -1,4 +1,4 @@
class Commission < ApplicationRecord
belongs_to :product, foreign_key: 'product_id'
belongs_to :menu_item, foreign_key: 'product_id'
has_many :commissioners
end

View File

@@ -3,6 +3,8 @@ class MenuItem < ApplicationRecord
belongs_to :menu_category, :optional => true
has_many :menu_item_instances
has_many :commissions
# belongs_to :parent, :class_name => "MenuItem", foreign_key: "menu_item_id", :optional => true
# has_many :children, :class_name => "MenuItem", foreign_key: "menu_item_id"
belongs_to :account

View File

@@ -1,6 +1,5 @@
class Product < ApplicationRecord
validates_presence_of :name
has_many :commissions
# Product Image Uploader
mount_uploader :image_path, ProductImageUploader