# ROR 2.0 & undefined method \`table\_name'

**URL:** <https://www.ruby-forum.com/t/ror-2-0-undefined-method-table-name/122515>\
**Category:** Rails\
**Created:** [December 8, 2007, 5:29pm UTC](https://www.ruby-forum.com/t/ror-2-0-undefined-method-table-name/122515 "2007-12-08T17:29:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![razy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@razy](https://www.ruby-forum.com/u/razy)\
**Post date:** [December 8, 2007, 5:29pm UTC](https://www.ruby-forum.com/t/ror-2-0-undefined-method-table-name/122515/1 "2007-12-08T17:29:21Z")

</div>

Hi all,

I’ve got stuck with this. Here’s the error message:  
NoMethodError in Account#index

Showing account/index.rhtml where line #4 raised:

undefined method `table\_name’ for Upload:Class  
Extracted source (around line #4):

1:

# My account
  
2:  
3: Login name: \<%= current\_user.login %\>   
  
4: Files uploaded: \<%= current\_user.uploads.find(:all).count %\>  
5:   
  
6: \<%= render :partial =\> ‘layouts/menu’ %\>

its a basic acts\_as\_authenticated user model with has\_many :uploads  
attribute  
any suggestions on how to fix this?

---

<div class="post-metadata">

**Author:** ![razy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@razy](https://www.ruby-forum.com/u/razy)\
**Post date:** [December 9, 2007, 3:42am UTC](https://www.ruby-forum.com/t/ror-2-0-undefined-method-table-name/122515/2 "2007-12-09T03:42:02Z")

</div>

A backtrace would be really awesome, along with the files from the app  
that it points to.

---

<div class="post-metadata">

**Author:** ![razy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@razy](https://www.ruby-forum.com/u/razy)\
**Post date:** [January 17, 2008, 7:24am UTC](https://www.ruby-forum.com/t/ror-2-0-undefined-method-table-name/122515/3 "2008-01-17T07:24:25Z")

</div>

I got that error too (but in Rails 1.2.3)

[http://pastie.org/139900](http://pastie.org/139900)

I only added line7 in user\_controller to have logs. The app works  
perfectly without it. And I also tried dropping/migrating the DB.

---

<div class="post-metadata">

**Author:** ![razy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@razy](https://www.ruby-forum.com/u/razy)\
**Post date:** [January 17, 2008, 7:38am UTC](https://www.ruby-forum.com/t/ror-2-0-undefined-method-table-name/122515/4 "2008-01-17T07:38:28Z")

</div>

On Jan 16, 2008, at 10:23 PM, riskyhm wrote:

> I got that error too (but in Rails 1.2.3)
> 
> [http://pastie.org/139900](http://pastie.org/139900)
> 
> I only added line7 in user\_controller to have logs. The app works  
> perfectly without it. And I also tried dropping/migrating the DB.

Look at the message. You have a naming conflict between WEBrick::Log  
and the Log class you defined. Can you use WoodenLogs or something  
like that?
