Forum: Ruby on Rails acts_as_versioned and acts_as_taggable on same model?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
John K. (Guest)
on 2006-02-17 18:35
(Received via mailing list)
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
Rick O. (Guest)
on 2006-02-17 19:36
(Received via mailing list)
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
John K. (Guest)
on 2006-02-17 21:35
(Received via mailing list)
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
This topic is locked and can not be replied to.