<commit_before># ModelGeneratorWithFactories

This is a modification of the standard Rails model generator (from Rails 2.2.2) to generate factory definitions for use with [factory_girl](http://github.com/thoughtbot/factory_girl) instead of fixtures.

## Requirements

This generator will only be useful with factory_girl version 1.1.4 or later. The generated code will not fail if version 1.1.4 is not installed; the factories will just not be available to your tests.

You will still need to add `require 'factory_girl'` to your test environment. This generator will not do that for you.

## Installation

1. Create a directory `$HOME/.rails/generators` if you have not already.
2. Change to that directory and run `git clone git://github.com/vigetlabs/model_generator_with_factories.git model_with_factories`
3. If you want this generator to override the standard Rails model generator, `mv model_with_factories model`

## Usage

If you only did steps 1 and 2 of the installation:

    ./script/generate model_with_factories Thing name:title description:text`

If you also did step 3:

    ./script/generate model Thing name:title description:text`

After generating the model, look in `test/factories` for your factory definition. As with fixtures in the stock model generator, you will probably want to change some of the default values.

## Author/Copyright
<commit_msg>remove stray backticks<commit_after># ModelGeneratorWithFactories

This is a modification of the standard Rails model generator (from Rails 2.2.2) to generate factory definitions for use with [factory_girl](http://github.com/thoughtbot/factory_girl) instead of fixtures.

## Requirements

This generator will only be useful with factory_girl version 1.1.4 or later. The generated code will not fail if version 1.1.4 is not installed; the factories will just not be available to your tests.

You will still need to add `require 'factory_girl'` to your test environment. This generator will not do that for you.

## Installation

1. Create a directory `$HOME/.rails/generators` if you have not already.
2. Change to that directory and run `git clone git://github.com/vigetlabs/model_generator_with_factories.git model_with_factories`
3. If you want this generator to override the standard Rails model generator, `mv model_with_factories model`

## Usage

If you only did steps 1 and 2 of the installation:

    ./script/generate model_with_factories Thing name:title description:text

If you also did step 3:

    ./script/generate model Thing name:title description:text

After generating the model, look in `test/factories` for your factory definition. As with fixtures in the stock model generator, you will probably want to change some of the default values.

## Author/Copyright

{'fraction_non_alphanumeric': 0.06021037359448676, 'fraction_numerical': 0.01088139281828074, 'mean_word_length': 4.663244353182751, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3548286', 'n_tokens_mistral': 748, 'n_tokens_neox': 706, 'n_words': 358}