lib/bullet.rb in bullet-1.6.0 vs lib/bullet.rb in bullet-1.7.0

- old
+ new

@@ -1,5 +1,6 @@ +require 'action_controller/dispatcher' require 'bulletware' module Bullet autoload :ActiveRecord, 'bullet/active_record' autoload :ActionController, 'bullet/action_controller' @@ -14,10 +15,12 @@ def enable=(enable) @enable = enable if enable? Bullet::ActiveRecord.enable Bullet::ActionController.enable - ::ActionController::Dispatcher.middleware.use Bulletware + if ::Rails::VERSION::STRING =~ /^2.3/ + ::ActionController::Dispatcher.middleware.use Bulletware + end end end def enable? @enable == true