Judging from the following code, this should work. The only possible
gotcha is that the factory_girl class will still have the name
Factory.
class Factory
def self.say_me
'FactoryGirl'
end
end
factory_girl = Factory.new
FactoryGirl = Factory
Object.send(:remove_const, :Factory)
class Factory
def self.say_me
'Factory'
end
end
factory = Factory.new
puts factory_girl.class.object_id
=> 83340
puts factory.class.object_id
=> 83270
puts factory_girl.class
=> Factory
puts factory.class
=> Factory
puts FactoryGirl.say_me
=> FactoryGirl
puts Factory.say_me
=> Factory
puts factory_girl.class.say_me
=> FactoryGirl
puts factory.class.say_me
=> Factory
///ark