acts-as-taggable-on icon indicating copy to clipboard operation
acts-as-taggable-on copied to clipboard

tag_list attribute is nil

Open cromulus opened this issue 4 years ago • 3 comments

Hello! Rails 6.0 acts-as-taggable-on: 6.5.0

I have a taggable model, "Person", which I want to serialize to json. when I access tag_list as an attribute on an instance of "Person" seems to be empty, even though both the instance has been tagged and the cached_tag_list is up to date.

i.e.:

@person=Person.new()
@person.tag_list.add('foobar')
@person.save
attributes = @person.attributes
nil == attributes.tag_list # this is true
['foobar'] == @person.tag_list  # this is also true

Is this the expected behavior?

I'm a huge fan of this gem. Use it in almost all of my projects. Truly appreciate all of the work that goes into it. Thanks!

cromulus avatar Feb 01 '21 19:02 cromulus

Have you tried upgrading to 7.0.0?

Merovex avatar Mar 18 '21 21:03 Merovex

Have you tried upgrading to 7.0.0?

Same problem image

mario-amazing avatar Apr 29 '21 07:04 mario-amazing

Just confirming that this is an issue with v9 as well. I could possible find some time to look into it, assuming that these attributes should be present.

bcasci avatar Jun 17 '23 14:06 bcasci