require 'securerandom'

namespace :data do
  task :partners => :environment do
    service = Account.master.first_service!

    heroku = Partner.create!(name: 'Heroku', system_name: 'heroku', api_key: Heroku.password)
    Heroku.plan_system_names.each do |system_name|
      application_plan = service.application_plans.find_by_system_name(system_name)
      heroku.application_plans << application_plan
    end
  end
end
