Created
January 31, 2014 03:36
-
-
Save Stenerson/8726239 to your computer and use it in GitHub Desktop.
My most proud ruby method so far. A method to find the candidates that a user needs to take action on. Probably makes no sense without context - too bad.
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
def candidate_queue | |
self.campaigns.collect do |x| | |
x.candidates.select {|y| y.owners.compact.include?(self) } | |
end.flatten.sort! {|a,b| a.updated_at <=> b.updated_at } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment