So in my current Rails project we're using acts-as-taggable-on.
There are many accounts in the system and each account has many events.
Event is the parent object for a bunch of other things like sessions_descriptions and venues. These things can be tagged and the tags need to be owned by the event so as to not bleed over into another event's tag cloud.
acts-as-taggable-on has support for this. From it's readme some sample code:
class User < ActiveRecord::Base
class Photo < ActiveRecord::Base
@some_user.tag(@some_photo, :with => "paris, normandy", :on => :locations)
The problem I'm experiencing is that when I call a method like this it is causing a .save method to be called on @some_photo. This screws me over since I'd pref to keep track of a transient string to manage the human editable tag list and execute the official tagging after_save -- but if doing the official tagging in after_save causes a save I end up with a execution loop and crash Ruby (or throw a more friendly exception on Ruby 1.9.3).
I don't think observers would help me since they sit atop the save callbacks too.
I feel like this is a bug in acts-as-taggable-on (in that using the .tag() method causes a side effect .save to be called on the passed in attributes but I'm hopeful to work around it if I can cause there don't seem to be alot of other tagging modules being actively worked on and I'd pref not to write my own.
Any feedback or suggestions welcome.
@zorn i will add skip_save option, so save will be skipped and you will be able to perform that when you want.
Cool. That's pretty much what I did in my fork.
#208 added skip_save for .tag