Update factory.rb

Ruby 1.9.3 doesn't allow sub to run on a symbol.