fhsav / clock

The clock for Farmington High School.
http://fhsclock.com
Other
12 stars 2 forks source link

Can activate more than one schedule #351

Closed ethnt closed 11 years ago

ethnt commented 11 years ago

You can activate more than one schedule at the moment. Steps to reproduce:

  1. Click "Activate" for one schedule.
  2. Click "Activate" on another schedule.
gluxon commented 11 years ago

I'll take a look at this.

ethnt commented 11 years ago

Oddly enough, this doesn't affect themes — just schedules, despite them using the same code.

def activate!
  self.class.all.set(:active, false)
  self.active = true
  self.save
end
gluxon commented 11 years ago

So, I was all set to look at this this morning, but I did a "git pull" and stuff broke. -.-

Connecting to localhost gives me "Internal Server Error". Are there error logs I can look at pinpoint the cause of this? /opt/nginx/logs doesn't help, unless I'm blind (which I may be).

I'm on the master branch.

ethnt commented 11 years ago

Basically, every time you do a git pull, you should rebundle the dependencies:

$ bundle install

It's probably that the dependencies changed and the clock is still looking for the old ones.

gluxon commented 11 years ago

That was definitely the first thing I tried. I also tried recloning.

ethnt commented 11 years ago

Bleh. Don't run the production version in development. Always use the development version in development. Just do this to start the dev server.

$ bundle exec foreman start
gluxon commented 11 years ago

Oh, well, I just got errors from that. Yay.

ethnt commented 11 years ago

Does it fail to start, or does it fail when you visit http://localhost:5000?

gluxon commented 11 years ago

That worked after I created an empty .env file. I assume the dotenv library requires it to at least be there? I don't remember creating it last time.

This was the original error -> https://gist.github.com/gluxon/5855601

ethnt commented 11 years ago

Yes, it requires a .env file with the configuration for Pusher. Just sign up for a free account, create an application there, then get put in the following.

PUSHER_APP_ID=foobar
PUSHER_KEY=foo
PUSHER_SECRET=bar
gluxon commented 11 years ago

Oh. Why didn't I need it before? Something special on the pusher branch?

ethnt commented 11 years ago

I'm not sure. The master branch didn't need it before, but now it does.