class Flipper::UI::Actions::PercentageOfActorsGate

Public Instance Methods

post() click to toggle source
# File lib/flipper/ui/actions/percentage_of_actors_gate.rb, line 12
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