Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete method update the all dirty fields #28

Open
farshadfahimi opened this issue Dec 8, 2021 · 0 comments
Open

delete method update the all dirty fields #28

farshadfahimi opened this issue Dec 8, 2021 · 0 comments

Comments

@farshadfahimi
Copy link

I have query and select the one row use merge for change some of the fields

after that in some condition need to delete the first one and after that clear a clone from the first one but determined when call the delete method it just update prev model data and change my data

for more info you can check the sample code below

let order = Order.find(10)
order.merge({
amount: 100000
})

if (order.amount > 100) {
 await order.delete() //this line update all of the prev order
 order = new Order()
 order.fill({ amount: 100 })
}

when I'm deleting the order just need the deleted_at field change and forget all the other changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant