Skip to content

Instantly share code, notes, and snippets.

/ruby.rb Secret

Created June 26, 2017 05:27
Show Gist options
  • Save anonymous/fa0c46b950e17ff2d191f3ba89ec00ed to your computer and use it in GitHub Desktop.
Save anonymous/fa0c46b950e17ff2d191f3ba89ec00ed to your computer and use it in GitHub Desktop.
module MyPatch
def find(name, prefixes = [], partial = false, keys = [], options = {})
raise "MyPatch_find"
end
end
ActionView::LookupContext::ViewPaths.prepend MyPatch
ActionView::LookupContext::ViewPaths.ancestors
# => [MyPatch, ActionView::LookupContext::ViewPaths]
self.class
# => ActionView::LookupContext
self.find("foo")
# => DOES NOT RAISE "MyPatch_find"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment