Skip to content

Commit e61eb5c

Browse files
committed
Closed #41
1 parent 52a8a77 commit e61eb5c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

bin/cdqi

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,18 +177,19 @@ end
177177
File::open(model_path) do |fd|
178178
xml = REXML::Document::new(fd)
179179
classes_by_entity_name = {}
180-
#build map of entity_name => class and excluded entities
180+
# Build map of entity_name => class and excluded entities
181181
xml.root.elements.each('entity') do |entity_node|
182-
represented_class = entity_node.attributes['representedClassName']
183-
represented_class = represented_class.split('.')[-1]
184182
entity_name = entity_node.attributes['name']
183+
represented_class = entity_node.attributes['representedClassName']
185184
excluded = false
186185
if represented_class.nil?
187-
$stderr.puts "WARNING: The '#{entity_name}' entity was skipped because it has no represented class."
186+
$stderr.puts "WARNING: The entity '#{entity_name}' was skipped because it has no represented class."
188187
excluded = true
188+
else
189+
represented_class = represented_class.split('.')[-1]
189190
end
190-
if represented_class == 'Key' && $options.suffix == 'Attribute'
191-
$stderr.puts "WARNING: The entity '#{entity_name}' represented by the class 'Key' was skipped because its name would conflict with CDQI's 'KeyAttribute'. You can avoid this by using a different represented class name or a suffix other than 'Attribute'."
191+
if ['String', 'Numeric', 'Date', 'Data', 'Entity'].include?(represented_class) && $options.suffix == 'Attribute'
192+
$stderr.puts "WARNING: The entity '#{entity_name}' represented by the class '#{represented_class}' was skipped because the name of its generated proxy would conflict with CDQI's '#{represented_class}Attribute'. You can avoid this by using a different represented class name or a suffix other than 'Attribute'."
192193
excluded = true
193194
end
194195
if excluded

0 commit comments

Comments
 (0)