module Mongoid::Relations::Synchronization::ClassMethods

Public Instance Methods

synced(metadata) click to toggle source

Set up the syncing of many to many foreign keys.

@example Set up the syncing.

Person.synced(metadata)

@param [ Metadata ] metadata The relation metadata.

@since 2.1.0

# File lib/mongoid/relations/synchronization.rb, line 112
def synced(metadata)
  unless metadata.forced_nil_inverse?
    synced_save(metadata)
    synced_destroy(metadata)
  end
end