paginated 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/paginated.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76e2b8888c610c376b97da4c118067cf4d6d1ac8d63e02fc11971638b9ad0595
|
4
|
+
data.tar.gz: a5fc2020f8d9a3adf16816e0d03d2e2419ed3128d806d23a5ce3d20a6831e442
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3aa8e4b873a0498720d727d3517cb9576eb1b97a96884cdf2c8336b92f56a0016db99e1d6c3c49875bede9fc73dbd91d902180b05253e7079d9970504f9b01a
|
7
|
+
data.tar.gz: 7ad52eb2f7a3b3c3356781d7703f156f14ef4cec04d00dc14e825e0c6dd4ef10b868b9325b18ab2405d740d0ddc2d70072f09d4e91cc12f398548344ed66ce02
|
data/lib/paginated.rb
CHANGED
@@ -46,7 +46,7 @@ class Paginated
|
|
46
46
|
return cached_value if cached_value
|
47
47
|
|
48
48
|
# получение кол-ва записей из запроса к БД
|
49
|
-
db_value = @model.
|
49
|
+
db_value = @model.merge(@scopes).count(:id)
|
50
50
|
|
51
51
|
# кеширование кол-ва записей при превышении порогового значения
|
52
52
|
if db_value >= 1_000
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paginated
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Павел Бабин
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-11-
|
11
|
+
date: 2023-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|