I have a model X with an attribute thedate of type datetime.
What is the slickest way to make thedate's year available for dynamic finders?
Examples:
X.find_by_year(2012)
X.find_by_location_and_year('here', 2012)
X.find_by_year_and_name(2012, 'name')
X.find_all_by_year(2012)
...
So far I found this custom finder approach, but apparently that would require to implement each and every desired method manually. I want to avoid that.