odata-model 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/odata/model/associations.rb +3 -2
- data/lib/odata/model/version.rb +1 -1
- data/spec/example_models/odatademo_product.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: 020be93a49670fde2d76fcd4383404740c85d18d
|
4
|
+
data.tar.gz: 0cfddee7c63aca2e5a1779b260ff65e38522ec5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf02e889c5318df600d166eb83257130053b2a96dde54d71b413216c6ceaf784af4e3dda4451ee97c0f0bb2517f7573edab981144e1ce8931c32dd18b44ec231
|
7
|
+
data.tar.gz: 7c15b9b21ab724a549f00a1cd09af2cdc611751e54f2dd2e39966ecfd0db78a33c7a1201aa7226bd7c32db61ff77f9f63f0977453b1f6e4ba1d0ec5bb1825e5c
|
data/CHANGELOG.md
CHANGED
@@ -45,15 +45,16 @@ module OData
|
|
45
45
|
class_eval do
|
46
46
|
define_method(accessor_name) do
|
47
47
|
association_entities = odata_entity.associations[association_name]
|
48
|
+
klass = self.class.odata_associations[association_name][:class_name]
|
49
|
+
model_klass = klass.is_a?(Class) ? klass : klass.to_s.constantize
|
50
|
+
model = model_klass.new
|
48
51
|
if association_entities.is_a?(Enumerable)
|
49
52
|
association_entities.collect do |entity|
|
50
|
-
model = self.class.odata_associations[association_name][:class_name].new
|
51
53
|
model.instance_variable_set(:@odata_entity, entity)
|
52
54
|
model
|
53
55
|
end
|
54
56
|
else
|
55
57
|
return nil if association_entities.nil?
|
56
|
-
model = self.class.odata_associations[association_name][:class_name].new
|
57
58
|
model.instance_variable_set(:@odata_entity, association_entities)
|
58
59
|
model
|
59
60
|
end
|
data/lib/odata/model/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: odata-model
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Thompson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|