# Model.create ignores id attribute

**URL:** <https://www.ruby-forum.com/t/model-create-ignores-id-attribute/58193>\
**Category:** Rails\
**Created:** [April 19, 2006, 3:59pm UTC](https://www.ruby-forum.com/t/model-create-ignores-id-attribute/58193 "2006-04-19T15:59:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lodi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/c67d28/32.png) [@lodi](https://www.ruby-forum.com/u/lodi)\
**Post date:** [April 19, 2006, 3:59pm UTC](https://www.ruby-forum.com/t/model-create-ignores-id-attribute/58193/1 "2006-04-19T15:59:32Z")

</div>

Hello all,

I’m inserting records from another system and it looks something like  
this:

Model.create :id=\>123, :name=\>“asdf”

I noticed that the id attribute is ignored (the database will  
automatically assign an auto\_increment id starting from 1).

I remember reading about this before: iirc this is done so that you can  
easily fill in model information from forms, but I can’t find any  
documentation on this now.

Is there a way to force the id? Or do I have to do:

m = Model.new( :name=\>“asdf” )  
m.id = 123  
m.save

Thanks.

---

<div class="post-metadata">

**Author:** ![lodi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/c67d28/32.png) [@lodi](https://www.ruby-forum.com/u/lodi)\
**Post date:** [April 19, 2006, 4:15pm UTC](https://www.ruby-forum.com/t/model-create-ignores-id-attribute/58193/2 "2006-04-19T16:15:16Z")

</div>

Anthony Lodi wrote:

> Hello all,
> 
> I’m inserting records from another system and it looks something like  
> this:

I’d suggest you leave id as an auto-increment and create a new field  
(oldsystem\_id or something).

Alan
