-
Notifications
You must be signed in to change notification settings - Fork 21.4k
Commit
This is a developer quality of life improvement, to ensure that unknown formats aren't assigned (which it would previously accept, but wouldn't work 100% correctly due to caching).
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -284,6 +284,11 @@ def formats=(values) | |||
values.concat(default_formats) if values.delete "*/*" | ||||
values.uniq! | ||||
|
||||
invalid_types = (values - Template::Types.symbols) | ||||
unless invalid_types.empty? | ||||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
kaspth
Contributor
|
order.include?(Mime::ALL) ? format : nil |
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
jhawthorn
Mar 28, 2019
•
edited
Author
Member
edited
🙇 Thank you. This should be fixed by #35775
I'm actually quite happy this changed caught this issue, previously we would have been looking for with .all
as the extension, ex. welcome.all.erb
, and not actually all extensions!
Very much of an edgecase but this now breaks in case you have an action that does this
The negotiated format returned will be
:all
which isn't part of theTemplate::Types.symbols
.Not sure if we want to fix since there is no point to defined a single
all
, but it surprised me that this suddenly broke