瀏覽代碼

增加商品属性定义

abiao 5 年之前
父節點
當前提交
14e8d3de1a
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      app/models/product.rb

+ 1 - 1
app/models/product.rb

@@ -5,7 +5,7 @@ class Product < ActiveRecord::Base
     belongs_to :merchant, :foreign_key => :merchant_id
     validates :name,:buy_price,:price,:category_id,:count,:robo_balance_price, presence: true
     attr_accessor :v_share_img,:get_size_enum
-    before_update :gross_interest_rate
+    after_find :gross_interest_rate
 
     TYPE_ENUM = [["直营","direct_sale"]]
     #["代销","user_sale"]