Module: ReactiveRecord::UnscopedCollection

Defined in:
lib/reactive_record/active_record/reactive_record/unscoped_collection.rb

Overview

The base collection class works with relationships method overrides for the unscoped collection

Instance Method Summary collapse

Instance Method Details



5
6
7
8
# File 'lib/reactive_record/active_record/reactive_record/unscoped_collection.rb', line 5

def set_pre_sync_related_records(related_records, _record = nil)
  @pre_sync_related_records = related_records
  live_scopes.each { |scope| scope.set_pre_sync_related_records(@pre_sync_related_records) }
end

#sync_scopes(related_records, record, filtering = true) ⇒ Object



10
11
12
13
14
# File 'lib/reactive_record/active_record/reactive_record/unscoped_collection.rb', line 10

def sync_scopes(related_records, record, filtering = true)
  live_scopes.each { |scope| scope.sync_scopes(related_records, record, filtering) }
ensure
  @pre_sync_related_records = nil
end