Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# 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 Rarequire File.expand_path('../config/application', __FILE__)
require File.expand_path('../config/application', __FILE__)
Rails.application.load_tasks
task :text_each_alert => :environment do
Alert.all.each do |alert|
#if alert.relevant_time?
if (alert.last_alert_status != nil) && (alert.last_alert_status != alert.current_train_status)
text=TwilioWrapper.new(alert.id)
text.sms
alert.transmogrify
elsif alert.bad_service? && alert.last_alert_status != alert.current_train_status
text=TwilioWrapper.new(alert.id)
text.sms
alert.transmogrify
end
end
#end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment