diff --git a/app/models/category_featured_topic.rb b/app/models/category_featured_topic.rb index caed542a697..c5506f55368 100644 --- a/app/models/category_featured_topic.rb +++ b/app/models/category_featured_topic.rb @@ -4,14 +4,12 @@ class CategoryFeaturedTopic < ActiveRecord::Base # Populates the category featured topics def self.feature_topics - transaction do - current = {} - CategoryFeaturedTopic.select(:topic_id, :category_id).order(:rank).each do |f| - (current[f.category_id] ||= []) << f.topic_id - end - Category.select(:id, :topic_id).find_each do |c| - CategoryFeaturedTopic.feature_topics_for(c, current[c.id] || []) - end + current = {} + CategoryFeaturedTopic.select(:topic_id, :category_id).order(:rank).each do |f| + (current[f.category_id] ||= []) << f.topic_id + end + Category.select(:id, :topic_id).find_each do |c| + CategoryFeaturedTopic.feature_topics_for(c, current[c.id] || []) end end