acts-as-taggable-on
acts-as-taggable-on copied to clipboard
How to use cache appropriately?
Hi @mbleigh,
First of all, I want to thank you for the wonderful library.
Forgive me to ask a dumb question. How to use cache appropriately?
I followed this https://github.com/mbleigh/acts-as-taggable-on/wiki/Caching to create cached tags. I also finished the migration. However, I don't know what is the correct way to use the cached tag.
I can use the cached_<somename>_list field directly. But I don't feel like it is the right way to do it.
I'm assuming that just use the library the normal way, and it will automatically query cached_<somename>_list first, before doing anything else.
Is my assumption wrong?
Thank you for your time, and have a nice day ahead!
Tom
it's the right way to do it.
if you call the @model.cached_<column_name>_list, it'll get the record from the column.
no extra query to ActAsTaggableOn table.
you are doing the right thing 🍻