class AutomobileActivityYear
Constants
- TABLE_STRUCTURE
Public Class Methods
find_by_closest_year(year)
click to toggle source
Used by Automobile and AutomobileTrip
# File lib/earth/automobile/automobile_activity_year.rb, line 25 def self.find_by_closest_year(year) if year > maximum(:activity_year) where(:activity_year => maximum(:activity_year)).first else where(:activity_year => [year, minimum(:activity_year)].max).first end end