app/models/manager_refresh/inventory_collection/data_storage.rb
def from_raw_value(value, available_inventory_collections)
        if value.kind_of?(Hash) && (value['type'] || value[:type]) == "ManagerRefresh::InventoryObjectLazy"
          value.transform_keys!(&:to_s)
        end

        if value.kind_of?(Hash) && value['type'] == "ManagerRefresh::InventoryObjectLazy"
          inventory_collection = available_inventory_collections[value['inventory_collection_name'].try(:to_sym)]
          raise "Couldn't build lazy_link #{value} the inventory_collection_name was not found" if inventory_collection.blank?
          inventory_collection.lazy_find(value['ems_ref'], :key => value['key'], :default => value['default'])
        else
          value
        end
      end
# Transform serialized references into lazy InventoryObject objects
#
# @param value [Object, Hash] Serialized InventoryObject into Hash
# @param available_inventory_collections [Array<ManagerRefresh::InventoryCollection>] List of available
#        InventoryCollection objects
# @return [Object, ManagerRefresh::InventoryObjectLazy] Returns ManagerRefresh::InventoryObjectLazy object
#         if the serialized form was a reference, or return original value
Transform serialized references into lazy InventoryObject objects
Transform serialized references into lazy InventoryObject objects
def from_raw_value(value, available_inventory_collections)
        if value.kind_of?(Hash) && (value['type'] || value[:type]) == "ManagerRefresh::InventoryObjectLazy"
          value.transform_keys!(&:to_s)
        end
        if value.kind_of?(Hash) && value['type'] == "ManagerRefresh::InventoryObjectLazy"
          inventory_collection = available_inventory_collections[value['inventory_collection_name'].try(:to_sym)]
          raise "Couldn't build lazy_link #{value} the inventory_collection_name was not found" if inventory_collection.blank?
          inventory_collection.lazy_find(value['ems_ref'], :key => value['key'], :default => value['default'])
        else
          value
        end
      end
def from_raw_value ( value , available_inventory_collections ) if value . kind_of? ( Hash ) && ( value [ 'type' ] || value [ :type ] ) == "ManagerRefresh::InventoryObjectLazy" value . transform_keys! ( & :to_s ) end if value . kind_of? ( Hash ) && value [ 'type' ] == "ManagerRefresh::InventoryObjectLazy" inventory_collection = available_inventory_collections [ value [ 'inventory_collection_name' ] . try ( :to_sym ) ] raise "Couldn't build lazy_link #{value} the inventory_collection_name was not found" if inventory_collection . blank? inventory_collection . lazy_find ( value [ 'ems_ref' ] , :key => value [ 'key' ] , :default => value [ 'default' ] ) else value end end
Transform serialized references into lazy InventoryObject objects
Transform serialized references into lazy InventoryObject objects
Returns ManagerRefresh::InventoryObjectLazy object if the serialized form was a reference, or return original value
Returns ManagerRefresh :: InventoryObjectLazy object if the serialized form was a reference or return original value
Object, ManagerRefresh::InventoryObjectLazy
value
Serialized InventoryObject into Hash
Serialized InventoryObject into Hash
available_inventory_collections
List of available InventoryCollection objects
List of available InventoryCollection objects