Skip to content

Instantly share code, notes, and snippets.

@fredjean
Created August 23, 2012 21:10
Show Gist options
  • Save fredjean/3441797 to your computer and use it in GitHub Desktop.
Save fredjean/3441797 to your computer and use it in GitHub Desktop.
desc "Imports all existing Salesforce accounts"
task :households => :environment do |t|
accounts = Salesforce::Household.all
start = 0
size = 100
loop do
puts "Loading from #{start} to #{start + size}"
accounts[start...(start + size)].each do |account|
SnuggHome::SalesforceImporter.import_home(account)
end
start += size
break if start > accounts.size
end
end # task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment