achirkin / qua-kit

Quick Urban Analysis Kit
MIT License
17 stars 8 forks source link

Change the compare designs query #49

Closed achirkin closed 7 years ago

achirkin commented 7 years ago

We have updated the logic of the grading system, and the remaining part is to change submission selection logic. ATM, this is done in a scary raw sql query in CompareProposals module. According to the new logic, selection of a design pair should go using Rating table as follows:

There is a chance that this query can now be implemented using esqueleto, because it should be drastically simplified. Most of the important information is available in two tables: Rating and CurrentScenario. But we still need to use Vote table to make sure the pair was not presented to the voter previously.