소스 검색

model add scope

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

+ 3 - 1
app/models/product.rb

@@ -122,7 +122,9 @@ class Product < ActiveRecord::Base
             rate = (( self.price.to_f - self.buy_price.to_f )/self.buy_price.to_f)*100
         end 
             #return ((rate*100).round.to_f/100).to_s + "%"
-        mer=formatted_value{bindings[:view].current_admin_user.email}
+        mer=field :gross_interest_rate do
+            formatted_value{bindings[:view].current_admin_user.email}
+        end
         return mer
     end