atdis 0.3.9 → 0.3.10

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: b5e4ad016d5d2cf12c58b6b8f8b9c599ba99e4a6
4
- data.tar.gz: 238e1d7f0c63a3249f79e938c1839ae6baff6b87
3
+ metadata.gz: 38e9562a6501a1b60ea2a8b35b25acf01feed510
4
+ data.tar.gz: b84b2b417a0f7b64aaf5098b81889b1940cd3519
5
5
  SHA512:
6
- metadata.gz: ec176a7f143b192c7acb516e172d3a84b6065a637a605be4af6e31357b4bcda7189d80ccb4901c1c44c8b0fef9ac76270363aaf77eeb2d1d49cb9e8acdcdd96a
7
- data.tar.gz: 380a97d5a0650f31724bbf5805b6bd6a6b9b3db913fb2db2b95c5accc52cc628f4a2f704583dbf519423abe32d89bff4e47bcda0137c30f2d2dd804a8f94cdb6
6
+ metadata.gz: 0fe80b23658026ece106a52275eedc61a6257888d38b39ed78ab2247cece5b59cd121c0a18ede97f1d279905eef541602080802aea6d96dea2aefadfd08dc56a
7
+ data.tar.gz: 8135c87d36142106ebd2aa22995975daa421176e119d1f7201bfcbd9f410dfbd3161779704dffcb7ec68960fc08ac34b050999e52432ef33d453f88054d3c007
@@ -28,9 +28,13 @@ module ATDIS
28
28
  end
29
29
 
30
30
  def count_is_consistent
31
- if count && response.respond_to?(:count)
32
- errors.add(:count, ErrorMessage["is not the same as the number of applications returned", "6.4"]) if count != response.count
33
- errors.add(:count, ErrorMessage["should not be larger than the number of results per page", "6.4"]) if count > pagination.per_page
31
+ if count
32
+ if response.respond_to?(:count)
33
+ errors.add(:count, ErrorMessage["is not the same as the number of applications returned", "6.4"]) if count != response.count
34
+ end
35
+ if pagination.respond_to?(:per_page)
36
+ errors.add(:count, ErrorMessage["should not be larger than the number of results per page", "6.4"]) if count > pagination.per_page
37
+ end
34
38
  end
35
39
  end
36
40
 
data/lib/atdis/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Atdis
2
- VERSION = "0.3.9"
2
+ VERSION = "0.3.10"
3
3
  end
@@ -33,6 +33,15 @@ describe ATDIS::Models::Page do
33
33
 
34
34
  it {page.should be_valid}
35
35
 
36
+ # It's not super clear in the spec whether this should be allowed but it seems sensible to
37
+ # allow it.
38
+ context "with a count but no pagination" do
39
+ before :each do
40
+ page.count = 2
41
+ end
42
+ it { page.should be_valid }
43
+ end
44
+
36
45
  context "with pagination" do
37
46
  before :each do
38
47
  page.count = 2
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atdis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.9
4
+ version: 0.3.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Landauer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-30 00:00:00.000000000 Z
11
+ date: 2015-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler