Skip to content

Instantly share code, notes, and snippets.

@roy
Created February 17, 2011 09:15
Show Gist options
  • Save roy/831364 to your computer and use it in GitHub Desktop.
Save roy/831364 to your computer and use it in GitHub Desktop.
def top_articles_for(widget_page_title, current_user)
article_relations = widget_page_widgets_for(widget_page_title, current_user).all.collect(&:widget).collect do |widget|
widget.top_articles
end
article_relations.inject {|sum, x| sum | x}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment