odata 0.6.13 → 0.6.14

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: 5381f4aa68afa778f56be63dc9864b456ee57f7f
4
- data.tar.gz: a7e006c5b4f2590811c9813bdc2123494c50e814
3
+ metadata.gz: 943ab749473103096ac1e3112bd58a3cac8ef453
4
+ data.tar.gz: aff62045213d7722a951bad6d8f2bdb014f6868a
5
5
  SHA512:
6
- metadata.gz: a01f153de7461a09772d1cb7a63dec351d511967dff9820b9458fa96e9bc0e174bdf11c5dd2a6de2fc1fc71be96e27852849cf8b792db41c34eb03c4997b41bb
7
- data.tar.gz: 8341abe5d59bbfabf16473087ab32080f6193d3e85fe92174f98b9f51427498ab5fc8fd66742d45f293b453bc87dc9a923bc230dddc65c63edd9447feb68d489
6
+ metadata.gz: 39c5d5f35616c5fac44c53eb8a7ad4f1bfb2e3820e4af4f9b15221c3ef4a9414207bc91c463e0f4db6b15e4e88b61d7b0fd332011201c7022ed1a44fb4e6f5a6
7
+ data.tar.gz: 816272d9977ae762154bc288067b89d3c28c46c8813ff0577bb03c5b63051e7a9c6f3d57a00de7b49e9c2403e0365aee6ac2acf003cd76dd9afd226c34a769ae
@@ -1,5 +1,10 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.6.14
4
+
5
+ * Changed implementation of OData::Association::Proxy#[] to properly handle
6
+ empty associations.
7
+
3
8
  ## 0.6.13
4
9
 
5
10
  * Minor bug fix in OData::Query::Result#each implementation.
@@ -6,8 +6,17 @@ module OData
6
6
  end
7
7
 
8
8
  def [](association_name)
9
- if entity.links[association_name].nil? || associations[association_name].nil?
9
+ if associations[association_name].nil?
10
10
  raise ArgumentError, "unknown association: #{association_name}"
11
+ elsif entity.links[association_name].nil?
12
+ association = associations[association_name]
13
+ association_end = association.ends.select {|details| details.entity_type != "#{namespace}.#{entity_type}"}.first
14
+ raise RuntimeError, 'association ends undefined' if association_end.nil?
15
+ if association_end.multiplicity == :many
16
+ []
17
+ else
18
+ nil
19
+ end
11
20
  end
12
21
 
13
22
  association_results(association_name)
@@ -1,3 +1,3 @@
1
1
  module OData
2
- VERSION = '0.6.13'
2
+ VERSION = '0.6.14'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: odata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.13
4
+ version: 0.6.14
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-09 00:00:00.000000000 Z
11
+ date: 2014-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler