softwear-lib 1.3.7 → 1.3.8

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: 08cf6aacd6f1611dd7678aedee774fe3532e9ae2
4
- data.tar.gz: d5b67400b88ab1fed3a10c7c8b3a0ab3217cb184
3
+ metadata.gz: d8242d03acacefda4174d1a878f58ce9ed135684
4
+ data.tar.gz: 063cc552f8838513d09f2349ed5f1cd8abb92585
5
5
  SHA512:
6
- metadata.gz: e708dfeb793a3909ea7f200435c48ccab88609797c239889c2e47859160434ad72a8c007855aae09de6c6b93b29a7346ec31858acc28bfd10f89c9e67f8542f4
7
- data.tar.gz: 059c47af88375dde455fe73d64562b2a56f0515f66753d10eb0bc9582a6148df6872d32b1ca3dbe4711c232bd9db016fba35ef3a062b74a5fc7dd0a11899bb46
6
+ metadata.gz: aa25e76ec0d67f5aa99fafe1b6e25b098c2dde96167e2ad54f91cea1b1278ed909d9c8adfd46741519a219020b550c9a0732806490881b4936b5f0fddd0f2ca1
7
+ data.tar.gz: 6bf34f9428f40692b00cc080687025eea44fe60b92443af472ca8832957042e0342d906d99dcd4812a626005a6381d03caf2bfb9ef3810eabc944d97b8f5c978
@@ -56,12 +56,17 @@ module Softwear
56
56
  end
57
57
 
58
58
  def create
59
- create! do |success, failure|
60
- success.json do
61
- headers['Location'] = resource_url(record.id)
62
- render_json(status: 201).call
63
- end
64
- failure.json(&render_errors)
59
+ self.record = resource_class.new
60
+
61
+ permitted_attributes.each do |a|
62
+ record.send("#{a}=", params[a]) if params[a]
63
+ end
64
+
65
+ if record.save
66
+ headers['Location'] = resource_url(record.id)
67
+ respond_to { |format| format.json(&render_json(status: 201)) }
68
+ else
69
+ respond_to { |format| format.json(&render_errors) }
65
70
  end
66
71
  end
67
72
 
@@ -1,5 +1,5 @@
1
1
  module Softwear
2
2
  module Lib
3
- VERSION = "1.3.7"
3
+ VERSION = "1.3.8"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: softwear-lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.7
4
+ version: 1.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nigel Baillie
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-06 00:00:00.000000000 Z
11
+ date: 2015-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler