Sha256: a7edb6ca678f5577b2f3532fcc37d76390de7d82031a7cc6076f3b5a285956f3

Contents?: true

Size: 653 Bytes

Versions: 3

Compression:

Stored size: 653 Bytes

Contents

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

module SyncMachine
  module OrmAdapters
    # Adapt generic SyncMachine functionality to ActiveRecord.
    module ActiveRecordAdapter
      def self.change_listener_changed_keys(record)
        record.previous_changes.keys
      end

      def self.record_id_for_job(record_id)
        record_id
      end

      def self.sufficient_changes_to_find_subjects?(record)
        change_listener_changed_keys(record).present?
      end
    end
  end
end

Wisper::ActiveRecord.extend_all

Version data entries

3 entries across 3 versions & 1 rubygems

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