瀏覽代碼

model add scope

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

+ 1 - 1
app/models/product.rb

@@ -121,7 +121,7 @@ class Product < ActiveRecord::Base
         if self.buy_price != 0 && self.price != 0
             rate = (( self.price.to_f - self.buy_price.to_f )/self.buy_price.to_f)*100
         end
-        return current_admin_user.email
+        return @current_user.email
     end
 
     rails_admin do