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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e63629829b740f9fc5a8a872349ce0e5052c882c
4
- data.tar.gz: d3ad74aab0c7ecf587c6d452a64d90cd375bd5df
3
+ metadata.gz: 003fb6844eb4348ea2d3bd7325e0f044eb8f59c7
4
+ data.tar.gz: 8c0136cb8f4bbac8ef5e337c19ee5be5b84aed4c
5
5
  SHA512:
6
- metadata.gz: cac9267ef75ca044c32d4920c6ebc9686cf136d56ed68d83cc23c79d0f11858a96c2bde431ac03a400e8ab1f30f1cb81c659b23953d43eb137374b816c18cd5d
7
- data.tar.gz: e2cef122a3d4c16c758f4bcdf10e672024c92990d9ea90c6215629b379b07c4ddacabdd90551baf9ed250adfdbbe42e541838c3ba158a6b99517d8c3416a6c4f
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.load_more.last_load(99)
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)
@@ -1,3 +1,3 @@
1
1
  module LoadMore
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
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.last_load(last_load_id) if last_load_id
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
- where("id < ?", id)
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.2
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-16 00:00:00.000000000 Z
11
+ date: 2015-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord