abiao пре 4 година
родитељ
комит
2b5582c87c
1 измењених фајлова са 5 додато и 5 уклоњено
  1. 5 5
      app/models/cash_balance.rb

+ 5 - 5
app/models/cash_balance.rb

@@ -43,15 +43,15 @@ class CashBalance < ActiveRecord::Base
     end
   end
   @total=0
-
+  LIST =  []
   def get_happen_total
-    @list=[]
-    unless @list.include?(self.id)
-      @list.append(self.id)
+
+    unless LIST.include?(self.id)
+      LIST.append(self.id)
     end
     # list.append(self.id)
 
-    total =  CashBalance.where(id:@list).sum("count")
+    total =  CashBalance.where(id:LIST).sum("count")
 
     return total
   end