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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/ree_lib/packages/ree_dao/package/ree_dao/association.rb +7 -5
- data/lib/ree_lib/packages/ree_dao/spec/ree_dao/functions/load_agg/load_agg_benchmark_spec.rb +2 -0
- data/lib/ree_lib/packages/ree_dao/spec/ree_dao/functions/load_agg/load_agg_spec.rb +2 -2
- data/lib/ree_lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58dcd5d4f8eeefdbea1dc995ea2e76734a8dccc6a913354085453ca9a0ddd72e
|
4
|
+
data.tar.gz: 1d29d9be3027f3d57e3502e6269ac3cd455e50e5ecdf4b17ea73877b15379423
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35b733d5bcaf9f7f837d212c7279c77044f29e11b5e48d0480a879180497f77805b3aa0bf5e17a8b2b1aa991f769a1452fad291d6895436d8d1eca6e9a6a4fb6
|
7
|
+
data.tar.gz: '08ec8fe4b53aceff584a515ca820484e59bfa387ae3d5f9c9d21fcdf73afa018d777882f40cab8e6f835fc5eb80ca941977f211614aa0005e10ebcea9fc333c9'
|
data/Gemfile.lock
CHANGED
@@ -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 =
|
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
|
|
data/lib/ree_lib/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2023-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ree
|