Module: Rexport::DataFields::ClassMethods

Defined in:
lib/rexport/data_fields.rb

Instance Method Summary collapse

Instance Method Details

#get_klass_from_associations(*associations) ⇒ Object

Returns the associated class by following the chain of associations



9
10
11
12
13
14
# File 'lib/rexport/data_fields.rb', line 9

def get_klass_from_associations(*associations)
  associations.flatten!
  return self if associations.empty?

  reflect_on_association(associations.shift.to_sym).klass.get_klass_from_associations(associations)
end