pragma 1.2.1 → 1.2.3

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: 38c08be11d2940d5f7cdadceb2a57d01606120d3
4
- data.tar.gz: 4ce405cf293998763434a9c587fc9b0db5a28a6a
3
+ metadata.gz: 3bfc105db005eb2c91fd2c88e0b8696c94222e9a
4
+ data.tar.gz: 29b65f0c0eb9dc5907a7cd04416965d946500049
5
5
  SHA512:
6
- metadata.gz: fba317d8e8a5b98b2030a63bbf3474540bdb2ece0ddc2caea12cbd21a5371bfd1dc490d15afbc6dc526030f854806990e2e43b477e0e28c28ed42f3dbf647313
7
- data.tar.gz: ab0c3bfe2c1e62e716904e38aa8449b0d3a18d8ad6fa9a375739897704d1538fad5f14b0c4ae3c12748e086238c0c846085d90b957d724cc001864e76ebb0769
6
+ metadata.gz: e64a1899d2e286c76633f7bee050f8ed8e882ba35dc9ed1af58aa5b16544688e4254ca1ca04ca94cfce3615d92a4c446b887bf27446feb54af85f54cc1cfb196
7
+ data.tar.gz: 5f43c159ec595cc137c846f4f42f9d8ce66b0df54e51df65929ce02e834b42694e51671445f7cdab10544c317383fc5f5b29a9caa95a7ac879d81dffd323b6ca
@@ -71,7 +71,8 @@ module Pragma
71
71
  def class_exists?(klass)
72
72
  begin
73
73
  Object.const_get(klass)
74
- rescue NameError
74
+ rescue NameError => e
75
+ raise e unless e.message.include?("uninitialized constant #{klass}")
75
76
  end
76
77
 
77
78
  Object.const_defined?(klass)
@@ -10,7 +10,16 @@ module Pragma
10
10
 
11
11
  def call
12
12
  context.records = authorize_collection(find_records)
13
- context.records = context.records.paginate(page: page, per_page: per_page)
13
+
14
+ begin
15
+ context.records = context.records.paginate(page: page, per_page: per_page)
16
+ rescue RangeError => e
17
+ respond_with!(
18
+ status: :bad_request,
19
+ error_type: :invalid_page,
20
+ error_message: e.message
21
+ )
22
+ end
14
23
 
15
24
  respond_with(
16
25
  resource: decorate(context.records),
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Pragma
3
- VERSION = '1.2.1'
3
+ VERSION = '1.2.3'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pragma
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alessandro Desantis
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-23 00:00:00.000000000 Z
11
+ date: 2017-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pragma-operation