Acts_as_versioned and acts_as_taggable on same model?


#1

I am trying to use acts_as_versioned and acts_as_taggable (plugin) on
the exact same model. Has anyone successfuly done this? I think
what I need to do is make model_versions acts_as_taggable instead of
my main model. Anyone have any other suggestions or any suggestions
how to do this?

Your Friend,

John K.
http://www.kopanas.com

=====================================================================
http://www.soen.info - source of the freshest software engineering
information on the net
http://cusec.soen.info - software engineering conference


#2

On 2/17/06, John K. removed_email_address@domain.invalid wrote:

I am trying to use acts_as_versioned and acts_as_taggable (plugin) on
the exact same model. Has anyone successfuly done this? I think
what I need to do is make model_versions acts_as_taggable instead of
my main model. Anyone have any other suggestions or any suggestions
how to do this?

Your Friend,

John K.
http://www.kopanas.com

What problems are you having? If you want acts_as_taggable on both
your versioned and your regular model, do this:

class Foo << AR::Base
acts_as_versioned do
def self.included(base)
base.acts_as_taggable
end
end
end


Rick O.
http://techno-weenie.net


#3

The problem is that when I do:

n = Note.find(1)
n.tag_with(“Introduction, XML, HTTP”)
n.tags

n.tags results in [] because n.tags checks note_versions and not note
model which tag_with associates the tags to.

So I need n.tags to check for tags on notes and not note_versions.

Any clue how I would do this?

On 17-Feb-06, at 12:36 PM, Rick O. wrote:

http://www.kopanas.com
end


Rick O.
http://techno-weenie.net


Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails

John K.
http://www.kopanas.com

=====================================================================
http://www.soen.info - source of the freshest software engineering
information on the net
http://cusec.soen.info - software engineering conference