Created
November 23, 2009 00:40
-
-
Save mrchrisadams/240812 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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