Explorar el Código

model add scope

abiao hace 4 años
padre
commit
d241e85a7f
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      app/models/product.rb

+ 2 - 1
app/models/product.rb

@@ -122,7 +122,8 @@ 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 + "%"
-            return binding[:view].current_admin_user.email
+        mer=formatted_value{bindings[:view].current_admin_user.email}
+        return mer
     end
 
     rails_admin do