universe_compiler 0.4.0 → 0.4.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d32cb08d065dc49ae220b4f681c37719f8cad091
4
- data.tar.gz: 97af0f860e453d852d9a77ff69d52e350dd2ec88
3
+ metadata.gz: fe37ccc7edb74a56d01cb303826c6aec8c34ac84
4
+ data.tar.gz: de12b614c27243e2629624ccac2f3f7a36c10ea6
5
5
  SHA512:
6
- metadata.gz: 700546bad667dedb998bb527ac6fd19c815cb870ccf82d77fb3c42c8927c7ffe915b122a3ef592bd805ca3358fee054ff3c0bfb4dde4c2a5f4740b6f09b4b977
7
- data.tar.gz: 9a5fce641199557bb8e9fdfbbaa483554d4e2e28ba38078b2757417977b079ab9ba160f83b0f4d52302f430c0276804c51770e47ad150acdb88d6e33bb49ba62
6
+ metadata.gz: 5f4023821d1fd3cd6961a8bd39d0d7088170190e45cd31d8ff182e4b49c40a1d32405e3128c9d7e329977e7d80c935df55ab3141f09f16951c2900c9d746e18d
7
+ data.tar.gz: 60a60200d9679c32e5cfa3ad9079c6b0e00c78a8e8c70ce615cfc8bd731b59c0c828c86551180c90c1d6c11db3f4546407187e503f23120cf5a081cb02f500ec
data/README.md CHANGED
@@ -276,8 +276,6 @@ Sometimes you may want entities _targeted_ by `has_one` or `has_many` relations
276
276
 
277
277
  This is called **reverse methods**.
278
278
 
279
- **:warning: This can only work within a universe !**
280
-
281
279
  ```ruby
282
280
  class EntityA < UniverseCompiler::Entity::Base
283
281
  auto_named_entity_type
@@ -34,7 +34,10 @@ module UniverseCompiler
34
34
  res = universe.get_entities(criterion: :by_type, value: method_definition_constraints[:source_entity]).select do |entity|
35
35
  entity[method_definition_constraints[:source_field]].send check_operation, self
36
36
  end
37
- return res if res.nil? || res.empty?
37
+ if res.empty?
38
+ res = nil if method_definition_constraints[:unique_result]
39
+ return res
40
+ end
38
41
 
39
42
  if method_definition_constraints[:unique_result]
40
43
  if res.size == 1
@@ -1,3 +1,3 @@
1
1
  module UniverseCompiler
2
- VERSION = '0.4.0'.freeze
2
+ VERSION = '0.4.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: universe_compiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Laurent B.