Commits on Apr 26, 2013
  1. @joshuaclayton

    Idea for association syntax within dynamic attributes

    Breaks in older (3.0, not sure about 3.1) versions of Rails due to how
    association assignment is handled.
    Problems: order of block variables is reversed between dynamic
    attributes and callbacks. If adding this, I'd prefer to maintain order.
    Current implementation handles this by, when one block variable,
    treating as evaluator like normal. When two are provided, the instance
    becomes the first and the second is the evaluator. Not sure how
    confusing that is, though.
    joshuaclayton committed Nov 20, 2012
  2. @olivierlacan @joshuaclayton
  3. @joshuaclayton

    Raise if a method is defined with a FactoryGirl block (factory or trait)

    This resolves an issue where users have defined methods inside factory
    girl blocks. This hasn't worked in quite a while and without raising,
    users would be able to define methods and see an odd error (a
    NoMethodError for `singleton_method_added=`). Instead, we raise
    immediately so that no issues come up later when they actually try to
    use the factories.
    Closes #513
    joshuaclayton committed Apr 26, 2013
Commits on Apr 5, 2013
  1. @releu @joshuaclayton

    Allow use of Symbol#to_proc in FactoryGirl callbacks

    This allows callbacks to be called as such:
        FactoryGirl.define do
          factory :user do
            after :create, &:confirm!
    Closes #511
    releu committed with joshuaclayton Apr 2, 2013
Commits on Mar 25, 2013
  1. @joshuaclayton
Commits on Feb 17, 2013
  1. @dpickett @joshuaclayton
  2. @dpickett @joshuaclayton
Commits on Feb 8, 2013
  1. @joshuaclayton

    Add global callbacks

    This allows callbacks (after :build, :create, etc.) to be defined at the
    FactoryGirl level; this means that the callback will be invoked for all
    factories. This is primarily to maintain consistency and follow the
    principle of least surprise.
    As usual, callbacks are applied from the lowest component to the
    highest, meaning that global callbacks will be run after factory and
    trait callbacks are run.
        FactoryGirl.define do
          after(:build) {|object| puts "Built #{object}" }
          factory :user
          # ...
    Closes #481
    Closes #486
    joshuaclayton committed Feb 8, 2013
  2. @joshuaclayton

    Add Code Climate badge

    joshuaclayton committed Feb 2, 2013
Commits on Jan 29, 2013
  1. @mjankowski
  2. @jordimassaguerpla @joshuaclayton

    add license information to gemspec

    This way it can be used with API
    jordimassaguerpla committed with joshuaclayton Jan 28, 2013
Commits on Jan 18, 2013
  1. @joshuaclayton

    Bump version to 4.2.0

    joshuaclayton committed Jan 18, 2013
  2. @joshuaclayton
  3. @joshuaclayton
  4. @joshuaclayton
  5. @joshuaclayton

    Fix warnings

    [Closes #463]
    joshuaclayton committed Jan 18, 2013
  6. @joshuaclayton
  7. @joshuaclayton

    Evaluate sequences within the context of the Evaluator when possible

    This fixes weird issues where methods invoked within sequences
    (like `sprintf`) fail because these methods are being evaluated within
    the context of the DefinitionProxy. With this change, invoking `#next`
    on a sequence happens from the evaluator so if the scope is provided (it
    usually will be), it'll run in the proper context. This means a couple
    of oddities are fixed:
    1. Developers can now refer to methods on the object instance, just like
    in dynamic attributes:
        class User
          def company
            # company lookup
        FactoryGirl.define do
          factory :user do
            sequence(:job_title) {|n| "{title} #{n} at #{}" }
    2. Invoke methods typically available because the method is available on
    Object (e.g. Kernel methods):
        FactoryGirl.define do
          factory :user do
            sequence(:last_4_ssn) {|n| sprintf '%04d', n }
    Derek Prior and Josh Clayton committed with joshuaclayton Jan 11, 2013
Commits on Jan 4, 2013
  1. @mjankowski
  2. @mjankowski

    Update rails gem versions in Appraisals to use latest stable releases…

    …: 3.2.10, 3.1.9, 3.0.18
    mjankowski committed Jan 4, 2013
Commits on Dec 21, 2012
  1. @aripollak @joshuaclayton
  2. @sikachu
Commits on Nov 7, 2012
  1. @joshuaclayton
  2. @joshuaclayton
Commits on Nov 2, 2012
  1. @joshuaclayton
  2. @joshuaclayton
  3. @joshuaclayton
  4. @hosamaly @joshuaclayton
Commits on Oct 29, 2012
  1. @stve
Commits on Oct 22, 2012
  1. @jferris @joshuaclayton

    Refactor spec to avoid a general fixture

    * Removes let blocks
    * Introduces factory methods for common test setup
    jferris committed with joshuaclayton Sep 14, 2012
  2. @pjg @joshuaclayton

    Two typos fix in GETTING_STARTED

    pjg committed with joshuaclayton Oct 15, 2012
  3. @bbugh @joshuaclayton
Commits on Sep 28, 2012
  1. @phlipper
Commits on Sep 14, 2012
  1. Update copyright years in and LICENSE

    Adarsh Pandit committed Sep 14, 2012
  2. @joshuaclayton