Skip to content

Add `exclude!` instance interface

Jeremy Jackson requested to merge jj-add-exclude-instance-interface into master

I thought I pulled this in for 0.5.0, but apparently didn't. 😓

This just adds a nicer way to include logic within the experiment block to exclude contexts.

experiment(:example, actor: current_user) do |e|
  e.exclude! unless can?(current_user, :manage, project)

  e.control { }
  e.candidate { }
end

This isn't really very much different than wrapping the experiment within an if, but it does keep our experiment logic wrapped nicely in the experiment block. I think on how we might be able to automate some cleanup tasks if we can follow some of these patterns?

Edited by Jeremy Jackson

Merge request reports

Loading