Skip to content

Commit

Permalink
only remove if defined
Browse files Browse the repository at this point in the history
  • Loading branch information
brettlangdon committed Apr 17, 2019
1 parent 323c004 commit 7eb728e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/ddtrace/analytics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ module InstanceMethodsCompatibility
def self.included(base)
base.class_eval do
alias_method :set_tag_without_analytics, :set_tag
remove_method :set_tag
# DEV: When we stack multiple extensions the method might already be removed
remove_method :set_tag if method_defined?(:set_tag)
end
end

Expand Down
3 changes: 2 additions & 1 deletion lib/ddtrace/forced_tracing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ module InstanceMethodsCompatibility
def self.included(base)
base.class_eval do
alias_method :set_tag_without_forced_tracing, :set_tag
remove_method :set_tag
# DEV: When we stack multiple extensions the method might already be removed
remove_method :set_tag if method_defined?(:set_tag)
end
end

Expand Down

0 comments on commit 7eb728e

Please sign in to comment.