Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (20 sloc) 953 Bytes
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
require 'rake'
require 'pony'
desc "Email admins about empty locations"
task :report_empty_locations => :environment do
Region.all.each do |r|
machineless_locations = r.machineless_locations
if machineless_locations.size
:to => r.users.collect {|u|},
:from => '',
:subject => "PBM - List of empty locations",
:body => "The following locations don't have machines at them anymore. You may want to consider removing them from the map. This check will happen again, automatically, in one week.\n\n" + {|ml| + " (#{}, #{ml.state})" }.sort.join("\n")
Something went wrong with that request. Please try again.