-
-
Save anonymous/398814f1b3053578d8a8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
So I'm trying to set the value of a primary key in my model...I'm thinking rails should be doing this on it's own but I'm not sure. My question is what should I be putting in place of "DEFAULT"? | |
tabel schema | |
create_table "Model_Labels", primary_key: "labelid", force: :cascade do |t| | |
t.string "name", limit: 255 | |
end | |
Portion of code where I want to set the value of "labelid" | |
model_labels = Model_Labels.new | |
model_labels.labelid = DEFAULT | |
model_labels.name = item['name'] | |
model_labels.save | |
label_id = model_labels.labelid | |
NOTE label_id get's called latter in the code |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment