Skip to content

Commoners useful queries

Pietro edited this page Jun 3, 2019 · 1 revision

Number of active commoners

Calculated as the total number of Commoners minus the number of incative commoners

inactive_commoners_count = Currency.find(ENV['QR_CODE_ENABLED_CURRENCIES'].split(',').map(&:to_i)).map(&:group).map{|g| g.inactive_commoners.count}.reduce(:+)
Commoner.count - inactive_commoners_count
Clone this wiki locally