* Use the existing Dossier#messagerie_available? method
* Raise when attempting to build a Commentaire if not messagerie_available?
* Disable the Messagerie form if not messagerie_available?
* Add tests :)
* Tweak the Horaires formatting while we’re here.
The user can’t even enter the path here, it’s nil.
fixes#3918
The @availability was always PATH_NOT_AVAILABLE when the form was reloaded after an error, because Procedure::path_availability always found an (archived) procedure with a nil path. It got confused and concluded its path was conflicting.
🤷🏻♂️
Sometimes, when using nested attributes, touch doesn’t propagate to
parent relationships. (see https://github.com/rails/rails/issues/26726)
Specifically, this happens in our app when updating a dossier with
only new attachements (but without changing the value of any fields).
To work around this, we need to define the parent relationship
explicitely. This is good practice anyway.
Fix#3906
Using an “inactive” Follow scope, similar to the “active” scope.
(I was tempted to use a default_scope, but this breaks when trying to `unscope` it in associations.)
Don’t check manually in advance: just try to create the new Follow and silently fail.
Since we have both Rails validation and DB constraints in place, we have two types of errors to check. I’m not actually sure this change improves the legibility of the code.
Under some circumstances (like dispatching events just before a page
navigation), IE 11 events will be dispatched twice by the browser: once
with the payload, and a second time without.
To prevent these errors, ignore the events if the payload is missing.
Styling `<select>` elements is notoriously hard. Here, it seems that
Firefox doesn't handle custom fonts on `<option>` elements. As we have
no fallback font, the browser uses its default font, Times.
Having fallback fonts is good practice anyway.
During integration tests, we don't want to load the tiles from OSM:
- It hits OSM servers during every test run;
- It it slow (Capybara waits for the tiles to be loaded to proceed);
- It makes test time out when tiles cannot be loaded for some reason.
Fix#3913