Method: Praxis::Mapper::SequelCompat::ClassMethods#associations

Defined in:
lib/praxis-mapper/sequel_compat.rb

#associationsObject



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/praxis-mapper/sequel_compat.rb', line 25

def associations
  orig = self.association_reflections.clone

  orig.each do |k,v|
    v[:model] = v.associated_class
    if v.respond_to?(:primary_key)
      v[:primary_key] = v.primary_key
    else
      # FIXME: figure out exactly what to do here. 
      # not super critical, as we can't track these associations
      # directly, but it would be nice to traverse these
      # properly.
      v[:primary_key] = :unsupported
    end
  end
  orig
end