lib/reality/generators/generator.rb in reality-generators-1.1.0 vs lib/reality/generators/generator.rb in reality-generators-1.2.0
- old
+ new
@@ -97,10 +97,11 @@
#
def collect_generation_targets(template_set_container, element_type, scope_element, element, targets)
(targets[element_type] ||= []) << [scope_element, element]
template_set_container.target_manager.targets_by_container(element_type).each do |target|
+ next unless handle_subelement?(element, target.key)
subelements = nil
subscope = nil
if target.standard?
subelements = element.send(target.access_method)
elsif element.facet_enabled?(target.facet_key)
@@ -113,9 +114,15 @@
subelements.each do |subelement|
collect_generation_targets(template_set_container, target.qualified_key, subscope || subelement, subelement, targets)
end
end
+ end
+
+ # A hook to control whether certain paths in model should
+ # be follow when collecting generation targets
+ def handle_subelement?(object, sub_feature_key)
+ true
end
end
end
end
end