Build out new reservation flow for members#2059
Conversation
75b2cc8 to
007bf93
Compare
crismali
left a comment
There was a problem hiding this comment.
Just a few little things but I think it looks good. 🔥
The main thing is that there is some nil handling after ActiveRecord finds which I think raise errors if the record can't be found.
|
|
||
| assert_text reservation.name | ||
| assert_text reservation.status | ||
| assert_text formatted_date_only(reservation.started_at) |
There was a problem hiding this comment.
CI fails on this assertion because it's looking for "March 01" but the page contains "March 1" which means that formatted_date_only helper function likely needs to be tweaked.
There was a problem hiding this comment.
We already have a :month_day_year option that removes the leading zero it turns out!
| @@ -0,0 +1,6 @@ | |||
| <ul class="tab"> | |||
There was a problem hiding this comment.
If this is only used in the one place it might make sense to just put it inline in the index.html.erb for now.
| module Account | ||
| class ReservationHoldsController < BaseController | ||
| def create | ||
| @reservation = current_member.reservations.find(reservation_hold_params[:reservation_id]) |
There was a problem hiding this comment.
I think this will raise if it can't find the reservation, so the if on the next few lines may not be necessary. Maybe a rescue_from is more appropriate? Or a find_by(id: reservation_hold_params[:reservation_id])
There was a problem hiding this comment.
Good call. I think I was trying to have some of the error handling redirect the user to different places, but it's really just a safeguard and shouldn't really be hit anyway. I'll simplify it using rescue_from.
What it does