Ensure to_json methods take optional argument
requested to merge 20003-newnoteworker-failing-repeatedly-with-argumenterror-wrong-number-of-arguments into master
If only Ruby had static checking for interfaces like this
Closes #20003 (closed).