I have a problem that surfaced in my attempt to upgrade my application
to Rails 1.1.
We have a STI model on the “belongs_to” side of a has_many/belongs_to
relationship. All my unit tests for this model pass, and the
relationships all seem to work fine.
But in my functional tests, I’m getting errors. I’ve traced it back
into the call to the has_many association returning nil (To put it in
familiar terms, this is like author.posts returning nil). I was under
the impression that a call to something like author.posts would NEVER
return nil, you would just get an empty array. In either case, it’s
bad, because in my functional test, it should be getting at least one
“post” back.
Does anyone have any insight here? I’ve been banging my head against a
brick wall for a couple of days now, and I’m about ready to give up.
–
Lori O.
http://blog.dragonsharp.com