Class: Satisfactory::Loader Private
- Inherits:
-
Object
- Object
- Satisfactory::Loader
- Defined in:
- lib/satisfactory/loader.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Loads factory configurations from FactoryBot.
Class Method Summary collapse
-
.factory_configurations ⇒ {Symbol => Hash}
private
Skips factories that don’t have a model that inherits from ApplicationRecord.
Class Method Details
.factory_configurations ⇒ {Symbol => Hash}
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Skips factories that don’t have a model that inherits from ApplicationRecord.
12 13 14 15 16 17 18 19 |
# File 'lib/satisfactory/loader.rb', line 12 def factory_configurations FactoryBot.factories.each.with_object({}) do |factory, configurations| next unless (model = factory.build_class) next unless model < ApplicationRecord configurations[factory.name] = configuration_for(factory, model) end end |