# Rails caching model

**URL:** <https://www.ruby-forum.com/t/rails-caching-model/87554>\
**Category:** Rails\
**Created:** [March 3, 2007, 8:23pm UTC](https://www.ruby-forum.com/t/rails-caching-model/87554 "2007-03-03T20:23:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![teesea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7feea3/32.png) [@teesea](https://www.ruby-forum.com/u/teesea)\
**Post date:** [March 3, 2007, 8:23pm UTC](https://www.ruby-forum.com/t/rails-caching-model/87554/1 "2007-03-03T20:23:39Z")

</div>

I’m having some trouble adding a method to one of my active record  
models, I added one method fine but when I added another method I got  
the error message “undefined method”, I’ve restarted the server, the  
pc but this hasnt made any difference, it appears that its running in  
developement as the production log is empty and when using \<  
%=ENV[‘RAILS\_ENV’]%\> its outputting “developement”. I’m running  
instant rails with a rails version of 1.1.6. Any suggestions?

Cheers

Teesea

---

<div class="post-metadata">

**Author:** ![teesea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7feea3/32.png) [@teesea](https://www.ruby-forum.com/u/teesea)\
**Post date:** [March 3, 2007, 9:25pm UTC](https://www.ruby-forum.com/t/rails-caching-model/87554/2 "2007-03-03T21:25:45Z")

</div>

Hi –

On Sat, 3 Mar 2007, teesea wrote:

> I’m having some trouble adding a method to one of my active record  
> models, I added one method fine but when I added another method I got  
> the error message “undefined method”, I’ve restarted the server, the  
> pc but this hasnt made any difference, it appears that its running in  
> developement as the production log is empty and when using \<  
> %=ENV[‘RAILS\_ENV’]%\> its outputting “developement”. I’m running  
> instant rails with a rails version of 1.1.6. Any suggestions?

There are many reasons you could be getting this error – or, I should  
say, one reason (you’re calling an undefined method 🙂 but many ways  
for that to happen.

First thing to check: is the method inside the model class? Make sure  
it is not defined after the final “end” of the class definition block.

David

–  
Q. What is THE Ruby book for Rails developers?  
A. RUBY FOR RAILS by David A. Black ([http://www.manning.com/black](http://www.manning.com/black))  
(See what readers are saying! [http://www.rubypal.com/r4rrevs.pdf](http://www.rubypal.com/r4rrevs.pdf))  
Q. Where can I get Ruby/Rails on-site training, consulting, coaching?  
A. Ruby Power and Light, LLC ([http://www.rubypal.com](http://www.rubypal.com))
