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
0cf94295
Verified
Commit
0cf94295
authored
Jul 14, 2018
by
Kaspar Vollenweider
👻
Browse files
prevent semester passed from index link to new action does not contain any hours
parent
aba7a3cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/controllers/billing_expenses_controller.rb
View file @
0cf94295
...
...
@@ -55,8 +55,6 @@ class BillingExpensesController < ApplicationController
authorize
@billing_expense
@selected_billing_semester
=
selected_billing_semester
set_default_filter
(
semester:
@selected_billing_semester
)
@q
=
Volunteer
.
with_billable_hours
(
@selected_billing_semester
).
ransack
(
params
[
:q
])
@volunteers
=
@q
.
result
@selected_volunteers
=
params
[
:selected_volunteers
].
presence
||
[]
...
...
@@ -108,9 +106,13 @@ class BillingExpensesController < ApplicationController
def
selected_billing_semester
if
params
[
:q
].
blank?
set_default_filter
(
semester:
default_billing_semester
)
default_billing_semester
elsif
params
[
:q
][
:all
].
present?
nil
elsif
!
@billing_semester_filters
.
pluck
(
:value
).
include?
params
[
:q
][
:semester
]
params
.
permit!
[
:q
][
:semester
]
=
default_billing_semester
default_billing_semester
else
params
[
:q
][
:semester
]
end
...
...
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