# ActiveRecord::Base.class\_eval not being called

**URL:** <https://www.ruby-forum.com/t/activerecord-base-class-eval-not-being-called/158674>\
**Category:** Rails\
**Created:** [January 26, 2009, 7:04pm UTC](https://www.ruby-forum.com/t/activerecord-base-class-eval-not-being-called/158674 "2009-01-26T19:04:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![blewis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/c57346/32.png) [@blewis](https://www.ruby-forum.com/u/blewis)\
**Post date:** [January 26, 2009, 7:04pm UTC](https://www.ruby-forum.com/t/activerecord-base-class-eval-not-being-called/158674/1 "2009-01-26T19:04:32Z")

</div>

I am extending activerecord to write some audit data before each save or  
create using this in the environment.rb file:

ActiveRecord::Base.class\_eval do  
blah  
blah  
blah  
end

It was working the first day I did this, and now it has stopped. I tried  
backing out of any changes that could have been made in the mean-time,  
but to no avail.

if I put a logger.debug in the method, I see that it gets hit each time  
the ap is started, but never after.

Any ideas why activerecord is not seeing this extension?

Thanks

-Ben
