You can clone with
HTTPS or Subversion.
I have placed FactoryGirl.find_definitions into factory_girl.rb initializer because I'm using FactoryGirl in seeds.rb and some rake tasks and I've noticed this weird behaviour: call of FactoryGirl.find_definitions in initializers/factory_girl.rb breaks evaluating of FriendlyId.defaults in initializers/friendly_id.rb. Application runs normally without any problem but everything what is inside of block FriendlyId.defaults is not evaluated.
FriendlyId.defaults do |config|
config.base = :name
config.reserved_words = %w(new edit)
FriendlyId::Slug.table_name = "slugs"
This should be related to the order in with initializers are being evaluated. I'm not 100% sure but, from a trivial check, initializers are evaluated in a stable, sort order. If that is the case, factory_girl.rb will always be evaluated before friendly_id.rb. If FactoryGirl runs first, then it wouldn't be able to see your FriendlyId defaults.
You could try either renaming your friendly_id.rb or moving that code somewhere else making sure FriendyId defaults are run first.
That said, I would strongly recommend against loading your FactoryGirl definitions all the time. They'll be available in your tests. If you need them in seeds.rb or rake tasks, load them as required. There no reason to do that in production, for example.
Sure, you're right - there's no need to load definitions all the time. Thanks!