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

Pass command options to changeset #596

Open
qortex opened this issue Apr 6, 2020 · 1 comment
Open

Pass command options to changeset #596

qortex opened this issue Apr 6, 2020 · 1 comment
Assignees
Milestone

Comments

@qortex
Copy link

qortex commented Apr 6, 2020

We could provide command options while constructing a changeset object. For now, options are not passed down to the command being built inside the changeset.

Examples

When result is supposed to be :many instead of the default :one value for the command:

rel.changeset(:delete, command_options: { result: :many } )
# or directly
rel.changeset(:delete, result: :many )
# or
rel.changeset(:delete).with_command_options(result: :many)

Right now, it is not possible with the current changeset implementation (arguments are considered data, see this file) so we have to circumvent:

c = rel.changeset(:delete)
c.command_options[:result] = :many
c.commit
@qortex qortex added the feature label Apr 6, 2020
@qortex
Copy link
Author

qortex commented Apr 6, 2020

@solnic solnic added this to the 6.0.0 milestone Jun 24, 2020
@solnic solnic self-assigned this Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

2 participants