rails_local_analytics 0.2.3 → 0.2.4
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 +4 -4
- data/README.md +1 -1
- data/lib/rails_local_analytics/version.rb +1 -1
- data/lib/rails_local_analytics.rb +9 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: beaf062a7a9dbc3b7f1719e7a271614f634fde67672a245346412eb4d1a78bdd
|
4
|
+
data.tar.gz: c794bcccb049f4ced030c232056687967c7aabe278886cff198b71933dcd5c85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52a06c2a88d8f3f603e693f19ed6edcc0c5d8d27d0d5ba04dd8b438ad5c40f71d7dfe00fb0dcb138f0ee57a0f63885dfa7b7c51509fd6ef605bbb8a2fe57361e
|
7
|
+
data.tar.gz: 074f789a04d5c0f58d52c404362c9169f77ed5da367af4094001a571d8396927b4f8a59913223ce039f3179ab984f793d39699db27aea1d899e08f68a40f099f
|
data/README.md
CHANGED
@@ -73,7 +73,7 @@ class CreateAnalyticsTables < ActiveRecord::Migration[6.0]
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
```
|
76
|
-
The reason we store our
|
76
|
+
The reason we store our analytics in two separate tables to keep the cardinality of our data low. You are permitted to store everything in only one table but I recommend you try the 2 table approach first and see if it meets your needs. See the performance optimization section for more details.
|
77
77
|
|
78
78
|
Add the route for the analytics dashboard at the desired endpoint:
|
79
79
|
|
@@ -29,7 +29,7 @@ module RailsLocalAnalytics
|
|
29
29
|
json_str = JSON.generate(json_hash) # convert to json string so that its compatible with all job backends
|
30
30
|
RecordRequestJob.perform_later(json_str)
|
31
31
|
else
|
32
|
-
RecordRequestJob.new.perform(json_hash)
|
32
|
+
RecordRequestJob.new.perform(json_hash.deep_stringify_keys)
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
@@ -44,12 +44,19 @@ module RailsLocalAnalytics
|
|
44
44
|
end
|
45
45
|
|
46
46
|
class Config
|
47
|
-
|
47
|
+
DEFAULTS = {
|
48
|
+
background_jobs: true,
|
49
|
+
}.freeze
|
50
|
+
|
48
51
|
mattr_reader :background_jobs
|
49
52
|
|
50
53
|
def self.background_jobs=(val)
|
51
54
|
@@background_jobs = !!val
|
52
55
|
end
|
56
|
+
|
57
|
+
DEFAULTS.each do |k,v|
|
58
|
+
self.send("#{k}=", v)
|
59
|
+
end
|
53
60
|
end
|
54
61
|
|
55
62
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_local_analytics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Weston Ganger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|