module Concerns
  module Competition
    module Categories
      # Array of ids (integers)
      # +race+ category, +race+ category's siblings, and any competition categories
      def category_ids_for(race)
        [ race.category_id ] + race.category.descendants.map(&:id)
      end
    end
  end
end

module Concerns
  module Competition
    module Categories
      def category_names
        [ friendly_name ]
      end

      # Only consider results from categories. Default to false: use all races in year.
      def categories?
        false
      end

      # Array of ids (integers)
      # +race+ category, +race+ category's siblings, and any competition categories
      def category_ids_for(race)
        [ race.category_id ] + race.category.descendants.map(&:id)
      end
    end
  end
end

Add category_names to allow shared create_races across competitions. Add source_events? method to scope results by source events or not.
Add category_names to allow shared create_races across competitions. Add source_events? method to scope results by source events or not.
