Marnen Laibow-Koser wrote:

> 
> It's not a good idea to store dates in the DB as strings.  You should 
> store dates as dates in the DB.  SQL has date handling functions that 
> you can use, so what you might want is something like :conditions => 
> ['day(b_date) = :day and month(b_date) = :month', {:day => 
> Date.today.day, :month => Date.today.month}] .
> 

Marnen is right, mind you. If you store a year with it, you have access 
to all the Rails date manipulation methods, as well as those of the 
database. It's better practice, and more convenient.
-- 
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