Merge pull request #763 from McRip/feature-view_context
Bugfix for missing ActionController::TestRequest
This commit is contained in:
commit
27357367c7
|
@ -1,5 +1,7 @@
|
||||||
# Draper Changelog
|
# Draper Changelog
|
||||||
|
|
||||||
|
* Fixed a bug where helpers were used inside a decorator and this decorator was used outside of controller context
|
||||||
|
|
||||||
## 3.0.0.pre1 - 2016-07-10
|
## 3.0.0.pre1 - 2016-07-10
|
||||||
|
|
||||||
* Added support for Rails 5, dropped 4.0 - 4.2
|
* Added support for Rails 5, dropped 4.0 - 4.2
|
||||||
|
|
|
@ -38,7 +38,7 @@ module Draper
|
||||||
|
|
||||||
def controller
|
def controller
|
||||||
(Draper::ViewContext.controller || ApplicationController.new).tap do |controller|
|
(Draper::ViewContext.controller || ApplicationController.new).tap do |controller|
|
||||||
controller.request ||= new_test_request controller
|
controller.request ||= new_test_request controller if defined?(ActionController::TestRequest)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue