Skip to content

Commit 85c53b8

Browse files
committed
Published at rather than created at
1 parent d6cc350 commit 85c53b8

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

app/services/xml_generator/single_provider.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ def topic_scope(prov)
5858
.select(:id, :title, :published_at, :language_id, :provider_id)
5959
.includes(:language, taggings: :tag) # eager-load language and taggings->tag
6060
.with_attached_documents # eager-load Active Storage attachments + blobs
61-
.order(:published_at)
61+
.order(published_at: :desc)
6262
end
6363
end

spec/services/xml_generator/all_providers_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
<?xml version="1.0"?>
2525
<cmes>
2626
<content_provider name="#{provider1.name}">
27-
<topic_year year="#{topic1.created_at.year}">
28-
<topic_month month="#{topic1.created_at.strftime("%m_%B")}">
27+
<topic_year year="#{topic1.published_at.year}">
28+
<topic_month month="#{topic1.published_at.strftime("%m_%B")}">
2929
<title name="#{topic1.title}">
3030
<topic_id>#{topic1.id}</topic_id>
3131
<topic_files files="Files"/>
@@ -35,8 +35,8 @@
3535
</topic_year>
3636
</content_provider>
3737
<content_provider name="#{provider2.name}">
38-
<topic_year year="#{topic2.created_at.year}">
39-
<topic_month month="#{topic2.created_at.strftime("%m_%B")}">
38+
<topic_year year="#{topic2.published_at.year}">
39+
<topic_month month="#{topic2.published_at.strftime("%m_%B")}">
4040
<title name="#{topic2.title}">
4141
<topic_id>#{topic2.id}</topic_id>
4242
<topic_files files="Files">

spec/services/xml_generator/single_provider_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
<?xml version="1.0"?>
4141
<cmes>
4242
<content_provider name="#{provider.name}">
43-
<topic_year year="#{topic.created_at.year}">
44-
<topic_month month="#{topic.created_at.strftime("%m_%B")}">
43+
<topic_year year="#{topic.published_at.year}">
44+
<topic_month month="#{topic.published_at.strftime("%m_%B")}">
4545
<title name="#{topic.title}">
4646
<topic_id>#{topic.id}</topic_id>
4747
<topic_files files="Files">

0 commit comments

Comments
 (0)