Skip to content
Open
Changes from all commits
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
6 changes: 5 additions & 1 deletion app/controllers/concerns/test_track/controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ module TestTrack::Controller
class_methods do
def require_feature_flag(feature_flag, *args)
before_action(*args) do
raise ActionController::RoutingError, 'Not Found' unless test_track_visitor.ab(feature_flag, context: self.class.name.underscore)
raise ActionController::RoutingError, 'Not Found' unless feature_flagged?(feature_flag)
end
end
end

private

def feature_flagged?(feature_flag)
test_track_visitor.ab(feature_flag, context: self.class.name.underscore)
end

def test_track_session
@test_track_session ||= TestTrack::WebSession.new(self)
end
Expand Down
Loading