Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Find the outdoor rinks in the best condition in Montreal (defunct)

branch: master
README.md

Patiner Montréal

Dependency Status

Getting Started

git clone git://github.com/opennorth/patinermontreal.ca.git
cd patinermontreal.ca
bundle
bundle exec rake db:setup
bundle exec rake cron
bundle exec rake import:manual
bundle exec rake import:location
bundle exec rake import:contacts

Run bundle exec rake db:drop to start over.

To run the app locally, run rails server.

Deployment

Create a Heroku account, install the Heroku toolbelt and setup SSH keys as described on Getting Started with Heroku.

heroku apps:create --stack cedar --addons pgbackups:auto-month memcachier scheduler:standard
git push heroku master
heroku config:add SECRET_TOKEN=`bundle exec rake secret`
heroku domains:add patinermontreal.ca
heroku domains:add www.patinermontreal.ca

To run the updates every hour, run heroku addons:open scheduler and add a rake cron job on an hourly frequency.

If you have already run the Rake tasks to build the database locally, run:

heroku db:push

Otherwise:

heroku run rake db:setup
heroku run rake cron
heroku run rake import:manual
heroku run rake import:location
heroku run rake import:contacts

Season Start & End

To end the season and display the sign-up page, run:

heroku config:add MAINTENANCE=on

To turn off the sign-up page at the beginning of a season, run:

heroku config:remove MAINTENANCE

To reset the Heroku database at the beginning of a season, run:

heroku pg:reset DATABASE_NAME

You can get a list of databases with:

heroku pg:info

Rink Maintenance

If the city changes its data such that a duplicate rink is created, you need to either:

  • Delete the old rink
  • Delete the new rink and change the code so that duplicate rinks are not created

Geocode a rink

To find all non-geocoded rinks open a Rails console (rails console locally or heroku run console remotely), and run:

Patinoire.nongeocoded

For prettier output, run:

Patinoire.nongeocoded.each{|p| puts "#{p.nom} (nom_arr: #{p.arrondissement.nom_arr}, parc: #{p.parc}, genre: #{p.genre}, disambiguation: #{p.disambiguation})"};nil

Then, find the rink's latitude and longitude somehow (e.g. using Google Maps), and enter that data into this spreadsheet. Fill in the columns to match each rink.

Delete a rink

Delete the rink from the database through a Rails console, e.g.:

Patinoire.find(numeric_identifier).destroy

If the rink was added manually, delete the row from this spreadsheet.

Bugs? Questions?

This app's main repository is on GitHub: http://github.com/opennorth/patinermontreal.ca, where your contributions, forks, bug reports, feature requests, and feedback are greatly welcomed.

Copyright (c) 2011 Open North Inc., released under the MIT license

Something went wrong with that request. Please try again.