diff --git a/app/logical/api_cache_generator.rb b/app/logical/api_cache_generator.rb new file mode 100644 index 000000000..19f45da76 --- /dev/null +++ b/app/logical/api_cache_generator.rb @@ -0,0 +1,17 @@ +class ApiCacheGenerator + def generate_tag_cache + File.open("#{RAILS_ROOT}/public/cache/tags-legacy.xml", "w") do |f| + f.puts('') + f.puts('') + Tag.find_each do |tag| + name = CGI.escape_html(tag.name) + id = tag.id.to_s + created_at = tag.created_at.try(:strftime, '%Y-%m-%d %H:%M') + post_count = tag.post_count.to_s + category = tag.category + f.puts('') + end + f.puts('') + end + end +end diff --git a/script/fixes/011.rb b/script/fixes/011.rb new file mode 100644 index 000000000..44e29f614 --- /dev/null +++ b/script/fixes/011.rb @@ -0,0 +1,5 @@ +#!/usr/bin/env ruby + +require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment')) +require 'benchmark' +