kaminari 0.16.2 → 0.16.3
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.
- checksums.yaml +4 -4
- data/CHANGELOG.rdoc +7 -0
- data/lib/kaminari/models/active_record_extension.rb +7 -7
- data/lib/kaminari/models/mongoid_extension.rb +5 -6
- data/lib/kaminari/version.rb +1 -1
- data/spec/fake_app/mongoid/models.rb +4 -0
- data/spec/fake_gem.rb +18 -2
- data/spec/models/active_record/inherited_spec.rb +9 -0
- data/spec/models/active_record/scopes_spec.rb +7 -4
- data/spec/models/mongoid/mongoid_spec.rb +5 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b60c50194b2623ea0fdfedba7baea9a4d675557
|
4
|
+
data.tar.gz: 9f98c924aea42ab769c9800e39d739e0ae1ea477
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 160ad63b6c8b586d82c37bf2c29230b1cb41375679073d628112b6d0023c3eee7e91de6ced19f31f6af02dd0fd5371fd1ab122120645a0f82cda005ff7e26a21
|
7
|
+
data.tar.gz: a0bca0e742f945a4ad67dd02406f74df8ae51f4a94bfcb5ff3025cfed5c1ad9522fea38bfdb4cd12f0e11ae8c0f2e7483594ee115a6af06cfb3b5088d914a2a9
|
data/CHANGELOG.rdoc
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
== 0.16.3
|
2
|
+
|
3
|
+
* Fixed a "stack level too deep" bug in mongoid #642 [bartes]
|
4
|
+
|
5
|
+
* Fixed a bug that Kaminari possibly crashes when combined with other gems
|
6
|
+
that define `inherited` method on model classes, such as aasm. #651 [zeitnot]
|
7
|
+
|
1
8
|
== 0.16.2
|
2
9
|
|
3
10
|
* Fixed a bug where cloned Relations remember previous relations'
|
@@ -3,16 +3,16 @@ require 'kaminari/models/active_record_model_extension'
|
|
3
3
|
module Kaminari
|
4
4
|
module ActiveRecordExtension
|
5
5
|
extend ActiveSupport::Concern
|
6
|
-
|
6
|
+
|
7
|
+
module ClassMethods
|
7
8
|
# Future subclasses will pick up the model extension
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
kls.send(:include, Kaminari::ActiveRecordModelExtension) if kls.superclass == ::ActiveRecord::Base
|
12
|
-
end
|
13
|
-
alias_method_chain :inherited, :kaminari
|
9
|
+
def inherited(kls) #:nodoc:
|
10
|
+
super
|
11
|
+
kls.send(:include, Kaminari::ActiveRecordModelExtension) if kls.superclass == ::ActiveRecord::Base
|
14
12
|
end
|
13
|
+
end
|
15
14
|
|
15
|
+
included do
|
16
16
|
# Existing subclasses pick up the model extension as well
|
17
17
|
self.descendants.each do |kls|
|
18
18
|
kls.send(:include, Kaminari::ActiveRecordModelExtension) if kls.superclass == ::ActiveRecord::Base
|
@@ -13,13 +13,12 @@ module Kaminari
|
|
13
13
|
include Kaminari::MongoidCriteriaMethods
|
14
14
|
include Kaminari::PageScopeMethods
|
15
15
|
end
|
16
|
+
end
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
end
|
22
|
-
alias_method_chain :inherited, :kaminari
|
18
|
+
module ClassMethods
|
19
|
+
def inherited(kls)
|
20
|
+
super
|
21
|
+
kls.send(:include, Kaminari::MongoidExtension::Document.dup)
|
23
22
|
end
|
24
23
|
end
|
25
24
|
end
|
data/lib/kaminari/version.rb
CHANGED
data/spec/fake_gem.rb
CHANGED
@@ -1,4 +1,20 @@
|
|
1
|
-
|
1
|
+
module Kaminari
|
2
|
+
module FakeGem
|
3
|
+
extend ActiveSupport::Concern
|
2
4
|
|
3
|
-
|
5
|
+
module ClassMethods
|
6
|
+
def inherited(kls)
|
7
|
+
super
|
8
|
+
def kls.fake_gem_defined_method; end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
ActiveSupport.on_load :active_record do
|
15
|
+
ActiveRecord::Base.send :include, Kaminari::FakeGem
|
16
|
+
|
17
|
+
# Simulate a gem providing a subclass of ActiveRecord::Base before the Railtie is loaded.
|
18
|
+
class GemDefinedModel < ActiveRecord::Base
|
19
|
+
end
|
4
20
|
end
|
@@ -31,10 +31,13 @@ if defined? ActiveRecord
|
|
31
31
|
end
|
32
32
|
|
33
33
|
describe Kaminari::ActiveRecordExtension do
|
34
|
-
before do
|
35
|
-
|
36
|
-
|
37
|
-
|
34
|
+
before :all do
|
35
|
+
[User, GemDefinedModel, Device].each do |m|
|
36
|
+
1.upto(100) {|i| m.create! :name => "user#{'%03d' % i}", :age => (i / 10)}
|
37
|
+
end
|
38
|
+
end
|
39
|
+
after :all do
|
40
|
+
[User, GemDefinedModel, Device].each {|m| m.delete_all }
|
38
41
|
end
|
39
42
|
|
40
43
|
[User, Admin, GemDefinedModel, Device].each do |model_class|
|
@@ -218,6 +218,11 @@ if defined? Mongoid
|
|
218
218
|
subject { Device.all.page 1 }
|
219
219
|
its(:limit_value) { should == 100 }
|
220
220
|
end
|
221
|
+
|
222
|
+
context 'when paginates_per is defined in subclass of subclass' do
|
223
|
+
subject { Android.all.page 1 }
|
224
|
+
its(:limit_value) { should == 200 }
|
225
|
+
end
|
221
226
|
end
|
222
227
|
end
|
223
228
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kaminari
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.16.
|
4
|
+
version: 0.16.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Akira Matsuda
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2015-
|
14
|
+
date: 2015-02-11 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activesupport
|
@@ -259,6 +259,7 @@ files:
|
|
259
259
|
- spec/helpers/sinatra_helpers_spec.rb
|
260
260
|
- spec/helpers/tags_spec.rb
|
261
261
|
- spec/models/active_record/active_record_relation_methods_spec.rb
|
262
|
+
- spec/models/active_record/inherited_spec.rb
|
262
263
|
- spec/models/active_record/scopes_spec.rb
|
263
264
|
- spec/models/array_spec.rb
|
264
265
|
- spec/models/configuration_methods_spec.rb
|
@@ -317,6 +318,7 @@ test_files:
|
|
317
318
|
- spec/helpers/sinatra_helpers_spec.rb
|
318
319
|
- spec/helpers/tags_spec.rb
|
319
320
|
- spec/models/active_record/active_record_relation_methods_spec.rb
|
321
|
+
- spec/models/active_record/inherited_spec.rb
|
320
322
|
- spec/models/active_record/scopes_spec.rb
|
321
323
|
- spec/models/array_spec.rb
|
322
324
|
- spec/models/configuration_methods_spec.rb
|