-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Perf: Better response times from api/public/v1/courses #4616
Changes from all commits
f29df41
a3b1200
0907c46
02f294e
673655c
fe478be
56988d8
6a711b8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -594,6 +594,8 @@ def gcse_grade_required | |
end | ||
|
||
def last_published_at | ||
return enrichments.select(&:last_published_timestamp_utc).max_by(&:last_published_timestamp_utc)&.last_published_timestamp_utc if enrichments.loaded? | ||
|
||
enrichments.maximum(:last_published_timestamp_utc) | ||
end | ||
Comment on lines
+597
to
600
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks like it can be generalised for all associations. Have you considered looking into ActiveRecord/Associations/CollectionProxy? A There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah that looks tempting. but I would be careful about doing that. It's something we should discuss though, it seems like a useful thing to do. |
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's have a discussion about this expiration time?