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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 38a6900082330168afc6a2a2cd4e17f2e9b7aeea
4
- data.tar.gz: 9ceb44378d54100b314b0baeb23ade9f28019f0b
3
+ metadata.gz: 32b3aba8caa3e47d90e9df65bb89ba689229d7e2
4
+ data.tar.gz: 512aa80a0df346007b3d72f7420adc2a995115d1
5
5
  SHA512:
6
- metadata.gz: ca065a617133aaa893e5f6b61f57affb99e1ee7b0265e52cca351a8b0f077817d9b389e6d51465c414b80230d53455004e73d000d6abe1b2526a7444af781d4f
7
- data.tar.gz: 65eaff58b513033cd2104fab7993198d45029bb1ac4cc1be744d16cb5d94000fb55af4a6e26ddab038a64455113978dd8e8a7b747aeef43e72aa7b561bbfa1ee
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
@@ -1,3 +1,3 @@
1
1
  module ActionTracker
2
- VERSION = '0.1.2.1'
2
+ VERSION = '0.1.2.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action_tracker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2.1
4
+ version: 0.1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - André Taiar