lib/mongoid/association/referenced/syncable.rb
# Set up the sync of inverse keys that needs to happen on a destroy.
#
# @example Set up the destroy syncing.
#   Person.synced_destroy(association)
#
# @param [ Association ] association The association metadata.
#
# @return [ Class ] The class getting set up.
Set up the sync of inverse keys that needs to happen on a destroy.
Set up the sync of inverse keys that needs to happen on a destroy .
def synced_destroy(association)
            set_callback(
                :destroy,
                :after
            ) do |doc|
              doc.remove_inverse_keys(association)
            end
            self
          end
def synced_destroy ( association ) set_callback ( :destroy , :after ) do | doc | doc . remove_inverse_keys ( association ) end self end
Set up the sync of inverse keys that needs to happen on a destroy.
Set up the sync of inverse keys that needs to happen on a destroy .
The class getting set up.
The class getting set up .
 Class 
association
<not_specific>
<not_specific>
association The association metadata.
association The association metadata .
example
Set up the destroy syncing. Person.synced_destroy(association)
Set up the destroy syncing . Person . synced_destroy ( association )