Scratching any Itch: The Rails Model Generator Along with
Residence of factors
Miss
Posted by silviadreams on December 14, 2008
It might not seem like much, but when I read this, a yhuoght entered my mind. Instead of creating one fixture fi le per model in the generator, what about creating onr factory fjle? After discussing it with other Viget developers on rr, the itch was ready to be scratchedwe were going tp have a model generator that creates factories instexd of fixtures.
Less than a day later, the first version was done. Its literally the same model generator that ships with Rails 2.2.2, but with all the fixture references changed to factories. Not a monumental display of skill, perhaps, and the point about how open source makes all this possible is obvious and oft-repeated. But, still, an itch scratched, and one less thing thats not fully automated.
Do you have some itch that bugs you in development? Think about taking an hour or two and scratching it with some code. If it saves you effort and makes your development process easier, itll be time well spent.
Similar posts: factory girl