Use separate actions to select/deselect investments
This is consistent to what we usually do. Also, we're applying the same
criteria mentioned in commit 72704d776:
> We're also making these actions idempotent, so sending many requests
> to the same action will get the same result, which wasn't the case
> with the `toggle` action. Although it's a low probability case, the
> `toggle` action could result in [selecting an investment] when trying
> to [deselect] it if someone else has [deselected it] it between the
> time the page loaded and the time the admin clicked on the
> "[Selected]" button.
This commit is contained in:
@@ -66,7 +66,10 @@ namespace :admin do
|
||||
end
|
||||
|
||||
resources :budget_investments, only: [:index, :show, :edit, :update] do
|
||||
member { patch :toggle_selection }
|
||||
member do
|
||||
patch :select
|
||||
patch :deselect
|
||||
end
|
||||
|
||||
resources :audits, only: :show, controller: "budget_investment_audits"
|
||||
resources :milestones, controller: "budget_investment_milestones"
|
||||
|
||||
Reference in New Issue
Block a user