Skip to content

Commit c510fe7

Browse files
committed
Include the features when ActionController::Base is loaded
This will make this gem not load order dependent. See rails/actionpack-page_caching#6 (comment)
1 parent c701ad9 commit c510fe7

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
* Fix load order problem with other gems
2+
3+
*Andrew White*
4+
15
## 1.1.0
26

37
* Allow to use non-proc object in `cache_path` option. You can pass an object that

lib/action_controller/action_caching.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
require 'action_controller/caching/actions'
2+
13
module ActionController
24
module Caching
35
eager_autoload do
@@ -7,3 +9,5 @@ module Caching
79
include Actions
810
end
911
end
12+
13+
ActionController::Base.send(:include, ActionController::Caching::Actions)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
require 'rails/railtie'
2+
3+
module ActionPack
4+
module ActionCaching
5+
class Railtie < Rails::Railtie
6+
initializer 'action_pack.action_caching' do
7+
ActiveSupport.on_load(:action_controller) do
8+
require 'action_controller/action_caching'
9+
end
10+
end
11+
end
12+
end
13+
end

0 commit comments

Comments
 (0)