Sha256: a09c530ac60f061f2ba9c0fe3988867c878d96d64553425719394de838ee426b
Contents?: true
Size: 767 Bytes
Versions: 11
Compression:
Stored size: 767 Bytes
Contents
require 'flipper/ui/action' require 'flipper/ui/decorators/feature' module Flipper module UI module Actions class PercentageOfActorsGate < UI::Action include FeatureNameFromRoute route %r{\A/features/(?<feature_name>.*)/percentage_of_actors/?\Z} def post feature = flipper[feature_name] @feature = Decorators::Feature.new(feature) begin feature.enable_percentage_of_actors params['value'] rescue ArgumentError => exception error = "Invalid percentage of actors value: #{exception.message}" redirect_to("/features/#{@feature.key}?error=#{error}") end redirect_to "/features/#{@feature.key}" end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems