Module: BrighterPlanet::Automobile::Relationships

Defined in:
lib/automobile/relationships.rb

Class Method Summary collapse

Class Method Details

.included(target) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/automobile/relationships.rb', line 4

def self.included(target)
  target.belongs_to :make,                    :class_name => 'AutomobileMake',                 :foreign_key => 'make_name'
  target.belongs_to :make_year,               :class_name => 'AutomobileMakeYear',             :foreign_key => 'make_year_name'
  target.belongs_to :make_model,              :class_name => 'AutomobileMakeModel',            :foreign_key => 'make_model_name'
  target.belongs_to :make_model_year,         :class_name => 'AutomobileMakeModelYear',        :foreign_key => 'make_model_year_name'
  target.belongs_to :make_model_year_variant, :class_name => 'AutomobileMakeModelYearVariant', :foreign_key => 'make_model_year_variant_row_hash'
  target.belongs_to :fuel_type,               :class_name => 'AutomobileFuelType',             :foreign_key => 'fuel_type_code'
  target.belongs_to :size_class,              :class_name => 'AutomobileSizeClass'
end