Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • 2
    From my understanding I think blid require the file correctly. Otherwise he would not be able to call the regular_method as he said. Commented Aug 23, 2012 at 15:47
  • Yes, my file is loaded, just as Jing Li explained. Commented Aug 23, 2012 at 15:57
  • @blid, could you please provide more details. Coz for me it looks weird, no typo, everything looks good. And as far as I know, there is no way to prevent monkey patching. BTW, you can also try ActiveMerchant::Shipping::UPS.singleton_methods to print out all class methods of UPS, of course in your case it would not contain process_request. Commented Aug 23, 2012 at 16:07
  • @Jing Li: I provided details as you asked, if I can add something more please let me know. Commented Aug 23, 2012 at 16:30
  • Thanks for the details! Unfortunately I still can't see what goes wrong. You show NoMethodError exception coming from irb (rails console?), can you add full backtrace that comes from your controller? It should be in log/development.log. Did you test regular_method in both console and controller? Also, can you show how MyModel.courier_service gets set, and the contents of your plugin's init.rb: plugins/my_plugin/init.rb ? Commented Aug 23, 2012 at 17:06