Module: FactoryGirl::Syntax::Blueprint::ActiveRecord::ClassMethods Private

Defined in:
lib/factory_girl/syntax/blueprint.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#blueprint(&block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



27
28
29
30
31
32
33
# File 'lib/factory_girl/syntax/blueprint.rb', line 27

def blueprint(&block)
  ActiveSupport::Deprecation.warn 'Model.blueprint is deprecated; use the FactoryGirl.define syntax instead', caller
  instance = Factory.new(name.underscore, class: self)
  proxy = FactoryGirl::DefinitionProxy.new(instance)
  proxy.instance_eval(&block)
  FactoryGirl.register_factory(instance)
end