onyxframework / sql

A delightful SQL ORM ☺️
https://api.onyxframework.com/sql
MIT License
91 stars 7 forks source link

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

Open vladfaust opened 5 years ago

vladfaust commented 5 years ago
repo.exec(user.update(updated_at: Time.now))

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

vladfaust commented 5 years ago

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))