action_trace 0.7.0 → 0.9.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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 87cdc0bf9fdd706f3281fea43d22c6ae6bbeb75a49aa595dc3b0da237003c2f8
|
|
4
|
+
data.tar.gz: bc9f95661a4d297ea5d0a604eac591e20008c66b53523d720fcabff254c5b651
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 27a038ca8bd66c44e59eb57e7208fb19d1241877b6238bc4c3736f3a85c7ad62ac85f677dd6cbb7cffbe3122e1cd1d7f6763a3a0e7afad4f751ba63c7e35fdf3
|
|
7
|
+
data.tar.gz: dee5ead60152d867fac30d4bfb42f48ec143deb7c37f3222f4496d349a8f48eda852ff0dbfc5f069a465776a099dadb8742ca18c935eec1e0f55af872eb57722
|
|
@@ -39,16 +39,16 @@ module ActivityLogFetchable
|
|
|
39
39
|
def apply_activity_type_filter(scope)
|
|
40
40
|
return scope if context.source.blank?
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
42
|
+
key_column = PublicActivity::Activity.arel_table[:key]
|
|
43
|
+
|
|
44
|
+
suffix = case context.source
|
|
45
|
+
when ActionTrace::ActivityLog::SOURCES[:data_destroy] then '%.destroy'
|
|
46
|
+
when ActionTrace::ActivityLog::SOURCES[:data_change] then '%.update'
|
|
47
|
+
when ActionTrace::ActivityLog::SOURCES[:data_create] then '%.create'
|
|
48
|
+
else return scope
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
scope.where(key_column.matches(suffix))
|
|
52
52
|
end
|
|
53
53
|
|
|
54
54
|
def apply_date_filters(scope, model_class)
|
data/lib/action_trace/version.rb
CHANGED
|
@@ -14,3 +14,17 @@ end
|
|
|
14
14
|
PublicActivity::Config.set do
|
|
15
15
|
enabled true
|
|
16
16
|
end
|
|
17
|
+
|
|
18
|
+
class Ahoy::Store < Ahoy::DatabaseStore
|
|
19
|
+
def track_event(data)
|
|
20
|
+
props = data[:properties] || {}
|
|
21
|
+
ctrl = props["controller"]
|
|
22
|
+
action = props["action"]
|
|
23
|
+
|
|
24
|
+
excluded =
|
|
25
|
+
ActionTrace.configuration.excluded_controllers.include?(ctrl) ||
|
|
26
|
+
ActionTrace.configuration.excluded_actions.include?(action)
|
|
27
|
+
|
|
28
|
+
super unless excluded
|
|
29
|
+
end
|
|
30
|
+
end
|