On 1/16/08, Mark Wilden <[EMAIL PROTECTED]> wrote:
>

> I must be missing something, because I don't see how the "manual" method
> could be overwritten. The creation of the dynamic finder happens in
> method_missing, which wouldn't be called if the method existed, right?

Right, if the method exists then method_missing won't be called.  And
that's what's causing the observed behavior.

Initially, he has his hard coded find_by_ip method which gets called.
This calls super
No super method for find_by_ip is found, so method_missing gets called.

In Rails < 2.0 the dynamic finder methods implementation was inside of
method_missing, and afterwards there would still be no find_by_ip and
so it would go.

In Rails 2.0 the method_missing method dynamically adds a find_by_ip
method, which overwrites the hard coded one (not I said overwrites
rather than overrides).  So the next time, his method  is no longer
there to do the parameter conversion thing.

-- 
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" 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-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to