add homie to the gang when homie is created
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
class Gang < ApplicationRecord
|
||||
|
||||
has_many :homies
|
||||
end
|
||||
@@ -2,6 +2,8 @@ class Homie < ApplicationRecord
|
||||
has_many :money_moves
|
||||
has_many :work
|
||||
|
||||
belongs_to :gang
|
||||
|
||||
def self.info(importance)
|
||||
cash_totals = Homie.all.joins(:money_moves).group(:id).order(:id).sum(:amount)
|
||||
work_totals = Homie.all.joins(:work).group(:id).order(:id).sum(:amount)
|
||||
|
||||
Reference in New Issue
Block a user