module Replication

Constants

VERSION

Public Class Methods

defaults() click to toggle source
# File lib/replication.rb, line 22
def self.defaults
  defaults = {
    only: [],
    except: []
  }
  defaults.merge!({
    strand_class: ::Replication::ActiveRecord::PolymorphicStrand,
    except: [:id, :created_at, :updated_at]
  }) if defined?(ActiveRecord)

  defaults
end
extended(model_class) click to toggle source
# File lib/replication.rb, line 35
def self.extended(model_class)
  return if model_class.respond_to?(:can_replicate)
  model_class.class_eval do
    extend Process
    @replication_config = Class.new(Config).new(self)
    include Model
  end
end
included(model_class) click to toggle source

Include or extend it. We work with both.

# File lib/replication.rb, line 45
def self.included(model_class)
  model_class.extend self
end