juanmac wrote:
> Thanks!
>
> I did it that way Aldric. It seems to be the better way. I will have a
> lots of rows in the database, so I wanted to boost the performance.
> That's why I want only to retrieve the specific day.
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}] .
>
> Thanks again! :D
>
> On 21 sep, 21:29, Aldric Giacomoni <[email protected]>
Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
--
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
-~----------~----~----~----~------~----~------~--~---