Skip to content

Cannot update records from a PostgreSQL database. #2375

Closed Answered by GoldenChrysus
Shaphil asked this question in Q&A
Discussion options

You must be logged in to vote

Reread the statement.

If you want to save the model back into the database, you need to convert it into an ActiveModel FIRST.

You are setting values on a Model not an ActiveModel as you are not first creating an ActiveModel. This is incorrect. You generally should not be modifying the Model at all.

Read the docs linked. They give a clear, proper example of exactly what you are trying to do.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@GoldenChrysus
Comment options

Answer selected by Shaphil
@Shaphil
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants