Skip to content

Instantly share code, notes, and snippets.

@loe
Created October 1, 2008 01:05
Show Gist options
  • Save loe/13999 to your computer and use it in GitHub Desktop.
Save loe/13999 to your computer and use it in GitHub Desktop.
Hub.for_user_clean(current_user).collect{|hub| hub.owner.enhanced_security_allowed?}.any?
#this will loop through all hubs I want to short circuit as soon as the block is true for any.
# something like this but I can't quite get the syntax right
Hub.for_user_clean(current_user).collect{|hub| true && break if hub.owner.enhanced_security_allowed?}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment