# Problem with alias\_method in a plugin

**URL:** <https://www.ruby-forum.com/t/problem-with-alias-method-in-a-plugin/138264>\
**Category:** Rails\
**Created:** [May 21, 2008, 3:18pm UTC](https://www.ruby-forum.com/t/problem-with-alias-method-in-a-plugin/138264 "2008-05-21T15:18:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![g0nzo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/3bc359/32.png) [@g0nzo](https://www.ruby-forum.com/u/g0nzo)\
**Post date:** [May 21, 2008, 3:18pm UTC](https://www.ruby-forum.com/t/problem-with-alias-method-in-a-plugin/138264/1 "2008-05-21T15:18:55Z")

</div>

Hi,

I’m doing my first plugin, based on attachment\_fu structure. Here’s  
the code: [Parked at Loopia](http://pastie.caboo.se/200797).

The problem is that the meta\_tag method doesn’t seem to be  
overwritten.

I can call model\_instance.original\_meta\_tag and it return same thing  
as model\_instance.meta\_tag, so the aliasing works.  
I can call model\_instance.foo and it correctly returns class of the  
model, so instance method also works.

I’ve set breakpoints on both methods (meta\_tag and foo) - calling  
model\_instance.meta\_tag doesn’t trigger debugger and  
model\_instance.foo triggers debugger. So the redefined meta\_tag method  
is not called at all.

If I copy all this code (has\_one, alias\_method and redefine meta\_tag)  
directly into the model it works fine.

Any ideas?
