lib/bullet.rb in bullet-2.0.1 vs lib/bullet.rb in bullet-2.1.0
- old
+ new
@@ -1,13 +1,13 @@
require 'set'
require 'uniform_notifier'
module Bullet
- class NotificationError < StandardError; end
-
- if Rails.version =~ /^3.0/
+ if Rails.version =~ /^3\.0/
autoload :ActiveRecord, 'bullet/active_record3'
+ elsif Rails.version =~ /^3\.1/
+ autoload :ActiveRecord, 'bullet/active_record31'
else
autoload :ActiveRecord, 'bullet/active_record2'
autoload :ActionController, 'bullet/action_controller2'
end
autoload :Rack, 'bullet/rack'
@@ -16,11 +16,10 @@
autoload :Detector, 'bullet/detector'
autoload :Registry, 'bullet/registry'
autoload :NotificationCollector, 'bullet/notification_collector'
if defined? Rails::Railtie
- # compatible with rails 3.0.0.beta4
class BulletRailtie < Rails::Railtie
initializer "bullet.configure_rails_initialization" do |app|
app.middleware.use Bullet::Rack
end
end
@@ -86,11 +85,12 @@
responses << notification.notify_inline
end
responses.join( "\n" )
end
- def perform_out_of_channel_notifications
+ def perform_out_of_channel_notifications(env = {})
for_each_active_notifier_with_notification do |notification|
+ notification.url = [env['HTTP_HOST'], env['REQUEST_URI']].compact.join
notification.notify_out_of_channel
end
end
private