ree_lib 1.0.63 → 1.0.64

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf0b2d37f1b4dab2dd798faa601db7969c49479c02eb39ee67a1a7344231b887
4
- data.tar.gz: aabcce88a49279d7d1d970e59056a43b866edd4d81d0a64cb553c0142b9da4c2
3
+ metadata.gz: 58dcd5d4f8eeefdbea1dc995ea2e76734a8dccc6a913354085453ca9a0ddd72e
4
+ data.tar.gz: 1d29d9be3027f3d57e3502e6269ac3cd455e50e5ecdf4b17ea73877b15379423
5
5
  SHA512:
6
- metadata.gz: f9bd4b78d0c104dccaee61ac1ab1979596c2d90c9006c0e939cb26c8984401d7e724edfff81f4ff106b9a5d153ab1a687bf3d1bb963ecefa1929839e81a0183c
7
- data.tar.gz: cbe3d31611bf98d43bd5cced27d68689bf739e04a87c023e96ede58b9ea500319ec907e2df6ce55f17ff752bc34c4c0e727ab34ed721b51130e251657d6764b3
6
+ metadata.gz: 35b733d5bcaf9f7f837d212c7279c77044f29e11b5e48d0480a879180497f77805b3aa0bf5e17a8b2b1aa991f769a1452fad291d6895436d8d1eca6e9a6a4fb6
7
+ data.tar.gz: '08ec8fe4b53aceff584a515ca820484e59bfa387ae3d5f9c9d21fcdf73afa018d777882f40cab8e6f835fc5eb80ca941977f211614aa0005e10ebcea9fc333c9'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ree_lib (1.0.63)
4
+ ree_lib (1.0.64)
5
5
  binding_of_caller (~> 1.0.0)
6
6
  i18n (~> 1.12.0)
7
7
  loofah (~> 2.18.0)
@@ -4,7 +4,6 @@ module ReeDao
4
4
 
5
5
  link :group_by, from: :ree_array
6
6
  link :index_by, from: :ree_array
7
- link :transform_values, from: :ree_hash
8
7
 
9
8
  attr_reader :parent, :parent_dao_name, :list, :global_opts
10
9
 
@@ -163,12 +162,14 @@ module ReeDao
163
162
  assoc_dao = find_dao(assoc_name, parent, scope)
164
163
 
165
164
  if reverse
165
+ # has_one
166
166
  if !foreign_key
167
167
  foreign_key = "#{parent_assoc_name.to_s.gsub(/s$/,'')}_id".to_sym
168
168
  end
169
169
 
170
170
  root_ids = list.map(&:id).uniq
171
171
  else
172
+ # belongs_to
172
173
  if !foreign_key
173
174
  foreign_key = :"#{assoc_name}_id"
174
175
  end
@@ -182,7 +183,6 @@ module ReeDao
182
183
  items = add_scopes(scope, global_opts[assoc_name])
183
184
  end
184
185
 
185
-
186
186
  assoc = index_by(items) { _1.send(reverse ? foreign_key : :id) }
187
187
 
188
188
  populate_association(
@@ -272,11 +272,13 @@ module ReeDao
272
272
  list.each do |item|
273
273
  if setter && setter.is_a?(Proc)
274
274
  if to_dto
275
- assoc_index = transform_values(association_index) do |key, value|
275
+ assoc_index = {}
276
+
277
+ association_index.each do |key, value|
276
278
  if value.is_a?(Array)
277
- value.map { to_dto.call(_1) }
279
+ assoc_index[key] = value.map { to_dto.call(_1) }
278
280
  else
279
- to_dto.call(value)
281
+ assoc_index[key] = to_dto.call(value)
280
282
  end
281
283
  end
282
284
 
@@ -251,7 +251,9 @@ RSpec.describe :load_agg do
251
251
 
252
252
  _users = []
253
253
  st_time = Time.now
254
+
254
255
  puts "Seeding #{NUM_OF_USERS} users..."
256
+
255
257
  NUM_OF_USERS.times do
256
258
  u = ReeDaoLoadAggTest::User.new(
257
259
  name: Faker::Name.name,
@@ -130,8 +130,8 @@ RSpec.describe :load_agg do
130
130
  end
131
131
 
132
132
  def some_method(list)
133
- puts list.map(&:id)
134
- puts list.map { _1.class.name }
133
+ # puts list.map(&:id)
134
+ # puts list.map { _1.class.name }
135
135
  end
136
136
 
137
137
  def passport_opts
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ReeLib
4
- VERSION = "1.0.63"
4
+ VERSION = "1.0.64"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ree_lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.63
4
+ version: 1.0.64
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruslan Gatiyatov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-31 00:00:00.000000000 Z
11
+ date: 2023-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ree