# Wrap conditions around many find requests

**URL:** <https://www.ruby-forum.com/t/wrap-conditions-around-many-find-requests/89079>\
**Category:** Rails\
**Created:** [March 17, 2007, 12:16am UTC](https://www.ruby-forum.com/t/wrap-conditions-around-many-find-requests/89079 "2007-03-17T00:16:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nathaniel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/ba8739/32.png) [@Nathaniel](https://www.ruby-forum.com/u/Nathaniel)\
**Post date:** [March 17, 2007, 12:16am UTC](https://www.ruby-forum.com/t/wrap-conditions-around-many-find-requests/89079/1 "2007-03-17T00:16:47Z")

</div>

Dear all,

Is it possible to declare Active Record ‘find’ conditions and have these  
‘:conditions’ apply to numerous find queries on a table without having  
to re-declare the conditions on every line where you have a find?

As an example, suppose you have a table of records of users and  
throughout a controller you only want to query records of people who are  
not ‘administrators’

A few months ago, when I read through a draft PDF of Agile Web  
Development with Rails 2nd ed, I seem to remember reading something like  
this…I think it even said you could declare a condition in an ‘around  
filter’ and have it apply to all ‘find’ calls within filtered actions.  
But for the life of me, if it was there I can’t find it in the final  
version.

Thanks, Nat

---

<div class="post-metadata">

**Author:** ![Nathaniel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/ba8739/32.png) [@Nathaniel](https://www.ruby-forum.com/u/Nathaniel)\
**Post date:** [March 17, 2007, 12:44am UTC](https://www.ruby-forum.com/t/wrap-conditions-around-many-find-requests/89079/2 "2007-03-17T00:44:05Z")

</div>

Nat,

I think with\_scope() is what you’re looking for.

–  
Zack C.  
[http://depixelate.com](http://depixelate.com)
