kaminari 0.10.3 → 0.10.4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of kaminari might be problematic. Click here for more details.
- data/CHANGELOG +7 -0
- data/VERSION +1 -1
- data/kaminari.gemspec +2 -2
- data/lib/kaminari/models/active_record_extension.rb +2 -0
- data/lib/kaminari/models/mongoid_extension.rb +3 -1
- data/spec/models/mongoid_spec.rb +20 -0
- data/spec/models/scopes_spec.rb +5 -0
- metadata +4 -4
data/CHANGELOG
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
== 0.10.4
|
2
|
+
|
3
|
+
* Do not break ActiveRecord::Base.descendants, by making sure to call super
|
4
|
+
from ActiveRecord::Base.inherited #34 [rolftimmermans]
|
5
|
+
|
6
|
+
* Fixed vanishing mongoid criteria after calling page() #26 [tyok]
|
7
|
+
|
1
8
|
== 0.10.3
|
2
9
|
|
3
10
|
* Fixed a bug that total_count() didn't work when chained with group() scope
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.10.
|
1
|
+
0.10.4
|
data/kaminari.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{kaminari}
|
8
|
-
s.version = "0.10.
|
8
|
+
s.version = "0.10.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Akira Matsuda"]
|
12
|
-
s.date = %q{2011-02-
|
12
|
+
s.date = %q{2011-02-24}
|
13
13
|
s.description = %q{Kaminari is a Scope & Engine based, clean, powerful, customizable and sophisticated paginator for Rails 3}
|
14
14
|
s.email = %q{ronnie@dio.jp}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -5,7 +5,9 @@ module Kaminari
|
|
5
5
|
extend ActiveSupport::Concern
|
6
6
|
|
7
7
|
included do
|
8
|
-
|
8
|
+
def page(*args)
|
9
|
+
self.klass.page(*args).criteria.merge(self)
|
10
|
+
end
|
9
11
|
end
|
10
12
|
end
|
11
13
|
|
data/spec/models/mongoid_spec.rb
CHANGED
@@ -6,6 +6,7 @@ describe Kaminari::MongoidExtension do
|
|
6
6
|
before :all do
|
7
7
|
class Developer
|
8
8
|
include ::Mongoid::Document
|
9
|
+
field :salary, :type => Integer
|
9
10
|
end
|
10
11
|
end
|
11
12
|
before do
|
@@ -39,6 +40,25 @@ describe Kaminari::MongoidExtension do
|
|
39
40
|
its(:num_pages) { should == 12 }
|
40
41
|
it { should skip 0 }
|
41
42
|
end
|
43
|
+
|
44
|
+
context 'with criteria before' do
|
45
|
+
subject { Developer.where(:salary => 1).page 2 }
|
46
|
+
its(:selector) { should == {:salary => 1} }
|
47
|
+
its(:current_page) { should == 2 }
|
48
|
+
its(:limit_value) { should == 25 }
|
49
|
+
its(:num_pages) { should == 12 }
|
50
|
+
it { should skip 25 }
|
51
|
+
end
|
52
|
+
|
53
|
+
context 'with criteria after' do
|
54
|
+
subject { Developer.page(2).where(:salary => 1) }
|
55
|
+
its(:selector) { should == {:salary => 1} }
|
56
|
+
its(:current_page) { should == 2 }
|
57
|
+
its(:limit_value) { should == 25 }
|
58
|
+
its(:num_pages) { should == 12 }
|
59
|
+
it { should skip 25 }
|
60
|
+
end
|
61
|
+
|
42
62
|
end
|
43
63
|
|
44
64
|
describe '#per' do
|
data/spec/models/scopes_spec.rb
CHANGED
@@ -101,4 +101,9 @@ describe Kaminari::ActiveRecordExtension do
|
|
101
101
|
its(:total_count) { should == 11 }
|
102
102
|
its(:num_pages) { should == 3 }
|
103
103
|
end
|
104
|
+
|
105
|
+
context 'activerecord descendants' do
|
106
|
+
subject { ActiveRecord::Base.descendants }
|
107
|
+
its(:length) { should_not == 0 }
|
108
|
+
end
|
104
109
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kaminari
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 63
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 10
|
9
|
-
-
|
10
|
-
version: 0.10.
|
9
|
+
- 4
|
10
|
+
version: 0.10.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Akira Matsuda
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-02-
|
18
|
+
date: 2011-02-24 00:00:00 +09:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|