Skip to content

Commit

Permalink
Load AC::Chaching::Sweeper if AC is defined when loading AR Observer
Browse files Browse the repository at this point in the history
Without this, AC::Cashing::Sweeper could never be loaded if Rails initializer
loads AC before loading AR, which actually is Rails' default behaviour.
  • Loading branch information
amatsuda committed Apr 2, 2014
1 parent 79e5c12 commit 40f615b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/rails/observers/activerecord/observer.rb
Expand Up @@ -123,3 +123,7 @@ def define_callbacks(klass)
end
end
end

if defined?(ActionController) and defined?(ActionController::Caching::Sweeping)
require 'rails/observers/action_controller/caching/sweeper'
end

0 comments on commit 40f615b

Please sign in to comment.