thoughtbot/factory_girl — Issue #251: NoMethodError: undefined method `substitute' for #<Account:0x00000100d00f88>
Author: mugwump
Created: 2011-12-09 16:57:14+00:00
State: open

Is FactoryGirl supposed to work with mongoid out of the box?! The basic methods are running fine, but when I try to make an association:

```ruby
FactoryGirl.define do
factory :user do
sequence :uid do |n|
"4711#{n}"
end
name 'test'
end

factory :account do
user { |account| account.association(:user)}
end

end
```
I get an error:

```ruby
NoMethodError: undefined method `substitute' for #
```

adding an empty
```ruby
def substitute(what)
end
```

appears to make factory-girl happy again. Is someone currently using factory-girl to factorize mongoid-models? Any more pitfalls?!

Cheers
Stefan