sorbet-rails 0.6.2 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (204) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -0
  3. data/README.md +3 -3
  4. data/lib/bundled_rbi/typed_enum.rbi +7 -0
  5. data/lib/sorbet-rails.rb +0 -2
  6. data/lib/sorbet-rails/active_record_rbi_formatter.rb +301 -0
  7. data/lib/sorbet-rails/config.rb +0 -1
  8. data/lib/sorbet-rails/dependent_gem_rbis/activerecord.rbi +11 -0
  9. data/lib/sorbet-rails/deprecation.rb +5 -0
  10. data/lib/sorbet-rails/gem_plugins/active_flag_plugin.rb +0 -1
  11. data/lib/sorbet-rails/gem_plugins/paperclip_plugin.rb +0 -1
  12. data/lib/sorbet-rails/model_plugins/active_record_assoc.rb +36 -8
  13. data/lib/sorbet-rails/model_plugins/active_record_attribute.rb +20 -9
  14. data/lib/sorbet-rails/model_plugins/active_record_enum.rb +0 -1
  15. data/lib/sorbet-rails/model_plugins/active_record_named_scope.rb +15 -6
  16. data/lib/sorbet-rails/model_plugins/active_record_querying.rb +34 -3
  17. data/lib/sorbet-rails/model_plugins/active_storage_methods.rb +1 -1
  18. data/lib/sorbet-rails/model_plugins/base.rb +10 -0
  19. data/lib/sorbet-rails/model_plugins/enumerable_collections.rb +0 -50
  20. data/lib/sorbet-rails/model_plugins/plugins.rb +0 -3
  21. data/lib/sorbet-rails/model_rbi_formatter.rb +6 -10
  22. data/lib/sorbet-rails/model_utils.rb +83 -36
  23. data/lib/sorbet-rails/rails_mixins/generated_url_helpers.rb +2 -3
  24. data/lib/sorbet-rails/railtie.rb +0 -2
  25. data/lib/sorbet-rails/tasks/rails_rbi.rake +32 -24
  26. data/sorbet-rails.gemspec +2 -2
  27. data/spec/active_record_rbi_formatter_spec.rb +24 -0
  28. data/spec/generators/rails-template.rb +90 -6
  29. data/spec/generators/sorbet_test_cases.rb +204 -122
  30. data/spec/model_rbi_formatter_spec.rb +1 -1
  31. data/spec/rails_helper.rb +14 -1
  32. data/spec/rake_rails_rbi_active_record_spec.rb +21 -0
  33. data/spec/rake_rails_rbi_models_spec.rb +7 -0
  34. data/spec/sorbet_spec.rb +12 -1
  35. data/spec/support/v5.0/Gemfile.lock +8 -8
  36. data/spec/support/v5.0/app/models/headmaster.rb +8 -0
  37. data/spec/support/v5.0/app/models/school.rb +2 -0
  38. data/spec/support/v5.0/app/models/spell.rb +5 -0
  39. data/spec/support/v5.0/app/models/spell_book.rb +5 -0
  40. data/spec/support/v5.0/app/models/subject.rb +5 -0
  41. data/spec/support/v5.0/app/models/wizard.rb +6 -1
  42. data/spec/support/v5.0/db/migrate/20190620000010_add_subject.rb +8 -0
  43. data/spec/support/v5.0/db/migrate/20190620000011_add_subjects_wizards.rb +8 -0
  44. data/spec/support/v5.0/db/migrate/20190620000012_add_spell.rb +8 -0
  45. data/spec/support/v5.0/db/migrate/20190620000013_add_spells_spell_books.rb +8 -0
  46. data/spec/support/v5.0/db/migrate/20190620000014_create_headmasters.rb +9 -0
  47. data/spec/support/v5.0/db/schema.rb +28 -1
  48. data/spec/support/v5.0/lib/mythical_rbi_plugin.rb +1 -1
  49. data/spec/support/v5.0/sorbet_test_cases.rb +204 -122
  50. data/spec/support/v5.1/Gemfile.lock +8 -8
  51. data/spec/support/v5.1/app/models/headmaster.rb +8 -0
  52. data/spec/support/v5.1/app/models/school.rb +2 -0
  53. data/spec/support/v5.1/app/models/spell.rb +5 -0
  54. data/spec/support/v5.1/app/models/spell_book.rb +5 -0
  55. data/spec/support/v5.1/app/models/subject.rb +5 -0
  56. data/spec/support/v5.1/app/models/wizard.rb +6 -1
  57. data/spec/support/v5.1/db/migrate/20190620000010_add_subject.rb +8 -0
  58. data/spec/support/v5.1/db/migrate/20190620000011_add_subjects_wizards.rb +8 -0
  59. data/spec/support/v5.1/db/migrate/20190620000012_add_spell.rb +8 -0
  60. data/spec/support/v5.1/db/migrate/20190620000013_add_spells_spell_books.rb +8 -0
  61. data/spec/support/v5.1/db/migrate/20190620000014_create_headmasters.rb +9 -0
  62. data/spec/support/v5.1/db/schema.rb +28 -1
  63. data/spec/support/v5.1/lib/mythical_rbi_plugin.rb +1 -1
  64. data/spec/support/v5.1/sorbet_test_cases.rb +204 -122
  65. data/spec/support/v5.2/Gemfile +1 -1
  66. data/spec/support/v5.2/Gemfile.lock +9 -9
  67. data/spec/support/v5.2/app/models/headmaster.rb +8 -0
  68. data/spec/support/v5.2/app/models/school.rb +2 -0
  69. data/spec/support/v5.2/app/models/spell.rb +5 -0
  70. data/spec/support/v5.2/app/models/spell_book.rb +5 -0
  71. data/spec/support/v5.2/app/models/subject.rb +5 -0
  72. data/spec/support/v5.2/app/models/wizard.rb +5 -0
  73. data/spec/support/v5.2/config/puma.rb +3 -0
  74. data/spec/support/v5.2/db/migrate/20190620000010_add_subject.rb +8 -0
  75. data/spec/support/v5.2/db/migrate/20190620000011_add_subjects_wizards.rb +8 -0
  76. data/spec/support/v5.2/db/migrate/20190620000012_add_spell.rb +8 -0
  77. data/spec/support/v5.2/db/migrate/20190620000013_add_spells_spell_books.rb +8 -0
  78. data/spec/support/v5.2/db/migrate/20190620000014_create_headmasters.rb +9 -0
  79. data/spec/support/v5.2/db/schema.rb +28 -1
  80. data/spec/support/v5.2/lib/mythical_rbi_plugin.rb +1 -1
  81. data/spec/support/v5.2/sorbet_test_cases.rb +204 -122
  82. data/spec/support/v6.0/Gemfile.lock +8 -8
  83. data/spec/support/v6.0/app/models/headmaster.rb +8 -0
  84. data/spec/support/v6.0/app/models/school.rb +2 -0
  85. data/spec/support/v6.0/app/models/spell.rb +5 -0
  86. data/spec/support/v6.0/app/models/spell_book.rb +5 -0
  87. data/spec/support/v6.0/app/models/subject.rb +5 -0
  88. data/spec/support/v6.0/app/models/wizard.rb +6 -1
  89. data/spec/support/v6.0/db/migrate/20190620000010_add_subject.rb +8 -0
  90. data/spec/support/v6.0/db/migrate/20190620000011_add_subjects_wizards.rb +8 -0
  91. data/spec/support/v6.0/db/migrate/20190620000012_add_spell.rb +8 -0
  92. data/spec/support/v6.0/db/migrate/20190620000013_add_spells_spell_books.rb +8 -0
  93. data/spec/support/v6.0/db/migrate/20190620000014_create_headmasters.rb +9 -0
  94. data/spec/support/v6.0/db/schema.rb +28 -1
  95. data/spec/support/v6.0/lib/mythical_rbi_plugin.rb +1 -1
  96. data/spec/support/v6.0/sorbet_test_cases.rb +204 -122
  97. data/spec/test_data/v5.0/expected_active_record_base.rbi +113 -0
  98. data/spec/test_data/v5.0/expected_active_record_relation.rbi +199 -0
  99. data/spec/test_data/v5.0/expected_habtm_subjects.rbi +660 -0
  100. data/spec/test_data/v5.0/expected_habtm_wizards.rbi +660 -0
  101. data/spec/test_data/v5.0/expected_headmaster.rbi +304 -0
  102. data/spec/test_data/v5.0/expected_internal_metadata.rbi +38 -401
  103. data/spec/test_data/v5.0/expected_potion.rbi +38 -401
  104. data/spec/test_data/v5.0/expected_robe.rbi +38 -403
  105. data/spec/test_data/v5.0/expected_schema_migration.rbi +38 -401
  106. data/spec/test_data/v5.0/expected_school.rbi +47 -401
  107. data/spec/test_data/v5.0/expected_spell.rbi +292 -0
  108. data/spec/test_data/v5.0/expected_spell/habtm_spell_books.rbi +295 -0
  109. data/spec/test_data/v5.0/expected_spell_book.rbi +86 -432
  110. data/spec/test_data/v5.0/expected_spell_book/habtm_spell_books.rbi +637 -0
  111. data/spec/test_data/v5.0/expected_spell_book/habtm_spells.rbi +295 -0
  112. data/spec/test_data/v5.0/expected_squib.rbi +122 -477
  113. data/spec/test_data/v5.0/expected_subject.rbi +292 -0
  114. data/spec/test_data/v5.0/expected_subject/habtm_wizards.rbi +295 -0
  115. data/spec/test_data/v5.0/expected_wand.rbi +75 -442
  116. data/spec/test_data/v5.0/expected_wizard.rbi +144 -498
  117. data/spec/test_data/v5.0/expected_wizard/habtm_subjects.rbi +295 -0
  118. data/spec/test_data/v5.0/expected_wizard_wo_spellbook.rbi +138 -498
  119. data/spec/test_data/v5.1/expected_active_record_base.rbi +113 -0
  120. data/spec/test_data/v5.1/expected_active_record_relation.rbi +178 -0
  121. data/spec/test_data/v5.1/expected_habtm_subjects.rbi +672 -0
  122. data/spec/test_data/v5.1/expected_habtm_wizards.rbi +672 -0
  123. data/spec/test_data/v5.1/expected_headmaster.rbi +310 -0
  124. data/spec/test_data/v5.1/expected_internal_metadata.rbi +38 -407
  125. data/spec/test_data/v5.1/expected_potion.rbi +38 -407
  126. data/spec/test_data/v5.1/expected_robe.rbi +38 -409
  127. data/spec/test_data/v5.1/expected_schema_migration.rbi +38 -407
  128. data/spec/test_data/v5.1/expected_school.rbi +47 -407
  129. data/spec/test_data/v5.1/expected_spell.rbi +298 -0
  130. data/spec/test_data/v5.1/expected_spell/habtm_spell_books.rbi +301 -0
  131. data/spec/test_data/v5.1/expected_spell_book.rbi +86 -438
  132. data/spec/test_data/v5.1/expected_spell_book/habtm_spell_books.rbi +649 -0
  133. data/spec/test_data/v5.1/expected_spell_book/habtm_spells.rbi +301 -0
  134. data/spec/test_data/v5.1/expected_squib.rbi +123 -484
  135. data/spec/test_data/v5.1/expected_subject.rbi +298 -0
  136. data/spec/test_data/v5.1/expected_subject/habtm_wizards.rbi +301 -0
  137. data/spec/test_data/v5.1/expected_wand.rbi +75 -448
  138. data/spec/test_data/v5.1/expected_wizard.rbi +145 -505
  139. data/spec/test_data/v5.1/expected_wizard/habtm_subjects.rbi +301 -0
  140. data/spec/test_data/v5.1/expected_wizard_wo_spellbook.rbi +139 -505
  141. data/spec/test_data/v5.2/expected_active_record_base.rbi +113 -0
  142. data/spec/test_data/v5.2/expected_active_record_relation.rbi +175 -0
  143. data/spec/test_data/v5.2/expected_attachment.rbi +38 -407
  144. data/spec/test_data/v5.2/expected_blob.rbi +60 -426
  145. data/spec/test_data/v5.2/expected_habtm_subjects.rbi +672 -0
  146. data/spec/test_data/v5.2/expected_habtm_wizards.rbi +672 -0
  147. data/spec/test_data/v5.2/expected_headmaster.rbi +310 -0
  148. data/spec/test_data/v5.2/expected_internal_metadata.rbi +38 -407
  149. data/spec/test_data/v5.2/expected_potion.rbi +38 -407
  150. data/spec/test_data/v5.2/expected_robe.rbi +38 -409
  151. data/spec/test_data/v5.2/expected_schema_migration.rbi +38 -407
  152. data/spec/test_data/v5.2/expected_school.rbi +47 -407
  153. data/spec/test_data/v5.2/expected_spell.rbi +298 -0
  154. data/spec/test_data/v5.2/expected_spell/habtm_spell_books.rbi +301 -0
  155. data/spec/test_data/v5.2/expected_spell_book.rbi +86 -438
  156. data/spec/test_data/v5.2/expected_spell_book/habtm_spell_books.rbi +649 -0
  157. data/spec/test_data/v5.2/expected_spell_book/habtm_spells.rbi +301 -0
  158. data/spec/test_data/v5.2/expected_squib.rbi +133 -488
  159. data/spec/test_data/v5.2/expected_subject.rbi +298 -0
  160. data/spec/test_data/v5.2/expected_subject/habtm_wizards.rbi +301 -0
  161. data/spec/test_data/v5.2/expected_wand.rbi +75 -448
  162. data/spec/test_data/v5.2/expected_wizard.rbi +155 -509
  163. data/spec/test_data/v5.2/expected_wizard/habtm_subjects.rbi +301 -0
  164. data/spec/test_data/v5.2/expected_wizard_wo_spellbook.rbi +149 -509
  165. data/spec/test_data/v6.0/expected_active_record_base.rbi +113 -0
  166. data/spec/test_data/v6.0/expected_active_record_relation.rbi +175 -0
  167. data/spec/test_data/v6.0/expected_attachment.rbi +38 -431
  168. data/spec/test_data/v6.0/expected_blob.rbi +60 -450
  169. data/spec/test_data/v6.0/expected_habtm_subjects.rbi +720 -0
  170. data/spec/test_data/v6.0/expected_habtm_wizards.rbi +720 -0
  171. data/spec/test_data/v6.0/expected_headmaster.rbi +334 -0
  172. data/spec/test_data/v6.0/expected_internal_metadata.rbi +38 -431
  173. data/spec/test_data/v6.0/expected_potion.rbi +38 -431
  174. data/spec/test_data/v6.0/expected_robe.rbi +38 -433
  175. data/spec/test_data/v6.0/expected_routes.rbi +14 -7
  176. data/spec/test_data/v6.0/expected_schema_migration.rbi +38 -431
  177. data/spec/test_data/v6.0/expected_school.rbi +47 -431
  178. data/spec/test_data/v6.0/expected_spell.rbi +322 -0
  179. data/spec/test_data/v6.0/expected_spell/habtm_spell_books.rbi +325 -0
  180. data/spec/test_data/v6.0/expected_spell_book.rbi +98 -474
  181. data/spec/test_data/v6.0/expected_spell_book/habtm_spell_books.rbi +697 -0
  182. data/spec/test_data/v6.0/expected_spell_book/habtm_spells.rbi +325 -0
  183. data/spec/test_data/v6.0/expected_squib.rbi +162 -541
  184. data/spec/test_data/v6.0/expected_subject.rbi +322 -0
  185. data/spec/test_data/v6.0/expected_subject/habtm_wizards.rbi +325 -0
  186. data/spec/test_data/v6.0/expected_wand.rbi +91 -488
  187. data/spec/test_data/v6.0/expected_wizard.rbi +184 -562
  188. data/spec/test_data/v6.0/expected_wizard/habtm_subjects.rbi +325 -0
  189. data/spec/test_data/v6.0/expected_wizard_wo_spellbook.rbi +178 -562
  190. metadata +170 -24
  191. data/lib/bundled_rbi/active_record_base.rbi +0 -83
  192. data/lib/bundled_rbi/active_record_relation.rbi +0 -122
  193. data/lib/bundled_rbi/parameters.rbi +0 -28
  194. data/lib/sorbet-rails/custom_types/boolean_string.rb +0 -32
  195. data/lib/sorbet-rails/custom_types/integer_string.rb +0 -35
  196. data/lib/sorbet-rails/model_plugins/active_record_finder_methods.rb +0 -131
  197. data/lib/sorbet-rails/rails_mixins/custom_params_methods.rb +0 -46
  198. data/spec/boolean_string_spec.rb +0 -59
  199. data/spec/custom_params_methods_spec.rb +0 -138
  200. data/spec/integer_string_spec.rb +0 -46
  201. data/spec/support/v5.0/typed-override.yaml +0 -2
  202. data/spec/support/v5.1/typed-override.yaml +0 -2
  203. data/spec/support/v5.2/typed-override.yaml +0 -2
  204. data/spec/support/v6.0/typed-override.yaml +0 -2
@@ -8,8 +8,6 @@ module ActiveRecord::SchemaMigration::ActiveRelation_WhereNot
8
8
  end
9
9
 
10
10
  module ActiveRecord::SchemaMigration::GeneratedAttributeMethods
11
- extend T::Sig
12
-
13
11
  sig { returns(String) }
14
12
  def version; end
15
13
 
@@ -40,121 +38,11 @@ end
40
38
  class ActiveRecord::SchemaMigration < ActiveRecord::Base
41
39
  include ActiveRecord::SchemaMigration::GeneratedAttributeMethods
42
40
  extend ActiveRecord::SchemaMigration::CustomFinderMethods
43
- extend T::Sig
44
- extend T::Generic
41
+ extend ActiveRecord::SchemaMigration::QueryMethodsReturningRelation
45
42
  RelationType = T.type_alias { T.any(ActiveRecord::SchemaMigration::ActiveRecord_Relation, ActiveRecord::SchemaMigration::ActiveRecord_Associations_CollectionProxy, ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
46
-
47
- sig { returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
48
- def self.all; end
49
-
50
- sig { params(block: T.nilable(T.proc.void)).returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
51
- def self.unscoped(&block); end
52
-
53
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
54
- def self.select(*args); end
55
-
56
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
57
- def self.order(*args); end
58
-
59
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
60
- def self.reorder(*args); end
61
-
62
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
63
- def self.group(*args); end
64
-
65
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
66
- def self.limit(*args); end
67
-
68
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
69
- def self.offset(*args); end
70
-
71
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
72
- def self.joins(*args); end
73
-
74
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
75
- def self.left_joins(*args); end
76
-
77
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
78
- def self.left_outer_joins(*args); end
79
-
80
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
81
- def self.where(*args); end
82
-
83
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
84
- def self.rewhere(*args); end
85
-
86
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
87
- def self.preload(*args); end
88
-
89
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
90
- def self.eager_load(*args); end
91
-
92
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
93
- def self.includes(*args); end
94
-
95
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
96
- def self.from(*args); end
97
-
98
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
99
- def self.lock(*args); end
100
-
101
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
102
- def self.readonly(*args); end
103
-
104
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
105
- def self.or(*args); end
106
-
107
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
108
- def self.having(*args); end
109
-
110
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
111
- def self.create_with(*args); end
112
-
113
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
114
- def self.distinct(*args); end
115
-
116
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
117
- def self.references(*args); end
118
-
119
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
120
- def self.none(*args); end
121
-
122
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
123
- def self.unscope(*args); end
124
-
125
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
126
- def self.except(*args); end
127
-
128
- sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
129
- def self.extending(*args, &block); end
130
-
131
- sig { params(conditions: T.untyped).returns(T::Boolean) }
132
- def self.exists?(conditions = nil); end
133
-
134
- sig { params(args: T.untyped).returns(T::Boolean) }
135
- def self.any?(*args); end
136
-
137
- sig { params(args: T.untyped).returns(T::Boolean) }
138
- def self.many?(*args); end
139
-
140
- sig { params(args: T.untyped).returns(T::Boolean) }
141
- def self.none?(*args); end
142
-
143
- sig { params(args: T.untyped).returns(T::Boolean) }
144
- def self.one?(*args); end
145
-
146
- sig { params(args: T.untyped).returns(T::Boolean) }
147
- def self.empty?(*args); end
148
43
  end
149
44
 
150
- class ActiveRecord::SchemaMigration::ActiveRecord_Relation < ActiveRecord::Relation
151
- include ActiveRecord::SchemaMigration::ActiveRelation_WhereNot
152
- include ActiveRecord::SchemaMigration::CustomFinderMethods
153
- include Enumerable
154
- extend T::Sig
155
- extend T::Generic
156
- Elem = type_member(fixed: ActiveRecord::SchemaMigration)
157
-
45
+ module ActiveRecord::SchemaMigration::QueryMethodsReturningRelation
158
46
  sig { returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
159
47
  def all; end
160
48
 
@@ -239,37 +127,24 @@ class ActiveRecord::SchemaMigration::ActiveRecord_Relation < ActiveRecord::Relat
239
127
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
240
128
  def extending(*args, &block); end
241
129
 
242
- sig { params(conditions: T.untyped).returns(T::Boolean) }
243
- def exists?(conditions = nil); end
244
-
245
- sig { params(args: T.untyped).returns(T::Boolean) }
246
- def any?(*args); end
247
-
248
- sig { params(args: T.untyped).returns(T::Boolean) }
249
- def many?(*args); end
250
-
251
- sig { params(args: T.untyped).returns(T::Boolean) }
252
- def none?(*args); end
253
-
254
- sig { params(args: T.untyped).returns(T::Boolean) }
255
- def one?(*args); end
256
-
257
- sig { params(args: T.untyped).returns(T::Boolean) }
258
- def empty?(*args); end
130
+ sig do
131
+ params(
132
+ of: T.nilable(Integer),
133
+ start: T.nilable(Integer),
134
+ finish: T.nilable(Integer),
135
+ load: T.nilable(T::Boolean),
136
+ error_on_ignore: T.nilable(T::Boolean),
137
+ block: T.nilable(T.proc.params(e: ActiveRecord::SchemaMigration::ActiveRecord_Relation).void)
138
+ ).returns(ActiveRecord::Batches::BatchEnumerator)
139
+ end
140
+ def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, &block); end
259
141
  end
260
142
 
261
- class ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
262
- include ActiveRecord::SchemaMigration::ActiveRelation_WhereNot
263
- include ActiveRecord::SchemaMigration::CustomFinderMethods
264
- include Enumerable
265
- extend T::Sig
266
- extend T::Generic
267
- Elem = type_member(fixed: ActiveRecord::SchemaMigration)
268
-
143
+ module ActiveRecord::SchemaMigration::QueryMethodsReturningAssociationRelation
269
144
  sig { returns(ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
270
145
  def all; end
271
146
 
272
- sig { params(block: T.nilable(T.proc.void)).returns(ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
147
+ sig { params(block: T.nilable(T.proc.void)).returns(ActiveRecord::SchemaMigration::ActiveRecord_Relation) }
273
148
  def unscoped(&block); end
274
149
 
275
150
  sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
@@ -350,275 +225,37 @@ class ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation < ActiveRe
350
225
  sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
351
226
  def extending(*args, &block); end
352
227
 
353
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration) }
354
- def find(*args); end
355
-
356
- sig { params(args: T.untyped).returns(T.nilable(ActiveRecord::SchemaMigration)) }
357
- def find_by(*args); end
358
-
359
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration) }
360
- def find_by!(*args); end
361
-
362
- sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ActiveRecord::SchemaMigration).void)).returns(ActiveRecord::SchemaMigration) }
363
- def find_or_initialize_by(attributes, &block); end
364
-
365
- sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ActiveRecord::SchemaMigration).void)).returns(ActiveRecord::SchemaMigration) }
366
- def find_or_create_by(attributes, &block); end
367
-
368
- sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ActiveRecord::SchemaMigration).void)).returns(ActiveRecord::SchemaMigration) }
369
- def find_or_create_by!(attributes, &block); end
370
-
371
- sig { returns(T.nilable(ActiveRecord::SchemaMigration)) }
372
- def first; end
373
-
374
- sig { returns(ActiveRecord::SchemaMigration) }
375
- def first!; end
376
-
377
- sig { returns(T.nilable(ActiveRecord::SchemaMigration)) }
378
- def second; end
379
-
380
- sig { returns(ActiveRecord::SchemaMigration) }
381
- def second!; end
382
-
383
- sig { returns(T.nilable(ActiveRecord::SchemaMigration)) }
384
- def third; end
385
-
386
- sig { returns(ActiveRecord::SchemaMigration) }
387
- def third!; end
388
-
389
- sig { returns(T.nilable(ActiveRecord::SchemaMigration)) }
390
- def third_to_last; end
391
-
392
- sig { returns(ActiveRecord::SchemaMigration) }
393
- def third_to_last!; end
394
-
395
- sig { returns(T.nilable(ActiveRecord::SchemaMigration)) }
396
- def second_to_last; end
397
-
398
- sig { returns(ActiveRecord::SchemaMigration) }
399
- def second_to_last!; end
400
-
401
- sig { returns(T.nilable(ActiveRecord::SchemaMigration)) }
402
- def last; end
403
-
404
- sig { returns(ActiveRecord::SchemaMigration) }
405
- def last!; end
406
-
407
- sig { params(conditions: T.untyped).returns(T::Boolean) }
408
- def exists?(conditions = nil); end
409
-
410
- sig { params(args: T.untyped).returns(T::Boolean) }
411
- def any?(*args); end
412
-
413
- sig { params(args: T.untyped).returns(T::Boolean) }
414
- def many?(*args); end
415
-
416
- sig { params(args: T.untyped).returns(T::Boolean) }
417
- def none?(*args); end
418
-
419
- sig { params(args: T.untyped).returns(T::Boolean) }
420
- def one?(*args); end
421
-
422
- sig { params(args: T.untyped).returns(T::Boolean) }
423
- def empty?(*args); end
424
-
425
- sig { override.params(block: T.proc.params(e: ActiveRecord::SchemaMigration).void).returns(T::Array[ActiveRecord::SchemaMigration]) }
426
- def each(&block); end
427
-
428
- sig { params(level: T.nilable(Integer)).returns(T::Array[ActiveRecord::SchemaMigration]) }
429
- def flatten(level); end
430
-
431
- sig { returns(T::Array[ActiveRecord::SchemaMigration]) }
432
- def to_a; end
433
-
434
228
  sig do
435
- type_parameters(:U).params(
436
- blk: T.proc.params(arg0: Elem).returns(T.type_parameter(:U)),
437
- )
438
- .returns(T::Array[T.type_parameter(:U)])
229
+ params(
230
+ of: T.nilable(Integer),
231
+ start: T.nilable(Integer),
232
+ finish: T.nilable(Integer),
233
+ load: T.nilable(T::Boolean),
234
+ error_on_ignore: T.nilable(T::Boolean),
235
+ block: T.nilable(T.proc.params(e: ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation).void)
236
+ ).returns(ActiveRecord::Batches::BatchEnumerator)
439
237
  end
440
- def map(&blk); end
238
+ def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, &block); end
441
239
  end
442
240
 
443
- class ActiveRecord::SchemaMigration::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associations::CollectionProxy
241
+ class ActiveRecord::SchemaMigration::ActiveRecord_Relation < ActiveRecord::Relation
242
+ include ActiveRecord::SchemaMigration::ActiveRelation_WhereNot
444
243
  include ActiveRecord::SchemaMigration::CustomFinderMethods
445
- include Enumerable
446
- extend T::Sig
447
- extend T::Generic
244
+ include ActiveRecord::SchemaMigration::QueryMethodsReturningRelation
448
245
  Elem = type_member(fixed: ActiveRecord::SchemaMigration)
246
+ end
449
247
 
450
- sig { returns(ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
451
- def all; end
452
-
453
- sig { params(block: T.nilable(T.proc.void)).returns(ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
454
- def unscoped(&block); end
455
-
456
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
457
- def select(*args); end
458
-
459
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
460
- def order(*args); end
461
-
462
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
463
- def reorder(*args); end
464
-
465
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
466
- def group(*args); end
467
-
468
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
469
- def limit(*args); end
470
-
471
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
472
- def offset(*args); end
473
-
474
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
475
- def joins(*args); end
476
-
477
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
478
- def left_joins(*args); end
479
-
480
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
481
- def left_outer_joins(*args); end
482
-
483
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
484
- def where(*args); end
485
-
486
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
487
- def rewhere(*args); end
488
-
489
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
490
- def preload(*args); end
491
-
492
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
493
- def eager_load(*args); end
494
-
495
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
496
- def includes(*args); end
497
-
498
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
499
- def from(*args); end
500
-
501
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
502
- def lock(*args); end
503
-
504
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
505
- def readonly(*args); end
506
-
507
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
508
- def or(*args); end
509
-
510
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
511
- def having(*args); end
512
-
513
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
514
- def create_with(*args); end
515
-
516
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
517
- def distinct(*args); end
518
-
519
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
520
- def references(*args); end
521
-
522
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
523
- def none(*args); end
524
-
525
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
526
- def unscope(*args); end
527
-
528
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
529
- def except(*args); end
530
-
531
- sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation) }
532
- def extending(*args, &block); end
533
-
534
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration) }
535
- def find(*args); end
536
-
537
- sig { params(args: T.untyped).returns(T.nilable(ActiveRecord::SchemaMigration)) }
538
- def find_by(*args); end
539
-
540
- sig { params(args: T.untyped).returns(ActiveRecord::SchemaMigration) }
541
- def find_by!(*args); end
542
-
543
- sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ActiveRecord::SchemaMigration).void)).returns(ActiveRecord::SchemaMigration) }
544
- def find_or_initialize_by(attributes, &block); end
545
-
546
- sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ActiveRecord::SchemaMigration).void)).returns(ActiveRecord::SchemaMigration) }
547
- def find_or_create_by(attributes, &block); end
548
-
549
- sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ActiveRecord::SchemaMigration).void)).returns(ActiveRecord::SchemaMigration) }
550
- def find_or_create_by!(attributes, &block); end
551
-
552
- sig { returns(T.nilable(ActiveRecord::SchemaMigration)) }
553
- def first; end
554
-
555
- sig { returns(ActiveRecord::SchemaMigration) }
556
- def first!; end
557
-
558
- sig { returns(T.nilable(ActiveRecord::SchemaMigration)) }
559
- def second; end
560
-
561
- sig { returns(ActiveRecord::SchemaMigration) }
562
- def second!; end
563
-
564
- sig { returns(T.nilable(ActiveRecord::SchemaMigration)) }
565
- def third; end
566
-
567
- sig { returns(ActiveRecord::SchemaMigration) }
568
- def third!; end
569
-
570
- sig { returns(T.nilable(ActiveRecord::SchemaMigration)) }
571
- def third_to_last; end
572
-
573
- sig { returns(ActiveRecord::SchemaMigration) }
574
- def third_to_last!; end
575
-
576
- sig { returns(T.nilable(ActiveRecord::SchemaMigration)) }
577
- def second_to_last; end
578
-
579
- sig { returns(ActiveRecord::SchemaMigration) }
580
- def second_to_last!; end
581
-
582
- sig { returns(T.nilable(ActiveRecord::SchemaMigration)) }
583
- def last; end
584
-
585
- sig { returns(ActiveRecord::SchemaMigration) }
586
- def last!; end
587
-
588
- sig { params(conditions: T.untyped).returns(T::Boolean) }
589
- def exists?(conditions = nil); end
590
-
591
- sig { params(args: T.untyped).returns(T::Boolean) }
592
- def any?(*args); end
593
-
594
- sig { params(args: T.untyped).returns(T::Boolean) }
595
- def many?(*args); end
596
-
597
- sig { params(args: T.untyped).returns(T::Boolean) }
598
- def none?(*args); end
599
-
600
- sig { params(args: T.untyped).returns(T::Boolean) }
601
- def one?(*args); end
602
-
603
- sig { params(args: T.untyped).returns(T::Boolean) }
604
- def empty?(*args); end
605
-
606
- sig { override.params(block: T.proc.params(e: ActiveRecord::SchemaMigration).void).returns(T::Array[ActiveRecord::SchemaMigration]) }
607
- def each(&block); end
608
-
609
- sig { params(level: T.nilable(Integer)).returns(T::Array[ActiveRecord::SchemaMigration]) }
610
- def flatten(level); end
611
-
612
- sig { returns(T::Array[ActiveRecord::SchemaMigration]) }
613
- def to_a; end
248
+ class ActiveRecord::SchemaMigration::ActiveRecord_AssociationRelation < ActiveRecord::AssociationRelation
249
+ include ActiveRecord::SchemaMigration::ActiveRelation_WhereNot
250
+ include ActiveRecord::SchemaMigration::CustomFinderMethods
251
+ include ActiveRecord::SchemaMigration::QueryMethodsReturningAssociationRelation
252
+ Elem = type_member(fixed: ActiveRecord::SchemaMigration)
253
+ end
614
254
 
615
- sig do
616
- type_parameters(:U).params(
617
- blk: T.proc.params(arg0: Elem).returns(T.type_parameter(:U)),
618
- )
619
- .returns(T::Array[T.type_parameter(:U)])
620
- end
621
- def map(&blk); end
255
+ class ActiveRecord::SchemaMigration::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associations::CollectionProxy
256
+ include ActiveRecord::SchemaMigration::CustomFinderMethods
257
+ include ActiveRecord::SchemaMigration::QueryMethodsReturningAssociationRelation
258
+ Elem = type_member(fixed: ActiveRecord::SchemaMigration)
622
259
 
623
260
  sig { params(records: T.any(ActiveRecord::SchemaMigration, T::Array[ActiveRecord::SchemaMigration])).returns(T.self_type) }
624
261
  def <<(*records); end