rack-autocrud 0.1.10 → 0.1.11

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.
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: