kaminari-activerecord 1.0.0.rc1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 711c45636af3a883dd3423099b806119be97de69
|
4
|
+
data.tar.gz: c6e2277873dc10069fd8e25f7f7aae3fab3264bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc118f1c18bf2f7d721e13d84451ce9b06e669a64c22aecec81251208f06ff34d58a7b2e17cd1223b44de3daafeb7e179670bf474d616778414bbf953753afdf
|
7
|
+
data.tar.gz: 5e0974d4ac02e0d9e37be7b6c0e61121e14811862c9e5b7ed6b403359aa607d81796a1a59f303be4c8cce120b9b519c8c6d24b7b7746795917226c70a19d2508
|
@@ -20,8 +20,9 @@ module Kaminari
|
|
20
20
|
if loaded?
|
21
21
|
# Total count has to be 0 if loaded records are 0
|
22
22
|
return @total_count = 0 if (current_page == 1) && @records.empty?
|
23
|
-
# Total count is
|
24
|
-
|
23
|
+
# Total count is calculable at the last page
|
24
|
+
per_page = (defined?(@_per) && @_per) || default_per_page
|
25
|
+
return @total_count = (current_page - 1) * per_page + @records.length if @records.any? && (@records.length < per_page)
|
25
26
|
end
|
26
27
|
|
27
28
|
# #count overrides the #select which could include generated columns referenced in #order, so skip #order here, where it's irrelevant to the result anyway
|
@@ -55,8 +56,12 @@ module Kaminari
|
|
55
56
|
super
|
56
57
|
else
|
57
58
|
@values[:limit] = limit_value + 1
|
59
|
+
# FIXME: this could be removed when we're dropping AR 4 support
|
60
|
+
@arel.limit = @values[:limit] if @arel && (Integer === @arel.limit)
|
58
61
|
super
|
59
62
|
@values[:limit] = limit_value - 1
|
63
|
+
# FIXME: this could be removed when we're dropping AR 4 support
|
64
|
+
@arel.limit = @values[:limit] if @arel && (Integer === @arel.limit)
|
60
65
|
|
61
66
|
if @records.any?
|
62
67
|
@records = @records.dup if (frozen = @records.frozen?)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kaminari-activerecord
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Akira Matsuda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kaminari-core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.0.0
|
19
|
+
version: 1.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.0.0
|
26
|
+
version: 1.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activerecord
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -96,9 +96,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
96
96
|
version: '0'
|
97
97
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
98
98
|
requirements:
|
99
|
-
- - "
|
99
|
+
- - ">="
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version:
|
101
|
+
version: '0'
|
102
102
|
requirements: []
|
103
103
|
rubyforge_project:
|
104
104
|
rubygems_version: 2.6.8
|