def log_replication_outcome(winner, diff)
options = rep_helper.options_for_table(diff.changes[:left].table)
option_values = [options[:logged_replication_events]].flatten
if diff.type == :conflict
return unless option_values.include?(:all_conflicts) or option_values.include?(:ignored_conflicts)
return if winner != :ignore and not option_values.include?(:all_conflicts)
outcome = {:left => 'left_won', :right => 'right_won', :ignore => 'ignored'}[winner]
else
return unless option_values.include?(:all_changes) or option_values.include?(:ignored_changes)
return if winner != :ignore and not option_values.include?(:all_changes)
outcome = winner == :ignore ? 'ignored' : 'replicated'
end
rep_helper.log_replication_outcome diff, outcome
end