@people = Person.find(:all, :conditions => ['parent_id = :parent_id', params[:person]])
I would like to integrate an age range condition based on birthdate as well. I figure in the model I can write something like:
def minimum_age_conditions
["people.birthdate <= ?", Date.today - minimum_age.years] unless minimum_age.blank?
end
def maximum_age_conditions
["people.birthdate >= ?", Date.tomorrow - (maximum_age+1).years] unless maximum_age.blank?
end
So how can I link the controller conditions to these methods in the model? Or is it better to place these all in the conditions part of the find?