Coder Social home page Coder Social logo

inventory_refresh's People

Contributors

agrare avatar alonakaplan avatar bdunne avatar blomquisg avatar carbonin avatar cben avatar chessbyte avatar chrisarcand avatar d-m-u avatar djberg96 avatar durandom avatar duskyprawn avatar fryguy avatar gtanzillo avatar israel-hdez avatar jameswnl avatar jaywcarman avatar jrafanie avatar kbrock avatar ladas avatar mansam avatar matheuscmelo avatar mend-bolt-for-github[bot] avatar miha-plesko avatar nicklamuro avatar pkliczewski avatar renovate[bot] avatar skateman avatar slemrmartin avatar tumido avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

inventory_refresh's Issues

Honor create_only? for Base Saver

--- a/lib/inventory_refresh/save_collection/saver/base.rb
+++ b/lib/inventory_refresh/save_collection/saver/base.rb
@@ -163,7 +163,7 @@ module InventoryRefresh::SaveCollection
               # Record was found in the DB but not sent for saving, that means it doesn't exist anymore and we should
               # delete it from the DB.
               delete_record!(record) if inventory_collection.delete_allowed?
-            else
+            elsif !inventory_collection.create_only?
               # Record was found in the DB and sent for saving, we will be updating the DB.
               update_record!(record, hash, inventory_object) if assert_referential_integrity(hash)

The create_only? option is honored by concurrent_safe_batch and batch save strategies but not by base.

secondary_ref lookup ergonmics

  • secondary_ref is an odd name choice...perhaps extra_indexes, alternate_indexes, lookups?
  • When you use a secondary_ref, the current syntax is
# collection def
:secondary_refs = {:by_name => %i(name)}

# in parser
collection.lazy_find({:name => "foo"}, {:ref => :by_name})

A more ergnomic syntax would be

collection.lazy_find(:by_name => {:name => "foo"})

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

bundler
Gemfile
  • activerecord "~>5.2.6"
  • activerecord "~>6.0.4"
  • activerecord "~>6.1.4"
github-actions
.github/workflows/ci.yaml
  • actions/checkout v4
  • ruby/setup-ruby v1
  • paambaati/codeclimate-action v8
  • manageiq/postgresql 13

  • Check this box to trigger a request for Renovate to run again on this repository

`lazy_find` should accept lambda to preprocess value

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.