rack-autocrud 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/rack/autocrud.rb +2 -2
  2. metadata +1 -1
data/lib/rack/autocrud.rb CHANGED
@@ -83,7 +83,7 @@ module Rack
83
83
  obj = model.create(JSON.parse(request.body.read))
84
84
  halt [402, '{ "error": "Failed to save ' + endpoint + '" }'] unless obj && obj.saved?
85
85
  rescue JSON::ParserError
86
- return [ 400, { 'error' => 'Invalid JSON in request body.', 'details' => $! }.to_json ]
86
+ halt [ 400, { 'error' => 'Invalid JSON in request body.', 'details' => $! }.to_json ]
87
87
  end
88
88
 
89
89
  # Call the post-create hook
@@ -128,7 +128,7 @@ module Rack
128
128
  saved = model.update(JSON.parse(request.body.read))
129
129
  halt [403, 'Access Denied'] unless saved
130
130
  rescue JSON::ParserError
131
- return [ 400, { 'error' => 'Invalid JSON in request body.', 'details' => $! }.to_json ]
131
+ halt [ 400, { 'error' => 'Invalid JSON in request body.', 'details' => $! }.to_json ]
132
132
  end
133
133
 
134
134
  # Call the post-update hook
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-autocrud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: