Module: Babik::QuerySet::SetOperations

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

Overview

Set operations over QuerySets

Instance Method Summary collapse

Instance Method Details

#difference(other_queryset) ⇒ Babik::QuerySet::Except

Difference (minus) operation

Parameters:

  • other_queryset (QuerySet)

    Other QuerySet

Returns:



11
12
13
# File 'lib/babik/queryset/mixins/set_operations.rb', line 11

def difference(other_queryset)
  Babik::QuerySet::Except.new(self.model, self, other_queryset)
end

#intersection(other_queryset) ⇒ Babik::QuerySet::Intersect

Intersection (except) operation

Parameters:

  • other_queryset (QuerySet)

    Other QuerySet

Returns:



18
19
20
# File 'lib/babik/queryset/mixins/set_operations.rb', line 18

def intersection(other_queryset)
  Babik::QuerySet::Intersect.new(self.model, self, other_queryset)
end

#union(other_queryset) ⇒ Babik::QuerySet::Union

Union operation

Parameters:

  • other_queryset (QuerySet)

    Other QuerySet

Returns:



25
26
27
# File 'lib/babik/queryset/mixins/set_operations.rb', line 25

def union(other_queryset)
  Babik::QuerySet::Union.new(self.model, self, other_queryset)
end