# Class name conflict

**URL:** <https://www.ruby-forum.com/t/class-name-conflict/71382>\
**Category:** Rails\
**Created:** [October 8, 2006, 2:33am UTC](https://www.ruby-forum.com/t/class-name-conflict/71382 "2006-10-08T02:33:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jigar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/4491bb/32.png) [@jigar](https://www.ruby-forum.com/u/jigar)\
**Post date:** [October 8, 2006, 2:33am UTC](https://www.ruby-forum.com/t/class-name-conflict/71382/1 "2006-10-08T02:33:15Z")

</div>

I have a model with name Module

class Module \< ActiveRecord::Base  
set\_table\_name “modules”  
belongs\_to :tabs  
…

end

Some how I am getting error : “undefined method `table\_name’ for  
Module:Class”

I assume this is happening because there is some class in rails with  
same name, I would appreciate if some body can show me way to solve  
this problem.

---

<div class="post-metadata">

**Author:** ![jigar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/4491bb/32.png) [@jigar](https://www.ruby-forum.com/u/jigar)\
**Post date:** [October 8, 2006, 7:07am UTC](https://www.ruby-forum.com/t/class-name-conflict/71382/2 "2006-10-08T07:07:38Z")

</div>

Jigar wrote:

> I have a model with name Module
> 
> I assume this is happening because there is some class in rails with  
> same name, I would appreciate if some body can show me way to solve  
> this problem.

Not just in Rails, in Ruby! Module (capitalized) is a reserved word,  
like Class. You’ll have to pick a different model name.

Jeff

> **[Hey Daddio!](http://softiesonrails.com)**
>
> Home of Hey Daddio Software

---

<div class="post-metadata">

**Author:** ![jigar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/4491bb/32.png) [@jigar](https://www.ruby-forum.com/u/jigar)\
**Post date:** [October 8, 2006, 2:58pm UTC](https://www.ruby-forum.com/t/class-name-conflict/71382/3 "2006-10-08T14:58:12Z")

</div>

Thanks you very much Jeff
