Skip to content

Commit

Permalink
Project: verify cover photo persistence
Browse files Browse the repository at this point in the history
The form (still) raises an error when trying to re-render edit
after an invalid cover photo is attached.

Check for persistence of the cover photo, not just attachment and persistence of
the model.

References #401, #381, #295
  • Loading branch information
ybakos committed Apr 16, 2024
1 parent bf80e70 commit 86fc46b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/projects/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
= f.label :structure_description, 'Description of Construction Elements'
= help_button('structure_description-help')
= f.text_area :structure_description, placeholder: 'Briefly describe LT-PBR design and/or construction elements.', class: 'form-control', rows: 5
- if @project.persisted? && @project.cover_photo.attached?
- if @project.persisted? && @project.cover_photo.attached? && @project.cover_photo.persisted?
%h5 Current cover photo
= image_tag @project.cover_photo, class: 'rounded photo-small mb-3'
.form-group
Expand Down

0 comments on commit 86fc46b

Please sign in to comment.