lib/contrast/utils/assess/propagation_method_utils.rb in contrast-agent-5.3.0 vs lib/contrast/utils/assess/propagation_method_utils.rb in contrast-agent-6.0.0
- old
+ new
@@ -8,10 +8,11 @@
# and some other module methods from the same place, so we can ease the main module
module PropagationMethodUtils
APPEND_ACTION = 'APPEND'
CENTER_ACTION = 'CENTER'
INSERT_ACTION = 'INSERT'
+ BUFFER_ACTION = 'BUFFER'
KEEP_ACTION = 'KEEP'
NEXT_ACTION = 'NEXT'
NOOP_ACTION = 'NOOP'
PREPEND_ACTION = 'PREPEND'
REPLACE_ACTION = 'REPLACE'
@@ -28,10 +29,11 @@
APPEND_ACTION => Contrast::Agent::Assess::Policy::Propagator::Append,
CENTER_ACTION => Contrast::Agent::Assess::Policy::Propagator::Center,
INSERT_ACTION => Contrast::Agent::Assess::Policy::Propagator::Insert,
KEEP_ACTION => Contrast::Agent::Assess::Policy::Propagator::Keep,
NEXT_ACTION => Contrast::Agent::Assess::Policy::Propagator::Next,
+ BUFFER_ACTION => Contrast::Agent::Assess::Policy::Propagator::Buffer,
NOOP_ACTION => nil,
PREPEND_ACTION => Contrast::Agent::Assess::Policy::Propagator::Prepend,
REPLACE_ACTION => Contrast::Agent::Assess::Policy::Propagator::Replace,
REMOVE_ACTION => Contrast::Agent::Assess::Policy::Propagator::Remove,
REVERSE_ACTION => Contrast::Agent::Assess::Policy::Propagator::Reverse,
@@ -92,9 +94,13 @@
# @param target [Object] the thing to which to propagate
# @return [Boolean]
def can_propagate? propagation_node, preshift, target
return false unless appropriate_target?(propagation_node, target)
return true if Contrast::Utils::Assess::TrackingUtil.tracked?(target)
+ if propagation_node.use_original_object?
+ # return true since we don't have preshift while using the original object.
+ return true
+ end
return false unless preshift
propagation_node.sources.each do |source|
case source
when Contrast::Utils::ObjectShare::OBJECT_KEY