Skip to content

Commit 2a8b807

Browse files
committed
Ask to remove factories.rb even in older Solidus versions
If extension has a folder that contain all the factories, we can remove factories.rb file, since the load_for() method will already take all the files and load them individually, even when find_definitions is not used.
1 parent 5dfe81e commit 2a8b807

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

lib/solidus_dev_support/testing_support/factories.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ module Factories
1313
def self.load_for(*engines)
1414
paths = engines.flat_map do |engine|
1515
factories_file_or_folder = engine.root.glob('lib/*/testing_support/factories{,.rb}')
16-
17-
if factories_file_or_folder.size == 2 && using_factory_bot_definition_file_paths?
16+
if factories_file_or_folder.size == 2
1817
folder, file = factories_file_or_folder.partition(&:directory?).map(&:first).map { |path| path.to_s.gsub(engine.root.to_s, '') }
1918
ActiveSupport::Deprecation.warn <<-WARN.squish, caller(4)
2019
SolidusDevSupport::TestingSupport::Factories.load_for() is automatically loading

0 commit comments

Comments
 (0)