# One model won't work like the others, generating weird error

**URL:** <https://www.ruby-forum.com/t/one-model-wont-work-like-the-others-generating-weird-error/57744>\
**Category:** Rails\
**Created:** [April 13, 2006, 5:31pm UTC](https://www.ruby-forum.com/t/one-model-wont-work-like-the-others-generating-weird-error/57744 "2006-04-13T17:31:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [April 13, 2006, 5:31pm UTC](https://www.ruby-forum.com/t/one-model-wont-work-like-the-others-generating-weird-error/57744/1 "2006-04-13T17:31:52Z")

</div>

I’ve been banging my head against this for quite some time and can’t  
figure out what is going on. I’m doing up a web site based on Typo and  
adding in some custom controllers. I’m running Typo from trunk, so it’s  
using the version of rails in vendor/rails. Everything is going  
smoothly…until now.

I have one model that JUST. WON’T. WORK. Whenever I call it, I get the  
following error:

(eval):1:in `compute\_type’: compile error  
(eval):1: parse error, unexpected tINTEGER  
Object::2

The model itself couldn’t be any simpler:

class Team \< ActiveRecord::Base  
end

The controller calling it is as follows:

class RostersController \< ContentController  
layout :theme\_layout  
helper :articles  
model :team

def index  
ac\_teams =  
[‘COU’,‘TRI’,‘CAP’,‘BUF’,‘MCM’,‘WMS’,‘PHI’,‘BOW’,‘PAD’,‘STL’,‘POR’,‘LAW’]  
nc\_teams =  
[‘SDQ’,‘CSP’,‘MIL’,‘CAJ’,‘HAG’,‘BUZ’,‘DTR’,‘COL’,‘SPO’,‘SEA’,‘MAD’,‘CRE’]  
result = Team.find(:all)  
#if params[:id] == “ac”  
# @team\_rosters = get\_rosters(ac\_teams)  
#elsif params[:id] == “nc”  
# @team\_rosters = get\_rosters(nc\_teams)  
#else  
# @team\_rosters = get\_rosters(ac\_teams)  
# @team\_rosters \<\< get\_rosters(nc\_teams)  
#end

end  
end

It chokes on the Team.find line, spewing out the above-mentioned error.  
Two other models that are in use work just fine.

Any thoughts? Suggestions? This is driving me nucking futs.

---

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [April 13, 2006, 6:21pm UTC](https://www.ruby-forum.com/t/one-model-wont-work-like-the-others-generating-weird-error/57744/2 "2006-04-13T18:21:18Z")

</div>

(wow, answering oneself is so weird)

Turns out the problem was that one of the fields in the table was called  
‘type’, and for whatever reason Rails didn’t like it.

Chris H. wrote:

> Any thoughts? Suggestions? This is driving me nucking futs.

---

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [April 13, 2006, 6:53pm UTC](https://www.ruby-forum.com/t/one-model-wont-work-like-the-others-generating-weird-error/57744/3 "2006-04-13T18:53:21Z")

</div>

Hi Chris,

Rails reserves columns named “type” for single table inheritance:  
[http://wiki.rubyonrails.org/rails/pages/SingleTableInheritance](http://wiki.rubyonrails.org/rails/pages/SingleTableInheritance)

I actually had this same problem and think it would be great if there  
were  
someway you could have a column named “type” without having single table  
inheritance.

Daniel
