8000 refact(forced-decision): Support for decision context added. by ozayr-zaviar · Pull Request #288 · optimizely/ruby-sdk · GitHub
[go: up one dir, main page]

Skip to content

refact(forced-decision): Support for decision context added. #288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 2, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
variation updated to variation_key
  • Loading branch information
ozayr-zaviar committed Oct 28, 2021
commit 22e21f6a2377fc79caf7bec3fe88a0a71a5edfff
4 changes: 2 additions & 2 deletions lib/optimizely/optimizely_user_context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class OptimizelyUserContext
attr_reader :OptimizelyForcedDecision

OptimizelyDecisionContext = Struct.new(:flag_key, :rule_key)
OptimizelyForcedDecision = Struct.new(:variation)
OptimizelyForcedDecision = Struct.new(:variation_key)
def initialize(optimizely_client, user_id, user_attributes)
@attr_mutex = Mutex.new
@forced_decision_mutex = Mutex.new
Expand Down Expand Up @@ -165,7 +165,7 @@ def find_validated_forced_decision(context)
decision = find_forced_decision(context)
flag_key = context[:flag_key]
rule_key = context[:rule_key]
variation_key = decision ? decision[:variation] : decision
variation_key = decision ? decision[:variation_key] : decision
reasons = []
target = rule_key ? "flag (#{flag_key}), rule (#{rule_key})" : "flag (#{flag_key})"
if variation_key
Expand Down
0