Forum: Ruby on Rails Query help

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3083ca8f0496edaac2fa10c20630d0bc?d=identicon&s=25 Newb Newb (newb)
on 2009-02-02 07:38
hi..
what does the below code ?
conditions << "company_id = #{company_id}" unless company_id.nil?


pls explain.
thank you
978ed7ca309d5495078702096f9add03?d=identicon&s=25 Thomas r. Koll (tomk32)
on 2009-02-02 12:34
(Received via mailing list)
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 Newb <rails-mailing-l...@andreas-s.net> 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
just a geek trying to change the world
http://github.com/TomK32
This topic is locked and can not be replied to.