Lost associations

I have a plugin which does something like this for different
associations:

belongs_to_klass.send(:belongs_to, belongs_to_name)

This works fine for the first page request in mongrel/webrick, but the
associations are lost on/by the next page request. Any ideas?

Thanks :o)

Matthew P. wrote:

I have a plugin which does something like this for different
associations:

belongs_to_klass.send(:belongs_to, belongs_to_name)

This works fine for the first page request in mongrel/webrick, but the
associations are lost on/by the next page request. Any ideas?

Thanks :o)

Heh, thought of the answer just after posting! In environment.rb, this
was the case:

config.cache_classes = false

So the classes were being scrubbed, but the plugin was not being called
again.

On 2006-09-20, at 13:18 , Matthew P. wrote:

I have a plugin which does something like this for different
associations:

belongs_to_klass.send(:belongs_to, belongs_to_name)

This works fine for the first page request in mongrel/webrick, but the
associations are lost on/by the next page request. Any ideas?

Test with the production environment. If it works there, then it’s a
problem with class reloading that happens in the development
environment.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs