odata 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/odata/entity_set.rb +6 -1
- data/lib/odata/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64f90a5ad13079e0238b44ce57d7bd8e0fc3f93a
|
4
|
+
data.tar.gz: 7afb091b0a7dcfdade84a5f1ebbd8e8feab25076
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11f24245a4d87f00fa7b1acd6103d1e5ccd9f190f149afac192d025175ed1b9edecedbfe205ef91abf41b14d6f235c5f176eb92550e16e706abd96ebdf79733e
|
7
|
+
data.tar.gz: bcf9ae832061fe082c715b01bd22fa8cd41f3fce929c7943267a03889c8f97032f3ac192fca92aaa11ecd74743a335a343cbe3ec535eb3cb9e36c1e890c893fa
|
data/lib/odata/entity_set.rb
CHANGED
@@ -88,7 +88,12 @@ module OData
|
|
88
88
|
# @param key [to_s] primary key to lookup
|
89
89
|
# @return [OData::Entity,nil]
|
90
90
|
def [](key)
|
91
|
-
|
91
|
+
entity = new_entity
|
92
|
+
key_property = entity.send(:properties)[entity.primary_key]
|
93
|
+
key_property.value = key
|
94
|
+
url_key = key_property.url_value
|
95
|
+
|
96
|
+
result = service.execute("#{name}(#{url_key})")
|
92
97
|
entities = service.find_entities(result)
|
93
98
|
OData::Entity.from_xml(entities[0], entity_options)
|
94
99
|
end
|
data/lib/odata/version.rb
CHANGED