Created
March 17, 2014 16:22
-
-
Save sebbean/9602586 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :hub do | |
namespace :push do | |
task :products, [:limit] => [:environment] do |t, args| | |
limit = args[:limit] | |
Spree::Product.all.limit(limit).each do |p| | |
# variants = p.variants_including_master | |
ap HubPushWorker.perform_async({class_name:'Spree::Product',id:p.id}) | |
end | |
end | |
task :orders, [:limit] => [:environment] do |t, args| | |
limit = args[:limit] | |
Spree::Order.complete.limit(limit).each do |o| | |
ap HubPushWorker.perform_async({class_name:'Spree::Order',number:o.number}) | |
end | |
end | |
task :inventory, [:limit] => [:environment] do |t, args| | |
limit = args[:limit] | |
Spree::StockItem.limit(limit).each do |si| | |
ap HubPushWorker.perform_async({class_name:'Spree::StockItem',id:si.id}) | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment