Skip to content

Commit

Permalink
Invert the logic
Browse files Browse the repository at this point in the history
Co-authored-by: Renato Arruda <git@rarruda.org>
  • Loading branch information
jdurkee-mdsol and rarruda committed May 2, 2023
1 parent c09d24b commit abf400e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/unleash/feature_toggle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def sum_variant_defs_weights
end

def variant_salt(context, stickiness = "default")
return context.get_by_name(stickiness) unless stickiness == "default" || context.nil?
return context.get_by_name(stickiness) if !context.nil? && stickiness != "default"
return context.user_id unless context&.user_id.to_s.empty?
return context.session_id unless context&.session_id.to_s.empty?
return context.remote_address unless context&.remote_address.to_s.empty?
Expand Down

0 comments on commit abf400e

Please sign in to comment.