sorbet-rails 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +6 -1
- data/.travis.yml +1 -1
- data/CONTRIBUTING.md +21 -12
- data/Rakefile +81 -0
- data/lib/sorbet-rails/gem_plugins/kaminari_plugin.rb +21 -0
- data/lib/sorbet-rails/tasks/rails_rbi.rake +10 -6
- data/sorbet-rails.gemspec +1 -1
- data/spec/bin/run_spec.sh +2 -2
- data/spec/generators/rails-template.rb +268 -0
- data/spec/{support/rails_shared → generators}/sorbet_test_cases.rb +0 -0
- data/spec/helper_rbi_formatter_spec.rb +1 -1
- data/spec/support/v4.2/Gemfile +3 -14
- data/spec/support/v4.2/Gemfile.lock +8 -23
- data/spec/support/v4.2/app/controllers/application_controller.rb +1 -1
- data/spec/support/v4.2/app/helpers/application_helper.rb +3 -0
- data/spec/support/v4.2/app/helpers/bar_helper.rb +3 -0
- data/spec/support/v4.2/app/helpers/baz_helper.rb +3 -0
- data/spec/support/v4.2/app/helpers/foo_helper.rb +3 -0
- data/spec/support/{rails_shared/app/controllers/concerns → v4.2/app/models}/.keep +0 -0
- data/spec/support/v4.2/app/models/application_record.rb +5 -0
- data/spec/support/{v5.0/test/controllers → v4.2/app/models/concerns}/.keep +0 -0
- data/spec/support/v4.2/app/models/concerns/mythical.rb +11 -0
- data/spec/support/v4.2/app/models/potion.rb +5 -0
- data/spec/support/v4.2/app/models/spell_book.rb +5 -0
- data/spec/support/v4.2/app/models/wand.rb +17 -0
- data/spec/support/v4.2/app/models/wizard.rb +14 -0
- data/spec/support/v4.2/config/initializers/sorbet_rails.rb +3 -0
- data/spec/support/v4.2/config/routes.rb +55 -2
- data/spec/support/v4.2/db/migrate/{20190620001234_create_wizards.rb → 20190620000001_create_wizards.rb} +0 -0
- data/spec/support/v4.2/db/migrate/{20190620003037_create_wands.rb → 20190620000002_create_wands.rb} +0 -0
- data/spec/support/v4.2/db/migrate/{20190620003739_create_spell_books.rb → 20190620000003_create_spell_books.rb} +0 -0
- data/spec/support/{rails_shared/db/migrate/20190622000000_add_more_column_types_to_wands.rb → v4.2/db/migrate/20190620000004_add_more_column_types_to_wands.rb} +4 -5
- data/spec/support/v4.2/db/schema.rb +1 -1
- data/spec/support/v4.2/lib/mythical_rbi_plugin.rb +16 -0
- data/spec/support/v4.2/sorbet/rbi/gems/actionpack.rbi +277 -279
- data/spec/support/v4.2/sorbet/rbi/gems/actionview.rbi +18 -18
- data/spec/support/v4.2/sorbet/rbi/gems/activemodel.rbi +46 -46
- data/spec/support/v4.2/sorbet/rbi/gems/activerecord.rbi +413 -410
- data/spec/support/v4.2/sorbet/rbi/gems/activesupport.rbi +58 -58
- data/spec/support/v4.2/sorbet/rbi/gems/byebug.rbi +22 -22
- data/spec/support/v4.2/sorbet/rbi/gems/mail.rbi +2 -2
- data/spec/support/v4.2/sorbet/rbi/gems/mini_mime.rbi +8 -2
- data/spec/support/v4.2/sorbet/rbi/gems/parlour.rbi +214 -0
- data/spec/support/v4.2/sorbet/rbi/gems/rails-html-sanitizer.rbi +3 -2
- data/spec/support/v4.2/sorbet/rbi/gems/railties.rbi +0 -6
- data/spec/support/v4.2/sorbet/rbi/gems/thor.rbi +2 -2
- data/spec/support/v4.2/sorbet/rbi/sorbet-typed/lib/actionpack/all/actionpack.rbi +457 -2
- data/spec/support/v4.2/sorbet/rbi/sorbet-typed/lib/activemodel/all/activemodel.rbi +422 -0
- data/spec/support/v4.2/sorbet/rbi/sorbet-typed/lib/activerecord/all/activerecord.rbi +1229 -17
- data/spec/support/v4.2/sorbet/rbi/sorbet-typed/lib/activesupport/all/activesupport.rbi +360 -9
- data/spec/support/v4.2/sorbet/rbi/sorbet-typed/lib/bundler/all/bundler.rbi +32 -4
- data/spec/support/v4.2/sorbet/rbi/sorbet-typed/lib/minitest/all/minitest.rbi +99 -0
- data/spec/support/v4.2/sorbet/rbi/sorbet-typed/lib/ruby/all/open3.rbi +14 -14
- data/spec/support/v4.2/sorbet/rbi/todo.rbi +59 -1
- data/spec/support/v4.2/sorbet_test_cases.rb +123 -0
- data/spec/support/v4.2/typed-override.yaml +2 -0
- data/spec/support/v5.0/Gemfile +6 -19
- data/spec/support/v5.0/Gemfile.lock +12 -9
- data/spec/support/v5.0/app/assets/config/manifest.js +2 -0
- data/spec/support/v5.0/{test/fixtures → app/assets/images}/.keep +0 -0
- data/spec/support/v5.0/app/assets/stylesheets/application.css +15 -0
- data/spec/support/v5.0/app/controllers/application_controller.rb +4 -0
- data/spec/support/v5.0/{test/fixtures/files → app/controllers/concerns}/.keep +0 -0
- data/spec/support/v5.0/app/helpers/application_helper.rb +3 -0
- data/spec/support/v5.0/app/helpers/bar_helper.rb +3 -0
- data/spec/support/v5.0/app/helpers/baz_helper.rb +3 -0
- data/spec/support/v5.0/app/helpers/foo_helper.rb +3 -0
- data/spec/support/v5.0/app/models/application_record.rb +5 -0
- data/spec/support/v5.0/{test/integration → app/models/concerns}/.keep +0 -0
- data/spec/support/v5.0/app/models/concerns/mythical.rb +11 -0
- data/spec/support/v5.0/app/models/potion.rb +5 -0
- data/spec/support/v5.0/app/models/spell_book.rb +5 -0
- data/spec/support/v5.0/app/models/wand.rb +17 -0
- data/spec/support/v5.0/app/models/wizard.rb +14 -0
- data/spec/support/v5.0/app/views/layouts/application.html.erb +13 -0
- data/spec/support/v5.0/config/application.rb +2 -7
- data/spec/support/v5.0/config/environments/production.rb +0 -4
- data/spec/support/v5.0/config/initializers/cookies_serializer.rb +6 -0
- data/spec/support/v5.0/config/initializers/new_framework_defaults.rb +8 -0
- data/spec/support/v5.0/config/initializers/session_store.rb +4 -0
- data/spec/support/v5.0/config/initializers/sorbet_rails.rb +3 -0
- data/spec/support/v5.0/config/routes.rb +2 -2
- data/spec/support/{rails_shared/db/migrate/20190620001234_create_wizards.rb → v5.0/db/migrate/20190620000001_create_wizards.rb} +2 -1
- data/spec/support/{rails_shared/db/migrate/20190620003037_create_wands.rb → v5.0/db/migrate/20190620000002_create_wands.rb} +2 -1
- data/spec/support/{rails_shared/db/migrate/20190620003739_create_spell_books.rb → v5.0/db/migrate/20190620000003_create_spell_books.rb} +2 -1
- data/spec/support/v5.0/db/migrate/20190620000004_add_more_column_types_to_wands.rb +16 -0
- data/spec/support/v5.0/db/schema.rb +1 -1
- data/spec/support/v5.0/{test/mailers → lib/assets}/.keep +0 -0
- data/spec/support/v5.0/lib/mythical_rbi_plugin.rb +16 -0
- data/spec/support/v5.0/sorbet/rbi/gems/actionmailer.rbi +2 -50
- data/spec/support/v5.0/sorbet/rbi/gems/actionpack.rbi +533 -696
- data/spec/support/v5.0/sorbet/rbi/gems/actionview.rbi +56 -57
- data/spec/support/v5.0/sorbet/rbi/gems/activejob.rbi +0 -22
- data/spec/support/v5.0/sorbet/rbi/gems/activemodel.rbi +75 -75
- data/spec/support/v5.0/sorbet/rbi/gems/activerecord.rbi +644 -1020
- data/spec/support/v5.0/sorbet/rbi/gems/activesupport.rbi +81 -216
- data/spec/support/v5.0/sorbet/rbi/gems/arel.rbi +6 -6
- data/spec/support/v5.0/sorbet/rbi/gems/byebug.rbi +22 -22
- data/spec/support/v5.0/sorbet/rbi/gems/jbuilder.rbi +99 -0
- data/spec/support/v5.0/sorbet/rbi/gems/mail.rbi +2 -2
- data/spec/support/v5.0/sorbet/rbi/gems/mini_mime.rbi +8 -2
- data/spec/support/v5.0/sorbet/rbi/gems/nokogiri.rbi +6 -6
- data/spec/support/v5.0/sorbet/rbi/gems/parlour.rbi +214 -0
- data/spec/support/v5.0/sorbet/rbi/gems/rack.rbi +53 -98
- data/spec/support/v5.0/sorbet/rbi/gems/rails-html-sanitizer.rbi +3 -2
- data/spec/support/v5.0/sorbet/rbi/gems/railties.rbi +0 -210
- data/spec/support/v5.0/sorbet/rbi/sorbet-typed/lib/actionpack/all/actionpack.rbi +457 -2
- data/spec/support/v5.0/sorbet/rbi/sorbet-typed/lib/activemodel/all/activemodel.rbi +422 -0
- data/spec/support/v5.0/sorbet/rbi/sorbet-typed/lib/activerecord/all/activerecord.rbi +1229 -17
- data/spec/support/v5.0/sorbet/rbi/sorbet-typed/lib/activesupport/all/activesupport.rbi +360 -9
- data/spec/support/v5.0/sorbet/rbi/sorbet-typed/lib/bundler/all/bundler.rbi +32 -4
- data/spec/support/v5.0/sorbet/rbi/sorbet-typed/lib/minitest/all/minitest.rbi +99 -0
- data/spec/support/v5.0/sorbet/rbi/sorbet-typed/lib/ruby/all/open3.rbi +14 -14
- data/spec/support/v5.0/sorbet/rbi/todo.rbi +62 -4
- data/spec/support/v5.0/sorbet_test_cases.rb +123 -0
- data/spec/support/v5.0/typed-override.yaml +2 -0
- data/spec/support/v5.0/{test/models → vendor/assets/stylesheets}/.keep +0 -0
- data/spec/support/v5.1/.gitignore +23 -0
- data/spec/support/v5.1/Gemfile +9 -25
- data/spec/support/v5.1/Gemfile.lock +22 -11
- data/spec/support/v5.1/app/assets/config/manifest.js +2 -0
- data/spec/support/v5.1/{test/controllers → app/assets/images}/.keep +0 -0
- data/spec/support/v5.1/app/assets/stylesheets/application.css +15 -0
- data/spec/support/v5.1/app/controllers/application_controller.rb +4 -0
- data/spec/support/v5.1/{test/fixtures → app/controllers/concerns}/.keep +0 -0
- data/spec/support/v5.1/app/helpers/application_helper.rb +3 -0
- data/spec/support/v5.1/app/helpers/bar_helper.rb +3 -0
- data/spec/support/v5.1/app/helpers/baz_helper.rb +3 -0
- data/spec/support/v5.1/app/helpers/foo_helper.rb +3 -0
- data/spec/support/v5.1/app/models/application_record.rb +5 -0
- data/spec/support/v5.1/{test/fixtures/files → app/models/concerns}/.keep +0 -0
- data/spec/support/v5.1/app/models/concerns/mythical.rb +11 -0
- data/spec/support/v5.1/app/models/potion.rb +5 -0
- data/spec/support/v5.1/app/models/spell_book.rb +5 -0
- data/spec/support/v5.1/app/models/wand.rb +17 -0
- data/spec/support/v5.1/app/models/wizard.rb +14 -0
- data/spec/support/v5.1/app/views/layouts/application.html.erb +13 -0
- data/spec/support/v5.1/bin/setup +3 -0
- data/spec/support/v5.1/bin/yarn +11 -0
- data/spec/support/v5.1/config/application.rb +5 -7
- data/spec/support/v5.1/config/environments/production.rb +1 -5
- data/spec/support/v5.1/config/initializers/cookies_serializer.rb +6 -0
- data/spec/support/v5.1/config/initializers/sorbet_rails.rb +3 -0
- data/spec/support/v5.1/config/routes.rb +5 -0
- data/spec/support/v5.1/db/migrate/20190620000001_create_wizards.rb +13 -0
- data/spec/support/v5.1/db/migrate/20190620000002_create_wands.rb +12 -0
- data/spec/support/v5.1/db/migrate/20190620000003_create_spell_books.rb +9 -0
- data/spec/support/v5.1/db/migrate/20190620000004_add_more_column_types_to_wands.rb +16 -0
- data/spec/support/v5.1/db/schema.rb +1 -1
- data/spec/support/v5.1/{test/integration → lib/assets}/.keep +0 -0
- data/spec/support/v5.1/lib/mythical_rbi_plugin.rb +16 -0
- data/spec/support/v5.1/package.json +5 -0
- data/spec/support/v5.1/sorbet/rbi/gems/actionmailer.rbi +2 -49
- data/spec/support/v5.1/sorbet/rbi/gems/actionpack.rbi +588 -732
- data/spec/support/v5.1/sorbet/rbi/gems/actionview.rbi +123 -124
- data/spec/support/v5.1/sorbet/rbi/gems/activejob.rbi +0 -35
- data/spec/support/v5.1/sorbet/rbi/gems/activemodel.rbi +68 -68
- data/spec/support/v5.1/sorbet/rbi/gems/activerecord.rbi +501 -651
- data/spec/support/v5.1/sorbet/rbi/gems/activesupport.rbi +80 -218
- data/spec/support/v5.1/sorbet/rbi/gems/bindex.rbi +36 -0
- data/spec/support/v5.1/sorbet/rbi/gems/byebug.rbi +22 -22
- data/spec/support/v5.1/sorbet/rbi/gems/jbuilder.rbi +99 -0
- data/spec/support/v5.1/sorbet/rbi/gems/mail.rbi +2 -2
- data/spec/support/v5.1/sorbet/rbi/gems/mini_mime.rbi +8 -2
- data/spec/support/v5.1/sorbet/rbi/gems/nokogiri.rbi +6 -6
- data/spec/support/v5.1/sorbet/rbi/gems/parlour.rbi +214 -0
- data/spec/support/v5.1/sorbet/rbi/gems/rack.rbi +53 -98
- data/spec/support/v5.1/sorbet/rbi/gems/rails-html-sanitizer.rbi +3 -2
- data/spec/support/v5.1/sorbet/rbi/gems/railties.rbi +0 -209
- data/spec/support/v5.1/sorbet/rbi/gems/sqlite3.rbi +13 -5
- data/spec/support/{v4.2 → v5.1}/sorbet/rbi/gems/web-console.rbi +10 -73
- data/spec/support/v5.1/sorbet/rbi/sorbet-typed/lib/actionpack/all/actionpack.rbi +457 -2
- data/spec/support/v5.1/sorbet/rbi/sorbet-typed/lib/activemodel/all/activemodel.rbi +422 -0
- data/spec/support/v5.1/sorbet/rbi/sorbet-typed/lib/activerecord/all/activerecord.rbi +1229 -17
- data/spec/support/v5.1/sorbet/rbi/sorbet-typed/lib/activesupport/all/activesupport.rbi +360 -9
- data/spec/support/v5.1/sorbet/rbi/sorbet-typed/lib/bundler/all/bundler.rbi +32 -4
- data/spec/support/v5.1/sorbet/rbi/sorbet-typed/lib/minitest/all/minitest.rbi +99 -0
- data/spec/support/v5.1/sorbet/rbi/sorbet-typed/lib/ruby/all/open3.rbi +14 -14
- data/spec/support/v5.1/sorbet/rbi/todo.rbi +59 -2
- data/spec/support/v5.1/sorbet_test_cases.rb +123 -0
- data/spec/support/v5.1/typed-override.yaml +2 -0
- data/spec/support/v5.2-no-sorbet/.gitignore +31 -0
- data/spec/support/v5.2-no-sorbet/Gemfile +12 -28
- data/spec/support/v5.2-no-sorbet/Gemfile.lock +24 -10
- data/spec/support/v5.2-no-sorbet/app/assets/config/manifest.js +2 -0
- data/spec/support/{v5.1/test/mailers → v5.2-no-sorbet/app/assets/images}/.keep +0 -0
- data/spec/support/v5.2-no-sorbet/app/assets/stylesheets/application.css +15 -0
- data/spec/support/{rails_shared → v5.2-no-sorbet}/app/controllers/application_controller.rb +0 -0
- data/spec/support/{v5.1/test/models → v5.2-no-sorbet/app/controllers/concerns}/.keep +0 -0
- data/spec/support/v5.2-no-sorbet/app/helpers/application_helper.rb +2 -0
- data/spec/support/{rails_shared → v5.2-no-sorbet}/app/helpers/bar_helper.rb +0 -0
- data/spec/support/{rails_shared → v5.2-no-sorbet}/app/helpers/baz_helper.rb +0 -0
- data/spec/support/{rails_shared → v5.2-no-sorbet}/app/helpers/foo_helper.rb +0 -0
- data/spec/support/v5.2-no-sorbet/app/jobs/application_job.rb +0 -1
- data/spec/support/v5.2-no-sorbet/app/mailers/application_mailer.rb +0 -1
- data/spec/support/{rails_shared → v5.2-no-sorbet}/app/models/application_record.rb +0 -1
- data/spec/support/v5.2-no-sorbet/{test/controllers → app/models/concerns}/.keep +0 -0
- data/spec/support/{rails_shared → v5.2-no-sorbet}/app/models/concerns/mythical.rb +1 -1
- data/spec/support/{rails_shared → v5.2-no-sorbet}/app/models/potion.rb +0 -1
- data/spec/support/{rails_shared → v5.2-no-sorbet}/app/models/spell_book.rb +0 -2
- data/spec/support/{rails_shared → v5.2-no-sorbet}/app/models/wand.rb +0 -0
- data/spec/support/{rails_shared → v5.2-no-sorbet}/app/models/wizard.rb +0 -1
- data/spec/support/v5.2-no-sorbet/app/views/layouts/application.html.erb +14 -0
- data/spec/support/v5.2-no-sorbet/bin/setup +3 -0
- data/spec/support/v5.2-no-sorbet/bin/update +3 -0
- data/spec/support/v5.2-no-sorbet/bin/yarn +11 -0
- data/spec/support/v5.2-no-sorbet/config/application.rb +5 -8
- data/spec/support/v5.2-no-sorbet/config/boot.rb +0 -1
- data/spec/support/v5.2-no-sorbet/config/environment.rb +0 -1
- data/spec/support/v5.2-no-sorbet/config/environments/development.rb +0 -1
- data/spec/support/v5.2-no-sorbet/config/environments/production.rb +1 -7
- data/spec/support/v5.2-no-sorbet/config/environments/test.rb +0 -1
- data/spec/support/v5.2-no-sorbet/config/initializers/application_controller_renderer.rb +0 -1
- data/spec/support/v5.2-no-sorbet/config/initializers/backtrace_silencers.rb +0 -1
- data/spec/support/v5.2-no-sorbet/config/initializers/content_security_policy.rb +25 -0
- data/spec/support/v5.2-no-sorbet/config/initializers/cookies_serializer.rb +5 -0
- data/spec/support/v5.2-no-sorbet/config/initializers/filter_parameter_logging.rb +0 -1
- data/spec/support/v5.2-no-sorbet/config/initializers/inflections.rb +0 -1
- data/spec/support/v5.2-no-sorbet/config/initializers/mime_types.rb +0 -1
- data/spec/support/v5.2-no-sorbet/config/initializers/sorbet_rails.rb +3 -0
- data/spec/support/v5.2-no-sorbet/config/initializers/wrap_parameters.rb +0 -1
- data/spec/support/v5.2-no-sorbet/config/puma.rb +0 -1
- data/spec/support/v5.2-no-sorbet/config/routes.rb +4 -0
- data/spec/support/v5.2-no-sorbet/db/migrate/20190620000001_create_wizards.rb +12 -0
- data/spec/support/v5.2-no-sorbet/db/migrate/20190620000002_create_wands.rb +11 -0
- data/spec/support/v5.2-no-sorbet/db/migrate/20190620000003_create_spell_books.rb +8 -0
- data/spec/support/{v4.2/db/migrate/20190622000000_add_more_column_types_to_wands.rb → v5.2-no-sorbet/db/migrate/20190620000004_add_more_column_types_to_wands.rb} +6 -2
- data/spec/support/v5.2-no-sorbet/db/schema.rb +1 -2
- data/spec/support/v5.2-no-sorbet/db/seeds.rb +0 -1
- data/spec/support/v5.2-no-sorbet/{test/fixtures → lib/assets}/.keep +0 -0
- data/spec/support/v5.2-no-sorbet/lib/mythical_rbi_plugin.rb +16 -0
- data/spec/support/v5.2-no-sorbet/package.json +5 -0
- data/spec/support/v5.2-no-sorbet/sorbet_test_cases.rb +123 -0
- data/spec/support/v5.2-no-sorbet/typed-override.yaml +2 -0
- data/spec/support/v5.2/.gitignore +31 -0
- data/spec/support/v5.2/Gemfile +12 -28
- data/spec/support/v5.2/Gemfile.lock +24 -10
- data/spec/support/v5.2/app/assets/config/manifest.js +2 -0
- data/spec/support/{v5.2-no-sorbet/test/fixtures/files → v5.2/app/assets/images}/.keep +0 -0
- data/spec/support/v5.2/app/assets/stylesheets/application.css +15 -0
- data/spec/support/v5.2/app/controllers/application_controller.rb +3 -0
- data/spec/support/{v5.2-no-sorbet/test/integration → v5.2/app/controllers/concerns}/.keep +0 -0
- data/spec/support/v5.2/app/helpers/application_helper.rb +3 -0
- data/spec/support/v5.2/app/helpers/bar_helper.rb +3 -0
- data/spec/support/v5.2/app/helpers/baz_helper.rb +3 -0
- data/spec/support/v5.2/app/helpers/foo_helper.rb +3 -0
- data/spec/support/v5.2/app/models/application_record.rb +5 -0
- data/spec/support/{v5.2-no-sorbet/test/mailers → v5.2/app/models/concerns}/.keep +0 -0
- data/spec/support/v5.2/app/models/concerns/mythical.rb +11 -0
- data/spec/support/v5.2/app/models/potion.rb +5 -0
- data/spec/support/v5.2/app/models/spell_book.rb +5 -0
- data/spec/support/v5.2/app/models/wand.rb +17 -0
- data/spec/support/v5.2/app/models/wizard.rb +14 -0
- data/spec/support/v5.2/app/views/layouts/application.html.erb +14 -0
- data/spec/support/v5.2/bin/setup +3 -0
- data/spec/support/v5.2/bin/update +3 -0
- data/spec/support/v5.2/bin/yarn +11 -0
- data/spec/support/v5.2/config/application.rb +5 -7
- data/spec/support/v5.2/config/environments/production.rb +1 -6
- data/spec/support/v5.2/config/initializers/content_security_policy.rb +26 -0
- data/spec/support/v5.2/config/initializers/cookies_serializer.rb +6 -0
- data/spec/support/v5.2/config/initializers/sorbet_rails.rb +3 -0
- data/spec/support/v5.2/config/routes.rb +5 -0
- data/spec/support/v5.2/db/migrate/20190620000001_create_wizards.rb +13 -0
- data/spec/support/v5.2/db/migrate/20190620000002_create_wands.rb +12 -0
- data/spec/support/v5.2/db/migrate/20190620000003_create_spell_books.rb +9 -0
- data/spec/support/v5.2/db/migrate/20190620000004_add_more_column_types_to_wands.rb +16 -0
- data/spec/support/v5.2/db/schema.rb +1 -1
- data/spec/support/{v5.2-no-sorbet/test/models → v5.2/lib/assets}/.keep +0 -0
- data/spec/support/v5.2/lib/mythical_rbi_plugin.rb +16 -0
- data/spec/support/v5.2/package.json +5 -0
- data/spec/support/v5.2/sorbet/rbi/gems/actionmailer.rbi +2 -50
- data/spec/support/v5.2/sorbet/rbi/gems/actionpack.rbi +504 -640
- data/spec/support/v5.2/sorbet/rbi/gems/actionview.rbi +123 -124
- data/spec/support/v5.2/sorbet/rbi/gems/activejob.rbi +0 -37
- data/spec/support/v5.2/sorbet/rbi/gems/activemodel.rbi +70 -69
- data/spec/support/v5.2/sorbet/rbi/gems/activerecord.rbi +521 -690
- data/spec/support/v5.2/sorbet/rbi/gems/activesupport.rbi +93 -235
- data/spec/support/v5.2/sorbet/rbi/gems/arel.rbi +4 -0
- data/spec/support/v5.2/sorbet/rbi/gems/bindex.rbi +36 -0
- data/spec/support/v5.2/sorbet/rbi/gems/byebug.rbi +22 -22
- data/spec/support/v5.2/sorbet/rbi/gems/concurrent-ruby.rbi +4 -0
- data/spec/support/v5.2/sorbet/rbi/gems/jbuilder.rbi +99 -0
- data/spec/support/v5.2/sorbet/rbi/gems/mail.rbi +2 -2
- data/spec/support/v5.2/sorbet/rbi/gems/mini_mime.rbi +8 -2
- data/spec/support/v5.2/sorbet/rbi/gems/nokogiri.rbi +10 -6
- data/spec/support/v5.2/sorbet/rbi/gems/parlour.rbi +214 -0
- data/spec/support/v5.2/sorbet/rbi/gems/rack.rbi +57 -98
- data/spec/support/v5.2/sorbet/rbi/gems/rails-html-sanitizer.rbi +3 -2
- data/spec/support/v5.2/sorbet/rbi/gems/railties.rbi +1 -215
- data/spec/support/v5.2/sorbet/rbi/gems/web-console.rbi +73 -0
- data/spec/support/v5.2/sorbet/rbi/sorbet-typed/lib/actionpack/all/actionpack.rbi +457 -2
- data/spec/support/v5.2/sorbet/rbi/sorbet-typed/lib/activemodel/all/activemodel.rbi +422 -0
- data/spec/support/v5.2/sorbet/rbi/sorbet-typed/lib/activerecord/>=5.2/activerecord.rbi +17 -0
- data/spec/support/v5.2/sorbet/rbi/sorbet-typed/lib/activerecord/all/activerecord.rbi +1229 -17
- data/spec/support/v5.2/sorbet/rbi/sorbet-typed/lib/activerecord/{~>5.2 → ~>5.2.0}/activerecord.rbi +1 -1
- data/spec/support/v5.2/sorbet/rbi/sorbet-typed/lib/activesupport/all/activesupport.rbi +360 -9
- data/spec/support/v5.2/sorbet/rbi/sorbet-typed/lib/bundler/all/bundler.rbi +32 -4
- data/spec/support/v5.2/sorbet/rbi/sorbet-typed/lib/minitest/all/minitest.rbi +99 -0
- data/spec/support/v5.2/sorbet/rbi/sorbet-typed/lib/ruby/all/open3.rbi +14 -14
- data/spec/support/v5.2/sorbet/rbi/todo.rbi +59 -2
- data/spec/support/v5.2/sorbet_test_cases.rb +123 -0
- data/spec/support/v5.2/typed-override.yaml +2 -0
- data/spec/support/v6.0/.gitignore +2 -0
- data/spec/support/v6.0/Gemfile +8 -17
- data/spec/support/v6.0/Gemfile.lock +19 -6
- data/spec/support/v6.0/app/assets/config/manifest.js +2 -0
- data/spec/support/{v5.2/sorbet → v6.0/app/assets/images}/.keep +0 -0
- data/spec/support/v6.0/app/assets/stylesheets/application.css +15 -0
- data/spec/support/v6.0/app/controllers/application_controller.rb +3 -0
- data/spec/support/{v5.2/test/controllers → v6.0/app/controllers/concerns}/.keep +0 -0
- data/spec/support/v6.0/app/helpers/application_helper.rb +3 -0
- data/spec/support/v6.0/app/helpers/bar_helper.rb +3 -0
- data/spec/support/v6.0/app/helpers/baz_helper.rb +3 -0
- data/spec/support/v6.0/app/helpers/foo_helper.rb +3 -0
- data/spec/support/v6.0/app/models/application_record.rb +5 -0
- data/spec/support/{v5.2/test/fixtures → v6.0/app/models/concerns}/.keep +0 -0
- data/spec/support/v6.0/app/models/concerns/mythical.rb +11 -0
- data/spec/support/v6.0/app/models/potion.rb +5 -0
- data/spec/support/v6.0/app/models/spell_book.rb +5 -0
- data/spec/support/v6.0/app/models/wand.rb +17 -0
- data/spec/support/v6.0/app/models/wizard.rb +14 -0
- data/spec/support/v6.0/app/views/layouts/application.html.erb +14 -0
- data/spec/support/v6.0/config/application.rb +4 -6
- data/spec/support/v6.0/config/database.yml +1 -1
- data/spec/support/v6.0/config/environments/development.rb +3 -0
- data/spec/support/v6.0/config/environments/production.rb +1 -5
- data/spec/support/v6.0/config/initializers/content_security_policy.rb +29 -0
- data/spec/support/v6.0/config/initializers/cookies_serializer.rb +6 -0
- data/spec/support/v6.0/config/initializers/sorbet_rails.rb +3 -0
- data/spec/support/v6.0/config/routes.rb +2 -2
- data/spec/support/v6.0/db/migrate/20190620000001_create_wizards.rb +13 -0
- data/spec/support/v6.0/db/migrate/20190620000002_create_wands.rb +12 -0
- data/spec/support/v6.0/db/migrate/20190620000003_create_spell_books.rb +9 -0
- data/spec/support/v6.0/db/migrate/20190620000004_add_more_column_types_to_wands.rb +16 -0
- data/spec/support/v6.0/db/schema.rb +1 -1
- data/spec/support/{v5.2/test/fixtures/files → v6.0/lib/assets}/.keep +0 -0
- data/spec/support/v6.0/lib/mythical_rbi_plugin.rb +16 -0
- data/spec/support/v6.0/public/robots.txt +1 -1
- data/spec/support/v6.0/sorbet/rbi/gems/actionmailbox.rbi +1 -1
- data/spec/support/v6.0/sorbet/rbi/gems/actionmailer.rbi +1 -50
- data/spec/support/v6.0/sorbet/rbi/gems/actionpack.rbi +232 -479
- data/spec/support/v6.0/sorbet/rbi/gems/actiontext.rbi +1 -1
- data/spec/support/v6.0/sorbet/rbi/gems/actionview.rbi +179 -77
- data/spec/support/v6.0/sorbet/rbi/gems/activejob.rbi +1 -283
- data/spec/support/v6.0/sorbet/rbi/gems/activemodel.rbi +71 -70
- data/spec/support/v6.0/sorbet/rbi/gems/activerecord.rbi +705 -843
- data/spec/support/v6.0/sorbet/rbi/gems/activestorage.rbi +5 -1
- data/spec/support/v6.0/sorbet/rbi/gems/activesupport.rbi +121 -300
- data/spec/support/v6.0/sorbet/rbi/gems/bindex.rbi +36 -0
- data/spec/support/v6.0/sorbet/rbi/gems/byebug.rbi +22 -22
- data/spec/support/v6.0/sorbet/rbi/gems/jbuilder.rbi +99 -0
- data/spec/support/v6.0/sorbet/rbi/gems/mail.rbi +1 -1
- data/spec/support/v6.0/sorbet/rbi/gems/mini_mime.rbi +8 -2
- data/spec/support/v6.0/sorbet/rbi/gems/parlour.rbi +214 -0
- data/spec/support/v6.0/sorbet/rbi/gems/rack.rbi +54 -95
- data/spec/support/v6.0/sorbet/rbi/gems/rails-html-sanitizer.rbi +3 -2
- data/spec/support/v6.0/sorbet/rbi/gems/railties.rbi +9 -221
- data/spec/support/v6.0/sorbet/rbi/gems/web-console.rbi +72 -0
- data/spec/support/v6.0/sorbet/rbi/gems/zeitwerk.rbi +12 -4
- data/spec/support/v6.0/sorbet/rbi/sorbet-typed/lib/actionpack/all/actionpack.rbi +457 -2
- data/spec/support/v6.0/sorbet/rbi/sorbet-typed/lib/activemodel/all/activemodel.rbi +422 -0
- data/spec/support/v6.0/sorbet/rbi/sorbet-typed/lib/activerecord/>=5.2/activerecord.rbi +17 -0
- data/spec/support/v6.0/sorbet/rbi/sorbet-typed/lib/activerecord/all/activerecord.rbi +1229 -17
- data/spec/support/v6.0/sorbet/rbi/sorbet-typed/lib/activerecord/~>6.0.0.rc1/activerecord.rbi +10 -0
- data/spec/support/v6.0/sorbet/rbi/sorbet-typed/lib/activesupport/>=6.0.0.rc1/activesupport.rbi +23 -0
- data/spec/support/v6.0/sorbet/rbi/sorbet-typed/lib/activesupport/all/activesupport.rbi +361 -10
- data/spec/support/v6.0/sorbet/rbi/sorbet-typed/lib/bundler/all/bundler.rbi +32 -4
- data/spec/support/v6.0/sorbet/rbi/sorbet-typed/lib/minitest/all/minitest.rbi +99 -0
- data/spec/support/v6.0/sorbet/rbi/sorbet-typed/lib/ruby/all/open3.rbi +14 -14
- data/spec/support/v6.0/sorbet/rbi/todo.rbi +59 -0
- data/spec/support/v6.0/sorbet_test_cases.rb +123 -0
- data/spec/support/v6.0/typed-override.yaml +2 -0
- data/spec/test_data/v4.2/expected_helpers.rbi +5 -0
- data/spec/test_data/v5.0/expected_helpers.rbi +5 -0
- data/spec/test_data/v5.1/expected_helpers.rbi +5 -0
- data/spec/test_data/v5.2-no-sorbet/expected_helpers.rbi +5 -0
- data/spec/test_data/v5.2/expected_helpers.rbi +5 -0
- data/spec/test_data/v6.0/expected_helpers.rbi +5 -0
- data/spec/test_data/v6.0/expected_routes.rbi +12 -0
- metadata +356 -317
- data/spec/support/rails_shared/config/initializers/sorbet_rails.rb +0 -3
- data/spec/support/rails_shared/config/routes.rb +0 -6
- data/spec/support/rails_shared/lib/mythical_rbi_plugin.rb +0 -16
- data/spec/support/rails_shared/typed-override.yaml +0 -2
- data/spec/support/rails_symlinks/app/controllers +0 -1
- data/spec/support/rails_symlinks/app/helpers +0 -1
- data/spec/support/rails_symlinks/app/models +0 -1
- data/spec/support/rails_symlinks/config/initializers/sorbet_rails.rb +0 -1
- data/spec/support/rails_symlinks/config/routes.rb +0 -5
- data/spec/support/rails_symlinks/db/migrate +0 -1
- data/spec/support/rails_symlinks/lib/mythical_rbi_plugin.rb +0 -1
- data/spec/support/rails_symlinks/sorbet_test_cases.rb +0 -1
- data/spec/support/rails_symlinks/typed-override.yaml +0 -1
- data/spec/support/v4.2/app/helpers +0 -1
- data/spec/support/v4.2/app/models +0 -1
- data/spec/support/v4.2/config/initializers/sorbet_rails.rb +0 -1
- data/spec/support/v4.2/config/secrets.yml +0 -22
- data/spec/support/v4.2/lib/mythical_rbi_plugin.rb +0 -1
- data/spec/support/v4.2/sorbet/rbi/gems/binding_of_caller.rbi +0 -22
- data/spec/support/v4.2/sorbet/rbi/gems/debug_inspector.rbi +0 -18
- data/spec/support/v4.2/sorbet/rbi/gems/rdoc.rbi +0 -1053
- data/spec/support/v4.2/sorbet/rbi/gems/sdoc.rbi +0 -73
- data/spec/support/v4.2/sorbet_test_cases.rb +0 -1
- data/spec/support/v4.2/typed-override.yaml +0 -1
- data/spec/support/v5.0/app/channels/application_cable/channel.rb +0 -5
- data/spec/support/v5.0/app/channels/application_cable/connection.rb +0 -5
- data/spec/support/v5.0/app/controllers +0 -1
- data/spec/support/v5.0/app/helpers +0 -1
- data/spec/support/v5.0/app/models +0 -1
- data/spec/support/v5.0/config/cable.yml +0 -9
- data/spec/support/v5.0/config/initializers/cors.rb +0 -17
- data/spec/support/v5.0/config/initializers/sorbet_rails.rb +0 -1
- data/spec/support/v5.0/config/secrets.yml +0 -22
- data/spec/support/v5.0/db/migrate +0 -1
- data/spec/support/v5.0/lib/mythical_rbi_plugin.rb +0 -1
- data/spec/support/v5.0/rails_symlinks/app/controllers +0 -1
- data/spec/support/v5.0/rails_symlinks/app/models +0 -1
- data/spec/support/v5.0/rails_symlinks/config/routes.rb +0 -6
- data/spec/support/v5.0/rails_symlinks/db/migrate +0 -1
- data/spec/support/v5.0/sorbet/rbi/gems/actioncable.rbi +0 -309
- data/spec/support/v5.0/sorbet/rbi/gems/method_source.rbi +0 -63
- data/spec/support/v5.0/sorbet/rbi/gems/minitest.rbi +0 -276
- data/spec/support/v5.0/sorbet/rbi/gems/rails-dom-testing.rbi +0 -67
- data/spec/support/v5.0/sorbet/rbi/gems/rake.rbi +0 -255
- data/spec/support/v5.0/sorbet/rbi/gems/thor.rbi +0 -401
- data/spec/support/v5.0/sorbet_test_cases.rb +0 -1
- data/spec/support/v5.0/test/test_helper.rb +0 -11
- data/spec/support/v5.0/typed-override.yaml +0 -1
- data/spec/support/v5.1/app/channels/application_cable/channel.rb +0 -5
- data/spec/support/v5.1/app/channels/application_cable/connection.rb +0 -5
- data/spec/support/v5.1/app/controllers +0 -1
- data/spec/support/v5.1/app/helpers +0 -1
- data/spec/support/v5.1/app/models +0 -1
- data/spec/support/v5.1/bin/spring +0 -17
- data/spec/support/v5.1/config/cable.yml +0 -10
- data/spec/support/v5.1/config/initializers/cors.rb +0 -17
- data/spec/support/v5.1/config/initializers/sorbet_rails.rb +0 -1
- data/spec/support/v5.1/config/routes.rb +0 -1
- data/spec/support/v5.1/config/secrets.yml +0 -32
- data/spec/support/v5.1/config/spring.rb +0 -7
- data/spec/support/v5.1/db/migrate +0 -1
- data/spec/support/v5.1/lib/mythical_rbi_plugin.rb +0 -1
- data/spec/support/v5.1/sorbet/rbi/gems/actioncable.rbi +0 -309
- data/spec/support/v5.1/sorbet/rbi/gems/method_source.rbi +0 -63
- data/spec/support/v5.1/sorbet/rbi/gems/minitest.rbi +0 -276
- data/spec/support/v5.1/sorbet/rbi/gems/rails-dom-testing.rbi +0 -67
- data/spec/support/v5.1/sorbet/rbi/gems/rake.rbi +0 -255
- data/spec/support/v5.1/sorbet/rbi/gems/thor.rbi +0 -450
- data/spec/support/v5.1/sorbet_test_cases.rb +0 -1
- data/spec/support/v5.1/test/test_helper.rb +0 -11
- data/spec/support/v5.1/typed-override.yaml +0 -1
- data/spec/support/v5.2-no-sorbet/app/channels/application_cable/channel.rb +0 -5
- data/spec/support/v5.2-no-sorbet/app/channels/application_cable/connection.rb +0 -5
- data/spec/support/v5.2-no-sorbet/app/controllers +0 -1
- data/spec/support/v5.2-no-sorbet/app/helpers +0 -1
- data/spec/support/v5.2-no-sorbet/app/models +0 -1
- data/spec/support/v5.2-no-sorbet/bin/spring +0 -17
- data/spec/support/v5.2-no-sorbet/config/cable.yml +0 -10
- data/spec/support/v5.2-no-sorbet/config/credentials.yml.enc +0 -1
- data/spec/support/v5.2-no-sorbet/config/initializers/cors.rb +0 -17
- data/spec/support/v5.2-no-sorbet/config/initializers/sorbet_rails.rb +0 -1
- data/spec/support/v5.2-no-sorbet/config/routes.rb +0 -1
- data/spec/support/v5.2-no-sorbet/config/spring.rb +0 -7
- data/spec/support/v5.2-no-sorbet/db/migrate +0 -1
- data/spec/support/v5.2-no-sorbet/lib/mythical_rbi_plugin.rb +0 -1
- data/spec/support/v5.2-no-sorbet/sorbet_test_cases.rb +0 -1
- data/spec/support/v5.2-no-sorbet/test/test_helper.rb +0 -11
- data/spec/support/v5.2-no-sorbet/typed-override.yaml +0 -1
- data/spec/support/v5.2/app/channels/application_cable/channel.rb +0 -5
- data/spec/support/v5.2/app/channels/application_cable/connection.rb +0 -5
- data/spec/support/v5.2/app/controllers +0 -1
- data/spec/support/v5.2/app/helpers +0 -1
- data/spec/support/v5.2/app/models +0 -1
- data/spec/support/v5.2/bin/spring +0 -17
- data/spec/support/v5.2/config/cable.yml +0 -10
- data/spec/support/v5.2/config/credentials.yml.enc +0 -1
- data/spec/support/v5.2/config/initializers/cors.rb +0 -17
- data/spec/support/v5.2/config/initializers/sorbet_rails.rb +0 -1
- data/spec/support/v5.2/config/routes.rb +0 -1
- data/spec/support/v5.2/config/spring.rb +0 -7
- data/spec/support/v5.2/db/migrate +0 -1
- data/spec/support/v5.2/lib/mythical_rbi_plugin.rb +0 -1
- data/spec/support/v5.2/sorbet/rbi/gems/actioncable.rbi +0 -309
- data/spec/support/v5.2/sorbet/rbi/gems/method_source.rbi +0 -63
- data/spec/support/v5.2/sorbet/rbi/gems/minitest.rbi +0 -276
- data/spec/support/v5.2/sorbet/rbi/gems/rails-dom-testing.rbi +0 -67
- data/spec/support/v5.2/sorbet/rbi/gems/rake.rbi +0 -251
- data/spec/support/v5.2/sorbet/rbi/gems/thor.rbi +0 -449
- data/spec/support/v5.2/sorbet_test_cases.rb +0 -1
- data/spec/support/v5.2/test/integration/.keep +0 -0
- data/spec/support/v5.2/test/mailers/.keep +0 -0
- data/spec/support/v5.2/test/models/.keep +0 -0
- data/spec/support/v5.2/test/test_helper.rb +0 -11
- data/spec/support/v5.2/typed-override.yaml +0 -1
- data/spec/support/v6.0/app/channels/application_cable/channel.rb +0 -5
- data/spec/support/v6.0/app/channels/application_cable/connection.rb +0 -5
- data/spec/support/v6.0/app/controllers +0 -1
- data/spec/support/v6.0/app/helpers +0 -1
- data/spec/support/v6.0/app/models +0 -1
- data/spec/support/v6.0/config/cable.yml +0 -10
- data/spec/support/v6.0/config/credentials.yml.enc +0 -1
- data/spec/support/v6.0/config/initializers/cors.rb +0 -17
- data/spec/support/v6.0/config/initializers/sorbet_rails.rb +0 -1
- data/spec/support/v6.0/db/migrate +0 -1
- data/spec/support/v6.0/lib/mythical_rbi_plugin.rb +0 -1
- data/spec/support/v6.0/sorbet/rbi/gems/actioncable.rbi +0 -245
- data/spec/support/v6.0/sorbet/rbi/gems/method_source.rbi +0 -63
- data/spec/support/v6.0/sorbet/rbi/gems/minitest.rbi +0 -276
- data/spec/support/v6.0/sorbet/rbi/gems/rails-dom-testing.rbi +0 -67
- data/spec/support/v6.0/sorbet/rbi/gems/rake.rbi +0 -254
- data/spec/support/v6.0/sorbet/rbi/gems/thor.rbi +0 -450
- data/spec/support/v6.0/sorbet_test_cases.rb +0 -1
- data/spec/support/v6.0/test/channels/application_cable/connection_test.rb +0 -12
- data/spec/support/v6.0/test/controllers/.keep +0 -0
- data/spec/support/v6.0/test/fixtures/.keep +0 -0
- data/spec/support/v6.0/test/fixtures/files/.keep +0 -0
- data/spec/support/v6.0/test/integration/.keep +0 -0
- data/spec/support/v6.0/test/mailers/.keep +0 -0
- data/spec/support/v6.0/test/models/.keep +0 -0
- data/spec/support/v6.0/test/test_helper.rb +0 -14
- data/spec/support/v6.0/typed-override.yaml +0 -1
@@ -0,0 +1,422 @@
|
|
1
|
+
# This file is autogenerated. Do not edit it by hand. Regenerate it with:
|
2
|
+
# srb rbi sorbet-typed
|
3
|
+
#
|
4
|
+
# If you would like to make changes to this file, great! Please upstream any changes you make here:
|
5
|
+
#
|
6
|
+
# https://github.com/sorbet/sorbet-typed/edit/master/lib/activemodel/all/activemodel.rbi
|
7
|
+
#
|
8
|
+
# typed: false
|
9
|
+
|
10
|
+
module ActiveModel::Dirty
|
11
|
+
extend T::Sig
|
12
|
+
sig { params(attr: Symbol, from: T.untyped, to: T.untyped).returns(T::Boolean) }
|
13
|
+
def attribute_changed?(attr, from: nil, to: nil); end
|
14
|
+
|
15
|
+
sig { params(attr_name: Symbol).returns(T::Boolean) }
|
16
|
+
def attribute_changed_in_place?(attr_name); end
|
17
|
+
|
18
|
+
sig { params(attr_name: Symbol).returns(T::Boolean) }
|
19
|
+
def attribute_previously_changed?(attr_name); end
|
20
|
+
|
21
|
+
sig { returns(T::Boolean) }
|
22
|
+
def changed?; end
|
23
|
+
end
|
24
|
+
|
25
|
+
module ActiveModel::Validations
|
26
|
+
module ClassMethods
|
27
|
+
# https://github.com/rails/rails/blob/v5.2.3/activemodel/lib/active_model/validations.rb#L136-L154
|
28
|
+
sig do
|
29
|
+
params(
|
30
|
+
names: T.any(Symbol, String),
|
31
|
+
if: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
32
|
+
on: T.any(Symbol, String),
|
33
|
+
prepend: T::Boolean,
|
34
|
+
unless: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
35
|
+
).void
|
36
|
+
end
|
37
|
+
def validate(
|
38
|
+
*names,
|
39
|
+
if: nil,
|
40
|
+
on: nil,
|
41
|
+
prepend: false,
|
42
|
+
unless: nil
|
43
|
+
); end
|
44
|
+
|
45
|
+
# https://github.com/rails/rails/blob/v5.2.3/activemodel/lib/active_model/validations/validates.rb#L75-L105
|
46
|
+
sig do
|
47
|
+
params(
|
48
|
+
names: T.any(Symbol, String), # a splat of at least one attribute name
|
49
|
+
absence: T.any(T::Boolean, T::Hash[T.untyped, T.untyped]),
|
50
|
+
acceptance: T.any(T::Boolean, T::Hash[T.untyped, T.untyped]),
|
51
|
+
allow_blank: T::Boolean,
|
52
|
+
allow_nil: T::Boolean,
|
53
|
+
confirmation: T.any(T::Boolean, T::Hash[T.untyped, T.untyped]),
|
54
|
+
# `exclusion` and `inclusion` are tricky to type without better support
|
55
|
+
# for overloading and shapes. Value can be anything that responds to
|
56
|
+
# `include?` (e.g. (1..3)), or a hash having an `in` or `within` key,
|
57
|
+
# like { in: [1, 2, 3], ... }
|
58
|
+
exclusion: T::Enumerable[T.untyped],
|
59
|
+
# `format` hash must additionally contain either :with or :without keys.
|
60
|
+
# Alternatively, it can be a Regexp.
|
61
|
+
format: T.any(T::Hash[T.untyped, T.untyped], Regexp),
|
62
|
+
if: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
63
|
+
# `exclusion` and `inclusion` are tricky to type without better support
|
64
|
+
# for overloading and shapes. Value can be anything that responds to
|
65
|
+
# `include?` (e.g. (1..3)), or a hash having an `in` or `within` key,
|
66
|
+
# like { in: [1, 2, 3], ... }
|
67
|
+
inclusion: T::Enumerable[T.untyped],
|
68
|
+
# if Hash, must contain :in, :within, :maximum, :minimum, or :is keys
|
69
|
+
length: T.any(T::Range, T::Hash[T.untyped, T.untyped]),
|
70
|
+
numericality: T.any(T::Boolean, T::Hash[T.untyped, T.untyped]),
|
71
|
+
on: T.any(Symbol, String, T::Array[T.any(Symbol, String)]),
|
72
|
+
presence: T::Boolean,
|
73
|
+
size: T.any(T::Boolean, T::Hash[T.untyped, T.untyped]),
|
74
|
+
strict: T::Boolean,
|
75
|
+
uniqueness: T.any(T::Boolean, T::Hash[T.untyped, T.untyped]),
|
76
|
+
unless: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
77
|
+
).void
|
78
|
+
end
|
79
|
+
def validates(
|
80
|
+
*names,
|
81
|
+
absence: false,
|
82
|
+
acceptance: {},
|
83
|
+
allow_blank: false,
|
84
|
+
allow_nil: false,
|
85
|
+
confirmation: false,
|
86
|
+
exclusion: [],
|
87
|
+
format: {},
|
88
|
+
if: nil,
|
89
|
+
inclusion: [],
|
90
|
+
length: {},
|
91
|
+
numericality: false,
|
92
|
+
on: :_,
|
93
|
+
presence: false,
|
94
|
+
size: false,
|
95
|
+
strict: false,
|
96
|
+
uniqueness: false,
|
97
|
+
unless: :_
|
98
|
+
)
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
class ActiveModel::Type::Boolean
|
104
|
+
sig { params(arg0: T.untyped).returns(T.nilable(T::Boolean))}
|
105
|
+
def cast(arg0); end
|
106
|
+
end
|
107
|
+
|
108
|
+
module ActiveModel::Validations::HelperMethods
|
109
|
+
sig do
|
110
|
+
params(
|
111
|
+
attr_names: T.any(String, Symbol),
|
112
|
+
message: String,
|
113
|
+
if: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
114
|
+
unless: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
115
|
+
on: T.any(Symbol, String),
|
116
|
+
allow_nil: T::Boolean,
|
117
|
+
allow_blank: T::Boolean,
|
118
|
+
strict: T::Boolean
|
119
|
+
).void
|
120
|
+
end
|
121
|
+
def validates_absence_of(
|
122
|
+
*attr_names,
|
123
|
+
message: 'must be blank',
|
124
|
+
if: nil,
|
125
|
+
unless: :_,
|
126
|
+
on: :_,
|
127
|
+
allow_nil: false,
|
128
|
+
allow_blank: false,
|
129
|
+
strict: false
|
130
|
+
); end
|
131
|
+
|
132
|
+
sig do
|
133
|
+
params(
|
134
|
+
attr_names: T.any(String, Symbol),
|
135
|
+
message: String,
|
136
|
+
accept: T.untyped,
|
137
|
+
if: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
138
|
+
unless: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
139
|
+
on: T.any(Symbol, String),
|
140
|
+
allow_nil: T::Boolean,
|
141
|
+
allow_blank: T::Boolean,
|
142
|
+
strict: T::Boolean
|
143
|
+
).void
|
144
|
+
end
|
145
|
+
def validates_acceptance_of(
|
146
|
+
*attr_names,
|
147
|
+
message: 'must be accepted',
|
148
|
+
accept: ['1', true],
|
149
|
+
if: nil,
|
150
|
+
unless: :_,
|
151
|
+
on: :_,
|
152
|
+
allow_nil: false,
|
153
|
+
allow_blank: false,
|
154
|
+
strict: false
|
155
|
+
); end
|
156
|
+
|
157
|
+
sig do
|
158
|
+
params(
|
159
|
+
attr_names: T.any(String, Symbol),
|
160
|
+
message: String,
|
161
|
+
case_sensitive: T::Boolean,
|
162
|
+
if: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
163
|
+
unless: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
164
|
+
on: T.any(Symbol, String),
|
165
|
+
allow_nil: T::Boolean,
|
166
|
+
allow_blank: T::Boolean,
|
167
|
+
strict: T::Boolean
|
168
|
+
).void
|
169
|
+
end
|
170
|
+
def validates_confirmation_of(
|
171
|
+
*attr_names,
|
172
|
+
message: "doesn't match %{translated_attribute_name}",
|
173
|
+
case_sensitive: true,
|
174
|
+
if: nil,
|
175
|
+
unless: :_,
|
176
|
+
on: :_,
|
177
|
+
allow_nil: false,
|
178
|
+
allow_blank: false,
|
179
|
+
strict: false
|
180
|
+
); end
|
181
|
+
|
182
|
+
# A type alias for the in/within parameters on the
|
183
|
+
# validates_(inclusion/exclusion)_of methods.
|
184
|
+
InWithinType = T.type_alias(
|
185
|
+
T.nilable(
|
186
|
+
T.any(
|
187
|
+
Symbol,
|
188
|
+
String,
|
189
|
+
T::Array[T.any(String, Symbol)],
|
190
|
+
T::Range[Integer],
|
191
|
+
T.proc.params(arg0: T.untyped).returns(T::Boolean)
|
192
|
+
)
|
193
|
+
)
|
194
|
+
)
|
195
|
+
sig do
|
196
|
+
params(
|
197
|
+
attr_names: T.any(String, Symbol),
|
198
|
+
message: String,
|
199
|
+
in: InWithinType,
|
200
|
+
within: InWithinType,
|
201
|
+
if: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
202
|
+
unless: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
203
|
+
on: T.any(Symbol, String),
|
204
|
+
allow_nil: T::Boolean,
|
205
|
+
allow_blank: T::Boolean,
|
206
|
+
strict: T::Boolean
|
207
|
+
).void
|
208
|
+
end
|
209
|
+
def validates_exclusion_of(
|
210
|
+
*attr_names,
|
211
|
+
message: 'is reserved',
|
212
|
+
in: nil,
|
213
|
+
within: nil,
|
214
|
+
if: nil,
|
215
|
+
unless: :_,
|
216
|
+
on: :_,
|
217
|
+
allow_nil: false,
|
218
|
+
allow_blank: false,
|
219
|
+
strict: false
|
220
|
+
); end
|
221
|
+
|
222
|
+
sig do
|
223
|
+
params(
|
224
|
+
attr_names: T.any(String, Symbol),
|
225
|
+
message: String,
|
226
|
+
with: T.untyped,
|
227
|
+
without: T.untyped,
|
228
|
+
multiline: T.untyped,
|
229
|
+
if: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
230
|
+
unless: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
231
|
+
on: T.any(Symbol, String),
|
232
|
+
allow_nil: T::Boolean,
|
233
|
+
allow_blank: T::Boolean,
|
234
|
+
strict: T::Boolean
|
235
|
+
).void
|
236
|
+
end
|
237
|
+
def validates_format_of(
|
238
|
+
*attr_names,
|
239
|
+
message: 'is invalid',
|
240
|
+
with: nil,
|
241
|
+
without: nil,
|
242
|
+
multiline: nil,
|
243
|
+
if: nil,
|
244
|
+
unless: :_,
|
245
|
+
on: :_,
|
246
|
+
allow_nil: false,
|
247
|
+
allow_blank: false,
|
248
|
+
strict: false
|
249
|
+
); end
|
250
|
+
|
251
|
+
sig do
|
252
|
+
params(
|
253
|
+
attr_names: T.any(String, Symbol),
|
254
|
+
message: String,
|
255
|
+
in: InWithinType,
|
256
|
+
within: InWithinType,
|
257
|
+
if: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
258
|
+
unless: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
259
|
+
on: T.any(Symbol, String),
|
260
|
+
allow_nil: T::Boolean,
|
261
|
+
allow_blank: T::Boolean,
|
262
|
+
strict: T::Boolean
|
263
|
+
).void
|
264
|
+
end
|
265
|
+
def validates_inclusion_of(
|
266
|
+
*attr_names,
|
267
|
+
message: 'is not included in the list',
|
268
|
+
in: nil,
|
269
|
+
within: nil,
|
270
|
+
if: nil,
|
271
|
+
unless: :_,
|
272
|
+
on: :_,
|
273
|
+
allow_nil: false,
|
274
|
+
allow_blank: false,
|
275
|
+
strict: false
|
276
|
+
); end
|
277
|
+
|
278
|
+
sig do
|
279
|
+
params(
|
280
|
+
attr_names: T.any(String, Symbol),
|
281
|
+
message: T.nilable(String),
|
282
|
+
minimum: T.nilable(Integer),
|
283
|
+
maximum: T.nilable(Integer),
|
284
|
+
is: T.nilable(Integer),
|
285
|
+
within: T.nilable(T::Range[Integer]),
|
286
|
+
in: T.nilable(T::Range[Integer]),
|
287
|
+
too_long: String,
|
288
|
+
too_short: String,
|
289
|
+
wrong_length: String,
|
290
|
+
if: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
291
|
+
unless: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
292
|
+
on: T.any(Symbol, String),
|
293
|
+
allow_nil: T::Boolean,
|
294
|
+
allow_blank: T::Boolean,
|
295
|
+
strict: T::Boolean
|
296
|
+
).void
|
297
|
+
end
|
298
|
+
def validates_length_of(
|
299
|
+
*attr_names,
|
300
|
+
message: nil,
|
301
|
+
minimum: nil,
|
302
|
+
maximum: nil,
|
303
|
+
is: nil,
|
304
|
+
within: nil,
|
305
|
+
in: nil,
|
306
|
+
too_long: 'is too long (maximum is %{count} characters)',
|
307
|
+
too_short: 'is too short (minimum is %{count} characters)',
|
308
|
+
wrong_length: 'is the wrong length (should be %{count} characters)',
|
309
|
+
if: nil,
|
310
|
+
unless: :_,
|
311
|
+
on: :_,
|
312
|
+
allow_nil: false,
|
313
|
+
allow_blank: false,
|
314
|
+
strict: false
|
315
|
+
); end
|
316
|
+
|
317
|
+
# validates_size_of is an alias of validates_length_of
|
318
|
+
sig do
|
319
|
+
params(
|
320
|
+
attr_names: T.any(String, Symbol),
|
321
|
+
message: T.nilable(String),
|
322
|
+
minimum: T.nilable(Integer),
|
323
|
+
maximum: T.nilable(Integer),
|
324
|
+
is: T.nilable(Integer),
|
325
|
+
within: T.nilable(T::Range[Integer]),
|
326
|
+
in: T.nilable(T::Range[Integer]),
|
327
|
+
too_long: String,
|
328
|
+
too_short: String,
|
329
|
+
wrong_length: String,
|
330
|
+
if: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
331
|
+
unless: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
332
|
+
on: T.any(Symbol, String),
|
333
|
+
allow_nil: T::Boolean,
|
334
|
+
allow_blank: T::Boolean,
|
335
|
+
strict: T::Boolean
|
336
|
+
).void
|
337
|
+
end
|
338
|
+
def validates_size_of(
|
339
|
+
*attr_names,
|
340
|
+
message: nil,
|
341
|
+
minimum: nil,
|
342
|
+
maximum: nil,
|
343
|
+
is: nil,
|
344
|
+
within: nil,
|
345
|
+
in: nil,
|
346
|
+
too_long: 'is too long (maximum is %{count} characters)',
|
347
|
+
too_short: 'is too short (minimum is %{count} characters)',
|
348
|
+
wrong_length: 'is the wrong length (should be %{count} characters)',
|
349
|
+
if: nil,
|
350
|
+
unless: :_,
|
351
|
+
on: :_,
|
352
|
+
allow_nil: false,
|
353
|
+
allow_blank: false,
|
354
|
+
strict: false
|
355
|
+
); end
|
356
|
+
|
357
|
+
# Create a type alias so we don't have to repeat this long type signature 6 times.
|
358
|
+
NumberComparatorType = T.type_alias(T.nilable(T.any(Integer, Float, T.proc.params(arg0: T.untyped).returns(T::Boolean), Symbol)))
|
359
|
+
sig do
|
360
|
+
params(
|
361
|
+
attr_names: T.any(String, Symbol),
|
362
|
+
message: String,
|
363
|
+
only_integer: T::Boolean,
|
364
|
+
greater_than: NumberComparatorType,
|
365
|
+
greater_than_or_equal_to: NumberComparatorType,
|
366
|
+
equal_to: NumberComparatorType,
|
367
|
+
less_than: NumberComparatorType,
|
368
|
+
less_than_or_equal_to: NumberComparatorType,
|
369
|
+
other_than: NumberComparatorType,
|
370
|
+
odd: T::Boolean,
|
371
|
+
even: T::Boolean,
|
372
|
+
if: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
373
|
+
unless: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
374
|
+
on: T.any(Symbol, String),
|
375
|
+
allow_nil: T::Boolean,
|
376
|
+
allow_blank: T::Boolean,
|
377
|
+
strict: T::Boolean
|
378
|
+
).void
|
379
|
+
end
|
380
|
+
def validates_numericality_of(
|
381
|
+
*attr_names,
|
382
|
+
message: 'is not a number',
|
383
|
+
only_integer: false,
|
384
|
+
greater_than: nil,
|
385
|
+
greater_than_or_equal_to: nil,
|
386
|
+
equal_to: nil,
|
387
|
+
less_than: nil,
|
388
|
+
less_than_or_equal_to: nil,
|
389
|
+
other_than: nil,
|
390
|
+
odd: false,
|
391
|
+
even: false,
|
392
|
+
if: nil,
|
393
|
+
unless: :_,
|
394
|
+
on: :_,
|
395
|
+
allow_nil: false,
|
396
|
+
allow_blank: false,
|
397
|
+
strict: false
|
398
|
+
); end
|
399
|
+
|
400
|
+
sig do
|
401
|
+
params(
|
402
|
+
attr_names: T.any(String, Symbol),
|
403
|
+
message: String,
|
404
|
+
if: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
405
|
+
unless: T.any(Symbol, String, T.proc.params(arg0: T.untyped).returns(T::Boolean)),
|
406
|
+
on: T.any(Symbol, String),
|
407
|
+
allow_nil: T::Boolean,
|
408
|
+
allow_blank: T::Boolean,
|
409
|
+
strict: T::Boolean
|
410
|
+
).void
|
411
|
+
end
|
412
|
+
def validates_presence_of(
|
413
|
+
*attr_names,
|
414
|
+
message: "can't be blank",
|
415
|
+
if: nil,
|
416
|
+
unless: :_,
|
417
|
+
on: :_,
|
418
|
+
allow_nil: false,
|
419
|
+
allow_blank: false,
|
420
|
+
strict: false
|
421
|
+
); end
|
422
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# This file is autogenerated. Do not edit it by hand. Regenerate it with:
|
2
|
+
# srb rbi sorbet-typed
|
3
|
+
#
|
4
|
+
# If you would like to make changes to this file, great! Please upstream any changes you make here:
|
5
|
+
#
|
6
|
+
# https://github.com/sorbet/sorbet-typed/edit/master/lib/activerecord/>=5.2/activerecord.rbi
|
7
|
+
#
|
8
|
+
# typed: strong
|
9
|
+
|
10
|
+
class ActiveRecord::Base
|
11
|
+
extend ActiveRecord::Delegation::DelegateCache
|
12
|
+
extend ActiveRecord::CollectionCacheKey
|
13
|
+
include ActiveRecord::DefineCallbacks
|
14
|
+
include ActiveRecord::TouchLater
|
15
|
+
include ActiveRecord::SecureToken
|
16
|
+
include ActiveRecord::Suppressor
|
17
|
+
end
|
@@ -5,47 +5,1259 @@
|
|
5
5
|
#
|
6
6
|
# https://github.com/sorbet/sorbet-typed/edit/master/lib/activerecord/all/activerecord.rbi
|
7
7
|
#
|
8
|
-
# typed:
|
8
|
+
# typed: false
|
9
|
+
|
10
|
+
VariadicUntypedFunction = T.type_alias(
|
11
|
+
T.any(
|
12
|
+
T.proc.returns(T.untyped),
|
13
|
+
T.proc.params(arg0: T.untyped).returns(T.untyped),
|
14
|
+
T.proc.params(arg0: T.untyped, arg1: T.untyped).returns(T.untyped),
|
15
|
+
T.proc.params(arg0: T.untyped, arg1: T.untyped, arg2: T.untyped).returns(T.untyped),
|
16
|
+
T.proc.params(arg0: T.untyped, arg1: T.untyped, arg2: T.untyped, arg3: T.untyped).returns(T.untyped),
|
17
|
+
T.proc.params(arg0: T.untyped, arg1: T.untyped, arg2: T.untyped, arg3: T.untyped, arg4: T.untyped).returns(T.untyped),
|
18
|
+
T.proc.params(arg0: T.untyped, arg1: T.untyped, arg2: T.untyped, arg3: T.untyped, arg4: T.untyped, arg5: T.untyped).returns(T.untyped),
|
19
|
+
T.proc.params(arg0: T.untyped, arg1: T.untyped, arg2: T.untyped, arg3: T.untyped, arg4: T.untyped, arg5: T.untyped, arg6: T.untyped).returns(T.untyped),
|
20
|
+
T.proc.params(arg0: T.untyped, arg1: T.untyped, arg2: T.untyped, arg3: T.untyped, arg4: T.untyped, arg5: T.untyped, arg6: T.untyped, arg7: T.untyped).returns(T.untyped),
|
21
|
+
T.proc.params(arg0: T.untyped, arg1: T.untyped, arg2: T.untyped, arg3: T.untyped, arg4: T.untyped, arg5: T.untyped, arg6: T.untyped, arg7: T.untyped, arg8: T.untyped).returns(T.untyped),
|
22
|
+
T.proc.params(arg0: T.untyped, arg1: T.untyped, arg2: T.untyped, arg3: T.untyped, arg4: T.untyped, arg5: T.untyped, arg6: T.untyped, arg7: T.untyped, arg8: T.untyped, arg9: T.untyped).returns(T.untyped)
|
23
|
+
# Currently Sorbet is limited to procs with 9 args: https://github.com/sorbet/sorbet/blob/df6085e6ae9846f033064513ea14f069c68b0bf9/core/SymbolRef.h#L387
|
24
|
+
)
|
25
|
+
)
|
26
|
+
|
27
|
+
module ActiveRecord::Associations::ClassMethods
|
28
|
+
sig do
|
29
|
+
params(
|
30
|
+
name: Symbol,
|
31
|
+
scope: T.nilable(T.proc.void),
|
32
|
+
after_add: T.nilable(T.any(Symbol, String, T.proc.void)),
|
33
|
+
after_remove: T.nilable(T.any(Symbol, String, T.proc.void)),
|
34
|
+
anonymous_class: T.nilable(T.any(Symbol, String)),
|
35
|
+
as: T.nilable(T.any(Symbol, String)),
|
36
|
+
autosave: T.nilable(T::Boolean),
|
37
|
+
before_add: T.nilable(T.any(Symbol, String, T.proc.void)),
|
38
|
+
before_remove: T.nilable(T.any(Symbol, String, T.proc.void)),
|
39
|
+
class_name: T.nilable(T.any(Symbol, String)),
|
40
|
+
counter_cache: T.nilable(T.any(Symbol, String)),
|
41
|
+
dependent: T.nilable(T.any(Symbol, String)),
|
42
|
+
extend: T.nilable(T.any(Module, T::Array[Module])),
|
43
|
+
foreign_key: T.nilable(T.any(Symbol, String)),
|
44
|
+
foreign_type: T.nilable(T.any(Symbol, String)),
|
45
|
+
index_errors: T.nilable(T::Boolean),
|
46
|
+
inverse_of: T.nilable(T.any(Symbol, String)),
|
47
|
+
join_table: T.nilable(T.any(Symbol, String)),
|
48
|
+
primary_key: T.nilable(T.any(Symbol, String)),
|
49
|
+
source: T.nilable(T.any(Symbol, String)),
|
50
|
+
source_type: T.nilable(T.any(Symbol, String)),
|
51
|
+
table_name: T.nilable(T.any(Symbol, String)),
|
52
|
+
through: T.nilable(T.any(Symbol, String)),
|
53
|
+
validate: T.nilable(T::Boolean),
|
54
|
+
blk: T.nilable(T.proc.void)
|
55
|
+
).void
|
56
|
+
end
|
57
|
+
def has_many(
|
58
|
+
name,
|
59
|
+
scope = nil,
|
60
|
+
after_add: nil,
|
61
|
+
after_remove: nil,
|
62
|
+
anonymous_class: nil,
|
63
|
+
as: nil,
|
64
|
+
autosave: nil,
|
65
|
+
before_add: nil,
|
66
|
+
before_remove: nil,
|
67
|
+
class_name: nil,
|
68
|
+
counter_cache: nil,
|
69
|
+
dependent: nil,
|
70
|
+
extend: nil,
|
71
|
+
foreign_key: nil,
|
72
|
+
foreign_type: nil,
|
73
|
+
index_errors: nil,
|
74
|
+
inverse_of: nil,
|
75
|
+
join_table: nil,
|
76
|
+
primary_key: nil,
|
77
|
+
source: nil,
|
78
|
+
source_type: nil,
|
79
|
+
table_name: nil,
|
80
|
+
through: nil,
|
81
|
+
validate: nil,
|
82
|
+
&blk
|
83
|
+
); end
|
84
|
+
|
85
|
+
sig do
|
86
|
+
params(
|
87
|
+
name: Symbol,
|
88
|
+
scope: T.nilable(T.proc.void),
|
89
|
+
anonymous_class: T.nilable(T.any(Symbol, String)),
|
90
|
+
as: T.nilable(T.any(Symbol, String)),
|
91
|
+
autosave: T.nilable(T::Boolean),
|
92
|
+
class_name: T.nilable(T.any(Symbol, String)),
|
93
|
+
dependent: T.nilable(T.any(Symbol, String)),
|
94
|
+
foreign_key: T.nilable(T.any(Symbol, String)),
|
95
|
+
foreign_type: T.nilable(T.any(Symbol, String)),
|
96
|
+
inverse_of: T.nilable(T.any(Symbol, String)),
|
97
|
+
primary_key: T.nilable(T.any(Symbol, String)),
|
98
|
+
required: T.nilable(T::Boolean),
|
99
|
+
source: T.nilable(T.any(Symbol, String)),
|
100
|
+
source_type: T.nilable(T.any(Symbol, String)),
|
101
|
+
through: T.nilable(T.any(Symbol, String)),
|
102
|
+
validate: T.nilable(T::Boolean),
|
103
|
+
blk: T.nilable(T.proc.void)
|
104
|
+
).void
|
105
|
+
end
|
106
|
+
def has_one(
|
107
|
+
name,
|
108
|
+
scope = nil,
|
109
|
+
anonymous_class: nil,
|
110
|
+
as: nil,
|
111
|
+
autosave: nil,
|
112
|
+
class_name: nil,
|
113
|
+
dependent: nil,
|
114
|
+
foreign_key: nil,
|
115
|
+
foreign_type: nil,
|
116
|
+
inverse_of: nil,
|
117
|
+
primary_key: nil,
|
118
|
+
required: nil,
|
119
|
+
source: nil,
|
120
|
+
source_type: nil,
|
121
|
+
through: nil,
|
122
|
+
validate: nil,
|
123
|
+
&blk
|
124
|
+
); end
|
9
125
|
|
10
|
-
class ActiveRecord::Base
|
11
126
|
sig do
|
12
127
|
params(
|
13
|
-
|
128
|
+
name: T.nilable(T.any(Symbol, String)),
|
129
|
+
scope: T.nilable(T.proc.void),
|
14
130
|
autosave: T.nilable(T::Boolean),
|
15
|
-
class_name: T.nilable(String),
|
16
|
-
counter_cache: T.nilable(T
|
17
|
-
dependent: T.nilable(Symbol),
|
18
|
-
foreign_key: T.nilable(Symbol),
|
19
|
-
|
20
|
-
inverse_of: T.nilable(Symbol),
|
131
|
+
class_name: T.nilable(T.any(Symbol, String)),
|
132
|
+
counter_cache: T.nilable(T::Boolean),
|
133
|
+
dependent: T.nilable(T.any(Symbol, String)),
|
134
|
+
foreign_key: T.nilable(T.any(Symbol, String)),
|
135
|
+
foreign_type: T.nilable(T.any(Symbol, String)),
|
136
|
+
inverse_of: T.nilable(T.any(Symbol, String)),
|
137
|
+
optional: T.nilable(T::Boolean),
|
21
138
|
polymorphic: T.nilable(T::Boolean),
|
139
|
+
primary_key: T.nilable(T.any(Symbol, String)),
|
140
|
+
required: T.nilable(T::Boolean),
|
22
141
|
touch: T.nilable(T.any(T::Boolean, Symbol)),
|
23
142
|
validate: T.nilable(T::Boolean),
|
24
|
-
|
143
|
+
default: T.nilable(T.proc.returns(T.untyped))
|
25
144
|
).void
|
26
145
|
end
|
27
|
-
def
|
28
|
-
|
146
|
+
def belongs_to(
|
147
|
+
name,
|
148
|
+
scope = nil,
|
29
149
|
autosave: nil,
|
30
150
|
class_name: nil,
|
31
151
|
counter_cache: nil,
|
32
152
|
dependent: nil,
|
33
153
|
foreign_key: nil,
|
34
|
-
|
154
|
+
foreign_type: nil,
|
35
155
|
inverse_of: nil,
|
156
|
+
optional: nil,
|
36
157
|
polymorphic: nil,
|
158
|
+
primary_key: nil,
|
159
|
+
required: nil,
|
37
160
|
touch: nil,
|
38
161
|
validate: nil,
|
39
|
-
|
162
|
+
default: nil
|
163
|
+
); end
|
164
|
+
|
165
|
+
sig do
|
166
|
+
params(
|
167
|
+
name: T.nilable(T.any(Symbol, String)),
|
168
|
+
scope: T.nilable(T.proc.void),
|
169
|
+
after_add: T.nilable(T.any(Symbol, String, T.proc.void)),
|
170
|
+
after_remove: T.nilable(T.any(Symbol, String, T.proc.void)),
|
171
|
+
association_foreign_key: T.nilable(T.any(Symbol, String)),
|
172
|
+
autosave: T.nilable(T::Boolean),
|
173
|
+
before_add: T.nilable(T.any(Symbol, String, T.proc.void)),
|
174
|
+
before_remove: T.nilable(T.any(Symbol, String, T.proc.void)),
|
175
|
+
class_name: T.nilable(T.any(Symbol, String)),
|
176
|
+
extend: T.nilable(T.any(Module, T::Array[Module])),
|
177
|
+
foreign_key: T.nilable(T.any(Symbol, String)),
|
178
|
+
join_table: T.nilable(T.any(Symbol, String)),
|
179
|
+
validate: T.nilable(T::Boolean),
|
180
|
+
blk: T.nilable(T.proc.void)
|
181
|
+
).void
|
182
|
+
end
|
183
|
+
def has_and_belongs_to_many(
|
184
|
+
name,
|
185
|
+
scope = nil,
|
186
|
+
after_add: nil,
|
187
|
+
after_remove: nil,
|
188
|
+
association_foreign_key: nil,
|
189
|
+
autosave: nil,
|
190
|
+
before_add: nil,
|
191
|
+
before_remove: nil,
|
192
|
+
class_name: nil,
|
193
|
+
extend: nil,
|
194
|
+
foreign_key: nil,
|
195
|
+
join_table: nil,
|
196
|
+
validate: nil,
|
197
|
+
&blk
|
198
|
+
); end
|
199
|
+
end
|
200
|
+
|
201
|
+
module ActiveRecord::AttributeMethods
|
202
|
+
include ActiveModel::AttributeMethods
|
203
|
+
end
|
204
|
+
|
205
|
+
module ActiveRecord::AttributeMethods::Serialization::ClassMethods
|
206
|
+
sig { params(attr_name: Symbol, class_name_or_coder: T.untyped).void }
|
207
|
+
def serialize(attr_name, class_name_or_coder = Object); end
|
208
|
+
end
|
209
|
+
|
210
|
+
module ActiveRecord::NestedAttributes::ClassMethods
|
211
|
+
sig do
|
212
|
+
params(
|
213
|
+
attr_names: T.any(T.any(Symbol, String), T::Array[T.any(Symbol, String)]),
|
214
|
+
allow_destroy: T.nilable(T::Boolean),
|
215
|
+
reject_if: T.any(Symbol, T.proc.returns(T::Boolean)),
|
216
|
+
limit: T.any(Integer, Symbol, T.proc.returns(Integer)),
|
217
|
+
update_only: T.nilable(T::Boolean),
|
218
|
+
).void
|
219
|
+
end
|
220
|
+
def accepts_nested_attributes_for(
|
221
|
+
attr_names,
|
222
|
+
allow_destroy: nil,
|
223
|
+
reject_if: nil,
|
224
|
+
limit: nil,
|
225
|
+
update_only: nil
|
226
|
+
); end
|
227
|
+
end
|
228
|
+
|
229
|
+
module ActiveRecord::Scoping::Named::ClassMethods
|
230
|
+
sig do
|
231
|
+
params(
|
232
|
+
name: T.nilable(T.any(Symbol, String)),
|
233
|
+
body: VariadicUntypedFunction,
|
234
|
+
blk: T.nilable(VariadicUntypedFunction)
|
235
|
+
).void
|
236
|
+
end
|
237
|
+
def scope(
|
238
|
+
name,
|
239
|
+
body,
|
240
|
+
&blk
|
241
|
+
); end
|
242
|
+
end
|
243
|
+
|
244
|
+
module ActiveRecord::Scoping::Default::ClassMethods
|
245
|
+
end
|
246
|
+
|
247
|
+
module ActiveRecord::Inheritance
|
248
|
+
mixes_in_class_methods(ActiveRecord::Inheritance::ClassMethods)
|
249
|
+
end
|
250
|
+
|
251
|
+
class ActiveRecord::Base
|
252
|
+
extend ActiveModel::Naming
|
253
|
+
|
254
|
+
extend ActiveSupport::Benchmarkable
|
255
|
+
extend ActiveSupport::DescendantsTracker
|
256
|
+
|
257
|
+
extend ActiveRecord::ConnectionHandling
|
258
|
+
extend ActiveRecord::QueryCache::ClassMethods
|
259
|
+
extend ActiveRecord::Querying
|
260
|
+
extend ActiveRecord::Translation
|
261
|
+
extend ActiveRecord::DynamicMatchers
|
262
|
+
extend ActiveRecord::Explain
|
263
|
+
extend ActiveRecord::Enum
|
264
|
+
|
265
|
+
include ActiveRecord::Core
|
266
|
+
include ActiveRecord::Persistence
|
267
|
+
include ActiveRecord::ReadonlyAttributes
|
268
|
+
include ActiveRecord::ModelSchema
|
269
|
+
include ActiveRecord::Inheritance
|
270
|
+
include ActiveRecord::Scoping
|
271
|
+
include ActiveRecord::Scoping::Default # via ActiveRecord::Scoping#included hook
|
272
|
+
extend ActiveRecord::Scoping::Default::ClassMethods # via ActiveRecord::Scoping::Default Concern inclusion
|
273
|
+
include ActiveRecord::Scoping::Named # via ActiveRecord::Scoping#included hook
|
274
|
+
extend ActiveRecord::Scoping::Named::ClassMethods # via ActiveRecord::Scoping::Named Concern inclusion
|
275
|
+
include ActiveRecord::Sanitization
|
276
|
+
include ActiveRecord::AttributeAssignment
|
277
|
+
include ActiveModel::Conversion
|
278
|
+
include ActiveRecord::Integration
|
279
|
+
include ActiveRecord::Validations
|
280
|
+
include ActiveRecord::CounterCache
|
281
|
+
include ActiveRecord::Attributes
|
282
|
+
include ActiveRecord::AttributeDecorators
|
283
|
+
include ActiveRecord::Locking::Optimistic
|
284
|
+
include ActiveRecord::Locking::Pessimistic
|
285
|
+
include ActiveRecord::AttributeMethods
|
286
|
+
include ActiveRecord::AttributeMethods::Read # via ActiveRecord::AttributeMethods#included hook
|
287
|
+
include ActiveRecord::AttributeMethods::Write # via ActiveRecord::AttributeMethods#included hook
|
288
|
+
include ActiveRecord::AttributeMethods::BeforeTypeCast # via ActiveRecord::AttributeMethods#included hook
|
289
|
+
include ActiveRecord::AttributeMethods::Query # via ActiveRecord::AttributeMethods#included hook
|
290
|
+
include ActiveRecord::AttributeMethods::PrimaryKey # via ActiveRecord::AttributeMethods#included hook
|
291
|
+
include ActiveRecord::AttributeMethods::TimeZoneConversion # via ActiveRecord::AttributeMethods#included hook
|
292
|
+
include ActiveRecord::AttributeMethods::Dirty # via ActiveRecord::AttributeMethods#included hook
|
293
|
+
include ActiveRecord::AttributeMethods::Serialization # via ActiveRecord::AttributeMethods#included hook
|
294
|
+
extend ActiveRecord::AttributeMethods::Serialization::ClassMethods # via ActiveRecord::AttributeMethods::Serialization Concern inclusion
|
295
|
+
include ActiveRecord::Callbacks
|
296
|
+
include ActiveRecord::Timestamp
|
297
|
+
include ActiveRecord::Associations
|
298
|
+
include ActiveModel::SecurePassword
|
299
|
+
include ActiveRecord::AutosaveAssociation
|
300
|
+
include ActiveRecord::NestedAttributes
|
301
|
+
extend ActiveRecord::NestedAttributes::ClassMethods # via ActiveRecord::NestedAttributes Concern inclusion
|
302
|
+
include ActiveRecord::Aggregations
|
303
|
+
include ActiveRecord::Transactions
|
304
|
+
include ActiveRecord::NoTouching
|
305
|
+
include ActiveRecord::Reflection
|
306
|
+
include ActiveRecord::Serialization
|
307
|
+
include ActiveRecord::Store
|
308
|
+
|
309
|
+
sig do
|
310
|
+
params(
|
311
|
+
arg: Symbol,
|
312
|
+
if: T.nilable(T.any(Symbol, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean)))),
|
313
|
+
on: T.nilable(Symbol),
|
314
|
+
unless: T.nilable(T.any(Symbol, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean))))
|
315
|
+
).void
|
316
|
+
end
|
317
|
+
def self.after_commit(
|
318
|
+
arg,
|
319
|
+
if: nil,
|
320
|
+
on: nil,
|
321
|
+
unless: nil
|
322
|
+
); end
|
323
|
+
|
324
|
+
sig do
|
325
|
+
params(
|
326
|
+
arg: T.nilable(Symbol),
|
327
|
+
if: T.nilable(T.any(Symbol, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean)))),
|
328
|
+
unless: T.nilable(T.any(Symbol, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean))))
|
329
|
+
).void
|
330
|
+
end
|
331
|
+
def self.after_create(
|
332
|
+
arg = nil,
|
333
|
+
if: nil,
|
334
|
+
unless: nil
|
335
|
+
); end
|
336
|
+
|
337
|
+
sig do
|
338
|
+
params(
|
339
|
+
arg: T.nilable(Symbol),
|
340
|
+
if: T.nilable(T.any(Symbol, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean)))),
|
341
|
+
unless: T.nilable(T.any(Symbol, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean))))
|
342
|
+
).void
|
343
|
+
end
|
344
|
+
def self.after_destroy(
|
345
|
+
arg = nil,
|
346
|
+
if: nil,
|
347
|
+
unless: nil
|
348
|
+
); end
|
349
|
+
|
350
|
+
sig do
|
351
|
+
params(
|
352
|
+
arg: T.nilable(Symbol),
|
353
|
+
if: T.nilable(T.any(Symbol, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean)))),
|
354
|
+
unless: T.nilable(T.any(Symbol, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean))))
|
355
|
+
).void
|
356
|
+
end
|
357
|
+
def self.after_rollback(
|
358
|
+
arg = nil,
|
359
|
+
if: nil,
|
360
|
+
unless: nil
|
361
|
+
); end
|
362
|
+
|
363
|
+
sig do
|
364
|
+
params(
|
365
|
+
arg: T.nilable(Symbol),
|
366
|
+
if: T.nilable(T.any(Symbol, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean)))),
|
367
|
+
unless: T.nilable(T.any(Symbol, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean))))
|
368
|
+
).void
|
369
|
+
end
|
370
|
+
def self.after_save(
|
371
|
+
arg = nil,
|
372
|
+
if: nil,
|
373
|
+
unless: nil
|
374
|
+
); end
|
375
|
+
|
376
|
+
sig do
|
377
|
+
params(
|
378
|
+
arg: T.nilable(Symbol),
|
379
|
+
if: T.nilable(T.any(Symbol, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean)))),
|
380
|
+
unless: T.nilable(T.any(Symbol, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean))))
|
381
|
+
).void
|
382
|
+
end
|
383
|
+
def self.after_update(
|
384
|
+
arg = nil,
|
385
|
+
if: nil,
|
386
|
+
unless: nil
|
387
|
+
); end
|
388
|
+
|
389
|
+
sig do
|
390
|
+
params(
|
391
|
+
arg: T.nilable(Symbol),
|
392
|
+
if: T.nilable(T.any(Symbol, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean)))),
|
393
|
+
unless: T.nilable(T.any(Symbol, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean))))
|
394
|
+
).void
|
395
|
+
end
|
396
|
+
def self.after_validation(
|
397
|
+
arg = nil,
|
398
|
+
if: nil,
|
399
|
+
unless: nil
|
400
|
+
); end
|
401
|
+
|
402
|
+
sig do
|
403
|
+
params(
|
404
|
+
arg: T.nilable(Symbol),
|
405
|
+
if: T.nilable(T.any(Symbol, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean)))),
|
406
|
+
unless: T.nilable(T.any(Symbol, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean))))
|
407
|
+
).void
|
408
|
+
end
|
409
|
+
def self.around_create(
|
410
|
+
arg = nil,
|
411
|
+
if: nil,
|
412
|
+
unless: nil
|
413
|
+
); end
|
414
|
+
|
415
|
+
sig do
|
416
|
+
params(
|
417
|
+
arg: T.nilable(Symbol),
|
418
|
+
if: T.nilable(T.any(Symbol, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean)))),
|
419
|
+
unless: T.nilable(T.any(Symbol, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean))))
|
420
|
+
).void
|
421
|
+
end
|
422
|
+
def self.around_destroy(
|
423
|
+
arg = nil,
|
424
|
+
if: nil,
|
425
|
+
unless: nil
|
40
426
|
); end
|
427
|
+
|
428
|
+
sig do
|
429
|
+
params(
|
430
|
+
arg: T.nilable(Symbol),
|
431
|
+
if: T.nilable(T.any(Symbol, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean)))),
|
432
|
+
unless: T.nilable(T.any(Symbol, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean))))
|
433
|
+
).void
|
434
|
+
end
|
435
|
+
def self.around_save(
|
436
|
+
arg = nil,
|
437
|
+
if: nil,
|
438
|
+
unless: nil
|
439
|
+
); end
|
440
|
+
|
441
|
+
sig do
|
442
|
+
params(
|
443
|
+
arg: T.nilable(Symbol),
|
444
|
+
if: T.nilable(T.any(Symbol, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean)))),
|
445
|
+
unless: T.nilable(T.any(Symbol, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean))))
|
446
|
+
).void
|
447
|
+
end
|
448
|
+
def self.around_update(
|
449
|
+
arg = nil,
|
450
|
+
if: nil,
|
451
|
+
unless: nil
|
452
|
+
); end
|
453
|
+
|
454
|
+
sig do
|
455
|
+
params(
|
456
|
+
arg: T.nilable(Symbol),
|
457
|
+
if: T.nilable(T.any(Symbol, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean)))),
|
458
|
+
unless: T.nilable(T.any(Symbol, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean))))
|
459
|
+
).void
|
460
|
+
end
|
461
|
+
def self.before_create(
|
462
|
+
arg = nil,
|
463
|
+
if: nil,
|
464
|
+
unless: nil
|
465
|
+
); end
|
466
|
+
|
467
|
+
sig do
|
468
|
+
params(
|
469
|
+
arg: T.nilable(Symbol),
|
470
|
+
if: T.nilable(T.any(Symbol, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean)))),
|
471
|
+
unless: T.nilable(T.any(Symbol, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean))))
|
472
|
+
).void
|
473
|
+
end
|
474
|
+
def self.before_destroy(
|
475
|
+
arg = nil,
|
476
|
+
if: nil,
|
477
|
+
unless: nil
|
478
|
+
); end
|
479
|
+
|
480
|
+
sig do
|
481
|
+
params(
|
482
|
+
arg: T.nilable(Symbol),
|
483
|
+
if: T.nilable(T.any(Symbol, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean)))),
|
484
|
+
unless: T.nilable(T.any(Symbol, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean))))
|
485
|
+
).void
|
486
|
+
end
|
487
|
+
def self.before_save(
|
488
|
+
arg = nil,
|
489
|
+
if: nil,
|
490
|
+
unless: nil
|
491
|
+
); end
|
492
|
+
|
493
|
+
sig do
|
494
|
+
params(
|
495
|
+
arg: T.nilable(Symbol),
|
496
|
+
if: T.nilable(T.any(Symbol, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean)))),
|
497
|
+
unless: T.nilable(T.any(Symbol, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean))))
|
498
|
+
).void
|
499
|
+
end
|
500
|
+
def self.before_update(
|
501
|
+
arg = nil,
|
502
|
+
if: nil,
|
503
|
+
unless: nil
|
504
|
+
); end
|
505
|
+
|
506
|
+
sig do
|
507
|
+
params(
|
508
|
+
arg: T.nilable(Symbol),
|
509
|
+
if: T.nilable(T.any(Symbol, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean)))),
|
510
|
+
unless: T.nilable(T.any(Symbol, T.proc.params(arg0: T.untyped).returns(T.nilable(T::Boolean)))),
|
511
|
+
on: T.nilable(Symbol)
|
512
|
+
).void
|
513
|
+
end
|
514
|
+
def self.before_validation(
|
515
|
+
arg = nil,
|
516
|
+
if: nil,
|
517
|
+
unless: nil,
|
518
|
+
on: nil
|
519
|
+
); end
|
520
|
+
end
|
521
|
+
|
522
|
+
module ActiveRecord::Inheritance::ClassMethods
|
523
|
+
sig { params(value: T::Boolean).void }
|
524
|
+
def abstract_class=(value); end
|
525
|
+
|
526
|
+
sig { returns(T::Boolean) }
|
527
|
+
def abstract_class; end
|
528
|
+
end
|
529
|
+
|
530
|
+
module ActiveRecord::Persistence
|
531
|
+
mixes_in_class_methods(ActiveRecord::Persistence::ClassMethods)
|
532
|
+
|
533
|
+
sig { params(klass: Class).returns(T.untyped) }
|
534
|
+
def becomes!(klass); end
|
535
|
+
|
536
|
+
sig { params(klass: Class).returns(T.untyped) }
|
537
|
+
def becomes(klass); end
|
538
|
+
|
539
|
+
sig do
|
540
|
+
params(
|
541
|
+
attribute: T.any(Symbol, String),
|
542
|
+
by: T.nilable(Integer),
|
543
|
+
touch: T.nilable(T::Boolean)
|
544
|
+
).returns(T.self_type)
|
545
|
+
end
|
546
|
+
def decrement!(attribute, by = 1, touch: nil); end
|
547
|
+
|
548
|
+
sig do
|
549
|
+
params(
|
550
|
+
attribute: T.any(Symbol, String),
|
551
|
+
by: T.nilable(Integer)
|
552
|
+
).returns(T.self_type)
|
553
|
+
end
|
554
|
+
def decrement(attribute, by = 1); end
|
555
|
+
|
556
|
+
sig { returns(T::Boolean) }
|
557
|
+
def destroyed?(); end
|
558
|
+
|
559
|
+
sig do
|
560
|
+
params(
|
561
|
+
attribute: T.any(Symbol, String),
|
562
|
+
by: T.nilable(Integer),
|
563
|
+
touch: T.nilable(T::Boolean)
|
564
|
+
).returns(T.self_type)
|
565
|
+
end
|
566
|
+
def increment!(attribute, by = 1, touch: nil); end
|
567
|
+
|
568
|
+
sig do
|
569
|
+
params(
|
570
|
+
attribute: T.any(Symbol, String),
|
571
|
+
by: T.nilable(Integer)
|
572
|
+
).returns(T.self_type)
|
573
|
+
end
|
574
|
+
def increment(attribute, by = 1); end
|
575
|
+
|
576
|
+
sig { returns(T::Boolean) }
|
577
|
+
def new_record?(); end
|
578
|
+
|
579
|
+
sig { returns(T::Boolean) }
|
580
|
+
def persisted?(); end
|
581
|
+
|
582
|
+
sig do
|
583
|
+
params(
|
584
|
+
options: T.nilable({ lock: T.nilable(T::Boolean) })
|
585
|
+
).returns(T.self_type)
|
586
|
+
end
|
587
|
+
def reload(options = nil); end
|
588
|
+
|
589
|
+
sig do
|
590
|
+
params(
|
591
|
+
args: T.untyped,
|
592
|
+
blk: T.proc.void,
|
593
|
+
).returns(TrueClass)
|
594
|
+
end
|
595
|
+
def save!(*args, &blk); end
|
596
|
+
|
597
|
+
sig do
|
598
|
+
params(
|
599
|
+
args: T.untyped,
|
600
|
+
blk: T.proc.void,
|
601
|
+
).returns(T::Boolean)
|
602
|
+
end
|
603
|
+
def save(*args, &blk); end
|
604
|
+
|
605
|
+
sig { params(attribute: T.any(Symbol, String)).returns(TrueClass) }
|
606
|
+
def toggle!(attribute); end
|
607
|
+
|
608
|
+
sig { params(attribute: T.any(Symbol, String)).returns(T.self_type) }
|
609
|
+
def toggle(attribute); end
|
610
|
+
|
611
|
+
sig do
|
612
|
+
params(
|
613
|
+
names: T.any(
|
614
|
+
Symbol,
|
615
|
+
String,
|
616
|
+
T::Array[T.any(Symbol, String)]
|
617
|
+
),
|
618
|
+
time: T.nilable(Time)
|
619
|
+
).returns(T::Boolean)
|
620
|
+
end
|
621
|
+
def touch(*names, time: nil); end
|
622
|
+
|
623
|
+
sig do
|
624
|
+
params(
|
625
|
+
name: T.any(Symbol, String),
|
626
|
+
value: T.untyped,
|
627
|
+
).returns(T::Boolean)
|
628
|
+
end
|
629
|
+
def update_attribute(name, value); end
|
630
|
+
|
631
|
+
sig do
|
632
|
+
params(
|
633
|
+
name: T.any(Symbol, String),
|
634
|
+
value: T.untyped,
|
635
|
+
).returns(T::Boolean)
|
636
|
+
end
|
637
|
+
def update_column(name, value); end
|
638
|
+
|
639
|
+
sig do
|
640
|
+
params(
|
641
|
+
attributes: T::Hash[T.any(Symbol, String), T.untyped]
|
642
|
+
).returns(T::Boolean)
|
643
|
+
end
|
644
|
+
def update_columns(attributes); end
|
645
|
+
|
646
|
+
sig do
|
647
|
+
params(
|
648
|
+
attributes: T::Hash[T.any(Symbol, String), T.untyped]
|
649
|
+
).returns(TrueClass)
|
650
|
+
end
|
651
|
+
def update!(attributes); end
|
652
|
+
|
653
|
+
# update_attributes! is an alias of update!
|
654
|
+
sig do
|
655
|
+
params(
|
656
|
+
attributes: T::Hash[T.any(Symbol, String), T.untyped]
|
657
|
+
).returns(TrueClass)
|
658
|
+
end
|
659
|
+
def update_attributes!(attributes); end
|
660
|
+
|
661
|
+
sig do
|
662
|
+
params(
|
663
|
+
attributes: T::Hash[T.any(Symbol, String), T.untyped]
|
664
|
+
).returns(T::Boolean)
|
665
|
+
end
|
666
|
+
def update(attributes); end
|
667
|
+
|
668
|
+
# update_attributes is an alias of update
|
669
|
+
sig do
|
670
|
+
params(
|
671
|
+
attributes: T::Hash[T.any(Symbol, String), T.untyped]
|
672
|
+
).returns(T::Boolean)
|
673
|
+
end
|
674
|
+
def update_attributes(attributes); end
|
41
675
|
end
|
42
676
|
|
43
|
-
|
677
|
+
module ActiveRecord::Persistence::ClassMethods
|
678
|
+
sig do
|
679
|
+
params(
|
680
|
+
attributes: T.nilable(T.any(
|
681
|
+
T::Hash[T.any(Symbol, String), T.untyped],
|
682
|
+
T::Array[T::Hash[T.any(Symbol, String), T.untyped]]
|
683
|
+
)),
|
684
|
+
blk: T.nilable(T.proc.params(arg0: T.untyped).returns(T.untyped))
|
685
|
+
).returns(T.untyped)
|
686
|
+
end
|
687
|
+
def create!(attributes = nil, &blk); end
|
688
|
+
|
689
|
+
sig do
|
690
|
+
params(
|
691
|
+
attributes: T.nilable(T.any(
|
692
|
+
T::Hash[T.any(Symbol, String), T.untyped],
|
693
|
+
T::Array[T::Hash[T.any(Symbol, String), T.untyped]]
|
694
|
+
)),
|
695
|
+
blk: T.nilable(T.proc.params(arg0: T.untyped).returns(T.untyped))
|
696
|
+
).returns(T.untyped)
|
697
|
+
end
|
698
|
+
def create(attributes = nil, &blk); end
|
699
|
+
|
700
|
+
sig do
|
701
|
+
params(
|
702
|
+
id_or_array: T.any(T.untyped, T::Array[T.untyped])
|
703
|
+
).returns(T.untyped)
|
704
|
+
end
|
705
|
+
def delete(id_or_array); end
|
706
|
+
|
707
|
+
sig do
|
708
|
+
params(
|
709
|
+
id_or_array: T.any(T.untyped, T::Array[T.untyped])
|
710
|
+
).returns(T.untyped)
|
711
|
+
end
|
712
|
+
def destroy!(id_or_array); end
|
713
|
+
|
714
|
+
sig do
|
715
|
+
params(
|
716
|
+
id_or_array: T.any(T.untyped, T::Array[T.untyped])
|
717
|
+
).returns(T.untyped)
|
718
|
+
end
|
719
|
+
def destroy(id_or_array); end
|
720
|
+
|
721
|
+
sig do
|
722
|
+
params(
|
723
|
+
attributes: T::Array[T::Hash[T.any(Symbol, String), T.untyped]],
|
724
|
+
returning: T.nilable(T.any(FalseClass, T::Array[T.any(Symbol, String)]))
|
725
|
+
).returns(ActiveRecord::Result)
|
726
|
+
end
|
727
|
+
def insert_all!(attributes, returning: nil); end
|
728
|
+
|
729
|
+
sig do
|
730
|
+
params(
|
731
|
+
attributes: T::Array[T::Hash[T.any(Symbol, String), T.untyped]],
|
732
|
+
returning: T.nilable(T.any(FalseClass, T::Array[T.any(Symbol, String)])),
|
733
|
+
unique_by: T.nilable(T.untyped)
|
734
|
+
).returns(ActiveRecord::Result)
|
735
|
+
end
|
736
|
+
def insert_all(attributes, returning: nil, unique_by: nil); end
|
737
|
+
|
738
|
+
sig do
|
739
|
+
params(
|
740
|
+
attributes: T::Hash[T.any(Symbol, String), T.untyped],
|
741
|
+
returning: T.nilable(T.any(FalseClass, T::Array[T.any(Symbol, String)])),
|
742
|
+
unique_by: T.nilable(T.untyped)
|
743
|
+
).returns(ActiveRecord::Result)
|
744
|
+
end
|
745
|
+
def insert!(attributes, returning: nil, unique_by: nil); end
|
746
|
+
|
747
|
+
sig do
|
748
|
+
params(
|
749
|
+
attributes: T::Hash[T.any(Symbol, String), T.untyped],
|
750
|
+
returning: T.nilable(T.any(FalseClass, T::Array[T.any(Symbol, String)])),
|
751
|
+
unique_by: T.nilable(T.untyped)
|
752
|
+
).returns(ActiveRecord::Result)
|
753
|
+
end
|
754
|
+
def insert(attributes, returning: nil, unique_by: nil); end
|
755
|
+
|
756
|
+
sig { params(attributes: T.untyped, column_types: T::Hash[T.untyped, T.untyped], blk: T.proc.void).returns(T.untyped) }
|
757
|
+
def instantiate(attributes, column_types = {}, &blk); end
|
758
|
+
|
759
|
+
# The 'attributes' parameter can take either a hash or an array of hashes.
|
760
|
+
sig do
|
761
|
+
params(
|
762
|
+
id: T.any(T.untyped, T::Array[T.untyped], Symbol),
|
763
|
+
attributes: T.any(
|
764
|
+
T::Hash[T.any(Symbol, String), T.untyped],
|
765
|
+
T::Array[T::Hash[T.any(Symbol, String), T.untyped]]
|
766
|
+
)
|
767
|
+
).returns(T.any(T::Array[T.untyped], T.untyped))
|
768
|
+
end
|
769
|
+
def update(id = :all, attributes); end
|
770
|
+
|
771
|
+
sig do
|
772
|
+
params(
|
773
|
+
attributes: T::Array[T::Hash[T.any(Symbol, String), T.untyped]],
|
774
|
+
returning: T.nilable(T.any(FalseClass, T::Array[T.any(Symbol, String)])),
|
775
|
+
unique_by: T.nilable(T.untyped)
|
776
|
+
).returns(ActiveRecord::Result)
|
777
|
+
end
|
778
|
+
def upsert_all(attributes, returning: nil, unique_by: nil); end
|
779
|
+
|
780
|
+
sig do
|
781
|
+
params(
|
782
|
+
attributes: T::Hash[T.any(Symbol, String), T.untyped],
|
783
|
+
returning: T.nilable(T.any(FalseClass, T::Array[T.any(Symbol, String)])),
|
784
|
+
unique_by: T.nilable(T.untyped)
|
785
|
+
).returns(ActiveRecord::Result)
|
786
|
+
end
|
787
|
+
def upsert(attributes, returning: nil, unique_by: nil); end
|
788
|
+
end
|
789
|
+
|
790
|
+
class ActiveRecord::Result; end
|
791
|
+
|
792
|
+
class ActiveRecord::Type::Value
|
793
|
+
extend T::Sig
|
794
|
+
|
795
|
+
sig { params(args: T.untyped).void }
|
796
|
+
def initialize(args); end
|
797
|
+
|
798
|
+
sig { params(value: T.untyped).returns(T.untyped) }
|
799
|
+
def cast(value); end
|
800
|
+
end
|
801
|
+
|
802
|
+
class ActiveRecord::Type::Boolean < ActiveRecord::Type::Value
|
803
|
+
extend T::Sig
|
804
|
+
|
805
|
+
sig { params(args: T.untyped).void }
|
806
|
+
def initialize(args = nil); end
|
807
|
+
|
808
|
+
sig { params(value: T.untyped).returns(T.nilable(T::Boolean)) }
|
809
|
+
def cast(value); end
|
810
|
+
end
|
811
|
+
|
812
|
+
module ActiveRecord
|
813
|
+
class ActiveRecordError < StandardError; end
|
814
|
+
class AdapterNotFound < ActiveRecordError; end
|
815
|
+
class AdapterNotSpecified < ActiveRecordError; end
|
816
|
+
class AmbiguousSourceReflectionForThroughAssociation < ActiveRecordError; end
|
817
|
+
class AssociationNotFoundError < ConfigurationError; end
|
818
|
+
class AssociationTypeMismatch < ActiveRecordError; end
|
819
|
+
class AttributeAssignmentError < ActiveRecordError; end
|
820
|
+
class ConcurrentMigrationError < MigrationError; end
|
821
|
+
class ConfigurationError < ActiveRecordError; end
|
822
|
+
class ConnectionNotEstablished < ActiveRecordError; end
|
823
|
+
class ConnectionTimeoutError < ConnectionNotEstablished; end
|
824
|
+
class DangerousAttributeError < ActiveRecordError; end
|
825
|
+
class Deadlocked < TransactionRollbackError; end
|
826
|
+
class DeleteRestrictionError < ActiveRecordError; end
|
827
|
+
class DuplicateMigrationNameError < MigrationError; end
|
828
|
+
class DuplicateMigrationVersionError < MigrationError; end
|
829
|
+
class EagerLoadPolymorphicError < ActiveRecordError; end
|
830
|
+
class EnvironmentMismatchError < ActiveRecordError; end
|
831
|
+
class ExclusiveConnectionTimeoutError < ConnectionTimeoutError; end
|
832
|
+
class FixtureClassNotFound < ActiveRecordError; end
|
833
|
+
class HasManyThroughAssociationNotFoundError < ActiveRecordError; end
|
834
|
+
class HasManyThroughAssociationPointlessSourceTypeError < ActiveRecordError; end
|
835
|
+
class HasManyThroughAssociationPolymorphicSourceError < ActiveRecordError; end
|
836
|
+
class HasManyThroughAssociationPolymorphicThroughError < ActiveRecordError; end
|
837
|
+
class HasManyThroughCantAssociateThroughHasOneOrManyReflection < ThroughCantAssociateThroughHasOneOrManyReflection; end
|
838
|
+
class HasManyThroughNestedAssociationsAreReadonly < ThroughNestedAssociationsAreReadonly; end
|
839
|
+
class HasManyThroughOrderError < ActiveRecordError; end
|
840
|
+
class HasManyThroughSourceAssociationNotFoundError < ActiveRecordError; end
|
841
|
+
class HasOneAssociationPolymorphicThroughError < ActiveRecordError; end
|
842
|
+
class HasOneThroughCantAssociateThroughCollection < ActiveRecordError; end
|
843
|
+
class HasOneThroughCantAssociateThroughHasOneOrManyReflection < ThroughCantAssociateThroughHasOneOrManyReflection; end
|
844
|
+
class HasOneThroughNestedAssociationsAreReadonly < ThroughNestedAssociationsAreReadonly; end
|
845
|
+
class IllegalMigrationNameError < MigrationError; end
|
846
|
+
class ImmutableRelation < ActiveRecordError; end
|
847
|
+
class InvalidForeignKey < WrappedDatabaseException; end
|
848
|
+
class InverseOfAssociationNotFoundError < ActiveRecordError; end
|
849
|
+
class IrreversibleMigration < MigrationError; end
|
850
|
+
class IrreversibleOrderError < ActiveRecordError; end
|
851
|
+
class LockWaitTimeout < StatementInvalid; end
|
852
|
+
class MigrationError < ActiveRecordError; end
|
853
|
+
class MismatchedForeignKey < StatementInvalid; end
|
854
|
+
class MultiparameterAssignmentErrors < ActiveRecordError; end
|
855
|
+
class NoDatabaseError < StatementInvalid; end
|
856
|
+
class NoEnvironmentInSchemaError < MigrationError; end
|
857
|
+
class NotNullViolation < StatementInvalid; end
|
858
|
+
class PendingMigrationError < MigrationError; end
|
859
|
+
class PreparedStatementCacheExpired < StatementInvalid; end
|
860
|
+
class PreparedStatementInvalid < ActiveRecordError; end
|
861
|
+
class ProtectedEnvironmentError < ActiveRecordError; end
|
862
|
+
class QueryCanceled < StatementInvalid; end
|
863
|
+
class RangeError < StatementInvalid; end
|
864
|
+
class ReadOnlyRecord < ActiveRecordError; end
|
865
|
+
class RecordInvalid < ActiveRecordError; end
|
866
|
+
class RecordNotDestroyed < ActiveRecordError; end
|
867
|
+
class RecordNotFound < ActiveRecordError; end
|
868
|
+
class RecordNotSaved < ActiveRecordError; end
|
869
|
+
class RecordNotUnique < WrappedDatabaseException; end
|
870
|
+
class Rollback < ActiveRecordError; end
|
871
|
+
class SerializationFailure < TransactionRollbackError; end
|
872
|
+
class SerializationTypeMismatch < ActiveRecordError; end
|
873
|
+
class StaleObjectError < ActiveRecordError; end
|
874
|
+
class StatementInvalid < ActiveRecordError; end
|
875
|
+
class StatementTimeout < StatementInvalid; end
|
876
|
+
class SubclassNotFound < ActiveRecordError; end
|
877
|
+
class ThroughCantAssociateThroughHasOneOrManyReflection < ActiveRecordError; end
|
878
|
+
class ThroughNestedAssociationsAreReadonly < ActiveRecordError; end
|
879
|
+
class TransactionIsolationError < ActiveRecordError; end
|
880
|
+
class TransactionRollbackError < StatementInvalid; end
|
881
|
+
class TypeConflictError < StandardError; end
|
882
|
+
class UnknownAttributeError < NoMethodError; end
|
883
|
+
class UnknownAttributeReference < ActiveRecordError; end
|
884
|
+
class UnknownMigrationVersionError < MigrationError; end
|
885
|
+
class UnknownPrimaryKey < ActiveRecordError; end
|
886
|
+
class ValueTooLong < StatementInvalid; end
|
887
|
+
class WrappedDatabaseException < StatementInvalid; end
|
888
|
+
end
|
889
|
+
|
890
|
+
class ActiveRecord::Schema < ActiveRecord::Migration::Current
|
44
891
|
sig {params(info: T::Hash[T.untyped, T.untyped], blk: T.proc.bind(ActiveRecord::Schema).void).void}
|
45
892
|
def self.define(info = nil, &blk); end
|
46
893
|
end
|
47
894
|
|
895
|
+
# Method definitions are documented here:
|
896
|
+
# https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html
|
48
897
|
class ActiveRecord::Migration::Current < ActiveRecord::Migration
|
49
|
-
|
50
|
-
|
898
|
+
# Tables
|
899
|
+
|
900
|
+
# https://github.com/rails/rails/blob/v5.2.3/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb#L151-L290
|
901
|
+
sig do
|
902
|
+
params(
|
903
|
+
table_name: T.any(String, Symbol),
|
904
|
+
comment: T.untyped,
|
905
|
+
id: T.any(T::Boolean, Symbol),
|
906
|
+
primary_key: T.any(String, Symbol, T::Array[T.any(String, Symbol)]),
|
907
|
+
options: T.untyped,
|
908
|
+
temporary: T::Boolean,
|
909
|
+
force: T.any(T::Boolean, Symbol),
|
910
|
+
as: T.untyped,
|
911
|
+
blk: T.nilable(T.proc.params(t: ActiveRecord::ConnectionAdapters::TableDefinition).void)
|
912
|
+
).returns(T.untyped)
|
913
|
+
end
|
914
|
+
def create_table(
|
915
|
+
table_name,
|
916
|
+
comment: nil,
|
917
|
+
id: :primary_key,
|
918
|
+
primary_key: :_,
|
919
|
+
options: nil,
|
920
|
+
temporary: false,
|
921
|
+
force: false,
|
922
|
+
as: nil,
|
923
|
+
&blk
|
924
|
+
); end
|
925
|
+
|
926
|
+
sig do
|
927
|
+
params(
|
928
|
+
table_name: T.any(String, Symbol),
|
929
|
+
bulk: T::Boolean
|
930
|
+
).returns(T.untyped)
|
931
|
+
end
|
932
|
+
def change_table(
|
933
|
+
table_name,
|
934
|
+
bulk: false
|
935
|
+
); end
|
936
|
+
|
937
|
+
sig { params(table_name: T.any(String, Symbol), new_name: T.any(String, Symbol)).returns(T.untyped) }
|
938
|
+
def rename_table(table_name, new_name); end
|
939
|
+
|
940
|
+
sig do
|
941
|
+
params(
|
942
|
+
table_name: T.any(String, Symbol),
|
943
|
+
force: T.any(T::Boolean, Symbol),
|
944
|
+
if_exists: T::Boolean
|
945
|
+
).returns(T.untyped)
|
946
|
+
end
|
947
|
+
def drop_table(
|
948
|
+
table_name,
|
949
|
+
force: false,
|
950
|
+
if_exists: false
|
951
|
+
); end
|
952
|
+
|
953
|
+
# Join Tables
|
954
|
+
|
955
|
+
sig do
|
956
|
+
params(
|
957
|
+
table_1: T.any(String, Symbol),
|
958
|
+
table_2: T.any(String, Symbol),
|
959
|
+
column_options: T.untyped,
|
960
|
+
options: T.untyped,
|
961
|
+
table_name: T.untyped,
|
962
|
+
temporary: T.untyped,
|
963
|
+
force: T::Boolean
|
964
|
+
).returns(T.untyped)
|
965
|
+
end
|
966
|
+
def create_join_table(
|
967
|
+
table_1,
|
968
|
+
table_2,
|
969
|
+
column_options: {},
|
970
|
+
options: nil,
|
971
|
+
table_name: nil,
|
972
|
+
temporary: nil,
|
973
|
+
force: false
|
974
|
+
); end
|
975
|
+
|
976
|
+
sig { params(table_1: T.any(String, Symbol), table_2: T.any(String, Symbol), options: T.untyped).returns(T.untyped) }
|
977
|
+
def drop_join_table(table_1, table_2, options = {}); end
|
978
|
+
|
979
|
+
# Columns
|
980
|
+
|
981
|
+
sig do
|
982
|
+
params(
|
983
|
+
table_name: T.untyped,
|
984
|
+
column_name: T.untyped,
|
985
|
+
type: T.untyped,
|
986
|
+
limit: T.untyped,
|
987
|
+
default: T.untyped,
|
988
|
+
null: T.untyped,
|
989
|
+
precision: T.untyped,
|
990
|
+
scale: T.untyped,
|
991
|
+
comment: T.untyped
|
992
|
+
).returns(T.untyped)
|
993
|
+
end
|
994
|
+
def add_column(
|
995
|
+
table_name,
|
996
|
+
column_name,
|
997
|
+
type,
|
998
|
+
limit: nil,
|
999
|
+
default: nil,
|
1000
|
+
null: nil,
|
1001
|
+
precision: nil,
|
1002
|
+
scale: nil,
|
1003
|
+
comment: nil
|
1004
|
+
); end
|
1005
|
+
|
1006
|
+
sig do
|
1007
|
+
params(
|
1008
|
+
table_name: T.untyped,
|
1009
|
+
column_name: T.untyped,
|
1010
|
+
type: T.untyped,
|
1011
|
+
limit: T.untyped,
|
1012
|
+
default: T.untyped,
|
1013
|
+
null: T.untyped,
|
1014
|
+
precision: T.untyped,
|
1015
|
+
scale: T.untyped,
|
1016
|
+
comment: T.untyped
|
1017
|
+
).returns(T.untyped)
|
1018
|
+
end
|
1019
|
+
def change_column(
|
1020
|
+
table_name,
|
1021
|
+
column_name,
|
1022
|
+
type,
|
1023
|
+
limit: nil,
|
1024
|
+
default: nil,
|
1025
|
+
null: nil,
|
1026
|
+
precision: nil,
|
1027
|
+
scale: nil,
|
1028
|
+
comment: nil
|
1029
|
+
); end
|
1030
|
+
|
1031
|
+
sig do
|
1032
|
+
params(
|
1033
|
+
table_name: T.untyped,
|
1034
|
+
column_name: T.untyped,
|
1035
|
+
null: T.untyped,
|
1036
|
+
default: T.untyped
|
1037
|
+
).returns(T.untyped)
|
1038
|
+
end
|
1039
|
+
def change_column_null(table_name, column_name, null, default = nil); end
|
1040
|
+
|
1041
|
+
sig { params(table_name: T.untyped, column_name: T.untyped, default_or_changes: T.untyped).returns(T.untyped) }
|
1042
|
+
def change_column_default(table_name, column_name, default_or_changes); end
|
1043
|
+
|
1044
|
+
sig { params(table_name: T.untyped, column_name: T.untyped, new_column_name: T.untyped).returns(T.untyped) }
|
1045
|
+
def rename_column(table_name, column_name, new_column_name); end
|
1046
|
+
|
1047
|
+
sig do
|
1048
|
+
params(
|
1049
|
+
table_name: T.untyped,
|
1050
|
+
column_name: T.untyped,
|
1051
|
+
type: T.untyped,
|
1052
|
+
options: T.untyped
|
1053
|
+
).returns(T.untyped)
|
1054
|
+
end
|
1055
|
+
def remove_column(
|
1056
|
+
table_name,
|
1057
|
+
column_name,
|
1058
|
+
type = nil,
|
1059
|
+
options = {}
|
1060
|
+
); end
|
1061
|
+
|
1062
|
+
sig { params(table_name: T.any(String, Symbol), column_names: T.untyped).returns(T.untyped) }
|
1063
|
+
def remove_columns(table_name, *column_names); end
|
1064
|
+
|
1065
|
+
# Foreign Keys
|
1066
|
+
|
1067
|
+
sig do
|
1068
|
+
params(
|
1069
|
+
from_table: T.untyped,
|
1070
|
+
to_table: T.untyped,
|
1071
|
+
column: T.untyped,
|
1072
|
+
primary_key: T.untyped,
|
1073
|
+
name: T.untyped,
|
1074
|
+
on_delete: T.untyped,
|
1075
|
+
on_update: T.untyped,
|
1076
|
+
validate: T.untyped
|
1077
|
+
).returns(T.untyped)
|
1078
|
+
end
|
1079
|
+
def add_foreign_key(
|
1080
|
+
from_table,
|
1081
|
+
to_table,
|
1082
|
+
column: nil,
|
1083
|
+
primary_key: nil,
|
1084
|
+
name: nil,
|
1085
|
+
on_delete: nil,
|
1086
|
+
on_update: nil,
|
1087
|
+
validate: nil
|
1088
|
+
); end
|
1089
|
+
|
1090
|
+
sig do
|
1091
|
+
params(
|
1092
|
+
from_table: T.untyped,
|
1093
|
+
to_table: T.untyped,
|
1094
|
+
column: T.untyped,
|
1095
|
+
primary_key: T.untyped,
|
1096
|
+
name: T.untyped,
|
1097
|
+
on_delete: T.untyped,
|
1098
|
+
on_update: T.untyped,
|
1099
|
+
validate: T.untyped
|
1100
|
+
).returns(T.untyped)
|
1101
|
+
end
|
1102
|
+
def remove_foreign_key(
|
1103
|
+
from_table,
|
1104
|
+
to_table,
|
1105
|
+
column: nil,
|
1106
|
+
primary_key: nil,
|
1107
|
+
name: nil,
|
1108
|
+
on_delete: nil,
|
1109
|
+
on_update: nil,
|
1110
|
+
validate: nil
|
1111
|
+
); end
|
1112
|
+
|
1113
|
+
# Indices
|
1114
|
+
|
1115
|
+
sig do
|
1116
|
+
params(
|
1117
|
+
table_name: T.untyped,
|
1118
|
+
column_name: T.untyped,
|
1119
|
+
using: T.untyped,
|
1120
|
+
unique: T.nilable(T::Boolean),
|
1121
|
+
where: T.untyped,
|
1122
|
+
order: T.untyped,
|
1123
|
+
name: T.untyped,
|
1124
|
+
length: T.untyped,
|
1125
|
+
opclass: T.untyped,
|
1126
|
+
type: T.untyped,
|
1127
|
+
internal: T.untyped,
|
1128
|
+
algorithm: T.untyped
|
1129
|
+
).returns(T.untyped)
|
1130
|
+
end
|
1131
|
+
def add_index(
|
1132
|
+
table_name,
|
1133
|
+
column_name,
|
1134
|
+
using: nil,
|
1135
|
+
unique: nil,
|
1136
|
+
where: nil,
|
1137
|
+
order: nil,
|
1138
|
+
name: nil,
|
1139
|
+
length: nil,
|
1140
|
+
opclass: nil,
|
1141
|
+
type: nil,
|
1142
|
+
internal: nil,
|
1143
|
+
algorithm: nil
|
1144
|
+
); end
|
1145
|
+
|
1146
|
+
sig do
|
1147
|
+
params(
|
1148
|
+
table_name: Symbol,
|
1149
|
+
column: T.any(Symbol, T::Array[Symbol]),
|
1150
|
+
name: T.nilable(Symbol)
|
1151
|
+
).returns(T.untyped)
|
1152
|
+
end
|
1153
|
+
def remove_index(
|
1154
|
+
table_name,
|
1155
|
+
column,
|
1156
|
+
name: nil
|
1157
|
+
); end
|
1158
|
+
|
1159
|
+
sig do
|
1160
|
+
params(
|
1161
|
+
table_name: T.any(String, Symbol),
|
1162
|
+
old_name: T.any(String, Symbol),
|
1163
|
+
new_name: T.any(String, Symbol)
|
1164
|
+
).returns(T.untyped)
|
1165
|
+
end
|
1166
|
+
def rename_index(
|
1167
|
+
table_name,
|
1168
|
+
old_name,
|
1169
|
+
new_name
|
1170
|
+
); end
|
1171
|
+
|
1172
|
+
# References
|
1173
|
+
|
1174
|
+
sig do
|
1175
|
+
params(
|
1176
|
+
table_name: T.any(String, Symbol),
|
1177
|
+
ref_name: T.untyped,
|
1178
|
+
type: T.untyped,
|
1179
|
+
index: T.untyped,
|
1180
|
+
foreign_key: T.untyped,
|
1181
|
+
polymorphic: T.untyped,
|
1182
|
+
null: T.untyped
|
1183
|
+
).returns(T.untyped)
|
1184
|
+
end
|
1185
|
+
def add_reference(
|
1186
|
+
table_name,
|
1187
|
+
ref_name,
|
1188
|
+
type: nil,
|
1189
|
+
index: nil,
|
1190
|
+
foreign_key: nil,
|
1191
|
+
polymorphic: nil,
|
1192
|
+
null: nil
|
1193
|
+
); end
|
1194
|
+
|
1195
|
+
sig do
|
1196
|
+
params(
|
1197
|
+
table_name: T.any(String, Symbol),
|
1198
|
+
ref_name: T.untyped,
|
1199
|
+
foreign_key: T.untyped,
|
1200
|
+
polymorphic: T.untyped,
|
1201
|
+
index: T.untyped
|
1202
|
+
).returns(T.untyped)
|
1203
|
+
end
|
1204
|
+
def remove_reference(
|
1205
|
+
table_name,
|
1206
|
+
ref_name,
|
1207
|
+
foreign_key: false,
|
1208
|
+
polymorphic: false,
|
1209
|
+
index: nil
|
1210
|
+
); end
|
1211
|
+
|
1212
|
+
# Timestamps
|
1213
|
+
|
1214
|
+
sig { params(table_name: T.any(String, Symbol), options: T.untyped).returns(T.untyped) }
|
1215
|
+
def add_timestamps(table_name, options = {}); end
|
1216
|
+
|
1217
|
+
sig { params(table_name: T.any(String, Symbol), options: T.untyped).returns(T.untyped) }
|
1218
|
+
def remove_timestamps(table_name, options = {}); end
|
1219
|
+
|
1220
|
+
# Extensions
|
1221
|
+
|
1222
|
+
sig { params(name: T.any(String, Symbol)).returns(T.untyped) }
|
1223
|
+
def enable_extension(name); end
|
1224
|
+
|
1225
|
+
sig { params(name: T.any(String, Symbol)).returns(T.untyped) }
|
1226
|
+
def disable_extension(name); end
|
1227
|
+
|
1228
|
+
# Miscellaneous
|
1229
|
+
|
1230
|
+
sig { params(message: String, subitem: T.untyped).void }
|
1231
|
+
def say(message, subitem = false); end
|
1232
|
+
|
1233
|
+
sig { params(message: String).returns(T.untyped) }
|
1234
|
+
def say_with_time(message); end
|
1235
|
+
|
1236
|
+
sig { void }
|
1237
|
+
def suppress_messages; end
|
1238
|
+
|
1239
|
+
sig { returns(T.untyped) }
|
1240
|
+
def reversible(); end
|
1241
|
+
|
1242
|
+
sig { params(migration_classes: T.untyped).returns(T.untyped) }
|
1243
|
+
def revert(*migration_classes); end
|
1244
|
+
|
1245
|
+
sig { params(sql: String, name: T.nilable(String)).returns(T.untyped) }
|
1246
|
+
def execute(sql, name = nil); end
|
1247
|
+
end
|
1248
|
+
|
1249
|
+
module ActiveRecord::AttributeMethods::Dirty
|
1250
|
+
extend T::Sig
|
1251
|
+
sig { params(attr_name: Symbol, options: T.untyped).returns(T::Boolean) }
|
1252
|
+
def saved_change_to_attribute?(attr_name, **options); end
|
1253
|
+
end
|
1254
|
+
|
1255
|
+
module ActiveRecord::Associations
|
1256
|
+
mixes_in_class_methods(ActiveRecord::Associations::ClassMethods)
|
1257
|
+
end
|
1258
|
+
|
1259
|
+
module ActiveRecord::Validations
|
1260
|
+
include ActiveModel::Validations
|
1261
|
+
|
1262
|
+
mixes_in_class_methods(ActiveModel::Validations::ClassMethods)
|
51
1263
|
end
|