Sha256: 1a9b22c295a0c116e561e077a7ffa2cb184244bafa607b497ed4432c6fd42f80
Contents?: true
Size: 644 Bytes
Versions: 13
Compression:
Stored size: 644 Bytes
Contents
require 'flipper/ui/action' require 'flipper/ui/decorators/feature' module Flipper module UI module Actions class BooleanGate < UI::Action include FeatureNameFromRoute route %r{\A/features/(?<feature_name>.*)/boolean/?\Z} def post read_only if Flipper::UI.configuration.read_only feature = flipper[feature_name] @feature = Decorators::Feature.new(feature) if params['action'] == 'Enable' feature.enable else feature.disable end redirect_to "/features/#{@feature.key}" end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems