def check_code_name(code_name)
      [code_name.pluralize, code_name.singularize].each {|name|
        %w{self_and_ancestors descendants}.each {|m|
          return false if template.send(m).map(&:code_name).include?(name)}}
      true
    end
def check_code_name(code_name)
      [code_name.pluralize, code_name.singularize].each {|name|
        %w{self_and_ancestors descendants}.each {|m|
          return false if template.send(m).map(&:code_name).include?(name)}}
      true
    end
Check if there is code_name in template branch