-
Notifications
You must be signed in to change notification settings - Fork 172
E2566 Finish Due Dates #234
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
Open
SeojinSeojin
wants to merge
17
commits into
expertiza:main
Choose a base branch
from
SeojinSeojin:e2566-duedate
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
e3d03c9
Pushing (Local) Changes to the Task1 and Task2 for Completion checks.
MrScruffles 0049749
Updates to comments in pullrequest
MrScruffles e2e1540
Update .DS_Store
MrScruffles ec7a755
fix: remove methods, revise shift deadlines type to use days
SeojinSeojin 9937b35
delete .ds_store, rename methods
SeojinSeojin 8f0fc6b
remove .ds_store
SeojinSeojin 29f4ba3
Updated based on comments.
MrScruffles 096561b
removal of ActiveSupport::Concern (not needed)
MrScruffles ab83d49
Final edits from the meeting we had on Friday.
MrScruffles 40e9aef
fix: fix migration files for proper migration
SeojinSeojin 0c6907e
test: update test codes for new due date modules
SeojinSeojin c02ae6d
fix: code review - simplify comments, truncate chained method for nex…
SeojinSeojin da53025
fix: code review - remove comments for removed method
SeojinSeojin 58fbb12
test: add test codes
SeojinSeojin a5ca117
test: add test codes for assignment model (with DueDateAction)
SeojinSeojin d2a5841
fix: fix deadlines_properly_ordered? method in due date actions mixin
SeojinSeojin 9eb9a49
Removal of Late methods as didn't' have use, added comment to due_dat…
MrScruffles File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -92,15 +92,9 @@ def copy(from_assignment_id, to_assignment_id) | |
|
|
||
|
|
||
|
|
||
| def next_due_date(parent_id, topic_id = nil) | ||
| if topic_id | ||
| topic_deadline = where(parent_id: topic_id, parent_type: 'ProjectTopic') | ||
| .upcoming.first | ||
| return topic_deadline if topic_deadline | ||
| end | ||
|
|
||
| where(parent_id: parent_id).upcoming.first | ||
| end | ||
| # This method is no longer needed as the functionality has been moved | ||
|
||
| # to the DueDateActions concern which provides a cleaner interface | ||
| # that doesn't require the caller to know about topic vs assignment due dates | ||
| end | ||
|
|
||
| private | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,11 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| class TopicDueDate < DueDate | ||
| def self.next_due_date(assignment_id, topic_id) | ||
| topic_deadline = where(parent_id: topic_id, parent_type: 'ProjectTopic') | ||
| .where('due_at >= ?', Time.current) | ||
| .order(:due_at) | ||
| .first | ||
|
|
||
| topic_deadline || DueDate.where(parent_id: assignment_id, parent_type: 'Assignment') | ||
| .where('due_at >= ?', Time.current) | ||
| .order(:due_at) | ||
| .first | ||
| end | ||
| # TopicDueDate is a subclass of DueDate that uses single table inheritance | ||
| # The 'type' field in the database will be automatically set to 'TopicDueDate' | ||
| # when instances of this class are created. | ||
| # | ||
| # This class inherits all functionality from DueDate and doesn't need | ||
| # any additional methods since the parent class and DueDateActions concern | ||
| # already handle topic-specific due date logic properly. | ||
| end |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Code is just fine. I would suggest appending lines 66 & 67 to line 65 for better readability. I also think you may have gone overboard on the comments; perhaps you could ask an LLM how to comment the method just as clearly but more concisely.