Skip to content

Instantly share code, notes, and snippets.

@jackieiscool
Created August 14, 2012 19:24
Show Gist options
  • Save jackieiscool/3351965 to your computer and use it in GitHub Desktop.
Save jackieiscool/3351965 to your computer and use it in GitHub Desktop.
Trying out rake tasks
namespace :populate do
congresspeople = Sunlight::legislator.all_where(:gender => "M")
task :get_info do
congresspeople.each do |rep|
:firstname = rep.firstname
:lastname = rep.lastname
:bioguide_id = rep.bioguide_id
create_rep(firstname, lastname, bioguide_id)
end
end
task :create_rep
Representaive.create(params[:firstname, :lastname, :bioguide_id])
end
task :populate_databse
get_info
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment