looksist 0.3.8 → 0.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1ed8d09b1e799bb4e40b66a065fbe39ed049e423
4
- data.tar.gz: eeec8b9db71d9a12c63cfaa18880c084a169a2b2
3
+ metadata.gz: 6738e7223eb398300b1f39bbff473a32be03e0ac
4
+ data.tar.gz: e1038299efa273e12ba68e547d0a315f6126eb01
5
5
  SHA512:
6
- metadata.gz: e28f0f4283e7aed483bcda0ba3f377b3267570d647ee4362d8a4ab16611afbfd2d363103a9b2271a140fec65894d10ce01273f35853f2127ea5e918b656a2294
7
- data.tar.gz: b22b1798d96ab7484845ebb4a42b819754680c150d29edcc7124b2a09e6c61100bb32474ef687ffd30cfab688ef30f189b19ad56f904a68d268ef7380284cd17
6
+ metadata.gz: a264b8c03bb41a8db5821ae12fc5c33b9db7d4a991f47461764d7aebbf8adde22334461aadacb13ccc1f408be97d74c6b3dab8648c401d565165442f54e46691
7
+ data.tar.gz: bcf2614b4341eaebe18b9dd043ae340919c6a0312443e0f992ce71e7ed137b6bf9179d8a64c1b261d7a4a15eeee995959f791210b31969a37d6804e0bc2fe4fb
@@ -105,11 +105,7 @@ module Looksist
105
105
  def inject_attributes_for_array(array_of_hashes, at, opts)
106
106
  all_values = opts.each_with_object({}) do |opt, acc|
107
107
  entity_name = __entity__(opt[:bucket_name] || opt[:using])
108
- modified_array = if at.nil?
109
- array_of_hashes.map(&:values)
110
- else
111
- extract_values(array_of_hashes, opt[:using])
112
- end
108
+ modified_array = extract_values(array_of_hashes, opt[:using])
113
109
  keys = modified_array.flatten.compact.uniq
114
110
  values = Hash[keys.zip(Looksist.redis_service.send("#{entity_name}_for", keys))]
115
111
  acc[opt[:using]] = values
@@ -1,3 +1,3 @@
1
1
  module Lookist
2
- VERSION = '0.3.8'
2
+ VERSION = '0.3.9'
3
3
  end
@@ -398,10 +398,12 @@ describe Looksist::Hashed do
398
398
  def metrics
399
399
  [
400
400
  {
401
- item_id: 1
401
+ item_id: 1,
402
+ item_preference:'Low'
402
403
  },
403
404
  {
404
- item_id: 2
405
+ item_id: 2,
406
+ item_preference:'High'
405
407
  }
406
408
  ]
407
409
  end
@@ -414,11 +416,13 @@ describe Looksist::Hashed do
414
416
  expect(ArrayOfHashes.new.metrics).to eq(
415
417
  [{
416
418
  item_id: 1,
417
- dish_name: 'Idly'
419
+ dish_name: 'Idly',
420
+ item_preference:'Low'
418
421
  },
419
422
  {
420
423
  item_id: 2,
421
- dish_name: 'Pongal'
424
+ dish_name: 'Pongal',
425
+ item_preference:'High'
422
426
  }]
423
427
  )
424
428
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: looksist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - RC