# CGI anomaly associated with access to a Rails Active Record outside of rails

**URL:** <https://www.ruby-forum.com/t/cgi-anomaly-associated-with-access-to-a-rails-active-record-outside-of-rails/143069>\
**Category:** Ruby\
**Created:** [July 14, 2008, 10:50pm UTC](https://www.ruby-forum.com/t/cgi-anomaly-associated-with-access-to-a-rails-active-record-outside-of-rails/143069 "2008-07-14T22:50:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xeno\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/958977/32.png) [@Xeno\_C](https://www.ruby-forum.com/u/Xeno_C)\
**Post date:** [July 14, 2008, 10:50pm UTC](https://www.ruby-forum.com/t/cgi-anomaly-associated-with-access-to-a-rails-active-record-outside-of-rails/143069/1 "2008-07-14T22:50:32Z")

</div>

So, I’m not sure I will have the energy to do other than just mention  
this with barely specific details, and I already understand that this  
kind of thing is expected to be a little ticklish at this time, but…

1. I’m using a non-mod\_ruby application for internal services which  
also  
accesses data from a Rails app through a call to active\_record, all of  
which mostly seems to work.

2. I tried, for organizational purposes, embedding the include .rb file  
that includes cgi for my app inside an include file which is inside  
another include file, which was one more such level lower than before.  
This caused the Query strings stuff to no longer be available to me in  
my $CGIo object I was making. I tried a number of variations, but the  
two common things that fixed it were either taking out the active record  
connection call, or moving the include file that instantiates $CGIo =  
cgi.new to at least one level less deep.

So, I guess I’m only including this for now for use by the devs and  
warning to the group. For all I know I’m the only one foolhardy enough  
to be doing this kind of thing at this time, but still, it may be  
interesting.

Best wishes.

Sincerely, Xeno  
xc

---

<div class="post-metadata">

**Author:** ![Xeno\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/958977/32.png) [@Xeno\_C](https://www.ruby-forum.com/u/Xeno_C)\
**Post date:** [July 18, 2008, 6:38am UTC](https://www.ruby-forum.com/t/cgi-anomaly-associated-with-access-to-a-rails-active-record-outside-of-rails/143069/2 "2008-07-18T06:38:58Z")

</div>

Xeno C. wrote:  
Followup on this, though instantiation / object variables initiated in  
the constructor failed at lower levels, a class variable from the base  
does fine all the time.
