Ruby Forum Ruby on Rails > ActiveRecord class method count issues

Posted by Drew Olson (dfg59)
on 06.03.2007 19:23
All -

I'm using ActiveRecord outside of the rails framework and I'm having an
issue using the class method count. I'm connected to an Oracle 10g
database and my find commands are working fine:

Employee.find(:first) -> Gives me the first record just as expected

However, when I try:

Employee.count

I get the following error:

irb(main):004:0> Employee.count
ActiveRecord::ConnectionNotEstablished:
ActiveRecord::ConnectionNotEstablished

I literally did these lines one after another in the same irb session.
Bizarre...

Thanks,
Drew
Posted by Earle Clubb (eclubb)
on 30.04.2008 22:15
Drew Olson wrote:
> All -
> 
> I'm using ActiveRecord outside of the rails framework and I'm having an
> issue using the class method count. I'm connected to an Oracle 10g
> database and my find commands are working fine:
> 
> Employee.find(:first) -> Gives me the first record just as expected
> 
> However, when I try:
> 
> Employee.count
> 
> I get the following error:
> 
> irb(main):004:0> Employee.count
> ActiveRecord::ConnectionNotEstablished:
> ActiveRecord::ConnectionNotEstablished
> 
> I literally did these lines one after another in the same irb session.
> Bizarre...
> 
> Thanks,
> Drew


I'm having the same problem.  Did you ever find a solution?

Earle