Re: Cannot seem to include my own module & classes into Rails ap

Michael Guterl
Mon, 03 Aug 2009 02:13:42 -0000

Doug Livesey wrote:
> Hi -- I''ve got a class called SF::SOAP that gets defined at
> /lib/wsdl/sandbox/defaultDriver.rb
> It is defined like:
>
>   module SF
>     class SOAP
>       # ...
>     end
>   end
>
> How do I include this in my Rails app so that I can (for instance) call
> SF::SOAP.new without getting an unintitialised constant (for SF) error?
> I''ve tried direct requires, adding to the config.load_paths in the
> environment files, adding to the $: array, all to no avail.
> I did something similar years ago, but I''m damn''ed if I
can remember
> how, so any help would be very gratefully received.

Rails'' dependency loading mechanism will automatically pick up SF::Soap
if it is in the following location: /lib/sf/soap.rb

Best,
Michael Guterl