Permalink
Commits on Nov 18, 2011
  1. Bump version to 2.3.0

    joshuaclayton committed Nov 18, 2011
  2. Traits can be added to factories when the factory creates an instance

    This allows for traits to be used with normal factories without having
    to name every single factory that uses one (or many) traits.
    
    So, instead of creating male_admin and female_admin factories:
    
        FactoryGirl.define do
          factory :user do
            trait(:admin)  { admin true }
            trait(:male)   { gender "Male" }
            trait(:female) { gender "Female" }
    
            factory :male_admin,   :traits => [:male, :admin]
            factory :female_admin, :traits => [:admin, :female]
          end
        end
    
        FactoryGirl.create(:male_admin)
        FactoryGirl.create(:female_admin)
    
    You could just create a user with those traits assigned:
    
        FactoryGirl.create(:user, :admin, :male)
        FactoryGirl.create(:user, :admin, :female)
    
    This can be combined with attribute overrides as expected.
    
        FactoryGirl.create(:user, :admin, :male,   :name => "John Doe")
        FactoryGirl.create(:user, :admin, :female, :name => "Jane Doe")
    joshuaclayton committed Nov 18, 2011
  3. Don't cache build class

    joshuaclayton committed Nov 18, 2011
Commits on Nov 16, 2011
Commits on Nov 12, 2011
Commits on Nov 11, 2011
  1. Merge pull request #233 from thoughtbot/correct-module

    Use correct module in docs.
    jferris committed Nov 11, 2011
  2. date isn't necessary anymore.

    gabebw committed Nov 11, 2011
  3. Use Bundler gem tasks.

    gabebw committed Nov 11, 2011
Commits on Nov 9, 2011
  1. Use correct module in docs.

    gabebw committed Nov 9, 2011
Commits on Nov 4, 2011
  1. fixed typo

    ayrton committed Nov 4, 2011
Commits on Nov 2, 2011
Commits on Nov 1, 2011
Commits on Oct 31, 2011
  1. Wrap up DeclarationList

    DeclarationList knows how to generate an attribute
    list, which never really made sense outside of being generated from
    declarations. Now, the declaration list builds a list of attributes
    which is combined in Factory#attributes with attributes from traits and
    its parents.
    joshuaclayton committed Oct 30, 2011
  2. Add NullFactory

    joshuaclayton committed Oct 29, 2011
  3. Add FactoryGirl::Definition

    Both Factory and Trait have similar methods and interact with a
    DefinitionProxy. The idea here is to move the interface DefinitionProxy
    expects to a separate class and both Factory and Trait can delegate to
    an instance of Definition.
    joshuaclayton committed Oct 28, 2011
Commits on Oct 28, 2011
  1. Escape the underscore.

    gabebw committed Oct 28, 2011
  2. Merge pull request #220 from GunioRobot/clean

    Clean up whitespace thanks to Gun.io.
    gabebw committed Oct 28, 2011
Commits on Oct 27, 2011
Commits on Oct 21, 2011
  1. Remove whitespace [Gun.io WhitespaceBot]

    Gun.io Whitespace Robot committed Oct 21, 2011
Commits on Oct 20, 2011
  1. Attribute lists can be named

    This allows us to move self-referencing logic into AttributeList and
    just delegate to define_attribute from Factory. This means that once
    define_attribute is private, Factory will only need to remove the
    delegation.
    joshuaclayton committed Oct 20, 2011
  2. Clean up method names

    joshuaclayton committed Oct 20, 2011
  3. Extract complicated runner code into private class

    Factory#run was getting confusing - it added callbacks to the proxy,
    iterated over all attributes and operated on the proxy depending on if
    there were overridtes, mutated the overrides hash, and then operated on
    the mutated hash afterwards. This logic has been extracted into a
    private Factory::Runner class. The goal is to make it easier to
    understand everything that's occurring in order to instantiate and build
    the class.
    joshuaclayton committed Oct 20, 2011
Commits on Oct 15, 2011
  1. Use correct parameters in specs for FactoryGirl::Attribute::Dynamic c…

    …lass
    
    Closes #217
    Paco Guzman committed with joshuaclayton Oct 15, 2011
  2. Working rcov Rake task.

    Closes #218
    gabebw committed with joshuaclayton Oct 15, 2011