This project is archived and is in readonly mode.
unable to create a model entity with a custom primary key
-
deepak
Hmm, the formatting seems to have been lost at the end. Here are my environment settings again :
Environment
- Rails : 2.2.2
- Ruby : ruby 1.8.6 (2008-03-03 patchlevel 114) [i686-darwin9.5.0]
- MySQL : mysql5 Ver 14.12 Distrib 5.0.67, for apple-darwin9.5.0 (i686) using EditLine wrapper
- OS : OSX 10.5.6
-
Jeff
It appears you can't create a model with a specific primary key value regardless of whether it is custom or default. The code you can preventing it is here: http://github.com/rails/rails/bl...
Essentially when creating the object it looks to see what attributes are assignable in attributes_from_column_definition, and the primary_key is excluded there.
-
Santiago Pastorino
- State changed from new to open
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
Santiago Pastorino
- State changed from open to stale