<p></p>
<p><b>@kcne</b> commented on this pull request.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5761#discussion_r2010247893">lib/user_activities.rb</a>:</p>
<pre style='color:#555'>> + # Common SQL for activity days
+ private_class_method def self.activity_days_sql(_user_id)
+ <<~SQL.squish
+ SELECT DATE_TRUNC('day', changesets.created_at) AS day FROM changesets WHERE user_id = :user_id
+ UNION ALL
+ SELECT DATE_TRUNC('day', diary_entries.created_at) AS day FROM diary_entries WHERE user_id = :user_id AND visible = true
+ UNION ALL
+ SELECT DATE_TRUNC('day', changeset_comments.created_at) AS day FROM changeset_comments WHERE author_id = :user_id
+ UNION ALL
+ SELECT DATE_TRUNC('day', note_comments.created_at) AS day FROM note_comments WHERE author_id = :user_id
+ UNION ALL
+ SELECT DATE_TRUNC('day', diary_comments.created_at) AS day FROM diary_comments WHERE user_id = :user_id AND visible = true
+ UNION ALL
+ SELECT DATE_TRUNC('day', gpx_files.timestamp) AS day FROM gpx_files WHERE user_id = :user_id
+ SQL
+ end
</pre>
<p dir="auto">Thank you for the time spent on this Tom. I refactored to use the limits as suggested. Also opted for cursor based pagination to support <code class="notranslate">load more</code> functionality later. It should also follow the pattern and use the indexes efficitently.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5761#discussion_r2010247893">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLMERUERTOR7STLD2332WAF7BAVCNFSM6AAAAABYQQXBLGVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDOMJQGUYDMNBSGA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLKM2AG7WPBQSH6IE432WAF7BA5CNFSM6AAAAABYQQXBLGWGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTVBR4F3I.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/5761/review/2710506420</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/5761#discussion_r2010247893",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5761#discussion_r2010247893",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>