aboutsummaryrefslogtreecommitdiffstats
path: root/models/models.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-09-06 10:20:09 +0800
committertechknowlogick <techknowlogick@gitea.io>2019-09-05 22:20:09 -0400
commitc03d75fbd51174d0e7ffdbaf9e9e253438d06cf7 (patch)
treea54e9fdfb6ff96baf7010d7fd5049a05a16644e2 /models/models.go
parentb660a732ae283d863636ead9cc1a365ce1c0edc1 (diff)
downloadgitea-c03d75fbd51174d0e7ffdbaf9e9e253438d06cf7.tar.gz
gitea-c03d75fbd51174d0e7ffdbaf9e9e253438d06cf7.zip
Move git diff codes from models to services/gitdiff (#7889)
* move git diff codes from models to services/gitdiff * fix template * fix test * fix template
Diffstat (limited to 'models/models.go')
-rw-r--r--models/models.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/models/models.go b/models/models.go
index 04acc77aa9..e802a35a77 100644
--- a/models/models.go
+++ b/models/models.go
@@ -250,3 +250,8 @@ func MaxBatchInsertSize(bean interface{}) int {
t := x.TableInfo(bean)
return 999 / len(t.ColumnsSeq())
}
+
+// Count returns records number according struct's fields as database query conditions
+func Count(bean interface{}) (int64, error) {
+ return x.Count(bean)
+}