load_more 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +1 -1
- data/lib/load_more/version.rb +1 -1
- data/lib/load_more.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 003fb6844eb4348ea2d3bd7325e0f044eb8f59c7
|
4
|
+
data.tar.gz: 8c0136cb8f4bbac8ef5e337c19ee5be5b84aed4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57a27f910e21ff0778c060cf6580471b93858ee41e677df04c71f4416b98265e2e0cf27d92d13ec78221c7c092a223dec933020b7091d694f90657b1073899a9
|
7
|
+
data.tar.gz: 58f03eb46d89c40bac4eb21f57748bbbc6aaac2aad1d3898f1817bd3e3447c5f56dc277f1ecf232c2201b7b5c28b6cde894b72d43cd749e3a55e4cfe7c0c89c6
|
data/README.rdoc
CHANGED
@@ -18,7 +18,7 @@ The default 'per_load' value is 10.
|
|
18
18
|
Then you can use
|
19
19
|
>> Article.load_more(last_load: 99)
|
20
20
|
or
|
21
|
-
>> Article.
|
21
|
+
>> Article.last_load(99)
|
22
22
|
|
23
23
|
You can also customize the per_load value:
|
24
24
|
>> Article.load_more(per_load: 20, last_load: 99)
|
data/lib/load_more/version.rb
CHANGED
data/lib/load_more.rb
CHANGED
@@ -16,12 +16,12 @@ module LoadMore
|
|
16
16
|
per_load = options.delete(:per_load) || self.per_load
|
17
17
|
last_load_id = options.delete(:last_load)
|
18
18
|
rel = order(id: :desc).limit(per_load)
|
19
|
-
rel = rel.
|
19
|
+
rel = rel.where('id < ?', last_load_id) if last_load_id
|
20
20
|
rel
|
21
21
|
end
|
22
22
|
|
23
23
|
def last_load(id)
|
24
|
-
|
24
|
+
load_more(last_load: id)
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: load_more
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jiajia Wang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|