rails-on-sorbet 0.5.0 → 0.6.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: 3ea28926ab10cc0fcae86ab5b28f3f0edcb837c108b2dce06dc4a0630dcf5b87
4
- data.tar.gz: 6dd9264a458700cb250c6c75314475ed542f84bc4d9dcfa7dffe040db8939984
3
+ metadata.gz: b4812fc020427c13b159bdb9efef7c237a4b400a6ac2dee02746193f2a483777
4
+ data.tar.gz: ce29ecb1f8d1176e7ca596430fd17c883a32a14801061f9aeaea21b1724504b3
5
5
  SHA512:
6
- metadata.gz: a7ce2795b1153542782e7b62764c71af68d7dbbf62fb0eed0b4b626d112d585ef70901138a88c8d6309649d7df5d8e769e5d2c15b4525e1207948c0819638e4b
7
- data.tar.gz: ccd02ca4092d27b855f657847d89facf82f8a3737bbba890343095a84a4acfbb2d9d4f46796f0f0adeded61e1709a28cf0b8a040eb39082c230f02af29de1aaa
6
+ metadata.gz: ff2e0aa0fa03716b215d63f3548e7c6c5d6572831697115ae31db4c8df7af146fc01972fa23c105dc2f47d6f649706f3e0297777f4ff2353fbf80abff61dc731
7
+ data.tar.gz: 6564143b63c4d46f0c4bfa9a7fddd5c3ec2688c29a0d8a961545c6a78fe5fa9348dc0c1dd46c5d2823a1842ebbb3d90eb0029b1c1af8adb2fb715a0c15520249
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.6.0] - 16.01.2026
16
+
17
+ [Diff](https://github.com/espago/rails-on-sorbet/compare/v0.5.1...v0.6.0)
18
+
19
+ ### Breaking changes
20
+ - Remove `TypedAssociated::Relation`, `TypedAssociation::Relation::GroupChain`, `TypedAssociation::Relation::WhereChain` in favour of `TypedRelation`, `TypedRelation::GroupChain`, `TypedRelation::WhereChain` respectively
21
+
22
+ ## [0.5.1] - 30.12.2025
23
+
24
+ [Diff](https://github.com/espago/rails-on-sorbet/compare/v0.5.0...v0.5.1)
25
+
26
+ ### Changes
27
+ - Fix RBI signatures for `TypedRelation`
28
+
15
29
  ## [0.5.0] - 30.12.2025
16
30
 
17
31
  [Diff](https://github.com/espago/rails-on-sorbet/compare/v0.4.0...v0.5.0)
@@ -32,26 +32,6 @@ module TypedAssociation
32
32
  def CollectionProxy(val) = val # rubocop:disable Naming/MethodName
33
33
  end
34
34
 
35
- # Represents a `X::PrivateAssociationRelation` tapioca generated class, where `X` is an ActiveRecord model.
36
- module Relation
37
- extend T::Generic
38
-
39
- class << self
40
- def GroupChain(val) = val # rubocop:disable Naming/MethodName
41
- def WhereChain(val) = val # rubocop:disable Naming/MethodName
42
- def CollectionProxy(val) = val # rubocop:disable Naming/MethodName
43
- end
44
-
45
- module GroupChain
46
- extend T::Generic
47
- include Relation
48
- end
49
-
50
- module WhereChain
51
- extend T::Generic
52
- end
53
- end
54
-
55
35
  module CollectionProxy
56
36
  extend T::Generic
57
37
  include TypedRelation
@@ -3,7 +3,7 @@
3
3
  module Rails
4
4
  module On
5
5
  module Sorbet
6
- VERSION = '0.5.0'
6
+ VERSION = '0.6.0'
7
7
  end
8
8
  end
9
9
  end
@@ -36,19 +36,19 @@ module Tapioca
36
36
  fixed: klass.fully_qualified_name,)
37
37
 
38
38
  private_association_relation = klass.create_class('PrivateAssociationRelation', superclass_name: '::ActiveRecord::AssociationRelation')
39
- private_association_relation.create_include('::TypedAssociation::Relation')
39
+ private_association_relation.create_include('::TypedRelation')
40
40
  private_association_relation.create_type_variable('Elem', type: 'type_member',
41
41
  fixed: klass.fully_qualified_name,)
42
42
 
43
43
  private_relation_group_chain = klass.create_class('PrivateAssociationRelationGroupChain',
44
44
  superclass_name: 'PrivateAssociationRelation',)
45
- private_relation_group_chain.create_include('::TypedAssociation::Relation::GroupChain')
45
+ private_relation_group_chain.create_include('::TypedRelation::GroupChain')
46
46
  private_relation_group_chain.create_type_variable('Elem', type: 'type_member',
47
47
  fixed: klass.fully_qualified_name,)
48
48
 
49
49
  private_relation_where_chain = klass.create_class('PrivateAssociationRelationWhereChain',
50
50
  superclass_name: '::ActiveRecord::QueryMethods::WhereChain',)
51
- private_relation_where_chain.create_include('::TypedAssociation::Relation::WhereChain')
51
+ private_relation_where_chain.create_include('::TypedRelation::WhereChain')
52
52
  private_relation_where_chain.create_type_variable('Elem', type: 'type_member',
53
53
  fixed: klass.fully_qualified_name,)
54
54
 
@@ -7,7 +7,7 @@ def TypedRelation(val); end
7
7
  # @abstract
8
8
  module TypedCommonRelationMethods
9
9
  extend T::Generic
10
- include Enumerable[Elem]
10
+ include Enumerable
11
11
 
12
12
  Elem = type_member(:out)
13
13
 
@@ -699,7 +699,7 @@ module TypedGeneratedAssociationRelationMethods
699
699
  sig { abstract.params(args: T.untyped, blk: T.untyped).returns(T.self_type) }
700
700
  def from(*args, &blk); end
701
701
 
702
- sig { abstract.params(args: T.untyped, blk: T.untyped).returns(TypedAssociation::Relation::GroupChain[Elem]) }
702
+ sig { abstract.params(args: T.untyped, blk: T.untyped).returns(TypedRelation::GroupChain[Elem]) }
703
703
  def group(*args, &blk); end
704
704
 
705
705
  sig { abstract.params(args: T.untyped, blk: T.untyped).returns(T.self_type) }
@@ -800,7 +800,7 @@ module TypedGeneratedAssociationRelationMethods
800
800
  sig { abstract.params(args: T.untyped, blk: T.untyped).returns(T.self_type) }
801
801
  def unscope(*args, &blk); end
802
802
 
803
- sig { returns(TypedAssociation::Relation::WhereChain[Elem]) }
803
+ sig { returns(TypedRelation::WhereChain[Elem]) }
804
804
  sig { params(args: T.untyped).returns(T.self_type) }
805
805
  def where(*args); end
806
806
 
@@ -816,85 +816,12 @@ end
816
816
 
817
817
  module TypedAssociation
818
818
  class << self
819
- #: (::ActiveRecord::Relation) -> TypedAssociation::Relation[untyped]
819
+ #: (::ActiveRecord::Relation) -> TypedRelation[untyped]
820
820
  def Relation(val); end
821
821
  #: (::ActiveRecord::Associations::CollectionProxy) -> CollectionProxy[untyped]
822
822
  def CollectionProxy(val); end
823
823
  end
824
824
 
825
- # @abstract
826
- module Relation
827
- extend T::Generic
828
- include TypedCommonRelationMethods
829
- include TypedGeneratedAssociationRelationMethods
830
-
831
- Elem = type_member(:out)
832
-
833
- class << self
834
- #: (ActiveRecord::Relation) -> TypedAssociation::Relation::GroupChain[untyped]
835
- def GroupChain(val); end
836
- #: (ActiveRecord::QueryMethods::WhereChain) -> TypedAssociation::Relation::WhereChain[untyped]
837
- def WhereChain(val); end
838
- end
839
-
840
- # @abstract
841
- module WhereChain
842
- extend T::Generic
843
- Elem = type_member(:out)
844
-
845
- sig { abstract.params(args: T.untyped).returns(TypedAssociation::Relation[Elem]) }
846
- def associated(*args); end
847
-
848
- sig { abstract.params(args: T.untyped).returns(TypedAssociation::Relation[Elem]) }
849
- def missing(*args); end
850
-
851
- sig { abstract.params(opts: T.untyped, rest: T.untyped).returns(TypedAssociation::Relation[Elem]) }
852
- def not(opts, *rest); end
853
- end
854
-
855
- # @abstract
856
- module GroupChain
857
- extend T::Generic
858
- include TypedAssociation::Relation
859
-
860
- Elem = type_member(:out)
861
-
862
- sig { abstract.params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) }
863
- def average(column_name); end
864
-
865
- sig do
866
- abstract.params(
867
- operation: Symbol,
868
- column_name: T.any(String, Symbol)
869
- ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)])
870
- end
871
- def calculate(operation, column_name); end
872
-
873
- sig { abstract.params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) }
874
- def count(column_name = nil); end
875
-
876
- sig { abstract.params(args: T.untyped, blk: T.untyped).returns(T.self_type) }
877
- def having(*args, &blk); end
878
-
879
- sig { abstract.params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) }
880
- def maximum(column_name); end
881
-
882
- sig { abstract.params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) }
883
- def minimum(column_name); end
884
-
885
- sig { abstract.returns(T::Hash[T.untyped, Integer]) }
886
- def size; end
887
-
888
- sig do
889
- abstract.params(
890
- column_name: T.nilable(T.any(String, Symbol)),
891
- block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped))
892
- ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)])
893
- end
894
- def sum(column_name = nil, &block); end
895
- end
896
- end
897
-
898
825
  # Represents a typed `ActiveRecord::Associations::CollectionProxy`
899
826
  #
900
827
  # @abstract
@@ -954,7 +881,7 @@ module TypedAssociation
954
881
  end
955
882
  def replace(other_array); end
956
883
 
957
- sig { abstract.returns(TypedAssociation::Relation[Elem]) }
884
+ sig { abstract.returns(TypedRelation[Elem]) }
958
885
  def scope; end
959
886
 
960
887
  sig { abstract.returns(T::Array[Elem]) }
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.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mateusz Drewniak