Skip to content

Commit

Permalink
refactor(contact): builtin piece jointe attachment
Browse files Browse the repository at this point in the history
  • Loading branch information
colinux committed Jul 31, 2024
1 parent 7515b73 commit ee47a71
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/controllers/contact_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ def create
return

Check warning on line 20 in app/controllers/contact_controller.rb

View check run for this annotation

Codecov / codecov/patch

app/controllers/contact_controller.rb#L19-L20

Added lines #L19 - L20 were not covered by tests
end

form_params = contact_form_params
@form = ContactForm.new(form_params.except(:piece_jointe))
@form.piece_jointe.attach(form_params[:piece_jointe]) if form_params[:piece_jointe].present?
@form = ContactForm.new(contact_form_params)
@form.user = current_user

Check warning on line 24 in app/controllers/contact_controller.rb

View check run for this annotation

Codecov / codecov/patch

app/controllers/contact_controller.rb#L23-L24

Added lines #L23 - L24 were not covered by tests

if @form.save

Check warning on line 26 in app/controllers/contact_controller.rb

View check run for this annotation

Codecov / codecov/patch

app/controllers/contact_controller.rb#L26

Added line #L26 was not covered by tests
Expand Down

0 comments on commit ee47a71

Please sign in to comment.