Hi,
First, I'm not sure if the term is overwritting, or reloading, or
reopening the class, sorry if I'm wrong.
Andrei (also in this list) and me are trying to migrate tog (http://
www.toghq.com) from rails 2.2.x + desert 0.3.x to rails 2.3 + desert
0.5. We are almost done, but we are hitting a wall we can solve by
ourselves. I'm going to trry to explain the scenario, so you can
understand it properly. We didn't have this problem with the previous
versions (rails 2.2 + desert 0.3.x). It also seems to work as expected
with rails 2.2.x + desert 0.5
1.- We have a plugin that defines the model "user" (user.rb).
2.- Another plugin, defines model "profile" (profile.rb), and
redefines/overwrittes "user.rb" to add a has_one relationships
(has_one :profile).
And this works as expected using Rails 2.2.x. We can use user.profile
anywhere and it works.
The problem comes when, while using Rails 2.3, we try to ovewrite the
model profile.rb in the host app (directly in the app, altough it
could also happen in a third plugin) to add some new features (in
fact, just an empty profile.rb prodeces this error). As soon as we add
a profile.rb to the app, we get an exception while trying to get
user's profile.
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.include?
(the errors refer tothe call: user.profile)
I suppose it has something to do with relationships reloading in rails
2.3, but before going deeper, I suppose you guys has problably faced
this problem and have a fix or workaround for it.
Any ideas?.