airbnb/trebuchet — pull request #11 by schleyfox (2014-03-19 21:04:09+00:00)
Title: Adds Trebuchet.reset_current!, consolidate controller trebuchets

If `Trebuchet.current` or `ApplicationController#trebuchet` are called before user authentication, each one will separately memoize an unauthenticated Trebuchet for the duration of the request. This can lead to unexpected behavior. This patch consolidates `Trebuchet.current` and `ApplicationController#trebuchet` to refer to the same instance. This allows Trebuchet to expose a function, `Trebuchet.reset_current!`, that can be called when the authentication status of the request changes.

/cc @josephsofaer @jtai @daveaugustine