Forum: Ruby on Rails baffling undefined method

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Bfccdb1c41c334fec20e5ede3a7ccfcc?d=identicon&s=25 Andrew Roth (andrewroth)
on 2007-04-16 21:44
(Received via mailing list)
I have a model

class Person < CimHrdb
  belongs_to :local_province, :foreign_key =>
"person_local_province_id", :class_name => "Province"

(where CimHrdb extends some classes (with abstract_class = true) that
eventually extend ActiveRecord::Base)

and I'm getting

A NoMethodError occurred in reports#crisis_management:

 undefined method `local_province' for #<Person:0x40eec754>
1799:in `method_missing'

The confusing thing is that it happens every once in a while.  It's
not every time.  I can't figure out why.  It seems to not set up the
local_province method at times.  This is on a production mongrel
server, btw.

-Andrew Roth
Bfccdb1c41c334fec20e5ede3a7ccfcc?d=identicon&s=25 Andrew Roth (andrewroth)
on 2007-04-20 23:16
(Received via mailing list)
Just wanted to follow up on this.  I found out that it's because one
of my log/ files got erased, so when mongrel was
restarting, it couldn't kill one of them.  Then it kept running with
old classes loaded.  So one of my three mongrels had old classes
loaded, explaining why it only happened sometimes.

This topic is locked and can not be replied to.