Guest User

Untitled

a guest
Jun 26th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.38 KB | None | 0 0
  1. module MyPatch
  2.   def find(name, prefixes = [], partial = false, keys = [], options = {})
  3.     raise "MyPatch_find"
  4.   end
  5. end
  6.  
  7. ActionView::LookupContext::ViewPaths.prepend MyPatch
  8.  
  9. ActionView::LookupContext::ViewPaths.ancestors
  10. # => [MyPatch, ActionView::LookupContext::ViewPaths]
  11.  
  12. self.class
  13. # => ActionView::LookupContext
  14.  
  15. self.find("foo")
  16. # => DOES NOT RAISE "MyPatch_find"
Add Comment
Please, Sign In to add comment