# Condition metadata / dyanmic conditions

**URL:** <https://www.ruby-forum.com/t/condition-metadata-dyanmic-conditions/155453>\
**Category:** Rails\
**Created:** [December 11, 2008, 10:00pm UTC](https://www.ruby-forum.com/t/condition-metadata-dyanmic-conditions/155453 "2008-12-11T22:00:24Z")\
**Posts on this page:** 2\
**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:** [December 11, 2008, 10:00pm UTC](https://www.ruby-forum.com/t/condition-metadata-dyanmic-conditions/155453/1 "2008-12-11T22:00:24Z")

</div>

Hello,

Is there a plugin / gem out there that would help me construct a dynamic  
set of conditions for a finder?

In other words, I have a user with multiple attributes (some 50+). I  
have other users that want to express preferences for befriending users  
based on criteria (which I’d like to store) such as specific interests,  
personality types, etc. (both values, ranges)

The scenario I’m confused about is how do you construct the finder for  
something like this

User.find(:all, :conditions =\> [“not sure what goes here because it’ll  
be different for each user”,  
current\_user.preferences.attributes.collect(&:id)])

you get the idea …

Thank you.

---

<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:** [December 11, 2008, 10:03pm UTC](https://www.ruby-forum.com/t/condition-metadata-dyanmic-conditions/155453/2 "2008-12-11T22:03:37Z")

</div>

You could try ambition → [http://ambition.rubyforge.org/](http://ambition.rubyforge.org/)

- 

Maurício Linhares  
[http://alinhavado.wordpress.com/](http://alinhavado.wordpress.com/) (pt-br) | [http://blog.codevader.com/](http://blog.codevader.com/)  
(en)

On Thu, Dec 11, 2008 at 6:00 PM, Grayson P.
