ahoy_matey 5.2.1 → 5.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5ebbbd60be1beec66d70d5fee4922f013e61a9add9b9da33ec709fa8ca166cf7
4
- data.tar.gz: '0969a3b0711ccc95e140017fc81480c2636a819b113b5a09337f72ff19b2fb09'
3
+ metadata.gz: 3cdf6f78b5c08e7d2783e3f8c6b21b33efba9d95949bc3dd249a77c9295c3d58
4
+ data.tar.gz: 15c4e9503b7d5a5ae28037ca30516742c2eb3cc99c7bbd4fe7f626d2d7b2e02c
5
5
  SHA512:
6
- metadata.gz: 6ef517cd3e3eb8b612ae54aef6b9051d1533acc0562303e03e8656b04b703425b55b0d4b6b0811c4f420c46ad6f34e6c01d2fc2dd802438f5dbbee36f82b4118
7
- data.tar.gz: 228810c7e621654f88a21f864fd1400f0226fd9efb0d1902ffc98f997c9263daad675f656c59de2e28f5f641f2f70ed99e7814d071062610309a19f8724f4bc9
6
+ metadata.gz: d71d10e8ebff84650cccb1b3898e360521631e7eec0263f138f4640dcc07331e01240372527ce61ec0578a07b910c451005c7483e8f6fab2dea3030c8781a799
7
+ data.tar.gz: 3aa5aea74d2e425fee7f3e2067ca2c54abd019384ec7639824e4cafff1ba3f7a94d80304a47e1b24e1fb808f073febf25f336daadbf74bcb83e1fb6b144f324a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 5.4.0 (2025-05-04)
2
+
3
+ - Dropped support for Ruby < 3.2 and Rails < 7.1
4
+
5
+ ## 5.3.0 (2025-02-01)
6
+
7
+ - Dropped support for Ruby < 3.1 and Rails < 7
8
+ - Dropped support for Mongoid < 8
9
+
1
10
  ## 5.2.1 (2024-10-07)
2
11
 
3
12
  - Fixed connection leasing for Active Record 7.2+
@@ -362,3 +371,19 @@ Breaking changes
362
371
  ## 0.1.0 (2014-03-19)
363
372
 
364
373
  - First major release
374
+
375
+ ## 0.0.4 (2014-03-01)
376
+
377
+ - Added UTM parameters
378
+
379
+ ## 0.0.3 (2014-02-26)
380
+
381
+ - Renamed `ahoy_visit` method to `current_visit`
382
+
383
+ ## 0.0.2 (2014-02-26)
384
+
385
+ - Added `ahoy_visit` method to controllers
386
+
387
+ ## 0.0.1 (2014-02-26)
388
+
389
+ - First release
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014-2024 Andrew Kane
1
+ Copyright (c) 2014-2025 Andrew Kane
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -4,8 +4,6 @@
4
4
 
5
5
  Track visits and events in Ruby, JavaScript, and native apps. Data is stored in your database by default, and you can customize it for any data store as you grow.
6
6
 
7
- **Ahoy 5.0 was recently released** - see [how to upgrade](#upgrading)
8
-
9
7
  :postbox: Check out [Ahoy Email](https://github.com/ankane/ahoy_email) for emails and [Field Test](https://github.com/ankane/field_test) for A/B testing
10
8
 
11
9
  :tangerine: Battle-tested at [Instacart](https://www.instacart.com/opensource)
@@ -48,7 +46,7 @@ And restart your web server.
48
46
 
49
47
  ### JavaScript
50
48
 
51
- For Importmap (Rails 7 default), add to `config/importmap.rb`:
49
+ For Importmap (Rails 7+ default), add to `config/importmap.rb`:
52
50
 
53
51
  ```ruby
54
52
  pin "ahoy", to: "ahoy.js"
@@ -60,13 +58,15 @@ And add to `app/javascript/application.js`:
60
58
  import "ahoy"
61
59
  ```
62
60
 
63
- For Webpacker (Rails 6 default), run:
61
+ For Bun, esbuild, rollup.js, or Webpack, run:
64
62
 
65
63
  ```sh
64
+ bun add ahoy.js
65
+ # or
66
66
  yarn add ahoy.js
67
67
  ```
68
68
 
69
- And add to `app/javascript/packs/application.js`:
69
+ And add to `app/javascript/application.js`:
70
70
 
71
71
  ```javascript
72
72
  import ahoy from "ahoy.js"
@@ -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.2]
200
+ class AddAhoyVisitToOrders < ActiveRecord::Migration[8.0]
201
201
  def change
202
202
  add_reference :orders, :ahoy_visit
203
203
  end
@@ -765,7 +765,7 @@ Send a `POST` request to `/ahoy/events` with `Content-Type: application/json` an
765
765
  "properties": {
766
766
  "item_id": 123
767
767
  },
768
- "time": "2018-01-01T00:00:00-07:00"
768
+ "time": "2025-01-01T00:00:00-07:00"
769
769
  }
770
770
  ]
771
771
  }
data/lib/ahoy/engine.rb CHANGED
@@ -29,7 +29,7 @@ module Ahoy
29
29
 
30
30
  # for importmap
31
31
  initializer "ahoy.importmap" do |app|
32
- if defined?(Importmap)
32
+ if app.config.respond_to?(:assets) && defined?(Importmap) && defined?(Sprockets)
33
33
  app.config.assets.precompile << "ahoy.js"
34
34
  end
35
35
  end
data/lib/ahoy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ahoy
2
- VERSION = "5.2.1"
2
+ VERSION = "5.4.0"
3
3
  end
@@ -33,10 +33,6 @@ module Ahoy
33
33
  properties_type == "text" || (properties_type == "json" && ActiveRecord::Base.connection.try(:mariadb?))
34
34
  end
35
35
 
36
- def serialize_options
37
- ActiveRecord::VERSION::STRING.to_f >= 7.1 ? "coder: JSON" : "JSON"
38
- end
39
-
40
36
  # use connection_db_config instead of connection.adapter
41
37
  # so database connection isn't needed
42
38
  def adapter
@@ -6,5 +6,5 @@ class Ahoy::Event < ApplicationRecord
6
6
  belongs_to :visit
7
7
  belongs_to :user, optional: true<% if serialize_properties? %>
8
8
 
9
- serialize :properties, <%= serialize_options %><% end %>
9
+ serialize :properties, coder: JSON<% end %>
10
10
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ahoy_matey
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.1
4
+ version: 5.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-10-08 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activesupport
@@ -16,14 +15,14 @@ dependencies:
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: '6.1'
18
+ version: '7.1'
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - ">="
25
24
  - !ruby/object:Gem::Version
26
- version: '6.1'
25
+ version: '7.1'
27
26
  - !ruby/object:Gem::Dependency
28
27
  name: device_detector
29
28
  requirement: !ruby/object:Gem::Requirement
@@ -52,7 +51,6 @@ dependencies:
52
51
  - - ">="
53
52
  - !ruby/object:Gem::Version
54
53
  version: '0.4'
55
- description:
56
54
  email: andrew@ankane.org
57
55
  executables: []
58
56
  extensions: []
@@ -97,7 +95,6 @@ homepage: https://github.com/ankane/ahoy
97
95
  licenses:
98
96
  - MIT
99
97
  metadata: {}
100
- post_install_message:
101
98
  rdoc_options: []
102
99
  require_paths:
103
100
  - lib
@@ -105,15 +102,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
105
102
  requirements:
106
103
  - - ">="
107
104
  - !ruby/object:Gem::Version
108
- version: '3'
105
+ version: '3.2'
109
106
  required_rubygems_version: !ruby/object:Gem::Requirement
110
107
  requirements:
111
108
  - - ">="
112
109
  - !ruby/object:Gem::Version
113
110
  version: '0'
114
111
  requirements: []
115
- rubygems_version: 3.5.16
116
- signing_key:
112
+ rubygems_version: 3.6.7
117
113
  specification_version: 4
118
114
  summary: Simple, powerful, first-party analytics for Rails
119
115
  test_files: []