Forum: Ruby on Rails apply more than one condition to a find(:all

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.
scott (Guest)
on 2006-06-05 20:10
Hi

I have the find statement below, how can I apply another condition to
this to say AND status > 3

@projectReport = Project.find(:all, :conditions => 'status != 7')

Thanks
scott
ryan (Guest)
on 2006-06-05 20:18
@projectReport = Project.find(:all, :conditions => 'status != 7 AND
active = 1')

scott wrote:
> Hi
>
> I have the find statement below, how can I apply another condition to
> this to say AND status > 3
>
> @projectReport = Project.find(:all, :conditions => 'status != 7')
>
> Thanks
> scott
Pat M. (Guest)
on 2006-06-05 20:19
(Received via mailing list)
On 6/5/06, scott <removed_email_address@domain.invalid> wrote:
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
>

:conditions just throws in a WHERE clause.

@projectReport = Project.find(:all, :conditions => 'status != 7 AND
status > 3')
ryan (Guest)
on 2006-06-05 20:20
Sorry, I didn't see the specific thing you wanted to do

 @projectReport = Project.find(:all, :conditions => 'status != 7 AND
status > 3')

ryan wrote:
> @projectReport = Project.find(:all, :conditions => 'status != 7 AND
> active = 1')
>
> scott wrote:
>> Hi
>>
>> I have the find statement below, how can I apply another condition to
>> this to say AND status > 3
>>
>> @projectReport = Project.find(:all, :conditions => 'status != 7')
>>
>> Thanks
>> scott
Tom M. (Guest)
on 2006-06-05 20:22
(Received via mailing list)
On Jun 5, 2006, at 9:10 AM, scott wrote:

> I have the find statement below, how can I apply another condition to
> this to say AND status > 3
>
> @projectReport = Project.find(:all, :conditions => 'status != 7')

   @projectReport = Project.find(:all, :conditions => 'status != 7
and status > 3')

:-)

--
-- Tom M.
scott (Guest)
on 2006-06-05 20:26
thats great,

thanks
This topic is locked and can not be replied to.