summaryrefslogtreecommitdiffstats
path: root/models/review.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/review.go')
-rw-r--r--models/review.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/models/review.go b/models/review.go
index acb54d970f..1ffff8feb6 100644
--- a/models/review.go
+++ b/models/review.go
@@ -208,6 +208,11 @@ func FindReviews(opts FindReviewOptions) ([]*Review, error) {
return findReviews(x, opts)
}
+// CountReviews returns count of reviews passing FindReviewOptions
+func CountReviews(opts FindReviewOptions) (int64, error) {
+ return x.Where(opts.toCond()).Count(&Review{})
+}
+
// CreateReviewOptions represent the options to create a review. Type, Issue and Reviewer are required.
type CreateReviewOptions struct {
Content string