MetricMike / simrep

http://simrep.herokuapp.com/
2 stars 1 forks source link

Professions should automatically pay when awarding for event attendance #13

Open MetricMike opened 8 years ago

MetricMike commented 8 years ago

What event am I paying for? weekend = Event.last.weekend What characters have professions? characters = Talent.where(group: "Profession").map(&:character).uniq Have they bought upkeep this event? upkeeps = characters.map { |c| BankTransaction.where(from_account_id: c.bank_accounts.first).where(created_at: weekend-1.month..weekend+1.month).where('memo ilike ?', '%upkeep%') }.flatten