sql icon indicating copy to clipboard operation
sql copied to clipboard

`Changeset#update` should return `self`

Open vladfaust opened this issue 6 years ago • 1 comments

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

vladfaust avatar Apr 17 '19 10:04 vladfaust

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.

vladfaust avatar Apr 27 '19 19:04 vladfaust