Open meesterdude opened 12 years ago
Noticed this too.
It seems if you use:
Tagger.tag(item, :with => tags, :on => :tags)
It creates a taggings that is assigned to the tagger, and correctly attaches the item being tagged.
The problem is though, that it doesn't update the item's tag_list.
If I tag one acts_as_taggable model via a tagger model, I can call
Tagger.owned_tags
item.tagged_with(tags)
item.tags
but item.tag_list
will be empty.
If I update item.tag_list
to equal available on item.tags
, I end up with multiple taggings
rows in the db for the same taggable_id
and tag_id
, one of whom have a null tagger_id
, and one of whom will have the Tagger.id
as tagger_id
.
I don't know if this is intentional behavior, but it seems odd.
+1
This inconsistency must be removed. Or atleast the tag_list method must accept some parameters to pull all the tags (irrespective of the tagger id)
When object.build()
is called from a chained object that is set to acts_as_tagger
it is creating the object with tagger_id
and tagger_type
set to nil
- It should set these with the acts_as_tagger
objects ID.
In my case, I was using @user.tag() as well to add relationship. I was trying to list the items sorted by tag using @marks = current_user.marks.tagged_with(@tag)
and it would show two iterations for each mark because there were two taggings. For the time being I've fixed this by doing @marks = current_user.marks.tagged_with(@tag, :owned_by => current_user)
instead. I scanned all throughout the cost trying to find what is executed when doing a model.build(), though being a novice, was to no avail.
I've noticed some inconsistency when querying, between using tagger and normal assignment (i.e. u.tag(u) vs. u.music_list=)
I made a user model, with ordered tags, taggers, and predefined contexts music and movies. if i have two users, m and u, and m tags u with some music, it doesn't show up under u.music. this is likewise if u assigns u music in this way. but if u assigns it as music_list then u.musiclist shows the ones assigned, but still not the other ones.
I see the sql for u.music_list looks like
note the
should it not be null OR current user id at the least? is there a reason its like this?