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

lazy_find should accept lambda to preprocess value #85

Open
miha-plesko opened this issue Jul 18, 2019 · 2 comments
Open

lazy_find should accept lambda to preprocess value #85

miha-plesko opened this issue Jul 18, 2019 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed size/m

Comments

@miha-plesko
Copy link
Contributor

We're hitting an issue where we have to copy value from Flavor to Vm, but divide it by 2^20 prior saving. Something like:

persister.flavors.build(
  ... 
  :memory => flavor.memory_in_mb.megabytes # store in bytes
)

persister.hardwares.build(
  ...
  :memory_mb => persister.flavors.find(flavor_ref).memory / 1.megabytes  # convert to megabytes
)

Problem is that we currently have to use .find() which may potentially result in ordering issues. Would it be possible to let .lazy_find() accept a block where we could preprocess the value? Something like this would be fantastic:

persister.flavors.lazy_find(flavor_ref) { |flavor| flavor.memory / 1.megabyte }

/cc @agrare

@miq-bot
Copy link
Member

miq-bot commented Jun 11, 2020

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions! More information about the ManageIQ triage process can be found in the traige process documentation.

@Fryguy Fryguy removed the stale label Jul 6, 2020
@agrare agrare removed their assignment Sep 28, 2020
@agrare agrare added the help wanted Extra attention is needed label Sep 28, 2020
@agrare agrare added the size/m label Mar 30, 2021
@miq-bot miq-bot added the stale label Feb 27, 2023
@miq-bot
Copy link
Member

miq-bot commented Feb 27, 2023

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation.

@Fryguy Fryguy removed the stale label Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed size/m
Projects
None yet
Development

No branches or pull requests

5 participants