|
|
@@ -9,6 +9,8 @@ class Product < ActiveRecord::Base
|
|
|
belongs_to :product_sale_type, :foreign_key => :sale_zone
|
|
|
|
|
|
belongs_to :merchant, :foreign_key => :merchant_id
|
|
|
+ has_and_belongs_to_many :depart_record
|
|
|
+
|
|
|
validates :product_no,:name,:buy_price,:price,:category_id,:count,:robo_balance_price,:relate_product_id, presence: true
|
|
|
validate :product_validation
|
|
|
validates :id, presence: true, uniqueness: true
|
|
|
@@ -231,6 +233,7 @@ class Product < ActiveRecord::Base
|
|
|
end
|
|
|
field :out_nums
|
|
|
field :key_words
|
|
|
+ #field :depart_record
|
|
|
field :created_at
|
|
|
field :updated_at
|
|
|
end
|
|
|
@@ -309,6 +312,7 @@ class Product < ActiveRecord::Base
|
|
|
field :silver
|
|
|
field :use_quan
|
|
|
field :key_words
|
|
|
+ field :depart_record
|
|
|
field :created_at
|
|
|
field :updated_at
|
|
|
end
|
|
|
@@ -387,6 +391,7 @@ class Product < ActiveRecord::Base
|
|
|
field :key_words
|
|
|
field :silver
|
|
|
field :use_quan
|
|
|
+ field :depart_record
|
|
|
end
|
|
|
|
|
|
end
|