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.
9904f8acaf66a3c1a4b4434676be11cf?d=identicon&s=25 John Kopanas (Guest)
on 2006-02-17 17: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 Kopanas
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
821395fe70906c8290df7f18ac4ac6cf?d=identicon&s=25 Rick Olson (Guest)
on 2006-02-17 18:36
(Received via mailing list)
On 2/17/06, John Kopanas <john@protoseinc.com> 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 Kopanas
> 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 Olson
http://techno-weenie.net
9904f8acaf66a3c1a4b4434676be11cf?d=identicon&s=25 John Kopanas (Guest)
on 2006-02-17 20: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 Olson wrote:

>> http://www.kopanas.com
> end
>
> --
> Rick Olson
> http://techno-weenie.net
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails


John Kopanas
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.