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.
Thanks again! :D On 21 sep, 21:29, Aldric Giacomoni <[email protected]> wrote: > It depends how it' stored in the Database. > If it is stored in a string of format 'MM/DD', then I'd probably do > something like this: > > def find_birthdays > mmdd = Date.today.to_s.gsub('-', '/')[5..9] > @birthdays = Birthday.find :all, :conditions => ['b_date like ?', > mmdd] > end > > Just make sure the month and day are always two digits. > And there might be a smarter way to do it than using gsub, but I don't > know it off-hand. > -- > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---

