소스 검색

model add scope

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

+ 2 - 2
app/models/product.rb

@@ -115,13 +115,13 @@ class Product < ActiveRecord::Base
     def after_destroy
         clean_share_img
     end
-    strs=""
+    mer=""
     def gross_interest_rate
         rate = 0
         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
-        mer =field :gross_interest_rate do
+        mer=field :gross_interest_rate do
             formatted_value{bindings[:view].current_admin_user.email}
         end
         return mer