github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

vigetlabs / model_generator_with_factories

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 23
    • 3
  • Source
  • Commits
  • Network (3)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

a modification of the standard Rails model generator to generate factory definitions for use with factory_girl instead of fixtures — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

rename back to ModelGenerator so it will override standard generator by 
default 
mcornick (author)
Wed Dec 03 13:01:34 -0800 2008
commit  6523681d8e8984b9060c6218aab6a1c74470cff6
tree    4b08a4061093a4cb1034bed0185803e53c0d200e
parent  9b7a328c4e70d5528cf74f95355ddfa77f1c4bb2
model_generator_with_factories /
name age
history
message
file MIT-LICENSE Tue Dec 02 10:47:31 -0800 2008 add readme and license [mcornick]
file README.markdown Loading commit data...
directory generators/
README.markdown

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 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

To install the generator as a plugin in your Rails app:

./script/plugin install git://github.com/vigetlabs/model_generator_with_factories.git

This will override the standard Rails model generator for this application. You can also pull the generators/model directory out of this repository and put it in $HOME/.rails/generators to make it available to all your present and future Rails applications.

Usage

Usage is the same as the standard Rails model generator:

./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

This generator incorporates most of its code from the stock Rails model generator, which is:

Copyright (c) 2004-2008 David Heinemeier Hansson

The modifications to make the generator generate factories instead of fixtures are:

Copyright (c) 2008 Mark Cornick and Viget Labs

Both the original Rails code and the modifications are released under the MIT license.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server