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

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

Open
vladfaust opened this issue Apr 17, 2019 · 1 comment
Open

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

vladfaust opened this issue Apr 17, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@vladfaust
Copy link
Member

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

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

@vladfaust vladfaust added the enhancement New feature or request label Apr 17, 2019
@vladfaust vladfaust added this to the 0.8.0 milestone Apr 17, 2019
@vladfaust vladfaust self-assigned this Apr 17, 2019
@vladfaust
Copy link
Member Author

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 vladfaust changed the title Allow instance updates with values Add argless #update and #delete instance query shortcuts Apr 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant