# Need help with extending a plugin

**URL:** <https://www.ruby-forum.com/t/need-help-with-extending-a-plugin/175328>\
**Category:** Rails\
**Created:** [September 11, 2009, 10:59am UTC](https://www.ruby-forum.com/t/need-help-with-extending-a-plugin/175328 "2009-09-11T10:59:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmaxvv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/85f322/32.png) [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Post date:** [September 11, 2009, 10:59am UTC](https://www.ruby-forum.com/t/need-help-with-extending-a-plugin/175328/1 "2009-09-11T10:59:34Z")

</div>

hey folks

I’ve installed the plugin acts\_as\_taggable\_on\_steroids (henceforth  
aatos), and i already have some tagging functionality set up, using the  
same approach (ie a Tag and a Tagging class with associated tables) as  
aatos.

So, i want my existing Tag and Taggings methods, plus some other methods  
i have in a module which i include with the taggable classes (ie the  
ones that would call acts\_as\_taggable now) to be overlaid on top of the  
aatos ones (i’ll probably end up deleting some of them because they  
replicate aatos methods).

I’ve got part of the way there by basically moving my own methods into a  
lib file (taggable\_extensions.rb) which mirrors the acts\_as\_x plugin  
setup, and so in my taggable classes i now say

acts\_as\_taggable  
include TaggableExtensions

This is fine for those classes, although it would be nice if there was  
some way i could get aatos to automatically use these exensions without  
going in and hacking the plugin.

However, i’m not sure what to do with my Tag and Tagging class methods.  
Should i put those in the same module, in taggable\_extensions? If so  
then how do i get them to be loaded? I guess these two questions are  
the same, ie “Can i push some modules into a plugin on startup without  
changing the plugin code?”

I have the feeling i’m missing something obvious and i can just push  
everything in taggable\_extensions into the aatos plugin, from inside  
taggable\_extensions. I just don’t know how.

Here’s what my current taggable\_extensions.rb looks like

module ActiveRecord  
module Acts

```
module TaggableExtras
  def self.included(base)
    base.extend(ClassMethods)
  end

  module ClassMethods
    def acts_as_taggable_extras(options = {})
      include ActiveRecord::Acts::TaggableExtras::InstanceMethods
      extend ActiveRecord::Acts::TaggableExtras::SingletonMethods
    end
  end

  module SingletonMethods
    #nothing here yet
  end

  module InstanceMethods
    #...some instance methods here, added to taggables
  end

end

```

end  
end
