create a file under lib / tasks / your_namespace.rake and write the task:
namespace :your_namespace do desc "An optional description of your task" task :your_task_name => [:environment] do
You should be able to use code from modules. In the case, just add this line to the rake command:
require 'yourfile'
Andrea Pavoni
source share