ahoy_matey 5.1.0 → 5.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/app/controllers/ahoy/events_controller.rb +13 -2
- data/lib/ahoy/tracker.rb +1 -1
- data/lib/ahoy/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9161dead45561a928523eb7d5ed70be20c67c8629499c35cb428271d714895a7
|
4
|
+
data.tar.gz: f17eb958ee297a4eda86388e0458a04a2a39de5b868076521eb65dd6e4cbc21a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c68fa7030244573a75b72167d163a8a0f2cfb5ef01e3718980ea25e5c13a5936973d0d5f83d3302f9e610508d94758ec0587f6fe4dd19c7c23668181ea1dcfe0
|
7
|
+
data.tar.gz: 7950a3cd2dda3818e21a6da37ab0d1b49b01d22110c76f0ae1abd15abba7aaa6140db24d70cedb4d5af0c5022f2b95a2f7e5a11339425eefb51240bb9ea17578
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -197,7 +197,7 @@ Order.joins(:ahoy_visit).group("device_type").count
|
|
197
197
|
Here’s what the migration to add the `ahoy_visit_id` column should look like:
|
198
198
|
|
199
199
|
```ruby
|
200
|
-
class AddAhoyVisitToOrders < ActiveRecord::Migration[7.
|
200
|
+
class AddAhoyVisitToOrders < ActiveRecord::Migration[7.2]
|
201
201
|
def change
|
202
202
|
add_reference :orders, :ahoy_visit
|
203
203
|
end
|
@@ -17,12 +17,23 @@ module Ahoy
|
|
17
17
|
begin
|
18
18
|
ActiveSupport::JSON.decode(data)
|
19
19
|
rescue ActiveSupport::JSON.parse_error
|
20
|
-
#
|
20
|
+
# TODO change to nil in Ahoy 6
|
21
21
|
[]
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
|
25
|
+
max_events_per_request = Ahoy.max_events_per_request
|
26
|
+
|
27
|
+
# check before creating any events
|
28
|
+
unless events.is_a?(Array) && events.first(max_events_per_request).all? { |v| v.is_a?(Hash) }
|
29
|
+
logger.info "[ahoy] Invalid parameters"
|
30
|
+
# :unprocessable_entity is probably more correct
|
31
|
+
# but keep consistent with missing parameters for now
|
32
|
+
render plain: "Invalid parameters\n", status: :bad_request
|
33
|
+
return
|
34
|
+
end
|
35
|
+
|
36
|
+
events.first(max_events_per_request).each do |event|
|
26
37
|
time = Time.zone.parse(event["time"]) rescue nil
|
27
38
|
|
28
39
|
# timestamp is deprecated
|
data/lib/ahoy/tracker.rb
CHANGED
@@ -49,7 +49,7 @@ module Ahoy
|
|
49
49
|
visit_token: visit_token,
|
50
50
|
visitor_token: visitor_token,
|
51
51
|
user_id: user.try(:id),
|
52
|
-
started_at: trusted_time(started_at)
|
52
|
+
started_at: trusted_time(started_at)
|
53
53
|
}.merge(visit_properties).select { |_, v| v }
|
54
54
|
|
55
55
|
@store.track_visit(data)
|
data/lib/ahoy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ahoy_matey
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
112
|
- !ruby/object:Gem::Version
|
113
113
|
version: '0'
|
114
114
|
requirements: []
|
115
|
-
rubygems_version: 3.5.
|
115
|
+
rubygems_version: 3.5.11
|
116
116
|
signing_key:
|
117
117
|
specification_version: 4
|
118
118
|
summary: Simple, powerful, first-party analytics for Rails
|