ahoy_matey 1.5.2 → 1.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +14 -3
- data/app/controllers/ahoy/base_controller.rb +3 -1
- data/app/controllers/ahoy/events_controller.rb +2 -2
- data/lib/ahoy/deckhands/request_deckhand.rb +0 -2
- data/lib/ahoy/deckhands/utm_parameter_deckhand.rb +3 -2
- data/lib/ahoy/stores/active_record_token_store.rb +1 -1
- data/lib/ahoy/tracker.rb +2 -2
- data/lib/ahoy/version.rb +1 -1
- data/lib/ahoy/visit_properties.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14b16720c567a2d253632b9a2a238273c1efb192
|
4
|
+
data.tar.gz: fa9aa63ecb5aaa91c44c9a617c4bccfa3f37f6c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a77b0b9f3ba3bfd134f848a531406778a46ae213b532945b80e0e2d11e81019ee22d1c55b8967e1913dd5b01aa6814d2e0b512dc500fe7a856e5f33adad35455
|
7
|
+
data.tar.gz: 6f616904606aaf1af958a8defed7a2fd6ddf9297af5872a3746062ec74ce76cf8eb5c63c606ab45c10884d5119c6f3de45c1e618f892fa1495342a182b3adf28
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -139,7 +139,7 @@ class Ahoy::Store < Ahoy::Stores::BaseStore
|
|
139
139
|
end
|
140
140
|
```
|
141
141
|
|
142
|
-
See the [
|
142
|
+
See the [ActiveRecordTokenStore](https://github.com/ankane/ahoy/blob/master/lib/ahoy/stores/active_record_token_store.rb) for an example.
|
143
143
|
|
144
144
|
## How It Works
|
145
145
|
|
@@ -238,6 +238,8 @@ class Ahoy::Store < Ahoy::Stores::ActiveRecordTokenStore
|
|
238
238
|
end
|
239
239
|
```
|
240
240
|
|
241
|
+
Some methods you can use are `request`, `controller`, `visit_properties`, and `ahoy`.
|
242
|
+
|
241
243
|
### Customize User
|
242
244
|
|
243
245
|
If you use a method other than `current_user`, set it here:
|
@@ -497,7 +499,16 @@ With ActiveRecord, use:
|
|
497
499
|
Ahoy::Event.where(name: "Viewed product").where_properties(product_id: 123).count
|
498
500
|
```
|
499
501
|
|
500
|
-
**Note:** If you get a `NoMethodError`, upgrade Ahoy and add `include Ahoy::Properties` to
|
502
|
+
**Note:** If you get a `NoMethodError`, upgrade Ahoy and add `include Ahoy::Properties` to the Ahoy::Event class:
|
503
|
+
|
504
|
+
```ruby
|
505
|
+
module Ahoy
|
506
|
+
class Event < ActiveRecord::Base
|
507
|
+
include Ahoy::Properties
|
508
|
+
...
|
509
|
+
end
|
510
|
+
end
|
511
|
+
```
|
501
512
|
|
502
513
|
## Native Apps
|
503
514
|
|
@@ -542,7 +553,7 @@ Ahoy.mount = false
|
|
542
553
|
|
543
554
|
### 1.4.0
|
544
555
|
|
545
|
-
There’s nothing to do, but it’s worth noting the default store was changed from `ActiveRecordStore` to `ActiveRecordTokenStore` for new installations.
|
556
|
+
There’s nothing to do, but it’s worth noting the default store was changed from `ActiveRecordStore` to `ActiveRecordTokenStore` for new installations. `ActiveRecordStore` will continue to be supported.
|
546
557
|
|
547
558
|
### json -> jsonb
|
548
559
|
|
@@ -15,7 +15,9 @@ module Ahoy
|
|
15
15
|
before_filter :verify_request_size
|
16
16
|
end
|
17
17
|
|
18
|
-
|
18
|
+
if respond_to?(:protect_from_forgery)
|
19
|
+
protect_from_forgery with: :null_session, if: -> { Ahoy.protect_from_forgery }
|
20
|
+
end
|
19
21
|
|
20
22
|
protected
|
21
23
|
|
@@ -1,8 +1,9 @@
|
|
1
1
|
module Ahoy
|
2
2
|
module Deckhands
|
3
3
|
class UtmParameterDeckhand
|
4
|
-
def initialize(landing_page)
|
4
|
+
def initialize(landing_page, params = nil)
|
5
5
|
@landing_page = landing_page
|
6
|
+
@params = params || {}
|
6
7
|
end
|
7
8
|
|
8
9
|
def landing_params
|
@@ -14,7 +15,7 @@ module Ahoy
|
|
14
15
|
|
15
16
|
%w(utm_source utm_medium utm_term utm_content utm_campaign).each do |name|
|
16
17
|
define_method name do
|
17
|
-
landing_params[name]
|
18
|
+
@params[name] || landing_params[name]
|
18
19
|
end
|
19
20
|
end
|
20
21
|
end
|
data/lib/ahoy/tracker.rb
CHANGED
@@ -160,7 +160,7 @@ module Ahoy
|
|
160
160
|
def visit_token_helper
|
161
161
|
@visit_token_helper ||= begin
|
162
162
|
token = existing_visit_token
|
163
|
-
token ||= generate_id unless
|
163
|
+
token ||= generate_id unless Ahoy.api_only
|
164
164
|
token
|
165
165
|
end
|
166
166
|
end
|
@@ -168,7 +168,7 @@ module Ahoy
|
|
168
168
|
def visitor_token_helper
|
169
169
|
@visitor_token_helper ||= begin
|
170
170
|
token = existing_visitor_token
|
171
|
-
token ||= generate_id unless
|
171
|
+
token ||= generate_id unless Ahoy.api_only
|
172
172
|
token
|
173
173
|
end
|
174
174
|
end
|
data/lib/ahoy/version.rb
CHANGED
@@ -46,7 +46,7 @@ module Ahoy
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def utm_parameter_deckhand
|
49
|
-
@utm_parameter_deckhand ||= Deckhands::UtmParameterDeckhand.new(request_deckhand.landing_page)
|
49
|
+
@utm_parameter_deckhand ||= Deckhands::UtmParameterDeckhand.new(request_deckhand.landing_page, request_deckhand.params)
|
50
50
|
end
|
51
51
|
|
52
52
|
def technology_deckhand
|
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: 1.5.
|
4
|
+
version: 1.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -335,7 +335,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
335
335
|
version: '0'
|
336
336
|
requirements: []
|
337
337
|
rubyforge_project:
|
338
|
-
rubygems_version: 2.
|
338
|
+
rubygems_version: 2.5.1
|
339
339
|
signing_key:
|
340
340
|
specification_version: 4
|
341
341
|
summary: Simple, powerful visit tracking for Rails
|
@@ -348,4 +348,3 @@ test_files:
|
|
348
348
|
- test/properties/postgresql_text_test.rb
|
349
349
|
- test/test_helper.rb
|
350
350
|
- test/visit_properties_test.rb
|
351
|
-
has_rdoc:
|