mirror of
https://github.com/thoughtbot/factory_bot.git
synced 2022-11-09 11:43:51 -05:00
parent
7e41f4f327
commit
80f0fd2adc
2 changed files with 5 additions and 5 deletions
|
@ -41,7 +41,7 @@ module FactoryGirl
|
|||
|
||||
module ClassMethods
|
||||
def generate(overrides = {}, &block)
|
||||
ActiveSupport::Deprecation.warn 'Model.generate is deprecated; use the FactoryGirl.define syntax instead', caller
|
||||
ActiveSupport::Deprecation.warn 'Model.generate is deprecated; use FactoryGirl.build(:name) instead.', caller
|
||||
instance = FactoryRunner.new(name.underscore, :build, [overrides]).run
|
||||
instance.save
|
||||
yield(instance) if block_given?
|
||||
|
@ -49,14 +49,14 @@ module FactoryGirl
|
|||
end
|
||||
|
||||
def generate!(overrides = {}, &block)
|
||||
ActiveSupport::Deprecation.warn 'Model.generate! is deprecated; use the FactoryGirl.define syntax instead', caller
|
||||
ActiveSupport::Deprecation.warn 'Model.generate! is deprecated; use FactoryGirl.create(:name) instead.', caller
|
||||
instance = FactoryRunner.new(name.underscore, :create, [overrides]).run
|
||||
yield(instance) if block_given?
|
||||
instance
|
||||
end
|
||||
|
||||
def spawn(overrides = {}, &block)
|
||||
ActiveSupport::Deprecation.warn 'Model.spawn is deprecated; use the FactoryGirl.define syntax instead', caller
|
||||
ActiveSupport::Deprecation.warn 'Model.spawn is deprecated; use FactoryGirl.build(:name) instead.', caller
|
||||
instance = FactoryRunner.new(name.underscore, :build, [overrides]).run
|
||||
yield(instance) if block_given?
|
||||
instance
|
||||
|
|
|
@ -27,12 +27,12 @@ module FactoryGirl
|
|||
|
||||
module ClassMethods
|
||||
def make(overrides = {})
|
||||
ActiveSupport::Deprecation.warn 'Model.make is deprecated; use the FactoryGirl.define syntax instead', caller
|
||||
ActiveSupport::Deprecation.warn 'Model.make is deprecated; use FactoryGirl.build(:model) instead.', caller
|
||||
FactoryRunner.new(name.underscore, :build, [overrides]).run
|
||||
end
|
||||
|
||||
def make!(overrides = {})
|
||||
ActiveSupport::Deprecation.warn 'Model.make! is deprecated; use the FactoryGirl.define syntax instead', caller
|
||||
ActiveSupport::Deprecation.warn 'Model.make! is deprecated; use FactoryGirl.create(:model) instead.', caller
|
||||
FactoryRunner.new(name.underscore, :create, [overrides]).run
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue