naranya_ecm-sdk 0.0.28 → 0.0.29
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/naranya_ecm/rest/associations.rb +1 -3
- data/lib/naranya_ecm/rest/relation.rb +5 -4
- data/lib/naranya_ecm-sdk/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: 43a17f984bc77a91ab6f48708316247507c6998d
|
|
4
|
+
data.tar.gz: 938b9aa5bc94cb567bd40df4df89491068f831cd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 04148763fe680ec57f5927a6407ada9c28fa1919ea1524c7120a20f72dbe6ef6f934e2c259e5c2add795249100c62c725e43b576d5f3a8a79a028c645bfe0225
|
|
7
|
+
data.tar.gz: ced5f82fd6da50e743e95f82c56d38a812022adaf2ac6699d47a6c35a00a15fd7dbd93ef82519edd9abcfaa5e7ea936939a7ede0bd71cdc3af67d7057e9c98ef
|
|
@@ -58,9 +58,7 @@ module NaranyaEcm::Rest
|
|
|
58
58
|
reflection = self.class.reflect_on_association(name)
|
|
59
59
|
relation = Relation.new(reflection.associated_class, { reflection.foreign_key => self.id })
|
|
60
60
|
|
|
61
|
-
unless new_value.
|
|
62
|
-
relation.load new_value
|
|
63
|
-
end
|
|
61
|
+
relation.load new_value unless new_value.nil?
|
|
64
62
|
|
|
65
63
|
instance_variable_set "@#{name}".to_sym, relation
|
|
66
64
|
end
|
|
@@ -21,7 +21,7 @@ module NaranyaEcm::Rest
|
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
def to_a
|
|
24
|
-
materialize!
|
|
24
|
+
materialize! if @elements.nil?
|
|
25
25
|
elements
|
|
26
26
|
end
|
|
27
27
|
|
|
@@ -32,9 +32,10 @@ module NaranyaEcm::Rest
|
|
|
32
32
|
|
|
33
33
|
def load(given_list)
|
|
34
34
|
# Revisar que todos los elementos sean Hash o la clase asociada:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
if given_list.count > 0 && given_list.map{ |e| e.is_a?(Hash) || e.is_a?(@klass) }.reduce { |res, e| res && e } == false
|
|
36
|
+
raise "Type Mismatch: some elements are not a hash nor associated_class"
|
|
37
|
+
end
|
|
38
|
+
|
|
38
39
|
@elements = given_list.map { |e| e.is_a?(Hash) ? @klass.load(e) : e }
|
|
39
40
|
end
|
|
40
41
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: naranya_ecm-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.29
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Roberto Quintanilla
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-05-
|
|
11
|
+
date: 2014-05-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|