Class: Ripple::Conflict::BasicResolver

Inherits:
Object
  • Object
show all
Defined in:
lib/ripple/conflict/basic_resolver.rb

Instance Method Summary collapse

Constructor Details

#initialize(main_resolver) ⇒ BasicResolver

Returns a new instance of BasicResolver.



6
7
8
# File 'lib/ripple/conflict/basic_resolver.rb', line 6

def initialize(main_resolver)
  @main_resolver = main_resolver
end

Instance Method Details

#performObject



22
23
24
25
26
27
# File 'lib/ripple/conflict/basic_resolver.rb', line 22

def perform
  process_properties
  process_embedded_associations
  process_linked_associations
  process_stored_key_associations
end

#remaining_conflictsObject



10
11
12
# File 'lib/ripple/conflict/basic_resolver.rb', line 10

def remaining_conflicts
  @remaining_conflicts ||= []
end

#unexpected_conflictsObject



14
15
16
17
18
19
20
# File 'lib/ripple/conflict/basic_resolver.rb', line 14

def unexpected_conflicts
  # if the user didn't specify the conflict they expect,
  # then don't consider any conflicts unexpected
  return [] if model_class.expected_conflicts.blank?

  remaining_conflicts - model_class.expected_conflicts
end