# Empty Model creates DangerousAttributeError and connection is defined by ActiveRecord

**URL:** <https://www.ruby-forum.com/t/empty-model-creates-dangerousattributeerror-and-connection-is-defined-by-activerecord/127229>\
**Category:** Rails\
**Created:** [January 26, 2008, 4:52pm UTC](https://www.ruby-forum.com/t/empty-model-creates-dangerousattributeerror-and-connection-is-defined-by-activerecord/127229 "2008-01-26T16:52:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dgo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cab0a1/32.png) [@dgo](https://www.ruby-forum.com/u/dgo)\
**Post date:** [January 26, 2008, 4:52pm UTC](https://www.ruby-forum.com/t/empty-model-creates-dangerousattributeerror-and-connection-is-defined-by-activerecord/127229/1 "2008-01-26T16:52:23Z")

</div>

Dear list,

The following situation drives me crazy.

I have one model called AlumniMember and one AlumniData. Both filled  
with code. I developed both on Rails 1.2.3. Now I update the App to  
Rails 2.0.2. Now the following happens, always when I call  
AlumniData.new I get the DangerousAttributeError.

First I cleaned out the Model, the only line I left is  
“has\_one :alumni\_member”. Same error. The I cleaned that line too:  
guess… same error.

F%&/ it, I thought and got rid of the model with “script/destroy model  
AlumniData”. The I recreated the model . . . same error. Rails always  
writer the following message: “connection is defined by ActiveRecord”

Please somebody, is there help. What is the problem.

Thank you very much!!

Daniel

---

<div class="post-metadata">

**Author:** ![dgo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cab0a1/32.png) [@dgo](https://www.ruby-forum.com/u/dgo)\
**Post date:** [January 26, 2008, 6:50pm UTC](https://www.ruby-forum.com/t/empty-model-creates-dangerousattributeerror-and-connection-is-defined-by-activerecord/127229/2 "2008-01-26T18:50:25Z")

</div>

Please provide the migrations or db:schema for the two models. I  
believe, that error means than an attribute name conflicts with a  
reserved name.

---

<div class="post-metadata">

**Author:** ![dgo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cab0a1/32.png) [@dgo](https://www.ruby-forum.com/u/dgo)\
**Post date:** [January 27, 2008, 11:29am UTC](https://www.ruby-forum.com/t/empty-model-creates-dangerousattributeerror-and-connection-is-defined-by-activerecord/127229/3 "2008-01-27T11:29:50Z")

</div>

Hei brewpoo,

yes you are right! Last night I found out this was the problem. I had  
in my table a column called “connection”. Renaming this solved the  
problem!

Thank you very much for your help!

daniel
