ree_lib 1.0.101 → 1.0.103
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.schema.json +7 -0
- data/lib/ree_lib/packages/ree_dao/package/ree_dao/aggregate_dsl.rb +1 -0
- data/lib/ree_lib/packages/ree_dao/package/ree_dao/functions/agg_contract_for.rb +24 -0
- data/lib/ree_lib/packages/ree_dao/schemas/ree_dao/functions/agg_contract_for.schema.json +28 -0
- data/lib/ree_lib/packages/ree_dao/spec/ree_dao/functions/load_agg/agg_spec.rb +2 -1
- data/lib/ree_lib/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75f247e14979ba0df355bb52af63566ae959bcbcba8cccb10748f7d74fd211dd
|
4
|
+
data.tar.gz: 9d5f448666afa6361b842b5a9d164f777471e1412bb804086298671756fd4f6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a4833af76b846c2b448422d9bd4f09b8da3948a66a1a44666cee8a228c3f5608def79dd87763639a7b9ea962ab5654ec3ffda011de8d61ef6e3037fc8529327
|
7
|
+
data.tar.gz: 8c6c272989bf412a9419cffa8c315606b138612d5c677a1a6d10a40f857a8be22f611fa91ad869b8c6a094c1443d0a79604ebc18b6eafe3eb03bf3cea6251fd7
|
data/Gemfile.lock
CHANGED
@@ -40,6 +40,13 @@
|
|
40
40
|
"fn"
|
41
41
|
]
|
42
42
|
},
|
43
|
+
{
|
44
|
+
"name": "agg_contract_for",
|
45
|
+
"schema": "packages/ree_dao/schemas/ree_dao/functions/agg_contract_for.schema.json",
|
46
|
+
"tags": [
|
47
|
+
"fn"
|
48
|
+
]
|
49
|
+
},
|
43
50
|
{
|
44
51
|
"name": "build_connection",
|
45
52
|
"schema": "packages/ree_dao/schemas/ree_dao/functions/build_connection.schema.json",
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class ReeDao::AggContractFor
|
4
|
+
include Ree::FnDSL
|
5
|
+
|
6
|
+
fn :agg_contract_for do
|
7
|
+
target :class
|
8
|
+
with_caller
|
9
|
+
end
|
10
|
+
|
11
|
+
contract(Any => nil)
|
12
|
+
def call(klass)
|
13
|
+
get_caller.contract(
|
14
|
+
Or[Sequel::Dataset, ArrayOf[Integer], Integer, ArrayOf[klass]],
|
15
|
+
Ksplat[
|
16
|
+
only?: ArrayOf[Symbol],
|
17
|
+
except?: ArrayOf[Symbol],
|
18
|
+
RestKeys => Any
|
19
|
+
] => ArrayOf[klass]
|
20
|
+
)
|
21
|
+
|
22
|
+
nil
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
{
|
2
|
+
"schema_type": "object",
|
3
|
+
"schema_version": "1.1",
|
4
|
+
"name": "agg_contract_for",
|
5
|
+
"path": "packages/ree_dao/package/ree_dao/functions/agg_contract_for.rb",
|
6
|
+
"mount_as": "fn",
|
7
|
+
"class": "ReeDao::AggContractFor",
|
8
|
+
"factory": null,
|
9
|
+
"methods": [
|
10
|
+
{
|
11
|
+
"doc": "",
|
12
|
+
"throws": [
|
13
|
+
|
14
|
+
],
|
15
|
+
"return": "Any",
|
16
|
+
"args": [
|
17
|
+
{
|
18
|
+
"arg": "klass",
|
19
|
+
"arg_type": "req",
|
20
|
+
"type": "Any"
|
21
|
+
}
|
22
|
+
]
|
23
|
+
}
|
24
|
+
],
|
25
|
+
"links": [
|
26
|
+
|
27
|
+
]
|
28
|
+
}
|
@@ -87,7 +87,7 @@ RSpec.describe :agg do
|
|
87
87
|
include ReeDao::AggregateDSL
|
88
88
|
|
89
89
|
aggregate :agg_users do
|
90
|
-
link :users, from: :ree_dao_agg_test
|
90
|
+
link :users, from: :ree_dao_agg_test, import: -> { User }
|
91
91
|
link :organizations_dao, from: :ree_dao_agg_test
|
92
92
|
link :user_passports, from: :ree_dao_agg_test
|
93
93
|
link :books, from: :ree_dao_agg_test
|
@@ -98,6 +98,7 @@ RSpec.describe :agg do
|
|
98
98
|
link :agg, from: :ree_dao
|
99
99
|
end
|
100
100
|
|
101
|
+
agg_contract_for User
|
101
102
|
def call(ids_or_scope, **opts)
|
102
103
|
agg(users, ids_or_scope, **opts) do |users_list|
|
103
104
|
belongs_to :organization
|
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.103
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ruslan Gatiyatov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ree
|
@@ -331,6 +331,7 @@ files:
|
|
331
331
|
- lib/ree_lib/packages/ree_dao/package/ree_dao/dataset_extensions.rb
|
332
332
|
- lib/ree_lib/packages/ree_dao/package/ree_dao/dsl.rb
|
333
333
|
- lib/ree_lib/packages/ree_dao/package/ree_dao/functions/agg.rb
|
334
|
+
- lib/ree_lib/packages/ree_dao/package/ree_dao/functions/agg_contract_for.rb
|
334
335
|
- lib/ree_lib/packages/ree_dao/package/ree_dao/functions/build_connection.rb
|
335
336
|
- lib/ree_lib/packages/ree_dao/package/ree_dao/functions/build_dao.rb
|
336
337
|
- lib/ree_lib/packages/ree_dao/package/ree_dao/functions/build_pg_connection.rb
|
@@ -343,6 +344,7 @@ files:
|
|
343
344
|
- lib/ree_lib/packages/ree_dao/package/ree_dao/wrappers/pg_jsonb.rb
|
344
345
|
- lib/ree_lib/packages/ree_dao/schemas/ree_dao/beans/connections.schema.json
|
345
346
|
- lib/ree_lib/packages/ree_dao/schemas/ree_dao/functions/agg.schema.json
|
347
|
+
- lib/ree_lib/packages/ree_dao/schemas/ree_dao/functions/agg_contract_for.schema.json
|
346
348
|
- lib/ree_lib/packages/ree_dao/schemas/ree_dao/functions/build_connection.schema.json
|
347
349
|
- lib/ree_lib/packages/ree_dao/schemas/ree_dao/functions/build_dao.schema.json
|
348
350
|
- lib/ree_lib/packages/ree_dao/schemas/ree_dao/functions/build_pg_connection.schema.json
|