rails_local_analytics 0.2.3 → 1.0.0

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
  SHA256:
3
- metadata.gz: f0a0bf463e77ac16f76c751e5664ae847146c8e2e7b2fbbef76093512d966af1
4
- data.tar.gz: d5c9028dcf9cc3307bb39441f107a0a07afa8f115c013b0edc9512d9ccc0d7e8
3
+ metadata.gz: 2e1f4be59a2ab3441a9797c4e903262deb94e88f6e0185e18e76675ce3c0c494
4
+ data.tar.gz: b64c1f23ff32b3ecf058e972734264b2f435ea09e2db406021b81f5d6bef304b
5
5
  SHA512:
6
- metadata.gz: faa7bf7a4c0ee569aae5873e93358cea48ff0060b9caf14c9b7516390a71698bd42b2308233b87438fce0d85d3804990ee0254bb66090024394caf674c5e0f79
7
- data.tar.gz: 71662ed4b26b97d416d9dd8341ccc3576f0e6725af6ece920adef1727fd276871cac65023d8d5d2279d734ce3ee6a6d2f32c0e2c7f75b92856d157d4fe2c8112
6
+ metadata.gz: a6c5290db60c958fbf9fabfd7f65fd9f82fd3a7c8ff39a99aeb2c929e21803fdfac703ae471282874f17fa5bd2c4a5323291275a56e771c244eae784e2de74ba
7
+ data.tar.gz: be174afa37617cd178bc1286778384590feda9b7dcd9b856a84e11623c7f6b6995b2d7704d4bbfe82dff3c20803bd74e5ed879f384ec6932a34d51e3a3b30e4f
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 anayltics in two separate tables to keep the cardinality of our data low. You may use only a single 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.
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
 
@@ -1,3 +1,3 @@
1
1
  module RailsLocalAnalytics
2
- VERSION = "0.2.3".freeze
2
+ VERSION = "1.0.0".freeze
3
3
  end
@@ -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
- @@background_jobs = true
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.3
4
+ version: 1.0.0
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-17 00:00:00.000000000 Z
11
+ date: 2025-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails