I'm trying to create a named_scope for people who were born this
year. I have an application helper method defining "current_year".
So far, I have this, but it's not filtering correctly. I think I need
a BETWEEN, maybe? I know this is something easy I'm just not
seeing... any help is appreciated!
class Person < ActiveRecord::Base
:named_scope :born_this_year, :conditions => {:dob => :current_year}
end
I'm trying to create a named_scope for people who were born this
year. I have an application helper method defining "current_year".
So far, I have this, but it's not filtering correctly. I think I need
a BETWEEN, maybe? I know this is something easy I'm just not
seeing... any help is appreciated!
class Person < ActiveRecord::Base
Have you used a debugger or logging statements to see what the
values of :dob and :current_year are at this point?