drapergem/draper — pull request #592 by tiegz (2013-12-18 21:07:12+00:00)
Title: Give before_filter a name

Changes:

* __Pulls the Rails before_filter into its own method__
We have a scenario (in Rails 3.2) where a few before_filters run before Draper's. One of them is actually dependent on Draper, and ends up raising an error because the Draper current_controller isn't setup yet. If we had a name for this before_filter -- I used `activate_draper` in the spirit of authlogic -- we could skip it, and then prepend it ourselves in the right place.

* __Also omits `clear!` in the before_filter__
Afaict, clearing the current_view_context is redundant since Draper moved to RequestStore. RequestStore should clear the controller variable in the middleware before the request. I think clearing the current_view_context originated in [this commit](https://github.com/drapergem/draper/commit/6e6217a484feb5ae134eba88063db1c8a92e7908), which doesn't mention any other reason to clear it.