clean_pagination 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5928775355f89948f557343e829b7c0c7c4c141a
4
- data.tar.gz: 91e251019e0142b6fa265575183745cb12d5e09f
3
+ metadata.gz: fead59867c1ad221c9ca134934082c2db9fac913
4
+ data.tar.gz: 9fd7a6e2d86d532d81a3e429da9890b27e34e21c
5
5
  SHA512:
6
- metadata.gz: 1cd6d1fbf227b1c9b1194dc48003ea0246ab87db17163d5ffc2b57619e0072b35a70bc9f07b89c5aa1ba9bab58fcd96ddab54edf409152b2ab26025b8789775d
7
- data.tar.gz: d85c03582740a034d65323ff8c7a56f785d31aa176981d5c79db3359d6713b783a11db3e7a1f1d31e2c2ee8f428f014c262d94b04fff549cddddf7339854a139
6
+ metadata.gz: 59d4e5ef1d0351162b08169541de84cf1add2dd2c7afd27059ef90a5e1d09bac7d086434ec5d70d395f5ae3c1dcd04c273f72e3ce86aa75ee0972aa733613840
7
+ data.tar.gz: 78a761c0891acb35b8ae5814181d45ee1527c23d0c9876d2e328aa1bd0c5ae99aeab3aaaf5445e3b74b339e3e7f4bad723c62c84b64577674c54c7acacb805ec
@@ -78,7 +78,7 @@ module CleanPagination
78
78
  links << "<#{request.url}>; rel=\"first\"; items=\"0-#{suppress_infinity(requested_limit-1)}\""
79
79
  end
80
80
 
81
- headers['Link'] = links.join ', '
81
+ headers['Link'] = links.join ', ' unless links.empty?
82
82
  end
83
83
 
84
84
  private
@@ -1,3 +1,3 @@
1
1
  module CleanPagination
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
@@ -369,4 +369,12 @@ class ApplicationControllerTest < ActionController::TestCase
369
369
  assert_match /\?foo=bar/, link
370
370
  end
371
371
  end
372
+
373
+ test "omits empty link header" do
374
+ @controller.stubs(:total_items).returns 2
375
+
376
+ get :index
377
+
378
+ assert_equal false, response.headers.has_key?('Link')
379
+ end
372
380
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clean_pagination
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Nelson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-27 00:00:00.000000000 Z
11
+ date: 2014-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails