super won't work here because the method isn't defined on a parent of
Person, it's defined on person itself. So what's happening is that
the call to method missing is generating a *new* implementation of
find_by_name which simply does the find, without your changes.
We could fix this for rails 3.0 by moving those generated methods from
Person to a module included in person, but for 2.3 you'll have to do
as Ryan suggests and use aliasing, or just call
all(:conditions=>{:first_name=>params.first}) instead of super.
--
Cheers
Koz
>
> I just wanted a :before_find hook, saw the mail history from here
> during 2006 and they said do
>
> def find
> # Before Find.
> super
> # After Find
> end
>
> But now we know how that turns out.
>
> Ultimately it isn't important to my app, but it would be nice when me
> or users forget trailing .s
>
You might also want to think about doing this in a before_filter;
cleaning trailing spaces off of request parameters feels pretty
controller-y to me.
--Matt Jones