posthog-rails 3.9.3 → 3.9.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/posthog/rails/railtie.rb +6 -6
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: acf2dae9d33c6b1186af158600a34be474df6fb57e7ee0d3b82144ac21aa6ab1
4
- data.tar.gz: bc72fab471755cd32695bfdc919aa5cc99559c626504af061e89b80ad98dfd33
3
+ metadata.gz: ec0f2d75e41e549493253977a5e98eb4ae0ca57f80fceda6beec1bd683562a5a
4
+ data.tar.gz: e8d1208f8174c553f05d7ae43dc4e1d9a1eb019dc5a0f1abd559016821b04084
5
5
  SHA512:
6
- metadata.gz: 9522bf990ab2b753a24962af203df38320ba3737898f91274507eac16a913ff37424a09c291c399ee508389a1ae2d281522ea367e7a37ec0071b0425f5e87d8d
7
- data.tar.gz: afb7cb589db961516dea558424cdbe71ff9e20a004a0b944eba6f0aa54fdcb5a4be92acd0dfe6ce88abc84e35a63ca6567ecea4b5fd662018940b05b595aa27b
6
+ metadata.gz: 1d6cb2a1158500f273f7c524cbca0d1ee6901e18ef4f843a47c78ebb89b9f79e7911cb8112c441a83476be39bd9be7e7b1cc860cde4072780092d189b6fd64f9
7
+ data.tar.gz: 84873843f9fc8d5f09dea8bbd261c82721bd37dbaba76a4a48572aca0191de81ff478fd7eae4519fdce9d404c6eb1e007e67a1120386e35f33efcd9ed4ca1c4a
@@ -54,10 +54,10 @@ module PostHog
54
54
  # Fallback for any client methods not explicitly defined.
55
55
  #
56
56
  # @api private
57
- # rubocop:disable Lint/RedundantSafeNavigation
58
57
  def method_missing(method_name, ...)
59
- if client&.respond_to?(method_name)
60
- ensure_initialized!
58
+ ensure_initialized!
59
+
60
+ if client.respond_to?(method_name)
61
61
  client.public_send(method_name, ...)
62
62
  else
63
63
  super
@@ -66,16 +66,16 @@ module PostHog
66
66
 
67
67
  # @api private
68
68
  def respond_to_missing?(method_name, include_private = false)
69
- client&.respond_to?(method_name) || super
69
+ ensure_initialized!
70
+ client.respond_to?(method_name, include_private) || super
70
71
  end
71
- # rubocop:enable Lint/RedundantSafeNavigation
72
72
 
73
73
  private
74
74
 
75
75
  def ensure_initialized!
76
76
  return if initialized?
77
77
 
78
- raise 'PostHog is not initialized. Call PostHog.init in an initializer.'
78
+ @client = PostHog::Client.new(api_key: nil, silence_disabled_client_error: true)
79
79
  end
80
80
  end
81
81
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: posthog-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.9.3
4
+ version: 3.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - PostHog