sorry , conditions should be hash

Post.find(:first,:conditions=>[ 'status like ? and active like ?', 1, 1])


On Sun, Jul 12, 2009 at 5:14 PM, Narendra sisodiya <[email protected]
> wrote:

> I never used but
>
> this may work Post.find(:first,:conditions[ 'status like ? and active like
> ?', 1, 1])
>
>
> On Sun, Jul 12, 2009 at 5:07 PM, Rails List <
> [email protected]> wrote:
>
>>
>> Recently I read that the following find
>>
>> Type 1
>> ------
>> Post.find(:first, :conditions => ['status = ? and active = ?', 1, 1])
>>
>> can be written as
>>
>> Type 2
>> ------
>> Post.find(:first, :conditions => { :status => 1, :active => 1 })
>>
>>
>> But how do I include LIKE operator in Type 2 find?
>>
>> thanks
>> --
>> Posted via http://www.ruby-forum.com/.
>>
>> >>
>>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to