abiao 4 lat temu
rodzic
commit
2b5582c87c
1 zmienionych plików z 5 dodań i 5 usunięć
  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