Module: Babik::QuerySet::Distinguishable

Included in:
AbstractBase
Defined in:
lib/babik/queryset/mixins/distinguishable.rb

Overview

Distinguishable functionality for QuerySet

Instance Method Summary collapse

Instance Method Details

#distinct!QuerySet

Mark this QuerySet as distinguishable. Modify this object (i.e. DISTINCT keyword will be applied to the final SQL query).

Returns:

  • (QuerySet)

    Reference to this QuerySet.



12
13
14
15
# File 'lib/babik/queryset/mixins/distinguishable.rb', line 12

def distinct!
  @_distinct = true
  self
end

#undistinct!QuerySet

Mark this QuerySet as not distinguishable (i.e. DISTINCT keyword will NOT be applied to query).

Returns:

  • (QuerySet)

    Reference to this QuerySet.



20
21
22
23
# File 'lib/babik/queryset/mixins/distinguishable.rb', line 20

def undistinct!
  @_distinct = false
  self
end