# :condition not being applied

**URL:** <https://www.ruby-forum.com/t/condition-not-being-applied/98929>\
**Category:** Rails\
**Created:** [January 30, 2006, 6:44pm UTC](https://www.ruby-forum.com/t/condition-not-being-applied/98929 "2006-01-30T18:44:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![softwareengineer\_99](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b782af/32.png) [@softwareengineer\_99](https://www.ruby-forum.com/u/softwareengineer_99)\
**Post date:** [January 30, 2006, 6:44pm UTC](https://www.ruby-forum.com/t/condition-not-being-applied/98929/1 "2006-01-30T18:44:12Z")

</div>

I am using acts\_as\_taggable and everything seems to be working except  
that

:condition =\> “tags\_resources.portal\_id=#{portal\_id}”

is not being applied.

```
  @resource_pages = Paginator.new self, 

```

Resource.find\_tagged\_with(:any =\> tag, :condition =\>  
“tags\_resources.portal\_id=#{portal\_id}”).length, 25, @params[‘page’];  
@resources = Resource.find\_tagged\_with( :any =\> tag, :condition  
=\> “tags\_resources.portal\_id=#{portal\_id}”, :separator=\> ’ ',  
:limit =\> “#{@resource\_pages.current.to\_sql[1]},  
#{@resource\_pages.current.to\_sql[0]}”);

I have two Active Record classes, Resource and Tag.

Can anyone please tell what am I missing here?

Many thanks in advance.  
Frank

---

<div class="post-metadata">

**Author:** ![softwareengineer\_99](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b782af/32.png) [@softwareengineer\_99](https://www.ruby-forum.com/u/softwareengineer_99)\
**Post date:** [January 30, 2006, 6:53pm UTC](https://www.ruby-forum.com/t/condition-not-being-applied/98929/2 "2006-01-30T18:53:20Z")

</div>

I believe it should be :conditions plural, no :condition singular.

cheers  
Gerret

---

<div class="post-metadata">

**Author:** ![softwareengineer\_99](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b782af/32.png) [@softwareengineer\_99](https://www.ruby-forum.com/u/softwareengineer_99)\
**Post date:** [January 30, 2006, 7:05pm UTC](https://www.ruby-forum.com/t/condition-not-being-applied/98929/3 "2006-01-30T19:05:34Z")

</div>

Thanks Gerret, for saving the day.

At [taggable.rubyforge.org](http://taggable.rubyforge.org), I was following this example:

Person.find\_tagged\_with(:any =\> ‘wine’, :condition =\>  
“tags\_people.created\_by\_id = 1 AND tags\_people.position = 1”)

Cheers

Frank  
Gerret A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote: I believe it should be  
:conditions plural, no :condition singular.

cheers  
Gerret
