Permalink
Browse files

Revert "Deprecate attributes_for and build_stubbed"

This reverts commit a883315.
  • Loading branch information...
1 parent 5780364 commit 2d6adfd009f51fa8ed6c57434dca93e8ff5b05ff @joshuaclayton joshuaclayton committed Jan 20, 2012
Showing with 0 additions and 18 deletions.
  1. +0 −10 lib/factory_girl/syntax/methods.rb
  2. +0 −8 lib/factory_girl/syntax/vintage.rb
@@ -5,10 +5,6 @@ module Methods
# can be individually overridden by passing in a Hash of attribute => value
# pairs.
#
- # DEPRECATED
- #
- # Use build or create instead, calling attributes on the result
- #
# Arguments:
# * name: +Symbol+ or +String+
# The name of the factory that should be used.
@@ -22,7 +18,6 @@ module Methods
# A set of attributes that can be used to build an instance of the class
# this factory generates.
def attributes_for(name, *traits_and_overrides, &block)
- $stderr.puts "DEPRECATION WARNING: FactoryGirl.attributes_for is deprecated; use FactoryGirl.build or FactoryGirl.create and call #attributes on the result instead."
run_factory_girl_proxy(name, traits_and_overrides, Proxy::AttributesFor, &block)
end
@@ -72,10 +67,6 @@ def create(name, *traits_and_overrides, &block)
# stubbed out. Attributes can be individually overridden by passing in a Hash
# of attribute => value pairs.
#
- # DEPRECATED
- #
- # Use build instead
- #
# Arguments:
# * name: +Symbol+ or +String+
# The name of the factory that should be used.
@@ -88,7 +79,6 @@ def create(name, *traits_and_overrides, &block)
# Returns: +Object+
# An object with generated attributes stubbed out.
def build_stubbed(name, *traits_and_overrides, &block)
- $stderr.puts "DEPRECATION WARNING: FactoryGirl.build_stubbed is deprecated; use FactoryGirl.build instead."
run_factory_girl_proxy(name, traits_and_overrides, Proxy::Stub, &block)
end
@@ -110,10 +110,6 @@ def self.alias(pattern, replace)
end
# Alias for FactoryGirl.attributes_for
- #
- # DEPRECATED
- #
- # Use build or create instead, calling attributes on the result
def self.attributes_for(name, overrides = {})
FactoryGirl.attributes_for(name, overrides)
end
@@ -129,10 +125,6 @@ def self.create(name, overrides = {})
end
# Alias for FactoryGirl.build_stubbed.
- #
- # DEPRECATED
- #
- # Use build instead
def self.stub(name, overrides = {})
FactoryGirl.build_stubbed(name, overrides)
end

1 comment on commit 2d6adfd

Thank you thank you thank you!

Just for future reference: In addition to the complaint regarding #attributes_for and nil values (here), replacing #build_stubbed with #build was unsatisfactory because the later does not set the "id" attribute, so resulting objects are useless for url_for helpers.

Please sign in to comment.