Module: NoBrainer::Criteria::Changes

Extended by:
ActiveSupport::Concern
Defined in:
lib/no_brainer/criteria/changes.rb

Instance Method Summary collapse

Instance Method Details

#changes(*args) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/no_brainer/criteria/changes.rb', line 4

def changes(*args)
  return finalized_criteria.changes(*args) unless finalized?

  # We won't do any instantiations with attributes for now.
  raise 'Please use .raw.changes()' unless raw?

  # We can't have implicit sorting as eager streams are not
  # supported by r.changes().
  criteria = self
  criteria = criteria.without_ordering if ordering_mode == :implicit
  run { criteria.to_rql.changes(*args) }
end