lib/synchronisable/synchronizer.rb in synchronisable-1.0.7 vs lib/synchronisable/synchronizer.rb in synchronisable-1.0.8
- old
+ new
@@ -16,9 +16,12 @@
SYMBOL_ARRAY_CONVERTER = ->(source) { (source || []).map(&:to_s) }
# The name of remote `id` attribute.
attribute :remote_id, default: :id
+ # The unique id to prevent sync of duplicate records.
+ attribute :unique_id
+
# Mapping configuration between local model attributes and
# its remote counterpart (including id attribute).
attribute :mappings, converter: ->(source) {
source.try(:with_indifferent_access)
}