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