universe_compiler 0.4.1 → 0.4.2

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: fe37ccc7edb74a56d01cb303826c6aec8c34ac84
4
- data.tar.gz: de12b614c27243e2629624ccac2f3f7a36c10ea6
3
+ metadata.gz: d09b8d02e98418aef483a480fb61437a50598419
4
+ data.tar.gz: 64ce9d0d55cd3d993f41dfbf38035506e259fe7c
5
5
  SHA512:
6
- metadata.gz: 5f4023821d1fd3cd6961a8bd39d0d7088170190e45cd31d8ff182e4b49c40a1d32405e3128c9d7e329977e7d80c935df55ab3141f09f16951c2900c9d746e18d
7
- data.tar.gz: 60a60200d9679c32e5cfa3ad9079c6b0e00c78a8e8c70ce615cfc8bd731b59c0c828c86551180c90c1d6c11db3f4546407187e503f23120cf5a081cb02f500ec
6
+ metadata.gz: dce3601fef115bc74a0b395a90a9e7946c667b5a7a09afb77ed8246bf9381111ebe31c8256375ec9a159dff1ef4c28f7342dc3a1b26dd12c23b1ab40d3bcac64
7
+ data.tar.gz: f25e06b4e0236c55b19c801b65331049e27a5a946f1eecaac60a9603b49426cf83b9abc58e28ffb57ee06f69bf4647ca15c88498ecd352fd1c36fa57390a0668
@@ -13,9 +13,8 @@ module UniverseCompiler
13
13
  end
14
14
  end
15
15
 
16
- def define_reverse_method(default_method_name, method_definition_constraints)
16
+ def define_reverse_method(method_name, method_definition_constraints)
17
17
  metaclass = class << self; self ; end
18
- method_name = normalize_method_name(default_method_name, method_definition_constraints)
19
18
  UniverseCompiler.logger.debug 'Defining reverse method "%s" on class %s (%s)' % [method_name, metaclass, self.type]
20
19
  raise UniverseCompiler::Error, "'#{method_name}' already exists on class '#{metaclass}'. Skipped !" if self.respond_to? method_name
21
20
  method_definition_constraints[:actual_method] = method_name
@@ -54,16 +53,6 @@ module UniverseCompiler
54
53
  end
55
54
  end
56
55
 
57
-
58
-
59
- def normalize_method_name(default_method_name, method_definition_constraints)
60
- if default_method_name == method_definition_constraints[:source_entity]
61
- "referenced_from_#{method_definition_constraints[:source_entity]}_entities"
62
- else
63
- default_method_name
64
- end
65
- end
66
-
67
56
  def define_known_fields_accessors
68
57
  self.class.fields_constraints.each do |field_name, constraints|
69
58
  next if constraints[:reverse_method]
@@ -46,7 +46,7 @@ module UniverseCompiler
46
46
  def define_constraint_for_reverse_method(relation_type, target_entity_type, source_field_name, with_reverse_method, unique)
47
47
  reverse_method_name = case with_reverse_method
48
48
  when TrueClass
49
- self.entity_type
49
+ "referenced_from_#{self.entity_type}_#{source_field_name}".to_sym
50
50
  when String, Symbol
51
51
  with_reverse_method.to_sym
52
52
  end
@@ -1,3 +1,3 @@
1
1
  module UniverseCompiler
2
- VERSION = '0.4.1'.freeze
2
+ VERSION = '0.4.2'.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.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Laurent B.