her 0.8.5 → 0.8.6

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: deb396c535f2621118ad4127970ed969edb232c6
4
- data.tar.gz: f71fbc8a42a9bdf453512adbf6740542ca7a00c8
3
+ metadata.gz: bd29346168938bbc64f498b73226188938c7cdb5
4
+ data.tar.gz: 86554e2fa519f825aedb4fa63a3c82e50b4a8731
5
5
  SHA512:
6
- metadata.gz: 1a7085472d5a1b1dbcd1981e717a02dd66fa64cad301507f384176c9c48713340c938de866c5c59bef729869d50a0c6c9ffcc8b8e6f8bab53f6f9327a1ee0a40
7
- data.tar.gz: 48b8ab97ca692b35ec372834e899e8e03123cef0022d91a75ef9058ba96a59fa7321b4bf513865481a35688781151c232b8768a242932db9166d58b594cbd46c
6
+ metadata.gz: ffd1a26120cb29cab5d879515b8c587c65f5729aaa61735998dd5e94a6f5af717399e8c4f03dcb2098fbc4385645312335b477f14e3559e90afd348a850cf087
7
+ data.tar.gz: f2a023b8d8c0330988c104664026c26ffa5e6e34554724b4379f7d2edddb4aec306de9b6fe032b1c75d85b0c0238e170db20534d8e54bc9236b985b937c3754a
data/README.md CHANGED
@@ -415,8 +415,8 @@ You can use the association methods to build new objects and save them.
415
415
  @user.comments.build(body: "Just a draft")
416
416
  # => [#<Comment body="Just a draft" user_id=1>]
417
417
 
418
- @user.comments.create(body: "Hello world.")
419
- # POST "/users/1/comments" with `body=Hello+world.`
418
+ @user.comments.create(body: "Hello world.", user_id: 1)
419
+ # POST "/comments" with `body=Hello+world.&user_id=1`
420
420
  # => [#<Comment id=3 body="Hello world." user_id=1>]
421
421
  ```
422
422
 
@@ -58,7 +58,7 @@ module Her
58
58
  def embeded_params(attributes)
59
59
  associations[:has_many].select { |a| attributes.include?(a[:data_key])}.compact.inject({}) do |hash, association|
60
60
  params = attributes[association[:data_key]].map(&:to_params)
61
- next if params.empty?
61
+ next hash if params.empty?
62
62
  if association[:class_name].constantize.include_root_in_json?
63
63
  root = association[:class_name].constantize.root_element
64
64
  hash[association[:data_key]] = params.map { |n| n[root] }
@@ -1,3 +1,3 @@
1
1
  module Her
2
- VERSION = "0.8.5"
2
+ VERSION = "0.8.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: her
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.5
4
+ version: 0.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rémi Prévost
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-13 00:00:00.000000000 Z
11
+ date: 2017-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake