sql icon indicating copy to clipboard operation
sql copied to clipboard

Add argless `#update` and `#delete` instance query shortcuts

Open vladfaust opened this issue 6 years ago • 1 comments

repo.exec(user.update(updated_at: Time.now))

Doesn't work now, as Model#update requires Changeset argument.

vladfaust avatar Apr 17 '19 06:04 vladfaust

I think that it would be better to add argless update and delete shortcuts:

user.update == User.where(id: user.id!).update

The first example would be changed to:

repo.exec(user.update.set(updated_at: Time.now))

vladfaust avatar Apr 27 '19 19:04 vladfaust