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 +4 -4
- data/README.md +2 -2
- data/lib/her/model/parse.rb +1 -1
- data/lib/her/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: bd29346168938bbc64f498b73226188938c7cdb5
|
4
|
+
data.tar.gz: 86554e2fa519f825aedb4fa63a3c82e50b4a8731
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 "/
|
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
|
|
data/lib/her/model/parse.rb
CHANGED
@@ -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] }
|
data/lib/her/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2017-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|