Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
aoz-003
Commits
4b9b47f9
Verified
Commit
4b9b47f9
authored
Jul 05, 2018
by
Kaspar Vollenweider
👻
Browse files
rename action from update_waive_and_iban to update_bank_details
parent
120c49c9
Changes
4
Hide whitespace changes
Inline
Side-by-side
app/assets/javascripts/last_submitted_hours_and_feedbacks_form.es6
View file @
4b9b47f9
...
...
@@ -8,7 +8,7 @@ $(() => {
data: { volunteer: { [fieldName]: valueOrChecked($(target)) } },
method: 'PATCH',
dataType: 'json',
url: Routes.update_
waive_and_iban
_volunteer_path(volunteerId)
url: Routes.update_
bank_details
_volunteer_path(volunteerId)
})
}))
})
...
...
app/controllers/volunteers_controller.rb
View file @
4b9b47f9
class
VolunteersController
<
ApplicationController
before_action
:set_volunteer
,
only:
[
:show
,
:edit
,
:update
,
:terminate
,
:account
,
:update_
waive_and_iban
]
before_action
:set_volunteer
,
only:
[
:show
,
:edit
,
:update
,
:terminate
,
:account
,
:update_
bank_details
]
def
index
authorize
Volunteer
...
...
@@ -79,7 +79,7 @@ class VolunteersController < ApplicationController
end
end
def
update_
waive_and_iban
def
update_
bank_details
authorize
@volunteer
@volunteer
.
update
(
volunteer_params
.
slice
(
:iban
,
:waive
,
:bank
))
render
json:
nil
,
status: :ok
...
...
app/policies/volunteer_policy.rb
View file @
4b9b47f9
...
...
@@ -45,7 +45,7 @@ class VolunteerPolicy < ApplicationPolicy
alias_method
:show?
,
:volunteer_managing_or_volunteers_profile?
alias_method
:edit?
,
:volunteer_managing_or_volunteers_profile?
alias_method
:update?
,
:volunteer_managing_or_volunteers_profile?
alias_method
:update_
waive_and_iban
?
,
:volunteer_managing_or_volunteers_profile?
alias_method
:update_
bank_details
?
,
:volunteer_managing_or_volunteers_profile?
alias_method
:account?
,
:superadmin?
# supplementary policies
...
...
config/routes.rb
View file @
4b9b47f9
...
...
@@ -103,7 +103,7 @@ Rails.application.routes.draw do
put
:account
,
on: :member
get
:find_client
,
on: :member
,
to:
'assignments#find_client'
get
:seeking_clients
,
on: :collection
patch
:update_
waive_and_iban
,
on: :member
patch
:update_
bank_details
,
on: :member
resources
:assignments
,
except:
[
:destroy
],
concerns:
[
:assignment_feedbacks
,
:hours_resources
]
resources
:billing_expenses
,
only:
[
:index
]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment