rails-school/school — pull request #11 by btaitelb (2013-12-16 12:41:18+00:00)
Title: Adds multi-school support

- new current_school helper in application_controller, which is set in the following order of precedence (lowest to highest):
1. defaults to first venue's school (assumes a venue exists, which made tests a little heavier, but is a fair assumption) if none of the others match
1. if the user is logged in and has a school set on their profile, this is used
1. if there is a school set on the session, this is used
1. if a school gets passed as a query param `?school=` then this has top priority
- see spec/controller/application_controller_spec.rb for tests of this functionality
- users can set their school when signing up, and can update their school when editing their profile
- current users will have their school set to 1, which is the only existing school in production and makes sense
- I didn't like creating a venue in all the acceptance tests, so there's probably a more elegant way to mock up current_school for all the acceptance tests that aren't explicitly using it
- dynamic school dropdown in menu could probably be styled better, but this accomplishes the task
- notifications only sent to subscribed users who attend the school where the lesson will be taught. Possibly future enhancement to let users subscribe to nearby schools as well.
- nice font-face in current logo image goes away in favor of text that changes per school. Possible future enhancements: either use a better typeface or allow for each school to set a different logo
- I removed the require for jquery.snow.hacked because it's already covered by the `require_tree .`, although I've noticed that the snow does block input elements