@@ -121,6 +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 rate
@@ -129,8 +130,11 @@ class Product < ActiveRecord::Base
weight -240
list do
+ current_user.id
+ if current_user.id==1
+ scopes [:inactive]
+ end
- scopes [:inactive]
filters [:id,:detail,:status,:name]
field :id