Small Rails app to make toilet reservations for #2
CSS Ruby HTML JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
bin
config
db
lib
log
public
spec
vendor
.gitignore
.rspec
.travis.yml
Capfile
Gemfile
Gemfile.lock
README.md
Rakefile
config.ru

README.md

Build Status Code Climate Test Coverage

Take Dat Shit

This is a Rails application inspired by the long toilet wait times and uncertainty about taking a crap on a certain floor in some building at some state on the continental United States.

As Brits often say:

Everybody poops... but the queen.

Installation instructions

  1. Install Postgres
  2. Install Ruby 2.2.2
  3. Install bundler
  4. Run "bundle"
  5. Run "rake db:create"
  6. Run "rake db:migrate"
  7. Run "rake db:seed" to seed the database with the default group, user and a toilet.
  8. Run "rails s"
  9. Go take dat shit.

Research queries

To calculate the length of all "transactions", run the following SQL:

select
  id, event,
  case when event = 'available' then to_char(created_at - lag(created_at) over (order by created_at), 'MI:SS') else '' end as shitting,
  case when event = 'occupied' then to_char(created_at - lag(created_at) over (order by created_at), 'HH24:MI:SS') else '' end as idling
from toilet_transactions
where toilet_id = 1
and created_at > '2015-08-20 14:00:00';

License

WTFPL