Evet, ben de ºöyle bir yol izledim:
def yarr(args = {})
args.map {|k, v| "(LOWER(#{k}) = LOWER(#{v}))"}.join (" AND ")
end
Foo.find(:all, :conditions => yarr(:username => "this"))
ama hala postgre'nin bi select case-insensitive mod'unun olmasi gerektigi dusuncesindeyim :)
kolay gelsin
----- Original Message ----
From: Murat Arif ÇEL©KER <murat.celiker@gmail.com>
To: linux-programlama@liste.linux.org.tr
Sent: Sunday, November 4, 2007 6:21:17 PM
Subject: [Linux-programlama] Re: Postgresql - select case insensitive
Postgresql harici ActiveRecord taraf¹nda ºu ºekilde bir yol izleyerek istenilen sonuca ulaºabilirsiniz:
app/models/user.rb
def self.find_by_username(username)
find(:first, :conditions => ['lower(username) = lower(?)', username])
end
--
- - - - - - - - - - - - - - - - - - - - - -
Murat Ârif ÇEL©KER < http://www.ikinoktayazilim.com/wordpress >
Bursa, Türkiye
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
Linux-programlama mailing list
Linux-programlama_at_liste.linux.org.tr
http://liste.linux.org.tr/mailman/listinfo/linux-programlama
Received on Tue 06 Nov 2007 - 08:53:04 EET