On Wed, Nov 2, 2022 at 9:31 AM Priya <priya1031...@gmail.com> wrote:

> Hi Jeremy
> I have a Postgres database and I'm using ruby. My Postgres connections has
> permission for insert, select, update, and delete. I was able to delete
> records without issue. However, on the update, it does get updated
> momentarily but not on the database (please check attachment -new). And
> throws an error for .save after the update. please help.
>

Please post text and not pictures.

>From what I can guess from the picture, you may have a plain dataset in the
instance variable.  Then you have @dataset[condition], which returns a plan
Hash.  Then you are calling Hash#update, which only updates the hash, it
does not effect the database.  If that is the case, you may want to change
to using model objects (where Sequel::Model#update will update the database
if needed), or using Dataset#update instead of retrieving the first record
in a dataset and then updating the related row (e.g.
dataset.where(condition).update(update_hash)).

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sequel-talk+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/CADGZSSdgTeLgJ-WYEKJ_bXFtw3Ly%2Bcp2F%3DUvLFz%3D85MstV1-YA%40mail.gmail.com.

Reply via email to