-
-
Save mxcl/241661 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 more "Ruby", and I agree that I don't necessarily agree with | |
# all the syntax choices. The else condition isn't required as the | |
# function returns nil if no other code paths executed. You could argue | |
# that, that is a regression waiting to happen though. | |
def just_one_kind_of_response? item, controller | |
case controller | |
when 'actions' | |
item.comments.blank? or item.suggestions.blank? or detail.comments.blank? | |
when 'thoughts' | |
item.comments.blank? or item.suggestions.blank? | |
when 'suggestions' | |
item.comments.blank? or item.actions.blank? | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment