don't autoextend methods from modules
we can't detect when a method is added from a module, so make immediate detection work the same way Change-Id: I8558e1fccf14a62d21efcc3108a1fca34f0c2ac4 Reviewed-on: https://gerrit.instructure.com/51799 Reviewed-by: Ethan Vizitei <evizitei@instructure.com> Tested-by: Jenkins Product-Review: Cody Cutrer <cody@instructure.com> QA-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
parent
4e39bcfb76
commit
84f1082b6a
|
@ -96,14 +96,14 @@ module Autoextend
|
||||||
|
|
||||||
def autoextend_singleton(method, feature)
|
def autoextend_singleton(method, feature)
|
||||||
extension = autoextend_method(method, feature, singleton_autoextensions)
|
extension = autoextend_method(method, feature, singleton_autoextensions)
|
||||||
if singleton_class.method_defined?(method)
|
if singleton_class.method_defined?(method) && method(method).owner == singleton_class
|
||||||
extension.extend(singleton_class)
|
extension.extend(singleton_class)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def autoextend(method, feature)
|
def autoextend(method, feature)
|
||||||
extension = autoextend_method(method, feature, autoextensions)
|
extension = autoextend_method(method, feature, autoextensions)
|
||||||
if method_defined?(method)
|
if method_defined?(method) && instance_method(method).owner == self
|
||||||
extension.extend(self)
|
extension.extend(self)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue