I suppose you could do a
unless defined? RAILS_ROOT
# Do non Rails code
end
Martin
On 2 dec 2005, at 16.19, Phil Swenson wrote:
> Is there a good way to see if a class is being executed inside
> rails? I have common code that isn’t always run from inside rails,
> if it’s not using rails I need to establish an active record
> connection manually. Is there a good way to see if the application
> is rails?
>
>
>
> Thanks,
>
> phil
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails