Sha256: c26bbdeadadb5a2d29d2671c4659b590d30b9f4527ae1a86e73ec75554de9861
Contents?: true
Size: 809 Bytes
Versions: 10
Compression:
Stored size: 809 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 render_read_only if read_only? 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
10 entries across 10 versions & 1 rubygems