On 20 Jan 2009, at 20:48, David Law wrote:

>

>
>
> Here you can see the method inherited has been aliased to
> inherited_with_facebooker and inherited_without_facebooker has been
> aliased to inherited.  However, when the method is called
> inherited_without_facebooker goes into an endless recursive call which
> results in a stack level too deep error.  I tried to prevent
> alias_method_chain from being called twice (which is what I suspect
> the problem being) by checking if inherited_with_facebooker already
> exists.  It has not seemed to fix the problem.  Does anyone else have
> a possible solution I may try.  Thanks again!
>

You're in the right mindset but you haven't got you're check quite  
right. You ask whether the object ActionController::Base (ie the  
class) responds to that method and it doesn't so that will always   
return false. What you want is whether instances of that class  
respond_to your method (so this is the same as  
String.respond_to? :strip returning false, "".respond_to? :strip  
returns true)

Fred

>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to