opened
seymour
username_0
I have this simple factory for Mongoid model

``` ruby
    FactoryGirl.define do
      factory :mongo_group, :class => MongoGroup do
         name 'Group'
         membership_type Group::GROUP_TYPE[:public]
         description 'Description'
         welcome_header 'Welcome'
         welcome_message 'Message'
         memberships_count 10

         factory :myapp_mongo_group do
           name 'MyApp'
         end
      end
    end
```

when trying to make FactoryGirl.create(:myapp_mongo_group) I get exception with message "Trait not registered: created_by" where created_by is belongs_to association in mongoid model (belongs_to :created_by, :class_name => 'MongoUser').
If I make factory to be non-inherited

``` ruby
    factory :myapp_mongo_group, :class => MongoGroup do
      name 'MyApp'
      membership_type Group::GROUP_TYPE[:public]
      description 'Description'
      welcome_header 'Welcome'
      welcome_message 'Message'
      memberships_count 10
    end
```

then problem persists.
Trait not registered
issue
created
sanchez2210
username_1
For anybody still getting this error: `factory :mongo_group, aliases: [:created_by]` or better: `association :created_by, factory: :mongo_group`
comment