Skip to content
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

fix: do not fail when case insentive enabled while having a complex context object #191

Merged
merged 7 commits into from
Aug 29, 2024
Merged
2 changes: 1 addition & 1 deletion lib/unleash/constraint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def matches_constraint?(context)
context_value = context.get_by_name(self.context_name)
gastonfournier marked this conversation as resolved.
Show resolved Hide resolved

v.map!(&:upcase) if self.case_insensitive
context_value = context_value.upcase if self.case_insensitive
context_value = context_value.upcase if self.case_insensitive && context_value.is_a?(String)
gastonfournier marked this conversation as resolved.
Show resolved Hide resolved

OPERATORS[self.operator].call(context_value, v)
end
Expand Down
Loading