Class: GreenFlag::Admin::FeatureDecisionSummariesController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/green_flag/admin/feature_decision_summaries_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



3
4
5
6
7
8
# File 'app/controllers/green_flag/admin/feature_decision_summaries_controller.rb', line 3

def show
  feature_id = params[:feature_id]
  feature = GreenFlag::Feature.find(feature_id)

  render :json => summary(feature)
end

#updateObject



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/controllers/green_flag/admin/feature_decision_summaries_controller.rb', line 10

def update
  feature_id = params[:feature_id]
  feature = GreenFlag::Feature.find(feature_id)

  if params[:forget_enabled]
    feature.forget_non_manual_decisions!(true)
  end
  if params[:forget_disabled]
    feature.forget_non_manual_decisions!(false)
  end

  render :json => summary(feature)
end