Class RR::ReplicationDifference
In: lib/rubyrep/replication_difference.rb
Parent: Object

Describes a (record specific) difference between both databases as identifed via change log.

Methods

amend   changes   load   loaded?   new   session   to_yaml_properties  

Constants

OTHER_SIDE = { :left => :right, :right => :left   Shortcut to calculate the "other" database.
DIFF_TYPES = { :insert => {:insert => :conflict, :update => :conflict, :delete => :conflict, :no_change => :left}, :update => {:insert => :conflict, :update => :conflict, :delete => :conflict, :no_change => :left}, :delete => {:insert => :conflict, :update => :conflict, :delete => :no_change, :no_change => :left}, :no_change => {:insert => :right, :update => :right, :delete => :right, :no_change => :no_change}   Resulting diff type based on types of left changes (outer hash) and right changes (inner hash)

External Aliases

second_chance -> second_chance?

Attributes

loaded  [W]  Should be set to true if this ReplicationDifference instance was successfully loaded.
loaders  [RW]  The current LoggedChangeLoaders instance
second_chance  [RW]  Is set to true if first replication attempt failed but it should be tried again later
type  [RW]  The type of the difference. Either
  • :left: change in left database
  • :right: change in right database
  • :conflict: change in both databases
  • :no_diff: changes in both databases constitute no difference

Public Class methods

Creates a new ReplicationDifference instance. loaders is teh current LoggedChangeLoaders instance

Public Instance methods

Amends a difference according to new entries in the change log table

A hash with keys :left and / or :right. Hash values are LoggedChange instances.

Loads a difference

Returns true if a replication difference was loaded

The current Session.

Prevents session and change loaders from going into YAML output

[Validate]