Need help with a possible patch

5 views
Skip to first unread message

Zach Moazeni

unread,
Apr 13, 2011, 12:14:19 PM4/13/11
to factory_girl
Hey guys,

I have an odd issue with an interplay between Spork + FactoryGirl on
Rails3 and 1.9.2. When defining factories with the form of :class =>
"SomeNamespace::SomeClass" FactoryGirl doesn't do the right thing when
resolving the constant. It throws a strange "constant is missing"
error. When defining the factory in the form of :class =>
SomeNamespace::SomeClass, everything is dandy because it relies on
Rails' dependency detection.

I found the area in the codebase that has the problem:
https://github.com/thoughtbot/factory_girl/blob/master/lib/factory_girl/factory.rb#L145
. Apparently the code needs to be firing a cont_missing directly. So I
wrote a commit to https://github.com/zmoazeni/factory_girl/commit/457c667ca285a53960fc60ab97c8a2c364764673
and all the tests are still green.

What confuses me is that I can't seem to write a red/green scenario
for this. I know this works because I can monkey patch FactoryGirl for
our project. And it is essentially a port of
https://github.com/rails/rails/blob/master/activesupport/lib/active_support/inflector/methods.rb#L107

Does anyone have any advice on how to move forward on submitting this
to the maintainers in a not-so-gut-feeling way?
Reply all
Reply to author
Forward
0 new messages