mbleigh / acts-as-taggable-on

A tagging plugin for Rails applications that allows for custom tagging along dynamic contexts.
http://mbleigh.lighthouseapp.com/projects/10116-acts-as-taggable-on
MIT License
4.98k stars 1.19k forks source link

Loads all tags/taggings on taggable object load after upgrading to v6.0.0 #926

Open colemerrick opened 6 years ago

colemerrick commented 6 years ago

Previously, when loading a taggable object, it's tags did not load. After upgrading to v6.0.0, whenever a taggable object is loaded, all it's tags are also loaded (and consequently all it's taggings). This is a huge performance hit.

I can't find anywhere in the commit history where this functionality was adopted as a feature although a similar feature had been requested in the past: #91. Therefore, I am calling this a bug.

If for some reason I am missing something, and this was a finished feature, then we need to create some way of opting out. Thoughts?

amaierhofer commented 4 years ago

We observed similar behavior and pinned it down to a devise, serializing all attributes when inspecting the object.

We were able to remove the noise when running in the rails console by including tag_list in the the blacklist (Devise::Models::Authenticatable::BLACKLIST_FOR_SERIALIZATION << :tag_list).

The issue did not occur when loading models during a web request.

colemerrick commented 4 years ago

@amaierhofer That sounds like a devise issue. We forked this lib and we're able to get rid of it.

cpjolicoeur commented 3 years ago

@colemerrick Just seeing this thread now. I looked at the forked version in your repository but didn't see any associated changes/fixes for this. Maybe I misunderstood your last comment (from Feb 19, 2020), but do you have a commit/fix for this issue?

ggladden commented 3 years ago

I'm wondering if there is a fix for this too? I see the issue when fragment/russian doll caching taggable records. I verified it doesn't happen in version 5.0.0, but it appears to have been introduced in version 6.0.0. I'm able to reproduce it in version 8.1.0.