remark_analytics 1.0.10 → 1.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/remark_analytics/event.rb +17 -4
- data/lib/remark_analytics/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '058b54841fb2844dbb60f1625d2bd10fe7a550c8f05f72c309ba1a1fcf05b121'
|
4
|
+
data.tar.gz: 657290674e13f42ee59a1c3a592ad0b8827624dbdbe722effcb8b501f45fec76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74e3a8a05adfdb301290ff1995ad76ffcbc44a1c65afc5f792f3ad02a0396eb3a11e7d599a4a1d79b7d8d67cecafbbdc9882376085c660594ee96f374b943176
|
7
|
+
data.tar.gz: a1d57cb885a7144c842f1c1b2a7c893ad5d5991893310c1753cd2ff394db1bb6c1f586a0ea2447138805de95d27df2208a4707a84ec7b8776b9a2de8b76de701
|
@@ -15,12 +15,18 @@ module RemarkAnalytics
|
|
15
15
|
result[:resource_type] = event_parameters[:resource_type].presence
|
16
16
|
result[:resource_id] = event_parameters[:resource_id].presence
|
17
17
|
result[:data] = event_parameters[:data].presence || {}
|
18
|
-
result[:application_version] =
|
19
|
-
|
18
|
+
result[:application_version] =
|
19
|
+
event_parameters[:application_version].presence || RemarkAnalytics::VERSION
|
20
20
|
result[:occured_at] = event_parameters[:occured_at].presence || Time.zone.now
|
21
21
|
result[:tenant_name] = event_parameters[:tenant_name].presence ||
|
22
|
-
|
23
|
-
|
22
|
+
Rails.application.secrets.try(:REMARK_ANALYTICS_TENANT_NAME)
|
23
|
+
|
24
|
+
if result[:tenant_name].blank? && Object.const_defined?('VP_SETTINGS')
|
25
|
+
result[:tenant_name] = VP_SETTINGS[:tenant]
|
26
|
+
end
|
27
|
+
if result[:tenant_name].blank? && class_exists?('Admin::Setting')
|
28
|
+
result[:tenant_name] = Admin::Setting.all[:tenant]
|
29
|
+
end
|
24
30
|
|
25
31
|
# validate params at the other side (analytics api endoint)
|
26
32
|
result
|
@@ -38,5 +44,12 @@ module RemarkAnalytics
|
|
38
44
|
|
39
45
|
RemarkAnalytics::Jobs::PostEventJob.perform_later(event_params)
|
40
46
|
end
|
47
|
+
|
48
|
+
def class_exists?(class_name)
|
49
|
+
klass = Module.const_get(class_name)
|
50
|
+
klass.is_a?(Class)
|
51
|
+
rescue NameError
|
52
|
+
false
|
53
|
+
end
|
41
54
|
end
|
42
55
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remark_analytics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Rockx
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -65,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
65
65
|
- !ruby/object:Gem::Version
|
66
66
|
version: '0'
|
67
67
|
requirements: []
|
68
|
-
rubygems_version: 3.
|
68
|
+
rubygems_version: 3.3.16
|
69
69
|
signing_key:
|
70
70
|
specification_version: 4
|
71
71
|
summary: Gem to fire events to ReMark Analytics API from a client application
|