# Override "created\_at"-like Methods and add new one's

**URL:** <https://www.ruby-forum.com/t/override-created-at-like-methods-and-add-new-ones/114498>\
**Category:** Rails\
**Created:** [September 13, 2007, 1:22pm UTC](https://www.ruby-forum.com/t/override-created-at-like-methods-and-add-new-ones/114498 "2007-09-13T13:22:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pascal\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3da27b/32.png) [@Pascal\_F](https://www.ruby-forum.com/u/Pascal_F)\
**Post date:** [September 13, 2007, 1:22pm UTC](https://www.ruby-forum.com/t/override-created-at-like-methods-and-add-new-ones/114498/1 "2007-09-13T13:22:48Z")

</div>

Hi,

i’am about to redevelop an existing application and iam not allowed  
to touch the structure of the database. Every table of the  
database has the following fields:

anl\_dat (\<- created\_at)  
anl\_user (\<- who created the entry)  
aend\_dat (\<- updated\_at)  
aend\_user (\<- who updated)

how can i override the default rails behaviour so it uses  
the anl\_dat instead of created\_at?  
and is there a way to tell rails to automaticly fill anl\_user with  
something like session[:user\_name] ?

I need this for 99% of my models, only 2 tables  
need special treatment…

Thanks in advance,

Pascal
