Skip to content

Instantly share code, notes, and snippets.

@jywarren jywarren/relatedTags.rb

Last active Jan 16, 2019
Embed
What would you like to do?
time = Time.now
tags = {}
Tag.order(count: :desc).limit(250).each do |tag|
tags[tag.name] = Tag.related(tag.name).collect(&:name)
end
tags.to_json
(Time.now - time).to_s # time passed in seconds - ~8-11 seconds, potentially longer without caching
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.