Vishwanath Nayak wrote:
> If Area is an model object then you can put it in conditions itself as 
> below
> Area.find :all :conditions => ['name = lower(?)', area_name.down_case]
> 
> Nayak
> 
> On Fri, Jun 19, 2009 at 3:20 PM, Sijo Kg
> <[email protected]>wrote:
> 
>> Posted via http://www.ruby-forum.com/.
>>
>> >
>>
> 
> 
> --
> - NAYAK

Champs ..
Above both are not working ..
May be u people are not getting me properly .. :)
Sorry, Area is an model object ..
I had tried these four .. But none of them are working fine for 
"Area.exists? (:name => area_name)"

1) Area.find(:all, :conditions => ['name = lower(?)', 
area_name.downcase])
2) Area.find (:all).collect{|a| 
a.name.downcase}.include?(area_name.downcase)
3) Area.find(:all, :conditions => "name LIKE '%#{:name => area_name }'")
4) Area.exists?(['name LIKE ?', "%#{:name => area_name}%"])

Any other way .. ?

Thanks for yours response Champs .. Coming good .. :)
-- 
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