hangar 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/hangar/resources_controller.rb +14 -2
- data/lib/hangar/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38c212290c63ba2b653e4f9191e15e332fa91e56
|
4
|
+
data.tar.gz: b266016d0680f3cf61c6756fe1a94f1b5602e482
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f9b79f324377cdc234ce105ee6fa1d4c1b01c848de64a3908c0fef6d17014807e04de3746a747cef8fe192badc5af9899b953e1de57e610ee866723b76ddbef
|
7
|
+
data.tar.gz: 0c3ee3d211290ab0c0e4c9b3c93c8d001b3fedc76218eb70095ae5b3560709b5d950a74b1886face3d3b2f9871dce1044612a3ebf1187e1d4a925116a26e0c37
|
@@ -5,7 +5,7 @@ module Hangar
|
|
5
5
|
|
6
6
|
def create
|
7
7
|
created = FactoryBot.create resource, *traits, resource_attributes
|
8
|
-
render json: created.as_json(include: includes
|
8
|
+
render json: created.as_json(include: includes)
|
9
9
|
end
|
10
10
|
|
11
11
|
def new
|
@@ -29,7 +29,19 @@ module Hangar
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def includes
|
32
|
-
@includes ||=
|
32
|
+
@includes ||= begin
|
33
|
+
_includes = params.fetch(:include, {}).as_json
|
34
|
+
|
35
|
+
unless _includes.is_a?(Hash)
|
36
|
+
array_of_assocation_and_options_pairs = Array(_includes).flat_map do |n|
|
37
|
+
n.is_a?(Hash) ? n.to_a : [[n, {}]]
|
38
|
+
end
|
39
|
+
|
40
|
+
_includes = Hash[array_of_assocation_and_options_pairs]
|
41
|
+
end
|
42
|
+
|
43
|
+
_includes.deep_symbolize_keys
|
44
|
+
end
|
33
45
|
end
|
34
46
|
|
35
47
|
def error_render_method(exception)
|
data/lib/hangar/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hangar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Rossmeissl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|