Closed damianhxy closed 4 months ago
docs/features/schedulers.md (1)
Near line 50: Using many exclamation marks might seem excessive (in this case: 7 exclamation marks for a text that’s 1029 characters long) Context: ...t end end ``` **Visual Run Output** ![Scheduler Visual Run](/images/scheduler...
docs/features/schedulers.md (13)
29: Expected: 0 or 2; Actual: 1 Trailing spaces --- 8: Expected: 1; Actual: 0; Below Headings should be surrounded by blank lines --- 28: Expected: 1; Actual: 0; Below Headings should be surrounded by blank lines --- 12: null Fenced code blocks should be surrounded by blank lines --- 18: null Fenced code blocks should be surrounded by blank lines --- 20: null Fenced code blocks should be surrounded by blank lines --- 40: null Fenced code blocks should be surrounded by blank lines --- 49: null Fenced code blocks should be surrounded by blank lines --- 11: null Emphasis used instead of a heading --- 19: null Emphasis used instead of a heading --- 39: null Emphasis used instead of a heading --- 37: Expected: fenced; Actual: indented Code block style --- 51: null Files should end with a single newline character
docs/features/schedulers.md (1)
`32-37`: Clarify the behavior of the `update` method to prevent unexpected outputs.app/controllers/schedulers_controller.rb (1)
`59-59`: Ensure the `output` can be converted to a string to prevent errors.
Description
Check whether return value of
update
method has ato_str
method (used for implicit conversions), rather than just if it's non-nil
.Motivation and Context
The scheduler visual run output feature introduced in #1916 expects that users either return a string or
nil
from theupdate
method.However, if an existing user was not aware of the change, they may not have an explicit return. As a result of Ruby's implicit returns, they might return a value that is non-
nil
yet can not be converted to a string, leading to an error.How Has This Been Tested?
(Follow the steps in #1916 if unsure how to set up a scheduler)
returning a string
returning nil
returning non-nil value that can't be converted to a string
Note:
true
has ato_s
method but NOT ato_str
method. So implicit conversions fail. (same picture as above)Updated documentation
Types of changes
Checklist:
overcommit --install && overcommit --sign
to use pre-commit hook for lintingOther issues / help required
If unsure, feel free to submit first and we'll help you along.