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

Update submission schema for old marks in remark request #941

Closed
mikeing2001 opened this Issue Dec 5, 2012 · 11 comments

Comments

Projects
None yet
6 participants
@mikeing2001
Contributor

mikeing2001 commented Dec 5, 2012

Issue #904 was temporary fix by PR #940 to allow for a new release of MarkUs.

To fix Issue 904 we need to update the submission schema such that when we query @submission.result we don't rely on the database ordering and timestamp if possible (which it may not be).

Currently the Submission model has the line:

has_one :result, :dependent => :destroy

Since we know for sure that these models will sometimes have more than one, @ioev suggested that we change has_one to has_many.

As Joey suggested, write a method in the Result model "get_result" that does this, and then write another "get_old_result" that returns the marks that are being requested to be remarked.

@danielstjules

This comment has been minimized.

Show comment
Hide comment
@danielstjules

danielstjules Jan 21, 2013

Member

Mike, are you saying that "get_old_result" would return only one, or would it be more like "get old result(s)"?

@akwok18 @m-wu You may both be interested in this.

Member

danielstjules commented Jan 21, 2013

Mike, are you saying that "get_old_result" would return only one, or would it be more like "get old result(s)"?

@akwok18 @m-wu You may both be interested in this.

@mikeing2001

This comment has been minimized.

Show comment
Hide comment
@mikeing2001

mikeing2001 Jan 21, 2013

Contributor

The idea is that get_result and get_old_result would only return one result. The result for get_result will be the most recent result while get_old_result should be the second most recent result.

Contributor

mikeing2001 commented Jan 21, 2013

The idea is that get_result and get_old_result would only return one result. The result for get_result will be the most recent result while get_old_result should be the second most recent result.

@akwok18

This comment has been minimized.

Show comment
Hide comment
@akwok18

akwok18 Jan 24, 2013

Contributor

I'll look into this.

Contributor

akwok18 commented Jan 24, 2013

I'll look into this.

@ghost ghost assigned akwok18 Jan 24, 2013

@akwok18

This comment has been minimized.

Show comment
Hide comment
@akwok18

akwok18 Jan 25, 2013

Contributor

@mikeing2001 I'm still trying to get a feel of the code base but wouldn't we want to add the "get_result" and "get_old_result" methods in the Submission model instead of the Result, since we are trying to change "has_one :result, :dependent => :destroy" to "has_many :result, :dependent => :destroy" in the Submission model? Then would I be trying to update the references of "@submission.result" in results_controller.rb so that they are using the appropriate methods?

Contributor

akwok18 commented Jan 25, 2013

@mikeing2001 I'm still trying to get a feel of the code base but wouldn't we want to add the "get_result" and "get_old_result" methods in the Submission model instead of the Result, since we are trying to change "has_one :result, :dependent => :destroy" to "has_many :result, :dependent => :destroy" in the Submission model? Then would I be trying to update the references of "@submission.result" in results_controller.rb so that they are using the appropriate methods?

@mikeing2001

This comment has been minimized.

Show comment
Hide comment
@mikeing2001

mikeing2001 Feb 2, 2013

Contributor

I could be wrong but my gut is telling me Results. It may work with the Submission model as well.

Contributor

mikeing2001 commented Feb 2, 2013

I could be wrong but my gut is telling me Results. It may work with the Submission model as well.

@ghigt

This comment has been minimized.

Show comment
Hide comment
@ghigt

ghigt May 23, 2013

Member

@benjaminvialle, for me and @NelleV, it should be has_many :results instead of has_many :result, what do think ?

Member

ghigt commented May 23, 2013

@benjaminvialle, for me and @NelleV, it should be has_many :results instead of has_many :result, what do think ?

@NelleV

This comment has been minimized.

Show comment
Hide comment
@NelleV

NelleV May 23, 2013

Member

That is correct.

Member

NelleV commented May 23, 2013

That is correct.

@benjaminvialle

This comment has been minimized.

Show comment
Hide comment
@benjaminvialle

benjaminvialle May 23, 2013

Member

@ghigt do you want to work on this issue?

Member

benjaminvialle commented May 23, 2013

@ghigt do you want to work on this issue?

@ghigt

This comment has been minimized.

Show comment
Hide comment
@ghigt

ghigt May 23, 2013

Member

ok

Member

ghigt commented May 23, 2013

ok

@ghigt

This comment has been minimized.

Show comment
Hide comment
@ghigt

ghigt May 27, 2013

Member

@benjaminvialle I think this issue is done, right ?

Member

ghigt commented May 27, 2013

@benjaminvialle I think this issue is done, right ?

@benjaminvialle

This comment has been minimized.

Show comment
Hide comment
Member

benjaminvialle commented May 27, 2013

Yes :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment