ree_lib 1.1.1 → 1.2.0

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
  SHA256:
3
- metadata.gz: 596e704a3b981b8785fbae6a8548a9b887af02377944a04d5c28589feac5f5e9
4
- data.tar.gz: 9baaefe6121c7c9c952d485b2b42335271c6c112d36fdda9a5c698136a468382
3
+ metadata.gz: 6bc4d8631de1c0c3a6c684730f28796df131d7a9dae3c5ca74864b5494b3b976
4
+ data.tar.gz: ca1154e4e622addc89f4da3cd0ab3e53ea909fa8129686e911796ba0a7f93273
5
5
  SHA512:
6
- metadata.gz: 6557561419a558ed78ccf7ecd7acdd17bb4316c6e437e5344ca57673be59456cc3d17c03ad0d9122792e40a04a7464e925b1bd0f825136c4465e911dd42e1e9b
7
- data.tar.gz: c4f0fd920373f229cc7d22a977542073a81d3c768da10d689a4aff4207814c87f12267721b0654f552c854e6c065a76301d73ffe97598b055e412b2e54fa22be
6
+ metadata.gz: 778dbf087c22dc7ccbe0305db22270463c83b5cc2f4a2c24840581edf0f670cf0b5d4b2acc1c7a0bbb60767cc0702a5e5f5d17270e2836c60387e4230d3b477d
7
+ data.tar.gz: 3c272e17d4b76ac7cee20be42084c9355c04e072326be94ef6943e5c728378b51169aab972b311b93cb4710636e2891a57309123922bb36b6082d016826214c4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ree_lib (1.1.1)
4
+ ree_lib (1.2.0)
5
5
  bigdecimal (~> 3.1.9)
6
6
  binding_of_caller (~> 1.0.1)
7
7
  i18n (~> 1.14.7)
@@ -0,0 +1,14 @@
1
+ module ReeDao
2
+ module BuildMethods
3
+ def self.extended(base)
4
+ base.include(InstanceMethods)
5
+ end
6
+
7
+ module InstanceMethods
8
+ def build(...)
9
+ dto_class = self.opts[:schema_mapper].dto(:db_load)
10
+ dto_class.build(...)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -10,6 +10,7 @@ class ReeDao::BuildConnection
10
10
  fn :build_connection do
11
11
  link :connections
12
12
  link 'ree_dao/dataset_extensions', -> { DatasetExtensions }
13
+ link 'ree_dao/build_methods', -> { BuildMethods }
13
14
  end
14
15
 
15
16
  TIMEZONES = [:utc, :local].freeze
@@ -92,6 +93,7 @@ class ReeDao::BuildConnection
92
93
  dataset_class = connection.dataset_class
93
94
  klass = Class.new(dataset_class)
94
95
  klass.extend(ReeDao::DatasetExtensions)
96
+ klass.extend(ReeDao::BuildMethods)
95
97
 
96
98
  connection.dataset_class = klass
97
99
 
@@ -0,0 +1,69 @@
1
+ # frozen_string_literal: true
2
+
3
+ RSpec.describe :build_dto do
4
+ link :build_sqlite_connection, from: :ree_dao
5
+
6
+ let(:connection) { build_sqlite_connection({database: 'sqlite_db'}) }
7
+
8
+ before :all do
9
+ Ree.enable_irb_mode
10
+ end
11
+
12
+ after do
13
+ Ree.disable_irb_mode
14
+ end
15
+
16
+ it {
17
+ module TestBuildDto
18
+ include Ree::PackageDSL
19
+
20
+ package do
21
+ depends_on :ree_dao
22
+ depends_on :ree_dto
23
+ end
24
+
25
+ class Db
26
+ include Ree::BeanDSL
27
+
28
+ bean :db do
29
+ singleton
30
+ factory :build
31
+
32
+ link :build_sqlite_connection, from: :ree_dao
33
+ end
34
+
35
+ def build
36
+ build_sqlite_connection({database: 'sqlite_db'})
37
+ end
38
+ end
39
+
40
+ class Project
41
+ include ReeDto::DSL
42
+
43
+ build_dto do
44
+ field :id, Nilor[Integer], default: nil
45
+ field :is_published, Bool, default: true
46
+ end
47
+ end
48
+
49
+ class ProjectsDao
50
+ include ReeDao::DSL
51
+
52
+ dao :projects_dao do
53
+ link :db
54
+ end
55
+
56
+ schema Project do
57
+ integer :id, null: true
58
+ bool :is_published
59
+ end
60
+ end
61
+ end
62
+
63
+ project = TestBuildDto::Project.build(id: 1)
64
+ expect(project.is_published).to eq(true)
65
+
66
+ project = TestBuildDto::ProjectsDao.new.build(id: 2)
67
+ expect(project.is_published).to eq(true)
68
+ }
69
+ end
@@ -395,10 +395,10 @@ RSpec.describe :agg do
395
395
  organizations.delete_all
396
396
  users.delete_all
397
397
 
398
- organization = ReeDaoAggTest::Organization.new(name: "Test Org")
398
+ organization = ReeDaoAggTest::Organization.build(name: "Test Org")
399
399
  organizations.put(organization)
400
400
 
401
- user = ReeDaoAggTest::User.new(name: "John", age: 33, organization_id: organization.id)
401
+ user = ReeDaoAggTest::User.build(name: "John", age: 33, organization_id: organization.id)
402
402
  users.put(user)
403
403
 
404
404
  expect {
@@ -413,37 +413,37 @@ RSpec.describe :agg do
413
413
  books.delete_all
414
414
  chapters.delete_all
415
415
 
416
- organization = ReeDaoAggTest::Organization.new(name: "Test Org")
416
+ organization = ReeDaoAggTest::Organization.build(name: "Test Org")
417
417
  organizations.put(organization)
418
418
 
419
- user_1 = ReeDaoAggTest::User.new(name: "John", age: 33, organization_id: organization.id)
420
- user_2 = ReeDaoAggTest::User.new(name: "Sam", age: 21, organization_id: organization.id)
419
+ user_1 = ReeDaoAggTest::User.build(name: "John", age: 33, organization_id: organization.id)
420
+ user_2 = ReeDaoAggTest::User.build(name: "Sam", age: 21, organization_id: organization.id)
421
421
  users.put(user_1)
422
422
  users.put(user_2)
423
423
 
424
- passport_1 = ReeDaoAggTest::UserPassport.new(user_id: user_1.id, info: "some info")
424
+ passport_1 = ReeDaoAggTest::UserPassport.build(user_id: user_1.id, info: "some info")
425
425
  user_passports.put(passport_1)
426
- user_passports.put(ReeDaoAggTest::UserPassport.new(user_id: user_2.id, info: "another info"))
426
+ user_passports.put(ReeDaoAggTest::UserPassport.build(user_id: user_2.id, info: "another info"))
427
427
 
428
- book_1 = ReeDaoAggTest::Book.new(user_id: user_1.id, title: "1984")
429
- book_2 = ReeDaoAggTest::Book.new(user_id: user_1.id, title: "1408")
428
+ book_1 = ReeDaoAggTest::Book.build(user_id: user_1.id, title: "1984")
429
+ book_2 = ReeDaoAggTest::Book.build(user_id: user_1.id, title: "1408")
430
430
 
431
431
  books.put(book_1)
432
432
  books.put(book_2)
433
433
 
434
- chapter = ReeDaoAggTest::Chapter.new(book_id: book_1.id, title: "beginning")
434
+ chapter = ReeDaoAggTest::Chapter.build(book_id: book_1.id, title: "beginning")
435
435
  chapters.put(chapter)
436
- chapters.put(ReeDaoAggTest::Chapter.new(book_id: book_1.id, title: "interlude"))
437
- chapters.put(ReeDaoAggTest::Chapter.new(book_id: book_1.id, title: "tragic ending"))
438
- chapters.put(ReeDaoAggTest::Chapter.new(book_id: book_2.id, title: "beginning"))
439
- chapters.put(ReeDaoAggTest::Chapter.new(book_id: book_2.id, title: "ending"))
436
+ chapters.put(ReeDaoAggTest::Chapter.build(book_id: book_1.id, title: "interlude"))
437
+ chapters.put(ReeDaoAggTest::Chapter.build(book_id: book_1.id, title: "tragic ending"))
438
+ chapters.put(ReeDaoAggTest::Chapter.build(book_id: book_2.id, title: "beginning"))
439
+ chapters.put(ReeDaoAggTest::Chapter.build(book_id: book_2.id, title: "ending"))
440
440
 
441
441
 
442
- authors.put(ReeDaoAggTest::Author.new(book_id: book_1.id, name: "George Orwell"))
443
- review = ReeDaoAggTest::Review.new(book_id: book_1.id, rating: 10)
442
+ authors.put(ReeDaoAggTest::Author.build(book_id: book_1.id, name: "George Orwell"))
443
+ review = ReeDaoAggTest::Review.build(book_id: book_1.id, rating: 10)
444
444
  reviews.put(review)
445
- reviews.put(ReeDaoAggTest::Review.new(book_id: book_1.id, rating: 7))
446
- review_authors.put(ReeDaoAggTest::ReviewAuthor.new(review_id: review.id, name: "John Review"))
445
+ reviews.put(ReeDaoAggTest::Review.build(book_id: book_1.id, rating: 7))
446
+ review_authors.put(ReeDaoAggTest::ReviewAuthor.build(review_id: review.id, name: "John Review"))
447
447
 
448
448
  res = agg_users.call(
449
449
  users.all,
@@ -458,10 +458,10 @@ RSpec.describe :agg do
458
458
  organizations.delete_all
459
459
  users.delete_all
460
460
 
461
- organization = ReeDaoAggTest::Organization.new(name: "Test Org")
461
+ organization = ReeDaoAggTest::Organization.build(name: "Test Org")
462
462
  organizations.put(organization)
463
463
 
464
- user = ReeDaoAggTest::User.new(name: "John", age: 33, organization_id: organization.id)
464
+ user = ReeDaoAggTest::User.build(name: "John", age: 33, organization_id: organization.id)
465
465
  users.put(user)
466
466
 
467
467
  expect {
@@ -473,24 +473,24 @@ RSpec.describe :agg do
473
473
  organizations.delete_all
474
474
  users.delete_all
475
475
 
476
- organization = ReeDaoAggTest::Organization.new(name: "Test Org")
476
+ organization = ReeDaoAggTest::Organization.build(name: "Test Org")
477
477
  organizations.put(organization)
478
478
 
479
- user_1 = ReeDaoAggTest::User.new(name: "John", age: 33, organization_id: organization.id)
480
- user_2 = ReeDaoAggTest::User.new(name: "Sam", age: 21, organization_id: organization.id)
479
+ user_1 = ReeDaoAggTest::User.build(name: "John", age: 33, organization_id: organization.id)
480
+ user_2 = ReeDaoAggTest::User.build(name: "Sam", age: 21, organization_id: organization.id)
481
481
  users.put(user_1)
482
482
  users.put(user_2)
483
483
 
484
- book_1 = ReeDaoAggTest::Book.new(user_id: user_1.id, title: "1984")
484
+ book_1 = ReeDaoAggTest::Book.build(user_id: user_1.id, title: "1984")
485
485
  books.put(book_1)
486
486
 
487
- authors.put(ReeDaoAggTest::Author.new(book_id: book_1.id, name: "George Orwell"))
488
- chapters.put(ReeDaoAggTest::Chapter.new(book_id: book_1.id, title: "interlude"))
487
+ authors.put(ReeDaoAggTest::Author.build(book_id: book_1.id, name: "George Orwell"))
488
+ chapters.put(ReeDaoAggTest::Chapter.build(book_id: book_1.id, title: "interlude"))
489
489
 
490
490
  res = agg_users_with_dto.call(
491
491
  users.all,
492
492
  to_dto: -> (user) {
493
- ReeDaoAggTest::UserDto.new(
493
+ ReeDaoAggTest::UserDto.build(
494
494
  id: user.id,
495
495
  name: user.name,
496
496
  organization_id: user.organization_id,
@@ -511,15 +511,15 @@ RSpec.describe :agg do
511
511
  organizations.delete_all
512
512
  users.delete_all
513
513
 
514
- org = ReeDaoAggTest::Organization.new(name: "Test Org")
514
+ org = ReeDaoAggTest::Organization.build(name: "Test Org")
515
515
  organizations.put(org)
516
516
 
517
- user = ReeDaoAggTest::User.new(name: "John", age: 33, organization_id: org.id)
517
+ user = ReeDaoAggTest::User.build(name: "John", age: 33, organization_id: org.id)
518
518
  users.put(user)
519
519
 
520
- book_1 = ReeDaoAggTest::Book.new(user_id: user.id, title: "1984")
521
- book_2 = ReeDaoAggTest::Book.new(user_id: user.id, title: "1408")
522
- book_3 = ReeDaoAggTest::Book.new(user_id: user.id, title: "1408")
520
+ book_1 = ReeDaoAggTest::Book.build(user_id: user.id, title: "1984")
521
+ book_2 = ReeDaoAggTest::Book.build(user_id: user.id, title: "1408")
522
+ book_3 = ReeDaoAggTest::Book.build(user_id: user.id, title: "1408")
523
523
 
524
524
  books.put(book_1)
525
525
  books.put(book_2)
@@ -538,37 +538,37 @@ RSpec.describe :agg do
538
538
  books.delete_all
539
539
  chapters.delete_all
540
540
 
541
- organization = ReeDaoAggTest::Organization.new(name: "Test Org")
541
+ organization = ReeDaoAggTest::Organization.build(name: "Test Org")
542
542
  organizations.put(organization)
543
543
 
544
- user_1 = ReeDaoAggTest::User.new(name: "John", age: 33, organization_id: organization.id)
545
- user_2 = ReeDaoAggTest::User.new(name: "Sam", age: 21, organization_id: organization.id)
544
+ user_1 = ReeDaoAggTest::User.build(name: "John", age: 33, organization_id: organization.id)
545
+ user_2 = ReeDaoAggTest::User.build(name: "Sam", age: 21, organization_id: organization.id)
546
546
  users.put(user_1)
547
547
  users.put(user_2)
548
548
 
549
- passport_1 = ReeDaoAggTest::UserPassport.new(user_id: user_1.id, info: "some info")
549
+ passport_1 = ReeDaoAggTest::UserPassport.build(user_id: user_1.id, info: "some info")
550
550
  user_passports.put(passport_1)
551
- user_passports.put(ReeDaoAggTest::UserPassport.new(user_id: user_2.id, info: "another info"))
551
+ user_passports.put(ReeDaoAggTest::UserPassport.build(user_id: user_2.id, info: "another info"))
552
552
 
553
- book_1 = ReeDaoAggTest::Book.new(user_id: user_1.id, title: "1984")
554
- book_2 = ReeDaoAggTest::Book.new(user_id: user_1.id, title: "1408")
553
+ book_1 = ReeDaoAggTest::Book.build(user_id: user_1.id, title: "1984")
554
+ book_2 = ReeDaoAggTest::Book.build(user_id: user_1.id, title: "1408")
555
555
 
556
556
  books.put(book_1)
557
557
  books.put(book_2)
558
558
 
559
- chapter = ReeDaoAggTest::Chapter.new(book_id: book_1.id, title: "beginning")
559
+ chapter = ReeDaoAggTest::Chapter.build(book_id: book_1.id, title: "beginning")
560
560
  chapters.put(chapter)
561
- chapters.put(ReeDaoAggTest::Chapter.new(book_id: book_1.id, title: "interlude"))
562
- chapters.put(ReeDaoAggTest::Chapter.new(book_id: book_1.id, title: "tragic ending"))
563
- chapters.put(ReeDaoAggTest::Chapter.new(book_id: book_2.id, title: "beginning"))
564
- chapters.put(ReeDaoAggTest::Chapter.new(book_id: book_2.id, title: "ending"))
561
+ chapters.put(ReeDaoAggTest::Chapter.build(book_id: book_1.id, title: "interlude"))
562
+ chapters.put(ReeDaoAggTest::Chapter.build(book_id: book_1.id, title: "tragic ending"))
563
+ chapters.put(ReeDaoAggTest::Chapter.build(book_id: book_2.id, title: "beginning"))
564
+ chapters.put(ReeDaoAggTest::Chapter.build(book_id: book_2.id, title: "ending"))
565
565
 
566
566
 
567
- authors.put(ReeDaoAggTest::Author.new(book_id: book_1.id, name: "George Orwell"))
568
- review = ReeDaoAggTest::Review.new(book_id: book_1.id, rating: 10)
567
+ authors.put(ReeDaoAggTest::Author.build(book_id: book_1.id, name: "George Orwell"))
568
+ review = ReeDaoAggTest::Review.build(book_id: book_1.id, rating: 10)
569
569
  reviews.put(review)
570
- reviews.put(ReeDaoAggTest::Review.new(book_id: book_1.id, rating: 7))
571
- review_authors.put(ReeDaoAggTest::ReviewAuthor.new(review_id: review.id, name: "John Review"))
570
+ reviews.put(ReeDaoAggTest::Review.build(book_id: book_1.id, rating: 7))
571
+ review_authors.put(ReeDaoAggTest::ReviewAuthor.build(review_id: review.id, name: "John Review"))
572
572
 
573
573
  res = agg_users.call(
574
574
  users.all,
@@ -595,22 +595,22 @@ RSpec.describe :agg do
595
595
  books.delete_all
596
596
  chapters.delete_all
597
597
 
598
- organization = ReeDaoAggTest::Organization.new(name: "Test Org")
598
+ organization = ReeDaoAggTest::Organization.build(name: "Test Org")
599
599
  organizations.put(organization)
600
600
 
601
- user_1 = ReeDaoAggTest::User.new(name: "John", age: 33, organization_id: organization.id)
602
- user_2 = ReeDaoAggTest::User.new(name: "Sam", age: 21, organization_id: organization.id)
601
+ user_1 = ReeDaoAggTest::User.build(name: "John", age: 33, organization_id: organization.id)
602
+ user_2 = ReeDaoAggTest::User.build(name: "Sam", age: 21, organization_id: organization.id)
603
603
  users.put(user_1)
604
604
  users.put(user_2)
605
605
 
606
- book_1 = ReeDaoAggTest::Book.new(user_id: user_1.id, title: "1984")
607
- book_2 = ReeDaoAggTest::Book.new(user_id: user_1.id, title: "1408")
606
+ book_1 = ReeDaoAggTest::Book.build(user_id: user_1.id, title: "1984")
607
+ book_2 = ReeDaoAggTest::Book.build(user_id: user_1.id, title: "1408")
608
608
 
609
609
  books.put(book_1)
610
610
  books.put(book_2)
611
611
 
612
- author_1 = ReeDaoAggTest::Author.new(book_id: book_1.id, name: "George Orwell")
613
- author_2 = ReeDaoAggTest::Author.new(book_id: book_2.id, name: "Stephen King")
612
+ author_1 = ReeDaoAggTest::Author.build(book_id: book_1.id, name: "George Orwell")
613
+ author_2 = ReeDaoAggTest::Author.build(book_id: book_2.id, name: "Stephen King")
614
614
  authors.put(author_1)
615
615
  authors.put(author_2)
616
616
 
@@ -638,16 +638,16 @@ RSpec.describe :agg do
638
638
  books.delete_all
639
639
  chapters.delete_all
640
640
 
641
- organization = ReeDaoAggTest::Organization.new(name: "Test Org")
641
+ organization = ReeDaoAggTest::Organization.build(name: "Test Org")
642
642
  organizations.put(organization)
643
643
 
644
- user_1 = ReeDaoAggTest::User.new(name: "John", age: 33, organization_id: organization.id)
645
- user_2 = ReeDaoAggTest::User.new(name: "Sam", age: 21, organization_id: organization.id)
644
+ user_1 = ReeDaoAggTest::User.build(name: "John", age: 33, organization_id: organization.id)
645
+ user_2 = ReeDaoAggTest::User.build(name: "Sam", age: 21, organization_id: organization.id)
646
646
  users.put(user_1)
647
647
  users.put(user_2)
648
648
 
649
- book_1 = ReeDaoAggTest::Book.new(user_id: user_1.id, title: "1984")
650
- book_2 = ReeDaoAggTest::Book.new(user_id: user_1.id, title: "1408")
649
+ book_1 = ReeDaoAggTest::Book.build(user_id: user_1.id, title: "1984")
650
+ book_2 = ReeDaoAggTest::Book.build(user_id: user_1.id, title: "1408")
651
651
 
652
652
  books.put(book_1)
653
653
  books.put(book_2)
@@ -675,16 +675,16 @@ RSpec.describe :agg do
675
675
  users.delete_all
676
676
  books.delete_all
677
677
 
678
- organization = ReeDaoAggTest::Organization.new(name: "Test Org")
678
+ organization = ReeDaoAggTest::Organization.build(name: "Test Org")
679
679
  organizations.put(organization)
680
680
 
681
- user_1 = ReeDaoAggTest::User.new(name: "John", age: 33, organization_id: organization.id)
682
- user_2 = ReeDaoAggTest::User.new(name: "Sam", age: 21, organization_id: organization.id)
681
+ user_1 = ReeDaoAggTest::User.build(name: "John", age: 33, organization_id: organization.id)
682
+ user_2 = ReeDaoAggTest::User.build(name: "Sam", age: 21, organization_id: organization.id)
683
683
  users.put(user_1)
684
684
  users.put(user_2)
685
685
 
686
- book_1 = ReeDaoAggTest::Book.new(user_id: user_1.id, title: "1984")
687
- book_2 = ReeDaoAggTest::Book.new(user_id: user_1.id, title: "1408")
686
+ book_1 = ReeDaoAggTest::Book.build(user_id: user_1.id, title: "1984")
687
+ book_2 = ReeDaoAggTest::Book.build(user_id: user_1.id, title: "1408")
688
688
 
689
689
  books.put(book_1)
690
690
  books.put(book_2)
@@ -703,16 +703,16 @@ RSpec.describe :agg do
703
703
  users.delete_all
704
704
  books.delete_all
705
705
 
706
- organization = ReeDaoAggTest::Organization.new(name: "Test Org")
706
+ organization = ReeDaoAggTest::Organization.build(name: "Test Org")
707
707
  organizations.put(organization)
708
708
 
709
- user_1 = ReeDaoAggTest::User.new(name: "John", age: 33, organization_id: organization.id)
710
- user_2 = ReeDaoAggTest::User.new(name: "Sam", age: 21, organization_id: organization.id)
709
+ user_1 = ReeDaoAggTest::User.build(name: "John", age: 33, organization_id: organization.id)
710
+ user_2 = ReeDaoAggTest::User.build(name: "Sam", age: 21, organization_id: organization.id)
711
711
  users.put(user_1)
712
712
  users.put(user_2)
713
713
 
714
- book_1 = ReeDaoAggTest::Book.new(user_id: user_1.id, title: "1984")
715
- book_2 = ReeDaoAggTest::Book.new(user_id: user_1.id, title: "1408")
714
+ book_1 = ReeDaoAggTest::Book.build(user_id: user_1.id, title: "1984")
715
+ book_2 = ReeDaoAggTest::Book.build(user_id: user_1.id, title: "1408")
716
716
 
717
717
  books.put(book_1)
718
718
  books.put(book_2)
@@ -729,23 +729,23 @@ RSpec.describe :agg do
729
729
  books.delete_all
730
730
  chapters.delete_all
731
731
 
732
- organization = ReeDaoAggTest::Organization.new(name: "Test Org")
732
+ organization = ReeDaoAggTest::Organization.build(name: "Test Org")
733
733
  organizations.put(organization)
734
734
 
735
- user_1 = ReeDaoAggTest::User.new(name: "John", age: 33, organization_id: organization.id)
735
+ user_1 = ReeDaoAggTest::User.build(name: "John", age: 33, organization_id: organization.id)
736
736
  users.put(user_1)
737
737
 
738
- book_1 = ReeDaoAggTest::Book.new(user_id: user_1.id, title: "1984")
739
- book_2 = ReeDaoAggTest::Book.new(user_id: user_1.id, title: "1408")
738
+ book_1 = ReeDaoAggTest::Book.build(user_id: user_1.id, title: "1984")
739
+ book_2 = ReeDaoAggTest::Book.build(user_id: user_1.id, title: "1408")
740
740
 
741
741
  books.put(book_1)
742
742
  books.put(book_2)
743
743
 
744
- chapters.put(ReeDaoAggTest::Chapter.new(book_id: book_1.id, title: "beginning"))
745
- chapters.put(ReeDaoAggTest::Chapter.new(book_id: book_1.id, title: "interlude"))
746
- chapters.put(ReeDaoAggTest::Chapter.new(book_id: book_1.id, title: "tragic ending"))
747
- chapters.put(ReeDaoAggTest::Chapter.new(book_id: book_2.id, title: "beginning"))
748
- chapters.put(ReeDaoAggTest::Chapter.new(book_id: book_2.id, title: "ending"))
744
+ chapters.put(ReeDaoAggTest::Chapter.build(book_id: book_1.id, title: "beginning"))
745
+ chapters.put(ReeDaoAggTest::Chapter.build(book_id: book_1.id, title: "interlude"))
746
+ chapters.put(ReeDaoAggTest::Chapter.build(book_id: book_1.id, title: "tragic ending"))
747
+ chapters.put(ReeDaoAggTest::Chapter.build(book_id: book_2.id, title: "beginning"))
748
+ chapters.put(ReeDaoAggTest::Chapter.build(book_id: book_2.id, title: "ending"))
749
749
 
750
750
  res = agg_users.call(
751
751
  users.all,
@@ -764,23 +764,23 @@ RSpec.describe :agg do
764
764
  books.delete_all
765
765
  chapters.delete_all
766
766
 
767
- organization = ReeDaoAggTest::Organization.new(name: "Test Org")
767
+ organization = ReeDaoAggTest::Organization.build(name: "Test Org")
768
768
  organizations.put(organization)
769
769
 
770
- user_1 = ReeDaoAggTest::User.new(name: "John", age: 33, organization_id: organization.id)
770
+ user_1 = ReeDaoAggTest::User.build(name: "John", age: 33, organization_id: organization.id)
771
771
  users.put(user_1)
772
772
 
773
- book_1 = ReeDaoAggTest::Book.new(user_id: user_1.id, title: "1984")
774
- book_2 = ReeDaoAggTest::Book.new(user_id: user_1.id, title: "1408")
773
+ book_1 = ReeDaoAggTest::Book.build(user_id: user_1.id, title: "1984")
774
+ book_2 = ReeDaoAggTest::Book.build(user_id: user_1.id, title: "1408")
775
775
 
776
776
  books.put(book_1)
777
777
  books.put(book_2)
778
778
 
779
- chapters.put(ReeDaoAggTest::Chapter.new(book_id: book_1.id, title: "beginning"))
780
- chapters.put(ReeDaoAggTest::Chapter.new(book_id: book_1.id, title: "interlude"))
781
- chapters.put(ReeDaoAggTest::Chapter.new(book_id: book_1.id, title: "tragic ending"))
782
- chapters.put(ReeDaoAggTest::Chapter.new(book_id: book_2.id, title: "beginning"))
783
- chapters.put(ReeDaoAggTest::Chapter.new(book_id: book_2.id, title: "ending"))
779
+ chapters.put(ReeDaoAggTest::Chapter.build(book_id: book_1.id, title: "beginning"))
780
+ chapters.put(ReeDaoAggTest::Chapter.build(book_id: book_1.id, title: "interlude"))
781
+ chapters.put(ReeDaoAggTest::Chapter.build(book_id: book_1.id, title: "tragic ending"))
782
+ chapters.put(ReeDaoAggTest::Chapter.build(book_id: book_2.id, title: "beginning"))
783
+ chapters.put(ReeDaoAggTest::Chapter.build(book_id: book_2.id, title: "ending"))
784
784
 
785
785
  res = agg_users.call(
786
786
  users.all,
@@ -799,24 +799,24 @@ RSpec.describe :agg do
799
799
  books.delete_all
800
800
  chapters.delete_all
801
801
 
802
- organization = ReeDaoAggTest::Organization.new(name: "Test Org")
802
+ organization = ReeDaoAggTest::Organization.build(name: "Test Org")
803
803
  organizations.put(organization)
804
804
 
805
- user = ReeDaoAggTest::User.new(name: "John", age: 33, organization_id: organization.id)
805
+ user = ReeDaoAggTest::User.build(name: "John", age: 33, organization_id: organization.id)
806
806
  users.put(user)
807
807
 
808
- book = ReeDaoAggTest::Book.new(user_id: user.id, title: "1984")
808
+ book = ReeDaoAggTest::Book.build(user_id: user.id, title: "1984")
809
809
  books.put(book)
810
810
 
811
- chapters.put(ReeDaoAggTest::Chapter.new(book_id: book.id, title: "beginning"))
812
- chapters.put(ReeDaoAggTest::Chapter.new(book_id: book.id, title: "interlude"))
813
- chapters.put(ReeDaoAggTest::Chapter.new(book_id: book.id, title: "tragic ending"))
811
+ chapters.put(ReeDaoAggTest::Chapter.build(book_id: book.id, title: "beginning"))
812
+ chapters.put(ReeDaoAggTest::Chapter.build(book_id: book.id, title: "interlude"))
813
+ chapters.put(ReeDaoAggTest::Chapter.build(book_id: book.id, title: "tragic ending"))
814
814
 
815
- authors.put(ReeDaoAggTest::Author.new(book_id: book.id, name: "George Orwell"))
815
+ authors.put(ReeDaoAggTest::Author.build(book_id: book.id, name: "George Orwell"))
816
816
 
817
- review = ReeDaoAggTest::Review.new(book_id: book.id, rating: 5)
817
+ review = ReeDaoAggTest::Review.build(book_id: book.id, rating: 5)
818
818
  reviews.put(review)
819
- review_authors.put(ReeDaoAggTest::ReviewAuthor.new(review_id: review.id, name: "John"))
819
+ review_authors.put(ReeDaoAggTest::ReviewAuthor.build(review_id: review.id, name: "John"))
820
820
 
821
821
  res = agg_users_autoload_books_children.call(
822
822
  users.all,
@@ -838,24 +838,24 @@ RSpec.describe :agg do
838
838
  books.delete_all
839
839
  chapters.delete_all
840
840
 
841
- organization = ReeDaoAggTest::Organization.new(name: "Test Org")
841
+ organization = ReeDaoAggTest::Organization.build(name: "Test Org")
842
842
  organizations.put(organization)
843
843
 
844
- user = ReeDaoAggTest::User.new(name: "John", age: 33, organization_id: organization.id)
844
+ user = ReeDaoAggTest::User.build(name: "John", age: 33, organization_id: organization.id)
845
845
  users.put(user)
846
846
 
847
- book = ReeDaoAggTest::Book.new(user_id: user.id, title: "1984")
847
+ book = ReeDaoAggTest::Book.build(user_id: user.id, title: "1984")
848
848
  books.put(book)
849
849
 
850
- chapters.put(ReeDaoAggTest::Chapter.new(book_id: book.id, title: "beginning"))
851
- chapters.put(ReeDaoAggTest::Chapter.new(book_id: book.id, title: "interlude"))
852
- chapters.put(ReeDaoAggTest::Chapter.new(book_id: book.id, title: "tragic ending"))
850
+ chapters.put(ReeDaoAggTest::Chapter.build(book_id: book.id, title: "beginning"))
851
+ chapters.put(ReeDaoAggTest::Chapter.build(book_id: book.id, title: "interlude"))
852
+ chapters.put(ReeDaoAggTest::Chapter.build(book_id: book.id, title: "tragic ending"))
853
853
 
854
- authors.put(ReeDaoAggTest::Author.new(book_id: book.id, name: "George Orwell"))
854
+ authors.put(ReeDaoAggTest::Author.build(book_id: book.id, name: "George Orwell"))
855
855
 
856
- review = ReeDaoAggTest::Review.new(book_id: book.id, rating: 5)
856
+ review = ReeDaoAggTest::Review.build(book_id: book.id, rating: 5)
857
857
  reviews.put(review)
858
- review_authors.put(ReeDaoAggTest::ReviewAuthor.new(review_id: review.id, name: "John"))
858
+ review_authors.put(ReeDaoAggTest::ReviewAuthor.build(review_id: review.id, name: "John"))
859
859
 
860
860
  res = agg_users_autoload_reviews_children.call(
861
861
  users.all,
@@ -876,13 +876,13 @@ RSpec.describe :agg do
876
876
  user_passports.delete_all
877
877
  books.delete_all
878
878
 
879
- organization = ReeDaoAggTest::Organization.new(name: "Test Org")
879
+ organization = ReeDaoAggTest::Organization.build(name: "Test Org")
880
880
  organizations.put(organization)
881
881
 
882
- user_1 = ReeDaoAggTest::User.new(name: "John", age: 33, organization_id: organization.id)
882
+ user_1 = ReeDaoAggTest::User.build(name: "John", age: 33, organization_id: organization.id)
883
883
  users.put(user_1)
884
884
 
885
- book_1 = ReeDaoAggTest::Book.new(user_id: user_1.id, title: "1984")
885
+ book_1 = ReeDaoAggTest::Book.build(user_id: user_1.id, title: "1984")
886
886
 
887
887
  books.put(book_1)
888
888
 
@@ -899,23 +899,23 @@ RSpec.describe :agg do
899
899
  books.delete_all
900
900
  chapters.delete_all
901
901
 
902
- organization = ReeDaoAggTest::Organization.new(name: "Test Org")
902
+ organization = ReeDaoAggTest::Organization.build(name: "Test Org")
903
903
  organizations.put(organization)
904
904
 
905
- user_1 = ReeDaoAggTest::User.new(name: "John", age: 33, organization_id: organization.id)
905
+ user_1 = ReeDaoAggTest::User.build(name: "John", age: 33, organization_id: organization.id)
906
906
  users.put(user_1)
907
907
 
908
- book_1 = ReeDaoAggTest::Book.new(user_id: user_1.id, title: "1984")
909
- book_2 = ReeDaoAggTest::Book.new(user_id: user_1.id, title: "1408")
908
+ book_1 = ReeDaoAggTest::Book.build(user_id: user_1.id, title: "1984")
909
+ book_2 = ReeDaoAggTest::Book.build(user_id: user_1.id, title: "1408")
910
910
 
911
911
  books.put(book_1)
912
912
  books.put(book_2)
913
913
 
914
- chapters.put(ReeDaoAggTest::Chapter.new(book_id: book_1.id, title: "beginning"))
915
- chapters.put(ReeDaoAggTest::Chapter.new(book_id: book_1.id, title: "interlude"))
916
- chapters.put(ReeDaoAggTest::Chapter.new(book_id: book_1.id, title: "tragic ending"))
917
- chapters.put(ReeDaoAggTest::Chapter.new(book_id: book_2.id, title: "beginning"))
918
- chapters.put(ReeDaoAggTest::Chapter.new(book_id: book_2.id, title: "ending"))
914
+ chapters.put(ReeDaoAggTest::Chapter.build(book_id: book_1.id, title: "beginning"))
915
+ chapters.put(ReeDaoAggTest::Chapter.build(book_id: book_1.id, title: "interlude"))
916
+ chapters.put(ReeDaoAggTest::Chapter.build(book_id: book_1.id, title: "tragic ending"))
917
+ chapters.put(ReeDaoAggTest::Chapter.build(book_id: book_2.id, title: "beginning"))
918
+ chapters.put(ReeDaoAggTest::Chapter.build(book_id: book_2.id, title: "ending"))
919
919
 
920
920
  res = agg_users.call(
921
921
  users.all,
@@ -933,11 +933,11 @@ RSpec.describe :agg do
933
933
  organizations.delete_all
934
934
  users.delete_all
935
935
 
936
- organization = ReeDaoAggTest::Organization.new(name: "Test Org")
936
+ organization = ReeDaoAggTest::Organization.build(name: "Test Org")
937
937
  organizations.put(organization)
938
938
 
939
- user_1 = ReeDaoAggTest::User.new(name: "John", age: 33, organization_id: organization.id)
940
- user_2 = ReeDaoAggTest::User.new(name: "Sam", age: 21, organization_id: organization.id)
939
+ user_1 = ReeDaoAggTest::User.build(name: "John", age: 33, organization_id: organization.id)
940
+ user_2 = ReeDaoAggTest::User.build(name: "Sam", age: 21, organization_id: organization.id)
941
941
  users.put(user_1)
942
942
  users.put(user_2)
943
943
 
@@ -951,10 +951,10 @@ RSpec.describe :agg do
951
951
  organizations.delete_all
952
952
  users.delete_all
953
953
 
954
- organization = ReeDaoAggTest::Organization.new(name: "Test Org")
954
+ organization = ReeDaoAggTest::Organization.build(name: "Test Org")
955
955
  organizations.put(organization)
956
956
 
957
- user_1 = ReeDaoAggTest::User.new(name: "John", age: 33, organization_id: organization.id)
957
+ user_1 = ReeDaoAggTest::User.build(name: "John", age: 33, organization_id: organization.id)
958
958
  users.put(user_1)
959
959
 
960
960
  res = agg(users, user_1.id)
@@ -965,11 +965,11 @@ RSpec.describe :agg do
965
965
  organizations.delete_all
966
966
  users.delete_all
967
967
 
968
- organization = ReeDaoAggTest::Organization.new(name: "Test Org")
968
+ organization = ReeDaoAggTest::Organization.build(name: "Test Org")
969
969
  organizations.put(organization)
970
970
 
971
- user_1 = ReeDaoAggTest::User.new(name: "John", age: 33, organization_id: organization.id)
972
- user_2 = ReeDaoAggTest::User.new(name: "Sam", age: 21, organization_id: organization.id)
971
+ user_1 = ReeDaoAggTest::User.build(name: "John", age: 33, organization_id: organization.id)
972
+ user_2 = ReeDaoAggTest::User.build(name: "Sam", age: 21, organization_id: organization.id)
973
973
  users.put(user_1)
974
974
  users.put(user_2)
975
975
 
@@ -979,9 +979,9 @@ RSpec.describe :agg do
979
979
 
980
980
  context "when sync mode enabled" do
981
981
  it {
982
- organization = ReeDaoAggTest::Organization.new(name: "Test Org")
982
+ organization = ReeDaoAggTest::Organization.build(name: "Test Org")
983
983
  organizations.put(organization)
984
- user = ReeDaoAggTest::User.new(name: "John", age: 33, organization_id: organization.id)
984
+ user = ReeDaoAggTest::User.build(name: "John", age: 33, organization_id: organization.id)
985
985
  users.put(user)
986
986
 
987
987
  allow(user).to receive(:some_field=)
@@ -128,7 +128,7 @@ RSpec.describe :one_to_one do
128
128
  project = TestOneToOne::Project.new(id: 1)
129
129
 
130
130
  project.set_project_user(
131
- TestOneToOne::ProjectUser.new
131
+ TestOneToOne::ProjectUser.build
132
132
  )
133
133
 
134
134
  TestOneToOne::ProjectsDao.new.put(project)
@@ -112,11 +112,11 @@ RSpec.describe :persist_assoc do
112
112
  project = TestPersistAssoc::Project.new(id: 1)
113
113
 
114
114
  project.add_project_user(
115
- TestPersistAssoc::ProjectUser.new
115
+ TestPersistAssoc::ProjectUser.build
116
116
  )
117
117
 
118
118
  project.add_project_user(
119
- TestPersistAssoc::ProjectUser.new
119
+ TestPersistAssoc::ProjectUser.build
120
120
  )
121
121
 
122
122
  TestPersistAssoc::ProjectsDao.new.put(project)
@@ -138,11 +138,11 @@ RSpec.describe :persist_assoc do
138
138
  project = TestPersistAssoc::Project.new(id: 2)
139
139
 
140
140
  project.add_project_user(
141
- TestPersistAssoc::ProjectUser.new
141
+ TestPersistAssoc::ProjectUser.build
142
142
  )
143
143
 
144
144
  project.add_project_user(
145
- TestPersistAssoc::ProjectUser.new
145
+ TestPersistAssoc::ProjectUser.build
146
146
  )
147
147
 
148
148
  TestPersistAssoc::ProjectsDao.new.put(project)
@@ -6,27 +6,34 @@ class ReeDto::DtoBuilder
6
6
  link "ree_dto/dto/field_meta", -> { FieldMeta }
7
7
  link "ree_dto/dto/collection_meta", -> { CollectionMeta }
8
8
 
9
- attr_reader :fields, :collections
9
+ attr_reader :fields, :fields_with_default, :collections
10
10
 
11
11
  def initialize(klass)
12
12
  @klass = klass
13
13
  @fields = []
14
+ @fields_with_default = []
14
15
  @collections = []
15
16
  end
16
17
 
17
- contract(Symbol, Any, Kwargs[setter: Bool, default: Any] => FieldMeta)
18
- def field(name, contract, setter: true, default: FieldMeta::NONE)
18
+ contract(Symbol, Any, Kwargs[setter: Bool, default: Any, field_type: Symbol] => FieldMeta)
19
+ def field(name, contract, setter: true, default: FieldMeta::NONE, field_type: :custom)
19
20
  existing = @fields.find { _1.name == name }
20
21
 
21
22
  if existing
22
23
  raise ArgumentError.new("field :#{name} already defined for #{@klass}")
23
24
  end
24
25
 
25
- field = FieldMeta.new(name, contract, setter, default)
26
+ field = FieldMeta.new(name, contract, setter, default, field_type)
26
27
  @fields << field
28
+ @fields_with_default << field if field.has_default?
27
29
  field
28
30
  end
29
31
 
32
+ contract(Symbol, Any, Kwargs[setter: Bool, default: Any] => FieldMeta)
33
+ def db_field(name, contract, setter: true, default: FieldMeta::NONE)
34
+ field(name, contract, setter: setter, default: default, field_type: :db)
35
+ end
36
+
30
37
  contract Symbol, Any, Optblock => CollectionMeta
31
38
  def collection(name, contract, &proc)
32
39
  existing = @collections.find { _1.name == name }
@@ -10,17 +10,38 @@ module ReeDto::DtoClassMethods
10
10
  @fields ||= []
11
11
  end
12
12
 
13
+ contract None => ArrayOf[ReeDto::FieldMeta]
14
+ def fields_with_default
15
+ @fields_with_default ||= []
16
+ end
17
+
13
18
  contract None => ArrayOf[ReeDto::CollectionMeta]
14
19
  def collections
15
20
  @collections ||= []
16
21
  end
17
22
 
23
+ def build(attrs = nil, **kwargs)
24
+ dto_obj = new(attrs || kwargs)
25
+ set_attrs = attrs ? attrs.keys : kwargs.keys
26
+ fields_to_set = fields_with_default.reject{ set_attrs.include?(_1.name) }
27
+
28
+ fields_to_set.each do |field|
29
+ dto_obj.set_attr(field.name, field.default)
30
+ end
31
+
32
+ dto_obj
33
+ end
34
+
18
35
  private
19
36
 
20
37
  def set_fields(v)
21
38
  @fields = v
22
39
  end
23
40
 
41
+ def set_fields_with_default(v)
42
+ @fields_with_default = v
43
+ end
44
+
24
45
  def set_collections(v)
25
46
  @collections = v
26
47
  end
@@ -42,15 +42,8 @@ module ReeDto::DtoInstanceMethods
42
42
 
43
43
  contract Symbol => Any
44
44
  def get_value(name)
45
- @_attrs.fetch(name) do
46
- meta = get_meta(name)
47
-
48
- if !meta.has_default?
49
- raise FieldNotSetError.new("field `#{name}` not set for: #{self}")
50
- else
51
- @_attrs[name] = meta.default
52
- end
53
- end
45
+ return @_attrs[name] unless @_attrs[name].nil?
46
+ get_nil_or_raise(name)
54
47
  end
55
48
 
56
49
  contract None => Hash
@@ -82,7 +75,7 @@ module ReeDto::DtoInstanceMethods
82
75
 
83
76
  contract Symbol => Bool
84
77
  def has_value?(name)
85
- @_attrs.key?(name) || get_meta(name).has_default?
78
+ @_attrs.key?(name)
86
79
  end
87
80
 
88
81
  contract None => ArrayOf[Symbol]
@@ -161,4 +154,9 @@ module ReeDto::DtoInstanceMethods
161
154
  v.inspect
162
155
  end
163
156
  end
157
+
158
+ def get_nil_or_raise(name)
159
+ return if @_attrs.has_key?(name)
160
+ raise FieldNotSetError.new("field `#{name}` not set for: #{self}")
161
+ end
164
162
  end
@@ -4,14 +4,15 @@ class ReeDto::FieldMeta
4
4
 
5
5
  NONE = Object.new.freeze
6
6
 
7
- attr_reader :name, :contract, :setter, :default
7
+ attr_reader :name, :contract, :setter, :default, :field_type
8
8
 
9
- contract Symbol, Any, Bool, Any => Any
10
- def initialize(name, contract, setter, default)
9
+ contract Symbol, Any, Bool, Any, Symbol => Any
10
+ def initialize(name, contract, setter, default, field_type)
11
11
  @name = name
12
12
  @contract = contract
13
13
  @setter = setter
14
14
  @default = default
15
+ @field_type = field_type
15
16
  end
16
17
 
17
18
  contract None => Bool
@@ -23,6 +23,7 @@ class ReeDto::BuildDto
23
23
  builder.instance_exec(&proc)
24
24
 
25
25
  klass.send(:set_fields, builder.fields)
26
+ klass.send(:set_fields_with_default, builder.fields_with_default)
26
27
  klass.send(:set_collections, builder.collections)
27
28
 
28
29
  builder.fields.each do |field|
@@ -38,16 +38,23 @@ RSpec.describe ReeDto::DSL do
38
38
  }
39
39
 
40
40
  it {
41
- dto = ReeDto::DtoClass.new
41
+ dto = ReeDto::DtoClass.build
42
+
42
43
  expect(dto.with_default).to eq(1)
43
44
 
44
- dto = ReeDto::DtoClass.new({})
45
+ dto = ReeDto::DtoClass.build({})
45
46
  expect(dto.with_default).to eq(1)
46
47
  expect(dto.get_value(:with_default)).to eq(1)
47
48
  }
48
49
 
49
50
  it {
50
51
  dto = ReeDto::DtoClass.new
52
+ expect(dto.has_value?(:with_default)).to eq(false)
53
+ expect(dto.has_value?(:string)).to eq(false)
54
+ }
55
+
56
+ it {
57
+ dto = ReeDto::DtoClass.build
51
58
  expect(dto.has_value?(:with_default)).to eq(true)
52
59
  expect(dto.has_value?(:string)).to eq(false)
53
60
  }
@@ -60,6 +67,26 @@ RSpec.describe ReeDto::DSL do
60
67
  it {
61
68
  dto = ReeDto::DtoClass.new
62
69
 
70
+ expect {
71
+ dto.string
72
+ }.to raise_error do |e|
73
+ expect(e.message).to eq("field `string` not set for: #<dto ReeDto::DtoClass >")
74
+ end
75
+ }
76
+
77
+ it {
78
+ dto = ReeDto::DtoClass.new
79
+
80
+ expect {
81
+ dto.with_default
82
+ }.to raise_error do |e|
83
+ expect(e.message).to eq("field `with_default` not set for: #<dto ReeDto::DtoClass >")
84
+ end
85
+ }
86
+
87
+ it {
88
+ dto = ReeDto::DtoClass.build
89
+
63
90
  expect {
64
91
  dto.string
65
92
  }.to raise_error do |e|
@@ -86,6 +113,20 @@ RSpec.describe ReeDto::DSL do
86
113
  values << value
87
114
  end
88
115
 
116
+ expect(fields).to eq([])
117
+ expect(values).to eq([])
118
+ }
119
+
120
+ it {
121
+ dto = ReeDto::DtoClass.build
122
+ fields = []
123
+ values = []
124
+
125
+ dto.each_field do |name, value|
126
+ fields << name
127
+ values << value
128
+ end
129
+
89
130
  expect(fields).to eq([:with_default])
90
131
  expect(values).to eq([1])
91
132
  }
@@ -169,16 +210,16 @@ RSpec.describe ReeDto::DSL do
169
210
 
170
211
  it {
171
212
  expect(
172
- ReeDto::DtoClass.new(string: "str")
213
+ ReeDto::DtoClass.build(string: "str")
173
214
  ).not_to eq(
174
- ReeDto::DtoClass.new(string: "str", with_default: 2)
215
+ ReeDto::DtoClass.build(string: "str", with_default: 2)
175
216
  )
176
217
  }
177
218
  end
178
219
 
179
220
  describe "#to_h" do
180
221
  it {
181
- dto = ReeDto::DtoClass.new(string: "str")
222
+ dto = ReeDto::DtoClass.build(string: "str")
182
223
  expect(dto.to_h).to eq({ string: "str", with_default: 1 })
183
224
  }
184
225
  end
@@ -3,7 +3,7 @@
3
3
  class ReeMapper::ReeDtoOutput < ReeMapper::StrategyOutput
4
4
  contract(None => Any)
5
5
  def build_object
6
- dto.new
6
+ dto.build
7
7
  end
8
8
 
9
9
  contract(Object, ReeMapper::Field, Any => nil)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ReeLib
4
- VERSION = "1.1.1"
4
+ VERSION = "1.2.0"
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ree_lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruslan Gatiyatov
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-03-07 00:00:00.000000000 Z
10
+ date: 2025-05-13 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: ree
@@ -312,6 +312,7 @@ files:
312
312
  - lib/ree_lib/packages/ree_dao/package/ree_dao/association_methods.rb
313
313
  - lib/ree_lib/packages/ree_dao/package/ree_dao/associations.rb
314
314
  - lib/ree_lib/packages/ree_dao/package/ree_dao/beans/connections.rb
315
+ - lib/ree_lib/packages/ree_dao/package/ree_dao/build_methods.rb
315
316
  - lib/ree_lib/packages/ree_dao/package/ree_dao/contract/dao_dataset_contract.rb
316
317
  - lib/ree_lib/packages/ree_dao/package/ree_dao/contract/dto_contract.rb
317
318
  - lib/ree_lib/packages/ree_dao/package/ree_dao/contract/entity_contract.rb
@@ -329,6 +330,7 @@ files:
329
330
  - lib/ree_lib/packages/ree_dao/package/ree_dao/thread_parents.rb
330
331
  - lib/ree_lib/packages/ree_dao/package/ree_dao/wrappers/pg_array.rb
331
332
  - lib/ree_lib/packages/ree_dao/package/ree_dao/wrappers/pg_jsonb.rb
333
+ - lib/ree_lib/packages/ree_dao/spec/ree_dao/functions/build_dto_spec.rb
332
334
  - lib/ree_lib/packages/ree_dao/spec/ree_dao/functions/build_pg_connection_spec.rb
333
335
  - lib/ree_lib/packages/ree_dao/spec/ree_dao/functions/build_sqlite_connection/max_connections_spec.rb
334
336
  - lib/ree_lib/packages/ree_dao/spec/ree_dao/functions/build_sqlite_connection_spec.rb