rails-on-sorbet 0.3.1 → 0.3.3

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: 0d2e5584be831c2f9ee13193b7330f3c4fcfcb38e23b58e647e447ea44fba206
4
- data.tar.gz: f1dcacdc4b00dd531400fb81b208e2ed0593f241156978adf8846c131c89cdfb
3
+ metadata.gz: d255de247b08a136edde26f15049767590f2e303a78e2551df4ef8998ab84512
4
+ data.tar.gz: 1d6c912134b2345bd3d6e537b99ab1d89f68f6b6c1ad60f9ea9556a8c025ff3f
5
5
  SHA512:
6
- metadata.gz: 5065d66ccba78ecf89b3b0aa3acc1db333b7223d048b5fe6584170d8f87219d3e0cd9a20595b8cd115ab309aaf777ab0a3c16de21d82dd08b2bb1606145f29a1
7
- data.tar.gz: 8054062e2ccb3ef943a08735ecb54358c901ace2b387cc6c25022062b0ccd9ede91ca11498f5e6726d2def2b4097930a35adfccc00ed5dd8c977d80e721bb112
6
+ metadata.gz: 7bb596b03ee49d914a6d555eb646b1074357ea2368d24b2dd5a424ce3265de740ab44cbbd7191095cb39622e6991b77e6affa21762a3f5dad6dba078778fea27
7
+ data.tar.gz: da155d5a8360f016a854a2d9f9ff9b2ee28b60a83f397d6593773730ff4186ecd4af5ed39ca5966f00317862e95235f4479c6ce062ba41cbde709503560ae178
data/CHANGELOG.md CHANGED
@@ -12,6 +12,20 @@ Add changes in new features here. Do not change the gem's version in pull/merge
12
12
  ### Changes
13
13
  -
14
14
 
15
+ ## [0.3.3] - 20.10.2025
16
+
17
+ [Diff](https://github.com/espago/rails-on-sorbet/compare/v0.3.2...v0.3.3)
18
+
19
+ ### Changes
20
+ - Fix tapioca compiler and subtyping for `TypedRelation`
21
+
22
+ ## [0.3.2] - 20.10.2025
23
+
24
+ [Diff](https://github.com/espago/rails-on-sorbet/compare/v0.3.1...v0.3.2)
25
+
26
+ ### Changes
27
+ - Add `extend T::Generic` to `TypedRelation` definitions
28
+
15
29
  ## [0.3.1] - 20.10.2025
16
30
 
17
31
  [Diff](https://github.com/espago/rails-on-sorbet/compare/v0.3.0...v0.3.1)
@@ -54,5 +54,6 @@ module TypedAssociation
54
54
 
55
55
  module CollectionProxy
56
56
  extend T::Generic
57
+ include TypedRelation
57
58
  end
58
59
  end
@@ -3,7 +3,7 @@
3
3
  module Rails
4
4
  module On
5
5
  module Sorbet
6
- VERSION = '0.3.1'
6
+ VERSION = '0.3.3'
7
7
  end
8
8
  end
9
9
  end
@@ -20,26 +20,29 @@ module Tapioca
20
20
  #: -> void
21
21
  def decorate
22
22
  root.create_path(constant) do |klass|
23
- private_relation = klass.create_class('PrivateRelation')
23
+ private_relation = klass.create_class('PrivateRelation', superclass_name: '::ActiveRecord::Relation')
24
24
  private_relation.create_include('::TypedRelation')
25
25
 
26
- private_relation_group_chain = klass.create_class('PrivateRelationGroupChain')
26
+ private_relation_group_chain = klass.create_class('PrivateRelationGroupChain',
27
+ superclass_name: 'PrivateRelation',)
27
28
  private_relation_group_chain.create_include('::TypedRelation::GroupChain')
28
29
 
29
- private_relation_where_chain = klass.create_class('PrivateRelationWhereChain')
30
+ private_relation_where_chain = klass.create_class('PrivateRelationWhereChain', superclass_name: '::ActiveRecord::QueryMethods::WhereChain')
30
31
  private_relation_where_chain.create_include('::TypedRelation::WhereChain')
31
32
 
32
33
 
33
- private_association_relation = klass.create_class('PrivateAssociationRelation')
34
+ private_association_relation = klass.create_class('PrivateAssociationRelation', superclass_name: '::ActiveRecord::AssociationRelation')
34
35
  private_association_relation.create_include('::TypedAssociation::Relation')
35
36
 
36
- private_relation_group_chain = klass.create_class('PrivateAssociationRelationGroupChain')
37
+ private_relation_group_chain = klass.create_class('PrivateAssociationRelationGroupChain',
38
+ superclass_name: 'PrivateAssociationRelation',)
37
39
  private_relation_group_chain.create_include('::TypedAssociation::Relation::GroupChain')
38
40
 
39
- private_relation_where_chain = klass.create_class('PrivateAssociationRelationWhereChain')
41
+ private_relation_where_chain = klass.create_class('PrivateAssociationRelationWhereChain',
42
+ superclass_name: '::ActiveRecord::QueryMethods::WhereChain',)
40
43
  private_relation_where_chain.create_include('::TypedAssociation::Relation::WhereChain')
41
44
 
42
- private_collection_proxy = klass.create_class('PrivateCollectionProxy')
45
+ private_collection_proxy = klass.create_class('PrivateCollectionProxy', superclass_name: '::ActiveRecord::Associations::CollectionProxy')
43
46
  private_collection_proxy.create_include('::TypedAssociation::CollectionProxy')
44
47
  end
45
48
  end
@@ -5,6 +5,8 @@ def TypedRelation(val); end
5
5
 
6
6
  # @abstract
7
7
  module TypedCommonRelationMethods
8
+ extend T::Generic
9
+
8
10
  Elem = type_member(:out)
9
11
 
10
12
  # START CommonRelationMethods
@@ -417,6 +419,7 @@ end
417
419
 
418
420
  # @abstract
419
421
  module TypedRelation
422
+ extend T::Generic
420
423
  Elem = type_member(:out)
421
424
 
422
425
  class << self
@@ -428,6 +431,7 @@ module TypedRelation
428
431
 
429
432
  # @abstract
430
433
  module GroupChain
434
+ extend T::Generic
431
435
  include TypedRelation
432
436
 
433
437
  Elem = type_member(:out)
@@ -469,6 +473,7 @@ module TypedRelation
469
473
 
470
474
  # @abstract
471
475
  module WhereChain
476
+ extend T::Generic
472
477
  Elem = type_member(:out)
473
478
 
474
479
  sig { abstract.params(args: T.untyped).returns(TypedRelation[Elem]) }
@@ -638,6 +643,7 @@ end
638
643
 
639
644
  # @abstract
640
645
  module TypedGeneratedAssociationRelationMethods
646
+ extend T::Generic
641
647
  Elem = type_member(:out)
642
648
 
643
649
  sig { abstract.returns(T::Array[Elem]) }
@@ -807,6 +813,7 @@ module TypedAssociation
807
813
 
808
814
  # @abstract
809
815
  module Relation
816
+ extend T::Generic
810
817
  include TypedCommonRelationMethods
811
818
  include TypedGeneratedAssociationRelationMethods
812
819
 
@@ -821,6 +828,7 @@ module TypedAssociation
821
828
 
822
829
  # @abstract
823
830
  module WhereChain
831
+ extend T::Generic
824
832
  Elem = type_member(:out)
825
833
 
826
834
  sig { abstract.params(args: T.untyped).returns(Relation[Elem]) }
@@ -835,6 +843,7 @@ module TypedAssociation
835
843
 
836
844
  # @abstract
837
845
  module GroupChain
846
+ extend T::Generic
838
847
  include Relation
839
848
 
840
849
  Elem = type_member(:out)
@@ -877,6 +886,8 @@ module TypedAssociation
877
886
 
878
887
  # @abstract
879
888
  module CollectionProxy
889
+ extend T::Generic
890
+ include TypedRelation
880
891
  include TypedCommonRelationMethods
881
892
  include TypedGeneratedAssociationRelationMethods
882
893
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-on-sorbet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mateusz Drewniak