I encountered a small issue with this code:
if feature_image_id || has_branch?(id) || has_organization?(id),
do: false,
else: true
Recode wants to change this to:
not (feature_image_id || has_branch?(id) || has_organization?(id))
But this won't work, since feature_image_id is a string (if set), not a boolean, and if the ID is not nil, the statement evaluates to something like not "abc", which results in an ArgumentError, since not expects a boolean.
Workaround is to fix the result by adding an explicit !is_nil.
I encountered a small issue with this code:
Recode wants to change this to:
But this won't work, since
feature_image_idis a string (if set), not a boolean, and if the ID is notnil, the statement evaluates to something likenot "abc", which results in anArgumentError, sincenotexpects a boolean.Workaround is to fix the result by adding an explicit
!is_nil.