How to extend action-like-taggable-on

I recently replaced act_as_taggable_on_steroids act_as_taggable_on in my application and I continue to run into a problem when the rails cannot find the class associated with the new plugin. I think this is because I use the desert plugin and have extended some of the classes that exist in both act_as_taggable_on and act_as_taggable_on_steroids plugins. I think the desert incorrectly extends the new plugin classes. Does anyone know what could be? I noticed that the structure of the act_as_taggable_on plugin is different. Basically I get this error:

Constant TagList from tag_list.rb not found

to fix this, I included ActsAsTaggable in the intruder controller. Once I do this, I cannot access any methods that I wrote in m rewritten models.

+3
source share
1 answer

When you extend the base class or the plugin class, you need to manually require the file in which you made the extensions (unless they were named after the rails autoload conventions). And from within this file, you need a file with the original class definition. Perhaps this solves your problem.

0
source

Source: https://habr.com/ru/post/1758841/


All Articles