Skip to content

Commit

Permalink
We can just check if request/params are there
Browse files Browse the repository at this point in the history
  • Loading branch information
andrehjr committed Mar 3, 2024
1 parent f71cb5b commit 971673b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/split/encapsulated_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def initialize(context)
end

def params
request.params if request_present?
request.params if request && request.respond_to?(:params)
end

def request
Expand Down
4 changes: 2 additions & 2 deletions lib/split/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,11 @@ def is_ignored_ip_address?
end

def params_present?
defined?(params) && params != nil
defined?(params) && params
end

def request_present?
defined?(request) && request != nil
defined?(request) && request
end

def active_experiments
Expand Down

0 comments on commit 971673b

Please sign in to comment.