Module: Praxis::Mapper::SequelCompat::ClassMethods

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

Instance Method Summary collapse

Instance Method Details

#_field_selector_query_builder_classObject



24
25
26
# File 'lib/praxis/mapper/sequel_compat.rb', line 24

def _field_selector_query_builder_class
  Praxis::Extensions::FieldSelection::SequelQuerySelector
end

#_filter_query_builder_classObject



19
20
21
22
# File 'lib/praxis/mapper/sequel_compat.rb', line 19

def _filter_query_builder_class
  # TODO: refactor the query builder, and add the explicit require in this file
  Praxis::Extensions::SequelFilterQueryBuilder
end

#_pagination_query_builder_classObject



28
29
30
# File 'lib/praxis/mapper/sequel_compat.rb', line 28

def _pagination_query_builder_class
  Praxis::Extensions::Pagination::SequelPaginationHandler
end

#_praxis_associationsObject



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/praxis/mapper/sequel_compat.rb', line 32

def _praxis_associations
  orig = association_reflections.clone
  orig.each do |_k, v|
    v[:model] = v.associated_class
    v[:local_key_columns] = local_columns_used_for_the_association(v[:type], v)
    v[:remote_key_columns] = remote_columns_used_for_the_association(v[:type], v)
    v[:primary_key] = if v.respond_to?(: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.
                        :unsupported
                      end
  end
  orig
end