Skip to content

Instantly share code, notes, and snippets.

@kevinrutherford
Created July 11, 2012 11:10
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 kevinrutherford/3089723 to your computer and use it in GitHub Desktop.
Save kevinrutherford/3089723 to your computer and use it in GitHub Desktop.
Rails code in a rake task
namespace :cron
task :validate_models => [:environment] do
[Post, Comment].each do |klass|
klass.all.each do |obj|
ErrorMailer.report_errors('me@example.com', obj) unless obj.valid?
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment