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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ea9d74baca2cbdc590e6d5b595749ed585944358
4
- data.tar.gz: 18a9982c53ceae0b27ebcd33b1fa481ea4ac4143
3
+ metadata.gz: 64f90a5ad13079e0238b44ce57d7bd8e0fc3f93a
4
+ data.tar.gz: 7afb091b0a7dcfdade84a5f1ebbd8e8feab25076
5
5
  SHA512:
6
- metadata.gz: 2b7480aa1cb5e374d1a12bffe66be01d55731e1df62e39884f5b15f5e129717740965392e1bf71c87c3f844f46d8f84c2bf1d96e1a987bfbd71e1d9bd6194f45
7
- data.tar.gz: 00f30d2802f4a90d953aa9a46cbbbdc8d79e5ecea3bf0267180da280766da8f722f932875b1f446d466fcd9dfc8d7fff4a4d1ab1cfa6a64c31f1c2332297a0e2
6
+ metadata.gz: 11f24245a4d87f00fa7b1acd6103d1e5ccd9f190f149afac192d025175ed1b9edecedbfe205ef91abf41b14d6f235c5f176eb92550e16e706abd96ebdf79733e
7
+ data.tar.gz: bcf9ae832061fe082c715b01bd22fa8cd41f3fce929c7943267a03889c8f97032f3ac192fca92aaa11ecd74743a335a343cbe3ec535eb3cb9e36c1e890c893fa
@@ -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
- result = service.execute("#{name}(#{key})")
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
@@ -1,3 +1,3 @@
1
1
  module OData
2
- VERSION = '0.5.4'
2
+ VERSION = '0.5.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: odata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Thompson