module NoBrainer::Criteria::Changes

Public Instance Methods

changes(*args) click to toggle source
# 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