Created
August 14, 2012 19:24
-
-
Save jackieiscool/3351965 to your computer and use it in GitHub Desktop.
Trying out rake tasks
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 :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