# Custom finder method & arguments

**URL:** <https://www.ruby-forum.com/t/custom-finder-method-arguments/132681>\
**Category:** Rails\
**Created:** [March 23, 2008, 7:31am UTC](https://www.ruby-forum.com/t/custom-finder-method-arguments/132681 "2008-03-23T07:31:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![grayson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/c77e96/32.png) [@grayson](https://www.ruby-forum.com/u/grayson)\
**Post date:** [March 23, 2008, 7:31am UTC](https://www.ruby-forum.com/t/custom-finder-method-arguments/132681/1 "2008-03-23T07:31:43Z")

</div>

I’m wondering if it’s possible to pass an argument to a custom finder  
method when working with cache\_fu. The excellent “Advanced Rails  
Recipes” book has the following example:

The custom finder method in the model wasnâ€™t changed? Thatâ€™s right!  
The cache\_fu plugin offers a number of really sweet features, and one of  
our favorites is being able to pass a method name to the cached method  
and have the result cached. For example, now over in our controller we  
can use User.cached(:find\_latest):

@users = User.cached(:find\_latest)

How can I do it so that find\_latest actually has an argument like

def self.find\_latest(geography)

and then do

@users = User.cached(:find\_latest(‘North America’))

Thanks.
