lib/ahoy.rb in ahoy_matey-2.1.0 vs lib/ahoy.rb in ahoy_matey-2.2.0
- old
+ new
@@ -4,13 +4,15 @@
require "active_support/core_ext"
require "addressable/uri"
require "geocoder"
require "safely/core"
+require "ahoy/utils"
require "ahoy/base_store"
require "ahoy/controller"
require "ahoy/database_store"
+require "ahoy/helper"
require "ahoy/model"
require "ahoy/query_methods"
require "ahoy/tracker"
require "ahoy/version"
require "ahoy/visit_properties"
@@ -67,10 +69,13 @@
mattr_accessor :exclude_method
mattr_accessor :track_bots
self.track_bots = false
+ mattr_accessor :bot_detection_version
+ self.bot_detection_version = 1
+
mattr_accessor :token_generator
self.token_generator = -> { SecureRandom.uuid }
mattr_accessor :mask_ips
self.mask_ips = false
@@ -98,9 +103,13 @@
include Ahoy::Controller
end
ActiveSupport.on_load(:active_record) do
extend Ahoy::Model
+end
+
+ActiveSupport.on_load(:action_view) do
+ include Ahoy::Helper
end
# Mongoid
if defined?(ActiveModel)
ActiveModel::Callbacks.include(Ahoy::Model)