-
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
base: main
Are you sure you want to change the base?
Changes from all commits
ac7a654
fe64c32
ca45871
0e5d49f
8562649
dc7f15a
acc18eb
57a9250
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 |
---|---|---|
|
@@ -585,6 +585,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
+588
to
591
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?