# Detecting acts\_as\_x?

**URL:** <https://www.ruby-forum.com/t/detecting-acts-as-x/161403>\
**Category:** Rails\
**Created:** [February 26, 2009, 8:34am UTC](https://www.ruby-forum.com/t/detecting-acts-as-x/161403 "2009-02-26T08:34:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [February 26, 2009, 8:34am UTC](https://www.ruby-forum.com/t/detecting-acts-as-x/161403/1 "2009-02-26T08:34:03Z")

</div>

I’m writing an acts\_as\_x type plugin/gem and I need to know how to  
detect which other acts\_as plugins are installed so I can avoid name  
conflicts. What’s a simple way to do this?

Thanks

John S.

---

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [February 26, 2009, 9:36am UTC](https://www.ruby-forum.com/t/detecting-acts-as-x/161403/2 "2009-02-26T09:36:31Z")

</div>

On Feb 26, 7:34 am, John S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I’m writing an acts\_as\_x type plugin/gem and I need to know how to  
> detect which other acts\_as plugins are installed so I can avoid name  
> conflicts. What’s a simple way to do this?

Well there’s not much in the way of conventions or ways to list other  
installed plugins. You may find the easiest way is to namespace your  
stuff (so install of having MyAwesomeModule make it  
YourOrganisation::MyAwesomeModule), but as far as you and some other  
plugin both adding an acts\_as\_foo method you’re probably out of luck.  
You can find out if the method you are about to add is already there,  
but depending on plugin load order you might load before the  
conflicting plugin.

Fred

---

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [February 26, 2009, 10:44am UTC](https://www.ruby-forum.com/t/detecting-acts-as-x/161403/3 "2009-02-26T10:44:22Z")

</div>

Frederick C. wrote:

> On Feb 26, 7:34ï¿½am, John S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> wrote:
> 
> > I’m writing an acts\_as\_x type plugin/gem and I need to know how to  
> > detect which other acts\_as plugins are installed so I can avoid name  
> > conflicts. What’s a simple way to do this?
> 
> Well there’s not much in the way of conventions or ways to list other  
> installed plugins. You may find the easiest way is to namespace your  
> stuff (so install of having MyAwesomeModule make it  
> YourOrganisation::MyAwesomeModule), but as far as you and some other  
> plugin both adding an acts\_as\_foo method you’re probably out of luck.  
> You can find out if the method you are about to add is already there,  
> but depending on plugin load order you might load before the  
> conflicting plugin.
> 
> Fred  
> I rather thought that might be the case, I’ll name space myself and add  
> a switch to the initialization to determine whether to use probably  
> unique but awkward method names or simpler but probably conflicting  
> method names.
