Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamnengland/28c0aecef23d869f1170f77beb1814aa to your computer and use it in GitHub Desktop.
Save adamnengland/28c0aecef23d869f1170f77beb1814aa to your computer and use it in GitHub Desktop.
FMS Usage Report
out = []
Facility.find_each do |facility|
if facility.send(:belong_to_billable_company?) && facility.facility_map.geometric_objects.count > 10
out << "#{facility.company.name}, #{facility.name} has #{facility.facility_map.geometric_objects.count} objects"
end
end
facilities_receiving_texts = SMSReceivedEvent.pluck(:facility_id).uniq.length
facilities_sending_texts = SMSSentEvent.pluck(:facility_id).uniq.length
sms_received = SMSReceivedEvent.count
sms_sent = SMSSentEvent.count
ap "#{out.length} facilities are using maps"
ap "#{sms_received} SMS Sent by #{facilities_receiving_texts} facilities"
ap "#{sms_sent} SMS Sent by #{facilities_sending_texts} facilities"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment