onyxframework / sql

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

`Changeset#update` should return `self` #94

Open vladfaust opened 5 years ago

vladfaust commented 5 years ago
Onyx::SQL.exec(user.update(changeset.update(foo: "bar")))
vladfaust commented 5 years ago

However, a developer could be confused with such a one-liner. Consider this example:

changeset = user.changeset
changeset.update(foo: "bar")
Onyx::SQL.exec(user.update(changeset.update(baz: "qux")))

It's not clear whether would the update take two fields or the baz only.