Skip to content
Closed

WIP #347

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions app/services/xml_generator/single_provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def provider_xml(xml, provider)
xml.send("file_name_#{index + 1}", document.filename, file_size: document.byte_size)
end
}
xml.topic_tags topic.current_tags_list.join(", ")
xml.topic_tags topic.taggings.map { |tg| tg.tag.name }.uniq.join(", ")
}
end
}
Expand All @@ -40,8 +40,8 @@ def grouped_topics(prov)
end

def topic_scope(prov)
return prov.topics.where("created_at > ?", 1.month.ago) if args.fetch(:recent, false)

prov.topics
scope = prov.topics
scope = scope.where("created_at > ?", 1.month.ago) if args.fetch(:recent, false)
scope.eager_load(:language, taggings: :tag).with_attached_documents
end
end
5 changes: 5 additions & 0 deletions db/migrate/20250802124141_add_topic_indexes.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddTopicIndexes < ActiveRecord::Migration[8.0]
def change
add_index :topics, :created_at
end
end
Loading