ahoy_matey 5.0.2 → 5.1.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 +5 -0
- data/LICENSE.txt +1 -1
- data/README.md +2 -2
- data/lib/ahoy/query_methods.rb +2 -2
- data/lib/ahoy/version.rb +1 -1
- data/lib/generators/ahoy/activerecord_generator.rb +3 -7
- data/vendor/assets/javascripts/ahoy.js +5 -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: f8f4afce5d34400d46473e74e607c7758ef18e93d719d476b83c54bca455bd76
|
4
|
+
data.tar.gz: a64234a08867ad06f2084d4191c920f1ef12c0e290161e906303e8bcb744ead1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ef86e6a698447417887b1dbbd5491ca4e073811cba9bcff2cfd1b42d42291ae39c96652d8dce8c006945264932d611ed80321c1ab8f3c02ed4e9f8f98e6bd64
|
7
|
+
data.tar.gz: 1427722ca7b83c98e7db34eaf56fc86a46fd10c5d14659bb93e1e465cb7f24345cf15fc7125916d13512fa6e269c378cd5ca06e9c7b927ea62df967ee54762c3
|
data/CHANGELOG.md
CHANGED
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -10,7 +10,7 @@ Track visits and events in Ruby, JavaScript, and native apps. Data is stored in
|
|
10
10
|
|
11
11
|
:tangerine: Battle-tested at [Instacart](https://www.instacart.com/opensource)
|
12
12
|
|
13
|
-
[![Build Status](https://github.com/ankane/ahoy/workflows/build/badge.svg
|
13
|
+
[![Build Status](https://github.com/ankane/ahoy/actions/workflows/build.yml/badge.svg)](https://github.com/ankane/ahoy/actions)
|
14
14
|
|
15
15
|
## Installation
|
16
16
|
|
@@ -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.1]
|
201
201
|
def change
|
202
202
|
add_reference :orders, :ahoy_visit
|
203
203
|
end
|
data/lib/ahoy/query_methods.rb
CHANGED
@@ -14,7 +14,7 @@ module Ahoy
|
|
14
14
|
case adapter_name
|
15
15
|
when "mongoid"
|
16
16
|
where(properties.to_h { |k, v| ["properties.#{k}", v] })
|
17
|
-
when /mysql/
|
17
|
+
when /mysql|trilogy/
|
18
18
|
where("JSON_CONTAINS(properties, ?, '$') = 1", properties.to_json)
|
19
19
|
when /postgres|postgis/
|
20
20
|
case columns_hash["properties"].type
|
@@ -54,7 +54,7 @@ module Ahoy
|
|
54
54
|
case adapter_name
|
55
55
|
when "mongoid"
|
56
56
|
raise "Adapter not supported: #{adapter_name}"
|
57
|
-
when /mysql/
|
57
|
+
when /mysql|trilogy/
|
58
58
|
props.each do |prop|
|
59
59
|
quoted_prop = connection.quote("$.#{prop}")
|
60
60
|
relation = relation.group("JSON_UNQUOTE(JSON_EXTRACT(properties, #{quoted_prop}))")
|
data/lib/ahoy/version.rb
CHANGED
@@ -21,7 +21,7 @@ module Ahoy
|
|
21
21
|
case adapter
|
22
22
|
when /postg/i # postgres, postgis
|
23
23
|
"jsonb"
|
24
|
-
when /mysql/i
|
24
|
+
when /mysql|trilogy/i
|
25
25
|
"json"
|
26
26
|
else
|
27
27
|
"text"
|
@@ -37,14 +37,10 @@ module Ahoy
|
|
37
37
|
ActiveRecord::VERSION::STRING.to_f >= 7.1 ? "coder: JSON" : "JSON"
|
38
38
|
end
|
39
39
|
|
40
|
-
# use
|
40
|
+
# use connection_db_config instead of connection.adapter
|
41
41
|
# so database connection isn't needed
|
42
42
|
def adapter
|
43
|
-
|
44
|
-
ActiveRecord::Base.connection_db_config.adapter.to_s
|
45
|
-
else
|
46
|
-
ActiveRecord::Base.connection_config[:adapter].to_s
|
47
|
-
end
|
43
|
+
ActiveRecord::Base.connection_db_config.adapter.to_s
|
48
44
|
end
|
49
45
|
|
50
46
|
def migration_version
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* Ahoy.js v0.4.
|
2
|
+
* Ahoy.js v0.4.4
|
3
3
|
* Simple, powerful JavaScript analytics
|
4
4
|
* https://github.com/ankane/ahoy.js
|
5
5
|
* MIT License
|
@@ -188,6 +188,10 @@
|
|
188
188
|
|
189
189
|
// https://stackoverflow.com/a/2117523/1177228
|
190
190
|
function generateId() {
|
191
|
+
if (window.crypto && window.crypto.randomUUID) {
|
192
|
+
return window.crypto.randomUUID();
|
193
|
+
}
|
194
|
+
|
191
195
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
192
196
|
var r = Math.random() * 16 | 0;
|
193
197
|
var v = c === 'x' ? r : (r & 0x3 | 0x8);
|
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.0
|
4
|
+
version: 5.1.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:
|
11
|
+
date: 2024-03-26 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.
|
115
|
+
rubygems_version: 3.5.3
|
116
116
|
signing_key:
|
117
117
|
specification_version: 4
|
118
118
|
summary: Simple, powerful, first-party analytics for Rails
|