Extending the Page module with acts_as_taggable

Hi,
I’m trying to extend the Page module with acts_as_taggable, I added a
plugin
under the vendor part with the taggable.rb file and the following files:

page_ex.rb:
class Page
acts_as_taggable
end

and init.rb:
require_dependency ‘page’
require ‘taggable’
require ‘page_ex.rb’

This works in perfectly in production, but breaks in development, in
development the first call to an act_as_taggable fucntion works, but any
call after that gives errors like this:
NoMethodError (undefined method `tag’ for #Page:0x3878520)

I know this is a result of class caching and reloading of the class data
(or
at least I assume this is the reason).

Any ideas of how to solve this in devlopment?

Dror

On 10/08/2006, at 1:53 PM, dror tirosh wrote:

I know this is a result of class caching and reloading of the class
data (or at least I assume this is the reason).

Any ideas of how to solve this in devlopment?

Dror

I was running into this same problem all the time, I just gave up and
put a local version of radiant in my subversion repository, so I could
patch it easily. I remember reading somewhere (I just had a quick look,
but I cant find the reference :frowning: ) that rails plugins are designed to
be used by the application developer, not for patching an application
developed by someone else.

Bodhi

dror tirosh wrote:

This works in perfectly in production, but breaks in development, in
development the first call to an act_as_taggable fucntion works, but any
call after that gives errors like this:
NoMethodError (undefined method `tag’ for #Page:0x3878520)

I will look at trying to fix this when we implement the real plugin
system. For now I’d recommend that you only run in production mode.


John L.
http://wiseheartdesign.com