Sha256: abeea12967e2dab348578219df6cfd1a8f6ac2bd9173a2c7e090a09c2188dc39

Contents?: true

Size: 661 Bytes

Versions: 15

Compression:

Stored size: 661 Bytes

Contents

require 'factory_girl'
require 'factory_girl_rails/generator'
require 'rails'

module FactoryGirl
  class Railtie < Rails::Railtie

    initializer "factory_girl.set_fixture_replacement" do
      FactoryGirlRails::Generator.new(config).run
    end

    initializer "factory_girl.set_factory_paths" do
      FactoryGirl.definition_file_paths = [
        Rails.root.join('factories'),
        Rails.root.join('test', 'factories'),
        Rails.root.join('spec', 'factories')
      ]
    end

    config.after_initialize do
      FactoryGirl.find_definitions

      if defined?(Spring)
        Spring.after_fork { FactoryGirl.reload }
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 6 rubygems

Version Path
ffactory_girl_rails-4.8.3 lib/factory_girl_rails/railtie.rb
ffactory_girl_rails-4.8.2 lib/factory_girl_rails/railtie.rb
factory_girl_rails-4.9.0 lib/factory_girl_rails/railtie.rb
ffactory_girl_rails-4.8.0 lib/factory_girl_rails/railtie.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/factory_girl_rails-4.8.0/lib/factory_girl_rails/railtie.rb
factory_girl_rails-4.8.0 lib/factory_girl_rails/railtie.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/factory_girl_rails-4.7.0/lib/factory_girl_rails/railtie.rb
factory_girl_rails-4.7.0 lib/factory_girl_rails/railtie.rb
factory_girl_rails-4.6.0 lib/factory_girl_rails/railtie.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/factory_girl_rails-4.5.0/lib/factory_girl_rails/railtie.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/factory_girl_rails-4.5.0/lib/factory_girl_rails/railtie.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/factory_girl_rails-4.5.0/lib/factory_girl_rails/railtie.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/factory_girl_rails-4.5.0/lib/factory_girl_rails/railtie.rb
factory_girl_rails-4.5.0 lib/factory_girl_rails/railtie.rb
factory_girl_rails-4.4.1 lib/factory_girl_rails/railtie.rb