will_paginate_mongoid 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/README.md +29 -0
- data/lib/will_paginate_mongoid/version.rb +1 -1
- data/spec/spec_helper.rb +2 -2
- data/will_paginate_mongoid.gemspec +2 -1
- metadata +22 -30
- data/README +0 -0
data/Gemfile
CHANGED
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
Will Paginate Mongoid
|
2
|
+
========
|
3
|
+
|
4
|
+
A simple gem that allows you use pagination using Mongoid
|
5
|
+
---------------------------------------------------------------------
|
6
|
+
|
7
|
+
### Why use this gem?
|
8
|
+
|
9
|
+
Because will_paginate does not support mongoid `skip` and `limit` methods.
|
10
|
+
They just supports `paginate` method in `Array` class. So what it means?
|
11
|
+
Will_Paginate, find all objects and after that cut the needed objects.
|
12
|
+
It can cause performance problems when you have a lot of objects.
|
13
|
+
|
14
|
+
### How I install it?
|
15
|
+
|
16
|
+
In your `Gemfile` use `gem "will_paginate_mongoid"` and run `bundle install`
|
17
|
+
|
18
|
+
or
|
19
|
+
|
20
|
+
Just run `gem install will_paginate_mongoid`
|
21
|
+
|
22
|
+
### How it works?
|
23
|
+
|
24
|
+
It just create a `paginate` method compatible with will_paginate interface
|
25
|
+
and add two additional criterias: `skip` and `limit`
|
26
|
+
|
27
|
+
### Just that?
|
28
|
+
|
29
|
+
Yes. Now you can use `paginate` method like in [will_paginate documentation](https://github.com/mislav/will_paginate/wiki)
|
data/spec/spec_helper.rb
CHANGED
@@ -2,10 +2,10 @@ require 'rails'
|
|
2
2
|
require 'mongoid'
|
3
3
|
require 'will_paginate'
|
4
4
|
require 'will_paginate_mongoid'
|
5
|
-
|
6
5
|
require File.join(File.dirname(__FILE__), 'fake_app')
|
7
6
|
require 'rspec/rails'
|
8
7
|
|
8
|
+
|
9
9
|
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
10
10
|
|
11
11
|
RSpec.configure do |config|
|
@@ -18,5 +18,5 @@ RSpec.configure do |config|
|
|
18
18
|
end
|
19
19
|
|
20
20
|
Mongoid.configure do |config|
|
21
|
-
config.master = Mongo::Connection.new.db("
|
21
|
+
config.master = Mongo::Connection.new.db("will_paginate_mongoid_test")
|
22
22
|
end
|
@@ -18,6 +18,7 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
19
|
s.require_paths = ["lib"]
|
20
20
|
|
21
|
-
s.add_runtime_dependency "mongoid", "~> 2.
|
21
|
+
s.add_runtime_dependency "mongoid", "~> 2.4"
|
22
|
+
s.add_runtime_dependency "bson_ext", "~> 1.5"
|
22
23
|
s.add_runtime_dependency "will_paginate", "~> 3.0.2"
|
23
24
|
end
|
metadata
CHANGED
@@ -1,13 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: will_paginate_mongoid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 23
|
5
4
|
prerelease:
|
6
|
-
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
- 0
|
10
|
-
version: 1.0.0
|
5
|
+
version: 1.0.1
|
11
6
|
platform: ruby
|
12
7
|
authors:
|
13
8
|
- Lucas Souza
|
@@ -15,7 +10,7 @@ autorequire:
|
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
12
|
|
18
|
-
date:
|
13
|
+
date: 2012-01-23 00:00:00 -02:00
|
19
14
|
default_executable:
|
20
15
|
dependencies:
|
21
16
|
- !ruby/object:Gem::Dependency
|
@@ -26,30 +21,31 @@ dependencies:
|
|
26
21
|
requirements:
|
27
22
|
- - ~>
|
28
23
|
- !ruby/object:Gem::Version
|
29
|
-
|
30
|
-
segments:
|
31
|
-
- 2
|
32
|
-
- 2
|
33
|
-
- 2
|
34
|
-
version: 2.2.2
|
24
|
+
version: "2.4"
|
35
25
|
type: :runtime
|
36
26
|
version_requirements: *id001
|
37
27
|
- !ruby/object:Gem::Dependency
|
38
|
-
name:
|
28
|
+
name: bson_ext
|
39
29
|
prerelease: false
|
40
30
|
requirement: &id002 !ruby/object:Gem::Requirement
|
41
31
|
none: false
|
42
32
|
requirements:
|
43
33
|
- - ~>
|
44
34
|
- !ruby/object:Gem::Version
|
45
|
-
|
46
|
-
segments:
|
47
|
-
- 3
|
48
|
-
- 0
|
49
|
-
- 2
|
50
|
-
version: 3.0.2
|
35
|
+
version: "1.5"
|
51
36
|
type: :runtime
|
52
37
|
version_requirements: *id002
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
name: will_paginate
|
40
|
+
prerelease: false
|
41
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ~>
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 3.0.2
|
47
|
+
type: :runtime
|
48
|
+
version_requirements: *id003
|
53
49
|
description: ""
|
54
50
|
email:
|
55
51
|
- lucasas@gmail.com
|
@@ -63,7 +59,7 @@ files:
|
|
63
59
|
- .gitignore
|
64
60
|
- .rspec
|
65
61
|
- Gemfile
|
66
|
-
- README
|
62
|
+
- README.md
|
67
63
|
- Rakefile
|
68
64
|
- lib/will_paginate_mongoid.rb
|
69
65
|
- lib/will_paginate_mongoid/engine.rb
|
@@ -87,25 +83,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
87
83
|
requirements:
|
88
84
|
- - ">="
|
89
85
|
- !ruby/object:Gem::Version
|
90
|
-
hash: 3
|
91
|
-
segments:
|
92
|
-
- 0
|
93
86
|
version: "0"
|
94
87
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
88
|
none: false
|
96
89
|
requirements:
|
97
90
|
- - ">="
|
98
91
|
- !ruby/object:Gem::Version
|
99
|
-
hash: 3
|
100
|
-
segments:
|
101
|
-
- 0
|
102
92
|
version: "0"
|
103
93
|
requirements: []
|
104
94
|
|
105
95
|
rubyforge_project: will_paginate_mongoid
|
106
|
-
rubygems_version: 1.
|
96
|
+
rubygems_version: 1.5.0
|
107
97
|
signing_key:
|
108
98
|
specification_version: 3
|
109
99
|
summary: An extension that becomes possible use paginate method with Mongoid
|
110
|
-
test_files:
|
111
|
-
|
100
|
+
test_files:
|
101
|
+
- spec/fake_app.rb
|
102
|
+
- spec/integration/mongoid_paginator_spec.rb
|
103
|
+
- spec/spec_helper.rb
|
data/README
DELETED
File without changes
|