Sha256: 4344ab43f9354b7a81a4907c58a69e8a51e5efa3c3abc0b04e9b73829341d8c5
Contents?: true
Size: 874 Bytes
Versions: 15
Compression:
Stored size: 874 Bytes
Contents
module TestTrack::Controller extend ActiveSupport::Concern included do class_attribute :test_track_identity helper_method :test_track_session, :test_track_visitor helper TestTrack::ApplicationHelper around_action :manage_test_track_session end class_methods do def require_feature_flag(feature_flag, *args) before_action(*args) do unless test_track_visitor.ab(feature_flag, context: self.class.name.underscore) raise ActionController::RoutingError, 'Not Found' end end end end private def test_track_session @test_track_session ||= TestTrack::Session.new(self) end def test_track_visitor test_track_session.visitor_dsl end def manage_test_track_session RequestStore[:test_track_session] = test_track_session test_track_session.manage do yield end end end
Version data entries
15 entries across 15 versions & 1 rubygems