thoughtbot/factory_girl_rails — pull request #141 by kreintjes (2014-09-03 08:05:05+00:00)
Title: Add filename_proc option to Factory generator

Add a filename_proc option to the Factory generator for better control over the generated factory filename.

Main motivation for this pull request is the ability to use the singularized model_name in the factory filename. For the model Book I want to be able to call the factory book_factory.rb, while with the suffix option only books_factory.rb can be achieved. I believe the latter filename is not semantically correct, because the file defines the data for a single book.

With the filename_proc option people could of course also add prefixes or suffixes to the filename. Therefore this option could potentially replace the suffix option, although it is also possible to support them both for legacy reasons.