diff options
Diffstat (limited to 'models')
-rw-r--r-- | models/fixtures/comment.yml | 4 | ||||
-rw-r--r-- | models/issue_comment.go | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/models/fixtures/comment.yml b/models/fixtures/comment.yml index 864313cac3..bd64680c8c 100644 --- a/models/fixtures/comment.yml +++ b/models/fixtures/comment.yml @@ -13,6 +13,7 @@ issue_id: 1 # in repo_id 1 content: "good work!" created_unix: 946684811 + updated_unix: 946684811 - id: 3 type: 0 # comment @@ -20,6 +21,7 @@ issue_id: 1 # in repo_id 1 content: "meh..." created_unix: 946684812 + updated_unix: 946684812 - id: 4 type: 21 # code comment @@ -63,4 +65,4 @@ review_id: 10 tree_path: "README.md" created_unix: 946684812 - invalidated: true
\ No newline at end of file + invalidated: true diff --git a/models/issue_comment.go b/models/issue_comment.go index 9caab1dc45..8f54d9656a 100644 --- a/models/issue_comment.go +++ b/models/issue_comment.go @@ -782,6 +782,7 @@ type FindCommentsOptions struct { IssueID int64 ReviewID int64 Since int64 + Before int64 Type CommentType } @@ -799,6 +800,9 @@ func (opts *FindCommentsOptions) toConds() builder.Cond { if opts.Since > 0 { cond = cond.And(builder.Gte{"comment.updated_unix": opts.Since}) } + if opts.Before > 0 { + cond = cond.And(builder.Lte{"comment.updated_unix": opts.Before}) + } if opts.Type != CommentTypeUnknown { cond = cond.And(builder.Eq{"comment.type": opts.Type}) } |