Reputation: 6898
I'm making redirecting extension and I'd like to make a decorator for find_page in PagesController in pages extension (to handle redirect if page is not found). Everything works fine if the decorator is in main app. If I put it in my redirect extentension it gets loaded - but the results are inconsistent; sometimes it works, sometimes it doesn't.
My guess is that it has to do with order of loading files, so I tried to require pages extension before loading decorator in my engine - but that didn't help. Any ideas how to do this?
Upvotes: 0
Views: 247
Reputation: 6898
I was able to get this done following advice from Augmenting a model from an external gem -although I had to put actual code in to_prepare in order for it to work always in development mode when classes are reloaded.
Upvotes: 1