You will need to break the date because you want to ignore the year. You will need to use some of the functions provided by your SQL provider (the example below uses MySQL):
bdays = Soldier.find(:all, :conditions => ["DAY(birth_date) = ? AND MONTH(birth_date) = ?", Date.today.day, Date.today.month])
if you use SQLite (the default database is rails), it will be a little more complicated because they do not have a real date type:
bdays = Soldier.find(:all, :conditions => ["STRFTIME('%d', birth_date) = ? AND STRFTIME('%m', birth_date) = ?", Date.today.day, Date.today.month])
source share