Bump ahoy_matey from 1.6.0 to 3.2.0
Bumps [ahoy_matey](https://github.com/ankane/ahoy) from 1.6.0 to 3.2.0. - [Release notes](https://github.com/ankane/ahoy/releases) - [Changelog](https://github.com/ankane/ahoy/blob/master/CHANGELOG.md) - [Commits](https://github.com/ankane/ahoy/compare/v1.6.0...v3.2.0) --- updated-dependencies: - dependency-name: ahoy_matey dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
3
Gemfile
3
Gemfile
@@ -4,7 +4,7 @@ gem "rails", "5.2.6"
|
||||
|
||||
gem "acts-as-taggable-on", "~> 8.1.0"
|
||||
gem "acts_as_votable", "~> 0.13.1"
|
||||
gem "ahoy_matey", "~> 1.6.0"
|
||||
gem "ahoy_matey", "~> 3.2.0"
|
||||
gem "airbrake", "~> 7.4.0"
|
||||
gem "ancestry", "~> 4.1.0"
|
||||
gem "audited", "~> 5.0.1"
|
||||
@@ -59,6 +59,7 @@ gem "translator-text", "~> 0.1.0"
|
||||
gem "turbolinks", "~> 5.2.1"
|
||||
gem "turnout", "~> 2.5.0"
|
||||
gem "uglifier", "~> 4.2.0"
|
||||
gem "uuidtools", "~> 2.1.5"
|
||||
gem "view_component", "~> 2.37.0", require: "view_component/engine"
|
||||
gem "whenever", "~> 1.0.0", require: false
|
||||
gem "wicked_pdf", "~> 2.1.0"
|
||||
|
||||
33
Gemfile.lock
33
Gemfile.lock
@@ -48,17 +48,11 @@ GEM
|
||||
acts_as_votable (0.13.1)
|
||||
addressable (2.8.0)
|
||||
public_suffix (>= 2.0.2, < 5.0)
|
||||
ahoy_matey (1.6.0)
|
||||
addressable
|
||||
browser (~> 2.0)
|
||||
geocoder
|
||||
rack-attack (< 6)
|
||||
railties
|
||||
referer-parser (>= 0.3.0)
|
||||
request_store
|
||||
safely_block (>= 0.1.1)
|
||||
user_agent_parser
|
||||
uuidtools
|
||||
ahoy_matey (3.2.0)
|
||||
activesupport (>= 5)
|
||||
device_detector
|
||||
geocoder (>= 1.4.5)
|
||||
safely_block (>= 0.2.1)
|
||||
airbrake (7.4.0)
|
||||
airbrake-ruby (~> 2.12)
|
||||
airbrake-ruby (2.12.0)
|
||||
@@ -89,7 +83,6 @@ GEM
|
||||
parser (>= 2.4)
|
||||
smart_properties
|
||||
bindex (0.8.1)
|
||||
browser (2.5.3)
|
||||
builder (3.2.4)
|
||||
bullet (6.1.4)
|
||||
activesupport (>= 3.0.0)
|
||||
@@ -172,6 +165,7 @@ GEM
|
||||
delayed_job_active_record (4.1.6)
|
||||
activerecord (>= 3.0, < 6.2)
|
||||
delayed_job (>= 3.0, < 5)
|
||||
device_detector (1.0.5)
|
||||
devise (4.8.0)
|
||||
bcrypt (~> 3.0)
|
||||
orm_adapter (~> 0.1)
|
||||
@@ -222,7 +216,7 @@ GEM
|
||||
rainbow
|
||||
rubocop
|
||||
smart_properties
|
||||
errbase (0.0.3)
|
||||
errbase (0.2.1)
|
||||
erubi (1.10.0)
|
||||
eslintrb (2.1.0)
|
||||
execjs
|
||||
@@ -269,7 +263,7 @@ GEM
|
||||
activemodel (>= 4.1, < 7.0)
|
||||
activesupport (>= 4.1, < 7.0)
|
||||
railties (>= 4.1, < 7.0)
|
||||
geocoder (1.6.3)
|
||||
geocoder (1.6.7)
|
||||
github_changelog_generator (1.15.2)
|
||||
activesupport
|
||||
faraday-http-cache
|
||||
@@ -476,8 +470,6 @@ GEM
|
||||
rack (2.2.3)
|
||||
rack-accept (0.4.5)
|
||||
rack (>= 0.4)
|
||||
rack-attack (5.0.1)
|
||||
rack
|
||||
rack-proxy (0.7.0)
|
||||
rack
|
||||
rack-test (1.1.0)
|
||||
@@ -519,7 +511,6 @@ GEM
|
||||
recipient_interceptor (0.3.0)
|
||||
mail
|
||||
redcarpet (3.5.1)
|
||||
referer-parser (0.3.0)
|
||||
regexp_parser (2.1.1)
|
||||
request_store (1.5.0)
|
||||
rack (>= 1.4)
|
||||
@@ -575,8 +566,8 @@ GEM
|
||||
rvm1-capistrano3 (1.4.0)
|
||||
capistrano (~> 3.0)
|
||||
sshkit (>= 1.2)
|
||||
safely_block (0.2.0)
|
||||
errbase
|
||||
safely_block (0.3.0)
|
||||
errbase (>= 0.1.1)
|
||||
sass (3.7.4)
|
||||
sass-listen (~> 4.0.0)
|
||||
sass-listen (4.0.0)
|
||||
@@ -664,7 +655,6 @@ GEM
|
||||
execjs (>= 0.3.0, < 3)
|
||||
unicode-display_width (1.7.0)
|
||||
uniform_notifier (1.14.2)
|
||||
user_agent_parser (2.6.0)
|
||||
uuidtools (2.1.5)
|
||||
view_component (2.37.0)
|
||||
activesupport (>= 5.0.0, < 8.0)
|
||||
@@ -702,7 +692,7 @@ PLATFORMS
|
||||
DEPENDENCIES
|
||||
acts-as-taggable-on (~> 8.1.0)
|
||||
acts_as_votable (~> 0.13.1)
|
||||
ahoy_matey (~> 1.6.0)
|
||||
ahoy_matey (~> 3.2.0)
|
||||
airbrake (~> 7.4.0)
|
||||
ancestry (~> 4.1.0)
|
||||
audited (~> 5.0.1)
|
||||
@@ -796,6 +786,7 @@ DEPENDENCIES
|
||||
turbolinks (~> 5.2.1)
|
||||
turnout (~> 2.5.0)
|
||||
uglifier (~> 4.2.0)
|
||||
uuidtools (~> 2.1.5)
|
||||
view_component (~> 2.37.0)
|
||||
web-console (~> 3.7.0)
|
||||
webdrivers (~> 4.6.0)
|
||||
|
||||
@@ -48,8 +48,7 @@ class Debate < ApplicationRecord
|
||||
scope :featured, -> { where.not(featured_at: nil) }
|
||||
scope :public_for_api, -> { all }
|
||||
|
||||
# Ahoy setup
|
||||
visitable # Ahoy will automatically assign visit_id on create
|
||||
visitable class_name: "Visit"
|
||||
|
||||
attr_accessor :link_required
|
||||
|
||||
|
||||
@@ -1,11 +1,36 @@
|
||||
Ahoy.geocode = false
|
||||
Ahoy.api = true
|
||||
Ahoy.server_side_visits = :when_needed
|
||||
|
||||
class Ahoy::Store < Ahoy::Stores::ActiveRecordStore
|
||||
# Track user IP
|
||||
def track_event(name, properties, options)
|
||||
super do |event|
|
||||
event.ip = request.ip
|
||||
# Most code comes from:
|
||||
# https://github.com/ankane/ahoy/blob/3661b7f9a/docs/Ahoy-2-Upgrade.md
|
||||
class Ahoy::Store < Ahoy::DatabaseStore
|
||||
def track_visit(data)
|
||||
data[:id] = ensure_uuid(data.delete(:visit_token))
|
||||
data[:visitor_id] = ensure_uuid(data.delete(:visitor_token))
|
||||
super(data)
|
||||
end
|
||||
|
||||
def track_event(data)
|
||||
data[:id] = ensure_uuid(data.delete(:event_id))
|
||||
data[:ip] = request.ip
|
||||
super(data)
|
||||
end
|
||||
|
||||
def visit
|
||||
@visit ||= visit_model.find_by(id: ensure_uuid(ahoy.visit_token)) if ahoy.visit_token
|
||||
end
|
||||
|
||||
def visit_model
|
||||
Visit
|
||||
end
|
||||
|
||||
UUID_NAMESPACE = UUIDTools::UUID.parse("a82ae811-5011-45ab-a728-569df7499c5f")
|
||||
|
||||
def ensure_uuid(id)
|
||||
UUIDTools::UUID.parse(id).to_s
|
||||
rescue
|
||||
UUIDTools::UUID.sha1_create(UUID_NAMESPACE, id).to_s
|
||||
end
|
||||
|
||||
def exclude?
|
||||
|
||||
Reference in New Issue
Block a user