wor-paginate 0.1.9 → 0.1.10

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: c6a4d0f06558e5204961f4db988546335b5e51b3
4
- data.tar.gz: b56ec43ef75a22e28c255c9ca0a7f4054a66fbed
3
+ metadata.gz: f09070288ef65ad8eb2bf6ba05b8eead1911ac05
4
+ data.tar.gz: 2261daf2882a9452432b0eb59609f9ab89713463
5
5
  SHA512:
6
- metadata.gz: a75d8db76635df594ad2870088cc12b151c7dc4c65af4029c3dc92a527f6eb370fa2a0744e9a704fc47776d913df6c744128abebecd9f278e555b8810be7c7a7
7
- data.tar.gz: b40078aee535d5c676afd501b96e9bfbd781c17143dbb7ac3923ea8593f98c5db66be41f8ab7c4e477e7e748a57c6a5ee494c0ac19a8eccad2473b569444d47e
6
+ metadata.gz: f5aa479217e9dfa235b14c0a98678679b4c25e2fa997b470b204193bbb59ffaf670c6b33595e9d020a642064e86fd7f5348904e8724bbe10b1b755f60726dda5
7
+ data.tar.gz: 5beb45a05d1d79ee1b215186463bfab3ca430dc92204ce6e2e0a321930144149b44bc9f5c6eda697bbaaebc025ea8e39fb6bd57dd8011af72c3154fe35e4322e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  ## Change log
2
2
 
3
+ ### V0.1.10
4
+ * [#90](https://github.com/Wolox/wor-paginate/pull/90) Verify that default adapter adapts - [@mtejedorwolox](https://github.com/mtejedorwolox).
5
+
3
6
  ### V0.1.9
4
7
  * [#88](https://github.com/Wolox/wor-paginate/pull/88) Default adapter - [@mtejedorwolox](https://github.com/mtejedorwolox).
5
8
  * [#87](https://github.com/Wolox/wor-paginate/pull/87) Supporting expect(response).to be_paginated - [@mnmallea](https://github.com/mnmallea).
data/lib/wor/paginate.rb CHANGED
@@ -16,6 +16,10 @@ module Wor
16
16
  module Paginate
17
17
  def self.configure
18
18
  yield Config
19
+
20
+ return if ADAPTERS.include?(Config.default_adapter) || Config.default_adapter.nil?
21
+
22
+ raise Exceptions::NoPaginationAdapter
19
23
  end
20
24
  end
21
25
  end
@@ -32,9 +32,11 @@ module Wor
32
32
  end
33
33
 
34
34
  def find_adapter_for_content(content, options)
35
- Config.default_adapter&.new(content, page(options), limit(options)) ||
36
- ADAPTERS.map { |adapter| adapter.new(content, page(options), limit(options)) }
37
- .find(&:adapt?)
35
+ adapters = []
36
+ adapters << Config.default_adapter if Config.default_adapter.present?
37
+ adapters += ADAPTERS
38
+ adapters.map { |adapter| adapter.new(content, page(options), limit(options)) }
39
+ .find(&:adapt?)
38
40
  end
39
41
 
40
42
  def page(options)
@@ -1,5 +1,5 @@
1
1
  module Wor
2
2
  module Paginate
3
- VERSION = '0.1.9'.freeze
3
+ VERSION = '0.1.10'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wor-paginate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - icoluccio