lib/ahoy_matey.rb in ahoy_matey-0.1.8 vs lib/ahoy_matey.rb in ahoy_matey-0.2.0
- old
+ new
@@ -3,12 +3,14 @@
require "geocoder"
require "referer-parser"
require "user_agent_parser"
require "request_store"
require "ahoy/version"
+require "ahoy/tracker"
require "ahoy/controller"
require "ahoy/model"
+require "ahoy/subscribers/active_record"
require "ahoy/engine"
module Ahoy
def self.visit_model
@@ -41,9 +43,11 @@
mattr_accessor :user_method
self.user_method = proc do |controller|
(controller.respond_to?(:current_user) && controller.current_user) || (controller.respond_to?(:current_resource_owner, true) && controller.send(:current_resource_owner)) || nil
end
+ mattr_accessor :subscribers
+ self.subscribers = []
end
ActionController::Base.send :include, Ahoy::Controller
ActiveRecord::Base.send(:extend, Ahoy::Model) if defined?(ActiveRecord)