# Query help

**URL:** <https://www.ruby-forum.com/t/query-help/159191>\
**Category:** Rails\
**Created:** [February 2, 2009, 7:38am UTC](https://www.ruby-forum.com/t/query-help/159191 "2009-02-02T07:38:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![newb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/2acd7d/32.png) [@newb](https://www.ruby-forum.com/u/newb)\
**Post date:** [February 2, 2009, 7:38am UTC](https://www.ruby-forum.com/t/query-help/159191/1 "2009-02-02T07:38:26Z")

</div>

hi…  
what does the below code ?  
conditions \<\< “company\_id = #{company\_id}” unless company\_id.nil?

pls explain.  
thank you

---

<div class="post-metadata">

**Author:** ![newb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/2acd7d/32.png) [@newb](https://www.ruby-forum.com/u/newb)\
**Post date:** [February 2, 2009, 12:34pm UTC](https://www.ruby-forum.com/t/query-help/159191/2 "2009-02-02T12:34:44Z")

</div>

Hi,

The question should be “Why is this bad code?”  
The answer for your question is that it append the company\_id to  
the conditions there is a company\_id.

ciao, tom

On Feb 2, 7:38 am, Newb N. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> hi…  
> what does the below code ?  
> conditions \<\< “company\_id = #{company\_id}” unless company\_id.nil?
> 
> ## pls explain. thank you
> 
> Posted viahttp://www.ruby-forum.com/.

–  
Thomas R. “TomK32” Koll \<\> [http://ananasblau.com](http://ananasblau.com)  
just a geek trying to change the world  
[TomK32 (Thomas R. Koll) · GitHub](http://github.com/TomK32)
