# Is there a way to put a model into a module?

**URL:** <https://www.ruby-forum.com/t/is-there-a-way-to-put-a-model-into-a-module/131988>\
**Category:** Rails\
**Created:** [March 14, 2008, 9:40pm UTC](https://www.ruby-forum.com/t/is-there-a-way-to-put-a-model-into-a-module/131988 "2008-03-14T21:40:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![matrixise](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/94ad74/32.png) [@matrixise](https://www.ruby-forum.com/u/matrixise)\
**Post date:** [March 14, 2008, 9:40pm UTC](https://www.ruby-forum.com/t/is-there-a-way-to-put-a-model-into-a-module/131988/1 "2008-03-14T21:40:31Z")

</div>

Hi all,

A friend and I want to generate a model based on a table named  
‘modules’, I know that “Module” is a class in Ruby, and so, I would  
like to know how to generate this model.

Thanks,

Best Regards,

Stephane

---

<div class="post-metadata">

**Author:** ![matrixise](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/94ad74/32.png) [@matrixise](https://www.ruby-forum.com/u/matrixise)\
**Post date:** [March 16, 2008, 8:39pm UTC](https://www.ruby-forum.com/t/is-there-a-way-to-put-a-model-into-a-module/131988/2 "2008-03-16T20:39:20Z")

</div>

On 3/14/08, Stéphane Wirtel [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi all,
> 
> A friend and I want to generate a model based on a table named  
> ‘modules’, I know that “Module” is a class in Ruby, and so, I would  
> like to know how to generate this model.

You’ll have to pick another name for the class, then override the  
table name so somthing like

class ModuleModel \< ActiveRecord::Base

set\_table\_name “modules”

end

–  
Rick DeNatale

My blog on Ruby  
[http://talklikeaduck.denhaven2.com/](http://talklikeaduck.denhaven2.com/)
