소스 검색

model add scope

abiao 4 년 전
부모
커밋
50bb9d7595
1개의 변경된 파일2개의 추가작업 그리고 5개의 파일을 삭제
  1. 2 5
      app/models/product.rb

+ 2 - 5
app/models/product.rb

@@ -121,13 +121,10 @@ 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
-        field :gross_interest_rate do
+        mer =field :gross_interest_rate do
             pretty_value{bindings[:view].current_admin_user.email}
-            if strs.length==0
-                strs=pretty_value{bindings[:view].current_admin_user.email}
-            end
         end
-        return strs
+        return mer
     end
 
     rails_admin do