In Rails3 how do I retrieve all records that have a date of this year? I d like to retrieve all my "Projects" where the "date" is this year.
我怀疑那会跟...
@projects_this_year = Project.where(:date.Time.year == Time.now.year)
or
@projects_this_year = Project.where(:date >= ?, Time.now.year)
我在看医生 但还没弄清楚