summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorEthan Koenig <etk39@cornell.edu>2017-01-13 21:21:30 -0500
committerLunny Xiao <xiaolunwen@gmail.com>2017-01-14 10:21:30 +0800
commita6f5efa0bb7bab30b6acd654c5ccf1c273c8b60c (patch)
tree4b5b6f7e4599aa3bb51010986c600cb36f4bc9ad /models
parent4a1f36c3cc3d93633299a2f71826ee0198adaef0 (diff)
downloadgitea-a6f5efa0bb7bab30b6acd654c5ccf1c273c8b60c.tar.gz
gitea-a6f5efa0bb7bab30b6acd654c5ccf1c273c8b60c.zip
Fix ambiguity bug in getCommentsByRepoIDSince (#665)
Diffstat (limited to 'models')
-rw-r--r--models/issue_comment.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/models/issue_comment.go b/models/issue_comment.go
index 73c9db1cdb..e9a401b864 100644
--- a/models/issue_comment.go
+++ b/models/issue_comment.go
@@ -420,9 +420,11 @@ func getCommentsByIssueIDSince(e Engine, issueID, since int64) ([]*Comment, erro
func getCommentsByRepoIDSince(e Engine, repoID, since int64) ([]*Comment, error) {
comments := make([]*Comment, 0, 10)
- sess := e.Where("issue.repo_id = ?", repoID).Join("INNER", "issue", "issue.id = comment.issue_id", repoID).Asc("created_unix")
+ sess := e.Where("issue.repo_id = ?", repoID).
+ Join("INNER", "issue", "issue.id = comment.issue_id").
+ Asc("comment.created_unix")
if since > 0 {
- sess.And("updated_unix >= ?", since)
+ sess.And("comment.updated_unix >= ?", since)
}
return comments, sess.Find(&comments)
}