Repository navigation
Conversation
5ddb666 to
ef250ed
Compare
5edfee7 to
c529390
Compare
|
@boblail ping |
|
@boblail 👀 requested changes addressed. |
|
LGTM! I'm curious what Rails Members think of the feature and of unifying with #35636! |
|
I think |
52ec6f3 to
2c131e9
Compare
|
I'm not liking the extra API exposed here, doesn't match Rails' aesthetic. Let's see where #35636 goes. |
|
@kaspth is it only about the API or doesn't you like option to specify which columns to use on update without need of using SQL fragment? In my eyes that is actually really handy and powerful. I can wait until #35636 is resolved and I'll try to rethink this agian. Anyway thanks for your time you spend on this already. |
|
I want to do something closer to only/with that I alluded to in #35686. |
|
I meant this part from the description: Book.upsert_all rows, only: %i( id name author_id )
Book.upsert_all rows, with: "status = GREATEST(books.status, excluded.status)"Though I'm thinking of putting a halt on more changes for |
|
👍 Ahh, ok. I'll focus on relation support for now. We can reopen and rethink specifying custom attributes to update on conflict once 6 is released and get more time unless next release. |
This allows to specify attributes to update on conflict. It opens door to handling timestamps updates manually in reasonable transparent way.
In combination with defaults (I'll try to add this in different PR) mentioned at #35493 (comment) it can provide easy and transparent way to handle timestamps. Anyway I think it should not be default behaviour since methods like
update_alldoesn't handle this on its own as well.WDYT @boblail @dhh @kaspth ❓
references #35493 #35494
I'll update documentation once approved.