# Baffling undefined method

**URL:** <https://www.ruby-forum.com/t/baffling-undefined-method/92175>\
**Category:** Rails\
**Created:** [April 16, 2007, 9:44pm UTC](https://www.ruby-forum.com/t/baffling-undefined-method/92175 "2007-04-16T21:44:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![arjackson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/57b2e6/32.png) [@arjackson](https://www.ruby-forum.com/u/arjackson)\
**Post date:** [April 16, 2007, 9:44pm UTC](https://www.ruby-forum.com/t/baffling-undefined-method/92175/1 "2007-04-16T21:44:33Z")

</div>

I have a model

class Person \< CimHrdb  
…  
belongs\_to :local\_province, :foreign\_key =\>  
“person\_local\_province\_id”, :class\_name =\> “Province”  
…  
end

(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> [RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/base.rb: 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 R.

---

<div class="post-metadata">

**Author:** ![arjackson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/57b2e6/32.png) [@arjackson](https://www.ruby-forum.com/u/arjackson)\
**Post date:** [April 20, 2007, 11:16pm UTC](https://www.ruby-forum.com/t/baffling-undefined-method/92175/2 "2007-04-20T23:16:09Z")

</div>

Just wanted to follow up on this. I found out that it’s because one  
of my log/mongrel.pid 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.

-Andrew
