action_tracker 0.1.2.1 → 0.1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/action_tracker/concerns/tracker.rb +13 -2
- data/lib/action_tracker/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32b3aba8caa3e47d90e9df65bb89ba689229d7e2
|
4
|
+
data.tar.gz: 512aa80a0df346007b3d72f7420adc2a995115d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e72ea8ee83ec6b147e24e7ee37bd7ea4440725d882661f5c650ea75b232b654a995b27a762ded099a792f294c0b81ce8e81e8abd6c67b412d561f797e3cb992
|
7
|
+
data.tar.gz: 4bd847b6c5a9408cedd41f9a9fc8328faa48a3693a1091f008ee5f4e3bd30dc52652a1b72604f067053f87d1dac831151665907a151ca8a914bfe0d31476c244
|
@@ -8,20 +8,31 @@ module ActionTracker
|
|
8
8
|
|
9
9
|
included do
|
10
10
|
helper ActionTracker::Helpers::Render
|
11
|
+
before_filter :initialize_session
|
12
|
+
after_filter :conditional_track_event
|
11
13
|
end
|
12
14
|
|
13
15
|
def render(*args)
|
14
16
|
track_event
|
17
|
+
session[:action_tracked] = true
|
15
18
|
super
|
16
19
|
end
|
17
20
|
|
21
|
+
private
|
22
|
+
|
23
|
+
def conditional_track_event
|
24
|
+
track_event unless session[:action_tracked]
|
25
|
+
end
|
26
|
+
|
27
|
+
def initialize_session
|
28
|
+
session[:action_tracked] = false
|
29
|
+
end
|
30
|
+
|
18
31
|
def track_event
|
19
32
|
session[:action_tracker] ||= []
|
20
33
|
session[:action_tracker] << tracker_params unless tracker_params.blank?
|
21
34
|
end
|
22
35
|
|
23
|
-
private
|
24
|
-
|
25
36
|
def tracker_klass
|
26
37
|
@tracker_klass ||= "#{namespace}#{controller_name.camelize}Tracker"
|
27
38
|
end
|