소스 검색

model add scope

abiao 4 년 전
부모
커밋
a6511e32ae
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_user.email
+        return @current_user.id
     end
 
     rails_admin do