Permalink
Browse files

Fix deprecation messages

Closes #375
  • Loading branch information...
1 parent 7e41f4f commit 80f0fd2adce0e6d3a8f4ed5fc715d972e81089f3 @joshuaclayton joshuaclayton committed May 11, 2012
Showing with 5 additions and 5 deletions.
  1. +3 −3 lib/factory_girl/syntax/generate.rb
  2. +2 −2 lib/factory_girl/syntax/make.rb
@@ -41,22 +41,22 @@ def self.included(base)
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?
instance
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 @@ def self.included(base)
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

0 comments on commit 80f0fd2

Please sign in to comment.