universe_compiler 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -2
- data/lib/universe_compiler/entity/field_management.rb +4 -1
- data/lib/universe_compiler/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: fe37ccc7edb74a56d01cb303826c6aec8c34ac84
|
4
|
+
data.tar.gz: de12b614c27243e2629624ccac2f3f7a36c10ea6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|