rack-autocrud 0.1.10 → 0.1.11

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 +1 -1
  2. metadata +1 -1
data/lib/rack/autocrud.rb CHANGED
@@ -100,7 +100,7 @@ module Rack
100
100
  # Attempt to create the model object
101
101
  obj = nil
102
102
  begin
103
- obj = model.new(JSON.parse(request.body.read))
103
+ obj = model.create(JSON.parse(request.body.read))
104
104
  halt [ 402, '{ "error": "Failed to save ' + endpoint + '" }' ] unless obj && obj.saved?
105
105
  rescue JSON::ParserError
106
106
  halt [ 400, { 'error' => 'Invalid JSON in request body.', 'details' => $! }.to_json ]
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.10
4
+ version: 0.1.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: