My name is Lawrence Whiteside and I created this app today to help the people of Oregon win their right to know if there food comes from pesticide heavy farming practices, otherwise known as GMOS.
Use it to search your facebook friends against the current Contested Ballots List from the Secretary of State’s office.
This is the code to the simple Rails, Jquery based app.
Licensed under the MIT license. Free to use and modify.
Downoad the source from this repo or fork it for yourself.
If you’re here to verify this code does what it says it does.
The files you’ll want to look at are all in the app directory.
app/views/home/index.html.erb app/models/ballots.rb app/assets/js/application.js app/controllers/home_controller.rb
Those 4 files contain most of the relevant application code.
It’s a Rails 4 app so it’ll need Ruby 2.1.4.
It uses PostgreSQL as it’s database.
It uses git, so install that too.
The data is located in mydb.dump.
It’s a PostGreSQL dump of the 13K person list given to me by Tony Green and the Secretary of State’s office in xslx format. The original file is located in the public directory.
git clone https://github.com/lawwantsin/unsignedFriends.git cd unsignedFriends bundle install rake db:create rake db:migrate psql find-unsigned_devlopment < mysql.dump rails s
Use Heroku. Sign up for an account. Download the toolbelt and run the following:
heroku create your-app-name git push heroku master heroku open (to view the site)
The table is over 10K rows so the database should be at least standard-0
Add an upgrade database with heroku
heroku addons:add pgbackups heroku addons:add heroku-postgresql:standard-0
That’s covered in this article. devcenter.heroku.com/articles/heroku-postgres-import-export
But the command is something like this.
heroku pgbackups:restore DATABASE 'https://website/mydb.dump'
Address of the data dump needs to be somewhere online.
Not from your local. I uploaded it to S3 for this purpose.
That’s it.
Thanks for reading.
Any questions, EMail me at [email protected].
Lawrence Whiteside