Skip to content

Commit d470621

Browse files
author
Jeremy McNevin
committed
Keep support for factories named in old style.
1 parent 841c3e7 commit d470621

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib/annotate/annotate_models.rb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,10 @@ def annotate(klass, file, header, options={})
252252
File.join(EXEMPLARS_SPEC_DIR, "#{model_name}_exemplar.rb"), # Object Daddy
253253
File.join(BLUEPRINTS_TEST_DIR, "#{model_name}_blueprint.rb"), # Machinist Blueprints
254254
File.join(BLUEPRINTS_SPEC_DIR, "#{model_name}_blueprint.rb"), # Machinist Blueprints
255-
File.join(FACTORY_GIRL_TEST_DIR, "#{klass.table_name}.rb"), # Factory Girl Factories
256-
File.join(FACTORY_GIRL_SPEC_DIR, "#{klass.table_name}.rb"), # Factory Girl Factories
255+
File.join(FACTORY_GIRL_TEST_DIR, "#{klass.table_name}.rb"), # Factory Girl Factories (new style)
256+
File.join(FACTORY_GIRL_SPEC_DIR, "#{klass.table_name}.rb"), # Factory Girl Factories (new style)
257+
File.join(FACTORY_GIRL_TEST_DIR, "#{model_name}_factory.rb"), # Factory Girl Factories (old style)
258+
File.join(FACTORY_GIRL_SPEC_DIR, "#{model_name}_factory.rb"), # Factory Girl Factories (old style)
257259
File.join(FABRICATORS_TEST_DIR, "#{model_name}_fabricator.rb"), # Fabrication Fabricators
258260
File.join(FABRICATORS_SPEC_DIR, "#{model_name}_fabricator.rb"), # Fabrication Fabricators
259261
].each do |file|
@@ -394,8 +396,10 @@ def remove_annotations(options={})
394396
File.join(EXEMPLARS_SPEC_DIR, "#{model_name}_exemplar.rb"), # Object Daddy
395397
File.join(BLUEPRINTS_TEST_DIR, "#{model_name}_blueprint.rb"), # Machinist Blueprints
396398
File.join(BLUEPRINTS_SPEC_DIR, "#{model_name}_blueprint.rb"), # Machinist Blueprints
397-
File.join(FACTORY_GIRL_TEST_DIR, "#{klass.table_name}.rb"), # Factory Girl Factories
398-
File.join(FACTORY_GIRL_SPEC_DIR, "#{klass.table_name}.rb"), # Factory Girl Factories
399+
File.join(FACTORY_GIRL_TEST_DIR, "#{klass.table_name}.rb"), # Factory Girl Factories (new style)
400+
File.join(FACTORY_GIRL_SPEC_DIR, "#{klass.table_name}.rb"), # Factory Girl Factories (new style)
401+
File.join(FACTORY_GIRL_TEST_DIR, "#{model_name}_factory.rb"), # Factory Girl Factories (old style)
402+
File.join(FACTORY_GIRL_SPEC_DIR, "#{model_name}_factory.rb"), # Factory Girl Factories (old style)
399403
File.join(FABRICATORS_TEST_DIR, "#{model_name}_fabricator.rb"), # Fabrication Fabricators
400404
File.join(FABRICATORS_SPEC_DIR, "#{model_name}_fabricator.rb"), # Fabrication Fabricators
401405
].each do |file|

0 commit comments

Comments
 (0)