Skip to content

Commit

Permalink
Merge pull request #1177 from ProjectSidewalk/develop
Browse files Browse the repository at this point in the history
v4.3.7
  • Loading branch information
manaswisaha authored Nov 8, 2017
2 parents 4fc11ce + a1fa812 commit 790e5d8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions app/models/audit/AuditTaskTable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -423,13 +423,13 @@ object AuditTaskTable {
} yield _edges

val lowestCompletionCount: Int = (for {
(_counts, _edges) <- StreetEdgeAssignmentCountTable.streetEdgeAssignmentCounts.innerJoin(edgesInRegion).on(_.streetEdgeId === _.streetEdgeId)
if !_counts.streetEdgeId.?.isEmpty
} yield _counts.completionCount.?.getOrElse(-1)).min.run.getOrElse(-1)
(_counts, _edges) <- StreetEdgeAssignmentCountTable.computeEdgeCompletionCounts.innerJoin(edgesInRegion).on(_._1 === _.streetEdgeId)
if !_counts._1.?.isEmpty
} yield _counts._2.?.getOrElse(-1)).min.run.getOrElse(-1)

val leastAuditedEdges = for {
(_counts, _edges) <- StreetEdgeAssignmentCountTable.streetEdgeAssignmentCounts.innerJoin(edgesInRegion).on(_.streetEdgeId === _.streetEdgeId)
if !_counts.streetEdgeId.?.isEmpty && _counts.completionCount === lowestCompletionCount
(_counts, _edges) <- StreetEdgeAssignmentCountTable.computeEdgeCompletionCounts.innerJoin(edgesInRegion).on(_._1 === _.streetEdgeId)
if !_counts._1.?.isEmpty && _counts._2 === lowestCompletionCount
} yield _edges

val edges: List[StreetEdge] = leastAuditedEdges.list
Expand Down Expand Up @@ -466,17 +466,17 @@ object AuditTaskTable {
// Gets the lowest completion count (across all users) for the set of streets in this region that this particular
// user has not audited. This should only be None if the user has audited all routes in this region.
val lowestCompletionCount: Option[Int] = (for {
(_counts, _edges) <- StreetEdgeAssignmentCountTable.streetEdgeAssignmentCounts.innerJoin(edgesInRegion).on(_.streetEdgeId === _.streetEdgeId)
if !_counts.streetEdgeId.?.isEmpty
} yield _counts.completionCount.?.getOrElse(-1)).min.run
(_counts, _edges) <- StreetEdgeAssignmentCountTable.computeEdgeCompletionCounts.innerJoin(edgesInRegion).on(_._1 === _.streetEdgeId)
if !_counts._1.?.isEmpty
} yield _counts._2.?.getOrElse(-1)).min.run

// Gets the list of edges in the region that has the minimum completion count.
lowestCompletionCount match {
case Some(completionCount) =>
// Gets the list of edges in the region that has the minimum completion count.
val leastAuditedEdges = for {
(_counts, _edges) <- StreetEdgeAssignmentCountTable.streetEdgeAssignmentCounts.innerJoin(edgesInRegion).on(_.streetEdgeId === _.streetEdgeId)
if !_counts.streetEdgeId.?.isEmpty && _counts.completionCount === completionCount
(_counts, _edges) <- StreetEdgeAssignmentCountTable.computeEdgeCompletionCounts.innerJoin(edgesInRegion).on(_._1 === _.streetEdgeId)
if !_counts._1.?.isEmpty && _counts._2 === completionCount
} yield _edges
val edges: List[StreetEdge] = leastAuditedEdges.list

Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import scalariform.formatter.preferences._

name := """sidewalk-webpage"""

version := "4.3.6"
version := "4.3.7"

scalaVersion := "2.10.4"

Expand Down

0 comments on commit 790e5d8

Please sign in to comment.