action_tracker 0.1.6.1 → 0.1.6.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 +5 -1
- data/lib/action_tracker/nil_resource.rb +36 -0
- data/lib/action_tracker/version.rb +1 -1
- data/lib/action_tracker.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17a7ac82929250a9c782575614ce3a6b72630646
|
4
|
+
data.tar.gz: bc7d46f483cf87562d7a2267b9ca04327a0bc6bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba376cb1d6f7a7f443c7900b3c98bd0b47f8d184622de9d7f00559eae108bc9f9164b7d2801801f9d8f15822d7422b8bf6d7ab6bc11e9424b98806f3d826bde4
|
7
|
+
data.tar.gz: b1d005029241f7a145e780a2299b7b9c0edf07dd320f7bb765e7ec2978ac0ae8bf3fb805d8fbf1fe40b39df6b19d79c37bff04e37b90e83070ac6951c895330f
|
@@ -53,7 +53,7 @@ module ActionTracker
|
|
53
53
|
def find_resource
|
54
54
|
@resource_method ||= Devise.mappings.keys.map { |resource| "current_#{resource}" }
|
55
55
|
.select { |method_name| !method(method_name).call.nil? }
|
56
|
-
.first
|
56
|
+
.first || 'nil_current_resource'
|
57
57
|
rescue NameError
|
58
58
|
nil
|
59
59
|
end
|
@@ -75,6 +75,10 @@ module ActionTracker
|
|
75
75
|
def namespace
|
76
76
|
self.class.name.deconstantize.try(:+, '::')
|
77
77
|
end
|
78
|
+
|
79
|
+
def nil_current_resource
|
80
|
+
NilResource.new
|
81
|
+
end
|
78
82
|
end
|
79
83
|
end
|
80
84
|
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module ActionTracker
|
2
|
+
# nodoc
|
3
|
+
class NilResource
|
4
|
+
def method_missing(_name, *_args)
|
5
|
+
self
|
6
|
+
end
|
7
|
+
|
8
|
+
def respond_to_missing?(*_args)
|
9
|
+
true
|
10
|
+
end
|
11
|
+
|
12
|
+
def to_s
|
13
|
+
''
|
14
|
+
end
|
15
|
+
|
16
|
+
def to_a
|
17
|
+
[]
|
18
|
+
end
|
19
|
+
|
20
|
+
def to_str
|
21
|
+
to_s
|
22
|
+
end
|
23
|
+
|
24
|
+
def to_ary
|
25
|
+
to_a
|
26
|
+
end
|
27
|
+
|
28
|
+
def to_i
|
29
|
+
0
|
30
|
+
end
|
31
|
+
|
32
|
+
def present?
|
33
|
+
true
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
data/lib/action_tracker.rb
CHANGED
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.6.
|
4
|
+
version: 0.1.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- André Taiar
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-05-
|
12
|
+
date: 2016-05-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -182,6 +182,7 @@ files:
|
|
182
182
|
- lib/action_tracker/matchers.rb
|
183
183
|
- lib/action_tracker/matchers/have_action_tracker_matcher.rb
|
184
184
|
- lib/action_tracker/matchers/track_matcher.rb
|
185
|
+
- lib/action_tracker/nil_resource.rb
|
185
186
|
- lib/action_tracker/version.rb
|
186
187
|
homepage: http://coders.appprova.com.br/
|
187
188
|
licenses:
|