normalizr.rb 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/normalizr/schema.rb +2 -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: 2005b8a5f7a97aa9916ac5fa1383625b1772bba6
|
|
4
|
+
data.tar.gz: 94bcbe9cd2eeccd9f140fc709c8cbfdaf7d393e7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aa3a15290e2ecc193392a780859bba99922fbdc3ae1a9e90dd72bedf867a9c36b7d81282be76d26437ebc5252091977e0f5897daf2c41cb5d9924d60fc94f7ac
|
|
7
|
+
data.tar.gz: 0087b62a3dd290ee48a33095a3d185779a4e0eaa511b525a9a0adef733fb09210c2e3cf3c63a4a4091597a00601b67beea9160f5b89b87059f897eaf5a0ef684
|
data/lib/normalizr/schema.rb
CHANGED
|
@@ -24,7 +24,8 @@ module Normalizr
|
|
|
24
24
|
# TODO: Write test for why this conditional needs to be here.
|
|
25
25
|
# I believe it has something to do with whether the root keys
|
|
26
26
|
# are originally symbols or non-symbols.
|
|
27
|
-
|
|
27
|
+
|
|
28
|
+
normalized = (obj[@name.to_sym][id] || obj[@name.to_sym][id.to_sym])
|
|
28
29
|
|
|
29
30
|
denormalized = @definition.keys.map do |key|
|
|
30
31
|
value = @definition[key].unvisit(obj, normalized[key])
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: normalizr.rb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Christopher Okhravi
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-02-
|
|
11
|
+
date: 2017-02-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Normalize deeply nested hash based on a schema
|
|
14
14
|
email:
|