graph_starter 0.13.1 → 0.13.2

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: 85725b1d19a58df475f57cb66cfad9bb8bc83333
4
- data.tar.gz: b8e5fbac3fe0b66440a5b00d6130f7defad79e05
3
+ metadata.gz: 940263fddced646bc176701aaf217487a77cbf91
4
+ data.tar.gz: 5dcd4f60644deb80119ea8fd55c49472e95d6645
5
5
  SHA512:
6
- metadata.gz: 326e0cef2e210b828805a35c28ae29dbe085ae6dd627abb92cd2df822dc3e65fb11c5f4b16ae0975ed5d7ad4c5a24951cfb223fdbd6cd33d0f9ebf8670c7c0f3
7
- data.tar.gz: 33bb2580ae7630bb73f2cf5ba4d2b7889048602573cf14c34c5b8b9f468110cafa557822bd1269772c0986eaa3c0889613bfa7cebd3f2afed483a48f50d67751
6
+ metadata.gz: 471f43e5c2e64d175608df231e0efbd4982bea5c619a72d1497d2490b0d27a012a96bc120ccdcb386d2b054d8c27c7248846f5b97d7688762cb9d1af81c82411
7
+ data.tar.gz: 5d9e6fbdba1150de2ed7a6d4f6de18f02792b90e4e657c55ad95bb3701ed5fc93da5a4d7e7777a1fe55086af9698e6bd9d55661782d3ed4f84215c1d85b296b8
@@ -5,7 +5,16 @@ end
5
5
 
6
6
  json.associations do
7
7
  @asset.class.authorized_associations.each do |name, association|
8
- json.set! name, @asset.send(name).to_a
8
+ value = case association.type
9
+ when :has_many
10
+ @asset.send(name).to_a
11
+ when :has_one
12
+ @asset.send(name)
13
+ else
14
+ fail "Invalid association: #{association.inspect}"
15
+ end
16
+
17
+ json.set! name, value
9
18
  end
10
19
  end
11
20
 
@@ -1,3 +1,3 @@
1
1
  module GraphStarter
2
- VERSION = "0.13.1"
2
+ VERSION = "0.13.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graph_starter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.1
4
+ version: 0.13.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Underwood