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.
B5a793b425c4db1f45c3cdfec5697047?d=identicon&s=25 scott (Guest)
on 2006-06-05 18: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
Cad27a22166c3a46e34da899476ec897?d=identicon&s=25 ryan (Guest)
on 2006-06-05 18: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
42172acdf3c6046f84d644cb0b94642c?d=identicon&s=25 Pat Maddox (pergesu)
on 2006-06-05 18:19
(Received via mailing list)
On 6/5/06, scott <scott@boxuk.com> wrote:
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>

:conditions just throws in a WHERE clause.

@projectReport = Project.find(:all, :conditions => 'status != 7 AND
status > 3')
Cad27a22166c3a46e34da899476ec897?d=identicon&s=25 ryan (Guest)
on 2006-06-05 18: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
59de94a56fd2c198f33d9515d1c05961?d=identicon&s=25 Tom Mornini (Guest)
on 2006-06-05 18: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 Mornini
B5a793b425c4db1f45c3cdfec5697047?d=identicon&s=25 scott (Guest)
on 2006-06-05 18:26
thats great,

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