# How to put the model class in module?

**URL:** <https://www.ruby-forum.com/t/how-to-put-the-model-class-in-module/55670>\
**Category:** Engines Development\
**Created:** [March 22, 2006, 9:50pm UTC](https://www.ruby-forum.com/t/how-to-put-the-model-class-in-module/55670 "2006-03-22T21:50:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oliver\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/ac91a4/32.png) [@Oliver\_P](https://www.ruby-forum.com/u/Oliver_P)\
**Post date:** [March 22, 2006, 9:50pm UTC](https://www.ruby-forum.com/t/how-to-put-the-model-class-in-module/55670/1 "2006-03-22T21:50:51Z")

</div>

I meet a strange problem. I have a table name is application. So I have  
to use Application as the model class name. But it reports error. If I  
put the model class into my special module and require the file in  
controller, it works. But I find that all predefined methods in Active  
Record are no longer effective, such as validate and so on.

Can you please give me some idea on this problem? Thanks .

---

<div class="post-metadata">

**Author:** ![Oliver\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/ac91a4/32.png) [@Oliver\_P](https://www.ruby-forum.com/u/Oliver_P)\
**Post date:** [March 23, 2006, 2:22am UTC](https://www.ruby-forum.com/t/how-to-put-the-model-class-in-module/55670/2 "2006-03-23T02:22:29Z")

</div>

This list is for discussion of the development of engines plugin - it  
sounds like your issue is to do with Rails in general, rather than the  
plugin, and therefore you may get a better response (from a wider  
audience) if you post this to the correct list.

That said, I can imagine that Rails won’t like you having a model  
called Application, since it would reside in a file called  
application.rb, which clashes with the ApplicationController file. You  
may simply have to choose a different name for your model…

- james

On 3/22/06, Oliver P [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> * * *
> 
> engine-developers mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rails-engines.org/listinfo.cgi/engine-developers-rails-engines.org](http://lists.rails-engines.org/listinfo.cgi/engine-developers-rails-engines.org)

–

- J \*  
~
