Created
August 23, 2012 21:10
-
-
Save fredjean/3441797 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
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