Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# this is ridonkulously ugly, and looks like an ideal candidate for a case statement, but my understanding was that case statements can only be used to for a single variable, not two.
# any alternatives greatly appreciated
def just_one_kind_of_response?(item, controller)
if (controller == 'actions' && detail.comments.blank?) || (controller == 'actions' && item.comments.blank?) || (controller == 'actions' && item.suggestions.blank?) || (controller == 'thoughts' && item.comments.blank?) || (controller == 'thoughts' && item.suggestions.blank?) || (controller == 'suggestions' && item.comments.blank?) || (controller == 'suggestions' && item.actions.blank?)
return true
else
return false
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment