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

bulk operations on relations #45

Open
Fryguy opened this issue Oct 1, 2016 · 1 comment
Open

bulk operations on relations #45

Fryguy opened this issue Oct 1, 2016 · 1 comment

Comments

@Fryguy
Copy link
Member

Fryguy commented Oct 1, 2016

So something like miq.vms.where(:power_state => "off").stop would internally call miq.vms.stop(miq.vms.where(:power_state => "off").pluck(:id))

This way you can do bulk operations, but not have to that dance manually.

@abellotti
Copy link
Member

Nice Request !! Wouldn't be hard to do.

miq.vms.stop([id1, id2, id3])

would internally be handled equivalently to

miq.vms.stop([{ "id" : id1 }, { "id" : id2 }, { "id" : id3 }])

this would work great for any actions not requiring parameters.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants