sorbet-rails 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +13 -1
- data/.travis.yml +2 -2
- data/Gemfile +1 -1
- data/README.md +79 -3
- data/lib/sorbet-rails.rb +5 -1
- data/lib/sorbet-rails/activerecord.rbi +27 -0
- data/lib/sorbet-rails/custom_finder_methods.rb +11 -0
- data/lib/sorbet-rails/helper_rbi_formatter.rb +33 -0
- data/lib/sorbet-rails/model_plugins/active_record_assoc.rb +91 -0
- data/lib/sorbet-rails/model_plugins/active_record_attribute.rb +111 -0
- data/lib/sorbet-rails/model_plugins/active_record_enum.rb +43 -0
- data/lib/sorbet-rails/model_plugins/active_record_finder_methods.rb +80 -0
- data/lib/sorbet-rails/model_plugins/active_record_named_scope.rb +28 -0
- data/lib/sorbet-rails/model_plugins/active_record_querying.rb +42 -0
- data/lib/sorbet-rails/model_plugins/active_relation_where_not.rb +28 -0
- data/lib/sorbet-rails/model_plugins/base.rb +33 -0
- data/lib/sorbet-rails/model_plugins/custom_finder_methods.rb +54 -0
- data/lib/sorbet-rails/model_plugins/enumerable_collections.rb +49 -0
- data/lib/sorbet-rails/model_plugins/plugins.rb +45 -0
- data/lib/sorbet-rails/model_rbi_formatter.rb +108 -362
- data/lib/sorbet-rails/model_utils.rb +45 -0
- data/lib/sorbet-rails/railtie.rb +1 -0
- data/lib/sorbet-rails/routes_rbi_formatter.rb +12 -3
- data/lib/sorbet-rails/tasks/rails_rbi.rake +36 -15
- data/lib/sorbet-rails/utils.rb +4 -0
- data/sorbet-rails.gemspec +4 -2
- data/spec/helper_rbi_formatter_spec.rb +13 -0
- data/spec/model_plugins_spec.rb +31 -0
- data/spec/model_rbi_formatter_spec.rb +5 -5
- data/spec/rake_rails_rbi_helpers_spec.rb +14 -0
- data/spec/routes_rbi_formatter_spec.rb +3 -3
- data/spec/sorbet_spec.rb +12 -16
- data/spec/support/rails_shared/app/controllers/application_controller.rb +1 -1
- data/spec/support/rails_shared/app/helpers/bar_helper.rb +2 -0
- data/spec/support/rails_shared/app/helpers/baz_helper.rb +2 -0
- data/spec/support/rails_shared/app/helpers/foo_helper.rb +2 -0
- data/spec/support/rails_shared/app/models/concerns/mythical.rb +10 -0
- data/spec/support/rails_shared/app/models/wand.rb +1 -0
- data/spec/support/rails_shared/config/initializers/sorbet_rails.rb +3 -0
- data/spec/support/rails_shared/lib/mythical_rbi_plugin.rb +16 -0
- data/spec/support/rails_shared/sorbet_test_cases.rb +5 -2
- data/spec/support/rails_shared/typed-override.yaml +2 -0
- data/spec/support/rails_symlinks/app/helpers +1 -0
- data/spec/support/rails_symlinks/config/initializers/sorbet_rails.rb +1 -0
- data/spec/support/rails_symlinks/lib/mythical_rbi_plugin.rb +1 -0
- data/spec/support/rails_symlinks/typed-override.yaml +1 -0
- data/spec/support/v4.2/Gemfile.lock +5 -0
- data/spec/support/v4.2/app/helpers +1 -0
- data/spec/support/v4.2/config/initializers/sorbet_rails.rb +1 -0
- data/spec/support/v4.2/config/routes.rb +0 -1
- data/spec/support/v4.2/lib/mythical_rbi_plugin.rb +1 -0
- data/spec/support/v4.2/sorbet/rbi/sorbet-typed/lib/activerecord/all/activerecord.rbi +1 -1
- data/spec/support/v4.2/sorbet/rbi/sorbet-typed/lib/activesupport/all/activesupport.rbi +1 -1
- data/spec/support/v4.2/typed-override.yaml +1 -0
- data/spec/support/v5.0/Gemfile.lock +5 -0
- data/spec/support/v5.0/app/helpers +1 -0
- data/spec/support/v5.0/config/initializers/sorbet_rails.rb +1 -0
- data/spec/support/v5.0/config/routes.rb +0 -1
- data/spec/support/v5.0/lib/mythical_rbi_plugin.rb +1 -0
- data/spec/support/v5.0/sorbet/rbi/sorbet-typed/lib/activerecord/all/activerecord.rbi +1 -1
- data/spec/support/v5.0/sorbet/rbi/sorbet-typed/lib/activesupport/all/activesupport.rbi +1 -1
- data/spec/support/v5.0/typed-override.yaml +1 -0
- data/spec/support/v5.1/Gemfile.lock +5 -0
- data/spec/support/v5.1/app/helpers +1 -0
- data/spec/support/v5.1/config/initializers/sorbet_rails.rb +1 -0
- data/spec/support/v5.1/lib/mythical_rbi_plugin.rb +1 -0
- data/spec/support/v5.1/sorbet/rbi/sorbet-typed/lib/activerecord/all/activerecord.rbi +1 -1
- data/spec/support/v5.1/sorbet/rbi/sorbet-typed/lib/activesupport/all/activesupport.rbi +1 -1
- data/spec/support/v5.1/typed-override.yaml +1 -0
- data/spec/support/v5.2-no-sorbet/Gemfile +0 -2
- data/spec/support/v5.2-no-sorbet/Gemfile.lock +7 -5
- data/spec/support/v5.2-no-sorbet/app/helpers +1 -0
- data/spec/support/v5.2-no-sorbet/config/initializers/sorbet_rails.rb +1 -0
- data/spec/support/v5.2-no-sorbet/lib/mythical_rbi_plugin.rb +1 -0
- data/spec/support/v5.2-no-sorbet/sorbet_test_cases.rb +1 -0
- data/spec/support/v5.2-no-sorbet/typed-override.yaml +1 -0
- data/spec/support/v5.2/Gemfile +0 -2
- data/spec/support/v5.2/Gemfile.lock +7 -5
- data/spec/support/v5.2/app/helpers +1 -0
- data/spec/support/v5.2/config/initializers/sorbet_rails.rb +1 -0
- data/spec/support/v5.2/lib/mythical_rbi_plugin.rb +1 -0
- data/spec/support/v5.2/sorbet/rbi/sorbet-typed/lib/activerecord/all/activerecord.rbi +1 -1
- data/spec/support/v5.2/sorbet/rbi/sorbet-typed/lib/activesupport/all/activesupport.rbi +1 -1
- data/spec/support/v5.2/typed-override.yaml +1 -0
- data/spec/support/v6.0/Gemfile +1 -3
- data/spec/support/v6.0/Gemfile.lock +61 -59
- data/spec/support/v6.0/app/helpers +1 -0
- data/spec/support/v6.0/config/initializers/sorbet_rails.rb +1 -0
- data/spec/support/v6.0/config/routes.rb +0 -1
- data/spec/support/v6.0/lib/mythical_rbi_plugin.rb +1 -0
- data/spec/support/v6.0/sorbet/rbi/sorbet-typed/lib/activerecord/all/activerecord.rbi +1 -1
- data/spec/support/v6.0/sorbet/rbi/sorbet-typed/lib/activesupport/all/activesupport.rbi +1 -1
- data/spec/support/v6.0/typed-override.yaml +1 -0
- data/spec/test_data/v4.2/expected_helpers.rbi +17 -0
- data/spec/test_data/v4.2/expected_potion.rbi +259 -28
- data/spec/test_data/v4.2/expected_spell_book.rbi +278 -37
- data/spec/test_data/v4.2/expected_srb_tc_output.txt +1 -99
- data/spec/test_data/v4.2/expected_wand.rbi +345 -96
- data/spec/test_data/v4.2/expected_wizard.rbi +322 -76
- data/spec/test_data/v4.2/expected_wizard_wo_spellbook.rbi +322 -76
- data/spec/test_data/v5.0/expected_helpers.rbi +17 -0
- data/spec/test_data/v5.0/expected_internal_metadata.rbi +273 -37
- data/spec/test_data/v5.0/expected_potion.rbi +259 -28
- data/spec/test_data/v5.0/expected_schema_migration.rbi +264 -28
- data/spec/test_data/v5.0/expected_spell_book.rbi +278 -37
- data/spec/test_data/v5.0/expected_srb_tc_output.txt +1 -81
- data/spec/test_data/v5.0/expected_wand.rbi +341 -92
- data/spec/test_data/v5.0/expected_wizard.rbi +318 -72
- data/spec/test_data/v5.0/expected_wizard_wo_spellbook.rbi +318 -72
- data/spec/test_data/v5.1/expected_helpers.rbi +17 -0
- data/spec/test_data/v5.1/expected_internal_metadata.rbi +273 -37
- data/spec/test_data/v5.1/expected_potion.rbi +259 -28
- data/spec/test_data/v5.1/expected_schema_migration.rbi +264 -28
- data/spec/test_data/v5.1/expected_spell_book.rbi +278 -37
- data/spec/test_data/v5.1/expected_srb_tc_output.txt +1 -81
- data/spec/test_data/v5.1/expected_wand.rbi +341 -92
- data/spec/test_data/v5.1/expected_wizard.rbi +318 -72
- data/spec/test_data/v5.1/expected_wizard_wo_spellbook.rbi +318 -72
- data/spec/test_data/v5.2-no-sorbet/expected_attachment.rbi +265 -29
- data/spec/test_data/v5.2-no-sorbet/expected_blob.rbi +271 -35
- data/spec/test_data/v5.2-no-sorbet/expected_helpers.rbi +17 -0
- data/spec/test_data/v5.2-no-sorbet/expected_internal_metadata.rbi +273 -37
- data/spec/test_data/v5.2-no-sorbet/expected_potion.rbi +259 -28
- data/spec/test_data/v5.2-no-sorbet/expected_schema_migration.rbi +264 -28
- data/spec/test_data/v5.2-no-sorbet/expected_spell_book.rbi +278 -37
- data/spec/test_data/v5.2-no-sorbet/expected_srb_tc_output.txt +1 -81
- data/spec/test_data/v5.2-no-sorbet/expected_wand.rbi +351 -102
- data/spec/test_data/v5.2-no-sorbet/expected_wizard.rbi +318 -72
- data/spec/test_data/v5.2-no-sorbet/expected_wizard_wo_spellbook.rbi +318 -72
- data/spec/test_data/v5.2/expected_attachment.rbi +265 -29
- data/spec/test_data/v5.2/expected_blob.rbi +271 -35
- data/spec/test_data/v5.2/expected_helpers.rbi +17 -0
- data/spec/test_data/v5.2/expected_internal_metadata.rbi +273 -37
- data/spec/test_data/v5.2/expected_potion.rbi +259 -28
- data/spec/test_data/v5.2/expected_schema_migration.rbi +264 -28
- data/spec/test_data/v5.2/expected_spell_book.rbi +278 -37
- data/spec/test_data/v5.2/expected_srb_tc_output.txt +1 -81
- data/spec/test_data/v5.2/expected_wand.rbi +351 -102
- data/spec/test_data/v5.2/expected_wizard.rbi +318 -72
- data/spec/test_data/v5.2/expected_wizard_wo_spellbook.rbi +318 -72
- data/spec/test_data/v6.0/expected_attachment.rbi +265 -29
- data/spec/test_data/v6.0/expected_blob.rbi +271 -35
- data/spec/test_data/v6.0/expected_helpers.rbi +17 -0
- data/spec/test_data/v6.0/expected_internal_metadata.rbi +273 -37
- data/spec/test_data/v6.0/expected_potion.rbi +259 -28
- data/spec/test_data/v6.0/expected_schema_migration.rbi +264 -28
- data/spec/test_data/v6.0/expected_spell_book.rbi +278 -37
- data/spec/test_data/v6.0/expected_srb_tc_output.txt +1 -81
- data/spec/test_data/v6.0/expected_wand.rbi +351 -102
- data/spec/test_data/v6.0/expected_wizard.rbi +318 -72
- data/spec/test_data/v6.0/expected_wizard_wo_spellbook.rbi +318 -72
- metadata +120 -37
- data/lib/sorbet-rails/rbi/activerecord.rbi +0 -207
- data/spec/support/v4.2/app/helpers/application_helper.rb +0 -3
- data/spec/support/v4.2/sorbet/rbi/gems/sorbet-runtime.rbi +0 -647
- data/spec/support/v4.2/sorbet/rbi/hidden-definitions/errors.txt +0 -11998
- data/spec/support/v4.2/sorbet/rbi/hidden-definitions/hidden.rbi +0 -27774
- data/spec/support/v5.0/sorbet/rbi/gems/sorbet-runtime.rbi +0 -647
- data/spec/support/v5.0/sorbet/rbi/hidden-definitions/errors.txt +0 -10523
- data/spec/support/v5.0/sorbet/rbi/hidden-definitions/hidden.rbi +0 -24969
- data/spec/support/v5.1/sorbet/rbi/gems/sorbet-runtime.rbi +0 -647
- data/spec/support/v5.1/sorbet/rbi/hidden-definitions/errors.txt +0 -10226
- data/spec/support/v5.1/sorbet/rbi/hidden-definitions/hidden.rbi +0 -24635
- data/spec/support/v5.2/.ruby-version +0 -1
- data/spec/support/v5.2/sorbet/rbi/gems/sorbet-runtime.rbi +0 -644
- data/spec/support/v5.2/sorbet/rbi/hidden-definitions/errors.txt +0 -10046
- data/spec/support/v5.2/sorbet/rbi/hidden-definitions/hidden.rbi +0 -24424
- data/spec/support/v6.0/sorbet/rbi/gems/sorbet-runtime.rbi +0 -647
- data/spec/support/v6.0/sorbet/rbi/hidden-definitions/errors.txt +0 -12074
- data/spec/support/v6.0/sorbet/rbi/hidden-definitions/hidden.rbi +0 -28231
@@ -1,54 +1,50 @@
|
|
1
1
|
# This is an autogenerated file for dynamic methods in ActiveStorage::Attachment
|
2
|
-
# Please rerun rake rails_rbi:models to regenerate.
|
3
|
-
# typed: strong
|
4
|
-
|
5
|
-
class ActiveStorage::Attachment::ActiveRecord_Relation < ActiveRecord::Relation
|
6
|
-
include ActiveStorage::Attachment::ModelRelationShared
|
7
|
-
extend T::Generic
|
8
|
-
Elem = type_member(fixed: ActiveStorage::Attachment)
|
9
|
-
end
|
10
|
-
|
11
|
-
class ActiveStorage::Attachment::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associations::CollectionProxy
|
12
|
-
include ActiveStorage::Attachment::ModelRelationShared
|
13
|
-
extend T::Generic
|
14
|
-
Elem = type_member(fixed: ActiveStorage::Attachment)
|
15
|
-
end
|
16
|
-
|
17
|
-
class ActiveStorage::Attachment < ActiveRecord::Base
|
18
|
-
extend T::Sig
|
19
|
-
extend T::Generic
|
20
|
-
extend ActiveStorage::Attachment::ModelRelationShared
|
21
|
-
include ActiveStorage::Attachment::InstanceMethods
|
22
|
-
Elem = type_template(fixed: ActiveStorage::Attachment)
|
23
|
-
end
|
24
|
-
|
25
|
-
module ActiveStorage::Attachment::InstanceMethods
|
26
|
-
extend T::Sig
|
2
|
+
# Please rerun rake rails_rbi:models[ActiveStorage::Attachment] to regenerate.
|
27
3
|
|
4
|
+
# typed: strong
|
5
|
+
module ActiveStorage::Attachment::ActiveRelation_WhereNot
|
6
|
+
sig { params(opts: T.untyped, rest: T.untyped).returns(T.self_type) }
|
7
|
+
def not(opts, *rest); end
|
28
8
|
end
|
29
9
|
|
30
|
-
|
10
|
+
module ActiveStorage::Attachment::GeneratedAssociationMethods
|
31
11
|
extend T::Sig
|
32
12
|
|
33
13
|
sig { returns(T.nilable(::ActiveStorage::Blob)) }
|
34
|
-
def blob
|
14
|
+
def blob; end
|
35
15
|
|
36
16
|
sig { params(value: T.nilable(::ActiveStorage::Blob)).void }
|
37
17
|
def blob=(value); end
|
38
18
|
|
39
19
|
sig { returns(T.nilable(T.untyped)) }
|
40
|
-
def record
|
20
|
+
def record; end
|
41
21
|
|
42
22
|
sig { params(value: T.nilable(T.untyped)).void }
|
43
23
|
def record=(value); end
|
24
|
+
end
|
25
|
+
|
26
|
+
module ActiveStorage::Attachment::CustomFinderMethods
|
27
|
+
sig { params(limit: Integer).returns(T::Array[ActiveStorage::Attachment]) }
|
28
|
+
def first_n(limit); end
|
29
|
+
|
30
|
+
sig { params(limit: Integer).returns(T::Array[ActiveStorage::Attachment]) }
|
31
|
+
def last_n(limit); end
|
32
|
+
|
33
|
+
sig { params(args: T::Array[T.any(Integer, String)]).returns(T::Array[ActiveStorage::Attachment]) }
|
34
|
+
def find_n(*args); end
|
44
35
|
|
36
|
+
sig { params(id: Integer).returns(T.nilable(ActiveStorage::Attachment)) }
|
37
|
+
def find_by_id(id); end
|
38
|
+
|
39
|
+
sig { params(id: Integer).returns(ActiveStorage::Attachment) }
|
40
|
+
def find_by_id!(id); end
|
45
41
|
end
|
46
42
|
|
47
43
|
module ActiveStorage::Attachment::ModelRelationShared
|
48
44
|
extend T::Sig
|
49
45
|
|
50
46
|
sig { returns(ActiveStorage::Attachment::ActiveRecord_Relation) }
|
51
|
-
def all
|
47
|
+
def all; end
|
52
48
|
|
53
49
|
sig { params(block: T.nilable(T.proc.void)).returns(ActiveStorage::Attachment::ActiveRecord_Relation) }
|
54
50
|
def unscoped(&block); end
|
@@ -145,5 +141,245 @@ module ActiveStorage::Attachment::ModelRelationShared
|
|
145
141
|
|
146
142
|
sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(ActiveStorage::Attachment::ActiveRecord_Relation) }
|
147
143
|
def only(*args, &block); end
|
144
|
+
end
|
145
|
+
|
146
|
+
class ActiveStorage::Attachment::ActiveRecord_Relation < ActiveRecord::Relation
|
147
|
+
include ActiveStorage::Attachment::ActiveRelation_WhereNot
|
148
|
+
include SorbetRails::CustomFinderMethods
|
149
|
+
include ActiveStorage::Attachment::CustomFinderMethods
|
150
|
+
include Enumerable
|
151
|
+
include ActiveStorage::Attachment::ModelRelationShared
|
152
|
+
extend T::Sig
|
153
|
+
extend T::Generic
|
154
|
+
Elem = type_member(fixed: ActiveStorage::Attachment)
|
155
|
+
|
156
|
+
sig { params(args: T.untyped).returns(ActiveStorage::Attachment) }
|
157
|
+
def find(*args); end
|
158
|
+
|
159
|
+
sig { params(args: T.untyped).returns(T.nilable(ActiveStorage::Attachment)) }
|
160
|
+
def find_by(*args); end
|
161
|
+
|
162
|
+
sig { params(args: T.untyped).returns(ActiveStorage::Attachment) }
|
163
|
+
def find_by!(*args); end
|
164
|
+
|
165
|
+
sig { returns(T.nilable(ActiveStorage::Attachment)) }
|
166
|
+
def first; end
|
167
|
+
|
168
|
+
sig { returns(ActiveStorage::Attachment) }
|
169
|
+
def first!; end
|
170
|
+
|
171
|
+
sig { returns(T.nilable(ActiveStorage::Attachment)) }
|
172
|
+
def second; end
|
173
|
+
|
174
|
+
sig { returns(ActiveStorage::Attachment) }
|
175
|
+
def second!; end
|
176
|
+
|
177
|
+
sig { returns(T.nilable(ActiveStorage::Attachment)) }
|
178
|
+
def third; end
|
179
|
+
|
180
|
+
sig { returns(ActiveStorage::Attachment) }
|
181
|
+
def third!; end
|
182
|
+
|
183
|
+
sig { returns(T.nilable(ActiveStorage::Attachment)) }
|
184
|
+
def third_to_last; end
|
185
|
+
|
186
|
+
sig { returns(ActiveStorage::Attachment) }
|
187
|
+
def third_to_last!; end
|
188
|
+
|
189
|
+
sig { returns(T.nilable(ActiveStorage::Attachment)) }
|
190
|
+
def second_to_last; end
|
191
|
+
|
192
|
+
sig { returns(ActiveStorage::Attachment) }
|
193
|
+
def second_to_last!; end
|
194
|
+
|
195
|
+
sig { returns(T.nilable(ActiveStorage::Attachment)) }
|
196
|
+
def last; end
|
197
|
+
|
198
|
+
sig { returns(ActiveStorage::Attachment) }
|
199
|
+
def last!; end
|
200
|
+
|
201
|
+
sig { params(conditions: T.untyped).returns(T::Boolean) }
|
202
|
+
def exists?(conditions = nil); end
|
203
|
+
|
204
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
205
|
+
def any?(*args); end
|
206
|
+
|
207
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
208
|
+
def many?(*args); end
|
209
|
+
|
210
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
211
|
+
def none?(*args); end
|
212
|
+
|
213
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
214
|
+
def one?(*args); end
|
215
|
+
|
216
|
+
sig { implementation.params(block: T.proc.params(e: ActiveStorage::Attachment).void).void }
|
217
|
+
def each(&block); end
|
218
|
+
|
219
|
+
sig { params(level: T.nilable(Integer)).returns(T::Array[ActiveStorage::Attachment]) }
|
220
|
+
def flatten(level); end
|
221
|
+
|
222
|
+
sig { returns(T::Array[ActiveStorage::Attachment]) }
|
223
|
+
def to_a; end
|
224
|
+
end
|
225
|
+
|
226
|
+
class ActiveStorage::Attachment::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associations::CollectionProxy
|
227
|
+
include ActiveStorage::Attachment::ActiveRelation_WhereNot
|
228
|
+
include SorbetRails::CustomFinderMethods
|
229
|
+
include ActiveStorage::Attachment::CustomFinderMethods
|
230
|
+
include Enumerable
|
231
|
+
include ActiveStorage::Attachment::ModelRelationShared
|
232
|
+
extend T::Sig
|
233
|
+
extend T::Generic
|
234
|
+
Elem = type_member(fixed: ActiveStorage::Attachment)
|
235
|
+
|
236
|
+
sig { params(args: T.untyped).returns(ActiveStorage::Attachment) }
|
237
|
+
def find(*args); end
|
238
|
+
|
239
|
+
sig { params(args: T.untyped).returns(T.nilable(ActiveStorage::Attachment)) }
|
240
|
+
def find_by(*args); end
|
241
|
+
|
242
|
+
sig { params(args: T.untyped).returns(ActiveStorage::Attachment) }
|
243
|
+
def find_by!(*args); end
|
244
|
+
|
245
|
+
sig { returns(T.nilable(ActiveStorage::Attachment)) }
|
246
|
+
def first; end
|
247
|
+
|
248
|
+
sig { returns(ActiveStorage::Attachment) }
|
249
|
+
def first!; end
|
250
|
+
|
251
|
+
sig { returns(T.nilable(ActiveStorage::Attachment)) }
|
252
|
+
def second; end
|
253
|
+
|
254
|
+
sig { returns(ActiveStorage::Attachment) }
|
255
|
+
def second!; end
|
256
|
+
|
257
|
+
sig { returns(T.nilable(ActiveStorage::Attachment)) }
|
258
|
+
def third; end
|
259
|
+
|
260
|
+
sig { returns(ActiveStorage::Attachment) }
|
261
|
+
def third!; end
|
262
|
+
|
263
|
+
sig { returns(T.nilable(ActiveStorage::Attachment)) }
|
264
|
+
def third_to_last; end
|
265
|
+
|
266
|
+
sig { returns(ActiveStorage::Attachment) }
|
267
|
+
def third_to_last!; end
|
268
|
+
|
269
|
+
sig { returns(T.nilable(ActiveStorage::Attachment)) }
|
270
|
+
def second_to_last; end
|
271
|
+
|
272
|
+
sig { returns(ActiveStorage::Attachment) }
|
273
|
+
def second_to_last!; end
|
274
|
+
|
275
|
+
sig { returns(T.nilable(ActiveStorage::Attachment)) }
|
276
|
+
def last; end
|
277
|
+
|
278
|
+
sig { returns(ActiveStorage::Attachment) }
|
279
|
+
def last!; end
|
280
|
+
|
281
|
+
sig { params(conditions: T.untyped).returns(T::Boolean) }
|
282
|
+
def exists?(conditions = nil); end
|
283
|
+
|
284
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
285
|
+
def any?(*args); end
|
286
|
+
|
287
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
288
|
+
def many?(*args); end
|
289
|
+
|
290
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
291
|
+
def none?(*args); end
|
292
|
+
|
293
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
294
|
+
def one?(*args); end
|
295
|
+
|
296
|
+
sig { implementation.params(block: T.proc.params(e: ActiveStorage::Attachment).void).void }
|
297
|
+
def each(&block); end
|
298
|
+
|
299
|
+
sig { params(level: T.nilable(Integer)).returns(T::Array[ActiveStorage::Attachment]) }
|
300
|
+
def flatten(level); end
|
301
|
+
|
302
|
+
sig { returns(T::Array[ActiveStorage::Attachment]) }
|
303
|
+
def to_a; end
|
304
|
+
|
305
|
+
sig { params(records: T.any(ActiveStorage::Attachment, T::Array[ActiveStorage::Attachment])).returns(T.self_type) }
|
306
|
+
def <<(*records); end
|
307
|
+
|
308
|
+
sig { params(records: T.any(ActiveStorage::Attachment, T::Array[ActiveStorage::Attachment])).returns(T.self_type) }
|
309
|
+
def append(*records); end
|
310
|
+
|
311
|
+
sig { params(records: T.any(ActiveStorage::Attachment, T::Array[ActiveStorage::Attachment])).returns(T.self_type) }
|
312
|
+
def push(*records); end
|
313
|
+
|
314
|
+
sig { params(records: T.any(ActiveStorage::Attachment, T::Array[ActiveStorage::Attachment])).returns(T.self_type) }
|
315
|
+
def concat(*records); end
|
316
|
+
end
|
317
|
+
|
318
|
+
class ActiveStorage::Attachment < ActiveRecord::Base
|
319
|
+
include ActiveStorage::Attachment::GeneratedAssociationMethods
|
320
|
+
extend SorbetRails::CustomFinderMethods
|
321
|
+
extend ActiveStorage::Attachment::CustomFinderMethods
|
322
|
+
extend T::Sig
|
323
|
+
extend T::Generic
|
324
|
+
extend ActiveStorage::Attachment::ModelRelationShared
|
325
|
+
|
326
|
+
sig { params(args: T.untyped).returns(ActiveStorage::Attachment) }
|
327
|
+
def self.find(*args); end
|
328
|
+
|
329
|
+
sig { params(args: T.untyped).returns(T.nilable(ActiveStorage::Attachment)) }
|
330
|
+
def self.find_by(*args); end
|
331
|
+
|
332
|
+
sig { params(args: T.untyped).returns(ActiveStorage::Attachment) }
|
333
|
+
def self.find_by!(*args); end
|
334
|
+
|
335
|
+
sig { returns(T.nilable(ActiveStorage::Attachment)) }
|
336
|
+
def self.first; end
|
337
|
+
|
338
|
+
sig { returns(ActiveStorage::Attachment) }
|
339
|
+
def self.first!; end
|
340
|
+
|
341
|
+
sig { returns(T.nilable(ActiveStorage::Attachment)) }
|
342
|
+
def self.second; end
|
343
|
+
|
344
|
+
sig { returns(ActiveStorage::Attachment) }
|
345
|
+
def self.second!; end
|
346
|
+
|
347
|
+
sig { returns(T.nilable(ActiveStorage::Attachment)) }
|
348
|
+
def self.third; end
|
349
|
+
|
350
|
+
sig { returns(ActiveStorage::Attachment) }
|
351
|
+
def self.third!; end
|
352
|
+
|
353
|
+
sig { returns(T.nilable(ActiveStorage::Attachment)) }
|
354
|
+
def self.third_to_last; end
|
355
|
+
|
356
|
+
sig { returns(ActiveStorage::Attachment) }
|
357
|
+
def self.third_to_last!; end
|
358
|
+
|
359
|
+
sig { returns(T.nilable(ActiveStorage::Attachment)) }
|
360
|
+
def self.second_to_last; end
|
361
|
+
|
362
|
+
sig { returns(ActiveStorage::Attachment) }
|
363
|
+
def self.second_to_last!; end
|
364
|
+
|
365
|
+
sig { returns(T.nilable(ActiveStorage::Attachment)) }
|
366
|
+
def self.last; end
|
367
|
+
|
368
|
+
sig { returns(ActiveStorage::Attachment) }
|
369
|
+
def self.last!; end
|
370
|
+
|
371
|
+
sig { params(conditions: T.untyped).returns(T::Boolean) }
|
372
|
+
def self.exists?(conditions = nil); end
|
373
|
+
|
374
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
375
|
+
def self.any?(*args); end
|
376
|
+
|
377
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
378
|
+
def self.many?(*args); end
|
379
|
+
|
380
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
381
|
+
def self.none?(*args); end
|
148
382
|
|
383
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
384
|
+
def self.one?(*args); end
|
149
385
|
end
|
@@ -1,70 +1,66 @@
|
|
1
1
|
# This is an autogenerated file for dynamic methods in ActiveStorage::Blob
|
2
|
-
# Please rerun rake rails_rbi:models to regenerate.
|
3
|
-
# typed: strong
|
4
|
-
|
5
|
-
class ActiveStorage::Blob::ActiveRecord_Relation < ActiveRecord::Relation
|
6
|
-
include ActiveStorage::Blob::ModelRelationShared
|
7
|
-
extend T::Generic
|
8
|
-
Elem = type_member(fixed: ActiveStorage::Blob)
|
9
|
-
end
|
10
|
-
|
11
|
-
class ActiveStorage::Blob::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associations::CollectionProxy
|
12
|
-
include ActiveStorage::Blob::ModelRelationShared
|
13
|
-
extend T::Generic
|
14
|
-
Elem = type_member(fixed: ActiveStorage::Blob)
|
15
|
-
end
|
16
|
-
|
17
|
-
class ActiveStorage::Blob < ActiveRecord::Base
|
18
|
-
extend T::Sig
|
19
|
-
extend T::Generic
|
20
|
-
extend ActiveStorage::Blob::ModelRelationShared
|
21
|
-
include ActiveStorage::Blob::InstanceMethods
|
22
|
-
Elem = type_template(fixed: ActiveStorage::Blob)
|
23
|
-
end
|
24
|
-
|
25
|
-
module ActiveStorage::Blob::InstanceMethods
|
26
|
-
extend T::Sig
|
2
|
+
# Please rerun rake rails_rbi:models[ActiveStorage::Blob] to regenerate.
|
27
3
|
|
4
|
+
# typed: strong
|
5
|
+
module ActiveStorage::Blob::ActiveRelation_WhereNot
|
6
|
+
sig { params(opts: T.untyped, rest: T.untyped).returns(T.self_type) }
|
7
|
+
def not(opts, *rest); end
|
28
8
|
end
|
29
9
|
|
30
|
-
|
10
|
+
module ActiveStorage::Blob::GeneratedAssociationMethods
|
31
11
|
extend T::Sig
|
32
12
|
|
33
13
|
sig { returns(::ActiveStorage::Attachment::ActiveRecord_Associations_CollectionProxy) }
|
34
|
-
def attachments
|
14
|
+
def attachments; end
|
35
15
|
|
36
16
|
sig { params(value: T.any(T::Array[::ActiveStorage::Attachment], ::ActiveStorage::Attachment::ActiveRecord_Associations_CollectionProxy)).void }
|
37
17
|
def attachments=(value); end
|
38
18
|
|
39
19
|
sig { returns(T.nilable(::ActiveStorage::Attachment)) }
|
40
|
-
def preview_image_attachment
|
20
|
+
def preview_image_attachment; end
|
41
21
|
|
42
22
|
sig { params(value: T.nilable(::ActiveStorage::Attachment)).void }
|
43
23
|
def preview_image_attachment=(value); end
|
44
24
|
|
45
25
|
sig { returns(T.nilable(::ActiveStorage::Blob)) }
|
46
|
-
def preview_image_blob
|
26
|
+
def preview_image_blob; end
|
47
27
|
|
48
28
|
sig { params(value: T.nilable(::ActiveStorage::Blob)).void }
|
49
29
|
def preview_image_blob=(value); end
|
30
|
+
end
|
31
|
+
|
32
|
+
module ActiveStorage::Blob::CustomFinderMethods
|
33
|
+
sig { params(limit: Integer).returns(T::Array[ActiveStorage::Blob]) }
|
34
|
+
def first_n(limit); end
|
50
35
|
|
36
|
+
sig { params(limit: Integer).returns(T::Array[ActiveStorage::Blob]) }
|
37
|
+
def last_n(limit); end
|
38
|
+
|
39
|
+
sig { params(args: T::Array[T.any(Integer, String)]).returns(T::Array[ActiveStorage::Blob]) }
|
40
|
+
def find_n(*args); end
|
41
|
+
|
42
|
+
sig { params(id: Integer).returns(T.nilable(ActiveStorage::Blob)) }
|
43
|
+
def find_by_id(id); end
|
44
|
+
|
45
|
+
sig { params(id: Integer).returns(ActiveStorage::Blob) }
|
46
|
+
def find_by_id!(id); end
|
51
47
|
end
|
52
48
|
|
53
49
|
module ActiveStorage::Blob::ModelRelationShared
|
54
50
|
extend T::Sig
|
55
51
|
|
56
|
-
sig { returns(ActiveStorage::Blob::ActiveRecord_Relation) }
|
57
|
-
def all(); end
|
58
|
-
|
59
|
-
sig { params(block: T.nilable(T.proc.void)).returns(ActiveStorage::Blob::ActiveRecord_Relation) }
|
60
|
-
def unscoped(&block); end
|
61
|
-
|
62
52
|
sig { params(args: T.untyped).returns(ActiveStorage::Blob::ActiveRecord_Relation) }
|
63
53
|
def unattached(*args); end
|
64
54
|
|
65
55
|
sig { params(args: T.untyped).returns(ActiveStorage::Blob::ActiveRecord_Relation) }
|
66
56
|
def with_attached_preview_image(*args); end
|
67
57
|
|
58
|
+
sig { returns(ActiveStorage::Blob::ActiveRecord_Relation) }
|
59
|
+
def all; end
|
60
|
+
|
61
|
+
sig { params(block: T.nilable(T.proc.void)).returns(ActiveStorage::Blob::ActiveRecord_Relation) }
|
62
|
+
def unscoped(&block); end
|
63
|
+
|
68
64
|
sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(ActiveStorage::Blob::ActiveRecord_Relation) }
|
69
65
|
def select(*args, &block); end
|
70
66
|
|
@@ -157,5 +153,245 @@ module ActiveStorage::Blob::ModelRelationShared
|
|
157
153
|
|
158
154
|
sig { params(args: T.untyped, block: T.nilable(T.proc.void)).returns(ActiveStorage::Blob::ActiveRecord_Relation) }
|
159
155
|
def only(*args, &block); end
|
156
|
+
end
|
157
|
+
|
158
|
+
class ActiveStorage::Blob::ActiveRecord_Relation < ActiveRecord::Relation
|
159
|
+
include ActiveStorage::Blob::ActiveRelation_WhereNot
|
160
|
+
include SorbetRails::CustomFinderMethods
|
161
|
+
include ActiveStorage::Blob::CustomFinderMethods
|
162
|
+
include Enumerable
|
163
|
+
include ActiveStorage::Blob::ModelRelationShared
|
164
|
+
extend T::Sig
|
165
|
+
extend T::Generic
|
166
|
+
Elem = type_member(fixed: ActiveStorage::Blob)
|
167
|
+
|
168
|
+
sig { params(args: T.untyped).returns(ActiveStorage::Blob) }
|
169
|
+
def find(*args); end
|
170
|
+
|
171
|
+
sig { params(args: T.untyped).returns(T.nilable(ActiveStorage::Blob)) }
|
172
|
+
def find_by(*args); end
|
173
|
+
|
174
|
+
sig { params(args: T.untyped).returns(ActiveStorage::Blob) }
|
175
|
+
def find_by!(*args); end
|
176
|
+
|
177
|
+
sig { returns(T.nilable(ActiveStorage::Blob)) }
|
178
|
+
def first; end
|
179
|
+
|
180
|
+
sig { returns(ActiveStorage::Blob) }
|
181
|
+
def first!; end
|
182
|
+
|
183
|
+
sig { returns(T.nilable(ActiveStorage::Blob)) }
|
184
|
+
def second; end
|
185
|
+
|
186
|
+
sig { returns(ActiveStorage::Blob) }
|
187
|
+
def second!; end
|
188
|
+
|
189
|
+
sig { returns(T.nilable(ActiveStorage::Blob)) }
|
190
|
+
def third; end
|
191
|
+
|
192
|
+
sig { returns(ActiveStorage::Blob) }
|
193
|
+
def third!; end
|
194
|
+
|
195
|
+
sig { returns(T.nilable(ActiveStorage::Blob)) }
|
196
|
+
def third_to_last; end
|
197
|
+
|
198
|
+
sig { returns(ActiveStorage::Blob) }
|
199
|
+
def third_to_last!; end
|
200
|
+
|
201
|
+
sig { returns(T.nilable(ActiveStorage::Blob)) }
|
202
|
+
def second_to_last; end
|
203
|
+
|
204
|
+
sig { returns(ActiveStorage::Blob) }
|
205
|
+
def second_to_last!; end
|
206
|
+
|
207
|
+
sig { returns(T.nilable(ActiveStorage::Blob)) }
|
208
|
+
def last; end
|
209
|
+
|
210
|
+
sig { returns(ActiveStorage::Blob) }
|
211
|
+
def last!; end
|
212
|
+
|
213
|
+
sig { params(conditions: T.untyped).returns(T::Boolean) }
|
214
|
+
def exists?(conditions = nil); end
|
215
|
+
|
216
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
217
|
+
def any?(*args); end
|
218
|
+
|
219
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
220
|
+
def many?(*args); end
|
221
|
+
|
222
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
223
|
+
def none?(*args); end
|
224
|
+
|
225
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
226
|
+
def one?(*args); end
|
227
|
+
|
228
|
+
sig { implementation.params(block: T.proc.params(e: ActiveStorage::Blob).void).void }
|
229
|
+
def each(&block); end
|
230
|
+
|
231
|
+
sig { params(level: T.nilable(Integer)).returns(T::Array[ActiveStorage::Blob]) }
|
232
|
+
def flatten(level); end
|
233
|
+
|
234
|
+
sig { returns(T::Array[ActiveStorage::Blob]) }
|
235
|
+
def to_a; end
|
236
|
+
end
|
237
|
+
|
238
|
+
class ActiveStorage::Blob::ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associations::CollectionProxy
|
239
|
+
include ActiveStorage::Blob::ActiveRelation_WhereNot
|
240
|
+
include SorbetRails::CustomFinderMethods
|
241
|
+
include ActiveStorage::Blob::CustomFinderMethods
|
242
|
+
include Enumerable
|
243
|
+
include ActiveStorage::Blob::ModelRelationShared
|
244
|
+
extend T::Sig
|
245
|
+
extend T::Generic
|
246
|
+
Elem = type_member(fixed: ActiveStorage::Blob)
|
247
|
+
|
248
|
+
sig { params(args: T.untyped).returns(ActiveStorage::Blob) }
|
249
|
+
def find(*args); end
|
250
|
+
|
251
|
+
sig { params(args: T.untyped).returns(T.nilable(ActiveStorage::Blob)) }
|
252
|
+
def find_by(*args); end
|
253
|
+
|
254
|
+
sig { params(args: T.untyped).returns(ActiveStorage::Blob) }
|
255
|
+
def find_by!(*args); end
|
256
|
+
|
257
|
+
sig { returns(T.nilable(ActiveStorage::Blob)) }
|
258
|
+
def first; end
|
259
|
+
|
260
|
+
sig { returns(ActiveStorage::Blob) }
|
261
|
+
def first!; end
|
262
|
+
|
263
|
+
sig { returns(T.nilable(ActiveStorage::Blob)) }
|
264
|
+
def second; end
|
265
|
+
|
266
|
+
sig { returns(ActiveStorage::Blob) }
|
267
|
+
def second!; end
|
268
|
+
|
269
|
+
sig { returns(T.nilable(ActiveStorage::Blob)) }
|
270
|
+
def third; end
|
271
|
+
|
272
|
+
sig { returns(ActiveStorage::Blob) }
|
273
|
+
def third!; end
|
274
|
+
|
275
|
+
sig { returns(T.nilable(ActiveStorage::Blob)) }
|
276
|
+
def third_to_last; end
|
277
|
+
|
278
|
+
sig { returns(ActiveStorage::Blob) }
|
279
|
+
def third_to_last!; end
|
280
|
+
|
281
|
+
sig { returns(T.nilable(ActiveStorage::Blob)) }
|
282
|
+
def second_to_last; end
|
283
|
+
|
284
|
+
sig { returns(ActiveStorage::Blob) }
|
285
|
+
def second_to_last!; end
|
286
|
+
|
287
|
+
sig { returns(T.nilable(ActiveStorage::Blob)) }
|
288
|
+
def last; end
|
289
|
+
|
290
|
+
sig { returns(ActiveStorage::Blob) }
|
291
|
+
def last!; end
|
292
|
+
|
293
|
+
sig { params(conditions: T.untyped).returns(T::Boolean) }
|
294
|
+
def exists?(conditions = nil); end
|
295
|
+
|
296
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
297
|
+
def any?(*args); end
|
298
|
+
|
299
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
300
|
+
def many?(*args); end
|
301
|
+
|
302
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
303
|
+
def none?(*args); end
|
304
|
+
|
305
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
306
|
+
def one?(*args); end
|
307
|
+
|
308
|
+
sig { implementation.params(block: T.proc.params(e: ActiveStorage::Blob).void).void }
|
309
|
+
def each(&block); end
|
310
|
+
|
311
|
+
sig { params(level: T.nilable(Integer)).returns(T::Array[ActiveStorage::Blob]) }
|
312
|
+
def flatten(level); end
|
313
|
+
|
314
|
+
sig { returns(T::Array[ActiveStorage::Blob]) }
|
315
|
+
def to_a; end
|
316
|
+
|
317
|
+
sig { params(records: T.any(ActiveStorage::Blob, T::Array[ActiveStorage::Blob])).returns(T.self_type) }
|
318
|
+
def <<(*records); end
|
319
|
+
|
320
|
+
sig { params(records: T.any(ActiveStorage::Blob, T::Array[ActiveStorage::Blob])).returns(T.self_type) }
|
321
|
+
def append(*records); end
|
322
|
+
|
323
|
+
sig { params(records: T.any(ActiveStorage::Blob, T::Array[ActiveStorage::Blob])).returns(T.self_type) }
|
324
|
+
def push(*records); end
|
325
|
+
|
326
|
+
sig { params(records: T.any(ActiveStorage::Blob, T::Array[ActiveStorage::Blob])).returns(T.self_type) }
|
327
|
+
def concat(*records); end
|
328
|
+
end
|
329
|
+
|
330
|
+
class ActiveStorage::Blob < ActiveRecord::Base
|
331
|
+
include ActiveStorage::Blob::GeneratedAssociationMethods
|
332
|
+
extend SorbetRails::CustomFinderMethods
|
333
|
+
extend ActiveStorage::Blob::CustomFinderMethods
|
334
|
+
extend T::Sig
|
335
|
+
extend T::Generic
|
336
|
+
extend ActiveStorage::Blob::ModelRelationShared
|
337
|
+
|
338
|
+
sig { params(args: T.untyped).returns(ActiveStorage::Blob) }
|
339
|
+
def self.find(*args); end
|
340
|
+
|
341
|
+
sig { params(args: T.untyped).returns(T.nilable(ActiveStorage::Blob)) }
|
342
|
+
def self.find_by(*args); end
|
343
|
+
|
344
|
+
sig { params(args: T.untyped).returns(ActiveStorage::Blob) }
|
345
|
+
def self.find_by!(*args); end
|
346
|
+
|
347
|
+
sig { returns(T.nilable(ActiveStorage::Blob)) }
|
348
|
+
def self.first; end
|
349
|
+
|
350
|
+
sig { returns(ActiveStorage::Blob) }
|
351
|
+
def self.first!; end
|
352
|
+
|
353
|
+
sig { returns(T.nilable(ActiveStorage::Blob)) }
|
354
|
+
def self.second; end
|
355
|
+
|
356
|
+
sig { returns(ActiveStorage::Blob) }
|
357
|
+
def self.second!; end
|
358
|
+
|
359
|
+
sig { returns(T.nilable(ActiveStorage::Blob)) }
|
360
|
+
def self.third; end
|
361
|
+
|
362
|
+
sig { returns(ActiveStorage::Blob) }
|
363
|
+
def self.third!; end
|
364
|
+
|
365
|
+
sig { returns(T.nilable(ActiveStorage::Blob)) }
|
366
|
+
def self.third_to_last; end
|
367
|
+
|
368
|
+
sig { returns(ActiveStorage::Blob) }
|
369
|
+
def self.third_to_last!; end
|
370
|
+
|
371
|
+
sig { returns(T.nilable(ActiveStorage::Blob)) }
|
372
|
+
def self.second_to_last; end
|
373
|
+
|
374
|
+
sig { returns(ActiveStorage::Blob) }
|
375
|
+
def self.second_to_last!; end
|
376
|
+
|
377
|
+
sig { returns(T.nilable(ActiveStorage::Blob)) }
|
378
|
+
def self.last; end
|
379
|
+
|
380
|
+
sig { returns(ActiveStorage::Blob) }
|
381
|
+
def self.last!; end
|
382
|
+
|
383
|
+
sig { params(conditions: T.untyped).returns(T::Boolean) }
|
384
|
+
def self.exists?(conditions = nil); end
|
385
|
+
|
386
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
387
|
+
def self.any?(*args); end
|
388
|
+
|
389
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
390
|
+
def self.many?(*args); end
|
391
|
+
|
392
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
393
|
+
def self.none?(*args); end
|
160
394
|
|
395
|
+
sig { params(args: T.untyped).returns(T::Boolean) }
|
396
|
+
def self.one?(*args); end
|
161
397
|
end
|