insert_conflict plugin #1856
PetrKaleta
started this conversation in
General
Replies: 1 comment 4 replies
-
The For what you want, it seems best to just to a normal save, rescue |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
let's say I have a model
Foo
with unique constraint onbar
attribute.This behavior is kinda strange. Why
id
isnil
andnew?
returnsfalse
. I am trying to make a "unique constraint safe" find or create method... So my idea is to create the model first and if it fails on UC, then return existing one...Beta Was this translation helpful? Give feedback.
All reactions