Sha256: 149401773d587a85ecd55d99cb8686255f3593907a7bba70caea826c60ef1994

Contents?: true

Size: 586 Bytes

Versions: 3

Compression:

Stored size: 586 Bytes

Contents

begin
  require 'wisper/mongoid'
rescue LoadError
  Kernel.abort(
    "Please install the fhwang-wisper-mongoid gem when using SyncMachine with Mongoid."
  )
end

module SyncMachine
  module OrmAdapters
    # Adapt generic SyncMachine functionality to Mongoid.
    module MongoidAdapter
      def self.change_listener_changed_keys(record)
        record.changes.keys
      end

      def self.record_id_for_job(record_id)
        record_id.to_s
      end

      def self.sufficient_changes_to_find_subjects?(_record)
        true
      end
    end
  end
end

Wisper::Mongoid.extend_all

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sync_machine-1.1.1 lib/sync_machine/orm_adapters/mongoid_adapter.rb
sync_machine-1.1.0 lib/sync_machine/orm_adapters/mongoid_adapter.rb
sync_machine-1.0.0 lib/sync_machine/orm_adapters/mongoid_adapter.rb