Module: Sidekiq::History::WebExtension::Helpers
- Defined in:
- lib/sidekiq/history/web_extension.rb
Overview
Helpers module provides utility methods for the Sidekiq History web extension.
Instance Method Summary collapse
-
#request_params(key) ⇒ String?
Fetches the query parameters or body from the request based on the Sidekiq version.
Instance Method Details
#request_params(key) ⇒ String?
Fetches the query parameters or body from the request based on the Sidekiq version.
Sidekiq 8.0 recommended ‘url_params` as a replacement for `params`. This method ensures compatibility with both older and newer versions of Sidekiq.
15 16 17 18 19 20 21 |
# File 'lib/sidekiq/history/web_extension.rb', line 15 def request_params(key) if Gem::Dependency.new('', '>= 8.0.0').match?('', Gem.loaded_specs['sidekiq'].version) url_params(key.to_s) else params[key] end end |