class Mhc::Sync::Strategy::Mirror
-
Mirror
side1 to side2simply follow the rule on the table below:
Side 2
|—
---------
———-------------
———|
S | | M | U | N | D | i |—---------
———-------------
———| d | M | OW 1->2 | OW 1->2 | CP 1->2 | CP 1->2 | e | U | OW 1->2 | – | ?? – | CP 1->2 | 1 | N | DEL 2 | ?? – | – | – |
| D | DEL 2 | DEL 2 | -- | -- | |---+---------+----------+------------+---------| + M :: Modified (or Created) + U :: Unchanged + N :: No Record + D :: Deleted + -- :: No operation (ignore) + ?? :: Not occurred in normal cases + OW :: Overwrite + CP :: Copy + DEL :: Delete
Public Instance Methods
whatnow(side1, side2)
click to toggle source
# File lib/mhc/sync/strategy.rb, line 207 def whatnow(side1, side2) actions = { "MM" => :overwrite1_to_2, "MU" => :overwrite1_to_2, "MN" => :copy1_to_2, "MD" => :copy1_to_2, "UM" => :overwrite1_to_2, "UU" => :ignore, "UN" => :ignore, "UD" => :copy1_to_2, "NM" => :delete2, "NU" => :ignore, "NN" => :ignore, "ND" => :ignore, "DM" => :delete2, "DU" => :delete2, "DN" => :ignore, "DD" => :ignore, } return actions[status_pair(side1, side2)] end