diff --git a/.gitignore b/.gitignore index d31e719..0dd6bdd 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,9 @@ !/app/assets/builds/.keep node_modules/ + +# Sorbet autogenerated scratch files +.sorbet-rbi-cache/ + +# Sorbet typecheck output +.sorbet/ diff --git a/Gemfile b/Gemfile index 8f958d4..c3f89e5 100644 --- a/Gemfile +++ b/Gemfile @@ -44,6 +44,9 @@ gem "view_component" # Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images] # gem "image_processing", "~> 1.2" +# OpenSSL for tapioca support - https://github.com/Shopify/tapioca/issues/2156#issuecomment-3605679933 +gem "openssl", "~> 3.3.1" + group :development, :test do # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem gem "debug", platforms: %i[mri windows], require: "debug/prelude" @@ -69,6 +72,11 @@ end group :development do # Use console on exceptions pages [https://github.com/rails/web-console] gem "web-console" + + # Tapioca and Sorbet for type checking [https://sorbet.org/] + gem "sorbet" + gem "sorbet-runtime" + gem "tapioca", "0.17.9", require: false end group :test do diff --git a/Gemfile.lock b/Gemfile.lock index df8426d..e8c66fc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,29 +3,29 @@ GEM specs: action_text-trix (2.1.15) railties - actioncable (8.1.0) - actionpack (= 8.1.0) - activesupport (= 8.1.0) + actioncable (8.1.1) + actionpack (= 8.1.1) + activesupport (= 8.1.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (8.1.0) - actionpack (= 8.1.0) - activejob (= 8.1.0) - activerecord (= 8.1.0) - activestorage (= 8.1.0) - activesupport (= 8.1.0) + actionmailbox (8.1.1) + actionpack (= 8.1.1) + activejob (= 8.1.1) + activerecord (= 8.1.1) + activestorage (= 8.1.1) + activesupport (= 8.1.1) mail (>= 2.8.0) - actionmailer (8.1.0) - actionpack (= 8.1.0) - actionview (= 8.1.0) - activejob (= 8.1.0) - activesupport (= 8.1.0) + actionmailer (8.1.1) + actionpack (= 8.1.1) + actionview (= 8.1.1) + activejob (= 8.1.1) + activesupport (= 8.1.1) mail (>= 2.8.0) rails-dom-testing (~> 2.2) - actionpack (8.1.0) - actionview (= 8.1.0) - activesupport (= 8.1.0) + actionpack (8.1.1) + actionview (= 8.1.1) + activesupport (= 8.1.1) nokogiri (>= 1.8.5) rack (>= 2.2.4) rack-session (>= 1.0.1) @@ -33,36 +33,36 @@ GEM rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) useragent (~> 0.16) - actiontext (8.1.0) + actiontext (8.1.1) action_text-trix (~> 2.1.15) - actionpack (= 8.1.0) - activerecord (= 8.1.0) - activestorage (= 8.1.0) - activesupport (= 8.1.0) + actionpack (= 8.1.1) + activerecord (= 8.1.1) + activestorage (= 8.1.1) + activesupport (= 8.1.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (8.1.0) - activesupport (= 8.1.0) + actionview (8.1.1) + activesupport (= 8.1.1) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (8.1.0) - activesupport (= 8.1.0) + activejob (8.1.1) + activesupport (= 8.1.1) globalid (>= 0.3.6) - activemodel (8.1.0) - activesupport (= 8.1.0) - activerecord (8.1.0) - activemodel (= 8.1.0) - activesupport (= 8.1.0) + activemodel (8.1.1) + activesupport (= 8.1.1) + activerecord (8.1.1) + activemodel (= 8.1.1) + activesupport (= 8.1.1) timeout (>= 0.4.0) - activestorage (8.1.0) - actionpack (= 8.1.0) - activejob (= 8.1.0) - activerecord (= 8.1.0) - activesupport (= 8.1.0) + activestorage (8.1.1) + actionpack (= 8.1.1) + activejob (= 8.1.1) + activerecord (= 8.1.1) + activesupport (= 8.1.1) marcel (~> 1.0) - activesupport (8.1.0) + activesupport (8.1.1) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.3.1) @@ -75,12 +75,13 @@ GEM securerandom (>= 0.3) tzinfo (~> 2.0, >= 2.0.5) uri (>= 0.13.1) - addressable (2.8.7) - public_suffix (>= 2.0.2, < 7.0) + addressable (2.8.8) + public_suffix (>= 2.0.2, < 8.0) ast (2.4.3) base64 (0.3.0) bcrypt (3.1.20) - bcrypt_pbkdf (1.1.1) + bcrypt_pbkdf (1.1.2) + benchmark (0.5.0) better_html (2.2.0) actionview (>= 7.0) activesupport (>= 7.0) @@ -90,7 +91,7 @@ GEM smart_properties bigdecimal (3.3.1) bindex (0.8.1) - bootsnap (1.18.6) + bootsnap (1.19.0) msgpack (~> 1.2) brakeman (7.1.1) racc @@ -105,16 +106,16 @@ GEM regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) concurrent-ruby (1.3.5) - connection_pool (2.5.4) + connection_pool (3.0.2) crass (1.0.6) - date (3.4.1) + date (3.5.0) debug (1.11.0) irb (~> 1.10) reline (>= 0.3.8) - dotenv (3.1.8) + dotenv (3.2.0) drb (2.2.3) ed25519 (1.4.0) - erb (5.1.1) + erb (6.0.0) erb_lint (0.9.0) activesupport better_html (>= 2.0.1) @@ -125,12 +126,12 @@ GEM erubi (1.13.1) et-orbi (1.4.0) tzinfo - factory_bot (6.5.5) + factory_bot (6.5.6) activesupport (>= 6.1.0) factory_bot_rails (6.5.1) factory_bot (~> 6.5) railties (>= 6.1.0) - faker (3.5.2) + faker (3.5.3) i18n (>= 1.8.11, < 2) fugit (1.12.1) et-orbi (~> 1.4) @@ -148,15 +149,15 @@ GEM activesupport (>= 3.0) nokogiri (>= 1.6) io-console (0.8.1) - irb (1.15.2) + irb (1.15.3) pp (>= 0.6.0) rdoc (>= 4.0.0) reline (>= 0.4.2) jbuilder (2.14.1) actionview (>= 7.0.0) activesupport (>= 7.0.0) - json (2.16.0) - kamal (2.8.2) + json (2.17.1) + kamal (2.9.0) activesupport (>= 7.0) base64 (~> 0.2) bcrypt_pbkdf (~> 1.0) @@ -182,7 +183,7 @@ GEM marcel (1.1.0) matrix (0.4.3) mini_mime (1.1.5) - minitest (5.26.1) + minitest (5.26.2) msgpack (1.8.0) net-imap (0.5.12) date @@ -198,21 +199,19 @@ GEM net-smtp (0.5.1) net-protocol net-ssh (7.3.0) - nio4r (2.7.4) + netrc (0.11.0) + nio4r (2.7.5) nokogiri (1.18.10-aarch64-linux-gnu) racc (~> 1.4) nokogiri (1.18.10-aarch64-linux-musl) racc (~> 1.4) - nokogiri (1.18.10-arm-linux-gnu) - racc (~> 1.4) - nokogiri (1.18.10-arm-linux-musl) - racc (~> 1.4) nokogiri (1.18.10-arm64-darwin) racc (~> 1.4) nokogiri (1.18.10-x86_64-linux-gnu) racc (~> 1.4) nokogiri (1.18.10-x86_64-linux-musl) racc (~> 1.4) + openssl (3.3.2) ostruct (0.6.3) parallel (1.27.0) parser (3.3.10.0) @@ -229,33 +228,33 @@ GEM psych (5.2.6) date stringio - public_suffix (6.0.2) + public_suffix (7.0.0) puma (7.1.0) nio4r (~> 2.0) raabro (1.4.0) racc (1.8.1) - rack (3.2.3) + rack (3.2.4) rack-session (2.1.1) base64 (>= 0.1.0) rack (>= 3.0.0) rack-test (2.2.0) rack (>= 1.3) - rackup (2.2.1) + rackup (2.3.1) rack (>= 3) - rails (8.1.0) - actioncable (= 8.1.0) - actionmailbox (= 8.1.0) - actionmailer (= 8.1.0) - actionpack (= 8.1.0) - actiontext (= 8.1.0) - actionview (= 8.1.0) - activejob (= 8.1.0) - activemodel (= 8.1.0) - activerecord (= 8.1.0) - activestorage (= 8.1.0) - activesupport (= 8.1.0) + rails (8.1.1) + actioncable (= 8.1.1) + actionmailbox (= 8.1.1) + actionmailer (= 8.1.1) + actionpack (= 8.1.1) + actiontext (= 8.1.1) + actionview (= 8.1.1) + activejob (= 8.1.1) + activemodel (= 8.1.1) + activerecord (= 8.1.1) + activestorage (= 8.1.1) + activesupport (= 8.1.1) bundler (>= 1.15.0) - railties (= 8.1.0) + railties (= 8.1.1) rails-dom-testing (2.3.0) activesupport (>= 5.0.0) minitest @@ -263,9 +262,9 @@ GEM rails-html-sanitizer (1.6.2) loofah (~> 2.21) nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) - railties (8.1.0) - actionpack (= 8.1.0) - activesupport (= 8.1.0) + railties (8.1.1) + actionpack (= 8.1.1) + activesupport (= 8.1.1) irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) @@ -273,16 +272,23 @@ GEM tsort (>= 0.2) zeitwerk (~> 2.6) rainbow (3.1.1) - rake (13.3.0) - rdoc (6.15.0) + rake (13.3.1) + rbi (0.3.8) + prism (~> 1.0) + rbs (>= 3.4.4) + rbs (4.0.0.dev.4) + logger + prism (>= 1.3.0) + rdoc (6.16.1) erb psych (>= 4.0.0) tsort regexp_parser (2.11.3) - reline (0.6.2) + reline (0.6.3) io-console (~> 0.5) + require-hooks (0.2.2) rexml (3.4.4) - rubocop (1.81.6) + rubocop (1.81.7) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -299,28 +305,28 @@ GEM rubocop-capybara (2.22.1) lint_roller (~> 1.1) rubocop (~> 1.72, >= 1.72.1) - rubocop-factory_bot (2.27.1) + rubocop-factory_bot (2.28.0) lint_roller (~> 1.1) rubocop (~> 1.72, >= 1.72.1) rubocop-performance (1.26.1) lint_roller (~> 1.1) rubocop (>= 1.75.0, < 2.0) rubocop-ast (>= 1.47.1, < 2.0) - rubocop-rails (2.33.4) + rubocop-rails (2.34.2) activesupport (>= 4.2.0) lint_roller (~> 1.1) rack (>= 1.1) rubocop (>= 1.75.0, < 2.0) rubocop-ast (>= 1.44.0, < 2.0) - rubocop-rspec (3.7.0) + rubocop-rspec (3.8.0) lint_roller (~> 1.1) - rubocop (~> 1.72, >= 1.72.1) + rubocop (~> 1.81) rubocop-rspec_rails (2.32.0) lint_roller (~> 1.1) rubocop (~> 1.72, >= 1.72.1) rubocop-rspec (~> 3.5) ruby-progressbar (1.13.0) - rubyzip (3.2.1) + rubyzip (3.2.2) securerandom (0.4.1) selenium-webdriver (4.38.0) base64 (~> 0.2) @@ -335,24 +341,39 @@ GEM activejob (>= 7.2) activerecord (>= 7.2) railties (>= 7.2) - solid_cache (1.0.8) + solid_cache (1.0.10) activejob (>= 7.2) activerecord (>= 7.2) railties (>= 7.2) - solid_queue (1.2.2) + solid_queue (1.2.4) activejob (>= 7.1) activerecord (>= 7.1) concurrent-ruby (>= 1.3.1) fugit (~> 1.11) railties (>= 7.1) thor (>= 1.3.1) - sqlite3 (2.8.0-aarch64-linux-gnu) - sqlite3 (2.8.0-aarch64-linux-musl) - sqlite3 (2.8.0-arm-linux-gnu) - sqlite3 (2.8.0-arm-linux-musl) - sqlite3 (2.8.0-arm64-darwin) - sqlite3 (2.8.0-x86_64-linux-gnu) - sqlite3 (2.8.0-x86_64-linux-musl) + sorbet (0.6.12824) + sorbet-static (= 0.6.12824) + sorbet-runtime (0.6.12824) + sorbet-static (0.6.12824-aarch64-linux) + sorbet-static (0.6.12824-universal-darwin) + sorbet-static (0.6.12824-x86_64-linux) + sorbet-static-and-runtime (0.6.12824) + sorbet (= 0.6.12824) + sorbet-runtime (= 0.6.12824) + spoom (1.7.10) + erubi (>= 1.10.0) + prism (>= 0.28.0) + rbi (>= 0.3.3) + rbs (>= 4.0.0.dev.4) + rexml (>= 3.2.6) + sorbet-static-and-runtime (>= 0.5.10187) + thor (>= 0.19.2) + sqlite3 (2.8.1-aarch64-linux-gnu) + sqlite3 (2.8.1-aarch64-linux-musl) + sqlite3 (2.8.1-arm64-darwin) + sqlite3 (2.8.1-x86_64-linux-gnu) + sqlite3 (2.8.1-x86_64-linux-musl) sshkit (1.24.0) base64 logger @@ -362,26 +383,35 @@ GEM ostruct stimulus-rails (1.3.4) railties (>= 6.0.0) - stringio (3.1.7) + stringio (3.1.9) tailwind_merge (1.3.1) sin_lru_redux (~> 2.5) - tailwindcss-rails (4.3.0) + tailwindcss-rails (4.4.0) railties (>= 7.0.0) tailwindcss-ruby (~> 4.0) - tailwindcss-ruby (4.1.13) - tailwindcss-ruby (4.1.13-aarch64-linux-gnu) - tailwindcss-ruby (4.1.13-aarch64-linux-musl) - tailwindcss-ruby (4.1.13-arm64-darwin) - tailwindcss-ruby (4.1.13-x86_64-linux-gnu) - tailwindcss-ruby (4.1.13-x86_64-linux-musl) + tailwindcss-ruby (4.1.16-aarch64-linux-gnu) + tailwindcss-ruby (4.1.16-aarch64-linux-musl) + tailwindcss-ruby (4.1.16-arm64-darwin) + tailwindcss-ruby (4.1.16-x86_64-linux-gnu) + tailwindcss-ruby (4.1.16-x86_64-linux-musl) + tapioca (0.17.9) + benchmark + bundler (>= 2.2.25) + netrc (>= 0.11.0) + parallel (>= 1.21.0) + rbi (>= 0.3.7) + require-hooks (>= 0.2.2) + sorbet-static-and-runtime (>= 0.5.11087) + spoom (>= 1.7.9) + thor (>= 1.2.0) + yard-sorbet thor (1.4.0) - thruster (0.1.16) thruster (0.1.16-aarch64-linux) thruster (0.1.16-arm64-darwin) thruster (0.1.16-x86_64-linux) - timeout (0.4.3) + timeout (0.4.4) tsort (0.2.0) - turbo-rails (2.0.17) + turbo-rails (2.0.20) actionpack (>= 7.1.0) railties (>= 7.1.0) tzinfo (2.0.6) @@ -407,14 +437,17 @@ GEM websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) + yard (0.9.38) + yard-sorbet (0.9.0) + sorbet-runtime + yard zeitwerk (2.7.3) PLATFORMS aarch64-linux aarch64-linux-gnu aarch64-linux-musl - arm-linux-gnu - arm-linux-musl + arm64-darwin-23 arm64-darwin-24 x86_64-linux x86_64-linux-gnu @@ -434,6 +467,7 @@ DEPENDENCIES inline_svg jbuilder kamal + openssl (~> 3.3.1) propshaft puma (>= 5.0) rails (~> 8.1.0) @@ -448,10 +482,13 @@ DEPENDENCIES solid_cable solid_cache solid_queue + sorbet + sorbet-runtime sqlite3 (>= 2.1) stimulus-rails tailwind_merge (~> 1.3) tailwindcss-rails (~> 4.3) + tapioca (= 0.17.9) thruster turbo-rails tzinfo-data diff --git a/README.md b/README.md index 57bbb27..eddf259 100644 --- a/README.md +++ b/README.md @@ -183,6 +183,44 @@ bundle exec erb_lint --lint-all [--autocorrect] **Note:** the `--autocorrect` option is optional, and will write changes to your files. ---- + +## Sorbet Type Checking + +This project uses **Sorbet** for gradual type checking and **Tapioca** for generating RBI files. + +### Common Commands + +Run the Sorbet type checker: + +``` +bundle exec srb tc +``` + +Regenerate RBI files when gems or DSLs change: + +``` +bundle exec tapioca gem +bundle exec tapioca dsl +``` + +### Adding Typing to Files + +When editing Ruby files, start by adding: + +```ruby +# typed: false +``` + +Increase the strictness (`typed: true`, `typed: strict`) gradually as you work on the file. + +### Developer Note + +Sorbet is optional during development, but all changes must pass: + +``` +bundle exec srb tc +``` + +before merging. For any issues, please reach out to the project leads so we can help you! diff --git a/app/controllers/subprojects_controller.rb b/app/controllers/subprojects_controller.rb index 30c1922..865e158 100644 --- a/app/controllers/subprojects_controller.rb +++ b/app/controllers/subprojects_controller.rb @@ -28,7 +28,7 @@ def create ) else flash.now[:error] = "Failed to create subproject." # rubocop:disable Rails/I18nLocaleTexts - render :new, status: :unprocessable_entity + render :new, status: :unprocessable_content end end @@ -42,7 +42,7 @@ def update ) else flash.now[:error] = t(".error") - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end end diff --git a/bin/tapioca b/bin/tapioca new file mode 100755 index 0000000..a6ae757 --- /dev/null +++ b/bin/tapioca @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'tapioca' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("tapioca", "tapioca") diff --git a/sorbet/config b/sorbet/config new file mode 100644 index 0000000..3a0416d --- /dev/null +++ b/sorbet/config @@ -0,0 +1,4 @@ +--dir +. +--ignore=/tmp/ +--ignore=/vendor/bundle diff --git a/sorbet/rbi/annotations/.gitattributes b/sorbet/rbi/annotations/.gitattributes new file mode 100644 index 0000000..d2eacd2 --- /dev/null +++ b/sorbet/rbi/annotations/.gitattributes @@ -0,0 +1 @@ +**/*.rbi linguist-vendored=true diff --git a/sorbet/rbi/annotations/actionmailer.rbi b/sorbet/rbi/annotations/actionmailer.rbi new file mode 100644 index 0000000..3d2771d --- /dev/null +++ b/sorbet/rbi/annotations/actionmailer.rbi @@ -0,0 +1,10 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This file was pulled from a central RBI files repository. +# Please run `bin/tapioca annotations` to update it. + +class ActionMailer::Base + sig { params(headers: T.untyped, block: T.nilable(T.proc.params(arg0: ActionMailer::Collector).void)).returns(Mail::Message) } + def mail(headers = nil, &block); end +end diff --git a/sorbet/rbi/annotations/actionpack.rbi b/sorbet/rbi/annotations/actionpack.rbi new file mode 100644 index 0000000..02e84d7 --- /dev/null +++ b/sorbet/rbi/annotations/actionpack.rbi @@ -0,0 +1,430 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This file was pulled from a central RBI files repository. +# Please run `bin/tapioca annotations` to update it. + +class ActionController::API + MODULES = T.let(T.unsafe(nil), T::Array[T.untyped]) +end + +module ActionController::Flash::ClassMethods + sig { params(types: Symbol).void } + def add_flash_types(*types); end +end + +module ActionController::Helpers::ClassMethods + sig { returns(ActionView::Base) } + def helpers; end +end + +class ActionController::Metal < AbstractController::Base + sig { returns(ActionController::Parameters) } + def params; end + + sig { returns(ActionDispatch::Request) } + def request; end + + sig { returns(ActionDispatch::Response) } + def response; end +end + +module ActionController::MimeResponds + sig { params(mimes: T.nilable(Symbol), block: T.nilable(T.proc.params(arg0: ActionController::MimeResponds::Collector).void)).void } + def respond_to(*mimes, &block); end +end + +class ActionController::Parameters + sig { params(other: T.any(String, ActionController::Parameters)).returns(T::Boolean) } + def ==(other); end + + sig { params(key: T.any(String, Symbol), value: T.untyped).void } + def []=(key, value); end + + sig { returns(T.nilable(T::Array[T.any(String, Symbol)])) } + def always_permitted_parameters; end + + sig { params(obj: T.nilable(T::Array[T.any(String, Symbol)])).void } + def always_permitted_parameters=(obj); end + + sig { returns(T.untyped) } + def deep_dup; end + + sig { params(key: T.any(String, Symbol), block: T.untyped).returns(T.untyped) } + def delete(key, &block); end + + sig { params(keys: T.any(String, Symbol)).returns(T.untyped) } + def dig(*keys); end + + sig { params(block: T.untyped).returns(T.untyped) } + def each_pair(&block); end + + # each is an alias of each_pair + sig { params(block: T.untyped).returns(T.untyped) } + def each(&block); end + + sig { params(keys: T.any(String, Symbol)).returns(ActionController::Parameters) } + def except(*keys); end + + sig { params(keys: T.any(String, Symbol)).returns(T.untyped) } + def extract!(*keys); end + + sig { params(key: T.any(String, Symbol), args: T.untyped).returns(T.untyped) } + def fetch(key, *args); end + + sig { returns(String) } + def inspect; end + + sig { params(other_hash: T.untyped, block: T.untyped).returns(ActionController::Parameters) } + def merge!(other_hash, &block); end + + sig { params(other_hash: T.untyped).returns(ActionController::Parameters) } + def merge(other_hash); end + + sig { returns(T.untyped) } + def parameters; end + + sig { returns(T.self_type) } + def permit!; end + + # You can pass _a lot_ of stuff to permit, so filters is left untyped for now. + sig { params(filters: T.untyped).returns(ActionController::Parameters) } + def permit(*filters); end + + sig { params(new_permitted: T.untyped).void } + def permitted=(new_permitted); end + + sig { returns(T::Boolean) } + def permitted?; end + + sig { params(block: T.untyped).returns(T.untyped) } + def reject!(&block); end + + # delete_if is an alias of reject! + sig { params(block: T.untyped).returns(T.untyped) } + def delete_if(&block); end + + sig { params(block: T.untyped).returns(T.untyped) } + def reject(&block); end + + sig { params(key: T.any(String, Symbol)).returns(T.untyped) } + def [](key); end + + sig { params(key: T.any(String, Symbol)).returns(T.untyped) } + sig { params(key: T::Array[T.any(String, Symbol)]).returns(T::Array[T.untyped]) } + def require(key); end + + # required is an alias of require + sig { params(key: T.any(String, Symbol)).returns(T.untyped) } + sig { params(key: T::Array[T.any(String, Symbol)]).returns(T::Array[T.untyped]) } + def required(key); end + + sig { params(other_hash: T.untyped).returns(ActionController::Parameters) } + def reverse_merge!(other_hash); end + + # with_defaults! is an alias of reverse_merge! + sig { params(other_hash: T.untyped).returns(ActionController::Parameters) } + def with_defaults!(other_hash); end + + sig { params(other_hash: T.untyped).returns(ActionController::Parameters) } + def reverse_merge(other_hash); end + + # with_defaults is an alias of reverse_merge + sig { params(other_hash: T.untyped).returns(ActionController::Parameters) } + def with_defaults(other_hash); end + + sig { params(block: T.untyped).returns(T.nilable(ActionController::Parameters)) } + def select!(&block); end + + # keep_if is an alias of select! + sig { params(block: T.untyped).returns(T.nilable(ActionController::Parameters)) } + def keep_if(&block); end + + sig { params(block: T.untyped).returns(ActionController::Parameters) } + def select(&block); end + + sig { params(keys: T.any(String, Symbol)).returns(ActionController::Parameters) } + def slice!(*keys); end + + sig { params(keys: T.any(String, Symbol)).returns(ActionController::Parameters) } + def slice(*keys); end + + sig { params(block: T.nilable(Proc)).returns(ActiveSupport::HashWithIndifferentAccess) } + def to_h(&block); end + + sig { returns(T::Hash[T.untyped, T.untyped]) } + def to_hash; end + + # to_param is an alias of to_query + sig { params(args: String).returns(T.nilable(String)) } + def to_param(*args); end + + sig { params(args: String).returns(T.nilable(String)) } + def to_query(*args); end + + sig { returns(ActiveSupport::HashWithIndifferentAccess) } + def to_unsafe_h; end + + # to_unsafe_hash is an alias of to_unsafe_h + sig { returns(ActiveSupport::HashWithIndifferentAccess) } + def to_unsafe_hash; end + + sig { params(block: T.untyped).returns(ActionController::Parameters) } + def transform_keys!(&block); end + + sig { params(block: T.untyped).returns(ActionController::Parameters) } + def transform_keys(&block); end + + sig { returns(ActionController::Parameters) } + def transform_values!; end + + sig { returns(ActionController::Parameters) } + def transform_values; end + + sig { params(keys: T.any(String, Symbol)).returns(T.untyped) } + def values_at(*keys); end + + sig { returns(T.any(Symbol, T::Boolean)) } + def self.action_on_unpermitted_parameters; end + + sig { params(obj: T.any(Symbol, T::Boolean)).void } + def self.action_on_unpermitted_parameters=(obj); end + + sig { returns(T::Array[T.any(String, Symbol)]) } + def self.always_permitted_parameters; end + + sig { params(obj: T::Array[T.any(String, Symbol)]).void } + def self.always_permitted_parameters=(obj); end + + sig { returns(T::Boolean) } + def self.permit_all_parameters; end + + sig { params(obj: T::Boolean).void } + def self.permit_all_parameters=(obj); end +end + +module ActionController::RequestForgeryProtection + sig { returns(T::Boolean) } + def protect_against_forgery?; end + + sig { params(form_options: T::Hash[T.untyped, T.untyped]).returns(String) } + def form_authenticity_token(form_options: {}); end +end + +module ActionController::RequestForgeryProtection::ClassMethods + sig { params(options: T::Hash[T.untyped, T.untyped]).void } + def skip_forgery_protection(options = T.unsafe(nil)); end +end + +module ActionController::StrongParameters + sig { returns(ActionController::Parameters) } + def params; end +end + +module ActionDispatch::Http::Parameters + sig { returns(ActionController::Parameters) } + def parameters; end + + # params is an alias of parameters + sig { returns(ActionController::Parameters) } + def params; end +end + +module ActionDispatch::Integration::Runner + # @method_missing: delegated to ActionDispatch::Integration::Session + sig { params(host: String).returns(String) } + def host!(host); end + + # @method_missing: delegated to ActionDispatch::Integration::Session + sig { params(flag: T::Boolean).returns(T::Boolean) } + def https!(flag = true); end +end + +class ActionDispatch::IntegrationTest + # The following methods are accessible on `IntegrationTest` + # through the following delegation chain: + # - `IntegrationTest` includes `IntegrationTest::Behavior` + # - `IntegrationTest::Behavior` includes `Integration::Runner` + # - `Integration::Runner#method_missing` delegates to `Integration::Session` + # + # Then `Integration::Session` either implements the methods + # directly or further delegates to `TestProcess` (included) or + # `TestResponse` / `Request` (via `delegate`). + # + # Cf. https://github.com/Shopify/rbi-central/pull/138 for more context. + # @method_missing: delegated to ActionDispatch::TestProcess + sig { returns(ActionDispatch::Flash::FlashHash) } + def flash; end + + # @method_missing: delegated to ActionDispatch::TestProcess + sig { returns(ActionDispatch::Request::Session) } + def session; end + + # @method_missing: delegated to ActionDispatch::TestResponse + sig { returns(T.nilable(Integer)) } + def status; end + + # @method_missing: delegated to ActionDispatch::TestResponse + sig { returns(T.nilable(String)) } + def status_message; end + + # @method_missing: delegated to ActionDispatch::TestResponse + sig { returns(ActionDispatch::Response::Header) } + def headers; end + + # @method_missing: delegated to ActionDispatch::TestResponse + sig { returns(T.nilable(String)) } + def body; end + + # @method_missing: delegated to ActionDispatch::TestResponse + sig { returns(T.nilable(T::Boolean)) } + def redirect?; end + + # @method_missing: delegated to ActionDispatch::Request + sig { returns(T.nilable(String)) } + def path; end + + # @method_missing: delegated to ActionDispatch::Integration::Session + sig { returns(String) } + def host; end + + # @method_missing: delegated to ActionDispatch::Integration::Session + sig { params(host: String).returns(String) } + attr_writer :host + + # @method_missing: delegated to ActionDispatch::Integration::Session + sig { returns(T.nilable(String)) } + attr_accessor :remote_addr + + # @method_missing: delegated to ActionDispatch::Integration::Session + sig { returns(T.nilable(String)) } + attr_accessor :accept + + # @method_missing: delegated to ActionDispatch::Integration::Session + sig { returns(Rack::Test::CookieJar) } + def cookies; end + + # @method_missing: delegated to ActionDispatch::Integration::Session + sig { returns(T.nilable(ActionController::Base)) } + attr_reader :controller + + # @method_missing: delegated to ActionDispatch::Integration::Session + sig { returns(ActionDispatch::TestRequest) } + attr_reader :request + + # @method_missing: delegated to ActionDispatch::Integration::Session + sig { returns(ActionDispatch::TestResponse) } + attr_reader :response + + # @method_missing: delegated to ActionDispatch::Integration::Session + sig { returns(Integer) } + attr_accessor :request_count +end + +class ActionDispatch::Request + # Provides access to the request's HTTP headers, for example: + # + # ```ruby + # request.headers["Content-Type"] # => "text/plain" + # ``` + sig { returns(ActionDispatch::Http::Headers) } + def headers; end + + # Returns a `String` with the last requested path including their params. + # + # ```ruby + # # get '/foo' + # request.original_fullpath # => '/foo' + # + # # get '/foo?bar' + # request.original_fullpath # => '/foo?bar' + # ``` + sig { returns(String) } + def original_fullpath; end + + # Returns the `String` full path including params of the last URL requested. + # + # ```ruby + # # get "/articles" + # request.fullpath # => "/articles" + # + # # get "/articles?page=2" + # request.fullpath # => "/articles?page=2" + # ``` + sig { returns(String) } + def fullpath; end + + # Returns the original request URL as a `String`. + # + # ```ruby + # # get "/articles?page=2" + # request.original_url # => "http://www.example.com/articles?page=2" + # ``` + sig { returns(String) } + def original_url; end + + # The `String` MIME type of the request. + # + # ``` + # # get "/articles" + # request.media_type # => "application/x-www-form-urlencoded" + # ``` + sig { returns(String) } + def media_type; end + + # Returns the content length of the request as an integer. + sig { returns(Integer) } + def content_length; end + + # Returns the IP address of client as a `String`. + sig { returns(String) } + def ip; end + + # Returns the IP address of client as a `String`, + # usually set by the RemoteIp middleware. + sig { returns(String) } + def remote_ip; end + + # Returns the unique request id, which is based on either the X-Request-Id header that can + # be generated by a firewall, load balancer, or web server or by the RequestId middleware + # (which sets the action_dispatch.request_id environment variable). + # + # This unique ID is useful for tracing a request from end-to-end as part of logging or debugging. + # This relies on the Rack variable set by the ActionDispatch::RequestId middleware. + sig { returns(T.nilable(String)) } + def request_id; end + + # Returns true if the request has a header matching the given key parameter. + # + # ```ruby + # request.key? :ip_spoofing_check # => true + # ``` + sig { params(key: Symbol).returns(T::Boolean) } + def key?(key); end + + # True if the request came from localhost, 127.0.0.1, or ::1. + sig { returns(T::Boolean) } + def local?; end +end + +module ActionDispatch::Routing::Mapper::Resources + sig { params(name: T.untyped).returns(T.untyped) } + def action_path(name); end + + sig { params(block: T.untyped).returns(T.untyped) } + def collection(&block); end + + sig { params(block: T.untyped).returns(T.untyped) } + def member(&block); end + + sig { returns(T.untyped) } + def shallow; end + + sig { returns(T::Boolean) } + def shallow?; end +end + +class ActionDispatch::Routing::RouteSet + sig { params(block: T.proc.bind(ActionDispatch::Routing::Mapper).void).void } + def draw(&block); end +end diff --git a/sorbet/rbi/annotations/actionview.rbi b/sorbet/rbi/annotations/actionview.rbi new file mode 100644 index 0000000..9c939f0 --- /dev/null +++ b/sorbet/rbi/annotations/actionview.rbi @@ -0,0 +1,75 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This file was pulled from a central RBI files repository. +# Please run `bin/tapioca annotations` to update it. + +module ActionView + TemplateError = T.type_alias { Template::Error } + + class MissingTemplate < ActionView::ActionViewError + sig { returns(String) } + def path; end + end +end + +class ActionView::Helpers::FormBuilder + sig { returns(T.untyped) } + def object; end +end + +module ActionView::Helpers::NumberHelper + sig { params(number: T.untyped, options: T::Hash[T.untyped, T.untyped]).returns(T.nilable(String)) } + def number_to_currency(number, options = T.unsafe(nil)); end + + sig { params(number: T.untyped, options: T::Hash[T.untyped, T.untyped]).returns(T.nilable(String)) } + def number_to_human(number, options = T.unsafe(nil)); end + + sig { params(number: T.untyped, options: T::Hash[T.untyped, T.untyped]).returns(T.nilable(String)) } + def number_to_human_size(number, options = T.unsafe(nil)); end + + sig { params(number: T.untyped, options: T::Hash[T.untyped, T.untyped]).returns(T.nilable(String)) } + def number_to_percentage(number, options = T.unsafe(nil)); end + + sig { params(number: T.untyped, options: T::Hash[T.untyped, T.untyped]).returns(T.nilable(String)) } + def number_to_phone(number, options = T.unsafe(nil)); end + + sig { params(number: T.untyped, options: T::Hash[T.untyped, T.untyped]).returns(T.nilable(String)) } + def number_with_delimiter(number, options = T.unsafe(nil)); end + + sig { params(number: T.untyped, options: T::Hash[T.untyped, T.untyped]).returns(T.nilable(String)) } + def number_with_precision(number, options = T.unsafe(nil)); end +end + +module ActionView::Helpers::SanitizeHelper + mixes_in_class_methods ActionView::Helpers::SanitizeHelper::ClassMethods +end + +module ActionView::Helpers::UrlHelper + extend ActiveSupport::Concern + include ActionView::Helpers::TagHelper + mixes_in_class_methods ActionView::Helpers::UrlHelper::ClassMethods + + sig { params(name: T.nilable(String), options: T.untyped, html_options: T.untyped, block: T.untyped).returns(ActiveSupport::SafeBuffer) } + def link_to(name = nil, options = nil, html_options = nil, &block); end + + sig { params(condition: T.untyped, name: String, options: T.untyped, html_options: T.untyped, block: T.untyped).returns(T.untyped) } + def link_to_if(condition, name, options = {}, html_options = {}, &block); end +end + +module ActionView::Layouts + mixes_in_class_methods ActionView::Layouts::ClassMethods +end + +module ActionView::Rendering + mixes_in_class_methods ActionView::Rendering::ClassMethods +end + +module ActionView::ViewPaths + mixes_in_class_methods ActionView::ViewPaths::ClassMethods +end + +module ActionView::ViewPaths::ClassMethods + sig { params(value: T.any(String, T::Array[String])).void } + def append_view_path(value); end +end diff --git a/sorbet/rbi/annotations/activejob.rbi b/sorbet/rbi/annotations/activejob.rbi new file mode 100644 index 0000000..1cd82ad --- /dev/null +++ b/sorbet/rbi/annotations/activejob.rbi @@ -0,0 +1,44 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This file was pulled from a central RBI files repository. +# Please run `bin/tapioca annotations` to update it. + +class ActiveJob::Base + sig { params(blk: T.proc.bind(T.attached_class).params(job: T.attached_class, exception: Exception).void).void } + def self.after_discard(&blk); end + + sig { params(filters: T.untyped, blk: T.nilable(T.proc.bind(T.attached_class).params(job: T.attached_class).void)).void } + def self.after_enqueue(*filters, &blk); end + + sig { params(filters: T.untyped, blk: T.nilable(T.proc.bind(T.attached_class).params(job: T.attached_class).void)).void } + def self.after_perform(*filters, &blk); end + + sig { params(filters: T.untyped, blk: T.nilable(T.proc.bind(T.attached_class).params(job: T.attached_class, block: T.untyped).void)).void } + def self.around_enqueue(*filters, &blk); end + + sig { params(filters: T.untyped, blk: T.nilable(T.proc.bind(T.attached_class).params(job: T.attached_class, block: T.untyped).void)).void } + def self.around_perform(*filters, &blk); end + + sig { params(filters: T.untyped, blk: T.nilable(T.proc.bind(T.attached_class).params(job: T.attached_class).void)).void } + def self.before_enqueue(*filters, &blk); end + + sig { params(filters: T.untyped, blk: T.nilable(T.proc.bind(T.attached_class).params(job: T.attached_class).void)).void } + def self.before_perform(*filters, &blk); end + + sig { type_parameters(:ExceptionType).params(exceptions: T::Class[T.type_parameter(:ExceptionType)], block: T.nilable(T.proc.params(job: T.attached_class, error: T.type_parameter(:ExceptionType)).void)).void } + sig { params(exceptions: T.any(Module, String), block: T.nilable(T.proc.params(job: T.attached_class, error: T.untyped).void)).void } + def self.discard_on(*exceptions, &block); end + + sig { params(klasses: T.any(Module, String), with: T.nilable(Symbol), block: T.nilable(T.proc.params(exception: T.untyped).void)).void } + def self.rescue_from(*klasses, with: nil, &block); end + + sig { params(exceptions: T.any(Module, String), wait: T.any(ActiveSupport::Duration, Integer, Symbol, T.proc.params(executions: Integer).returns(Integer)), attempts: T.any(Integer, Symbol), queue: T.nilable(T.any(String, Symbol)), priority: T.untyped, jitter: Numeric, block: T.nilable(T.proc.params(job: T.attached_class, error: T.untyped).void)).void } + def self.retry_on(*exceptions, wait: 3.seconds, attempts: 5, queue: nil, priority: nil, jitter: ActiveJob::Exceptions::JITTER_DEFAULT, &block); end + + sig { params(part_name: T.nilable(T.any(String, Symbol)), block: T.nilable(T.proc.bind(T.attached_class).returns(T.untyped))).void } + def self.queue_as(part_name = nil, &block); end + + sig { params(priority: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).returns(T.untyped))).void } + def self.queue_with_priority(priority = nil, &block); end +end diff --git a/sorbet/rbi/annotations/activemodel.rbi b/sorbet/rbi/annotations/activemodel.rbi new file mode 100644 index 0000000..1e1a642 --- /dev/null +++ b/sorbet/rbi/annotations/activemodel.rbi @@ -0,0 +1,89 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This file was pulled from a central RBI files repository. +# Please run `bin/tapioca annotations` to update it. + +class ActiveModel::Errors + Elem = type_member { { fixed: ActiveModel::Error } } + + sig { params(attribute: T.any(Symbol, String)).returns(T::Array[String]) } + def [](attribute); end + + sig { params(attribute: T.any(Symbol, String), type: T.untyped, options: T.untyped).returns(ActiveModel::Error) } + def add(attribute, type = :invalid, **options); end + + sig { params(attribute: T.any(Symbol, String), type: T.untyped, options: T.untyped).returns(T::Boolean) } + def added?(attribute, type = :invalid, options = {}); end + + sig { params(options: T.untyped).returns(T::Hash[T.untyped, T.untyped]) } + def as_json(options = nil); end + + sig { returns(T::Array[Symbol]) } + def attribute_names; end + + sig { params(attribute: T.any(Symbol, String), type: T.untyped, options: T.untyped).returns(T.nilable(T::Array[String])) } + def delete(attribute, type = nil, **options); end + + sig { returns(T::Hash[Symbol, T::Array[T::Hash[Symbol, T.untyped]]]) } + def details; end + + sig { returns(T::Array[Elem]) } + def errors; end + + sig { params(attribute: T.any(Symbol, String), message: String).returns(String) } + def full_message(attribute, message); end + + sig { returns(T::Array[String]) } + def full_messages; end + + sig { params(attribute: T.any(Symbol, String)).returns(T::Array[String]) } + def full_messages_for(attribute); end + + sig { params(attribute: T.any(Symbol, String), type: T.untyped, options: T.untyped).returns(String) } + def generate_message(attribute, type = :invalid, options = {}); end + + sig { returns(T::Hash[Symbol, T::Array[ActiveModel::Error]]) } + def group_by_attribute; end + + sig { params(attribute: T.any(Symbol, String)).returns(T::Boolean) } + def has_key?(attribute); end + + sig { params(error: ActiveModel::Error, override_options: T.untyped).returns(T::Array[ActiveModel::Error]) } + def import(error, override_options = {}); end + + sig { params(attribute: T.any(Symbol, String)).returns(T::Boolean) } + def include?(attribute); end + + sig { params(attribute: T.any(Symbol, String)).returns(T::Boolean) } + def key?(attribute); end + + sig { params(other: T.untyped).returns(T::Array[ActiveModel::Error]) } + def merge!(other); end + + sig { returns(T::Hash[Symbol, T::Array[String]]) } + def messages; end + + sig { params(attribute: T.any(Symbol, String)).returns(T::Array[String]) } + def messages_for(attribute); end + + sig { returns(T::Array[Elem]) } + def objects; end + + sig { params(attribute: T.any(Symbol, String), type: T.untyped).returns(T::Boolean) } + def of_kind?(attribute, type = :invalid); end + + sig { returns(T::Array[String]) } + def to_a; end + + sig { params(full_messages: T.untyped).returns(T::Hash[Symbol, T::Array[String]]) } + def to_hash(full_messages = false); end + + sig { params(attribute: T.any(Symbol, String), type: T.untyped, options: T.untyped).returns(T::Array[ActiveModel::Error]) } + def where(attribute, type = nil, **options); end +end + +module ActiveModel::Validations + sig { returns(ActiveModel::Errors) } + def errors; end +end diff --git a/sorbet/rbi/annotations/activerecord.rbi b/sorbet/rbi/annotations/activerecord.rbi new file mode 100644 index 0000000..41badc2 --- /dev/null +++ b/sorbet/rbi/annotations/activerecord.rbi @@ -0,0 +1,103 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This file was pulled from a central RBI files repository. +# Please run `bin/tapioca annotations` to update it. + +class ActiveRecord::Schema + sig { params(info: T::Hash[T.untyped, T.untyped], blk: T.proc.bind(ActiveRecord::Schema).void).void } + def self.define(info = nil, &blk); end +end + +class ActiveRecord::Migration + # @shim: Methods on migration are delegated to `SchemaStatements` using `method_missing` + include ActiveRecord::ConnectionAdapters::SchemaStatements + + # @shim: Methods on migration are delegated to `DatabaseStatements` using `method_missing` + include ActiveRecord::ConnectionAdapters::DatabaseStatements +end + +class ActiveRecord::Base + sig { returns(FalseClass) } + def blank?; end + + # @shim: since `present?` is always true, `presence` always returns `self` + sig { returns(T.self_type) } + def presence; end + + sig { returns(TrueClass) } + def present?; end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.after_initialize(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.after_find(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.after_touch(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.before_validation(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.after_validation(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.before_save(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.around_save(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.after_save(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.before_create(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.around_create(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.after_create(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.before_update(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.around_update(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.after_update(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.before_destroy(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.around_destroy(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.after_destroy(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.after_commit(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.after_rollback(*args, **options, &block); end +end + +class ActiveRecord::Relation + Elem = type_member(:out) { { fixed: T.untyped } } + + sig { returns(T::Boolean) } + def blank?; end + + sig { abstract.params(blk: T.proc.params(arg0: Elem).returns(BasicObject)).returns(T.untyped) } + sig { abstract.returns(T::Enumerator[Elem]) } + def each(&blk); end +end + +module ActiveRecord::Core + sig { params(comparison_object: T.anything).returns(T::Boolean) } + def ==(comparison_object); end +end diff --git a/sorbet/rbi/annotations/activesupport.rbi b/sorbet/rbi/annotations/activesupport.rbi new file mode 100644 index 0000000..d6779e3 --- /dev/null +++ b/sorbet/rbi/annotations/activesupport.rbi @@ -0,0 +1,495 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This file was pulled from a central RBI files repository. +# Please run `bin/tapioca annotations` to update it. + +module ActiveSupport::Testing::Declarative + sig { params(name: String, block: T.proc.bind(T.untyped).void).void } + def test(name, &block); end +end + +class ActiveSupport::EnvironmentInquirer + sig { returns(T::Boolean) } + def development?; end + + sig { returns(T::Boolean) } + def production?; end + + sig { returns(T::Boolean) } + def test?; end + + # @method_missing: delegated to String through ActiveSupport::StringInquirer + sig { returns(T::Boolean) } + def staging?; end +end + +module ActiveSupport::Testing::SetupAndTeardown::ClassMethods + sig { params(args: T.untyped, block: T.nilable(T.proc.bind(T.untyped).void)).void } + def setup(*args, &block); end + + sig { params(args: T.untyped, block: T.nilable(T.proc.bind(T.untyped).void)).void } + def teardown(*args, &block); end +end + +class ActiveSupport::TestCase + sig { params(args: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).void)).void } + def self.setup(*args, &block); end + + sig { params(args: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).void)).void } + def self.teardown(*args, &block); end + + sig { params(name: String, block: T.proc.bind(T.attached_class).void).void } + def self.test(name, &block); end +end + +class ActiveSupport::TimeWithZone + # @shim: Methods on ActiveSupport::TimeWithZone are delegated to `Time` using `method_missing + include ::DateAndTime::Zones + + # @shim: Methods on ActiveSupport::TimeWithZone are delegated to `Time` using `method_missing + include ::DateAndTime::Calculations + + sig { returns(FalseClass) } + def blank?; end + + # @shim: since `present?` is always true, `presence` always returns `self` + sig { returns(T.self_type) } + def presence; end + + # @shim: since `blank?` is always false, `present?` always returns `true` + sig { returns(TrueClass) } + def present?; end +end + +class Object + sig { returns(T::Boolean) } + def blank?; end + + sig { returns(FalseClass) } + def html_safe?; end + + sig { returns(T.nilable(T.self_type)) } + def presence; end + + sig { params(another_object: T.untyped).returns(T.nilable(T.self_type)) } + def presence_in(another_object); end + + sig { returns(T::Boolean) } + def present?; end +end + +class Hash + sig { returns(T::Boolean) } + def blank?; end + + sig { returns(T::Boolean) } + def present?; end + + sig { returns(T::Boolean) } + def extractable_options?; end + + # @version >= 6.1.0 + sig { returns(T.self_type) } + def compact_blank; end +end + +class Array + sig { returns(T::Boolean) } + def blank?; end + + sig { returns(T::Boolean) } + def present?; end + + sig { params(position: Integer).returns(T.self_type) } + def from(position); end + + sig { params(position: Integer).returns(T.self_type) } + def to(position); end + + sig { params(elements: T.untyped).returns(T::Array[T.untyped]) } + def including(*elements); end + + sig { params(elements: T.untyped).returns(T.self_type) } + def excluding(*elements); end + + sig { params(elements: T.untyped).returns(T.self_type) } + def without(*elements); end + + sig { returns(T.nilable(Elem)) } + def second; end + + sig { returns(T.nilable(Elem)) } + def third; end + + sig { returns(T.nilable(Elem)) } + def fourth; end + + sig { returns(T.nilable(Elem)) } + def fifth; end + + sig { returns(T.nilable(Elem)) } + def forty_two; end + + sig { returns(T.nilable(Elem)) } + def third_to_last; end + + sig { returns(T.nilable(Elem)) } + def second_to_last; end + + sig { params(options: T::Hash[T.untyped, T.untyped]).returns(String) } + def to_sentence(options = {}); end + + sig { params(format: Symbol).returns(String) } + def to_fs(format = :default); end + + sig { params(format: Symbol).returns(String) } + def to_formatted_s(format = :default); end + + sig { returns(String) } + def to_xml; end + + sig { returns(T::Hash[T.untyped, T.untyped]) } + def extract_options!; end + + sig { type_parameters(:FillType).params(number: Integer, fill_with: T.type_parameter(:FillType), block: T.nilable(T.proc.params(group: T::Array[T.any(Elem, T.type_parameter(:FillType))]).void)).returns(T::Array[T::Array[T.any(Elem, T.type_parameter(:FillType))]]) } + def in_groups(number, fill_with = T.unsafe(nil), &block); end + + sig { type_parameters(:FillType).params(number: Integer, fill_with: T.type_parameter(:FillType), block: T.nilable(T.proc.params(group: T::Array[T.any(Elem, T.type_parameter(:FillType))]).void)).returns(T::Array[T::Array[T.any(Elem, T.type_parameter(:FillType))]]) } + def in_groups_of(number, fill_with = T.unsafe(nil), &block); end + + sig { params(value: T.untyped, block: T.nilable(T.proc.params(element: Elem).returns(T.untyped))).returns(T::Array[T::Array[Elem]]) } + def split(value = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(element: Elem).returns(T.untyped))).returns(T.any(T::Array[Elem], T::Enumerator[Elem])) } + def extract!(&block); end + + sig { returns(ActiveSupport::ArrayInquirer) } + def inquiry; end + + sig { params(object: T.untyped).returns(T::Array[T.untyped]) } + def self.wrap(object); end +end + +class Date + sig { returns(FalseClass) } + def blank?; end + + # @shim: since `present?` is always true, `presence` always returns `self` + sig { returns(T.self_type) } + def presence; end + + # @shim: since `blank?` is always false, `present?` always returns `true` + sig { returns(TrueClass) } + def present?; end +end + +class DateTime + sig { returns(FalseClass) } + def blank?; end + + # @shim: since `present?` is always true, `presence` always returns `self` + sig { returns(T.self_type) } + def presence; end + + # @shim: since `blank?` is always false, `present?` always returns `true` + sig { returns(TrueClass) } + def present?; end +end + +module Enumerable + sig { type_parameters(:Block).params(block: T.proc.params(arg0: Elem).returns(T.type_parameter(:Block))).returns(T::Hash[T.type_parameter(:Block), Elem]) } + sig { returns(T::Enumerable[T.untyped]) } + def index_by(&block); end + + sig { type_parameters(:Block).params(block: T.proc.params(arg0: Elem).returns(T.type_parameter(:Block))).returns(T::Hash[Elem, T.type_parameter(:Block)]) } + sig { returns(T::Enumerable[T.untyped]) } + sig { type_parameters(:Default).params(default: T.type_parameter(:Default)).returns(T::Hash[Elem, T.type_parameter(:Default)]) } + def index_with(default = nil, &block); end + + sig { params(block: T.proc.params(arg0: Elem).returns(BasicObject)).returns(T::Boolean) } + sig { returns(T::Boolean) } + def many?(&block); end + + sig { params(object: BasicObject).returns(T::Boolean) } + def exclude?(object); end + + # @version >= 6.1.0 + sig { returns(T::Array[Elem]) } + def compact_blank; end + + # @version >= 7.0.0 + sig { returns(Elem) } + def sole; end +end + +class NilClass + sig { returns(TrueClass) } + def blank?; end + + # @shim: since `present?` is always false, `presence` always returns `nil` + sig { returns(NilClass) } + def presence; end + + # @shim: since `blank?` is always true, `present?` always returns `false` + sig { returns(FalseClass) } + def present?; end +end + +class FalseClass + sig { returns(TrueClass) } + def blank?; end + + # @shim: since `present?` is always false, `presence` always returns `nil` + sig { returns(NilClass) } + def presence; end + + # @shim: since `blank?` is always true, `present?` always returns `false` + sig { returns(FalseClass) } + def present?; end +end + +class TrueClass + sig { returns(FalseClass) } + def blank?; end + + # @shim: since `present?` is always true, `presence` always returns `self` + sig { returns(T.self_type) } + def presence; end + + # @shim: since `blank?` is always false, `present?` always returns `true` + sig { returns(TrueClass) } + def present?; end +end + +class Numeric + sig { returns(FalseClass) } + def blank?; end + + sig { returns(TrueClass) } + def html_safe?; end + + # @shim: since `present?` is always true, `presence` always returns `self` + sig { returns(T.self_type) } + def presence; end + + # @shim: since `blank?` is always false, `present?` always returns `true` + sig { returns(TrueClass) } + def present?; end +end + +class Time + sig { returns(FalseClass) } + def blank?; end + + # @shim: since `present?` is always true, `presence` always returns `self` + sig { returns(T.self_type) } + def presence; end + + # @shim: since `blank?` is always false, `present?` always returns `true` + sig { returns(TrueClass) } + def present?; end + + sig { returns(ActiveSupport::TimeZone) } + def self.zone; end + + sig { returns(T.any(ActiveSupport::TimeWithZone, ::Time)) } + def self.current; end +end + +class Symbol + sig { returns(T::Boolean) } + def blank?; end + + sig { returns(T::Boolean) } + def present?; end + + # alias for `#start_with?` + sig { params(string_or_regexp: T.any(String, Regexp)).returns(T::Boolean) } + def starts_with?(*string_or_regexp); end + + # alias for `#end_with?` + sig { params(string_or_regexp: T.any(String, Regexp)).returns(T::Boolean) } + def ends_with?(*string_or_regexp); end +end + +class String + sig { returns(TrueClass) } + def acts_like_string?; end + + # This is the subset of `#[]` sigs that have just 1 parameter. + # https://github.com/sorbet/sorbet/blob/40ad87b4dc7be23fa00c1369ac9f927053c68907/rbi/core/string.rbi#L270-L303 + sig { params(position: Integer).returns(T.nilable(String)) } + sig { params(position: T.any(T::Range[Integer], Regexp)).returns(T.nilable(String)) } + sig { params(position: String).returns(T.nilable(String)) } + def at(position); end + + sig { returns(String) } + def as_json; end + + sig { returns(T::Boolean) } + def blank?; end + + sig { params(first_letter: Symbol).returns(String) } + def camelcase(first_letter = :upper); end + + sig { params(first_letter: Symbol).returns(String) } + def camelize(first_letter = :upper); end + + sig { returns(String) } + def classify; end + + sig { returns(T.untyped) } + def constantize; end + + sig { returns(String) } + def dasherize; end + + sig { returns(String) } + def deconstantize; end + + sig { returns(String) } + def demodulize; end + + # alias for `#end_with?` + sig { params(string_or_regexp: T.any(String, Regexp)).returns(T::Boolean) } + def ends_with?(*string_or_regexp); end + + sig { returns(String) } + def downcase_first; end + + sig { params(string: String).returns(T::Boolean) } + def exclude?(string); end + + sig { params(limit: Integer).returns(String) } + def first(limit = 1); end + + sig { params(separate_class_name_and_id_with_underscore: T::Boolean).returns(String) } + def foreign_key(separate_class_name_and_id_with_underscore = true); end + + sig { params(position: Integer).returns(String) } + def from(position); end + + sig { returns(ActiveSupport::SafeBuffer) } + def html_safe; end + + sig { params(capitalize: T::Boolean, keep_id_suffix: T::Boolean).returns(String) } + def humanize(capitalize: true, keep_id_suffix: false); end + + sig { params(zone: T.nilable(T.any(ActiveSupport::TimeZone, String))).returns(T.any(ActiveSupport::TimeWithZone, Time)) } + def in_time_zone(zone = ::Time.zone); end + + sig { params(amount: Integer, indent_string: T.nilable(String), indent_empty_lines: T::Boolean).returns(String) } + def indent(amount, indent_string = nil, indent_empty_lines = false); end + + sig { params(amount: Integer, indent_string: T.nilable(String), indent_empty_lines: T::Boolean).returns(T.nilable(String)) } + def indent!(amount, indent_string = nil, indent_empty_lines = false); end + + sig { returns(ActiveSupport::StringInquirer) } + def inquiry; end + + sig { returns(T::Boolean) } + def is_utf8?; end + + sig { params(limit: Integer).returns(String) } + def last(limit = 1); end + + sig { returns(ActiveSupport::Multibyte::Chars) } + def mb_chars; end + + sig { params(separator: String, preserve_case: T::Boolean, locale: T.nilable(Symbol)).returns(String) } + def parameterize(separator: "-", preserve_case: false, locale: nil); end + + sig { params(count: T.nilable(T.any(Integer, Symbol)), locale: T.nilable(Symbol)).returns(String) } + def pluralize(count = nil, locale = :en); end + + sig { returns(T::Boolean) } + def present?; end + + sig { params(patterns: T.any(String, Regexp)).returns(String) } + def remove(*patterns); end + + sig { params(patterns: T.any(String, Regexp)).returns(String) } + def remove!(*patterns); end + + sig { returns(T.untyped) } + def safe_constantize; end + + sig { params(locale: Symbol).returns(String) } + def singularize(locale = :en); end + + sig { returns(String) } + def squish; end + + sig { returns(String) } + def squish!; end + + # alias for `#start_with?` + sig { params(string_or_regexp: T.any(String, Regexp)).returns(T::Boolean) } + def starts_with?(*string_or_regexp); end + + sig { returns(String) } + def strip_heredoc; end + + sig { returns(String) } + def tableize; end + + sig { params(keep_id_suffix: T::Boolean).returns(String) } + def titlecase(keep_id_suffix: false); end + + sig { params(keep_id_suffix: T::Boolean).returns(String) } + def titleize(keep_id_suffix: false); end + + sig { params(position: Integer).returns(String) } + def to(position); end + + sig { returns(::Date) } + def to_date; end + + sig { returns(::DateTime) } + def to_datetime; end + + sig { params(form: T.nilable(Symbol)).returns(T.nilable(Time)) } + def to_time(form = :local); end + + sig { params(truncate_to: Integer, options: T::Hash[Symbol, T.anything]).returns(String) } + def truncate(truncate_to, options = {}); end + + sig { params(truncate_to: Integer, omission: T.nilable(String)).returns(String) } + def truncate_bytes(truncate_to, omission: "…"); end + + sig { params(words_count: Integer, options: T::Hash[Symbol, T.anything]).returns(String) } + def truncate_words(words_count, options = {}); end + + sig { returns(String) } + def underscore; end + + sig { returns(String) } + def upcase_first; end +end + +class ActiveSupport::ErrorReporter + # @version >= 7.1.0.beta1 + sig { type_parameters(:Block, :Fallback).params(error_classes: T.class_of(Exception), severity: T.nilable(Symbol), context: T.nilable(T::Hash[Symbol, T.untyped]), fallback: T.nilable(T.proc.returns(T.type_parameter(:Fallback))), source: T.nilable(String), blk: T.proc.returns(T.type_parameter(:Block))).returns(T.any(T.type_parameter(:Block), T.type_parameter(:Fallback))) } + def handle(*error_classes, severity: T.unsafe(nil), context: T.unsafe(nil), fallback: T.unsafe(nil), source: T.unsafe(nil), &blk); end + + # @version >= 7.1.0.beta1 + sig { type_parameters(:Block).params(error_classes: T.class_of(Exception), severity: T.nilable(Symbol), context: T.nilable(T::Hash[Symbol, T.untyped]), source: T.nilable(String), blk: T.proc.returns(T.type_parameter(:Block))).returns(T.type_parameter(:Block)) } + def record(*error_classes, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil), &blk); end + + # @version >= 7.1.0.beta1 + sig { params(error: Exception, handled: T::Boolean, severity: T.nilable(Symbol), context: T::Hash[Symbol, T.untyped], source: T.nilable(String)).void } + def report(error, handled: true, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil)); end + + # @version >= 7.2.0.beta1 + sig { params(error: T.any(Exception, String), severity: T.nilable(Symbol), context: T::Hash[Symbol, T.untyped], source: T.nilable(String)).void } + def unexpected(error, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil)); end +end + +module ActiveSupport::Testing::Assertions + sig { type_parameters(:Block).params(block: T.proc.returns(T.type_parameter(:Block))).returns(T.type_parameter(:Block)) } + def assert_nothing_raised(&block); end + + sig { type_parameters(:TResult).params(expression: T.any(Proc, Kernel), message: Kernel, from: T.anything, to: T.anything, block: T.proc.returns(T.type_parameter(:TResult))).returns(T.type_parameter(:TResult)) } + def assert_changes(expression, message = T.unsafe(nil), from: T.unsafe(nil), to: T.unsafe(nil), &block); end +end diff --git a/sorbet/rbi/annotations/globalid.rbi b/sorbet/rbi/annotations/globalid.rbi new file mode 100644 index 0000000..916b21d --- /dev/null +++ b/sorbet/rbi/annotations/globalid.rbi @@ -0,0 +1,30 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This file was pulled from a central RBI files repository. +# Please run `bin/tapioca annotations` to update it. + +class ActiveRecord::Base + # @shim: this is included at runtime https://github.com/rails/globalid/blob/v1.0.0/lib/global_id/railtie.rb#L38 + include GlobalID::Identification +end + +module GlobalID::Identification + sig { params(options: T::Hash[T.untyped, T.untyped]).returns(GlobalID) } + def to_gid(options = {}); end + + sig { params(options: T::Hash[T.untyped, T.untyped]).returns(String) } + def to_gid_param(options = {}); end + + sig { params(options: T::Hash[T.untyped, T.untyped]).returns(GlobalID) } + def to_global_id(options = {}); end + + sig { params(options: T::Hash[T.untyped, T.untyped]).returns(SignedGlobalID) } + def to_sgid(options = {}); end + + sig { params(options: T::Hash[T.untyped, T.untyped]).returns(String) } + def to_sgid_param(options = {}); end + + sig { params(options: T::Hash[T.untyped, T.untyped]).returns(SignedGlobalID) } + def to_signed_global_id(options = {}); end +end diff --git a/sorbet/rbi/annotations/minitest.rbi b/sorbet/rbi/annotations/minitest.rbi new file mode 100644 index 0000000..64a8928 --- /dev/null +++ b/sorbet/rbi/annotations/minitest.rbi @@ -0,0 +1,119 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This file was pulled from a central RBI files repository. +# Please run `bin/tapioca annotations` to update it. + +module Minitest::Assertions + sig { params(test: T.anything, msg: T.anything).returns(TrueClass) } + def assert(test, msg = nil); end + + sig { params(obj: T.anything, msg: T.anything).returns(TrueClass) } + def assert_empty(obj, msg = nil); end + + sig { params(exp: T.anything, act: T.anything, msg: T.anything).returns(TrueClass) } + def assert_equal(exp, act, msg = nil); end + + sig { params(exp: T.anything, act: T.anything, delta: Numeric, msg: T.anything).returns(TrueClass) } + def assert_in_delta(exp, act, delta = T.unsafe(nil), msg = nil); end + + sig { params(a: T.anything, b: T.anything, epsilon: Numeric, msg: T.anything).returns(TrueClass) } + def assert_in_epsilon(a, b, epsilon = T.unsafe(nil), msg = nil); end + + sig { params(collection: T.anything, obj: T.anything, msg: T.anything).returns(TrueClass) } + def assert_includes(collection, obj, msg = nil); end + + sig { params(cls: T.anything, obj: T.anything, msg: T.anything).returns(TrueClass) } + def assert_instance_of(cls, obj, msg = nil); end + + sig { params(cls: T.anything, obj: T.anything, msg: T.anything).returns(TrueClass) } + def assert_kind_of(cls, obj, msg = nil); end + + sig { params(matcher: T.any(String, Regexp), obj: T.anything, msg: T.anything).returns(MatchData) } + def assert_match(matcher, obj, msg = nil); end + + sig { params(obj: T.anything, msg: T.anything).returns(TrueClass) } + def assert_nil(obj, msg = nil); end + + sig { params(o1: T.anything, op: T.any(Symbol, String), o2: T.anything, msg: T.anything).returns(TrueClass) } + def assert_operator(o1, op, o2 = T.unsafe(nil), msg = nil); end + + sig { params(stdout: T.nilable(T.any(String, Regexp)), stderr: T.nilable(T.any(String, Regexp)), block: T.proc.void).returns(T::Boolean) } + def assert_output(stdout = nil, stderr = nil, &block); end + + sig { params(path: T.any(String, Pathname), msg: T.anything).returns(TrueClass) } + def assert_path_exists(path, msg = nil); end + + sig { params(block: T.proc.void).returns(TrueClass) } + def assert_pattern(&block); end + + sig { params(o1: T.anything, op: T.any(String, Symbol), msg: T.anything).returns(TrueClass) } + def assert_predicate(o1, op, msg = nil); end + + sig { params(exp: NilClass, block: T.proc.void).returns(StandardError) } + sig { type_parameters(:T).params(exp: T.any(T::Class[T.type_parameter(:T)], Regexp, String), block: T.proc.void).returns(T.type_parameter(:T)) } + def assert_raises(*exp, &block); end + + sig { params(obj: T.anything, meth: T.any(String, Symbol), msg: T.anything, include_all: T::Boolean).returns(TrueClass) } + def assert_respond_to(obj, meth, msg = nil, include_all: false); end + + sig { params(exp: T.anything, act: T.anything, msg: T.anything).returns(TrueClass) } + def assert_same(exp, act, msg = nil); end + + sig { params(send_ary: T::Array[T.anything], m: T.anything).returns(T::Boolean) } + def assert_send(send_ary, m = nil); end + + sig { params(block: T.proc.void).returns(T::Boolean) } + def assert_silent(&block); end + + sig { params(sym: Symbol, msg: T.anything, block: T.proc.void).returns(T.anything) } + def assert_throws(sym, msg = nil, &block); end + + sig { params(test: T.anything, msg: T.anything).returns(TrueClass) } + def refute(test, msg = nil); end + + sig { params(obj: T.anything, msg: T.anything).returns(TrueClass) } + def refute_empty(obj, msg = nil); end + + sig { params(exp: T.anything, act: T.anything, msg: T.anything).returns(TrueClass) } + def refute_equal(exp, act, msg = nil); end + + sig { params(exp: T.anything, act: T.anything, delta: Numeric, msg: T.anything).returns(TrueClass) } + def refute_in_delta(exp, act, delta = T.unsafe(nil), msg = nil); end + + sig { params(a: T.anything, b: T.anything, epsilon: Numeric, msg: T.anything).returns(TrueClass) } + def refute_in_epsilon(a, b, epsilon = T.unsafe(nil), msg = nil); end + + sig { params(collection: T.anything, obj: T.anything, msg: T.anything).returns(TrueClass) } + def refute_includes(collection, obj, msg = nil); end + + sig { params(cls: T.anything, obj: T.anything, msg: T.anything).returns(TrueClass) } + def refute_instance_of(cls, obj, msg = nil); end + + sig { params(cls: T.anything, obj: T.anything, msg: T.anything).returns(TrueClass) } + def refute_kind_of(cls, obj, msg = nil); end + + sig { params(matcher: T.any(String, Regexp), obj: T.anything, msg: T.anything).returns(TrueClass) } + def refute_match(matcher, obj, msg = nil); end + + sig { params(obj: T.anything, msg: T.anything).returns(TrueClass) } + def refute_nil(obj, msg = nil); end + + sig { params(block: T.proc.void).returns(TrueClass) } + def refute_pattern(&block); end + + sig { params(o1: T.anything, op: T.any(Symbol, String), o2: T.anything, msg: T.anything).returns(TrueClass) } + def refute_operator(o1, op, o2 = T.unsafe(nil), msg = nil); end + + sig { params(path: T.any(String, Pathname), msg: T.anything).returns(TrueClass) } + def refute_path_exists(path, msg = nil); end + + sig { params(o1: T.anything, op: T.any(String, Symbol), msg: T.anything).returns(TrueClass) } + def refute_predicate(o1, op, msg = nil); end + + sig { params(obj: T.anything, meth: T.any(String, Symbol), msg: T.anything, include_all: T::Boolean).returns(TrueClass) } + def refute_respond_to(obj, meth, msg = nil, include_all: false); end + + sig { params(exp: T.anything, act: T.anything, msg: T.anything).returns(TrueClass) } + def refute_same(exp, act, msg = nil); end +end diff --git a/sorbet/rbi/annotations/railties.rbi b/sorbet/rbi/annotations/railties.rbi new file mode 100644 index 0000000..cec2842 --- /dev/null +++ b/sorbet/rbi/annotations/railties.rbi @@ -0,0 +1,61 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This file was pulled from a central RBI files repository. +# Please run `bin/tapioca annotations` to update it. + +module Rails + class << self + sig { returns(Rails::Application) } + def application; end + + sig { returns(ActiveSupport::BacktraceCleaner) } + def backtrace_cleaner; end + + sig { returns(ActiveSupport::Cache::Store) } + def cache; end + + sig { returns(ActiveSupport::EnvironmentInquirer) } + def env; end + + sig { returns(ActiveSupport::ErrorReporter) } + def error; end + + sig { returns(ActiveSupport::Logger) } + def logger; end + + sig { returns(Pathname) } + def root; end + + sig { returns(String) } + def version; end + end +end + +class Rails::Application < ::Rails::Engine + class << self + sig { params(block: T.proc.bind(Rails::Application).void).void } + def configure(&block); end + end + + sig { params(block: T.proc.bind(Rails::Application).void).void } + def configure(&block); end + + sig { returns(T.untyped) } + def config; end +end + +class Rails::Engine < ::Rails::Railtie + sig { params(block: T.untyped).returns(ActionDispatch::Routing::RouteSet) } + def routes(&block); end +end + +class Rails::Railtie + sig { params(block: T.proc.bind(Rails::Railtie).void).void } + def configure(&block); end +end + +class Rails::Railtie::Configuration + sig { params(blk: T.proc.bind(ActiveSupport::Reloader).void).void } + def to_prepare(&blk); end +end diff --git a/sorbet/rbi/annotations/rainbow.rbi b/sorbet/rbi/annotations/rainbow.rbi new file mode 100644 index 0000000..0d2cb4e --- /dev/null +++ b/sorbet/rbi/annotations/rainbow.rbi @@ -0,0 +1,269 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This file was pulled from a central RBI files repository. +# Please run `bin/tapioca annotations` to update it. + +module Rainbow + # @shim: https://github.com/sickill/rainbow/blob/master/lib/rainbow.rb#L10-L12 + sig { returns(T::Boolean) } + attr_accessor :enabled + + class Color + sig { returns(Symbol) } + attr_reader :ground + + sig { params(ground: Symbol, values: T.any([Integer], [Integer, Integer, Integer])).returns(Color) } + def self.build(ground, values); end + + sig { params(hex: String).returns([Integer, Integer, Integer]) } + def self.parse_hex_color(hex); end + + class Indexed < Rainbow::Color + sig { returns(Integer) } + attr_reader :num + + sig { params(ground: Symbol, num: Integer).void } + def initialize(ground, num); end + + sig { returns(T::Array[Integer]) } + def codes; end + end + + class Named < Rainbow::Color::Indexed + NAMES = T.let(nil, T::Hash[Symbol, Integer]) + + sig { params(ground: Symbol, name: Symbol).void } + def initialize(ground, name); end + + sig { returns(T::Array[Symbol]) } + def self.color_names; end + + sig { returns(String) } + def self.valid_names; end + end + + class RGB < Rainbow::Color::Indexed + sig { returns(Integer) } + attr_reader :r, :g, :b + + sig { params(ground: Symbol, values: Integer).void } + def initialize(ground, *values); end + + sig { returns(T::Array[Integer]) } + def codes; end + + sig { params(value: Numeric).returns(Integer) } + def self.to_ansi_domain(value); end + end + + class X11Named < Rainbow::Color::RGB + include Rainbow::X11ColorNames + + sig { params(ground: Symbol, name: Symbol).void } + def initialize(ground, name); end + + sig { returns(T::Array[Symbol]) } + def self.color_names; end + + sig { returns(String) } + def self.valid_names; end + end + end + + sig { returns(Wrapper) } + def self.global; end + + sig { returns(T::Boolean) } + def self.enabled; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def self.enabled=(value); end + + sig { params(string: String).returns(String) } + def self.uncolor(string); end + + class NullPresenter < String + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) } + def color(*values); end + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) } + def foreground(*values); end + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) } + def fg(*values); end + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) } + def background(*values); end + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) } + def bg(*values); end + + sig { returns(NullPresenter) } + def reset; end + + sig { returns(NullPresenter) } + def bright; end + + sig { returns(NullPresenter) } + def faint; end + + sig { returns(NullPresenter) } + def italic; end + + sig { returns(NullPresenter) } + def underline; end + + sig { returns(NullPresenter) } + def blink; end + + sig { returns(NullPresenter) } + def inverse; end + + sig { returns(NullPresenter) } + def hide; end + + sig { returns(NullPresenter) } + def cross_out; end + + sig { returns(NullPresenter) } + def black; end + + sig { returns(NullPresenter) } + def red; end + + sig { returns(NullPresenter) } + def green; end + + sig { returns(NullPresenter) } + def yellow; end + + sig { returns(NullPresenter) } + def blue; end + + sig { returns(NullPresenter) } + def magenta; end + + sig { returns(NullPresenter) } + def cyan; end + + sig { returns(NullPresenter) } + def white; end + + sig { returns(NullPresenter) } + def bold; end + + sig { returns(NullPresenter) } + def dark; end + + sig { returns(NullPresenter) } + def strike; end + end + + class Presenter < String + TERM_EFFECTS = T.let(nil, T::Hash[Symbol, Integer]) + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) } + def color(*values); end + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) } + def foreground(*values); end + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) } + def fg(*values); end + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) } + def background(*values); end + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) } + def bg(*values); end + + sig { returns(Presenter) } + def reset; end + + sig { returns(Presenter) } + def bright; end + + sig { returns(Presenter) } + def faint; end + + sig { returns(Presenter) } + def italic; end + + sig { returns(Presenter) } + def underline; end + + sig { returns(Presenter) } + def blink; end + + sig { returns(Presenter) } + def inverse; end + + sig { returns(Presenter) } + def hide; end + + sig { returns(Presenter) } + def cross_out; end + + sig { returns(Presenter) } + def black; end + + sig { returns(Presenter) } + def red; end + + sig { returns(Presenter) } + def green; end + + sig { returns(Presenter) } + def yellow; end + + sig { returns(Presenter) } + def blue; end + + sig { returns(Presenter) } + def magenta; end + + sig { returns(Presenter) } + def cyan; end + + sig { returns(Presenter) } + def white; end + + sig { returns(Presenter) } + def bold; end + + sig { returns(Presenter) } + def dark; end + + sig { returns(Presenter) } + def strike; end + end + + class StringUtils + sig { params(string: String, codes: T::Array[Integer]).returns(String) } + def self.wrap_with_sgr(string, codes); end + + sig { params(string: String).returns(String) } + def self.uncolor(string); end + end + + VERSION = T.let(nil, String) + + class Wrapper + sig { returns(T::Boolean) } + attr_accessor :enabled + + sig { params(enabled: T::Boolean).void } + def initialize(enabled = true); end + + sig { params(string: String).returns(T.any(Rainbow::Presenter, Rainbow::NullPresenter)) } + def wrap(string); end + end + + module X11ColorNames + NAMES = T.let(nil, T::Hash[Symbol, [Integer, Integer, Integer]]) + end +end + +sig { params(string: String).returns(Rainbow::Presenter) } +def Rainbow(string); end diff --git a/sorbet/rbi/dsl/.gitattributes b/sorbet/rbi/dsl/.gitattributes new file mode 100644 index 0000000..d9bb82a --- /dev/null +++ b/sorbet/rbi/dsl/.gitattributes @@ -0,0 +1 @@ +**/*.rbi linguist-generated=true diff --git a/sorbet/rbi/dsl/abstract_controller/caching.rbi b/sorbet/rbi/dsl/abstract_controller/caching.rbi new file mode 100644 index 0000000..f13c43e --- /dev/null +++ b/sorbet/rbi/dsl/abstract_controller/caching.rbi @@ -0,0 +1,25 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `AbstractController::Caching`. +# Please instead update this file by running `bin/tapioca dsl AbstractController::Caching`. + + +module AbstractController::Caching + include GeneratedInstanceMethods + + mixes_in_class_methods ::AbstractController::Caching::Fragments::ClassMethods + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def fragment_cache_keys; end + def fragment_cache_keys=(value); end + def fragment_cache_keys?; end + end + + module GeneratedInstanceMethods + def fragment_cache_keys; end + def fragment_cache_keys=(value); end + def fragment_cache_keys?; end + end +end diff --git a/sorbet/rbi/dsl/abstract_controller/caching/fragments.rbi b/sorbet/rbi/dsl/abstract_controller/caching/fragments.rbi new file mode 100644 index 0000000..d04a840 --- /dev/null +++ b/sorbet/rbi/dsl/abstract_controller/caching/fragments.rbi @@ -0,0 +1,24 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `AbstractController::Caching::Fragments`. +# Please instead update this file by running `bin/tapioca dsl AbstractController::Caching::Fragments`. + + +module AbstractController::Caching::Fragments + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def fragment_cache_keys; end + def fragment_cache_keys=(value); end + def fragment_cache_keys?; end + end + + module GeneratedInstanceMethods + def fragment_cache_keys; end + def fragment_cache_keys=(value); end + def fragment_cache_keys?; end + end +end diff --git a/sorbet/rbi/dsl/abstract_controller/callbacks.rbi b/sorbet/rbi/dsl/abstract_controller/callbacks.rbi new file mode 100644 index 0000000..16926ae --- /dev/null +++ b/sorbet/rbi/dsl/abstract_controller/callbacks.rbi @@ -0,0 +1,22 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `AbstractController::Callbacks`. +# Please instead update this file by running `bin/tapioca dsl AbstractController::Callbacks`. + + +module AbstractController::Callbacks + include GeneratedInstanceMethods + + mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + end + + module GeneratedInstanceMethods + def __callbacks; end + end +end diff --git a/sorbet/rbi/dsl/abstract_controller/helpers.rbi b/sorbet/rbi/dsl/abstract_controller/helpers.rbi new file mode 100644 index 0000000..3f1bbc1 --- /dev/null +++ b/sorbet/rbi/dsl/abstract_controller/helpers.rbi @@ -0,0 +1,24 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `AbstractController::Helpers`. +# Please instead update this file by running `bin/tapioca dsl AbstractController::Helpers`. + + +module AbstractController::Helpers + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + end + + module GeneratedInstanceMethods + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + end +end diff --git a/sorbet/rbi/dsl/abstract_controller/rendering.rbi b/sorbet/rbi/dsl/abstract_controller/rendering.rbi new file mode 100644 index 0000000..4a3bfe1 --- /dev/null +++ b/sorbet/rbi/dsl/abstract_controller/rendering.rbi @@ -0,0 +1,10 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `AbstractController::Rendering`. +# Please instead update this file by running `bin/tapioca dsl AbstractController::Rendering`. + + +module AbstractController::Rendering + mixes_in_class_methods ::ActionView::ViewPaths::ClassMethods +end diff --git a/sorbet/rbi/dsl/abstract_controller/url_for.rbi b/sorbet/rbi/dsl/abstract_controller/url_for.rbi new file mode 100644 index 0000000..14ffe07 --- /dev/null +++ b/sorbet/rbi/dsl/abstract_controller/url_for.rbi @@ -0,0 +1,24 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `AbstractController::UrlFor`. +# Please instead update this file by running `bin/tapioca dsl AbstractController::UrlFor`. + + +module AbstractController::UrlFor + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end + + module GeneratedInstanceMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end +end diff --git a/sorbet/rbi/dsl/action_cable/channel/callbacks.rbi b/sorbet/rbi/dsl/action_cable/channel/callbacks.rbi new file mode 100644 index 0000000..d090c5c --- /dev/null +++ b/sorbet/rbi/dsl/action_cable/channel/callbacks.rbi @@ -0,0 +1,22 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionCable::Channel::Callbacks`. +# Please instead update this file by running `bin/tapioca dsl ActionCable::Channel::Callbacks`. + + +module ActionCable::Channel::Callbacks + include GeneratedInstanceMethods + + mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + end + + module GeneratedInstanceMethods + def __callbacks; end + end +end diff --git a/sorbet/rbi/dsl/action_cable/channel/periodic_timers.rbi b/sorbet/rbi/dsl/action_cable/channel/periodic_timers.rbi new file mode 100644 index 0000000..9e62b4f --- /dev/null +++ b/sorbet/rbi/dsl/action_cable/channel/periodic_timers.rbi @@ -0,0 +1,22 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionCable::Channel::PeriodicTimers`. +# Please instead update this file by running `bin/tapioca dsl ActionCable::Channel::PeriodicTimers`. + + +module ActionCable::Channel::PeriodicTimers + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def periodic_timers; end + def periodic_timers=(value); end + def periodic_timers?; end + end + + module GeneratedInstanceMethods + def periodic_timers=(value); end + end +end diff --git a/sorbet/rbi/dsl/action_cable/connection/callbacks.rbi b/sorbet/rbi/dsl/action_cable/connection/callbacks.rbi new file mode 100644 index 0000000..95abe4a --- /dev/null +++ b/sorbet/rbi/dsl/action_cable/connection/callbacks.rbi @@ -0,0 +1,22 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionCable::Connection::Callbacks`. +# Please instead update this file by running `bin/tapioca dsl ActionCable::Connection::Callbacks`. + + +module ActionCable::Connection::Callbacks + include GeneratedInstanceMethods + + mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + end + + module GeneratedInstanceMethods + def __callbacks; end + end +end diff --git a/sorbet/rbi/dsl/action_cable/connection/identification.rbi b/sorbet/rbi/dsl/action_cable/connection/identification.rbi new file mode 100644 index 0000000..e835fe7 --- /dev/null +++ b/sorbet/rbi/dsl/action_cable/connection/identification.rbi @@ -0,0 +1,24 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionCable::Connection::Identification`. +# Please instead update this file by running `bin/tapioca dsl ActionCable::Connection::Identification`. + + +module ActionCable::Connection::Identification + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def identifiers; end + def identifiers=(value); end + def identifiers?; end + end + + module GeneratedInstanceMethods + def identifiers; end + def identifiers=(value); end + def identifiers?; end + end +end diff --git a/sorbet/rbi/dsl/action_controller/api_rendering.rbi b/sorbet/rbi/dsl/action_controller/api_rendering.rbi new file mode 100644 index 0000000..ee5efec --- /dev/null +++ b/sorbet/rbi/dsl/action_controller/api_rendering.rbi @@ -0,0 +1,11 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionController::ApiRendering`. +# Please instead update this file by running `bin/tapioca dsl ActionController::ApiRendering`. + + +module ActionController::ApiRendering + mixes_in_class_methods ::ActionView::ViewPaths::ClassMethods + mixes_in_class_methods ::ActionView::Rendering::ClassMethods +end diff --git a/sorbet/rbi/dsl/action_controller/caching.rbi b/sorbet/rbi/dsl/action_controller/caching.rbi new file mode 100644 index 0000000..214e10c --- /dev/null +++ b/sorbet/rbi/dsl/action_controller/caching.rbi @@ -0,0 +1,24 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionController::Caching`. +# Please instead update this file by running `bin/tapioca dsl ActionController::Caching`. + + +module ActionController::Caching + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def fragment_cache_keys; end + def fragment_cache_keys=(value); end + def fragment_cache_keys?; end + end + + module GeneratedInstanceMethods + def fragment_cache_keys; end + def fragment_cache_keys=(value); end + def fragment_cache_keys?; end + end +end diff --git a/sorbet/rbi/dsl/action_controller/conditional_get.rbi b/sorbet/rbi/dsl/action_controller/conditional_get.rbi new file mode 100644 index 0000000..a35b102 --- /dev/null +++ b/sorbet/rbi/dsl/action_controller/conditional_get.rbi @@ -0,0 +1,24 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionController::ConditionalGet`. +# Please instead update this file by running `bin/tapioca dsl ActionController::ConditionalGet`. + + +module ActionController::ConditionalGet + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def etaggers; end + def etaggers=(value); end + def etaggers?; end + end + + module GeneratedInstanceMethods + def etaggers; end + def etaggers=(value); end + def etaggers?; end + end +end diff --git a/sorbet/rbi/dsl/action_controller/content_security_policy.rbi b/sorbet/rbi/dsl/action_controller/content_security_policy.rbi new file mode 100644 index 0000000..04f6d59 --- /dev/null +++ b/sorbet/rbi/dsl/action_controller/content_security_policy.rbi @@ -0,0 +1,30 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionController::ContentSecurityPolicy`. +# Please instead update this file by running `bin/tapioca dsl ActionController::ContentSecurityPolicy`. + + +module ActionController::ContentSecurityPolicy + include GeneratedInstanceMethods + + mixes_in_class_methods ::AbstractController::Helpers::ClassMethods + mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods + mixes_in_class_methods ::AbstractController::Callbacks::ClassMethods + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + end +end diff --git a/sorbet/rbi/dsl/action_controller/data_streaming.rbi b/sorbet/rbi/dsl/action_controller/data_streaming.rbi new file mode 100644 index 0000000..91ac611 --- /dev/null +++ b/sorbet/rbi/dsl/action_controller/data_streaming.rbi @@ -0,0 +1,10 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionController::DataStreaming`. +# Please instead update this file by running `bin/tapioca dsl ActionController::DataStreaming`. + + +module ActionController::DataStreaming + mixes_in_class_methods ::ActionController::Rendering::ClassMethods +end diff --git a/sorbet/rbi/dsl/action_controller/etag_with_flash.rbi b/sorbet/rbi/dsl/action_controller/etag_with_flash.rbi new file mode 100644 index 0000000..ab5f950 --- /dev/null +++ b/sorbet/rbi/dsl/action_controller/etag_with_flash.rbi @@ -0,0 +1,25 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionController::EtagWithFlash`. +# Please instead update this file by running `bin/tapioca dsl ActionController::EtagWithFlash`. + + +module ActionController::EtagWithFlash + include GeneratedInstanceMethods + + mixes_in_class_methods ::ActionController::ConditionalGet::ClassMethods + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def etaggers; end + def etaggers=(value); end + def etaggers?; end + end + + module GeneratedInstanceMethods + def etaggers; end + def etaggers=(value); end + def etaggers?; end + end +end diff --git a/sorbet/rbi/dsl/action_controller/etag_with_template_digest.rbi b/sorbet/rbi/dsl/action_controller/etag_with_template_digest.rbi new file mode 100644 index 0000000..d6602b7 --- /dev/null +++ b/sorbet/rbi/dsl/action_controller/etag_with_template_digest.rbi @@ -0,0 +1,31 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionController::EtagWithTemplateDigest`. +# Please instead update this file by running `bin/tapioca dsl ActionController::EtagWithTemplateDigest`. + + +module ActionController::EtagWithTemplateDigest + include GeneratedInstanceMethods + + mixes_in_class_methods ::ActionController::ConditionalGet::ClassMethods + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def etag_with_template_digest; end + def etag_with_template_digest=(value); end + def etag_with_template_digest?; end + def etaggers; end + def etaggers=(value); end + def etaggers?; end + end + + module GeneratedInstanceMethods + def etag_with_template_digest; end + def etag_with_template_digest=(value); end + def etag_with_template_digest?; end + def etaggers; end + def etaggers=(value); end + def etaggers?; end + end +end diff --git a/sorbet/rbi/dsl/action_controller/flash.rbi b/sorbet/rbi/dsl/action_controller/flash.rbi new file mode 100644 index 0000000..d685467 --- /dev/null +++ b/sorbet/rbi/dsl/action_controller/flash.rbi @@ -0,0 +1,20 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionController::Flash`. +# Please instead update this file by running `bin/tapioca dsl ActionController::Flash`. + + +module ActionController::Flash + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def _flash_types; end + def _flash_types=(value); end + def _flash_types?; end + end + + module GeneratedInstanceMethods; end +end diff --git a/sorbet/rbi/dsl/action_controller/form_builder.rbi b/sorbet/rbi/dsl/action_controller/form_builder.rbi new file mode 100644 index 0000000..059161c --- /dev/null +++ b/sorbet/rbi/dsl/action_controller/form_builder.rbi @@ -0,0 +1,20 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionController::FormBuilder`. +# Please instead update this file by running `bin/tapioca dsl ActionController::FormBuilder`. + + +module ActionController::FormBuilder + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def _default_form_builder; end + def _default_form_builder=(value); end + def _default_form_builder?; end + end + + module GeneratedInstanceMethods; end +end diff --git a/sorbet/rbi/dsl/action_controller/helpers.rbi b/sorbet/rbi/dsl/action_controller/helpers.rbi new file mode 100644 index 0000000..dbfe5f4 --- /dev/null +++ b/sorbet/rbi/dsl/action_controller/helpers.rbi @@ -0,0 +1,37 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionController::Helpers`. +# Please instead update this file by running `bin/tapioca dsl ActionController::Helpers`. + + +module ActionController::Helpers + include GeneratedInstanceMethods + + mixes_in_class_methods ::AbstractController::Helpers::ClassMethods + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + def helpers_path; end + def helpers_path=(value); end + def helpers_path?; end + def include_all_helpers; end + def include_all_helpers=(value); end + def include_all_helpers?; end + end + + module GeneratedInstanceMethods + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + def helpers_path; end + def helpers_path=(value); end + def helpers_path?; end + def include_all_helpers; end + def include_all_helpers=(value); end + def include_all_helpers?; end + end +end diff --git a/sorbet/rbi/dsl/action_controller/params_wrapper.rbi b/sorbet/rbi/dsl/action_controller/params_wrapper.rbi new file mode 100644 index 0000000..4b12f1e --- /dev/null +++ b/sorbet/rbi/dsl/action_controller/params_wrapper.rbi @@ -0,0 +1,24 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionController::ParamsWrapper`. +# Please instead update this file by running `bin/tapioca dsl ActionController::ParamsWrapper`. + + +module ActionController::ParamsWrapper + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def _wrapper_options; end + def _wrapper_options=(value); end + def _wrapper_options?; end + end + + module GeneratedInstanceMethods + def _wrapper_options; end + def _wrapper_options=(value); end + def _wrapper_options?; end + end +end diff --git a/sorbet/rbi/dsl/action_controller/redirecting.rbi b/sorbet/rbi/dsl/action_controller/redirecting.rbi new file mode 100644 index 0000000..a9d109e --- /dev/null +++ b/sorbet/rbi/dsl/action_controller/redirecting.rbi @@ -0,0 +1,29 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionController::Redirecting`. +# Please instead update this file by running `bin/tapioca dsl ActionController::Redirecting`. + + +module ActionController::Redirecting + include GeneratedInstanceMethods + + mixes_in_class_methods ::AbstractController::UrlFor::ClassMethods + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def _allowed_redirect_hosts; end + def _allowed_redirect_hosts=(value); end + def allowed_redirect_hosts_permissions; end + def allowed_redirect_hosts_permissions=(value); end + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end + + module GeneratedInstanceMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end +end diff --git a/sorbet/rbi/dsl/action_controller/renderers.rbi b/sorbet/rbi/dsl/action_controller/renderers.rbi new file mode 100644 index 0000000..1a5e448 --- /dev/null +++ b/sorbet/rbi/dsl/action_controller/renderers.rbi @@ -0,0 +1,27 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionController::Renderers`. +# Please instead update this file by running `bin/tapioca dsl ActionController::Renderers`. + + +module ActionController::Renderers + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def _renderers; end + def _renderers=(value); end + def _renderers?; end + def escape_json_responses; end + def escape_json_responses=(value); end + def escape_json_responses?; end + end + + module GeneratedInstanceMethods + def _renderers; end + def _renderers=(value); end + def _renderers?; end + end +end diff --git a/sorbet/rbi/dsl/action_controller/renderers/all.rbi b/sorbet/rbi/dsl/action_controller/renderers/all.rbi new file mode 100644 index 0000000..7fefe24 --- /dev/null +++ b/sorbet/rbi/dsl/action_controller/renderers/all.rbi @@ -0,0 +1,28 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionController::Renderers::All`. +# Please instead update this file by running `bin/tapioca dsl ActionController::Renderers::All`. + + +module ActionController::Renderers::All + include GeneratedInstanceMethods + + mixes_in_class_methods ::ActionController::Renderers::ClassMethods + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def _renderers; end + def _renderers=(value); end + def _renderers?; end + def escape_json_responses; end + def escape_json_responses=(value); end + def escape_json_responses?; end + end + + module GeneratedInstanceMethods + def _renderers; end + def _renderers=(value); end + def _renderers?; end + end +end diff --git a/sorbet/rbi/dsl/action_controller/request_forgery_protection.rbi b/sorbet/rbi/dsl/action_controller/request_forgery_protection.rbi new file mode 100644 index 0000000..2812530 --- /dev/null +++ b/sorbet/rbi/dsl/action_controller/request_forgery_protection.rbi @@ -0,0 +1,30 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionController::RequestForgeryProtection`. +# Please instead update this file by running `bin/tapioca dsl ActionController::RequestForgeryProtection`. + + +module ActionController::RequestForgeryProtection + include GeneratedInstanceMethods + + mixes_in_class_methods ::AbstractController::Helpers::ClassMethods + mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods + mixes_in_class_methods ::AbstractController::Callbacks::ClassMethods + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + end +end diff --git a/sorbet/rbi/dsl/action_controller/rescue.rbi b/sorbet/rbi/dsl/action_controller/rescue.rbi new file mode 100644 index 0000000..b58f096 --- /dev/null +++ b/sorbet/rbi/dsl/action_controller/rescue.rbi @@ -0,0 +1,25 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionController::Rescue`. +# Please instead update this file by running `bin/tapioca dsl ActionController::Rescue`. + + +module ActionController::Rescue + include GeneratedInstanceMethods + + mixes_in_class_methods ::ActiveSupport::Rescuable::ClassMethods + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def rescue_handlers; end + def rescue_handlers=(value); end + def rescue_handlers?; end + end + + module GeneratedInstanceMethods + def rescue_handlers; end + def rescue_handlers=(value); end + def rescue_handlers?; end + end +end diff --git a/sorbet/rbi/dsl/action_controller/test_case/behavior.rbi b/sorbet/rbi/dsl/action_controller/test_case/behavior.rbi new file mode 100644 index 0000000..ee0cd10 --- /dev/null +++ b/sorbet/rbi/dsl/action_controller/test_case/behavior.rbi @@ -0,0 +1,25 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionController::TestCase::Behavior`. +# Please instead update this file by running `bin/tapioca dsl ActionController::TestCase::Behavior`. + + +module ActionController::TestCase::Behavior + include GeneratedInstanceMethods + + mixes_in_class_methods ::ActiveSupport::Testing::ConstantLookup::ClassMethods + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def _controller_class; end + def _controller_class=(value); end + def _controller_class?; end + end + + module GeneratedInstanceMethods + def _controller_class; end + def _controller_class=(value); end + def _controller_class?; end + end +end diff --git a/sorbet/rbi/dsl/action_controller/url_for.rbi b/sorbet/rbi/dsl/action_controller/url_for.rbi new file mode 100644 index 0000000..8b1aa82 --- /dev/null +++ b/sorbet/rbi/dsl/action_controller/url_for.rbi @@ -0,0 +1,25 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionController::UrlFor`. +# Please instead update this file by running `bin/tapioca dsl ActionController::UrlFor`. + + +module ActionController::UrlFor + include GeneratedInstanceMethods + + mixes_in_class_methods ::AbstractController::UrlFor::ClassMethods + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end + + module GeneratedInstanceMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end +end diff --git a/sorbet/rbi/dsl/action_dispatch/assertions.rbi b/sorbet/rbi/dsl/action_dispatch/assertions.rbi new file mode 100644 index 0000000..002fcd5 --- /dev/null +++ b/sorbet/rbi/dsl/action_dispatch/assertions.rbi @@ -0,0 +1,10 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionDispatch::Assertions`. +# Please instead update this file by running `bin/tapioca dsl ActionDispatch::Assertions`. + + +module ActionDispatch::Assertions + mixes_in_class_methods ::ActionDispatch::Assertions::RoutingAssertions::ClassMethods +end diff --git a/sorbet/rbi/dsl/action_dispatch/integration_test.rbi b/sorbet/rbi/dsl/action_dispatch/integration_test.rbi new file mode 100644 index 0000000..ff92dad --- /dev/null +++ b/sorbet/rbi/dsl/action_dispatch/integration_test.rbi @@ -0,0 +1,11 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionDispatch::IntegrationTest`. +# Please instead update this file by running `bin/tapioca dsl ActionDispatch::IntegrationTest`. + + +class ActionDispatch::IntegrationTest + include GeneratedUrlHelpersModule + include GeneratedPathHelpersModule +end diff --git a/sorbet/rbi/dsl/action_dispatch/routing/route_set/mounted_helpers.rbi b/sorbet/rbi/dsl/action_dispatch/routing/route_set/mounted_helpers.rbi new file mode 100644 index 0000000..8810693 --- /dev/null +++ b/sorbet/rbi/dsl/action_dispatch/routing/route_set/mounted_helpers.rbi @@ -0,0 +1,24 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionDispatch::Routing::RouteSet::MountedHelpers`. +# Please instead update this file by running `bin/tapioca dsl ActionDispatch::Routing::RouteSet::MountedHelpers`. + + +module ActionDispatch::Routing::RouteSet::MountedHelpers + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end + + module GeneratedInstanceMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end +end diff --git a/sorbet/rbi/dsl/action_dispatch/routing/url_for.rbi b/sorbet/rbi/dsl/action_dispatch/routing/url_for.rbi new file mode 100644 index 0000000..8bb4a03 --- /dev/null +++ b/sorbet/rbi/dsl/action_dispatch/routing/url_for.rbi @@ -0,0 +1,24 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionDispatch::Routing::UrlFor`. +# Please instead update this file by running `bin/tapioca dsl ActionDispatch::Routing::UrlFor`. + + +module ActionDispatch::Routing::UrlFor + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end + + module GeneratedInstanceMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end +end diff --git a/sorbet/rbi/dsl/action_mailbox/inbound_email.rbi b/sorbet/rbi/dsl/action_mailbox/inbound_email.rbi new file mode 100644 index 0000000..ceae709 --- /dev/null +++ b/sorbet/rbi/dsl/action_mailbox/inbound_email.rbi @@ -0,0 +1,1150 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionMailbox::InboundEmail`. +# Please instead update this file by running `bin/tapioca dsl ActionMailbox::InboundEmail`. + + +class ActionMailbox::InboundEmail + include GeneratedAssociationMethods + include EnumMethodsModule + extend CommonRelationMethods + extend GeneratedRelationMethods + + sig { returns(ActiveStorage::Attached::One) } + def raw_email; end + + sig { params(attachable: T.untyped).returns(T.untyped) } + def raw_email=(attachable); end + + private + + sig { returns(NilClass) } + def to_ary; end + + class << self + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionMailbox::InboundEmail).void) + ).returns(::ActionMailbox::InboundEmail) + end + def new(attributes = nil, &block); end + + sig { returns(T::Hash[T.any(String, Symbol), Integer]) } + def statuses; end + end + + module CommonRelationMethods + sig do + params( + block: T.nilable(T.proc.params(record: ::ActionMailbox::InboundEmail).returns(T.untyped)) + ).returns(T::Boolean) + end + def any?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def average(column_name); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::ActionMailbox::InboundEmail).void) + ).returns(::ActionMailbox::InboundEmail) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionMailbox::InboundEmail).void) + ).returns(T::Array[::ActionMailbox::InboundEmail]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionMailbox::InboundEmail).void) + ).returns(::ActionMailbox::InboundEmail) + end + def build(attributes = nil, &block); end + + sig { params(operation: Symbol, column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def calculate(operation, column_name); end + + sig { params(column_name: T.nilable(T.any(String, Symbol))).returns(Integer) } + sig do + params( + column_name: NilClass, + block: T.proc.params(object: ::ActionMailbox::InboundEmail).void + ).returns(Integer) + end + def count(column_name = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::ActionMailbox::InboundEmail).void) + ).returns(::ActionMailbox::InboundEmail) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionMailbox::InboundEmail).void) + ).returns(T::Array[::ActionMailbox::InboundEmail]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionMailbox::InboundEmail).void) + ).returns(::ActionMailbox::InboundEmail) + end + def create(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::ActionMailbox::InboundEmail).void) + ).returns(::ActionMailbox::InboundEmail) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionMailbox::InboundEmail).void) + ).returns(T::Array[::ActionMailbox::InboundEmail]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionMailbox::InboundEmail).void) + ).returns(::ActionMailbox::InboundEmail) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionMailbox::InboundEmail).void) + ).returns(T::Array[::ActionMailbox::InboundEmail]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionMailbox::InboundEmail).void) + ).returns(::ActionMailbox::InboundEmail) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionMailbox::InboundEmail).void) + ).returns(T::Array[::ActionMailbox::InboundEmail]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionMailbox::InboundEmail).void) + ).returns(::ActionMailbox::InboundEmail) + end + def create_or_find_by!(attributes, &block); end + + sig do + params( + records: T.any(::ActionMailbox::InboundEmail, Integer, String, T::Enumerable[T.any(::ActionMailbox::InboundEmail, Integer, String, T::Enumerable[::ActionMailbox::InboundEmail])]) + ).returns(Integer) + end + def delete(*records); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(args); end + + sig do + params( + records: T.any(::ActionMailbox::InboundEmail, Integer, String, T::Enumerable[T.any(::ActionMailbox::InboundEmail, Integer, String, T::Enumerable[::ActionMailbox::InboundEmail])]) + ).returns(T::Array[::ActionMailbox::InboundEmail]) + end + def destroy(*records); end + + sig { returns(T::Array[::ActionMailbox::InboundEmail]) } + def destroy_all; end + + sig { returns(T::Array[::ActionMailbox::InboundEmail]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::ActionMailbox::InboundEmail]) } + def destroy_by(args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::ActionMailbox::InboundEmail)) } + def fifth; end + + sig { returns(::ActionMailbox::InboundEmail) } + def fifth!; end + + sig do + params( + args: T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything]) + ).returns(::ActionMailbox::InboundEmail) + end + sig do + params( + args: T::Array[T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything])] + ).returns(T::Enumerable[::ActionMailbox::InboundEmail]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::ActionMailbox::InboundEmail).void + ).returns(T.nilable(::ActionMailbox::InboundEmail)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::ActionMailbox::InboundEmail)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::ActionMailbox::InboundEmail) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: ::ActionMailbox::InboundEmail).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[::ActionMailbox::InboundEmail]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: T::Array[::ActionMailbox::InboundEmail]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[T::Enumerator[::ActionMailbox::InboundEmail]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionMailbox::InboundEmail).void) + ).returns(T::Array[::ActionMailbox::InboundEmail]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionMailbox::InboundEmail).void) + ).returns(::ActionMailbox::InboundEmail) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionMailbox::InboundEmail).void) + ).returns(T::Array[::ActionMailbox::InboundEmail]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionMailbox::InboundEmail).void) + ).returns(::ActionMailbox::InboundEmail) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionMailbox::InboundEmail).void) + ).returns(T::Array[::ActionMailbox::InboundEmail]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionMailbox::InboundEmail).void) + ).returns(::ActionMailbox::InboundEmail) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::ActionMailbox::InboundEmail)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::ActionMailbox::InboundEmail) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::ActionMailbox::InboundEmail) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::ActionMailbox::InboundEmail)) } + sig { params(limit: Integer).returns(T::Array[::ActionMailbox::InboundEmail]) } + def first(limit = nil); end + + sig { returns(::ActionMailbox::InboundEmail) } + def first!; end + + sig { returns(T.nilable(::ActionMailbox::InboundEmail)) } + def forty_two; end + + sig { returns(::ActionMailbox::InboundEmail) } + def forty_two!; end + + sig { returns(T.nilable(::ActionMailbox::InboundEmail)) } + def fourth; end + + sig { returns(::ActionMailbox::InboundEmail) } + def fourth!; end + + sig { returns(Array) } + def ids; end + + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped, + block: T.proc.params(object: PrivateRelation).void + ).void + end + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped + ).returns(::ActiveRecord::Batches::BatchEnumerator) + end + def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, cursor: primary_key, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert!(attributes, returning: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert_all(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert_all!(attributes, returning: nil); end + + sig { returns(T.nilable(::ActionMailbox::InboundEmail)) } + sig { params(limit: Integer).returns(T::Array[::ActionMailbox::InboundEmail]) } + def last(limit = nil); end + + sig { returns(::ActionMailbox::InboundEmail) } + def last!; end + + sig do + params( + block: T.nilable(T.proc.params(record: ::ActionMailbox::InboundEmail).returns(T.untyped)) + ).returns(T::Boolean) + end + def many?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def maximum(column_name); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def member?(record); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def minimum(column_name); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::ActionMailbox::InboundEmail).void) + ).returns(::ActionMailbox::InboundEmail) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionMailbox::InboundEmail).void) + ).returns(T::Array[::ActionMailbox::InboundEmail]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionMailbox::InboundEmail).void) + ).returns(::ActionMailbox::InboundEmail) + end + def new(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::ActionMailbox::InboundEmail).returns(T.untyped)) + ).returns(T::Boolean) + end + def none?(&block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::ActionMailbox::InboundEmail).returns(T.untyped)) + ).returns(T::Boolean) + end + def one?(&block); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pick(*column_names); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pluck(*column_names); end + + sig { returns(T.nilable(::ActionMailbox::InboundEmail)) } + def second; end + + sig { returns(::ActionMailbox::InboundEmail) } + def second!; end + + sig { returns(T.nilable(::ActionMailbox::InboundEmail)) } + def second_to_last; end + + sig { returns(::ActionMailbox::InboundEmail) } + def second_to_last!; end + + sig { returns(::ActionMailbox::InboundEmail) } + def sole; end + + sig { params(initial_value_or_column: T.untyped).returns(T.any(Integer, Float, BigDecimal)) } + sig do + type_parameters(:U) + .params( + initial_value_or_column: T.nilable(T.type_parameter(:U)), + block: T.proc.params(object: ::ActionMailbox::InboundEmail).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::ActionMailbox::InboundEmail)) } + sig { params(limit: Integer).returns(T::Array[::ActionMailbox::InboundEmail]) } + def take(limit = nil); end + + sig { returns(::ActionMailbox::InboundEmail) } + def take!; end + + sig { returns(T.nilable(::ActionMailbox::InboundEmail)) } + def third; end + + sig { returns(::ActionMailbox::InboundEmail) } + def third!; end + + sig { returns(T.nilable(::ActionMailbox::InboundEmail)) } + def third_to_last; end + + sig { returns(::ActionMailbox::InboundEmail) } + def third_to_last!; end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert_all(attributes, returning: nil, unique_by: nil); end + end + + module EnumMethodsModule + sig { void } + def bounced!; end + + sig { returns(T::Boolean) } + def bounced?; end + + sig { void } + def delivered!; end + + sig { returns(T::Boolean) } + def delivered?; end + + sig { void } + def failed!; end + + sig { returns(T::Boolean) } + def failed?; end + + sig { void } + def pending!; end + + sig { returns(T::Boolean) } + def pending?; end + + sig { void } + def processing!; end + + sig { returns(T::Boolean) } + def processing?; end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(T.untyped) } + def build_raw_email_attachment(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.untyped) } + def build_raw_email_blob(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.untyped) } + def create_raw_email_attachment(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.untyped) } + def create_raw_email_attachment!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.untyped) } + def create_raw_email_blob(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.untyped) } + def create_raw_email_blob!(*args, &blk); end + + sig { returns(T.untyped) } + def raw_email_attachment; end + + sig { params(value: T.untyped).void } + def raw_email_attachment=(value); end + + sig { returns(T.untyped) } + def raw_email_blob; end + + sig { params(value: T.untyped).void } + def raw_email_blob=(value); end + + sig { returns(T.untyped) } + def reload_raw_email_attachment; end + + sig { returns(T.untyped) } + def reload_raw_email_blob; end + + sig { void } + def reset_raw_email_attachment; end + + sig { void } + def reset_raw_email_blob; end + end + + module GeneratedAssociationRelationMethods + sig { returns(PrivateAssociationRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def bounced(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def create_with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def delivered(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateAssociationRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def failed(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def not_bounced(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def not_delivered(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def not_failed(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def not_pending(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def not_processing(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def pending(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def processing(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + sig do + params( + blk: T.proc.params(record: ::ActionMailbox::InboundEmail).returns(BasicObject) + ).returns(T::Array[::ActionMailbox::InboundEmail]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateAssociationRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_attached_raw_email(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def without(*args, &blk); end + end + + module GeneratedRelationMethods + sig { returns(PrivateRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def bounced(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def create_with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def delivered(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def failed(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def not_bounced(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def not_delivered(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def not_failed(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def not_pending(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def not_processing(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def pending(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def processing(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + sig do + params( + blk: T.proc.params(record: ::ActionMailbox::InboundEmail).returns(BasicObject) + ).returns(T::Array[::ActionMailbox::InboundEmail]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_attached_raw_email(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::ActionMailbox::InboundEmail } } + + sig { returns(T::Array[::ActionMailbox::InboundEmail]) } + def to_a; end + + sig { returns(T::Array[::ActionMailbox::InboundEmail]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::ActionMailbox::InboundEmail } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateAssociationRelationWhereChain + Elem = type_member { { fixed: ::ActionMailbox::InboundEmail } } + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateAssociationRelation) } + def not(opts, *rest); end + end + + class PrivateCollectionProxy < ::ActiveRecord::Associations::CollectionProxy + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::ActionMailbox::InboundEmail } } + + sig do + params( + records: T.any(::ActionMailbox::InboundEmail, T::Enumerable[T.any(::ActionMailbox::InboundEmail, T::Enumerable[::ActionMailbox::InboundEmail])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::ActionMailbox::InboundEmail, T::Enumerable[T.any(::ActionMailbox::InboundEmail, T::Enumerable[::ActionMailbox::InboundEmail])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::ActionMailbox::InboundEmail, T::Enumerable[T.any(::ActionMailbox::InboundEmail, T::Enumerable[::ActionMailbox::InboundEmail])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig { returns(T::Array[::ActionMailbox::InboundEmail]) } + def load_target; end + + sig do + params( + records: T.any(::ActionMailbox::InboundEmail, T::Enumerable[T.any(::ActionMailbox::InboundEmail, T::Enumerable[::ActionMailbox::InboundEmail])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::ActionMailbox::InboundEmail, T::Enumerable[T.any(::ActionMailbox::InboundEmail, T::Enumerable[::ActionMailbox::InboundEmail])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::ActionMailbox::InboundEmail, T::Enumerable[T.any(::ActionMailbox::InboundEmail, T::Enumerable[::ActionMailbox::InboundEmail])]) + ).returns(T::Array[::ActionMailbox::InboundEmail]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::ActionMailbox::InboundEmail]) } + def target; end + + sig { returns(T::Array[::ActionMailbox::InboundEmail]) } + def to_a; end + + sig { returns(T::Array[::ActionMailbox::InboundEmail]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::ActionMailbox::InboundEmail } } + + sig { returns(T::Array[::ActionMailbox::InboundEmail]) } + def to_a; end + + sig { returns(T::Array[::ActionMailbox::InboundEmail]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::ActionMailbox::InboundEmail } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateRelationWhereChain + Elem = type_member { { fixed: ::ActionMailbox::InboundEmail } } + + sig { params(args: T.untyped).returns(PrivateRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateRelation) } + def not(opts, *rest); end + end +end diff --git a/sorbet/rbi/dsl/action_mailbox/incineration_job.rbi b/sorbet/rbi/dsl/action_mailbox/incineration_job.rbi new file mode 100644 index 0000000..48d9b0e --- /dev/null +++ b/sorbet/rbi/dsl/action_mailbox/incineration_job.rbi @@ -0,0 +1,21 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionMailbox::IncinerationJob`. +# Please instead update this file by running `bin/tapioca dsl ActionMailbox::IncinerationJob`. + + +class ActionMailbox::IncinerationJob + class << self + sig do + params( + inbound_email: T.untyped, + block: T.nilable(T.proc.params(job: ActionMailbox::IncinerationJob).void) + ).returns(T.any(ActionMailbox::IncinerationJob, FalseClass)) + end + def perform_later(inbound_email, &block); end + + sig { params(inbound_email: T.untyped).returns(T.untyped) } + def perform_now(inbound_email); end + end +end diff --git a/sorbet/rbi/dsl/action_mailbox/routing_job.rbi b/sorbet/rbi/dsl/action_mailbox/routing_job.rbi new file mode 100644 index 0000000..34b0e15 --- /dev/null +++ b/sorbet/rbi/dsl/action_mailbox/routing_job.rbi @@ -0,0 +1,21 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionMailbox::RoutingJob`. +# Please instead update this file by running `bin/tapioca dsl ActionMailbox::RoutingJob`. + + +class ActionMailbox::RoutingJob + class << self + sig do + params( + inbound_email: T.untyped, + block: T.nilable(T.proc.params(job: ActionMailbox::RoutingJob).void) + ).returns(T.any(ActionMailbox::RoutingJob, FalseClass)) + end + def perform_later(inbound_email, &block); end + + sig { params(inbound_email: T.untyped).returns(T.untyped) } + def perform_now(inbound_email); end + end +end diff --git a/sorbet/rbi/dsl/action_mailer/callbacks.rbi b/sorbet/rbi/dsl/action_mailer/callbacks.rbi new file mode 100644 index 0000000..829e1ad --- /dev/null +++ b/sorbet/rbi/dsl/action_mailer/callbacks.rbi @@ -0,0 +1,21 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionMailer::Callbacks`. +# Please instead update this file by running `bin/tapioca dsl ActionMailer::Callbacks`. + + +module ActionMailer::Callbacks + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + end + + module GeneratedInstanceMethods + def __callbacks; end + end +end diff --git a/sorbet/rbi/dsl/action_mailer/delivery_methods.rbi b/sorbet/rbi/dsl/action_mailer/delivery_methods.rbi new file mode 100644 index 0000000..a4d7c6c --- /dev/null +++ b/sorbet/rbi/dsl/action_mailer/delivery_methods.rbi @@ -0,0 +1,54 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionMailer::DeliveryMethods`. +# Please instead update this file by running `bin/tapioca dsl ActionMailer::DeliveryMethods`. + + +module ActionMailer::DeliveryMethods + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def delivery_method; end + def delivery_method=(value); end + def delivery_method?; end + def delivery_methods; end + def delivery_methods=(value); end + def delivery_methods?; end + def file_settings; end + def file_settings=(value); end + def file_settings?; end + def sendmail_settings; end + def sendmail_settings=(value); end + def sendmail_settings?; end + def smtp_settings; end + def smtp_settings=(value); end + def smtp_settings?; end + def test_settings; end + def test_settings=(value); end + def test_settings?; end + end + + module GeneratedInstanceMethods + def delivery_method; end + def delivery_method=(value); end + def delivery_method?; end + def delivery_methods; end + def delivery_methods=(value); end + def delivery_methods?; end + def file_settings; end + def file_settings=(value); end + def file_settings?; end + def sendmail_settings; end + def sendmail_settings=(value); end + def sendmail_settings?; end + def smtp_settings; end + def smtp_settings=(value); end + def smtp_settings?; end + def test_settings; end + def test_settings=(value); end + def test_settings?; end + end +end diff --git a/sorbet/rbi/dsl/action_mailer/form_builder.rbi b/sorbet/rbi/dsl/action_mailer/form_builder.rbi new file mode 100644 index 0000000..ca921d3 --- /dev/null +++ b/sorbet/rbi/dsl/action_mailer/form_builder.rbi @@ -0,0 +1,20 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionMailer::FormBuilder`. +# Please instead update this file by running `bin/tapioca dsl ActionMailer::FormBuilder`. + + +module ActionMailer::FormBuilder + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def _default_form_builder; end + def _default_form_builder=(value); end + def _default_form_builder?; end + end + + module GeneratedInstanceMethods; end +end diff --git a/sorbet/rbi/dsl/action_mailer/mail_delivery_job.rbi b/sorbet/rbi/dsl/action_mailer/mail_delivery_job.rbi new file mode 100644 index 0000000..ef86f90 --- /dev/null +++ b/sorbet/rbi/dsl/action_mailer/mail_delivery_job.rbi @@ -0,0 +1,35 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionMailer::MailDeliveryJob`. +# Please instead update this file by running `bin/tapioca dsl ActionMailer::MailDeliveryJob`. + + +class ActionMailer::MailDeliveryJob + class << self + sig do + params( + mailer: T.untyped, + mail_method: T.untyped, + delivery_method: T.untyped, + args: T.untyped, + kwargs: T.untyped, + params: T.untyped, + block: T.nilable(T.proc.params(job: ActionMailer::MailDeliveryJob).void) + ).returns(T.any(ActionMailer::MailDeliveryJob, FalseClass)) + end + def perform_later(mailer, mail_method, delivery_method, args:, kwargs: T.unsafe(nil), params: T.unsafe(nil), &block); end + + sig do + params( + mailer: T.untyped, + mail_method: T.untyped, + delivery_method: T.untyped, + args: T.untyped, + kwargs: T.untyped, + params: T.untyped + ).returns(T.untyped) + end + def perform_now(mailer, mail_method, delivery_method, args:, kwargs: T.unsafe(nil), params: T.unsafe(nil)); end + end +end diff --git a/sorbet/rbi/dsl/action_mailer/queued_delivery.rbi b/sorbet/rbi/dsl/action_mailer/queued_delivery.rbi new file mode 100644 index 0000000..a510146 --- /dev/null +++ b/sorbet/rbi/dsl/action_mailer/queued_delivery.rbi @@ -0,0 +1,30 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionMailer::QueuedDelivery`. +# Please instead update this file by running `bin/tapioca dsl ActionMailer::QueuedDelivery`. + + +module ActionMailer::QueuedDelivery + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def deliver_later_queue_name; end + def deliver_later_queue_name=(value); end + def deliver_later_queue_name?; end + def delivery_job; end + def delivery_job=(value); end + def delivery_job?; end + end + + module GeneratedInstanceMethods + def deliver_later_queue_name; end + def deliver_later_queue_name=(value); end + def deliver_later_queue_name?; end + def delivery_job; end + def delivery_job=(value); end + def delivery_job?; end + end +end diff --git a/sorbet/rbi/dsl/action_mailer/rescuable.rbi b/sorbet/rbi/dsl/action_mailer/rescuable.rbi new file mode 100644 index 0000000..5bd7ad4 --- /dev/null +++ b/sorbet/rbi/dsl/action_mailer/rescuable.rbi @@ -0,0 +1,25 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionMailer::Rescuable`. +# Please instead update this file by running `bin/tapioca dsl ActionMailer::Rescuable`. + + +module ActionMailer::Rescuable + include GeneratedInstanceMethods + + mixes_in_class_methods ::ActiveSupport::Rescuable::ClassMethods + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def rescue_handlers; end + def rescue_handlers=(value); end + def rescue_handlers?; end + end + + module GeneratedInstanceMethods + def rescue_handlers; end + def rescue_handlers=(value); end + def rescue_handlers?; end + end +end diff --git a/sorbet/rbi/dsl/action_mailer/test_case/behavior.rbi b/sorbet/rbi/dsl/action_mailer/test_case/behavior.rbi new file mode 100644 index 0000000..cab5a04 --- /dev/null +++ b/sorbet/rbi/dsl/action_mailer/test_case/behavior.rbi @@ -0,0 +1,25 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionMailer::TestCase::Behavior`. +# Please instead update this file by running `bin/tapioca dsl ActionMailer::TestCase::Behavior`. + + +module ActionMailer::TestCase::Behavior + include GeneratedInstanceMethods + + mixes_in_class_methods ::ActiveSupport::Testing::ConstantLookup::ClassMethods + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def _mailer_class; end + def _mailer_class=(value); end + def _mailer_class?; end + end + + module GeneratedInstanceMethods + def _mailer_class; end + def _mailer_class=(value); end + def _mailer_class?; end + end +end diff --git a/sorbet/rbi/dsl/action_text/encrypted_rich_text.rbi b/sorbet/rbi/dsl/action_text/encrypted_rich_text.rbi new file mode 100644 index 0000000..83eb844 --- /dev/null +++ b/sorbet/rbi/dsl/action_text/encrypted_rich_text.rbi @@ -0,0 +1,1052 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionText::EncryptedRichText`. +# Please instead update this file by running `bin/tapioca dsl ActionText::EncryptedRichText`. + + +class ActionText::EncryptedRichText + include GeneratedAssociationMethods + extend CommonRelationMethods + extend GeneratedRelationMethods + + sig { returns(ActiveStorage::Attached::Many) } + def embeds; end + + sig { params(attachable: T.untyped).returns(T.untyped) } + def embeds=(attachable); end + + private + + sig { returns(NilClass) } + def to_ary; end + + class << self + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionText::EncryptedRichText).void) + ).returns(::ActionText::EncryptedRichText) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig do + params( + block: T.nilable(T.proc.params(record: ::ActionText::EncryptedRichText).returns(T.untyped)) + ).returns(T::Boolean) + end + def any?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def average(column_name); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::ActionText::EncryptedRichText).void) + ).returns(::ActionText::EncryptedRichText) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionText::EncryptedRichText).void) + ).returns(T::Array[::ActionText::EncryptedRichText]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionText::EncryptedRichText).void) + ).returns(::ActionText::EncryptedRichText) + end + def build(attributes = nil, &block); end + + sig { params(operation: Symbol, column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def calculate(operation, column_name); end + + sig { params(column_name: T.nilable(T.any(String, Symbol))).returns(Integer) } + sig do + params( + column_name: NilClass, + block: T.proc.params(object: ::ActionText::EncryptedRichText).void + ).returns(Integer) + end + def count(column_name = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::ActionText::EncryptedRichText).void) + ).returns(::ActionText::EncryptedRichText) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionText::EncryptedRichText).void) + ).returns(T::Array[::ActionText::EncryptedRichText]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionText::EncryptedRichText).void) + ).returns(::ActionText::EncryptedRichText) + end + def create(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::ActionText::EncryptedRichText).void) + ).returns(::ActionText::EncryptedRichText) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionText::EncryptedRichText).void) + ).returns(T::Array[::ActionText::EncryptedRichText]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionText::EncryptedRichText).void) + ).returns(::ActionText::EncryptedRichText) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionText::EncryptedRichText).void) + ).returns(T::Array[::ActionText::EncryptedRichText]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionText::EncryptedRichText).void) + ).returns(::ActionText::EncryptedRichText) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionText::EncryptedRichText).void) + ).returns(T::Array[::ActionText::EncryptedRichText]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionText::EncryptedRichText).void) + ).returns(::ActionText::EncryptedRichText) + end + def create_or_find_by!(attributes, &block); end + + sig do + params( + records: T.any(::ActionText::EncryptedRichText, Integer, String, T::Enumerable[T.any(::ActionText::EncryptedRichText, Integer, String, T::Enumerable[::ActionText::EncryptedRichText])]) + ).returns(Integer) + end + def delete(*records); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(args); end + + sig do + params( + records: T.any(::ActionText::EncryptedRichText, Integer, String, T::Enumerable[T.any(::ActionText::EncryptedRichText, Integer, String, T::Enumerable[::ActionText::EncryptedRichText])]) + ).returns(T::Array[::ActionText::EncryptedRichText]) + end + def destroy(*records); end + + sig { returns(T::Array[::ActionText::EncryptedRichText]) } + def destroy_all; end + + sig { returns(T::Array[::ActionText::EncryptedRichText]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::ActionText::EncryptedRichText]) } + def destroy_by(args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::ActionText::EncryptedRichText)) } + def fifth; end + + sig { returns(::ActionText::EncryptedRichText) } + def fifth!; end + + sig do + params( + args: T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything]) + ).returns(::ActionText::EncryptedRichText) + end + sig do + params( + args: T::Array[T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything])] + ).returns(T::Enumerable[::ActionText::EncryptedRichText]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::ActionText::EncryptedRichText).void + ).returns(T.nilable(::ActionText::EncryptedRichText)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::ActionText::EncryptedRichText)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::ActionText::EncryptedRichText) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: ::ActionText::EncryptedRichText).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[::ActionText::EncryptedRichText]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: T::Array[::ActionText::EncryptedRichText]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[T::Enumerator[::ActionText::EncryptedRichText]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionText::EncryptedRichText).void) + ).returns(T::Array[::ActionText::EncryptedRichText]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionText::EncryptedRichText).void) + ).returns(::ActionText::EncryptedRichText) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionText::EncryptedRichText).void) + ).returns(T::Array[::ActionText::EncryptedRichText]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionText::EncryptedRichText).void) + ).returns(::ActionText::EncryptedRichText) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionText::EncryptedRichText).void) + ).returns(T::Array[::ActionText::EncryptedRichText]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionText::EncryptedRichText).void) + ).returns(::ActionText::EncryptedRichText) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::ActionText::EncryptedRichText)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::ActionText::EncryptedRichText) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::ActionText::EncryptedRichText) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::ActionText::EncryptedRichText)) } + sig { params(limit: Integer).returns(T::Array[::ActionText::EncryptedRichText]) } + def first(limit = nil); end + + sig { returns(::ActionText::EncryptedRichText) } + def first!; end + + sig { returns(T.nilable(::ActionText::EncryptedRichText)) } + def forty_two; end + + sig { returns(::ActionText::EncryptedRichText) } + def forty_two!; end + + sig { returns(T.nilable(::ActionText::EncryptedRichText)) } + def fourth; end + + sig { returns(::ActionText::EncryptedRichText) } + def fourth!; end + + sig { returns(Array) } + def ids; end + + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped, + block: T.proc.params(object: PrivateRelation).void + ).void + end + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped + ).returns(::ActiveRecord::Batches::BatchEnumerator) + end + def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, cursor: primary_key, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert!(attributes, returning: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert_all(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert_all!(attributes, returning: nil); end + + sig { returns(T.nilable(::ActionText::EncryptedRichText)) } + sig { params(limit: Integer).returns(T::Array[::ActionText::EncryptedRichText]) } + def last(limit = nil); end + + sig { returns(::ActionText::EncryptedRichText) } + def last!; end + + sig do + params( + block: T.nilable(T.proc.params(record: ::ActionText::EncryptedRichText).returns(T.untyped)) + ).returns(T::Boolean) + end + def many?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def maximum(column_name); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def member?(record); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def minimum(column_name); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::ActionText::EncryptedRichText).void) + ).returns(::ActionText::EncryptedRichText) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionText::EncryptedRichText).void) + ).returns(T::Array[::ActionText::EncryptedRichText]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionText::EncryptedRichText).void) + ).returns(::ActionText::EncryptedRichText) + end + def new(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::ActionText::EncryptedRichText).returns(T.untyped)) + ).returns(T::Boolean) + end + def none?(&block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::ActionText::EncryptedRichText).returns(T.untyped)) + ).returns(T::Boolean) + end + def one?(&block); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pick(*column_names); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pluck(*column_names); end + + sig { returns(T.nilable(::ActionText::EncryptedRichText)) } + def second; end + + sig { returns(::ActionText::EncryptedRichText) } + def second!; end + + sig { returns(T.nilable(::ActionText::EncryptedRichText)) } + def second_to_last; end + + sig { returns(::ActionText::EncryptedRichText) } + def second_to_last!; end + + sig { returns(::ActionText::EncryptedRichText) } + def sole; end + + sig { params(initial_value_or_column: T.untyped).returns(T.any(Integer, Float, BigDecimal)) } + sig do + type_parameters(:U) + .params( + initial_value_or_column: T.nilable(T.type_parameter(:U)), + block: T.proc.params(object: ::ActionText::EncryptedRichText).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::ActionText::EncryptedRichText)) } + sig { params(limit: Integer).returns(T::Array[::ActionText::EncryptedRichText]) } + def take(limit = nil); end + + sig { returns(::ActionText::EncryptedRichText) } + def take!; end + + sig { returns(T.nilable(::ActionText::EncryptedRichText)) } + def third; end + + sig { returns(::ActionText::EncryptedRichText) } + def third!; end + + sig { returns(T.nilable(::ActionText::EncryptedRichText)) } + def third_to_last; end + + sig { returns(::ActionText::EncryptedRichText) } + def third_to_last!; end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert_all(attributes, returning: nil, unique_by: nil); end + end + + module GeneratedAssociationMethods + sig { returns(T::Array[T.untyped]) } + def embeds_attachment_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def embeds_attachment_ids=(ids); end + + # This method is created by ActiveRecord on the `ActionText::RichText` class because it declared `has_many :embeds_attachments`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(ActiveRecord::Associations::CollectionProxy) } + def embeds_attachments; end + + sig { params(value: T::Enumerable[T.untyped]).void } + def embeds_attachments=(value); end + + sig { returns(T::Array[T.untyped]) } + def embeds_blob_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def embeds_blob_ids=(ids); end + + # This method is created by ActiveRecord on the `ActionText::RichText` class because it declared `has_many :embeds_blobs, through: :embeds_attachments`. + # 🔗 [Rails guide for `has_many_through` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-through-association) + sig { returns(ActiveRecord::Associations::CollectionProxy) } + def embeds_blobs; end + + sig { params(value: T::Enumerable[T.untyped]).void } + def embeds_blobs=(value); end + + sig { returns(T.untyped) } + def record; end + + sig { params(value: T.untyped).void } + def record=(value); end + + sig { returns(T.untyped) } + def reload_record; end + + sig { void } + def reset_record; end + end + + module GeneratedAssociationRelationMethods + sig { returns(PrivateAssociationRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateAssociationRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + sig do + params( + blk: T.proc.params(record: ::ActionText::EncryptedRichText).returns(BasicObject) + ).returns(T::Array[::ActionText::EncryptedRichText]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateAssociationRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_attached_embeds(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def without(*args, &blk); end + end + + module GeneratedRelationMethods + sig { returns(PrivateRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + sig do + params( + blk: T.proc.params(record: ::ActionText::EncryptedRichText).returns(BasicObject) + ).returns(T::Array[::ActionText::EncryptedRichText]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_attached_embeds(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::ActionText::EncryptedRichText } } + + sig { returns(T::Array[::ActionText::EncryptedRichText]) } + def to_a; end + + sig { returns(T::Array[::ActionText::EncryptedRichText]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::ActionText::EncryptedRichText } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateAssociationRelationWhereChain + Elem = type_member { { fixed: ::ActionText::EncryptedRichText } } + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateAssociationRelation) } + def not(opts, *rest); end + end + + class PrivateCollectionProxy < ::ActiveRecord::Associations::CollectionProxy + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::ActionText::EncryptedRichText } } + + sig do + params( + records: T.any(::ActionText::EncryptedRichText, T::Enumerable[T.any(::ActionText::EncryptedRichText, T::Enumerable[::ActionText::EncryptedRichText])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::ActionText::EncryptedRichText, T::Enumerable[T.any(::ActionText::EncryptedRichText, T::Enumerable[::ActionText::EncryptedRichText])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::ActionText::EncryptedRichText, T::Enumerable[T.any(::ActionText::EncryptedRichText, T::Enumerable[::ActionText::EncryptedRichText])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig { returns(T::Array[::ActionText::EncryptedRichText]) } + def load_target; end + + sig do + params( + records: T.any(::ActionText::EncryptedRichText, T::Enumerable[T.any(::ActionText::EncryptedRichText, T::Enumerable[::ActionText::EncryptedRichText])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::ActionText::EncryptedRichText, T::Enumerable[T.any(::ActionText::EncryptedRichText, T::Enumerable[::ActionText::EncryptedRichText])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::ActionText::EncryptedRichText, T::Enumerable[T.any(::ActionText::EncryptedRichText, T::Enumerable[::ActionText::EncryptedRichText])]) + ).returns(T::Array[::ActionText::EncryptedRichText]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::ActionText::EncryptedRichText]) } + def target; end + + sig { returns(T::Array[::ActionText::EncryptedRichText]) } + def to_a; end + + sig { returns(T::Array[::ActionText::EncryptedRichText]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::ActionText::EncryptedRichText } } + + sig { returns(T::Array[::ActionText::EncryptedRichText]) } + def to_a; end + + sig { returns(T::Array[::ActionText::EncryptedRichText]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::ActionText::EncryptedRichText } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateRelationWhereChain + Elem = type_member { { fixed: ::ActionText::EncryptedRichText } } + + sig { params(args: T.untyped).returns(PrivateRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateRelation) } + def not(opts, *rest); end + end +end diff --git a/sorbet/rbi/dsl/action_text/rich_text.rbi b/sorbet/rbi/dsl/action_text/rich_text.rbi new file mode 100644 index 0000000..4b8bb02 --- /dev/null +++ b/sorbet/rbi/dsl/action_text/rich_text.rbi @@ -0,0 +1,1053 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionText::RichText`. +# Please instead update this file by running `bin/tapioca dsl ActionText::RichText`. + + +class ActionText::RichText + include GeneratedAssociationMethods + extend CommonRelationMethods + extend GeneratedRelationMethods + + sig { returns(ActiveStorage::Attached::Many) } + def embeds; end + + sig { params(attachable: T.untyped).returns(T.untyped) } + def embeds=(attachable); end + + private + + sig { returns(NilClass) } + def to_ary; end + + class << self + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionText::RichText).void) + ).returns(::ActionText::RichText) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig do + params( + block: T.nilable(T.proc.params(record: ::ActionText::RichText).returns(T.untyped)) + ).returns(T::Boolean) + end + def any?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def average(column_name); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::ActionText::RichText).void) + ).returns(::ActionText::RichText) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionText::RichText).void) + ).returns(T::Array[::ActionText::RichText]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionText::RichText).void) + ).returns(::ActionText::RichText) + end + def build(attributes = nil, &block); end + + sig { params(operation: Symbol, column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def calculate(operation, column_name); end + + sig { params(column_name: T.nilable(T.any(String, Symbol))).returns(Integer) } + sig { params(column_name: NilClass, block: T.proc.params(object: ::ActionText::RichText).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::ActionText::RichText).void) + ).returns(::ActionText::RichText) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionText::RichText).void) + ).returns(T::Array[::ActionText::RichText]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionText::RichText).void) + ).returns(::ActionText::RichText) + end + def create(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::ActionText::RichText).void) + ).returns(::ActionText::RichText) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionText::RichText).void) + ).returns(T::Array[::ActionText::RichText]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionText::RichText).void) + ).returns(::ActionText::RichText) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionText::RichText).void) + ).returns(T::Array[::ActionText::RichText]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionText::RichText).void) + ).returns(::ActionText::RichText) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionText::RichText).void) + ).returns(T::Array[::ActionText::RichText]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionText::RichText).void) + ).returns(::ActionText::RichText) + end + def create_or_find_by!(attributes, &block); end + + sig do + params( + records: T.any(::ActionText::RichText, Integer, String, T::Enumerable[T.any(::ActionText::RichText, Integer, String, T::Enumerable[::ActionText::RichText])]) + ).returns(Integer) + end + def delete(*records); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(args); end + + sig do + params( + records: T.any(::ActionText::RichText, Integer, String, T::Enumerable[T.any(::ActionText::RichText, Integer, String, T::Enumerable[::ActionText::RichText])]) + ).returns(T::Array[::ActionText::RichText]) + end + def destroy(*records); end + + sig { returns(T::Array[::ActionText::RichText]) } + def destroy_all; end + + sig { returns(T::Array[::ActionText::RichText]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::ActionText::RichText]) } + def destroy_by(args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::ActionText::RichText)) } + def fifth; end + + sig { returns(::ActionText::RichText) } + def fifth!; end + + sig do + params( + args: T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything]) + ).returns(::ActionText::RichText) + end + sig do + params( + args: T::Array[T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything])] + ).returns(T::Enumerable[::ActionText::RichText]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::ActionText::RichText).void + ).returns(T.nilable(::ActionText::RichText)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::ActionText::RichText)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::ActionText::RichText) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: ::ActionText::RichText).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[::ActionText::RichText]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: T::Array[::ActionText::RichText]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[T::Enumerator[::ActionText::RichText]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionText::RichText).void) + ).returns(T::Array[::ActionText::RichText]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionText::RichText).void) + ).returns(::ActionText::RichText) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionText::RichText).void) + ).returns(T::Array[::ActionText::RichText]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionText::RichText).void) + ).returns(::ActionText::RichText) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionText::RichText).void) + ).returns(T::Array[::ActionText::RichText]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionText::RichText).void) + ).returns(::ActionText::RichText) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::ActionText::RichText)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::ActionText::RichText) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::ActionText::RichText) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::ActionText::RichText)) } + sig { params(limit: Integer).returns(T::Array[::ActionText::RichText]) } + def first(limit = nil); end + + sig { returns(::ActionText::RichText) } + def first!; end + + sig { returns(T.nilable(::ActionText::RichText)) } + def forty_two; end + + sig { returns(::ActionText::RichText) } + def forty_two!; end + + sig { returns(T.nilable(::ActionText::RichText)) } + def fourth; end + + sig { returns(::ActionText::RichText) } + def fourth!; end + + sig { returns(Array) } + def ids; end + + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped, + block: T.proc.params(object: PrivateRelation).void + ).void + end + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped + ).returns(::ActiveRecord::Batches::BatchEnumerator) + end + def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, cursor: primary_key, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert!(attributes, returning: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert_all(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert_all!(attributes, returning: nil); end + + sig { returns(T.nilable(::ActionText::RichText)) } + sig { params(limit: Integer).returns(T::Array[::ActionText::RichText]) } + def last(limit = nil); end + + sig { returns(::ActionText::RichText) } + def last!; end + + sig do + params( + block: T.nilable(T.proc.params(record: ::ActionText::RichText).returns(T.untyped)) + ).returns(T::Boolean) + end + def many?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def maximum(column_name); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def member?(record); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def minimum(column_name); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::ActionText::RichText).void) + ).returns(::ActionText::RichText) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionText::RichText).void) + ).returns(T::Array[::ActionText::RichText]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionText::RichText).void) + ).returns(::ActionText::RichText) + end + def new(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::ActionText::RichText).returns(T.untyped)) + ).returns(T::Boolean) + end + def none?(&block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::ActionText::RichText).returns(T.untyped)) + ).returns(T::Boolean) + end + def one?(&block); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pick(*column_names); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pluck(*column_names); end + + sig { returns(T.nilable(::ActionText::RichText)) } + def second; end + + sig { returns(::ActionText::RichText) } + def second!; end + + sig { returns(T.nilable(::ActionText::RichText)) } + def second_to_last; end + + sig { returns(::ActionText::RichText) } + def second_to_last!; end + + sig { returns(::ActionText::RichText) } + def sole; end + + sig { params(initial_value_or_column: T.untyped).returns(T.any(Integer, Float, BigDecimal)) } + sig do + type_parameters(:U) + .params( + initial_value_or_column: T.nilable(T.type_parameter(:U)), + block: T.proc.params(object: ::ActionText::RichText).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::ActionText::RichText)) } + sig { params(limit: Integer).returns(T::Array[::ActionText::RichText]) } + def take(limit = nil); end + + sig { returns(::ActionText::RichText) } + def take!; end + + sig { returns(T.nilable(::ActionText::RichText)) } + def third; end + + sig { returns(::ActionText::RichText) } + def third!; end + + sig { returns(T.nilable(::ActionText::RichText)) } + def third_to_last; end + + sig { returns(::ActionText::RichText) } + def third_to_last!; end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert_all(attributes, returning: nil, unique_by: nil); end + end + + module GeneratedAssociationMethods + sig { returns(T::Array[T.untyped]) } + def embeds_attachment_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def embeds_attachment_ids=(ids); end + + # This method is created by ActiveRecord on the `ActionText::RichText` class because it declared `has_many :embeds_attachments`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(ActiveRecord::Associations::CollectionProxy) } + def embeds_attachments; end + + sig { params(value: T::Enumerable[T.untyped]).void } + def embeds_attachments=(value); end + + sig { returns(T::Array[T.untyped]) } + def embeds_blob_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def embeds_blob_ids=(ids); end + + # This method is created by ActiveRecord on the `ActionText::RichText` class because it declared `has_many :embeds_blobs, through: :embeds_attachments`. + # 🔗 [Rails guide for `has_many_through` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-through-association) + sig { returns(ActiveRecord::Associations::CollectionProxy) } + def embeds_blobs; end + + sig { params(value: T::Enumerable[T.untyped]).void } + def embeds_blobs=(value); end + + sig { returns(T.untyped) } + def record; end + + sig { params(value: T.untyped).void } + def record=(value); end + + sig { returns(T::Boolean) } + def record_changed?; end + + sig { returns(T::Boolean) } + def record_previously_changed?; end + + sig { returns(T.untyped) } + def reload_record; end + + sig { void } + def reset_record; end + end + + module GeneratedAssociationRelationMethods + sig { returns(PrivateAssociationRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateAssociationRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + sig do + params( + blk: T.proc.params(record: ::ActionText::RichText).returns(BasicObject) + ).returns(T::Array[::ActionText::RichText]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateAssociationRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_attached_embeds(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def without(*args, &blk); end + end + + module GeneratedRelationMethods + sig { returns(PrivateRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + sig do + params( + blk: T.proc.params(record: ::ActionText::RichText).returns(BasicObject) + ).returns(T::Array[::ActionText::RichText]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_attached_embeds(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::ActionText::RichText } } + + sig { returns(T::Array[::ActionText::RichText]) } + def to_a; end + + sig { returns(T::Array[::ActionText::RichText]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::ActionText::RichText } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateAssociationRelationWhereChain + Elem = type_member { { fixed: ::ActionText::RichText } } + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateAssociationRelation) } + def not(opts, *rest); end + end + + class PrivateCollectionProxy < ::ActiveRecord::Associations::CollectionProxy + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::ActionText::RichText } } + + sig do + params( + records: T.any(::ActionText::RichText, T::Enumerable[T.any(::ActionText::RichText, T::Enumerable[::ActionText::RichText])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::ActionText::RichText, T::Enumerable[T.any(::ActionText::RichText, T::Enumerable[::ActionText::RichText])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::ActionText::RichText, T::Enumerable[T.any(::ActionText::RichText, T::Enumerable[::ActionText::RichText])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig { returns(T::Array[::ActionText::RichText]) } + def load_target; end + + sig do + params( + records: T.any(::ActionText::RichText, T::Enumerable[T.any(::ActionText::RichText, T::Enumerable[::ActionText::RichText])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::ActionText::RichText, T::Enumerable[T.any(::ActionText::RichText, T::Enumerable[::ActionText::RichText])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::ActionText::RichText, T::Enumerable[T.any(::ActionText::RichText, T::Enumerable[::ActionText::RichText])]) + ).returns(T::Array[::ActionText::RichText]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::ActionText::RichText]) } + def target; end + + sig { returns(T::Array[::ActionText::RichText]) } + def to_a; end + + sig { returns(T::Array[::ActionText::RichText]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::ActionText::RichText } } + + sig { returns(T::Array[::ActionText::RichText]) } + def to_a; end + + sig { returns(T::Array[::ActionText::RichText]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::ActionText::RichText } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateRelationWhereChain + Elem = type_member { { fixed: ::ActionText::RichText } } + + sig { params(args: T.untyped).returns(PrivateRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateRelation) } + def not(opts, *rest); end + end +end diff --git a/sorbet/rbi/dsl/action_view/helpers.rbi b/sorbet/rbi/dsl/action_view/helpers.rbi new file mode 100644 index 0000000..efa2fd8 --- /dev/null +++ b/sorbet/rbi/dsl/action_view/helpers.rbi @@ -0,0 +1,14 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionView::Helpers`. +# Please instead update this file by running `bin/tapioca dsl ActionView::Helpers`. + + +module ActionView::Helpers + include GeneratedUrlHelpersModule + include GeneratedPathHelpersModule + + mixes_in_class_methods ::ActionView::Helpers::UrlHelper::ClassMethods + mixes_in_class_methods ::ActionView::Helpers::SanitizeHelper::ClassMethods +end diff --git a/sorbet/rbi/dsl/action_view/helpers/form_helper.rbi b/sorbet/rbi/dsl/action_view/helpers/form_helper.rbi new file mode 100644 index 0000000..10a330a --- /dev/null +++ b/sorbet/rbi/dsl/action_view/helpers/form_helper.rbi @@ -0,0 +1,11 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionView::Helpers::FormHelper`. +# Please instead update this file by running `bin/tapioca dsl ActionView::Helpers::FormHelper`. + + +module ActionView::Helpers::FormHelper + mixes_in_class_methods ::ActionView::Helpers::UrlHelper::ClassMethods + mixes_in_class_methods ::ActionView::Helpers::SanitizeHelper::ClassMethods +end diff --git a/sorbet/rbi/dsl/action_view/helpers/form_tag_helper.rbi b/sorbet/rbi/dsl/action_view/helpers/form_tag_helper.rbi new file mode 100644 index 0000000..ca1d562 --- /dev/null +++ b/sorbet/rbi/dsl/action_view/helpers/form_tag_helper.rbi @@ -0,0 +1,11 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionView::Helpers::FormTagHelper`. +# Please instead update this file by running `bin/tapioca dsl ActionView::Helpers::FormTagHelper`. + + +module ActionView::Helpers::FormTagHelper + mixes_in_class_methods ::ActionView::Helpers::UrlHelper::ClassMethods + mixes_in_class_methods ::ActionView::Helpers::SanitizeHelper::ClassMethods +end diff --git a/sorbet/rbi/dsl/action_view/helpers/text_helper.rbi b/sorbet/rbi/dsl/action_view/helpers/text_helper.rbi new file mode 100644 index 0000000..733cb5f --- /dev/null +++ b/sorbet/rbi/dsl/action_view/helpers/text_helper.rbi @@ -0,0 +1,10 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionView::Helpers::TextHelper`. +# Please instead update this file by running `bin/tapioca dsl ActionView::Helpers::TextHelper`. + + +module ActionView::Helpers::TextHelper + mixes_in_class_methods ::ActionView::Helpers::SanitizeHelper::ClassMethods +end diff --git a/sorbet/rbi/dsl/action_view/layouts.rbi b/sorbet/rbi/dsl/action_view/layouts.rbi new file mode 100644 index 0000000..4f1bd8e --- /dev/null +++ b/sorbet/rbi/dsl/action_view/layouts.rbi @@ -0,0 +1,28 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionView::Layouts`. +# Please instead update this file by running `bin/tapioca dsl ActionView::Layouts`. + + +module ActionView::Layouts + include GeneratedInstanceMethods + + mixes_in_class_methods ::ActionView::ViewPaths::ClassMethods + mixes_in_class_methods ::ActionView::Rendering::ClassMethods + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def _layout; end + def _layout=(value); end + def _layout?; end + def _layout_conditions; end + def _layout_conditions=(value); end + def _layout_conditions?; end + end + + module GeneratedInstanceMethods + def _layout_conditions; end + def _layout_conditions?; end + end +end diff --git a/sorbet/rbi/dsl/action_view/rendering.rbi b/sorbet/rbi/dsl/action_view/rendering.rbi new file mode 100644 index 0000000..52ac489 --- /dev/null +++ b/sorbet/rbi/dsl/action_view/rendering.rbi @@ -0,0 +1,10 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionView::Rendering`. +# Please instead update this file by running `bin/tapioca dsl ActionView::Rendering`. + + +module ActionView::Rendering + mixes_in_class_methods ::ActionView::ViewPaths::ClassMethods +end diff --git a/sorbet/rbi/dsl/active_job/callbacks.rbi b/sorbet/rbi/dsl/active_job/callbacks.rbi new file mode 100644 index 0000000..281a3bf --- /dev/null +++ b/sorbet/rbi/dsl/active_job/callbacks.rbi @@ -0,0 +1,22 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveJob::Callbacks`. +# Please instead update this file by running `bin/tapioca dsl ActiveJob::Callbacks`. + + +module ActiveJob::Callbacks + include GeneratedInstanceMethods + + mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + end + + module GeneratedInstanceMethods + def __callbacks; end + end +end diff --git a/sorbet/rbi/dsl/active_job/concurrency_controls.rbi b/sorbet/rbi/dsl/active_job/concurrency_controls.rbi new file mode 100644 index 0000000..b39baab --- /dev/null +++ b/sorbet/rbi/dsl/active_job/concurrency_controls.rbi @@ -0,0 +1,42 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveJob::ConcurrencyControls`. +# Please instead update this file by running `bin/tapioca dsl ActiveJob::ConcurrencyControls`. + + +module ActiveJob::ConcurrencyControls + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def concurrency_duration; end + def concurrency_duration=(value); end + def concurrency_duration?; end + def concurrency_group; end + def concurrency_group=(value); end + def concurrency_group?; end + def concurrency_key; end + def concurrency_key=(value); end + def concurrency_key?; end + def concurrency_limit; end + def concurrency_limit=(value); end + def concurrency_limit?; end + def concurrency_on_conflict; end + def concurrency_on_conflict=(value); end + def concurrency_on_conflict?; end + end + + module GeneratedInstanceMethods + def concurrency_duration; end + def concurrency_duration=(value); end + def concurrency_duration?; end + def concurrency_limit; end + def concurrency_limit=(value); end + def concurrency_limit?; end + def concurrency_on_conflict; end + def concurrency_on_conflict=(value); end + def concurrency_on_conflict?; end + end +end diff --git a/sorbet/rbi/dsl/active_job/enqueuing.rbi b/sorbet/rbi/dsl/active_job/enqueuing.rbi new file mode 100644 index 0000000..a55a52e --- /dev/null +++ b/sorbet/rbi/dsl/active_job/enqueuing.rbi @@ -0,0 +1,19 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveJob::Enqueuing`. +# Please instead update this file by running `bin/tapioca dsl ActiveJob::Enqueuing`. + + +module ActiveJob::Enqueuing + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def enqueue_after_transaction_commit; end + def enqueue_after_transaction_commit=(value); end + end + + module GeneratedInstanceMethods; end +end diff --git a/sorbet/rbi/dsl/active_job/exceptions.rbi b/sorbet/rbi/dsl/active_job/exceptions.rbi new file mode 100644 index 0000000..f1c1f6c --- /dev/null +++ b/sorbet/rbi/dsl/active_job/exceptions.rbi @@ -0,0 +1,26 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveJob::Exceptions`. +# Please instead update this file by running `bin/tapioca dsl ActiveJob::Exceptions`. + + +module ActiveJob::Exceptions + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def after_discard_procs; end + def after_discard_procs=(value); end + def after_discard_procs?; end + def retry_jitter; end + def retry_jitter=(value); end + end + + module GeneratedInstanceMethods + def after_discard_procs; end + def after_discard_procs=(value); end + def after_discard_procs?; end + end +end diff --git a/sorbet/rbi/dsl/active_job/execution.rbi b/sorbet/rbi/dsl/active_job/execution.rbi new file mode 100644 index 0000000..7fa4a61 --- /dev/null +++ b/sorbet/rbi/dsl/active_job/execution.rbi @@ -0,0 +1,25 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveJob::Execution`. +# Please instead update this file by running `bin/tapioca dsl ActiveJob::Execution`. + + +module ActiveJob::Execution + include GeneratedInstanceMethods + + mixes_in_class_methods ::ActiveSupport::Rescuable::ClassMethods + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def rescue_handlers; end + def rescue_handlers=(value); end + def rescue_handlers?; end + end + + module GeneratedInstanceMethods + def rescue_handlers; end + def rescue_handlers=(value); end + def rescue_handlers?; end + end +end diff --git a/sorbet/rbi/dsl/active_job/logging.rbi b/sorbet/rbi/dsl/active_job/logging.rbi new file mode 100644 index 0000000..d375911 --- /dev/null +++ b/sorbet/rbi/dsl/active_job/logging.rbi @@ -0,0 +1,20 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveJob::Logging`. +# Please instead update this file by running `bin/tapioca dsl ActiveJob::Logging`. + + +module ActiveJob::Logging + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def log_arguments; end + def log_arguments=(value); end + def log_arguments?; end + end + + module GeneratedInstanceMethods; end +end diff --git a/sorbet/rbi/dsl/active_job/queue_adapter.rbi b/sorbet/rbi/dsl/active_job/queue_adapter.rbi new file mode 100644 index 0000000..7d7053a --- /dev/null +++ b/sorbet/rbi/dsl/active_job/queue_adapter.rbi @@ -0,0 +1,21 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveJob::QueueAdapter`. +# Please instead update this file by running `bin/tapioca dsl ActiveJob::QueueAdapter`. + + +module ActiveJob::QueueAdapter + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def _queue_adapter; end + def _queue_adapter=(value); end + def _queue_adapter_name; end + def _queue_adapter_name=(value); end + end + + module GeneratedInstanceMethods; end +end diff --git a/sorbet/rbi/dsl/active_job/queue_name.rbi b/sorbet/rbi/dsl/active_job/queue_name.rbi new file mode 100644 index 0000000..e728614 --- /dev/null +++ b/sorbet/rbi/dsl/active_job/queue_name.rbi @@ -0,0 +1,30 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveJob::QueueName`. +# Please instead update this file by running `bin/tapioca dsl ActiveJob::QueueName`. + + +module ActiveJob::QueueName + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def queue_name; end + def queue_name=(value); end + def queue_name?; end + def queue_name_delimiter; end + def queue_name_delimiter=(value); end + def queue_name_delimiter?; end + def queue_name_prefix; end + def queue_name_prefix=(value); end + def queue_name_prefix?; end + end + + module GeneratedInstanceMethods + def queue_name_prefix; end + def queue_name_prefix=(value); end + def queue_name_prefix?; end + end +end diff --git a/sorbet/rbi/dsl/active_job/queue_priority.rbi b/sorbet/rbi/dsl/active_job/queue_priority.rbi new file mode 100644 index 0000000..ec03184 --- /dev/null +++ b/sorbet/rbi/dsl/active_job/queue_priority.rbi @@ -0,0 +1,20 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveJob::QueuePriority`. +# Please instead update this file by running `bin/tapioca dsl ActiveJob::QueuePriority`. + + +module ActiveJob::QueuePriority + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def priority; end + def priority=(value); end + def priority?; end + end + + module GeneratedInstanceMethods; end +end diff --git a/sorbet/rbi/dsl/active_job/test_helper/test_queue_adapter.rbi b/sorbet/rbi/dsl/active_job/test_helper/test_queue_adapter.rbi new file mode 100644 index 0000000..8539af1 --- /dev/null +++ b/sorbet/rbi/dsl/active_job/test_helper/test_queue_adapter.rbi @@ -0,0 +1,19 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveJob::TestHelper::TestQueueAdapter`. +# Please instead update this file by running `bin/tapioca dsl ActiveJob::TestHelper::TestQueueAdapter`. + + +module ActiveJob::TestHelper::TestQueueAdapter + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def _test_adapter; end + def _test_adapter=(value); end + end + + module GeneratedInstanceMethods; end +end diff --git a/sorbet/rbi/dsl/active_model/api.rbi b/sorbet/rbi/dsl/active_model/api.rbi new file mode 100644 index 0000000..1f1608c --- /dev/null +++ b/sorbet/rbi/dsl/active_model/api.rbi @@ -0,0 +1,32 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveModel::API`. +# Please instead update this file by running `bin/tapioca dsl ActiveModel::API`. + + +module ActiveModel::API + include GeneratedInstanceMethods + + mixes_in_class_methods ::ActiveModel::Validations::ClassMethods + mixes_in_class_methods ::ActiveModel::Conversion::ClassMethods + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + def _validators; end + def _validators=(value); end + def _validators?; end + def param_delimiter; end + def param_delimiter=(value); end + def param_delimiter?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + def _validators; end + def _validators?; end + def param_delimiter=(value); end + end +end diff --git a/sorbet/rbi/dsl/active_model/attribute_methods.rbi b/sorbet/rbi/dsl/active_model/attribute_methods.rbi new file mode 100644 index 0000000..8e58d7b --- /dev/null +++ b/sorbet/rbi/dsl/active_model/attribute_methods.rbi @@ -0,0 +1,28 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveModel::AttributeMethods`. +# Please instead update this file by running `bin/tapioca dsl ActiveModel::AttributeMethods`. + + +module ActiveModel::AttributeMethods + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def attribute_aliases; end + def attribute_aliases=(value); end + def attribute_aliases?; end + def attribute_method_patterns; end + def attribute_method_patterns=(value); end + def attribute_method_patterns?; end + end + + module GeneratedInstanceMethods + def attribute_aliases; end + def attribute_aliases?; end + def attribute_method_patterns; end + def attribute_method_patterns?; end + end +end diff --git a/sorbet/rbi/dsl/active_model/attributes.rbi b/sorbet/rbi/dsl/active_model/attributes.rbi new file mode 100644 index 0000000..d300cb5 --- /dev/null +++ b/sorbet/rbi/dsl/active_model/attributes.rbi @@ -0,0 +1,30 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveModel::Attributes`. +# Please instead update this file by running `bin/tapioca dsl ActiveModel::Attributes`. + + +module ActiveModel::Attributes + include GeneratedInstanceMethods + + mixes_in_class_methods ::ActiveModel::AttributeRegistration::ClassMethods + mixes_in_class_methods ::ActiveModel::AttributeMethods::ClassMethods + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def attribute_aliases; end + def attribute_aliases=(value); end + def attribute_aliases?; end + def attribute_method_patterns; end + def attribute_method_patterns=(value); end + def attribute_method_patterns?; end + end + + module GeneratedInstanceMethods + def attribute_aliases; end + def attribute_aliases?; end + def attribute_method_patterns; end + def attribute_method_patterns?; end + end +end diff --git a/sorbet/rbi/dsl/active_model/attributes/normalization.rbi b/sorbet/rbi/dsl/active_model/attributes/normalization.rbi new file mode 100644 index 0000000..4d7dadc --- /dev/null +++ b/sorbet/rbi/dsl/active_model/attributes/normalization.rbi @@ -0,0 +1,37 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveModel::Attributes::Normalization`. +# Please instead update this file by running `bin/tapioca dsl ActiveModel::Attributes::Normalization`. + + +module ActiveModel::Attributes::Normalization + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + def attribute_aliases; end + def attribute_aliases=(value); end + def attribute_aliases?; end + def attribute_method_patterns; end + def attribute_method_patterns=(value); end + def attribute_method_patterns?; end + def normalized_attributes; end + def normalized_attributes=(value); end + def normalized_attributes?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + def attribute_aliases; end + def attribute_aliases?; end + def attribute_method_patterns; end + def attribute_method_patterns?; end + def normalized_attributes; end + def normalized_attributes=(value); end + def normalized_attributes?; end + end +end diff --git a/sorbet/rbi/dsl/active_model/conversion.rbi b/sorbet/rbi/dsl/active_model/conversion.rbi new file mode 100644 index 0000000..9289cdd --- /dev/null +++ b/sorbet/rbi/dsl/active_model/conversion.rbi @@ -0,0 +1,22 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveModel::Conversion`. +# Please instead update this file by running `bin/tapioca dsl ActiveModel::Conversion`. + + +module ActiveModel::Conversion + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def param_delimiter; end + def param_delimiter=(value); end + def param_delimiter?; end + end + + module GeneratedInstanceMethods + def param_delimiter=(value); end + end +end diff --git a/sorbet/rbi/dsl/active_model/dirty.rbi b/sorbet/rbi/dsl/active_model/dirty.rbi new file mode 100644 index 0000000..7eb00d3 --- /dev/null +++ b/sorbet/rbi/dsl/active_model/dirty.rbi @@ -0,0 +1,29 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveModel::Dirty`. +# Please instead update this file by running `bin/tapioca dsl ActiveModel::Dirty`. + + +module ActiveModel::Dirty + include GeneratedInstanceMethods + + mixes_in_class_methods ::ActiveModel::AttributeMethods::ClassMethods + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def attribute_aliases; end + def attribute_aliases=(value); end + def attribute_aliases?; end + def attribute_method_patterns; end + def attribute_method_patterns=(value); end + def attribute_method_patterns?; end + end + + module GeneratedInstanceMethods + def attribute_aliases; end + def attribute_aliases?; end + def attribute_method_patterns; end + def attribute_method_patterns?; end + end +end diff --git a/sorbet/rbi/dsl/active_model/model.rbi b/sorbet/rbi/dsl/active_model/model.rbi new file mode 100644 index 0000000..52bee74 --- /dev/null +++ b/sorbet/rbi/dsl/active_model/model.rbi @@ -0,0 +1,32 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveModel::Model`. +# Please instead update this file by running `bin/tapioca dsl ActiveModel::Model`. + + +module ActiveModel::Model + include GeneratedInstanceMethods + + mixes_in_class_methods ::ActiveModel::Validations::ClassMethods + mixes_in_class_methods ::ActiveModel::Conversion::ClassMethods + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + def _validators; end + def _validators=(value); end + def _validators?; end + def param_delimiter; end + def param_delimiter=(value); end + def param_delimiter?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + def _validators; end + def _validators?; end + def param_delimiter=(value); end + end +end diff --git a/sorbet/rbi/dsl/active_model/serializers/json.rbi b/sorbet/rbi/dsl/active_model/serializers/json.rbi new file mode 100644 index 0000000..ab70ce9 --- /dev/null +++ b/sorbet/rbi/dsl/active_model/serializers/json.rbi @@ -0,0 +1,23 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveModel::Serializers::JSON`. +# Please instead update this file by running `bin/tapioca dsl ActiveModel::Serializers::JSON`. + + +module ActiveModel::Serializers::JSON + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def include_root_in_json; end + def include_root_in_json=(value); end + def include_root_in_json?; end + end + + module GeneratedInstanceMethods + def include_root_in_json; end + def include_root_in_json?; end + end +end diff --git a/sorbet/rbi/dsl/active_model/validations.rbi b/sorbet/rbi/dsl/active_model/validations.rbi new file mode 100644 index 0000000..38b2a27 --- /dev/null +++ b/sorbet/rbi/dsl/active_model/validations.rbi @@ -0,0 +1,26 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveModel::Validations`. +# Please instead update this file by running `bin/tapioca dsl ActiveModel::Validations`. + + +module ActiveModel::Validations + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + def _validators; end + def _validators=(value); end + def _validators?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + def _validators; end + def _validators?; end + end +end diff --git a/sorbet/rbi/dsl/active_model/validations/callbacks.rbi b/sorbet/rbi/dsl/active_model/validations/callbacks.rbi new file mode 100644 index 0000000..16e3701 --- /dev/null +++ b/sorbet/rbi/dsl/active_model/validations/callbacks.rbi @@ -0,0 +1,21 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveModel::Validations::Callbacks`. +# Please instead update this file by running `bin/tapioca dsl ActiveModel::Validations::Callbacks`. + + +module ActiveModel::Validations::Callbacks + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + end + + module GeneratedInstanceMethods + def __callbacks; end + end +end diff --git a/sorbet/rbi/dsl/active_record/attribute_methods.rbi b/sorbet/rbi/dsl/active_record/attribute_methods.rbi new file mode 100644 index 0000000..d65dd43 --- /dev/null +++ b/sorbet/rbi/dsl/active_record/attribute_methods.rbi @@ -0,0 +1,57 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveRecord::AttributeMethods`. +# Please instead update this file by running `bin/tapioca dsl ActiveRecord::AttributeMethods`. + + +module ActiveRecord::AttributeMethods + include GeneratedInstanceMethods + + mixes_in_class_methods ::ActiveModel::AttributeMethods::ClassMethods + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def attribute_aliases; end + def attribute_aliases=(value); end + def attribute_aliases?; end + def attribute_method_patterns; end + def attribute_method_patterns=(value); end + def attribute_method_patterns?; end + def default_column_serializer; end + def default_column_serializer=(value); end + def default_column_serializer?; end + def partial_inserts; end + def partial_inserts=(value); end + def partial_inserts?; end + def partial_updates; end + def partial_updates=(value); end + def partial_updates?; end + def skip_time_zone_conversion_for_attributes; end + def skip_time_zone_conversion_for_attributes=(value); end + def skip_time_zone_conversion_for_attributes?; end + def time_zone_aware_attributes; end + def time_zone_aware_attributes=(value); end + def time_zone_aware_attributes?; end + def time_zone_aware_types; end + def time_zone_aware_types=(value); end + def time_zone_aware_types?; end + end + + module GeneratedInstanceMethods + def attribute_aliases; end + def attribute_aliases?; end + def attribute_method_patterns; end + def attribute_method_patterns?; end + def partial_inserts; end + def partial_inserts?; end + def partial_updates; end + def partial_updates?; end + def skip_time_zone_conversion_for_attributes; end + def skip_time_zone_conversion_for_attributes?; end + def time_zone_aware_attributes; end + def time_zone_aware_attributes?; end + def time_zone_aware_types; end + def time_zone_aware_types?; end + end +end diff --git a/sorbet/rbi/dsl/active_record/attribute_methods/dirty.rbi b/sorbet/rbi/dsl/active_record/attribute_methods/dirty.rbi new file mode 100644 index 0000000..516acdb --- /dev/null +++ b/sorbet/rbi/dsl/active_record/attribute_methods/dirty.rbi @@ -0,0 +1,39 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveRecord::AttributeMethods::Dirty`. +# Please instead update this file by running `bin/tapioca dsl ActiveRecord::AttributeMethods::Dirty`. + + +module ActiveRecord::AttributeMethods::Dirty + include GeneratedInstanceMethods + + mixes_in_class_methods ::ActiveModel::AttributeMethods::ClassMethods + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def attribute_aliases; end + def attribute_aliases=(value); end + def attribute_aliases?; end + def attribute_method_patterns; end + def attribute_method_patterns=(value); end + def attribute_method_patterns?; end + def partial_inserts; end + def partial_inserts=(value); end + def partial_inserts?; end + def partial_updates; end + def partial_updates=(value); end + def partial_updates?; end + end + + module GeneratedInstanceMethods + def attribute_aliases; end + def attribute_aliases?; end + def attribute_method_patterns; end + def attribute_method_patterns?; end + def partial_inserts; end + def partial_inserts?; end + def partial_updates; end + def partial_updates?; end + end +end diff --git a/sorbet/rbi/dsl/active_record/attribute_methods/serialization.rbi b/sorbet/rbi/dsl/active_record/attribute_methods/serialization.rbi new file mode 100644 index 0000000..9d06e27 --- /dev/null +++ b/sorbet/rbi/dsl/active_record/attribute_methods/serialization.rbi @@ -0,0 +1,20 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveRecord::AttributeMethods::Serialization`. +# Please instead update this file by running `bin/tapioca dsl ActiveRecord::AttributeMethods::Serialization`. + + +module ActiveRecord::AttributeMethods::Serialization + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def default_column_serializer; end + def default_column_serializer=(value); end + def default_column_serializer?; end + end + + module GeneratedInstanceMethods; end +end diff --git a/sorbet/rbi/dsl/active_record/attribute_methods/time_zone_conversion.rbi b/sorbet/rbi/dsl/active_record/attribute_methods/time_zone_conversion.rbi new file mode 100644 index 0000000..be40114 --- /dev/null +++ b/sorbet/rbi/dsl/active_record/attribute_methods/time_zone_conversion.rbi @@ -0,0 +1,33 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveRecord::AttributeMethods::TimeZoneConversion`. +# Please instead update this file by running `bin/tapioca dsl ActiveRecord::AttributeMethods::TimeZoneConversion`. + + +module ActiveRecord::AttributeMethods::TimeZoneConversion + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def skip_time_zone_conversion_for_attributes; end + def skip_time_zone_conversion_for_attributes=(value); end + def skip_time_zone_conversion_for_attributes?; end + def time_zone_aware_attributes; end + def time_zone_aware_attributes=(value); end + def time_zone_aware_attributes?; end + def time_zone_aware_types; end + def time_zone_aware_types=(value); end + def time_zone_aware_types?; end + end + + module GeneratedInstanceMethods + def skip_time_zone_conversion_for_attributes; end + def skip_time_zone_conversion_for_attributes?; end + def time_zone_aware_attributes; end + def time_zone_aware_attributes?; end + def time_zone_aware_types; end + def time_zone_aware_types?; end + end +end diff --git a/sorbet/rbi/dsl/active_record/attributes.rbi b/sorbet/rbi/dsl/active_record/attributes.rbi new file mode 100644 index 0000000..ebf3a4f --- /dev/null +++ b/sorbet/rbi/dsl/active_record/attributes.rbi @@ -0,0 +1,39 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveRecord::Attributes`. +# Please instead update this file by running `bin/tapioca dsl ActiveRecord::Attributes`. + + +module ActiveRecord::Attributes + include GeneratedInstanceMethods + + mixes_in_class_methods ::ActiveModel::AttributeRegistration::ClassMethods + mixes_in_class_methods ::ActiveModel::Attributes::Normalization::ClassMethods + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + def attribute_aliases; end + def attribute_aliases=(value); end + def attribute_aliases?; end + def attribute_method_patterns; end + def attribute_method_patterns=(value); end + def attribute_method_patterns?; end + def normalized_attributes; end + def normalized_attributes=(value); end + def normalized_attributes?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + def attribute_aliases; end + def attribute_aliases?; end + def attribute_method_patterns; end + def attribute_method_patterns?; end + def normalized_attributes; end + def normalized_attributes=(value); end + def normalized_attributes?; end + end +end diff --git a/sorbet/rbi/dsl/active_record/callbacks.rbi b/sorbet/rbi/dsl/active_record/callbacks.rbi new file mode 100644 index 0000000..76e4574 --- /dev/null +++ b/sorbet/rbi/dsl/active_record/callbacks.rbi @@ -0,0 +1,21 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveRecord::Callbacks`. +# Please instead update this file by running `bin/tapioca dsl ActiveRecord::Callbacks`. + + +module ActiveRecord::Callbacks + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + end + + module GeneratedInstanceMethods + def __callbacks; end + end +end diff --git a/sorbet/rbi/dsl/active_record/core.rbi b/sorbet/rbi/dsl/active_record/core.rbi new file mode 100644 index 0000000..b31cc1c --- /dev/null +++ b/sorbet/rbi/dsl/active_record/core.rbi @@ -0,0 +1,68 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveRecord::Core`. +# Please instead update this file by running `bin/tapioca dsl ActiveRecord::Core`. + + +module ActiveRecord::Core + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def _destroy_association_async_job; end + def _destroy_association_async_job=(value); end + def _destroy_association_async_job?; end + def attributes_for_inspect; end + def attributes_for_inspect=(value); end + def attributes_for_inspect?; end + def belongs_to_required_by_default; end + def belongs_to_required_by_default=(value); end + def belongs_to_required_by_default?; end + def default_connection_handler; end + def default_connection_handler=(value); end + def default_connection_handler?; end + def default_role; end + def default_role=(value); end + def default_role?; end + def default_shard; end + def default_shard=(value); end + def default_shard?; end + def destroy_association_async_batch_size; end + def destroy_association_async_batch_size=(value); end + def enumerate_columns_in_select_statements; end + def enumerate_columns_in_select_statements=(value); end + def enumerate_columns_in_select_statements?; end + def has_many_inversing; end + def has_many_inversing=(value); end + def has_many_inversing?; end + def logger; end + def logger=(value); end + def logger?; end + def run_commit_callbacks_on_first_saved_instances_in_transaction; end + def run_commit_callbacks_on_first_saved_instances_in_transaction=(value); end + def run_commit_callbacks_on_first_saved_instances_in_transaction?; end + def shard_selector; end + def shard_selector=(value); end + def shard_selector?; end + def strict_loading_by_default; end + def strict_loading_by_default=(value); end + def strict_loading_by_default?; end + def strict_loading_mode; end + def strict_loading_mode=(value); end + def strict_loading_mode?; end + end + + module GeneratedInstanceMethods + def default_connection_handler; end + def default_connection_handler?; end + def default_role; end + def default_role?; end + def default_shard; end + def default_shard?; end + def destroy_association_async_batch_size; end + def logger; end + def logger?; end + end +end diff --git a/sorbet/rbi/dsl/active_record/counter_cache.rbi b/sorbet/rbi/dsl/active_record/counter_cache.rbi new file mode 100644 index 0000000..9aff98e --- /dev/null +++ b/sorbet/rbi/dsl/active_record/counter_cache.rbi @@ -0,0 +1,26 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveRecord::CounterCache`. +# Please instead update this file by running `bin/tapioca dsl ActiveRecord::CounterCache`. + + +module ActiveRecord::CounterCache + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def _counter_cache_columns; end + def _counter_cache_columns=(value); end + def _counter_cache_columns?; end + def counter_cached_association_names; end + def counter_cached_association_names=(value); end + def counter_cached_association_names?; end + end + + module GeneratedInstanceMethods + def counter_cached_association_names; end + def counter_cached_association_names?; end + end +end diff --git a/sorbet/rbi/dsl/active_record/encryption/encryptable_record.rbi b/sorbet/rbi/dsl/active_record/encryption/encryptable_record.rbi new file mode 100644 index 0000000..73b5a46 --- /dev/null +++ b/sorbet/rbi/dsl/active_record/encryption/encryptable_record.rbi @@ -0,0 +1,24 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveRecord::Encryption::EncryptableRecord`. +# Please instead update this file by running `bin/tapioca dsl ActiveRecord::Encryption::EncryptableRecord`. + + +module ActiveRecord::Encryption::EncryptableRecord + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def encrypted_attributes; end + def encrypted_attributes=(value); end + def encrypted_attributes?; end + end + + module GeneratedInstanceMethods + def encrypted_attributes; end + def encrypted_attributes=(value); end + def encrypted_attributes?; end + end +end diff --git a/sorbet/rbi/dsl/active_record/inheritance.rbi b/sorbet/rbi/dsl/active_record/inheritance.rbi new file mode 100644 index 0000000..53130bd --- /dev/null +++ b/sorbet/rbi/dsl/active_record/inheritance.rbi @@ -0,0 +1,28 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveRecord::Inheritance`. +# Please instead update this file by running `bin/tapioca dsl ActiveRecord::Inheritance`. + + +module ActiveRecord::Inheritance + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def store_full_class_name; end + def store_full_class_name=(value); end + def store_full_class_name?; end + def store_full_sti_class; end + def store_full_sti_class=(value); end + def store_full_sti_class?; end + end + + module GeneratedInstanceMethods + def store_full_class_name; end + def store_full_class_name?; end + def store_full_sti_class; end + def store_full_sti_class?; end + end +end diff --git a/sorbet/rbi/dsl/active_record/integration.rbi b/sorbet/rbi/dsl/active_record/integration.rbi new file mode 100644 index 0000000..6fc6d69 --- /dev/null +++ b/sorbet/rbi/dsl/active_record/integration.rbi @@ -0,0 +1,33 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveRecord::Integration`. +# Please instead update this file by running `bin/tapioca dsl ActiveRecord::Integration`. + + +module ActiveRecord::Integration + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def cache_timestamp_format; end + def cache_timestamp_format=(value); end + def cache_timestamp_format?; end + def cache_versioning; end + def cache_versioning=(value); end + def cache_versioning?; end + def collection_cache_versioning; end + def collection_cache_versioning=(value); end + def collection_cache_versioning?; end + end + + module GeneratedInstanceMethods + def cache_timestamp_format; end + def cache_timestamp_format?; end + def cache_versioning; end + def cache_versioning?; end + def collection_cache_versioning; end + def collection_cache_versioning?; end + end +end diff --git a/sorbet/rbi/dsl/active_record/locking/optimistic.rbi b/sorbet/rbi/dsl/active_record/locking/optimistic.rbi new file mode 100644 index 0000000..99efc8b --- /dev/null +++ b/sorbet/rbi/dsl/active_record/locking/optimistic.rbi @@ -0,0 +1,23 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveRecord::Locking::Optimistic`. +# Please instead update this file by running `bin/tapioca dsl ActiveRecord::Locking::Optimistic`. + + +module ActiveRecord::Locking::Optimistic + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def lock_optimistically; end + def lock_optimistically=(value); end + def lock_optimistically?; end + end + + module GeneratedInstanceMethods + def lock_optimistically; end + def lock_optimistically?; end + end +end diff --git a/sorbet/rbi/dsl/active_record/model_schema.rbi b/sorbet/rbi/dsl/active_record/model_schema.rbi new file mode 100644 index 0000000..85bd9da --- /dev/null +++ b/sorbet/rbi/dsl/active_record/model_schema.rbi @@ -0,0 +1,53 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveRecord::ModelSchema`. +# Please instead update this file by running `bin/tapioca dsl ActiveRecord::ModelSchema`. + + +module ActiveRecord::ModelSchema + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def immutable_strings_by_default; end + def immutable_strings_by_default=(value); end + def immutable_strings_by_default?; end + def implicit_order_column; end + def implicit_order_column=(value); end + def implicit_order_column?; end + def inheritance_column; end + def inheritance_column=(value); end + def inheritance_column?; end + def internal_metadata_table_name; end + def internal_metadata_table_name=(value); end + def internal_metadata_table_name?; end + def pluralize_table_names; end + def pluralize_table_names=(value); end + def pluralize_table_names?; end + def primary_key_prefix_type; end + def primary_key_prefix_type=(value); end + def primary_key_prefix_type?; end + def schema_migrations_table_name; end + def schema_migrations_table_name=(value); end + def schema_migrations_table_name?; end + def table_name_prefix; end + def table_name_prefix=(value); end + def table_name_prefix?; end + def table_name_suffix; end + def table_name_suffix=(value); end + def table_name_suffix?; end + end + + module GeneratedInstanceMethods + def pluralize_table_names; end + def pluralize_table_names?; end + def primary_key_prefix_type; end + def primary_key_prefix_type?; end + def table_name_prefix; end + def table_name_prefix?; end + def table_name_suffix; end + def table_name_suffix?; end + end +end diff --git a/sorbet/rbi/dsl/active_record/nested_attributes.rbi b/sorbet/rbi/dsl/active_record/nested_attributes.rbi new file mode 100644 index 0000000..6bbad79 --- /dev/null +++ b/sorbet/rbi/dsl/active_record/nested_attributes.rbi @@ -0,0 +1,23 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveRecord::NestedAttributes`. +# Please instead update this file by running `bin/tapioca dsl ActiveRecord::NestedAttributes`. + + +module ActiveRecord::NestedAttributes + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def nested_attributes_options; end + def nested_attributes_options=(value); end + def nested_attributes_options?; end + end + + module GeneratedInstanceMethods + def nested_attributes_options; end + def nested_attributes_options?; end + end +end diff --git a/sorbet/rbi/dsl/active_record/readonly_attributes.rbi b/sorbet/rbi/dsl/active_record/readonly_attributes.rbi new file mode 100644 index 0000000..c6477f5 --- /dev/null +++ b/sorbet/rbi/dsl/active_record/readonly_attributes.rbi @@ -0,0 +1,20 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveRecord::ReadonlyAttributes`. +# Please instead update this file by running `bin/tapioca dsl ActiveRecord::ReadonlyAttributes`. + + +module ActiveRecord::ReadonlyAttributes + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def _attr_readonly; end + def _attr_readonly=(value); end + def _attr_readonly?; end + end + + module GeneratedInstanceMethods; end +end diff --git a/sorbet/rbi/dsl/active_record/reflection.rbi b/sorbet/rbi/dsl/active_record/reflection.rbi new file mode 100644 index 0000000..8328dd4 --- /dev/null +++ b/sorbet/rbi/dsl/active_record/reflection.rbi @@ -0,0 +1,38 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveRecord::Reflection`. +# Please instead update this file by running `bin/tapioca dsl ActiveRecord::Reflection`. + + +module ActiveRecord::Reflection + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def _reflections; end + def _reflections=(value); end + def _reflections?; end + def aggregate_reflections; end + def aggregate_reflections=(value); end + def aggregate_reflections?; end + def automatic_scope_inversing; end + def automatic_scope_inversing=(value); end + def automatic_scope_inversing?; end + def automatically_invert_plural_associations; end + def automatically_invert_plural_associations=(value); end + def automatically_invert_plural_associations?; end + end + + module GeneratedInstanceMethods + def _reflections; end + def _reflections?; end + def aggregate_reflections; end + def aggregate_reflections?; end + def automatic_scope_inversing; end + def automatic_scope_inversing?; end + def automatically_invert_plural_associations; end + def automatically_invert_plural_associations?; end + end +end diff --git a/sorbet/rbi/dsl/active_record/scoping.rbi b/sorbet/rbi/dsl/active_record/scoping.rbi new file mode 100644 index 0000000..229070b --- /dev/null +++ b/sorbet/rbi/dsl/active_record/scoping.rbi @@ -0,0 +1,24 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveRecord::Scoping`. +# Please instead update this file by running `bin/tapioca dsl ActiveRecord::Scoping`. + + +module ActiveRecord::Scoping + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def default_scope_override; end + def default_scope_override=(value); end + def default_scopes; end + def default_scopes=(value); end + end + + module GeneratedInstanceMethods + def default_scope_override; end + def default_scopes; end + end +end diff --git a/sorbet/rbi/dsl/active_record/scoping/default.rbi b/sorbet/rbi/dsl/active_record/scoping/default.rbi new file mode 100644 index 0000000..28518b0 --- /dev/null +++ b/sorbet/rbi/dsl/active_record/scoping/default.rbi @@ -0,0 +1,24 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveRecord::Scoping::Default`. +# Please instead update this file by running `bin/tapioca dsl ActiveRecord::Scoping::Default`. + + +module ActiveRecord::Scoping::Default + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def default_scope_override; end + def default_scope_override=(value); end + def default_scopes; end + def default_scopes=(value); end + end + + module GeneratedInstanceMethods + def default_scope_override; end + def default_scopes; end + end +end diff --git a/sorbet/rbi/dsl/active_record/secure_password.rbi b/sorbet/rbi/dsl/active_record/secure_password.rbi new file mode 100644 index 0000000..6c06f86 --- /dev/null +++ b/sorbet/rbi/dsl/active_record/secure_password.rbi @@ -0,0 +1,10 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveRecord::SecurePassword`. +# Please instead update this file by running `bin/tapioca dsl ActiveRecord::SecurePassword`. + + +module ActiveRecord::SecurePassword + mixes_in_class_methods ::ActiveModel::SecurePassword::ClassMethods +end diff --git a/sorbet/rbi/dsl/active_record/serialization.rbi b/sorbet/rbi/dsl/active_record/serialization.rbi new file mode 100644 index 0000000..59b5278 --- /dev/null +++ b/sorbet/rbi/dsl/active_record/serialization.rbi @@ -0,0 +1,23 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveRecord::Serialization`. +# Please instead update this file by running `bin/tapioca dsl ActiveRecord::Serialization`. + + +module ActiveRecord::Serialization + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def include_root_in_json; end + def include_root_in_json=(value); end + def include_root_in_json?; end + end + + module GeneratedInstanceMethods + def include_root_in_json; end + def include_root_in_json?; end + end +end diff --git a/sorbet/rbi/dsl/active_record/signed_id.rbi b/sorbet/rbi/dsl/active_record/signed_id.rbi new file mode 100644 index 0000000..fce073e --- /dev/null +++ b/sorbet/rbi/dsl/active_record/signed_id.rbi @@ -0,0 +1,25 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveRecord::SignedId`. +# Please instead update this file by running `bin/tapioca dsl ActiveRecord::SignedId`. + + +module ActiveRecord::SignedId + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def _signed_id_verifier; end + def _signed_id_verifier=(value); end + def signed_id_verifier_secret; end + def signed_id_verifier_secret=(value); end + def signed_id_verifier_secret?; end + end + + module GeneratedInstanceMethods + def signed_id_verifier_secret; end + def signed_id_verifier_secret?; end + end +end diff --git a/sorbet/rbi/dsl/active_record/timestamp.rbi b/sorbet/rbi/dsl/active_record/timestamp.rbi new file mode 100644 index 0000000..31ee319 --- /dev/null +++ b/sorbet/rbi/dsl/active_record/timestamp.rbi @@ -0,0 +1,24 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveRecord::Timestamp`. +# Please instead update this file by running `bin/tapioca dsl ActiveRecord::Timestamp`. + + +module ActiveRecord::Timestamp + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def record_timestamps; end + def record_timestamps=(value); end + def record_timestamps?; end + end + + module GeneratedInstanceMethods + def record_timestamps; end + def record_timestamps=(value); end + def record_timestamps?; end + end +end diff --git a/sorbet/rbi/dsl/active_record/token_for.rbi b/sorbet/rbi/dsl/active_record/token_for.rbi new file mode 100644 index 0000000..4e1eec6 --- /dev/null +++ b/sorbet/rbi/dsl/active_record/token_for.rbi @@ -0,0 +1,21 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveRecord::TokenFor`. +# Please instead update this file by running `bin/tapioca dsl ActiveRecord::TokenFor`. + + +module ActiveRecord::TokenFor + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def generated_token_verifier; end + def generated_token_verifier=(value); end + def token_definitions; end + def token_definitions=(value); end + end + + module GeneratedInstanceMethods; end +end diff --git a/sorbet/rbi/dsl/active_storage/analyze_job.rbi b/sorbet/rbi/dsl/active_storage/analyze_job.rbi new file mode 100644 index 0000000..7b48068 --- /dev/null +++ b/sorbet/rbi/dsl/active_storage/analyze_job.rbi @@ -0,0 +1,21 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveStorage::AnalyzeJob`. +# Please instead update this file by running `bin/tapioca dsl ActiveStorage::AnalyzeJob`. + + +class ActiveStorage::AnalyzeJob + class << self + sig do + params( + blob: T.untyped, + block: T.nilable(T.proc.params(job: ActiveStorage::AnalyzeJob).void) + ).returns(T.any(ActiveStorage::AnalyzeJob, FalseClass)) + end + def perform_later(blob, &block); end + + sig { params(blob: T.untyped).returns(T.untyped) } + def perform_now(blob); end + end +end diff --git a/sorbet/rbi/dsl/active_storage/attachment.rbi b/sorbet/rbi/dsl/active_storage/attachment.rbi new file mode 100644 index 0000000..945a33d --- /dev/null +++ b/sorbet/rbi/dsl/active_storage/attachment.rbi @@ -0,0 +1,1051 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveStorage::Attachment`. +# Please instead update this file by running `bin/tapioca dsl ActiveStorage::Attachment`. + + +class ActiveStorage::Attachment + include GeneratedAssociationMethods + extend CommonRelationMethods + extend GeneratedRelationMethods + + private + + sig { returns(NilClass) } + def to_ary; end + + class << self + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveStorage::Attachment).void) + ).returns(::ActiveStorage::Attachment) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig do + params( + block: T.nilable(T.proc.params(record: ::ActiveStorage::Attachment).returns(T.untyped)) + ).returns(T::Boolean) + end + def any?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def average(column_name); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::ActiveStorage::Attachment).void) + ).returns(::ActiveStorage::Attachment) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveStorage::Attachment).void) + ).returns(T::Array[::ActiveStorage::Attachment]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveStorage::Attachment).void) + ).returns(::ActiveStorage::Attachment) + end + def build(attributes = nil, &block); end + + sig { params(operation: Symbol, column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def calculate(operation, column_name); end + + sig { params(column_name: T.nilable(T.any(String, Symbol))).returns(Integer) } + sig do + params( + column_name: NilClass, + block: T.proc.params(object: ::ActiveStorage::Attachment).void + ).returns(Integer) + end + def count(column_name = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::ActiveStorage::Attachment).void) + ).returns(::ActiveStorage::Attachment) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveStorage::Attachment).void) + ).returns(T::Array[::ActiveStorage::Attachment]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveStorage::Attachment).void) + ).returns(::ActiveStorage::Attachment) + end + def create(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::ActiveStorage::Attachment).void) + ).returns(::ActiveStorage::Attachment) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveStorage::Attachment).void) + ).returns(T::Array[::ActiveStorage::Attachment]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveStorage::Attachment).void) + ).returns(::ActiveStorage::Attachment) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveStorage::Attachment).void) + ).returns(T::Array[::ActiveStorage::Attachment]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveStorage::Attachment).void) + ).returns(::ActiveStorage::Attachment) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveStorage::Attachment).void) + ).returns(T::Array[::ActiveStorage::Attachment]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveStorage::Attachment).void) + ).returns(::ActiveStorage::Attachment) + end + def create_or_find_by!(attributes, &block); end + + sig do + params( + records: T.any(::ActiveStorage::Attachment, Integer, String, T::Enumerable[T.any(::ActiveStorage::Attachment, Integer, String, T::Enumerable[::ActiveStorage::Attachment])]) + ).returns(Integer) + end + def delete(*records); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(args); end + + sig do + params( + records: T.any(::ActiveStorage::Attachment, Integer, String, T::Enumerable[T.any(::ActiveStorage::Attachment, Integer, String, T::Enumerable[::ActiveStorage::Attachment])]) + ).returns(T::Array[::ActiveStorage::Attachment]) + end + def destroy(*records); end + + sig { returns(T::Array[::ActiveStorage::Attachment]) } + def destroy_all; end + + sig { returns(T::Array[::ActiveStorage::Attachment]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::ActiveStorage::Attachment]) } + def destroy_by(args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::ActiveStorage::Attachment)) } + def fifth; end + + sig { returns(::ActiveStorage::Attachment) } + def fifth!; end + + sig do + params( + args: T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything]) + ).returns(::ActiveStorage::Attachment) + end + sig do + params( + args: T::Array[T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything])] + ).returns(T::Enumerable[::ActiveStorage::Attachment]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::ActiveStorage::Attachment).void + ).returns(T.nilable(::ActiveStorage::Attachment)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::ActiveStorage::Attachment)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::ActiveStorage::Attachment) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: ::ActiveStorage::Attachment).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[::ActiveStorage::Attachment]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: T::Array[::ActiveStorage::Attachment]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[T::Enumerator[::ActiveStorage::Attachment]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveStorage::Attachment).void) + ).returns(T::Array[::ActiveStorage::Attachment]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveStorage::Attachment).void) + ).returns(::ActiveStorage::Attachment) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveStorage::Attachment).void) + ).returns(T::Array[::ActiveStorage::Attachment]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveStorage::Attachment).void) + ).returns(::ActiveStorage::Attachment) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveStorage::Attachment).void) + ).returns(T::Array[::ActiveStorage::Attachment]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveStorage::Attachment).void) + ).returns(::ActiveStorage::Attachment) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::ActiveStorage::Attachment)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::ActiveStorage::Attachment) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::ActiveStorage::Attachment) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::ActiveStorage::Attachment)) } + sig { params(limit: Integer).returns(T::Array[::ActiveStorage::Attachment]) } + def first(limit = nil); end + + sig { returns(::ActiveStorage::Attachment) } + def first!; end + + sig { returns(T.nilable(::ActiveStorage::Attachment)) } + def forty_two; end + + sig { returns(::ActiveStorage::Attachment) } + def forty_two!; end + + sig { returns(T.nilable(::ActiveStorage::Attachment)) } + def fourth; end + + sig { returns(::ActiveStorage::Attachment) } + def fourth!; end + + sig { returns(Array) } + def ids; end + + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped, + block: T.proc.params(object: PrivateRelation).void + ).void + end + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped + ).returns(::ActiveRecord::Batches::BatchEnumerator) + end + def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, cursor: primary_key, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert!(attributes, returning: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert_all(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert_all!(attributes, returning: nil); end + + sig { returns(T.nilable(::ActiveStorage::Attachment)) } + sig { params(limit: Integer).returns(T::Array[::ActiveStorage::Attachment]) } + def last(limit = nil); end + + sig { returns(::ActiveStorage::Attachment) } + def last!; end + + sig do + params( + block: T.nilable(T.proc.params(record: ::ActiveStorage::Attachment).returns(T.untyped)) + ).returns(T::Boolean) + end + def many?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def maximum(column_name); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def member?(record); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def minimum(column_name); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::ActiveStorage::Attachment).void) + ).returns(::ActiveStorage::Attachment) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveStorage::Attachment).void) + ).returns(T::Array[::ActiveStorage::Attachment]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveStorage::Attachment).void) + ).returns(::ActiveStorage::Attachment) + end + def new(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::ActiveStorage::Attachment).returns(T.untyped)) + ).returns(T::Boolean) + end + def none?(&block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::ActiveStorage::Attachment).returns(T.untyped)) + ).returns(T::Boolean) + end + def one?(&block); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pick(*column_names); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pluck(*column_names); end + + sig { returns(T.nilable(::ActiveStorage::Attachment)) } + def second; end + + sig { returns(::ActiveStorage::Attachment) } + def second!; end + + sig { returns(T.nilable(::ActiveStorage::Attachment)) } + def second_to_last; end + + sig { returns(::ActiveStorage::Attachment) } + def second_to_last!; end + + sig { returns(::ActiveStorage::Attachment) } + def sole; end + + sig { params(initial_value_or_column: T.untyped).returns(T.any(Integer, Float, BigDecimal)) } + sig do + type_parameters(:U) + .params( + initial_value_or_column: T.nilable(T.type_parameter(:U)), + block: T.proc.params(object: ::ActiveStorage::Attachment).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::ActiveStorage::Attachment)) } + sig { params(limit: Integer).returns(T::Array[::ActiveStorage::Attachment]) } + def take(limit = nil); end + + sig { returns(::ActiveStorage::Attachment) } + def take!; end + + sig { returns(T.nilable(::ActiveStorage::Attachment)) } + def third; end + + sig { returns(::ActiveStorage::Attachment) } + def third!; end + + sig { returns(T.nilable(::ActiveStorage::Attachment)) } + def third_to_last; end + + sig { returns(::ActiveStorage::Attachment) } + def third_to_last!; end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert_all(attributes, returning: nil, unique_by: nil); end + end + + module GeneratedAssociationMethods + sig { returns(T.untyped) } + def blob; end + + sig { params(value: T.untyped).void } + def blob=(value); end + + sig { returns(T::Boolean) } + def blob_changed?; end + + sig { returns(T::Boolean) } + def blob_previously_changed?; end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.untyped) } + def build_blob(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.untyped) } + def create_blob(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.untyped) } + def create_blob!(*args, &blk); end + + sig { returns(T.untyped) } + def record; end + + sig { params(value: T.untyped).void } + def record=(value); end + + sig { returns(T::Boolean) } + def record_changed?; end + + sig { returns(T::Boolean) } + def record_previously_changed?; end + + sig { returns(T.untyped) } + def reload_blob; end + + sig { returns(T.untyped) } + def reload_record; end + + sig { void } + def reset_blob; end + + sig { void } + def reset_record; end + end + + module GeneratedAssociationRelationMethods + sig { returns(PrivateAssociationRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateAssociationRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + sig do + params( + blk: T.proc.params(record: ::ActiveStorage::Attachment).returns(BasicObject) + ).returns(T::Array[::ActiveStorage::Attachment]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateAssociationRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_all_variant_records(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def without(*args, &blk); end + end + + module GeneratedRelationMethods + sig { returns(PrivateRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + sig do + params( + blk: T.proc.params(record: ::ActiveStorage::Attachment).returns(BasicObject) + ).returns(T::Array[::ActiveStorage::Attachment]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_all_variant_records(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::ActiveStorage::Attachment } } + + sig { returns(T::Array[::ActiveStorage::Attachment]) } + def to_a; end + + sig { returns(T::Array[::ActiveStorage::Attachment]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::ActiveStorage::Attachment } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateAssociationRelationWhereChain + Elem = type_member { { fixed: ::ActiveStorage::Attachment } } + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateAssociationRelation) } + def not(opts, *rest); end + end + + class PrivateCollectionProxy < ::ActiveRecord::Associations::CollectionProxy + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::ActiveStorage::Attachment } } + + sig do + params( + records: T.any(::ActiveStorage::Attachment, T::Enumerable[T.any(::ActiveStorage::Attachment, T::Enumerable[::ActiveStorage::Attachment])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::ActiveStorage::Attachment, T::Enumerable[T.any(::ActiveStorage::Attachment, T::Enumerable[::ActiveStorage::Attachment])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::ActiveStorage::Attachment, T::Enumerable[T.any(::ActiveStorage::Attachment, T::Enumerable[::ActiveStorage::Attachment])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig { returns(T::Array[::ActiveStorage::Attachment]) } + def load_target; end + + sig do + params( + records: T.any(::ActiveStorage::Attachment, T::Enumerable[T.any(::ActiveStorage::Attachment, T::Enumerable[::ActiveStorage::Attachment])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::ActiveStorage::Attachment, T::Enumerable[T.any(::ActiveStorage::Attachment, T::Enumerable[::ActiveStorage::Attachment])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::ActiveStorage::Attachment, T::Enumerable[T.any(::ActiveStorage::Attachment, T::Enumerable[::ActiveStorage::Attachment])]) + ).returns(T::Array[::ActiveStorage::Attachment]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::ActiveStorage::Attachment]) } + def target; end + + sig { returns(T::Array[::ActiveStorage::Attachment]) } + def to_a; end + + sig { returns(T::Array[::ActiveStorage::Attachment]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::ActiveStorage::Attachment } } + + sig { returns(T::Array[::ActiveStorage::Attachment]) } + def to_a; end + + sig { returns(T::Array[::ActiveStorage::Attachment]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::ActiveStorage::Attachment } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateRelationWhereChain + Elem = type_member { { fixed: ::ActiveStorage::Attachment } } + + sig { params(args: T.untyped).returns(PrivateRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateRelation) } + def not(opts, *rest); end + end +end diff --git a/sorbet/rbi/dsl/active_storage/blob.rbi b/sorbet/rbi/dsl/active_storage/blob.rbi new file mode 100644 index 0000000..ab8381d --- /dev/null +++ b/sorbet/rbi/dsl/active_storage/blob.rbi @@ -0,0 +1,1148 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveStorage::Blob`. +# Please instead update this file by running `bin/tapioca dsl ActiveStorage::Blob`. + + +class ActiveStorage::Blob + include GeneratedAssociationMethods + extend CommonRelationMethods + extend GeneratedRelationMethods + include GeneratedSecureTokenMethods + include GeneratedStoredAttributesMethods + + sig { returns(ActiveStorage::Attached::One) } + def preview_image; end + + sig { params(attachable: T.untyped).returns(T.untyped) } + def preview_image=(attachable); end + + private + + sig { returns(NilClass) } + def to_ary; end + + class << self + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveStorage::Blob).void) + ).returns(::ActiveStorage::Blob) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig do + params( + block: T.nilable(T.proc.params(record: ::ActiveStorage::Blob).returns(T.untyped)) + ).returns(T::Boolean) + end + def any?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def average(column_name); end + + sig { params(block: T.nilable(T.proc.params(object: ::ActiveStorage::Blob).void)).returns(::ActiveStorage::Blob) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveStorage::Blob).void) + ).returns(T::Array[::ActiveStorage::Blob]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveStorage::Blob).void) + ).returns(::ActiveStorage::Blob) + end + def build(attributes = nil, &block); end + + sig { params(operation: Symbol, column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def calculate(operation, column_name); end + + sig { params(column_name: T.nilable(T.any(String, Symbol))).returns(Integer) } + sig { params(column_name: NilClass, block: T.proc.params(object: ::ActiveStorage::Blob).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::ActiveStorage::Blob).void)).returns(::ActiveStorage::Blob) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveStorage::Blob).void) + ).returns(T::Array[::ActiveStorage::Blob]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveStorage::Blob).void) + ).returns(::ActiveStorage::Blob) + end + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::ActiveStorage::Blob).void)).returns(::ActiveStorage::Blob) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveStorage::Blob).void) + ).returns(T::Array[::ActiveStorage::Blob]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveStorage::Blob).void) + ).returns(::ActiveStorage::Blob) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveStorage::Blob).void) + ).returns(T::Array[::ActiveStorage::Blob]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveStorage::Blob).void) + ).returns(::ActiveStorage::Blob) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveStorage::Blob).void) + ).returns(T::Array[::ActiveStorage::Blob]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveStorage::Blob).void) + ).returns(::ActiveStorage::Blob) + end + def create_or_find_by!(attributes, &block); end + + sig do + params( + records: T.any(::ActiveStorage::Blob, Integer, String, T::Enumerable[T.any(::ActiveStorage::Blob, Integer, String, T::Enumerable[::ActiveStorage::Blob])]) + ).returns(Integer) + end + def delete(*records); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(args); end + + sig do + params( + records: T.any(::ActiveStorage::Blob, Integer, String, T::Enumerable[T.any(::ActiveStorage::Blob, Integer, String, T::Enumerable[::ActiveStorage::Blob])]) + ).returns(T::Array[::ActiveStorage::Blob]) + end + def destroy(*records); end + + sig { returns(T::Array[::ActiveStorage::Blob]) } + def destroy_all; end + + sig { returns(T::Array[::ActiveStorage::Blob]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::ActiveStorage::Blob]) } + def destroy_by(args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::ActiveStorage::Blob)) } + def fifth; end + + sig { returns(::ActiveStorage::Blob) } + def fifth!; end + + sig do + params( + args: T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything]) + ).returns(::ActiveStorage::Blob) + end + sig do + params( + args: T::Array[T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything])] + ).returns(T::Enumerable[::ActiveStorage::Blob]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::ActiveStorage::Blob).void + ).returns(T.nilable(::ActiveStorage::Blob)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::ActiveStorage::Blob)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::ActiveStorage::Blob) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: ::ActiveStorage::Blob).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[::ActiveStorage::Blob]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: T::Array[::ActiveStorage::Blob]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[T::Enumerator[::ActiveStorage::Blob]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveStorage::Blob).void) + ).returns(T::Array[::ActiveStorage::Blob]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveStorage::Blob).void) + ).returns(::ActiveStorage::Blob) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveStorage::Blob).void) + ).returns(T::Array[::ActiveStorage::Blob]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveStorage::Blob).void) + ).returns(::ActiveStorage::Blob) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveStorage::Blob).void) + ).returns(T::Array[::ActiveStorage::Blob]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveStorage::Blob).void) + ).returns(::ActiveStorage::Blob) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::ActiveStorage::Blob)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::ActiveStorage::Blob) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::ActiveStorage::Blob) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::ActiveStorage::Blob)) } + sig { params(limit: Integer).returns(T::Array[::ActiveStorage::Blob]) } + def first(limit = nil); end + + sig { returns(::ActiveStorage::Blob) } + def first!; end + + sig { returns(T.nilable(::ActiveStorage::Blob)) } + def forty_two; end + + sig { returns(::ActiveStorage::Blob) } + def forty_two!; end + + sig { returns(T.nilable(::ActiveStorage::Blob)) } + def fourth; end + + sig { returns(::ActiveStorage::Blob) } + def fourth!; end + + sig { returns(Array) } + def ids; end + + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped, + block: T.proc.params(object: PrivateRelation).void + ).void + end + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped + ).returns(::ActiveRecord::Batches::BatchEnumerator) + end + def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, cursor: primary_key, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert!(attributes, returning: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert_all(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert_all!(attributes, returning: nil); end + + sig { returns(T.nilable(::ActiveStorage::Blob)) } + sig { params(limit: Integer).returns(T::Array[::ActiveStorage::Blob]) } + def last(limit = nil); end + + sig { returns(::ActiveStorage::Blob) } + def last!; end + + sig do + params( + block: T.nilable(T.proc.params(record: ::ActiveStorage::Blob).returns(T.untyped)) + ).returns(T::Boolean) + end + def many?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def maximum(column_name); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def member?(record); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def minimum(column_name); end + + sig { params(block: T.nilable(T.proc.params(object: ::ActiveStorage::Blob).void)).returns(::ActiveStorage::Blob) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveStorage::Blob).void) + ).returns(T::Array[::ActiveStorage::Blob]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveStorage::Blob).void) + ).returns(::ActiveStorage::Blob) + end + def new(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::ActiveStorage::Blob).returns(T.untyped)) + ).returns(T::Boolean) + end + def none?(&block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::ActiveStorage::Blob).returns(T.untyped)) + ).returns(T::Boolean) + end + def one?(&block); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pick(*column_names); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pluck(*column_names); end + + sig { returns(T.nilable(::ActiveStorage::Blob)) } + def second; end + + sig { returns(::ActiveStorage::Blob) } + def second!; end + + sig { returns(T.nilable(::ActiveStorage::Blob)) } + def second_to_last; end + + sig { returns(::ActiveStorage::Blob) } + def second_to_last!; end + + sig { returns(::ActiveStorage::Blob) } + def sole; end + + sig { params(initial_value_or_column: T.untyped).returns(T.any(Integer, Float, BigDecimal)) } + sig do + type_parameters(:U) + .params( + initial_value_or_column: T.nilable(T.type_parameter(:U)), + block: T.proc.params(object: ::ActiveStorage::Blob).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::ActiveStorage::Blob)) } + sig { params(limit: Integer).returns(T::Array[::ActiveStorage::Blob]) } + def take(limit = nil); end + + sig { returns(::ActiveStorage::Blob) } + def take!; end + + sig { returns(T.nilable(::ActiveStorage::Blob)) } + def third; end + + sig { returns(::ActiveStorage::Blob) } + def third!; end + + sig { returns(T.nilable(::ActiveStorage::Blob)) } + def third_to_last; end + + sig { returns(::ActiveStorage::Blob) } + def third_to_last!; end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert_all(attributes, returning: nil, unique_by: nil); end + end + + module GeneratedAssociationMethods + sig { returns(T::Array[T.untyped]) } + def attachment_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def attachment_ids=(ids); end + + # This method is created by ActiveRecord on the `ActiveStorage::Blob` class because it declared `has_many :attachments`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(ActiveRecord::Associations::CollectionProxy) } + def attachments; end + + sig { params(value: T::Enumerable[T.untyped]).void } + def attachments=(value); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.untyped) } + def build_preview_image_attachment(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.untyped) } + def build_preview_image_blob(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.untyped) } + def create_preview_image_attachment(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.untyped) } + def create_preview_image_attachment!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.untyped) } + def create_preview_image_blob(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.untyped) } + def create_preview_image_blob!(*args, &blk); end + + sig { returns(T.untyped) } + def preview_image_attachment; end + + sig { params(value: T.untyped).void } + def preview_image_attachment=(value); end + + sig { returns(T.untyped) } + def preview_image_blob; end + + sig { params(value: T.untyped).void } + def preview_image_blob=(value); end + + sig { returns(T.untyped) } + def reload_preview_image_attachment; end + + sig { returns(T.untyped) } + def reload_preview_image_blob; end + + sig { void } + def reset_preview_image_attachment; end + + sig { void } + def reset_preview_image_blob; end + + sig { returns(T::Array[T.untyped]) } + def variant_record_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def variant_record_ids=(ids); end + + # This method is created by ActiveRecord on the `ActiveStorage::Blob` class because it declared `has_many :variant_records`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(ActiveRecord::Associations::CollectionProxy) } + def variant_records; end + + sig { params(value: T::Enumerable[T.untyped]).void } + def variant_records=(value); end + end + + module GeneratedAssociationRelationMethods + sig { returns(PrivateAssociationRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateAssociationRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + sig do + params( + blk: T.proc.params(record: ::ActiveStorage::Blob).returns(BasicObject) + ).returns(T::Array[::ActiveStorage::Blob]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def unattached(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateAssociationRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_attached_preview_image(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def without(*args, &blk); end + end + + module GeneratedRelationMethods + sig { returns(PrivateRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + sig do + params( + blk: T.proc.params(record: ::ActiveStorage::Blob).returns(BasicObject) + ).returns(T::Array[::ActiveStorage::Blob]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def unattached(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_attached_preview_image(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def without(*args, &blk); end + end + + module GeneratedSecureTokenMethods + sig { returns(T::Boolean) } + def regenerate_key; end + end + + module GeneratedStoredAttributesMethods + sig { returns(T.untyped) } + def analyzed; end + + sig { params(value: T.untyped).returns(T.untyped) } + def analyzed=(value); end + + sig { returns(T.untyped) } + def analyzed_before_last_save; end + + sig { returns(T.untyped) } + def analyzed_change; end + + sig { returns(T::Boolean) } + def analyzed_changed?; end + + sig { returns(T.untyped) } + def analyzed_was; end + + sig { returns(T.untyped) } + def composed; end + + sig { params(value: T.untyped).returns(T.untyped) } + def composed=(value); end + + sig { returns(T.untyped) } + def composed_before_last_save; end + + sig { returns(T.untyped) } + def composed_change; end + + sig { returns(T::Boolean) } + def composed_changed?; end + + sig { returns(T.untyped) } + def composed_was; end + + sig { returns(T.untyped) } + def identified; end + + sig { params(value: T.untyped).returns(T.untyped) } + def identified=(value); end + + sig { returns(T.untyped) } + def identified_before_last_save; end + + sig { returns(T.untyped) } + def identified_change; end + + sig { returns(T::Boolean) } + def identified_changed?; end + + sig { returns(T.untyped) } + def identified_was; end + + sig { returns(T.untyped) } + def saved_change_to_analyzed; end + + sig { returns(T::Boolean) } + def saved_change_to_analyzed?; end + + sig { returns(T.untyped) } + def saved_change_to_composed; end + + sig { returns(T::Boolean) } + def saved_change_to_composed?; end + + sig { returns(T.untyped) } + def saved_change_to_identified; end + + sig { returns(T::Boolean) } + def saved_change_to_identified?; end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::ActiveStorage::Blob } } + + sig { returns(T::Array[::ActiveStorage::Blob]) } + def to_a; end + + sig { returns(T::Array[::ActiveStorage::Blob]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::ActiveStorage::Blob } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateAssociationRelationWhereChain + Elem = type_member { { fixed: ::ActiveStorage::Blob } } + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateAssociationRelation) } + def not(opts, *rest); end + end + + class PrivateCollectionProxy < ::ActiveRecord::Associations::CollectionProxy + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::ActiveStorage::Blob } } + + sig do + params( + records: T.any(::ActiveStorage::Blob, T::Enumerable[T.any(::ActiveStorage::Blob, T::Enumerable[::ActiveStorage::Blob])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::ActiveStorage::Blob, T::Enumerable[T.any(::ActiveStorage::Blob, T::Enumerable[::ActiveStorage::Blob])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::ActiveStorage::Blob, T::Enumerable[T.any(::ActiveStorage::Blob, T::Enumerable[::ActiveStorage::Blob])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig { returns(T::Array[::ActiveStorage::Blob]) } + def load_target; end + + sig do + params( + records: T.any(::ActiveStorage::Blob, T::Enumerable[T.any(::ActiveStorage::Blob, T::Enumerable[::ActiveStorage::Blob])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::ActiveStorage::Blob, T::Enumerable[T.any(::ActiveStorage::Blob, T::Enumerable[::ActiveStorage::Blob])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::ActiveStorage::Blob, T::Enumerable[T.any(::ActiveStorage::Blob, T::Enumerable[::ActiveStorage::Blob])]) + ).returns(T::Array[::ActiveStorage::Blob]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::ActiveStorage::Blob]) } + def target; end + + sig { returns(T::Array[::ActiveStorage::Blob]) } + def to_a; end + + sig { returns(T::Array[::ActiveStorage::Blob]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::ActiveStorage::Blob } } + + sig { returns(T::Array[::ActiveStorage::Blob]) } + def to_a; end + + sig { returns(T::Array[::ActiveStorage::Blob]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::ActiveStorage::Blob } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateRelationWhereChain + Elem = type_member { { fixed: ::ActiveStorage::Blob } } + + sig { params(args: T.untyped).returns(PrivateRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateRelation) } + def not(opts, *rest); end + end +end diff --git a/sorbet/rbi/dsl/active_storage/current.rbi b/sorbet/rbi/dsl/active_storage/current.rbi new file mode 100644 index 0000000..be334c3 --- /dev/null +++ b/sorbet/rbi/dsl/active_storage/current.rbi @@ -0,0 +1,26 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveStorage::Current`. +# Please instead update this file by running `bin/tapioca dsl ActiveStorage::Current`. + + +class ActiveStorage::Current + include GeneratedAttributeMethods + + class << self + sig { returns(T.untyped) } + def url_options; end + + sig { params(value: T.untyped).returns(T.untyped) } + def url_options=(value); end + end + + module GeneratedAttributeMethods + sig { returns(T.untyped) } + def url_options; end + + sig { params(value: T.untyped).returns(T.untyped) } + def url_options=(value); end + end +end diff --git a/sorbet/rbi/dsl/active_storage/mirror_job.rbi b/sorbet/rbi/dsl/active_storage/mirror_job.rbi new file mode 100644 index 0000000..bf0cac6 --- /dev/null +++ b/sorbet/rbi/dsl/active_storage/mirror_job.rbi @@ -0,0 +1,22 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveStorage::MirrorJob`. +# Please instead update this file by running `bin/tapioca dsl ActiveStorage::MirrorJob`. + + +class ActiveStorage::MirrorJob + class << self + sig do + params( + key: T.untyped, + checksum: T.untyped, + block: T.nilable(T.proc.params(job: ActiveStorage::MirrorJob).void) + ).returns(T.any(ActiveStorage::MirrorJob, FalseClass)) + end + def perform_later(key, checksum:, &block); end + + sig { params(key: T.untyped, checksum: T.untyped).returns(T.untyped) } + def perform_now(key, checksum:); end + end +end diff --git a/sorbet/rbi/dsl/active_storage/preview_image_job.rbi b/sorbet/rbi/dsl/active_storage/preview_image_job.rbi new file mode 100644 index 0000000..59d6f46 --- /dev/null +++ b/sorbet/rbi/dsl/active_storage/preview_image_job.rbi @@ -0,0 +1,22 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveStorage::PreviewImageJob`. +# Please instead update this file by running `bin/tapioca dsl ActiveStorage::PreviewImageJob`. + + +class ActiveStorage::PreviewImageJob + class << self + sig do + params( + blob: T.untyped, + variations: T.untyped, + block: T.nilable(T.proc.params(job: ActiveStorage::PreviewImageJob).void) + ).returns(T.any(ActiveStorage::PreviewImageJob, FalseClass)) + end + def perform_later(blob, variations, &block); end + + sig { params(blob: T.untyped, variations: T.untyped).returns(T.untyped) } + def perform_now(blob, variations); end + end +end diff --git a/sorbet/rbi/dsl/active_storage/purge_job.rbi b/sorbet/rbi/dsl/active_storage/purge_job.rbi new file mode 100644 index 0000000..bbbc635 --- /dev/null +++ b/sorbet/rbi/dsl/active_storage/purge_job.rbi @@ -0,0 +1,21 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveStorage::PurgeJob`. +# Please instead update this file by running `bin/tapioca dsl ActiveStorage::PurgeJob`. + + +class ActiveStorage::PurgeJob + class << self + sig do + params( + blob: T.untyped, + block: T.nilable(T.proc.params(job: ActiveStorage::PurgeJob).void) + ).returns(T.any(ActiveStorage::PurgeJob, FalseClass)) + end + def perform_later(blob, &block); end + + sig { params(blob: T.untyped).returns(T.untyped) } + def perform_now(blob); end + end +end diff --git a/sorbet/rbi/dsl/active_storage/reflection/active_record_extensions.rbi b/sorbet/rbi/dsl/active_storage/reflection/active_record_extensions.rbi new file mode 100644 index 0000000..7e6fe68 --- /dev/null +++ b/sorbet/rbi/dsl/active_storage/reflection/active_record_extensions.rbi @@ -0,0 +1,23 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveStorage::Reflection::ActiveRecordExtensions`. +# Please instead update this file by running `bin/tapioca dsl ActiveStorage::Reflection::ActiveRecordExtensions`. + + +module ActiveStorage::Reflection::ActiveRecordExtensions + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def attachment_reflections; end + def attachment_reflections=(value); end + def attachment_reflections?; end + end + + module GeneratedInstanceMethods + def attachment_reflections; end + def attachment_reflections?; end + end +end diff --git a/sorbet/rbi/dsl/active_storage/streaming.rbi b/sorbet/rbi/dsl/active_storage/streaming.rbi new file mode 100644 index 0000000..d4a390a --- /dev/null +++ b/sorbet/rbi/dsl/active_storage/streaming.rbi @@ -0,0 +1,11 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveStorage::Streaming`. +# Please instead update this file by running `bin/tapioca dsl ActiveStorage::Streaming`. + + +module ActiveStorage::Streaming + mixes_in_class_methods ::ActionController::Rendering::ClassMethods + mixes_in_class_methods ::ActionController::Live::ClassMethods +end diff --git a/sorbet/rbi/dsl/active_storage/transform_job.rbi b/sorbet/rbi/dsl/active_storage/transform_job.rbi new file mode 100644 index 0000000..e796264 --- /dev/null +++ b/sorbet/rbi/dsl/active_storage/transform_job.rbi @@ -0,0 +1,22 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveStorage::TransformJob`. +# Please instead update this file by running `bin/tapioca dsl ActiveStorage::TransformJob`. + + +class ActiveStorage::TransformJob + class << self + sig do + params( + blob: T.untyped, + transformations: T.untyped, + block: T.nilable(T.proc.params(job: ActiveStorage::TransformJob).void) + ).returns(T.any(ActiveStorage::TransformJob, FalseClass)) + end + def perform_later(blob, transformations, &block); end + + sig { params(blob: T.untyped, transformations: T.untyped).returns(T.untyped) } + def perform_now(blob, transformations); end + end +end diff --git a/sorbet/rbi/dsl/active_storage/variant_record.rbi b/sorbet/rbi/dsl/active_storage/variant_record.rbi new file mode 100644 index 0000000..a13c006 --- /dev/null +++ b/sorbet/rbi/dsl/active_storage/variant_record.rbi @@ -0,0 +1,1081 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveStorage::VariantRecord`. +# Please instead update this file by running `bin/tapioca dsl ActiveStorage::VariantRecord`. + + +class ActiveStorage::VariantRecord + include GeneratedAssociationMethods + extend CommonRelationMethods + extend GeneratedRelationMethods + + sig { returns(ActiveStorage::Attached::One) } + def image; end + + sig { params(attachable: T.untyped).returns(T.untyped) } + def image=(attachable); end + + private + + sig { returns(NilClass) } + def to_ary; end + + class << self + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveStorage::VariantRecord).void) + ).returns(::ActiveStorage::VariantRecord) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig do + params( + block: T.nilable(T.proc.params(record: ::ActiveStorage::VariantRecord).returns(T.untyped)) + ).returns(T::Boolean) + end + def any?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def average(column_name); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::ActiveStorage::VariantRecord).void) + ).returns(::ActiveStorage::VariantRecord) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveStorage::VariantRecord).void) + ).returns(T::Array[::ActiveStorage::VariantRecord]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveStorage::VariantRecord).void) + ).returns(::ActiveStorage::VariantRecord) + end + def build(attributes = nil, &block); end + + sig { params(operation: Symbol, column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def calculate(operation, column_name); end + + sig { params(column_name: T.nilable(T.any(String, Symbol))).returns(Integer) } + sig do + params( + column_name: NilClass, + block: T.proc.params(object: ::ActiveStorage::VariantRecord).void + ).returns(Integer) + end + def count(column_name = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::ActiveStorage::VariantRecord).void) + ).returns(::ActiveStorage::VariantRecord) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveStorage::VariantRecord).void) + ).returns(T::Array[::ActiveStorage::VariantRecord]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveStorage::VariantRecord).void) + ).returns(::ActiveStorage::VariantRecord) + end + def create(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::ActiveStorage::VariantRecord).void) + ).returns(::ActiveStorage::VariantRecord) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveStorage::VariantRecord).void) + ).returns(T::Array[::ActiveStorage::VariantRecord]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveStorage::VariantRecord).void) + ).returns(::ActiveStorage::VariantRecord) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveStorage::VariantRecord).void) + ).returns(T::Array[::ActiveStorage::VariantRecord]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveStorage::VariantRecord).void) + ).returns(::ActiveStorage::VariantRecord) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveStorage::VariantRecord).void) + ).returns(T::Array[::ActiveStorage::VariantRecord]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveStorage::VariantRecord).void) + ).returns(::ActiveStorage::VariantRecord) + end + def create_or_find_by!(attributes, &block); end + + sig do + params( + records: T.any(::ActiveStorage::VariantRecord, Integer, String, T::Enumerable[T.any(::ActiveStorage::VariantRecord, Integer, String, T::Enumerable[::ActiveStorage::VariantRecord])]) + ).returns(Integer) + end + def delete(*records); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(args); end + + sig do + params( + records: T.any(::ActiveStorage::VariantRecord, Integer, String, T::Enumerable[T.any(::ActiveStorage::VariantRecord, Integer, String, T::Enumerable[::ActiveStorage::VariantRecord])]) + ).returns(T::Array[::ActiveStorage::VariantRecord]) + end + def destroy(*records); end + + sig { returns(T::Array[::ActiveStorage::VariantRecord]) } + def destroy_all; end + + sig { returns(T::Array[::ActiveStorage::VariantRecord]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::ActiveStorage::VariantRecord]) } + def destroy_by(args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::ActiveStorage::VariantRecord)) } + def fifth; end + + sig { returns(::ActiveStorage::VariantRecord) } + def fifth!; end + + sig do + params( + args: T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything]) + ).returns(::ActiveStorage::VariantRecord) + end + sig do + params( + args: T::Array[T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything])] + ).returns(T::Enumerable[::ActiveStorage::VariantRecord]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::ActiveStorage::VariantRecord).void + ).returns(T.nilable(::ActiveStorage::VariantRecord)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::ActiveStorage::VariantRecord)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::ActiveStorage::VariantRecord) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: ::ActiveStorage::VariantRecord).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[::ActiveStorage::VariantRecord]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: T::Array[::ActiveStorage::VariantRecord]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[T::Enumerator[::ActiveStorage::VariantRecord]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveStorage::VariantRecord).void) + ).returns(T::Array[::ActiveStorage::VariantRecord]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveStorage::VariantRecord).void) + ).returns(::ActiveStorage::VariantRecord) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveStorage::VariantRecord).void) + ).returns(T::Array[::ActiveStorage::VariantRecord]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveStorage::VariantRecord).void) + ).returns(::ActiveStorage::VariantRecord) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveStorage::VariantRecord).void) + ).returns(T::Array[::ActiveStorage::VariantRecord]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveStorage::VariantRecord).void) + ).returns(::ActiveStorage::VariantRecord) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::ActiveStorage::VariantRecord)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::ActiveStorage::VariantRecord) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::ActiveStorage::VariantRecord) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::ActiveStorage::VariantRecord)) } + sig { params(limit: Integer).returns(T::Array[::ActiveStorage::VariantRecord]) } + def first(limit = nil); end + + sig { returns(::ActiveStorage::VariantRecord) } + def first!; end + + sig { returns(T.nilable(::ActiveStorage::VariantRecord)) } + def forty_two; end + + sig { returns(::ActiveStorage::VariantRecord) } + def forty_two!; end + + sig { returns(T.nilable(::ActiveStorage::VariantRecord)) } + def fourth; end + + sig { returns(::ActiveStorage::VariantRecord) } + def fourth!; end + + sig { returns(Array) } + def ids; end + + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped, + block: T.proc.params(object: PrivateRelation).void + ).void + end + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped + ).returns(::ActiveRecord::Batches::BatchEnumerator) + end + def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, cursor: primary_key, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert!(attributes, returning: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert_all(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert_all!(attributes, returning: nil); end + + sig { returns(T.nilable(::ActiveStorage::VariantRecord)) } + sig { params(limit: Integer).returns(T::Array[::ActiveStorage::VariantRecord]) } + def last(limit = nil); end + + sig { returns(::ActiveStorage::VariantRecord) } + def last!; end + + sig do + params( + block: T.nilable(T.proc.params(record: ::ActiveStorage::VariantRecord).returns(T.untyped)) + ).returns(T::Boolean) + end + def many?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def maximum(column_name); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def member?(record); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def minimum(column_name); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::ActiveStorage::VariantRecord).void) + ).returns(::ActiveStorage::VariantRecord) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveStorage::VariantRecord).void) + ).returns(T::Array[::ActiveStorage::VariantRecord]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveStorage::VariantRecord).void) + ).returns(::ActiveStorage::VariantRecord) + end + def new(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::ActiveStorage::VariantRecord).returns(T.untyped)) + ).returns(T::Boolean) + end + def none?(&block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::ActiveStorage::VariantRecord).returns(T.untyped)) + ).returns(T::Boolean) + end + def one?(&block); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pick(*column_names); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pluck(*column_names); end + + sig { returns(T.nilable(::ActiveStorage::VariantRecord)) } + def second; end + + sig { returns(::ActiveStorage::VariantRecord) } + def second!; end + + sig { returns(T.nilable(::ActiveStorage::VariantRecord)) } + def second_to_last; end + + sig { returns(::ActiveStorage::VariantRecord) } + def second_to_last!; end + + sig { returns(::ActiveStorage::VariantRecord) } + def sole; end + + sig { params(initial_value_or_column: T.untyped).returns(T.any(Integer, Float, BigDecimal)) } + sig do + type_parameters(:U) + .params( + initial_value_or_column: T.nilable(T.type_parameter(:U)), + block: T.proc.params(object: ::ActiveStorage::VariantRecord).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::ActiveStorage::VariantRecord)) } + sig { params(limit: Integer).returns(T::Array[::ActiveStorage::VariantRecord]) } + def take(limit = nil); end + + sig { returns(::ActiveStorage::VariantRecord) } + def take!; end + + sig { returns(T.nilable(::ActiveStorage::VariantRecord)) } + def third; end + + sig { returns(::ActiveStorage::VariantRecord) } + def third!; end + + sig { returns(T.nilable(::ActiveStorage::VariantRecord)) } + def third_to_last; end + + sig { returns(::ActiveStorage::VariantRecord) } + def third_to_last!; end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert_all(attributes, returning: nil, unique_by: nil); end + end + + module GeneratedAssociationMethods + sig { returns(T.untyped) } + def blob; end + + sig { params(value: T.untyped).void } + def blob=(value); end + + sig { returns(T::Boolean) } + def blob_changed?; end + + sig { returns(T::Boolean) } + def blob_previously_changed?; end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.untyped) } + def build_blob(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.untyped) } + def build_image_attachment(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.untyped) } + def build_image_blob(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.untyped) } + def create_blob(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.untyped) } + def create_blob!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.untyped) } + def create_image_attachment(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.untyped) } + def create_image_attachment!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.untyped) } + def create_image_blob(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.untyped) } + def create_image_blob!(*args, &blk); end + + sig { returns(T.untyped) } + def image_attachment; end + + sig { params(value: T.untyped).void } + def image_attachment=(value); end + + sig { returns(T.untyped) } + def image_blob; end + + sig { params(value: T.untyped).void } + def image_blob=(value); end + + sig { returns(T.untyped) } + def reload_blob; end + + sig { returns(T.untyped) } + def reload_image_attachment; end + + sig { returns(T.untyped) } + def reload_image_blob; end + + sig { void } + def reset_blob; end + + sig { void } + def reset_image_attachment; end + + sig { void } + def reset_image_blob; end + end + + module GeneratedAssociationRelationMethods + sig { returns(PrivateAssociationRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateAssociationRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + sig do + params( + blk: T.proc.params(record: ::ActiveStorage::VariantRecord).returns(BasicObject) + ).returns(T::Array[::ActiveStorage::VariantRecord]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateAssociationRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_attached_image(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def without(*args, &blk); end + end + + module GeneratedRelationMethods + sig { returns(PrivateRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + sig do + params( + blk: T.proc.params(record: ::ActiveStorage::VariantRecord).returns(BasicObject) + ).returns(T::Array[::ActiveStorage::VariantRecord]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_attached_image(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::ActiveStorage::VariantRecord } } + + sig { returns(T::Array[::ActiveStorage::VariantRecord]) } + def to_a; end + + sig { returns(T::Array[::ActiveStorage::VariantRecord]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::ActiveStorage::VariantRecord } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateAssociationRelationWhereChain + Elem = type_member { { fixed: ::ActiveStorage::VariantRecord } } + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateAssociationRelation) } + def not(opts, *rest); end + end + + class PrivateCollectionProxy < ::ActiveRecord::Associations::CollectionProxy + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::ActiveStorage::VariantRecord } } + + sig do + params( + records: T.any(::ActiveStorage::VariantRecord, T::Enumerable[T.any(::ActiveStorage::VariantRecord, T::Enumerable[::ActiveStorage::VariantRecord])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::ActiveStorage::VariantRecord, T::Enumerable[T.any(::ActiveStorage::VariantRecord, T::Enumerable[::ActiveStorage::VariantRecord])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::ActiveStorage::VariantRecord, T::Enumerable[T.any(::ActiveStorage::VariantRecord, T::Enumerable[::ActiveStorage::VariantRecord])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig { returns(T::Array[::ActiveStorage::VariantRecord]) } + def load_target; end + + sig do + params( + records: T.any(::ActiveStorage::VariantRecord, T::Enumerable[T.any(::ActiveStorage::VariantRecord, T::Enumerable[::ActiveStorage::VariantRecord])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::ActiveStorage::VariantRecord, T::Enumerable[T.any(::ActiveStorage::VariantRecord, T::Enumerable[::ActiveStorage::VariantRecord])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::ActiveStorage::VariantRecord, T::Enumerable[T.any(::ActiveStorage::VariantRecord, T::Enumerable[::ActiveStorage::VariantRecord])]) + ).returns(T::Array[::ActiveStorage::VariantRecord]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::ActiveStorage::VariantRecord]) } + def target; end + + sig { returns(T::Array[::ActiveStorage::VariantRecord]) } + def to_a; end + + sig { returns(T::Array[::ActiveStorage::VariantRecord]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::ActiveStorage::VariantRecord } } + + sig { returns(T::Array[::ActiveStorage::VariantRecord]) } + def to_a; end + + sig { returns(T::Array[::ActiveStorage::VariantRecord]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::ActiveStorage::VariantRecord } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateRelationWhereChain + Elem = type_member { { fixed: ::ActiveStorage::VariantRecord } } + + sig { params(args: T.untyped).returns(PrivateRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateRelation) } + def not(opts, *rest); end + end +end diff --git a/sorbet/rbi/dsl/active_support/actionable_error.rbi b/sorbet/rbi/dsl/active_support/actionable_error.rbi new file mode 100644 index 0000000..64b88fa --- /dev/null +++ b/sorbet/rbi/dsl/active_support/actionable_error.rbi @@ -0,0 +1,24 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveSupport::ActionableError`. +# Please instead update this file by running `bin/tapioca dsl ActiveSupport::ActionableError`. + + +module ActiveSupport::ActionableError + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def _actions; end + def _actions=(value); end + def _actions?; end + end + + module GeneratedInstanceMethods + def _actions; end + def _actions=(value); end + def _actions?; end + end +end diff --git a/sorbet/rbi/dsl/active_support/callbacks.rbi b/sorbet/rbi/dsl/active_support/callbacks.rbi new file mode 100644 index 0000000..15ee6be --- /dev/null +++ b/sorbet/rbi/dsl/active_support/callbacks.rbi @@ -0,0 +1,21 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveSupport::Callbacks`. +# Please instead update this file by running `bin/tapioca dsl ActiveSupport::Callbacks`. + + +module ActiveSupport::Callbacks + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + end + + module GeneratedInstanceMethods + def __callbacks; end + end +end diff --git a/sorbet/rbi/dsl/active_support/rescuable.rbi b/sorbet/rbi/dsl/active_support/rescuable.rbi new file mode 100644 index 0000000..cf65f82 --- /dev/null +++ b/sorbet/rbi/dsl/active_support/rescuable.rbi @@ -0,0 +1,24 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveSupport::Rescuable`. +# Please instead update this file by running `bin/tapioca dsl ActiveSupport::Rescuable`. + + +module ActiveSupport::Rescuable + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def rescue_handlers; end + def rescue_handlers=(value); end + def rescue_handlers?; end + end + + module GeneratedInstanceMethods + def rescue_handlers; end + def rescue_handlers=(value); end + def rescue_handlers?; end + end +end diff --git a/sorbet/rbi/dsl/active_support/testing/file_fixtures.rbi b/sorbet/rbi/dsl/active_support/testing/file_fixtures.rbi new file mode 100644 index 0000000..ba004cf --- /dev/null +++ b/sorbet/rbi/dsl/active_support/testing/file_fixtures.rbi @@ -0,0 +1,23 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveSupport::Testing::FileFixtures`. +# Please instead update this file by running `bin/tapioca dsl ActiveSupport::Testing::FileFixtures`. + + +module ActiveSupport::Testing::FileFixtures + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def file_fixture_path; end + def file_fixture_path=(value); end + def file_fixture_path?; end + end + + module GeneratedInstanceMethods + def file_fixture_path; end + def file_fixture_path?; end + end +end diff --git a/sorbet/rbi/dsl/application_controller.rbi b/sorbet/rbi/dsl/application_controller.rbi new file mode 100644 index 0000000..a8e1596 --- /dev/null +++ b/sorbet/rbi/dsl/application_controller.rbi @@ -0,0 +1,35 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ApplicationController`. +# Please instead update this file by running `bin/tapioca dsl ApplicationController`. + + +class ApplicationController + include GeneratedUrlHelpersModule + include GeneratedPathHelpersModule + + sig { returns(HelperProxy) } + def helpers; end + + module HelperMethods + include ::Turbo::DriveHelper + include ::Turbo::FramesHelper + include ::Turbo::IncludesHelper + include ::Turbo::StreamsHelper + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + include ::ActionView::Helpers::TagHelper + include ::Turbo::Streams::ActionHelper + include ::ActionText::ContentHelper + include ::ActionText::TagHelper + include ::Importmap::ImportmapTagsHelper + include ::ActionController::Base::HelperMethods + include ::ApplicationHelper + include ::FizzBuzzHelper + end + + class HelperProxy < ::ActionView::Base + include HelperMethods + end +end diff --git a/sorbet/rbi/dsl/application_mailer.rbi b/sorbet/rbi/dsl/application_mailer.rbi new file mode 100644 index 0000000..fcb7718 --- /dev/null +++ b/sorbet/rbi/dsl/application_mailer.rbi @@ -0,0 +1,10 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ApplicationMailer`. +# Please instead update this file by running `bin/tapioca dsl ApplicationMailer`. + + +class ApplicationMailer + include GeneratedUrlHelpersModule +end diff --git a/sorbet/rbi/dsl/generated_path_helpers_module.rbi b/sorbet/rbi/dsl/generated_path_helpers_module.rbi new file mode 100644 index 0000000..c97a7c8 --- /dev/null +++ b/sorbet/rbi/dsl/generated_path_helpers_module.rbi @@ -0,0 +1,155 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `GeneratedPathHelpersModule`. +# Please instead update this file by running `bin/tapioca dsl GeneratedPathHelpersModule`. + + +module GeneratedPathHelpersModule + include ::ActionDispatch::Routing::UrlFor + include ::ActionDispatch::Routing::PolymorphicRoutes + + sig { params(args: T.untyped).returns(String) } + def edit_project_subproject_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def fizz_buzz_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def login_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def logout_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_project_subproject_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_rails_conductor_inbound_email_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_rails_conductor_inbound_email_source_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_user_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def preview_view_component_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def preview_view_components_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def project_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def project_subproject_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def project_subprojects_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_blob_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_blob_representation_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_blob_representation_proxy_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_conductor_inbound_email_incinerate_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_conductor_inbound_email_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_conductor_inbound_email_reroute_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_conductor_inbound_email_sources_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_conductor_inbound_emails_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_direct_uploads_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_disk_service_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_health_check_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_info_notes_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_info_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_info_properties_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_info_routes_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_mailers_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_mailgun_inbound_emails_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_mandrill_inbound_emails_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_mandrill_inbound_health_check_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_postmark_inbound_emails_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_relay_inbound_emails_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_representation_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_sendgrid_inbound_emails_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_service_blob_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_service_blob_proxy_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_storage_proxy_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_storage_redirect_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def regions_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def root_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def turbo_recede_historical_location_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def turbo_refresh_historical_location_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def turbo_resume_historical_location_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def update_rails_disk_service_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def user_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def users_path(*args); end +end diff --git a/sorbet/rbi/dsl/generated_url_helpers_module.rbi b/sorbet/rbi/dsl/generated_url_helpers_module.rbi new file mode 100644 index 0000000..f475b24 --- /dev/null +++ b/sorbet/rbi/dsl/generated_url_helpers_module.rbi @@ -0,0 +1,155 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `GeneratedUrlHelpersModule`. +# Please instead update this file by running `bin/tapioca dsl GeneratedUrlHelpersModule`. + + +module GeneratedUrlHelpersModule + include ::ActionDispatch::Routing::UrlFor + include ::ActionDispatch::Routing::PolymorphicRoutes + + sig { params(args: T.untyped).returns(String) } + def edit_project_subproject_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def fizz_buzz_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def login_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def logout_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_project_subproject_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_rails_conductor_inbound_email_source_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_rails_conductor_inbound_email_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_user_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def preview_view_component_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def preview_view_components_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def project_subproject_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def project_subprojects_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def project_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_blob_representation_proxy_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_blob_representation_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_blob_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_conductor_inbound_email_incinerate_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_conductor_inbound_email_reroute_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_conductor_inbound_email_sources_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_conductor_inbound_email_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_conductor_inbound_emails_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_direct_uploads_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_disk_service_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_health_check_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_info_notes_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_info_properties_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_info_routes_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_info_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_mailers_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_mailgun_inbound_emails_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_mandrill_inbound_emails_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_mandrill_inbound_health_check_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_postmark_inbound_emails_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_relay_inbound_emails_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_representation_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_sendgrid_inbound_emails_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_service_blob_proxy_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_service_blob_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_storage_proxy_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def rails_storage_redirect_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def regions_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def root_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def turbo_recede_historical_location_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def turbo_refresh_historical_location_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def turbo_resume_historical_location_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def update_rails_disk_service_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def user_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def users_url(*args); end +end diff --git a/sorbet/rbi/dsl/journal.rbi b/sorbet/rbi/dsl/journal.rbi new file mode 100644 index 0000000..d8c7d3b --- /dev/null +++ b/sorbet/rbi/dsl/journal.rbi @@ -0,0 +1,1356 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Journal`. +# Please instead update this file by running `bin/tapioca dsl Journal`. + + +class Journal + include GeneratedAssociationMethods + include GeneratedAttributeMethods + extend CommonRelationMethods + extend GeneratedRelationMethods + + private + + sig { returns(NilClass) } + def to_ary; end + + class << self + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Journal).void)).returns(::Journal) } + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::Journal).returns(T.untyped))).returns(T::Boolean) } + def any?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def average(column_name); end + + sig { params(block: T.nilable(T.proc.params(object: ::Journal).void)).returns(::Journal) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Journal).void) + ).returns(T::Array[::Journal]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Journal).void)).returns(::Journal) } + def build(attributes = nil, &block); end + + sig { params(operation: Symbol, column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def calculate(operation, column_name); end + + sig { params(column_name: T.nilable(T.any(String, Symbol))).returns(Integer) } + sig { params(column_name: NilClass, block: T.proc.params(object: ::Journal).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Journal).void)).returns(::Journal) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Journal).void) + ).returns(T::Array[::Journal]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Journal).void)).returns(::Journal) } + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Journal).void)).returns(::Journal) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Journal).void) + ).returns(T::Array[::Journal]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Journal).void)).returns(::Journal) } + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Journal).void) + ).returns(T::Array[::Journal]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Journal).void)).returns(::Journal) } + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Journal).void) + ).returns(T::Array[::Journal]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Journal).void)).returns(::Journal) } + def create_or_find_by!(attributes, &block); end + + sig do + params( + records: T.any(::Journal, Integer, String, T::Enumerable[T.any(::Journal, Integer, String, T::Enumerable[::Journal])]) + ).returns(Integer) + end + def delete(*records); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(args); end + + sig do + params( + records: T.any(::Journal, Integer, String, T::Enumerable[T.any(::Journal, Integer, String, T::Enumerable[::Journal])]) + ).returns(T::Array[::Journal]) + end + def destroy(*records); end + + sig { returns(T::Array[::Journal]) } + def destroy_all; end + + sig { returns(T::Array[::Journal]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::Journal]) } + def destroy_by(args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::Journal)) } + def fifth; end + + sig { returns(::Journal) } + def fifth!; end + + sig do + params( + args: T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything]) + ).returns(::Journal) + end + sig do + params( + args: T::Array[T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything])] + ).returns(T::Enumerable[::Journal]) + end + sig { params(args: NilClass, block: T.proc.params(object: ::Journal).void).returns(T.nilable(::Journal)) } + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::Journal)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::Journal) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: ::Journal).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[::Journal]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: T::Array[::Journal]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[T::Enumerator[::Journal]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Journal).void) + ).returns(T::Array[::Journal]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Journal).void)).returns(::Journal) } + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Journal).void) + ).returns(T::Array[::Journal]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Journal).void)).returns(::Journal) } + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Journal).void) + ).returns(T::Array[::Journal]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Journal).void)).returns(::Journal) } + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::Journal)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::Journal) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::Journal) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::Journal)) } + sig { params(limit: Integer).returns(T::Array[::Journal]) } + def first(limit = nil); end + + sig { returns(::Journal) } + def first!; end + + sig { returns(T.nilable(::Journal)) } + def forty_two; end + + sig { returns(::Journal) } + def forty_two!; end + + sig { returns(T.nilable(::Journal)) } + def fourth; end + + sig { returns(::Journal) } + def fourth!; end + + sig { returns(T::Array[::Integer]) } + def ids; end + + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped, + block: T.proc.params(object: PrivateRelation).void + ).void + end + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped + ).returns(::ActiveRecord::Batches::BatchEnumerator) + end + def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, cursor: primary_key, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert!(attributes, returning: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert_all(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert_all!(attributes, returning: nil); end + + sig { returns(T.nilable(::Journal)) } + sig { params(limit: Integer).returns(T::Array[::Journal]) } + def last(limit = nil); end + + sig { returns(::Journal) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::Journal).returns(T.untyped))).returns(T::Boolean) } + def many?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def maximum(column_name); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def member?(record); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def minimum(column_name); end + + sig { params(block: T.nilable(T.proc.params(object: ::Journal).void)).returns(::Journal) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Journal).void) + ).returns(T::Array[::Journal]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Journal).void)).returns(::Journal) } + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Journal).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Journal).returns(T.untyped))).returns(T::Boolean) } + def one?(&block); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pick(*column_names); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pluck(*column_names); end + + sig { returns(T.nilable(::Journal)) } + def second; end + + sig { returns(::Journal) } + def second!; end + + sig { returns(T.nilable(::Journal)) } + def second_to_last; end + + sig { returns(::Journal) } + def second_to_last!; end + + sig { returns(::Journal) } + def sole; end + + sig { params(initial_value_or_column: T.untyped).returns(T.any(Integer, Float, BigDecimal)) } + sig do + type_parameters(:U) + .params( + initial_value_or_column: T.nilable(T.type_parameter(:U)), + block: T.proc.params(object: ::Journal).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::Journal)) } + sig { params(limit: Integer).returns(T::Array[::Journal]) } + def take(limit = nil); end + + sig { returns(::Journal) } + def take!; end + + sig { returns(T.nilable(::Journal)) } + def third; end + + sig { returns(::Journal) } + def third!; end + + sig { returns(T.nilable(::Journal)) } + def third_to_last; end + + sig { returns(::Journal) } + def third_to_last!; end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert_all(attributes, returning: nil, unique_by: nil); end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::Subproject) } + def build_subproject(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::User) } + def build_user(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Subproject) } + def create_subproject(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Subproject) } + def create_subproject!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::User) } + def create_user(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::User) } + def create_user!(*args, &blk); end + + sig { returns(T.nilable(::Subproject)) } + def reload_subproject; end + + sig { returns(T.nilable(::User)) } + def reload_user; end + + sig { void } + def reset_subproject; end + + sig { void } + def reset_user; end + + sig { returns(T.nilable(::Subproject)) } + def subproject; end + + sig { params(value: T.nilable(::Subproject)).void } + def subproject=(value); end + + sig { returns(T::Boolean) } + def subproject_changed?; end + + sig { returns(T::Boolean) } + def subproject_previously_changed?; end + + sig { returns(T.nilable(::User)) } + def user; end + + sig { params(value: T.nilable(::User)).void } + def user=(value); end + + sig { returns(T::Boolean) } + def user_changed?; end + + sig { returns(T::Boolean) } + def user_previously_changed?; end + end + + module GeneratedAssociationRelationMethods + sig { returns(PrivateAssociationRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateAssociationRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + sig { params(blk: T.proc.params(record: ::Journal).returns(BasicObject)).returns(T::Array[::Journal]) } + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateAssociationRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::ActiveSupport::TimeWithZone) } + def created_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def created_at=(value); end + + sig { returns(T::Boolean) } + def created_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_before_last_save; end + + sig { returns(T.untyped) } + def created_at_before_type_cast; end + + sig { returns(T::Boolean) } + def created_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_was; end + + sig { void } + def created_at_will_change!; end + + sig { returns(::Integer) } + def id; end + + sig { params(value: ::Integer).returns(::Integer) } + def id=(value); end + + sig { returns(T::Boolean) } + def id?; end + + sig { returns(T.nilable(::Integer)) } + def id_before_last_save; end + + sig { returns(T.untyped) } + def id_before_type_cast; end + + sig { returns(T::Boolean) } + def id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_previously_was; end + + sig { returns(::Integer) } + def id_value; end + + sig { params(value: ::Integer).returns(::Integer) } + def id_value=(value); end + + sig { returns(T::Boolean) } + def id_value?; end + + sig { returns(T.nilable(::Integer)) } + def id_value_before_last_save; end + + sig { returns(T.untyped) } + def id_value_before_type_cast; end + + sig { returns(T::Boolean) } + def id_value_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def id_value_was; end + + sig { void } + def id_value_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def id_was; end + + sig { void } + def id_will_change!; end + + sig { returns(T.nilable(::String)) } + def markdown_content; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def markdown_content=(value); end + + sig { returns(T::Boolean) } + def markdown_content?; end + + sig { returns(T.nilable(::String)) } + def markdown_content_before_last_save; end + + sig { returns(T.untyped) } + def markdown_content_before_type_cast; end + + sig { returns(T::Boolean) } + def markdown_content_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def markdown_content_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def markdown_content_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def markdown_content_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def markdown_content_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def markdown_content_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def markdown_content_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def markdown_content_previously_was; end + + sig { returns(T.nilable(::String)) } + def markdown_content_was; end + + sig { void } + def markdown_content_will_change!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_markdown_content!; end + + sig { void } + def restore_subproject_id!; end + + sig { void } + def restore_updated_at!; end + + sig { void } + def restore_user_id!; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_created_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id_value; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_markdown_content; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_markdown_content?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def saved_change_to_subproject_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_subproject_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_updated_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_updated_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def saved_change_to_user_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_user_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def subproject_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def subproject_id=(value); end + + sig { returns(T::Boolean) } + def subproject_id?; end + + sig { returns(T.nilable(::Integer)) } + def subproject_id_before_last_save; end + + sig { returns(T.untyped) } + def subproject_id_before_type_cast; end + + sig { returns(T::Boolean) } + def subproject_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def subproject_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def subproject_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def subproject_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def subproject_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def subproject_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def subproject_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def subproject_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def subproject_id_was; end + + sig { void } + def subproject_id_will_change!; end + + sig { returns(::ActiveSupport::TimeWithZone) } + def updated_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def updated_at=(value); end + + sig { returns(T::Boolean) } + def updated_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_before_last_save; end + + sig { returns(T.untyped) } + def updated_at_before_type_cast; end + + sig { returns(T::Boolean) } + def updated_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def updated_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def updated_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def updated_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def updated_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def updated_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_was; end + + sig { void } + def updated_at_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def user_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def user_id=(value); end + + sig { returns(T::Boolean) } + def user_id?; end + + sig { returns(T.nilable(::Integer)) } + def user_id_before_last_save; end + + sig { returns(T.untyped) } + def user_id_before_type_cast; end + + sig { returns(T::Boolean) } + def user_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def user_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def user_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def user_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def user_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def user_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def user_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def user_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def user_id_was; end + + sig { void } + def user_id_will_change!; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_markdown_content?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_subproject_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_updated_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_user_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + end + + module GeneratedRelationMethods + sig { returns(PrivateRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + sig { params(blk: T.proc.params(record: ::Journal).returns(BasicObject)).returns(T::Array[::Journal]) } + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::Journal } } + + sig { returns(T::Array[::Journal]) } + def to_a; end + + sig { returns(T::Array[::Journal]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::Journal } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateAssociationRelationWhereChain + Elem = type_member { { fixed: ::Journal } } + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateAssociationRelation) } + def not(opts, *rest); end + end + + class PrivateCollectionProxy < ::ActiveRecord::Associations::CollectionProxy + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::Journal } } + + sig do + params( + records: T.any(::Journal, T::Enumerable[T.any(::Journal, T::Enumerable[::Journal])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::Journal, T::Enumerable[T.any(::Journal, T::Enumerable[::Journal])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::Journal, T::Enumerable[T.any(::Journal, T::Enumerable[::Journal])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig { returns(T::Array[::Journal]) } + def load_target; end + + sig do + params( + records: T.any(::Journal, T::Enumerable[T.any(::Journal, T::Enumerable[::Journal])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::Journal, T::Enumerable[T.any(::Journal, T::Enumerable[::Journal])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::Journal, T::Enumerable[T.any(::Journal, T::Enumerable[::Journal])]) + ).returns(T::Array[::Journal]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::Journal]) } + def target; end + + sig { returns(T::Array[::Journal]) } + def to_a; end + + sig { returns(T::Array[::Journal]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::Journal } } + + sig { returns(T::Array[::Journal]) } + def to_a; end + + sig { returns(T::Array[::Journal]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::Journal } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateRelationWhereChain + Elem = type_member { { fixed: ::Journal } } + + sig { params(args: T.untyped).returns(PrivateRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateRelation) } + def not(opts, *rest); end + end +end diff --git a/sorbet/rbi/dsl/log_entry.rbi b/sorbet/rbi/dsl/log_entry.rbi new file mode 100644 index 0000000..7224a70 --- /dev/null +++ b/sorbet/rbi/dsl/log_entry.rbi @@ -0,0 +1,1356 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `LogEntry`. +# Please instead update this file by running `bin/tapioca dsl LogEntry`. + + +class LogEntry + include GeneratedAssociationMethods + include GeneratedAttributeMethods + extend CommonRelationMethods + extend GeneratedRelationMethods + + private + + sig { returns(NilClass) } + def to_ary; end + + class << self + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::LogEntry).void)).returns(::LogEntry) } + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::LogEntry).returns(T.untyped))).returns(T::Boolean) } + def any?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def average(column_name); end + + sig { params(block: T.nilable(T.proc.params(object: ::LogEntry).void)).returns(::LogEntry) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::LogEntry).void) + ).returns(T::Array[::LogEntry]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::LogEntry).void)).returns(::LogEntry) } + def build(attributes = nil, &block); end + + sig { params(operation: Symbol, column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def calculate(operation, column_name); end + + sig { params(column_name: T.nilable(T.any(String, Symbol))).returns(Integer) } + sig { params(column_name: NilClass, block: T.proc.params(object: ::LogEntry).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::LogEntry).void)).returns(::LogEntry) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::LogEntry).void) + ).returns(T::Array[::LogEntry]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::LogEntry).void)).returns(::LogEntry) } + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::LogEntry).void)).returns(::LogEntry) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::LogEntry).void) + ).returns(T::Array[::LogEntry]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::LogEntry).void)).returns(::LogEntry) } + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::LogEntry).void) + ).returns(T::Array[::LogEntry]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::LogEntry).void)).returns(::LogEntry) } + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::LogEntry).void) + ).returns(T::Array[::LogEntry]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::LogEntry).void)).returns(::LogEntry) } + def create_or_find_by!(attributes, &block); end + + sig do + params( + records: T.any(::LogEntry, Integer, String, T::Enumerable[T.any(::LogEntry, Integer, String, T::Enumerable[::LogEntry])]) + ).returns(Integer) + end + def delete(*records); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(args); end + + sig do + params( + records: T.any(::LogEntry, Integer, String, T::Enumerable[T.any(::LogEntry, Integer, String, T::Enumerable[::LogEntry])]) + ).returns(T::Array[::LogEntry]) + end + def destroy(*records); end + + sig { returns(T::Array[::LogEntry]) } + def destroy_all; end + + sig { returns(T::Array[::LogEntry]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::LogEntry]) } + def destroy_by(args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::LogEntry)) } + def fifth; end + + sig { returns(::LogEntry) } + def fifth!; end + + sig do + params( + args: T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything]) + ).returns(::LogEntry) + end + sig do + params( + args: T::Array[T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything])] + ).returns(T::Enumerable[::LogEntry]) + end + sig { params(args: NilClass, block: T.proc.params(object: ::LogEntry).void).returns(T.nilable(::LogEntry)) } + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::LogEntry)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::LogEntry) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: ::LogEntry).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[::LogEntry]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: T::Array[::LogEntry]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[T::Enumerator[::LogEntry]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::LogEntry).void) + ).returns(T::Array[::LogEntry]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::LogEntry).void)).returns(::LogEntry) } + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::LogEntry).void) + ).returns(T::Array[::LogEntry]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::LogEntry).void)).returns(::LogEntry) } + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::LogEntry).void) + ).returns(T::Array[::LogEntry]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::LogEntry).void)).returns(::LogEntry) } + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::LogEntry)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::LogEntry) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::LogEntry) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::LogEntry)) } + sig { params(limit: Integer).returns(T::Array[::LogEntry]) } + def first(limit = nil); end + + sig { returns(::LogEntry) } + def first!; end + + sig { returns(T.nilable(::LogEntry)) } + def forty_two; end + + sig { returns(::LogEntry) } + def forty_two!; end + + sig { returns(T.nilable(::LogEntry)) } + def fourth; end + + sig { returns(::LogEntry) } + def fourth!; end + + sig { returns(T::Array[::Integer]) } + def ids; end + + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped, + block: T.proc.params(object: PrivateRelation).void + ).void + end + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped + ).returns(::ActiveRecord::Batches::BatchEnumerator) + end + def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, cursor: primary_key, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert!(attributes, returning: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert_all(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert_all!(attributes, returning: nil); end + + sig { returns(T.nilable(::LogEntry)) } + sig { params(limit: Integer).returns(T::Array[::LogEntry]) } + def last(limit = nil); end + + sig { returns(::LogEntry) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::LogEntry).returns(T.untyped))).returns(T::Boolean) } + def many?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def maximum(column_name); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def member?(record); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def minimum(column_name); end + + sig { params(block: T.nilable(T.proc.params(object: ::LogEntry).void)).returns(::LogEntry) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::LogEntry).void) + ).returns(T::Array[::LogEntry]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::LogEntry).void)).returns(::LogEntry) } + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::LogEntry).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::LogEntry).returns(T.untyped))).returns(T::Boolean) } + def one?(&block); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pick(*column_names); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pluck(*column_names); end + + sig { returns(T.nilable(::LogEntry)) } + def second; end + + sig { returns(::LogEntry) } + def second!; end + + sig { returns(T.nilable(::LogEntry)) } + def second_to_last; end + + sig { returns(::LogEntry) } + def second_to_last!; end + + sig { returns(::LogEntry) } + def sole; end + + sig { params(initial_value_or_column: T.untyped).returns(T.any(Integer, Float, BigDecimal)) } + sig do + type_parameters(:U) + .params( + initial_value_or_column: T.nilable(T.type_parameter(:U)), + block: T.proc.params(object: ::LogEntry).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::LogEntry)) } + sig { params(limit: Integer).returns(T::Array[::LogEntry]) } + def take(limit = nil); end + + sig { returns(::LogEntry) } + def take!; end + + sig { returns(T.nilable(::LogEntry)) } + def third; end + + sig { returns(::LogEntry) } + def third!; end + + sig { returns(T.nilable(::LogEntry)) } + def third_to_last; end + + sig { returns(::LogEntry) } + def third_to_last!; end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert_all(attributes, returning: nil, unique_by: nil); end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::Subproject) } + def build_subproject(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::User) } + def build_user(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Subproject) } + def create_subproject(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Subproject) } + def create_subproject!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::User) } + def create_user(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::User) } + def create_user!(*args, &blk); end + + sig { returns(T.nilable(::Subproject)) } + def reload_subproject; end + + sig { returns(T.nilable(::User)) } + def reload_user; end + + sig { void } + def reset_subproject; end + + sig { void } + def reset_user; end + + sig { returns(T.nilable(::Subproject)) } + def subproject; end + + sig { params(value: T.nilable(::Subproject)).void } + def subproject=(value); end + + sig { returns(T::Boolean) } + def subproject_changed?; end + + sig { returns(T::Boolean) } + def subproject_previously_changed?; end + + sig { returns(T.nilable(::User)) } + def user; end + + sig { params(value: T.nilable(::User)).void } + def user=(value); end + + sig { returns(T::Boolean) } + def user_changed?; end + + sig { returns(T::Boolean) } + def user_previously_changed?; end + end + + module GeneratedAssociationRelationMethods + sig { returns(PrivateAssociationRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateAssociationRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + sig { params(blk: T.proc.params(record: ::LogEntry).returns(BasicObject)).returns(T::Array[::LogEntry]) } + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateAssociationRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::ActiveSupport::TimeWithZone) } + def created_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def created_at=(value); end + + sig { returns(T::Boolean) } + def created_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_before_last_save; end + + sig { returns(T.untyped) } + def created_at_before_type_cast; end + + sig { returns(T::Boolean) } + def created_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_was; end + + sig { void } + def created_at_will_change!; end + + sig { returns(::Integer) } + def id; end + + sig { params(value: ::Integer).returns(::Integer) } + def id=(value); end + + sig { returns(T::Boolean) } + def id?; end + + sig { returns(T.nilable(::Integer)) } + def id_before_last_save; end + + sig { returns(T.untyped) } + def id_before_type_cast; end + + sig { returns(T::Boolean) } + def id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_previously_was; end + + sig { returns(::Integer) } + def id_value; end + + sig { params(value: ::Integer).returns(::Integer) } + def id_value=(value); end + + sig { returns(T::Boolean) } + def id_value?; end + + sig { returns(T.nilable(::Integer)) } + def id_value_before_last_save; end + + sig { returns(T.untyped) } + def id_value_before_type_cast; end + + sig { returns(T::Boolean) } + def id_value_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def id_value_was; end + + sig { void } + def id_value_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def id_was; end + + sig { void } + def id_will_change!; end + + sig { returns(T.untyped) } + def metadata; end + + sig { params(value: T.untyped).returns(T.untyped) } + def metadata=(value); end + + sig { returns(T::Boolean) } + def metadata?; end + + sig { returns(T.untyped) } + def metadata_before_last_save; end + + sig { returns(T.untyped) } + def metadata_before_type_cast; end + + sig { returns(T::Boolean) } + def metadata_came_from_user?; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def metadata_change; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def metadata_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def metadata_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.untyped) } + def metadata_in_database; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def metadata_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def metadata_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.untyped) } + def metadata_previously_was; end + + sig { returns(T.untyped) } + def metadata_was; end + + sig { void } + def metadata_will_change!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_metadata!; end + + sig { void } + def restore_subproject_id!; end + + sig { void } + def restore_updated_at!; end + + sig { void } + def restore_user_id!; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_created_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id_value; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def saved_change_to_metadata; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_metadata?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def saved_change_to_subproject_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_subproject_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_updated_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_updated_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def saved_change_to_user_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_user_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def subproject_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def subproject_id=(value); end + + sig { returns(T::Boolean) } + def subproject_id?; end + + sig { returns(T.nilable(::Integer)) } + def subproject_id_before_last_save; end + + sig { returns(T.untyped) } + def subproject_id_before_type_cast; end + + sig { returns(T::Boolean) } + def subproject_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def subproject_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def subproject_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def subproject_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def subproject_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def subproject_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def subproject_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def subproject_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def subproject_id_was; end + + sig { void } + def subproject_id_will_change!; end + + sig { returns(::ActiveSupport::TimeWithZone) } + def updated_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def updated_at=(value); end + + sig { returns(T::Boolean) } + def updated_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_before_last_save; end + + sig { returns(T.untyped) } + def updated_at_before_type_cast; end + + sig { returns(T::Boolean) } + def updated_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def updated_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def updated_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def updated_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def updated_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def updated_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_was; end + + sig { void } + def updated_at_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def user_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def user_id=(value); end + + sig { returns(T::Boolean) } + def user_id?; end + + sig { returns(T.nilable(::Integer)) } + def user_id_before_last_save; end + + sig { returns(T.untyped) } + def user_id_before_type_cast; end + + sig { returns(T::Boolean) } + def user_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def user_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def user_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def user_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def user_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def user_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def user_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def user_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def user_id_was; end + + sig { void } + def user_id_will_change!; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_metadata?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_subproject_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_updated_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_user_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + end + + module GeneratedRelationMethods + sig { returns(PrivateRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + sig { params(blk: T.proc.params(record: ::LogEntry).returns(BasicObject)).returns(T::Array[::LogEntry]) } + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::LogEntry } } + + sig { returns(T::Array[::LogEntry]) } + def to_a; end + + sig { returns(T::Array[::LogEntry]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::LogEntry } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateAssociationRelationWhereChain + Elem = type_member { { fixed: ::LogEntry } } + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateAssociationRelation) } + def not(opts, *rest); end + end + + class PrivateCollectionProxy < ::ActiveRecord::Associations::CollectionProxy + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::LogEntry } } + + sig do + params( + records: T.any(::LogEntry, T::Enumerable[T.any(::LogEntry, T::Enumerable[::LogEntry])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::LogEntry, T::Enumerable[T.any(::LogEntry, T::Enumerable[::LogEntry])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::LogEntry, T::Enumerable[T.any(::LogEntry, T::Enumerable[::LogEntry])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig { returns(T::Array[::LogEntry]) } + def load_target; end + + sig do + params( + records: T.any(::LogEntry, T::Enumerable[T.any(::LogEntry, T::Enumerable[::LogEntry])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::LogEntry, T::Enumerable[T.any(::LogEntry, T::Enumerable[::LogEntry])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::LogEntry, T::Enumerable[T.any(::LogEntry, T::Enumerable[::LogEntry])]) + ).returns(T::Array[::LogEntry]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::LogEntry]) } + def target; end + + sig { returns(T::Array[::LogEntry]) } + def to_a; end + + sig { returns(T::Array[::LogEntry]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::LogEntry } } + + sig { returns(T::Array[::LogEntry]) } + def to_a; end + + sig { returns(T::Array[::LogEntry]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::LogEntry } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateRelationWhereChain + Elem = type_member { { fixed: ::LogEntry } } + + sig { params(args: T.untyped).returns(PrivateRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateRelation) } + def not(opts, *rest); end + end +end diff --git a/sorbet/rbi/dsl/project.rbi b/sorbet/rbi/dsl/project.rbi new file mode 100644 index 0000000..e905307 --- /dev/null +++ b/sorbet/rbi/dsl/project.rbi @@ -0,0 +1,1336 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Project`. +# Please instead update this file by running `bin/tapioca dsl Project`. + + +class Project + include GeneratedAssociationMethods + include GeneratedAttributeMethods + extend CommonRelationMethods + extend GeneratedRelationMethods + + private + + sig { returns(NilClass) } + def to_ary; end + + class << self + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Project).void)).returns(::Project) } + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::Project).returns(T.untyped))).returns(T::Boolean) } + def any?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def average(column_name); end + + sig { params(block: T.nilable(T.proc.params(object: ::Project).void)).returns(::Project) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Project).void) + ).returns(T::Array[::Project]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Project).void)).returns(::Project) } + def build(attributes = nil, &block); end + + sig { params(operation: Symbol, column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def calculate(operation, column_name); end + + sig { params(column_name: T.nilable(T.any(String, Symbol))).returns(Integer) } + sig { params(column_name: NilClass, block: T.proc.params(object: ::Project).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Project).void)).returns(::Project) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Project).void) + ).returns(T::Array[::Project]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Project).void)).returns(::Project) } + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Project).void)).returns(::Project) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Project).void) + ).returns(T::Array[::Project]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Project).void)).returns(::Project) } + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Project).void) + ).returns(T::Array[::Project]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Project).void)).returns(::Project) } + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Project).void) + ).returns(T::Array[::Project]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Project).void)).returns(::Project) } + def create_or_find_by!(attributes, &block); end + + sig do + params( + records: T.any(::Project, Integer, String, T::Enumerable[T.any(::Project, Integer, String, T::Enumerable[::Project])]) + ).returns(Integer) + end + def delete(*records); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(args); end + + sig do + params( + records: T.any(::Project, Integer, String, T::Enumerable[T.any(::Project, Integer, String, T::Enumerable[::Project])]) + ).returns(T::Array[::Project]) + end + def destroy(*records); end + + sig { returns(T::Array[::Project]) } + def destroy_all; end + + sig { returns(T::Array[::Project]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::Project]) } + def destroy_by(args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::Project)) } + def fifth; end + + sig { returns(::Project) } + def fifth!; end + + sig do + params( + args: T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything]) + ).returns(::Project) + end + sig do + params( + args: T::Array[T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything])] + ).returns(T::Enumerable[::Project]) + end + sig { params(args: NilClass, block: T.proc.params(object: ::Project).void).returns(T.nilable(::Project)) } + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::Project)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::Project) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: ::Project).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[::Project]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: T::Array[::Project]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[T::Enumerator[::Project]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Project).void) + ).returns(T::Array[::Project]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Project).void)).returns(::Project) } + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Project).void) + ).returns(T::Array[::Project]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Project).void)).returns(::Project) } + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Project).void) + ).returns(T::Array[::Project]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Project).void)).returns(::Project) } + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::Project)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::Project) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::Project) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::Project)) } + sig { params(limit: Integer).returns(T::Array[::Project]) } + def first(limit = nil); end + + sig { returns(::Project) } + def first!; end + + sig { returns(T.nilable(::Project)) } + def forty_two; end + + sig { returns(::Project) } + def forty_two!; end + + sig { returns(T.nilable(::Project)) } + def fourth; end + + sig { returns(::Project) } + def fourth!; end + + sig { returns(T::Array[::Integer]) } + def ids; end + + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped, + block: T.proc.params(object: PrivateRelation).void + ).void + end + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped + ).returns(::ActiveRecord::Batches::BatchEnumerator) + end + def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, cursor: primary_key, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert!(attributes, returning: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert_all(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert_all!(attributes, returning: nil); end + + sig { returns(T.nilable(::Project)) } + sig { params(limit: Integer).returns(T::Array[::Project]) } + def last(limit = nil); end + + sig { returns(::Project) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::Project).returns(T.untyped))).returns(T::Boolean) } + def many?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def maximum(column_name); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def member?(record); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def minimum(column_name); end + + sig { params(block: T.nilable(T.proc.params(object: ::Project).void)).returns(::Project) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Project).void) + ).returns(T::Array[::Project]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Project).void)).returns(::Project) } + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Project).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Project).returns(T.untyped))).returns(T::Boolean) } + def one?(&block); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pick(*column_names); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pluck(*column_names); end + + sig { returns(T.nilable(::Project)) } + def second; end + + sig { returns(::Project) } + def second!; end + + sig { returns(T.nilable(::Project)) } + def second_to_last; end + + sig { returns(::Project) } + def second_to_last!; end + + sig { returns(::Project) } + def sole; end + + sig { params(initial_value_or_column: T.untyped).returns(T.any(Integer, Float, BigDecimal)) } + sig do + type_parameters(:U) + .params( + initial_value_or_column: T.nilable(T.type_parameter(:U)), + block: T.proc.params(object: ::Project).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::Project)) } + sig { params(limit: Integer).returns(T::Array[::Project]) } + def take(limit = nil); end + + sig { returns(::Project) } + def take!; end + + sig { returns(T.nilable(::Project)) } + def third; end + + sig { returns(::Project) } + def third!; end + + sig { returns(T.nilable(::Project)) } + def third_to_last; end + + sig { returns(::Project) } + def third_to_last!; end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert_all(attributes, returning: nil, unique_by: nil); end + end + + module GeneratedAssociationMethods + sig { returns(T::Array[T.untyped]) } + def report_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def report_ids=(ids); end + + # This method is created by ActiveRecord on the `Project` class because it declared `has_many :reports`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::Report::PrivateCollectionProxy) } + def reports; end + + sig { params(value: T::Enumerable[::Report]).void } + def reports=(value); end + + sig { returns(T::Array[T.untyped]) } + def subproject_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def subproject_ids=(ids); end + + # This method is created by ActiveRecord on the `Project` class because it declared `has_many :subprojects`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::Subproject::PrivateCollectionProxy) } + def subprojects; end + + sig { params(value: T::Enumerable[::Subproject]).void } + def subprojects=(value); end + end + + module GeneratedAssociationRelationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def active(*args, &blk); end + + sig { returns(PrivateAssociationRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateAssociationRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + sig { params(blk: T.proc.params(record: ::Project).returns(BasicObject)).returns(T::Array[::Project]) } + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateAssociationRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(T.nilable(T::Boolean)) } + def active; end + + sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def active=(value); end + + sig { returns(T::Boolean) } + def active?; end + + sig { returns(T.nilable(T::Boolean)) } + def active_before_last_save; end + + sig { returns(T.untyped) } + def active_before_type_cast; end + + sig { returns(T::Boolean) } + def active_came_from_user?; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def active_change; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def active_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def active_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def active_in_database; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def active_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def active_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def active_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def active_was; end + + sig { void } + def active_will_change!; end + + sig { returns(::ActiveSupport::TimeWithZone) } + def created_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def created_at=(value); end + + sig { returns(T::Boolean) } + def created_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_before_last_save; end + + sig { returns(T.untyped) } + def created_at_before_type_cast; end + + sig { returns(T::Boolean) } + def created_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_was; end + + sig { void } + def created_at_will_change!; end + + sig { returns(T.nilable(::String)) } + def description; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def description=(value); end + + sig { returns(T::Boolean) } + def description?; end + + sig { returns(T.nilable(::String)) } + def description_before_last_save; end + + sig { returns(T.untyped) } + def description_before_type_cast; end + + sig { returns(T::Boolean) } + def description_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def description_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def description_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def description_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def description_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def description_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def description_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def description_previously_was; end + + sig { returns(T.nilable(::String)) } + def description_was; end + + sig { void } + def description_will_change!; end + + sig { returns(::Integer) } + def id; end + + sig { params(value: ::Integer).returns(::Integer) } + def id=(value); end + + sig { returns(T::Boolean) } + def id?; end + + sig { returns(T.nilable(::Integer)) } + def id_before_last_save; end + + sig { returns(T.untyped) } + def id_before_type_cast; end + + sig { returns(T::Boolean) } + def id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_previously_was; end + + sig { returns(::Integer) } + def id_value; end + + sig { params(value: ::Integer).returns(::Integer) } + def id_value=(value); end + + sig { returns(T::Boolean) } + def id_value?; end + + sig { returns(T.nilable(::Integer)) } + def id_value_before_last_save; end + + sig { returns(T.untyped) } + def id_value_before_type_cast; end + + sig { returns(T::Boolean) } + def id_value_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def id_value_was; end + + sig { void } + def id_value_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def id_was; end + + sig { void } + def id_will_change!; end + + sig { returns(T.nilable(::String)) } + def name; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def name=(value); end + + sig { returns(T::Boolean) } + def name?; end + + sig { returns(T.nilable(::String)) } + def name_before_last_save; end + + sig { returns(T.untyped) } + def name_before_type_cast; end + + sig { returns(T::Boolean) } + def name_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def name_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def name_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def name_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def name_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def name_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def name_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def name_previously_was; end + + sig { returns(T.nilable(::String)) } + def name_was; end + + sig { void } + def name_will_change!; end + + sig { void } + def restore_active!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_description!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_name!; end + + sig { void } + def restore_updated_at!; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def saved_change_to_active; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_active?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_created_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_description; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_description?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id_value; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_name; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_name?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_updated_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_updated_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(::ActiveSupport::TimeWithZone) } + def updated_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def updated_at=(value); end + + sig { returns(T::Boolean) } + def updated_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_before_last_save; end + + sig { returns(T.untyped) } + def updated_at_before_type_cast; end + + sig { returns(T::Boolean) } + def updated_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def updated_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def updated_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def updated_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def updated_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def updated_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_was; end + + sig { void } + def updated_at_will_change!; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_active?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_description?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_name?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_updated_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + end + + module GeneratedRelationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def active(*args, &blk); end + + sig { returns(PrivateRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + sig { params(blk: T.proc.params(record: ::Project).returns(BasicObject)).returns(T::Array[::Project]) } + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::Project } } + + sig { returns(T::Array[::Project]) } + def to_a; end + + sig { returns(T::Array[::Project]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::Project } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateAssociationRelationWhereChain + Elem = type_member { { fixed: ::Project } } + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateAssociationRelation) } + def not(opts, *rest); end + end + + class PrivateCollectionProxy < ::ActiveRecord::Associations::CollectionProxy + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::Project } } + + sig do + params( + records: T.any(::Project, T::Enumerable[T.any(::Project, T::Enumerable[::Project])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::Project, T::Enumerable[T.any(::Project, T::Enumerable[::Project])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::Project, T::Enumerable[T.any(::Project, T::Enumerable[::Project])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig { returns(T::Array[::Project]) } + def load_target; end + + sig do + params( + records: T.any(::Project, T::Enumerable[T.any(::Project, T::Enumerable[::Project])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::Project, T::Enumerable[T.any(::Project, T::Enumerable[::Project])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::Project, T::Enumerable[T.any(::Project, T::Enumerable[::Project])]) + ).returns(T::Array[::Project]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::Project]) } + def target; end + + sig { returns(T::Array[::Project]) } + def to_a; end + + sig { returns(T::Array[::Project]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::Project } } + + sig { returns(T::Array[::Project]) } + def to_a; end + + sig { returns(T::Array[::Project]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::Project } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateRelationWhereChain + Elem = type_member { { fixed: ::Project } } + + sig { params(args: T.untyped).returns(PrivateRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateRelation) } + def not(opts, *rest); end + end +end diff --git a/sorbet/rbi/dsl/rails/application_controller.rbi b/sorbet/rbi/dsl/rails/application_controller.rbi new file mode 100644 index 0000000..332de0c --- /dev/null +++ b/sorbet/rbi/dsl/rails/application_controller.rbi @@ -0,0 +1,35 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Rails::ApplicationController`. +# Please instead update this file by running `bin/tapioca dsl Rails::ApplicationController`. + + +class Rails::ApplicationController + include GeneratedUrlHelpersModule + include GeneratedPathHelpersModule + + sig { returns(HelperProxy) } + def helpers; end + + module HelperMethods + include ::Turbo::DriveHelper + include ::Turbo::FramesHelper + include ::Turbo::IncludesHelper + include ::Turbo::StreamsHelper + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + include ::ActionView::Helpers::TagHelper + include ::Turbo::Streams::ActionHelper + include ::ActionText::ContentHelper + include ::ActionText::TagHelper + include ::Importmap::ImportmapTagsHelper + include ::ActionController::Base::HelperMethods + include ::ApplicationHelper + include ::FizzBuzzHelper + end + + class HelperProxy < ::ActionView::Base + include HelperMethods + end +end diff --git a/sorbet/rbi/dsl/rails/conductor/base_controller.rbi b/sorbet/rbi/dsl/rails/conductor/base_controller.rbi new file mode 100644 index 0000000..674d937 --- /dev/null +++ b/sorbet/rbi/dsl/rails/conductor/base_controller.rbi @@ -0,0 +1,35 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Rails::Conductor::BaseController`. +# Please instead update this file by running `bin/tapioca dsl Rails::Conductor::BaseController`. + + +class Rails::Conductor::BaseController + include GeneratedUrlHelpersModule + include GeneratedPathHelpersModule + + sig { returns(HelperProxy) } + def helpers; end + + module HelperMethods + include ::Turbo::DriveHelper + include ::Turbo::FramesHelper + include ::Turbo::IncludesHelper + include ::Turbo::StreamsHelper + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + include ::ActionView::Helpers::TagHelper + include ::Turbo::Streams::ActionHelper + include ::ActionText::ContentHelper + include ::ActionText::TagHelper + include ::Importmap::ImportmapTagsHelper + include ::ActionController::Base::HelperMethods + include ::ApplicationHelper + include ::FizzBuzzHelper + end + + class HelperProxy < ::ActionView::Base + include HelperMethods + end +end diff --git a/sorbet/rbi/dsl/region.rbi b/sorbet/rbi/dsl/region.rbi new file mode 100644 index 0000000..ed6436d --- /dev/null +++ b/sorbet/rbi/dsl/region.rbi @@ -0,0 +1,1202 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Region`. +# Please instead update this file by running `bin/tapioca dsl Region`. + + +class Region + include GeneratedAssociationMethods + include GeneratedAttributeMethods + extend CommonRelationMethods + extend GeneratedRelationMethods + + private + + sig { returns(NilClass) } + def to_ary; end + + class << self + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Region).void)).returns(::Region) } + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::Region).returns(T.untyped))).returns(T::Boolean) } + def any?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def average(column_name); end + + sig { params(block: T.nilable(T.proc.params(object: ::Region).void)).returns(::Region) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Region).void) + ).returns(T::Array[::Region]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Region).void)).returns(::Region) } + def build(attributes = nil, &block); end + + sig { params(operation: Symbol, column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def calculate(operation, column_name); end + + sig { params(column_name: T.nilable(T.any(String, Symbol))).returns(Integer) } + sig { params(column_name: NilClass, block: T.proc.params(object: ::Region).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Region).void)).returns(::Region) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Region).void) + ).returns(T::Array[::Region]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Region).void)).returns(::Region) } + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Region).void)).returns(::Region) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Region).void) + ).returns(T::Array[::Region]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Region).void)).returns(::Region) } + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Region).void) + ).returns(T::Array[::Region]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Region).void)).returns(::Region) } + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Region).void) + ).returns(T::Array[::Region]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Region).void)).returns(::Region) } + def create_or_find_by!(attributes, &block); end + + sig do + params( + records: T.any(::Region, Integer, String, T::Enumerable[T.any(::Region, Integer, String, T::Enumerable[::Region])]) + ).returns(Integer) + end + def delete(*records); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(args); end + + sig do + params( + records: T.any(::Region, Integer, String, T::Enumerable[T.any(::Region, Integer, String, T::Enumerable[::Region])]) + ).returns(T::Array[::Region]) + end + def destroy(*records); end + + sig { returns(T::Array[::Region]) } + def destroy_all; end + + sig { returns(T::Array[::Region]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::Region]) } + def destroy_by(args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::Region)) } + def fifth; end + + sig { returns(::Region) } + def fifth!; end + + sig do + params( + args: T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything]) + ).returns(::Region) + end + sig do + params( + args: T::Array[T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything])] + ).returns(T::Enumerable[::Region]) + end + sig { params(args: NilClass, block: T.proc.params(object: ::Region).void).returns(T.nilable(::Region)) } + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::Region)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::Region) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: ::Region).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[::Region]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: T::Array[::Region]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[T::Enumerator[::Region]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Region).void) + ).returns(T::Array[::Region]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Region).void)).returns(::Region) } + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Region).void) + ).returns(T::Array[::Region]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Region).void)).returns(::Region) } + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Region).void) + ).returns(T::Array[::Region]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Region).void)).returns(::Region) } + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::Region)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::Region) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::Region) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::Region)) } + sig { params(limit: Integer).returns(T::Array[::Region]) } + def first(limit = nil); end + + sig { returns(::Region) } + def first!; end + + sig { returns(T.nilable(::Region)) } + def forty_two; end + + sig { returns(::Region) } + def forty_two!; end + + sig { returns(T.nilable(::Region)) } + def fourth; end + + sig { returns(::Region) } + def fourth!; end + + sig { returns(T::Array[::Integer]) } + def ids; end + + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped, + block: T.proc.params(object: PrivateRelation).void + ).void + end + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped + ).returns(::ActiveRecord::Batches::BatchEnumerator) + end + def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, cursor: primary_key, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert!(attributes, returning: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert_all(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert_all!(attributes, returning: nil); end + + sig { returns(T.nilable(::Region)) } + sig { params(limit: Integer).returns(T::Array[::Region]) } + def last(limit = nil); end + + sig { returns(::Region) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::Region).returns(T.untyped))).returns(T::Boolean) } + def many?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def maximum(column_name); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def member?(record); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def minimum(column_name); end + + sig { params(block: T.nilable(T.proc.params(object: ::Region).void)).returns(::Region) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Region).void) + ).returns(T::Array[::Region]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Region).void)).returns(::Region) } + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Region).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Region).returns(T.untyped))).returns(T::Boolean) } + def one?(&block); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pick(*column_names); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pluck(*column_names); end + + sig { returns(T.nilable(::Region)) } + def second; end + + sig { returns(::Region) } + def second!; end + + sig { returns(T.nilable(::Region)) } + def second_to_last; end + + sig { returns(::Region) } + def second_to_last!; end + + sig { returns(::Region) } + def sole; end + + sig { params(initial_value_or_column: T.untyped).returns(T.any(Integer, Float, BigDecimal)) } + sig do + type_parameters(:U) + .params( + initial_value_or_column: T.nilable(T.type_parameter(:U)), + block: T.proc.params(object: ::Region).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::Region)) } + sig { params(limit: Integer).returns(T::Array[::Region]) } + def take(limit = nil); end + + sig { returns(::Region) } + def take!; end + + sig { returns(T.nilable(::Region)) } + def third; end + + sig { returns(::Region) } + def third!; end + + sig { returns(T.nilable(::Region)) } + def third_to_last; end + + sig { returns(::Region) } + def third_to_last!; end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert_all(attributes, returning: nil, unique_by: nil); end + end + + module GeneratedAssociationMethods + sig { returns(T::Array[T.untyped]) } + def subproject_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def subproject_ids=(ids); end + + # This method is created by ActiveRecord on the `Region` class because it declared `has_many :subprojects`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::Subproject::PrivateCollectionProxy) } + def subprojects; end + + sig { params(value: T::Enumerable[::Subproject]).void } + def subprojects=(value); end + end + + module GeneratedAssociationRelationMethods + sig { returns(PrivateAssociationRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateAssociationRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + sig { params(blk: T.proc.params(record: ::Region).returns(BasicObject)).returns(T::Array[::Region]) } + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateAssociationRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::Integer) } + def id; end + + sig { params(value: ::Integer).returns(::Integer) } + def id=(value); end + + sig { returns(T::Boolean) } + def id?; end + + sig { returns(T.nilable(::Integer)) } + def id_before_last_save; end + + sig { returns(T.untyped) } + def id_before_type_cast; end + + sig { returns(T::Boolean) } + def id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_previously_was; end + + sig { returns(::Integer) } + def id_value; end + + sig { params(value: ::Integer).returns(::Integer) } + def id_value=(value); end + + sig { returns(T::Boolean) } + def id_value?; end + + sig { returns(T.nilable(::Integer)) } + def id_value_before_last_save; end + + sig { returns(T.untyped) } + def id_value_before_type_cast; end + + sig { returns(T::Boolean) } + def id_value_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def id_value_was; end + + sig { void } + def id_value_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def id_was; end + + sig { void } + def id_will_change!; end + + sig { returns(T.nilable(::BigDecimal)) } + def latitude; end + + sig { params(value: T.nilable(::BigDecimal)).returns(T.nilable(::BigDecimal)) } + def latitude=(value); end + + sig { returns(T::Boolean) } + def latitude?; end + + sig { returns(T.nilable(::BigDecimal)) } + def latitude_before_last_save; end + + sig { returns(T.untyped) } + def latitude_before_type_cast; end + + sig { returns(T::Boolean) } + def latitude_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::BigDecimal), T.nilable(::BigDecimal)])) } + def latitude_change; end + + sig { returns(T.nilable([T.nilable(::BigDecimal), T.nilable(::BigDecimal)])) } + def latitude_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def latitude_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::BigDecimal)) } + def latitude_in_database; end + + sig { returns(T.nilable([T.nilable(::BigDecimal), T.nilable(::BigDecimal)])) } + def latitude_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def latitude_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::BigDecimal)) } + def latitude_previously_was; end + + sig { returns(T.nilable(::BigDecimal)) } + def latitude_was; end + + sig { void } + def latitude_will_change!; end + + sig { returns(T.nilable(::BigDecimal)) } + def longitude; end + + sig { params(value: T.nilable(::BigDecimal)).returns(T.nilable(::BigDecimal)) } + def longitude=(value); end + + sig { returns(T::Boolean) } + def longitude?; end + + sig { returns(T.nilable(::BigDecimal)) } + def longitude_before_last_save; end + + sig { returns(T.untyped) } + def longitude_before_type_cast; end + + sig { returns(T::Boolean) } + def longitude_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::BigDecimal), T.nilable(::BigDecimal)])) } + def longitude_change; end + + sig { returns(T.nilable([T.nilable(::BigDecimal), T.nilable(::BigDecimal)])) } + def longitude_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def longitude_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::BigDecimal)) } + def longitude_in_database; end + + sig { returns(T.nilable([T.nilable(::BigDecimal), T.nilable(::BigDecimal)])) } + def longitude_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def longitude_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::BigDecimal)) } + def longitude_previously_was; end + + sig { returns(T.nilable(::BigDecimal)) } + def longitude_was; end + + sig { void } + def longitude_will_change!; end + + sig { returns(T.nilable(::String)) } + def name; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def name=(value); end + + sig { returns(T::Boolean) } + def name?; end + + sig { returns(T.nilable(::String)) } + def name_before_last_save; end + + sig { returns(T.untyped) } + def name_before_type_cast; end + + sig { returns(T::Boolean) } + def name_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def name_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def name_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def name_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def name_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def name_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def name_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def name_previously_was; end + + sig { returns(T.nilable(::String)) } + def name_was; end + + sig { void } + def name_will_change!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_latitude!; end + + sig { void } + def restore_longitude!; end + + sig { void } + def restore_name!; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id_value; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::BigDecimal), T.nilable(::BigDecimal)])) } + def saved_change_to_latitude; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_latitude?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::BigDecimal), T.nilable(::BigDecimal)])) } + def saved_change_to_longitude; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_longitude?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_name; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_name?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_latitude?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_longitude?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_name?(from: T.unsafe(nil), to: T.unsafe(nil)); end + end + + module GeneratedRelationMethods + sig { returns(PrivateRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + sig { params(blk: T.proc.params(record: ::Region).returns(BasicObject)).returns(T::Array[::Region]) } + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::Region } } + + sig { returns(T::Array[::Region]) } + def to_a; end + + sig { returns(T::Array[::Region]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::Region } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateAssociationRelationWhereChain + Elem = type_member { { fixed: ::Region } } + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateAssociationRelation) } + def not(opts, *rest); end + end + + class PrivateCollectionProxy < ::ActiveRecord::Associations::CollectionProxy + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::Region } } + + sig do + params( + records: T.any(::Region, T::Enumerable[T.any(::Region, T::Enumerable[::Region])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::Region, T::Enumerable[T.any(::Region, T::Enumerable[::Region])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::Region, T::Enumerable[T.any(::Region, T::Enumerable[::Region])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig { returns(T::Array[::Region]) } + def load_target; end + + sig do + params( + records: T.any(::Region, T::Enumerable[T.any(::Region, T::Enumerable[::Region])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::Region, T::Enumerable[T.any(::Region, T::Enumerable[::Region])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::Region, T::Enumerable[T.any(::Region, T::Enumerable[::Region])]) + ).returns(T::Array[::Region]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::Region]) } + def target; end + + sig { returns(T::Array[::Region]) } + def to_a; end + + sig { returns(T::Array[::Region]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::Region } } + + sig { returns(T::Array[::Region]) } + def to_a; end + + sig { returns(T::Array[::Region]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::Region } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateRelationWhereChain + Elem = type_member { { fixed: ::Region } } + + sig { params(args: T.untyped).returns(PrivateRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateRelation) } + def not(opts, *rest); end + end +end diff --git a/sorbet/rbi/dsl/report.rbi b/sorbet/rbi/dsl/report.rbi new file mode 100644 index 0000000..0a4ea73 --- /dev/null +++ b/sorbet/rbi/dsl/report.rbi @@ -0,0 +1,1400 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Report`. +# Please instead update this file by running `bin/tapioca dsl Report`. + + +class Report + include GeneratedAssociationMethods + include GeneratedAttributeMethods + extend CommonRelationMethods + extend GeneratedRelationMethods + + private + + sig { returns(NilClass) } + def to_ary; end + + class << self + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Report).void)).returns(::Report) } + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::Report).returns(T.untyped))).returns(T::Boolean) } + def any?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def average(column_name); end + + sig { params(block: T.nilable(T.proc.params(object: ::Report).void)).returns(::Report) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Report).void) + ).returns(T::Array[::Report]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Report).void)).returns(::Report) } + def build(attributes = nil, &block); end + + sig { params(operation: Symbol, column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def calculate(operation, column_name); end + + sig { params(column_name: T.nilable(T.any(String, Symbol))).returns(Integer) } + sig { params(column_name: NilClass, block: T.proc.params(object: ::Report).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Report).void)).returns(::Report) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Report).void) + ).returns(T::Array[::Report]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Report).void)).returns(::Report) } + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Report).void)).returns(::Report) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Report).void) + ).returns(T::Array[::Report]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Report).void)).returns(::Report) } + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Report).void) + ).returns(T::Array[::Report]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Report).void)).returns(::Report) } + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Report).void) + ).returns(T::Array[::Report]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Report).void)).returns(::Report) } + def create_or_find_by!(attributes, &block); end + + sig do + params( + records: T.any(::Report, Integer, String, T::Enumerable[T.any(::Report, Integer, String, T::Enumerable[::Report])]) + ).returns(Integer) + end + def delete(*records); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(args); end + + sig do + params( + records: T.any(::Report, Integer, String, T::Enumerable[T.any(::Report, Integer, String, T::Enumerable[::Report])]) + ).returns(T::Array[::Report]) + end + def destroy(*records); end + + sig { returns(T::Array[::Report]) } + def destroy_all; end + + sig { returns(T::Array[::Report]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::Report]) } + def destroy_by(args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::Report)) } + def fifth; end + + sig { returns(::Report) } + def fifth!; end + + sig do + params( + args: T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything]) + ).returns(::Report) + end + sig do + params( + args: T::Array[T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything])] + ).returns(T::Enumerable[::Report]) + end + sig { params(args: NilClass, block: T.proc.params(object: ::Report).void).returns(T.nilable(::Report)) } + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::Report)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::Report) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: ::Report).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[::Report]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: T::Array[::Report]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[T::Enumerator[::Report]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Report).void) + ).returns(T::Array[::Report]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Report).void)).returns(::Report) } + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Report).void) + ).returns(T::Array[::Report]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Report).void)).returns(::Report) } + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Report).void) + ).returns(T::Array[::Report]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Report).void)).returns(::Report) } + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::Report)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::Report) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::Report) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::Report)) } + sig { params(limit: Integer).returns(T::Array[::Report]) } + def first(limit = nil); end + + sig { returns(::Report) } + def first!; end + + sig { returns(T.nilable(::Report)) } + def forty_two; end + + sig { returns(::Report) } + def forty_two!; end + + sig { returns(T.nilable(::Report)) } + def fourth; end + + sig { returns(::Report) } + def fourth!; end + + sig { returns(T::Array[::Integer]) } + def ids; end + + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped, + block: T.proc.params(object: PrivateRelation).void + ).void + end + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped + ).returns(::ActiveRecord::Batches::BatchEnumerator) + end + def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, cursor: primary_key, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert!(attributes, returning: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert_all(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert_all!(attributes, returning: nil); end + + sig { returns(T.nilable(::Report)) } + sig { params(limit: Integer).returns(T::Array[::Report]) } + def last(limit = nil); end + + sig { returns(::Report) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::Report).returns(T.untyped))).returns(T::Boolean) } + def many?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def maximum(column_name); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def member?(record); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def minimum(column_name); end + + sig { params(block: T.nilable(T.proc.params(object: ::Report).void)).returns(::Report) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Report).void) + ).returns(T::Array[::Report]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Report).void)).returns(::Report) } + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Report).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Report).returns(T.untyped))).returns(T::Boolean) } + def one?(&block); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pick(*column_names); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pluck(*column_names); end + + sig { returns(T.nilable(::Report)) } + def second; end + + sig { returns(::Report) } + def second!; end + + sig { returns(T.nilable(::Report)) } + def second_to_last; end + + sig { returns(::Report) } + def second_to_last!; end + + sig { returns(::Report) } + def sole; end + + sig { params(initial_value_or_column: T.untyped).returns(T.any(Integer, Float, BigDecimal)) } + sig do + type_parameters(:U) + .params( + initial_value_or_column: T.nilable(T.type_parameter(:U)), + block: T.proc.params(object: ::Report).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::Report)) } + sig { params(limit: Integer).returns(T::Array[::Report]) } + def take(limit = nil); end + + sig { returns(::Report) } + def take!; end + + sig { returns(T.nilable(::Report)) } + def third; end + + sig { returns(::Report) } + def third!; end + + sig { returns(T.nilable(::Report)) } + def third_to_last; end + + sig { returns(::Report) } + def third_to_last!; end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert_all(attributes, returning: nil, unique_by: nil); end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::Project) } + def build_project(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Project) } + def create_project(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Project) } + def create_project!(*args, &blk); end + + sig { returns(T.nilable(::Project)) } + def project; end + + sig { params(value: T.nilable(::Project)).void } + def project=(value); end + + sig { returns(T::Boolean) } + def project_changed?; end + + sig { returns(T::Boolean) } + def project_previously_changed?; end + + sig { returns(T.nilable(::Project)) } + def reload_project; end + + sig { void } + def reset_project; end + + sig { returns(T::Array[T.untyped]) } + def snapshot_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def snapshot_ids=(ids); end + + # This method is created by ActiveRecord on the `Report` class because it declared `has_many :snapshots`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::Snapshot::PrivateCollectionProxy) } + def snapshots; end + + sig { params(value: T::Enumerable[::Snapshot]).void } + def snapshots=(value); end + end + + module GeneratedAssociationRelationMethods + sig { returns(PrivateAssociationRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateAssociationRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + sig { params(blk: T.proc.params(record: ::Report).returns(BasicObject)).returns(T::Array[::Report]) } + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateAssociationRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::ActiveSupport::TimeWithZone) } + def created_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def created_at=(value); end + + sig { returns(T::Boolean) } + def created_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_before_last_save; end + + sig { returns(T.untyped) } + def created_at_before_type_cast; end + + sig { returns(T::Boolean) } + def created_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_was; end + + sig { void } + def created_at_will_change!; end + + sig { returns(T.nilable(::Date)) } + def end_date; end + + sig { params(value: T.nilable(::Date)).returns(T.nilable(::Date)) } + def end_date=(value); end + + sig { returns(T::Boolean) } + def end_date?; end + + sig { returns(T.nilable(::Date)) } + def end_date_before_last_save; end + + sig { returns(T.untyped) } + def end_date_before_type_cast; end + + sig { returns(T::Boolean) } + def end_date_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Date), T.nilable(::Date)])) } + def end_date_change; end + + sig { returns(T.nilable([T.nilable(::Date), T.nilable(::Date)])) } + def end_date_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def end_date_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Date)) } + def end_date_in_database; end + + sig { returns(T.nilable([T.nilable(::Date), T.nilable(::Date)])) } + def end_date_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def end_date_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Date)) } + def end_date_previously_was; end + + sig { returns(T.nilable(::Date)) } + def end_date_was; end + + sig { void } + def end_date_will_change!; end + + sig { returns(T.nilable(::Date)) } + def expiry; end + + sig { params(value: T.nilable(::Date)).returns(T.nilable(::Date)) } + def expiry=(value); end + + sig { returns(T::Boolean) } + def expiry?; end + + sig { returns(T.nilable(::Date)) } + def expiry_before_last_save; end + + sig { returns(T.untyped) } + def expiry_before_type_cast; end + + sig { returns(T::Boolean) } + def expiry_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Date), T.nilable(::Date)])) } + def expiry_change; end + + sig { returns(T.nilable([T.nilable(::Date), T.nilable(::Date)])) } + def expiry_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def expiry_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Date)) } + def expiry_in_database; end + + sig { returns(T.nilable([T.nilable(::Date), T.nilable(::Date)])) } + def expiry_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def expiry_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Date)) } + def expiry_previously_was; end + + sig { returns(T.nilable(::Date)) } + def expiry_was; end + + sig { void } + def expiry_will_change!; end + + sig { returns(::Integer) } + def id; end + + sig { params(value: ::Integer).returns(::Integer) } + def id=(value); end + + sig { returns(T::Boolean) } + def id?; end + + sig { returns(T.nilable(::Integer)) } + def id_before_last_save; end + + sig { returns(T.untyped) } + def id_before_type_cast; end + + sig { returns(T::Boolean) } + def id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_previously_was; end + + sig { returns(::Integer) } + def id_value; end + + sig { params(value: ::Integer).returns(::Integer) } + def id_value=(value); end + + sig { returns(T::Boolean) } + def id_value?; end + + sig { returns(T.nilable(::Integer)) } + def id_value_before_last_save; end + + sig { returns(T.untyped) } + def id_value_before_type_cast; end + + sig { returns(T::Boolean) } + def id_value_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def id_value_was; end + + sig { void } + def id_value_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def id_was; end + + sig { void } + def id_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def project_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def project_id=(value); end + + sig { returns(T::Boolean) } + def project_id?; end + + sig { returns(T.nilable(::Integer)) } + def project_id_before_last_save; end + + sig { returns(T.untyped) } + def project_id_before_type_cast; end + + sig { returns(T::Boolean) } + def project_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def project_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def project_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def project_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def project_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def project_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def project_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def project_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def project_id_was; end + + sig { void } + def project_id_will_change!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_end_date!; end + + sig { void } + def restore_expiry!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_project_id!; end + + sig { void } + def restore_start_date!; end + + sig { void } + def restore_updated_at!; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_created_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::Date), T.nilable(::Date)])) } + def saved_change_to_end_date; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_end_date?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::Date), T.nilable(::Date)])) } + def saved_change_to_expiry; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_expiry?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id_value; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def saved_change_to_project_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_project_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::Date), T.nilable(::Date)])) } + def saved_change_to_start_date; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_start_date?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_updated_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_updated_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Date)) } + def start_date; end + + sig { params(value: T.nilable(::Date)).returns(T.nilable(::Date)) } + def start_date=(value); end + + sig { returns(T::Boolean) } + def start_date?; end + + sig { returns(T.nilable(::Date)) } + def start_date_before_last_save; end + + sig { returns(T.untyped) } + def start_date_before_type_cast; end + + sig { returns(T::Boolean) } + def start_date_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Date), T.nilable(::Date)])) } + def start_date_change; end + + sig { returns(T.nilable([T.nilable(::Date), T.nilable(::Date)])) } + def start_date_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def start_date_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Date)) } + def start_date_in_database; end + + sig { returns(T.nilable([T.nilable(::Date), T.nilable(::Date)])) } + def start_date_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def start_date_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Date)) } + def start_date_previously_was; end + + sig { returns(T.nilable(::Date)) } + def start_date_was; end + + sig { void } + def start_date_will_change!; end + + sig { returns(::ActiveSupport::TimeWithZone) } + def updated_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def updated_at=(value); end + + sig { returns(T::Boolean) } + def updated_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_before_last_save; end + + sig { returns(T.untyped) } + def updated_at_before_type_cast; end + + sig { returns(T::Boolean) } + def updated_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def updated_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def updated_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def updated_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def updated_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def updated_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_was; end + + sig { void } + def updated_at_will_change!; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_end_date?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_expiry?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_project_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_start_date?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_updated_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + end + + module GeneratedRelationMethods + sig { returns(PrivateRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + sig { params(blk: T.proc.params(record: ::Report).returns(BasicObject)).returns(T::Array[::Report]) } + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::Report } } + + sig { returns(T::Array[::Report]) } + def to_a; end + + sig { returns(T::Array[::Report]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::Report } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateAssociationRelationWhereChain + Elem = type_member { { fixed: ::Report } } + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateAssociationRelation) } + def not(opts, *rest); end + end + + class PrivateCollectionProxy < ::ActiveRecord::Associations::CollectionProxy + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::Report } } + + sig do + params( + records: T.any(::Report, T::Enumerable[T.any(::Report, T::Enumerable[::Report])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::Report, T::Enumerable[T.any(::Report, T::Enumerable[::Report])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::Report, T::Enumerable[T.any(::Report, T::Enumerable[::Report])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig { returns(T::Array[::Report]) } + def load_target; end + + sig do + params( + records: T.any(::Report, T::Enumerable[T.any(::Report, T::Enumerable[::Report])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::Report, T::Enumerable[T.any(::Report, T::Enumerable[::Report])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::Report, T::Enumerable[T.any(::Report, T::Enumerable[::Report])]) + ).returns(T::Array[::Report]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::Report]) } + def target; end + + sig { returns(T::Array[::Report]) } + def to_a; end + + sig { returns(T::Array[::Report]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::Report } } + + sig { returns(T::Array[::Report]) } + def to_a; end + + sig { returns(T::Array[::Report]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::Report } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateRelationWhereChain + Elem = type_member { { fixed: ::Report } } + + sig { params(args: T.untyped).returns(PrivateRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateRelation) } + def not(opts, *rest); end + end +end diff --git a/sorbet/rbi/dsl/snapshot.rbi b/sorbet/rbi/dsl/snapshot.rbi new file mode 100644 index 0000000..b922937 --- /dev/null +++ b/sorbet/rbi/dsl/snapshot.rbi @@ -0,0 +1,1272 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Snapshot`. +# Please instead update this file by running `bin/tapioca dsl Snapshot`. + + +class Snapshot + include GeneratedAssociationMethods + include GeneratedAttributeMethods + extend CommonRelationMethods + extend GeneratedRelationMethods + + private + + sig { returns(NilClass) } + def to_ary; end + + class << self + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Snapshot).void)).returns(::Snapshot) } + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::Snapshot).returns(T.untyped))).returns(T::Boolean) } + def any?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def average(column_name); end + + sig { params(block: T.nilable(T.proc.params(object: ::Snapshot).void)).returns(::Snapshot) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Snapshot).void) + ).returns(T::Array[::Snapshot]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Snapshot).void)).returns(::Snapshot) } + def build(attributes = nil, &block); end + + sig { params(operation: Symbol, column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def calculate(operation, column_name); end + + sig { params(column_name: T.nilable(T.any(String, Symbol))).returns(Integer) } + sig { params(column_name: NilClass, block: T.proc.params(object: ::Snapshot).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Snapshot).void)).returns(::Snapshot) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Snapshot).void) + ).returns(T::Array[::Snapshot]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Snapshot).void)).returns(::Snapshot) } + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Snapshot).void)).returns(::Snapshot) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Snapshot).void) + ).returns(T::Array[::Snapshot]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Snapshot).void)).returns(::Snapshot) } + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Snapshot).void) + ).returns(T::Array[::Snapshot]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Snapshot).void)).returns(::Snapshot) } + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Snapshot).void) + ).returns(T::Array[::Snapshot]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Snapshot).void)).returns(::Snapshot) } + def create_or_find_by!(attributes, &block); end + + sig do + params( + records: T.any(::Snapshot, Integer, String, T::Enumerable[T.any(::Snapshot, Integer, String, T::Enumerable[::Snapshot])]) + ).returns(Integer) + end + def delete(*records); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(args); end + + sig do + params( + records: T.any(::Snapshot, Integer, String, T::Enumerable[T.any(::Snapshot, Integer, String, T::Enumerable[::Snapshot])]) + ).returns(T::Array[::Snapshot]) + end + def destroy(*records); end + + sig { returns(T::Array[::Snapshot]) } + def destroy_all; end + + sig { returns(T::Array[::Snapshot]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::Snapshot]) } + def destroy_by(args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::Snapshot)) } + def fifth; end + + sig { returns(::Snapshot) } + def fifth!; end + + sig do + params( + args: T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything]) + ).returns(::Snapshot) + end + sig do + params( + args: T::Array[T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything])] + ).returns(T::Enumerable[::Snapshot]) + end + sig { params(args: NilClass, block: T.proc.params(object: ::Snapshot).void).returns(T.nilable(::Snapshot)) } + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::Snapshot)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::Snapshot) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: ::Snapshot).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[::Snapshot]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: T::Array[::Snapshot]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[T::Enumerator[::Snapshot]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Snapshot).void) + ).returns(T::Array[::Snapshot]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Snapshot).void)).returns(::Snapshot) } + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Snapshot).void) + ).returns(T::Array[::Snapshot]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Snapshot).void)).returns(::Snapshot) } + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Snapshot).void) + ).returns(T::Array[::Snapshot]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Snapshot).void)).returns(::Snapshot) } + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::Snapshot)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::Snapshot) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::Snapshot) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::Snapshot)) } + sig { params(limit: Integer).returns(T::Array[::Snapshot]) } + def first(limit = nil); end + + sig { returns(::Snapshot) } + def first!; end + + sig { returns(T.nilable(::Snapshot)) } + def forty_two; end + + sig { returns(::Snapshot) } + def forty_two!; end + + sig { returns(T.nilable(::Snapshot)) } + def fourth; end + + sig { returns(::Snapshot) } + def fourth!; end + + sig { returns(T::Array[::Integer]) } + def ids; end + + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped, + block: T.proc.params(object: PrivateRelation).void + ).void + end + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped + ).returns(::ActiveRecord::Batches::BatchEnumerator) + end + def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, cursor: primary_key, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert!(attributes, returning: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert_all(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert_all!(attributes, returning: nil); end + + sig { returns(T.nilable(::Snapshot)) } + sig { params(limit: Integer).returns(T::Array[::Snapshot]) } + def last(limit = nil); end + + sig { returns(::Snapshot) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::Snapshot).returns(T.untyped))).returns(T::Boolean) } + def many?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def maximum(column_name); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def member?(record); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def minimum(column_name); end + + sig { params(block: T.nilable(T.proc.params(object: ::Snapshot).void)).returns(::Snapshot) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Snapshot).void) + ).returns(T::Array[::Snapshot]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Snapshot).void)).returns(::Snapshot) } + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Snapshot).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Snapshot).returns(T.untyped))).returns(T::Boolean) } + def one?(&block); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pick(*column_names); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pluck(*column_names); end + + sig { returns(T.nilable(::Snapshot)) } + def second; end + + sig { returns(::Snapshot) } + def second!; end + + sig { returns(T.nilable(::Snapshot)) } + def second_to_last; end + + sig { returns(::Snapshot) } + def second_to_last!; end + + sig { returns(::Snapshot) } + def sole; end + + sig { params(initial_value_or_column: T.untyped).returns(T.any(Integer, Float, BigDecimal)) } + sig do + type_parameters(:U) + .params( + initial_value_or_column: T.nilable(T.type_parameter(:U)), + block: T.proc.params(object: ::Snapshot).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::Snapshot)) } + sig { params(limit: Integer).returns(T::Array[::Snapshot]) } + def take(limit = nil); end + + sig { returns(::Snapshot) } + def take!; end + + sig { returns(T.nilable(::Snapshot)) } + def third; end + + sig { returns(::Snapshot) } + def third!; end + + sig { returns(T.nilable(::Snapshot)) } + def third_to_last; end + + sig { returns(::Snapshot) } + def third_to_last!; end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert_all(attributes, returning: nil, unique_by: nil); end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::Report) } + def build_report(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Report) } + def create_report(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Report) } + def create_report!(*args, &blk); end + + sig { returns(T.nilable(::Report)) } + def reload_report; end + + sig { returns(T.nilable(::Report)) } + def report; end + + sig { params(value: T.nilable(::Report)).void } + def report=(value); end + + sig { returns(T::Boolean) } + def report_changed?; end + + sig { returns(T::Boolean) } + def report_previously_changed?; end + + sig { void } + def reset_report; end + end + + module GeneratedAssociationRelationMethods + sig { returns(PrivateAssociationRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateAssociationRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + sig { params(blk: T.proc.params(record: ::Snapshot).returns(BasicObject)).returns(T::Array[::Snapshot]) } + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateAssociationRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(T.untyped) } + def aggregated_data; end + + sig { params(value: T.untyped).returns(T.untyped) } + def aggregated_data=(value); end + + sig { returns(T::Boolean) } + def aggregated_data?; end + + sig { returns(T.untyped) } + def aggregated_data_before_last_save; end + + sig { returns(T.untyped) } + def aggregated_data_before_type_cast; end + + sig { returns(T::Boolean) } + def aggregated_data_came_from_user?; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def aggregated_data_change; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def aggregated_data_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def aggregated_data_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.untyped) } + def aggregated_data_in_database; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def aggregated_data_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def aggregated_data_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.untyped) } + def aggregated_data_previously_was; end + + sig { returns(T.untyped) } + def aggregated_data_was; end + + sig { void } + def aggregated_data_will_change!; end + + sig { returns(::ActiveSupport::TimeWithZone) } + def created_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def created_at=(value); end + + sig { returns(T::Boolean) } + def created_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_before_last_save; end + + sig { returns(T.untyped) } + def created_at_before_type_cast; end + + sig { returns(T::Boolean) } + def created_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_was; end + + sig { void } + def created_at_will_change!; end + + sig { returns(::Integer) } + def id; end + + sig { params(value: ::Integer).returns(::Integer) } + def id=(value); end + + sig { returns(T::Boolean) } + def id?; end + + sig { returns(T.nilable(::Integer)) } + def id_before_last_save; end + + sig { returns(T.untyped) } + def id_before_type_cast; end + + sig { returns(T::Boolean) } + def id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_previously_was; end + + sig { returns(::Integer) } + def id_value; end + + sig { params(value: ::Integer).returns(::Integer) } + def id_value=(value); end + + sig { returns(T::Boolean) } + def id_value?; end + + sig { returns(T.nilable(::Integer)) } + def id_value_before_last_save; end + + sig { returns(T.untyped) } + def id_value_before_type_cast; end + + sig { returns(T::Boolean) } + def id_value_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def id_value_was; end + + sig { void } + def id_value_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def id_was; end + + sig { void } + def id_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def report_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def report_id=(value); end + + sig { returns(T::Boolean) } + def report_id?; end + + sig { returns(T.nilable(::Integer)) } + def report_id_before_last_save; end + + sig { returns(T.untyped) } + def report_id_before_type_cast; end + + sig { returns(T::Boolean) } + def report_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def report_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def report_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def report_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def report_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def report_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def report_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def report_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def report_id_was; end + + sig { void } + def report_id_will_change!; end + + sig { void } + def restore_aggregated_data!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_report_id!; end + + sig { void } + def restore_updated_at!; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def saved_change_to_aggregated_data; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_aggregated_data?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_created_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id_value; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def saved_change_to_report_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_report_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_updated_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_updated_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(::ActiveSupport::TimeWithZone) } + def updated_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def updated_at=(value); end + + sig { returns(T::Boolean) } + def updated_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_before_last_save; end + + sig { returns(T.untyped) } + def updated_at_before_type_cast; end + + sig { returns(T::Boolean) } + def updated_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def updated_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def updated_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def updated_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def updated_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def updated_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_was; end + + sig { void } + def updated_at_will_change!; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_aggregated_data?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_report_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_updated_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + end + + module GeneratedRelationMethods + sig { returns(PrivateRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + sig { params(blk: T.proc.params(record: ::Snapshot).returns(BasicObject)).returns(T::Array[::Snapshot]) } + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::Snapshot } } + + sig { returns(T::Array[::Snapshot]) } + def to_a; end + + sig { returns(T::Array[::Snapshot]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::Snapshot } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateAssociationRelationWhereChain + Elem = type_member { { fixed: ::Snapshot } } + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateAssociationRelation) } + def not(opts, *rest); end + end + + class PrivateCollectionProxy < ::ActiveRecord::Associations::CollectionProxy + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::Snapshot } } + + sig do + params( + records: T.any(::Snapshot, T::Enumerable[T.any(::Snapshot, T::Enumerable[::Snapshot])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::Snapshot, T::Enumerable[T.any(::Snapshot, T::Enumerable[::Snapshot])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::Snapshot, T::Enumerable[T.any(::Snapshot, T::Enumerable[::Snapshot])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig { returns(T::Array[::Snapshot]) } + def load_target; end + + sig do + params( + records: T.any(::Snapshot, T::Enumerable[T.any(::Snapshot, T::Enumerable[::Snapshot])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::Snapshot, T::Enumerable[T.any(::Snapshot, T::Enumerable[::Snapshot])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::Snapshot, T::Enumerable[T.any(::Snapshot, T::Enumerable[::Snapshot])]) + ).returns(T::Array[::Snapshot]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::Snapshot]) } + def target; end + + sig { returns(T::Array[::Snapshot]) } + def to_a; end + + sig { returns(T::Array[::Snapshot]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::Snapshot } } + + sig { returns(T::Array[::Snapshot]) } + def to_a; end + + sig { returns(T::Array[::Snapshot]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::Snapshot } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateRelationWhereChain + Elem = type_member { { fixed: ::Snapshot } } + + sig { params(args: T.untyped).returns(PrivateRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateRelation) } + def not(opts, *rest); end + end +end diff --git a/sorbet/rbi/dsl/solid_cable/message.rbi b/sorbet/rbi/dsl/solid_cable/message.rbi new file mode 100644 index 0000000..d35c0bd --- /dev/null +++ b/sorbet/rbi/dsl/solid_cable/message.rbi @@ -0,0 +1,1333 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `SolidCable::Message`. +# Please instead update this file by running `bin/tapioca dsl SolidCable::Message`. + + +class SolidCable::Message + include GeneratedAttributeMethods + extend CommonRelationMethods + extend GeneratedRelationMethods + + private + + sig { returns(NilClass) } + def to_ary; end + + class << self + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidCable::Message).void) + ).returns(::SolidCable::Message) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidCable::Message).returns(T.untyped)) + ).returns(T::Boolean) + end + def any?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def average(column_name); end + + sig { params(block: T.nilable(T.proc.params(object: ::SolidCable::Message).void)).returns(::SolidCable::Message) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidCable::Message).void) + ).returns(T::Array[::SolidCable::Message]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidCable::Message).void) + ).returns(::SolidCable::Message) + end + def build(attributes = nil, &block); end + + sig { params(operation: Symbol, column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def calculate(operation, column_name); end + + sig { params(column_name: T.nilable(T.any(String, Symbol))).returns(Integer) } + sig { params(column_name: NilClass, block: T.proc.params(object: ::SolidCable::Message).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::SolidCable::Message).void)).returns(::SolidCable::Message) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidCable::Message).void) + ).returns(T::Array[::SolidCable::Message]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidCable::Message).void) + ).returns(::SolidCable::Message) + end + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::SolidCable::Message).void)).returns(::SolidCable::Message) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidCable::Message).void) + ).returns(T::Array[::SolidCable::Message]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidCable::Message).void) + ).returns(::SolidCable::Message) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidCable::Message).void) + ).returns(T::Array[::SolidCable::Message]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidCable::Message).void) + ).returns(::SolidCable::Message) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidCable::Message).void) + ).returns(T::Array[::SolidCable::Message]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidCable::Message).void) + ).returns(::SolidCable::Message) + end + def create_or_find_by!(attributes, &block); end + + sig do + params( + records: T.any(::SolidCable::Message, Integer, String, T::Enumerable[T.any(::SolidCable::Message, Integer, String, T::Enumerable[::SolidCable::Message])]) + ).returns(Integer) + end + def delete(*records); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(args); end + + sig do + params( + records: T.any(::SolidCable::Message, Integer, String, T::Enumerable[T.any(::SolidCable::Message, Integer, String, T::Enumerable[::SolidCable::Message])]) + ).returns(T::Array[::SolidCable::Message]) + end + def destroy(*records); end + + sig { returns(T::Array[::SolidCable::Message]) } + def destroy_all; end + + sig { returns(T::Array[::SolidCable::Message]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::SolidCable::Message]) } + def destroy_by(args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::SolidCable::Message)) } + def fifth; end + + sig { returns(::SolidCable::Message) } + def fifth!; end + + sig do + params( + args: T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything]) + ).returns(::SolidCable::Message) + end + sig do + params( + args: T::Array[T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything])] + ).returns(T::Enumerable[::SolidCable::Message]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::SolidCable::Message).void + ).returns(T.nilable(::SolidCable::Message)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::SolidCable::Message)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::SolidCable::Message) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: ::SolidCable::Message).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[::SolidCable::Message]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: T::Array[::SolidCable::Message]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[T::Enumerator[::SolidCable::Message]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidCable::Message).void) + ).returns(T::Array[::SolidCable::Message]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidCable::Message).void) + ).returns(::SolidCable::Message) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidCable::Message).void) + ).returns(T::Array[::SolidCable::Message]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidCable::Message).void) + ).returns(::SolidCable::Message) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidCable::Message).void) + ).returns(T::Array[::SolidCable::Message]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidCable::Message).void) + ).returns(::SolidCable::Message) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::SolidCable::Message)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::SolidCable::Message) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::SolidCable::Message) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::SolidCable::Message)) } + sig { params(limit: Integer).returns(T::Array[::SolidCable::Message]) } + def first(limit = nil); end + + sig { returns(::SolidCable::Message) } + def first!; end + + sig { returns(T.nilable(::SolidCable::Message)) } + def forty_two; end + + sig { returns(::SolidCable::Message) } + def forty_two!; end + + sig { returns(T.nilable(::SolidCable::Message)) } + def fourth; end + + sig { returns(::SolidCable::Message) } + def fourth!; end + + sig { returns(T::Array[::Integer]) } + def ids; end + + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped, + block: T.proc.params(object: PrivateRelation).void + ).void + end + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped + ).returns(::ActiveRecord::Batches::BatchEnumerator) + end + def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, cursor: primary_key, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert!(attributes, returning: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert_all(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert_all!(attributes, returning: nil); end + + sig { returns(T.nilable(::SolidCable::Message)) } + sig { params(limit: Integer).returns(T::Array[::SolidCable::Message]) } + def last(limit = nil); end + + sig { returns(::SolidCable::Message) } + def last!; end + + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidCable::Message).returns(T.untyped)) + ).returns(T::Boolean) + end + def many?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def maximum(column_name); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def member?(record); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def minimum(column_name); end + + sig { params(block: T.nilable(T.proc.params(object: ::SolidCable::Message).void)).returns(::SolidCable::Message) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidCable::Message).void) + ).returns(T::Array[::SolidCable::Message]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidCable::Message).void) + ).returns(::SolidCable::Message) + end + def new(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidCable::Message).returns(T.untyped)) + ).returns(T::Boolean) + end + def none?(&block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidCable::Message).returns(T.untyped)) + ).returns(T::Boolean) + end + def one?(&block); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pick(*column_names); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pluck(*column_names); end + + sig { returns(T.nilable(::SolidCable::Message)) } + def second; end + + sig { returns(::SolidCable::Message) } + def second!; end + + sig { returns(T.nilable(::SolidCable::Message)) } + def second_to_last; end + + sig { returns(::SolidCable::Message) } + def second_to_last!; end + + sig { returns(::SolidCable::Message) } + def sole; end + + sig { params(initial_value_or_column: T.untyped).returns(T.any(Integer, Float, BigDecimal)) } + sig do + type_parameters(:U) + .params( + initial_value_or_column: T.nilable(T.type_parameter(:U)), + block: T.proc.params(object: ::SolidCable::Message).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::SolidCable::Message)) } + sig { params(limit: Integer).returns(T::Array[::SolidCable::Message]) } + def take(limit = nil); end + + sig { returns(::SolidCable::Message) } + def take!; end + + sig { returns(T.nilable(::SolidCable::Message)) } + def third; end + + sig { returns(::SolidCable::Message) } + def third!; end + + sig { returns(T.nilable(::SolidCable::Message)) } + def third_to_last; end + + sig { returns(::SolidCable::Message) } + def third_to_last!; end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert_all(attributes, returning: nil, unique_by: nil); end + end + + module GeneratedAssociationRelationMethods + sig { returns(PrivateAssociationRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def broadcastable(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateAssociationRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + sig do + params( + blk: T.proc.params(record: ::SolidCable::Message).returns(BasicObject) + ).returns(T::Array[::SolidCable::Message]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def trimmable(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateAssociationRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::String) } + def channel; end + + sig { params(value: ::String).returns(::String) } + def channel=(value); end + + sig { returns(T::Boolean) } + def channel?; end + + sig { returns(T.nilable(::String)) } + def channel_before_last_save; end + + sig { returns(T.untyped) } + def channel_before_type_cast; end + + sig { returns(T::Boolean) } + def channel_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def channel_change; end + + sig { returns(T.nilable([::String, ::String])) } + def channel_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def channel_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(::Integer) } + def channel_hash; end + + sig { params(value: ::Integer).returns(::Integer) } + def channel_hash=(value); end + + sig { returns(T::Boolean) } + def channel_hash?; end + + sig { returns(T.nilable(::Integer)) } + def channel_hash_before_last_save; end + + sig { returns(T.untyped) } + def channel_hash_before_type_cast; end + + sig { returns(T::Boolean) } + def channel_hash_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def channel_hash_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def channel_hash_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def channel_hash_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def channel_hash_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def channel_hash_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def channel_hash_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def channel_hash_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def channel_hash_was; end + + sig { void } + def channel_hash_will_change!; end + + sig { returns(T.nilable(::String)) } + def channel_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def channel_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def channel_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def channel_previously_was; end + + sig { returns(T.nilable(::String)) } + def channel_was; end + + sig { void } + def channel_will_change!; end + + sig { returns(::ActiveSupport::TimeWithZone) } + def created_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def created_at=(value); end + + sig { returns(T::Boolean) } + def created_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_before_last_save; end + + sig { returns(T.untyped) } + def created_at_before_type_cast; end + + sig { returns(T::Boolean) } + def created_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_was; end + + sig { void } + def created_at_will_change!; end + + sig { returns(::Integer) } + def id; end + + sig { params(value: ::Integer).returns(::Integer) } + def id=(value); end + + sig { returns(T::Boolean) } + def id?; end + + sig { returns(T.nilable(::Integer)) } + def id_before_last_save; end + + sig { returns(T.untyped) } + def id_before_type_cast; end + + sig { returns(T::Boolean) } + def id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_previously_was; end + + sig { returns(::Integer) } + def id_value; end + + sig { params(value: ::Integer).returns(::Integer) } + def id_value=(value); end + + sig { returns(T::Boolean) } + def id_value?; end + + sig { returns(T.nilable(::Integer)) } + def id_value_before_last_save; end + + sig { returns(T.untyped) } + def id_value_before_type_cast; end + + sig { returns(T::Boolean) } + def id_value_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def id_value_was; end + + sig { void } + def id_value_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def id_was; end + + sig { void } + def id_will_change!; end + + sig { returns(::String) } + def payload; end + + sig { params(value: ::String).returns(::String) } + def payload=(value); end + + sig { returns(T::Boolean) } + def payload?; end + + sig { returns(T.nilable(::String)) } + def payload_before_last_save; end + + sig { returns(T.untyped) } + def payload_before_type_cast; end + + sig { returns(T::Boolean) } + def payload_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def payload_change; end + + sig { returns(T.nilable([::String, ::String])) } + def payload_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def payload_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def payload_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def payload_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def payload_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def payload_previously_was; end + + sig { returns(T.nilable(::String)) } + def payload_was; end + + sig { void } + def payload_will_change!; end + + sig { void } + def restore_channel!; end + + sig { void } + def restore_channel_hash!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_payload!; end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_channel; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_channel?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_channel_hash; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_channel_hash?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_created_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id_value; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_payload; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_payload?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_channel?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_channel_hash?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_payload?(from: T.unsafe(nil), to: T.unsafe(nil)); end + end + + module GeneratedRelationMethods + sig { returns(PrivateRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def broadcastable(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + sig do + params( + blk: T.proc.params(record: ::SolidCable::Message).returns(BasicObject) + ).returns(T::Array[::SolidCable::Message]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def trimmable(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::SolidCable::Message } } + + sig { returns(T::Array[::SolidCable::Message]) } + def to_a; end + + sig { returns(T::Array[::SolidCable::Message]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::SolidCable::Message } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateAssociationRelationWhereChain + Elem = type_member { { fixed: ::SolidCable::Message } } + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateAssociationRelation) } + def not(opts, *rest); end + end + + class PrivateCollectionProxy < ::ActiveRecord::Associations::CollectionProxy + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::SolidCable::Message } } + + sig do + params( + records: T.any(::SolidCable::Message, T::Enumerable[T.any(::SolidCable::Message, T::Enumerable[::SolidCable::Message])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::SolidCable::Message, T::Enumerable[T.any(::SolidCable::Message, T::Enumerable[::SolidCable::Message])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::SolidCable::Message, T::Enumerable[T.any(::SolidCable::Message, T::Enumerable[::SolidCable::Message])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig { returns(T::Array[::SolidCable::Message]) } + def load_target; end + + sig do + params( + records: T.any(::SolidCable::Message, T::Enumerable[T.any(::SolidCable::Message, T::Enumerable[::SolidCable::Message])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::SolidCable::Message, T::Enumerable[T.any(::SolidCable::Message, T::Enumerable[::SolidCable::Message])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::SolidCable::Message, T::Enumerable[T.any(::SolidCable::Message, T::Enumerable[::SolidCable::Message])]) + ).returns(T::Array[::SolidCable::Message]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::SolidCable::Message]) } + def target; end + + sig { returns(T::Array[::SolidCable::Message]) } + def to_a; end + + sig { returns(T::Array[::SolidCable::Message]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::SolidCable::Message } } + + sig { returns(T::Array[::SolidCable::Message]) } + def to_a; end + + sig { returns(T::Array[::SolidCable::Message]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::SolidCable::Message } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateRelationWhereChain + Elem = type_member { { fixed: ::SolidCable::Message } } + + sig { params(args: T.untyped).returns(PrivateRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateRelation) } + def not(opts, *rest); end + end +end diff --git a/sorbet/rbi/dsl/solid_cable/trim_job.rbi b/sorbet/rbi/dsl/solid_cable/trim_job.rbi new file mode 100644 index 0000000..1e14812 --- /dev/null +++ b/sorbet/rbi/dsl/solid_cable/trim_job.rbi @@ -0,0 +1,20 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `SolidCable::TrimJob`. +# Please instead update this file by running `bin/tapioca dsl SolidCable::TrimJob`. + + +class SolidCable::TrimJob + class << self + sig do + params( + block: T.nilable(T.proc.params(job: SolidCable::TrimJob).void) + ).returns(T.any(SolidCable::TrimJob, FalseClass)) + end + def perform_later(&block); end + + sig { returns(T.untyped) } + def perform_now; end + end +end diff --git a/sorbet/rbi/dsl/solid_cache/entry.rbi b/sorbet/rbi/dsl/solid_cache/entry.rbi new file mode 100644 index 0000000..1bc2332 --- /dev/null +++ b/sorbet/rbi/dsl/solid_cache/entry.rbi @@ -0,0 +1,1380 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `SolidCache::Entry`. +# Please instead update this file by running `bin/tapioca dsl SolidCache::Entry`. + + +class SolidCache::Entry + include GeneratedAttributeMethods + extend CommonRelationMethods + extend GeneratedRelationMethods + + private + + sig { returns(NilClass) } + def to_ary; end + + class << self + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidCache::Entry).void) + ).returns(::SolidCache::Entry) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::SolidCache::Entry).returns(T.untyped))).returns(T::Boolean) } + def any?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def average(column_name); end + + sig { params(block: T.nilable(T.proc.params(object: ::SolidCache::Entry).void)).returns(::SolidCache::Entry) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidCache::Entry).void) + ).returns(T::Array[::SolidCache::Entry]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidCache::Entry).void) + ).returns(::SolidCache::Entry) + end + def build(attributes = nil, &block); end + + sig { params(operation: Symbol, column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def calculate(operation, column_name); end + + sig { params(column_name: T.nilable(T.any(String, Symbol))).returns(Integer) } + sig { params(column_name: NilClass, block: T.proc.params(object: ::SolidCache::Entry).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::SolidCache::Entry).void)).returns(::SolidCache::Entry) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidCache::Entry).void) + ).returns(T::Array[::SolidCache::Entry]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidCache::Entry).void) + ).returns(::SolidCache::Entry) + end + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::SolidCache::Entry).void)).returns(::SolidCache::Entry) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidCache::Entry).void) + ).returns(T::Array[::SolidCache::Entry]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidCache::Entry).void) + ).returns(::SolidCache::Entry) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidCache::Entry).void) + ).returns(T::Array[::SolidCache::Entry]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidCache::Entry).void) + ).returns(::SolidCache::Entry) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidCache::Entry).void) + ).returns(T::Array[::SolidCache::Entry]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidCache::Entry).void) + ).returns(::SolidCache::Entry) + end + def create_or_find_by!(attributes, &block); end + + sig do + params( + records: T.any(::SolidCache::Entry, Integer, String, T::Enumerable[T.any(::SolidCache::Entry, Integer, String, T::Enumerable[::SolidCache::Entry])]) + ).returns(Integer) + end + def delete(*records); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(args); end + + sig do + params( + records: T.any(::SolidCache::Entry, Integer, String, T::Enumerable[T.any(::SolidCache::Entry, Integer, String, T::Enumerable[::SolidCache::Entry])]) + ).returns(T::Array[::SolidCache::Entry]) + end + def destroy(*records); end + + sig { returns(T::Array[::SolidCache::Entry]) } + def destroy_all; end + + sig { returns(T::Array[::SolidCache::Entry]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::SolidCache::Entry]) } + def destroy_by(args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::SolidCache::Entry)) } + def fifth; end + + sig { returns(::SolidCache::Entry) } + def fifth!; end + + sig do + params( + args: T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything]) + ).returns(::SolidCache::Entry) + end + sig do + params( + args: T::Array[T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything])] + ).returns(T::Enumerable[::SolidCache::Entry]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::SolidCache::Entry).void + ).returns(T.nilable(::SolidCache::Entry)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::SolidCache::Entry)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::SolidCache::Entry) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: ::SolidCache::Entry).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[::SolidCache::Entry]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: T::Array[::SolidCache::Entry]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[T::Enumerator[::SolidCache::Entry]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidCache::Entry).void) + ).returns(T::Array[::SolidCache::Entry]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidCache::Entry).void) + ).returns(::SolidCache::Entry) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidCache::Entry).void) + ).returns(T::Array[::SolidCache::Entry]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidCache::Entry).void) + ).returns(::SolidCache::Entry) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidCache::Entry).void) + ).returns(T::Array[::SolidCache::Entry]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidCache::Entry).void) + ).returns(::SolidCache::Entry) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::SolidCache::Entry)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::SolidCache::Entry) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::SolidCache::Entry) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::SolidCache::Entry)) } + sig { params(limit: Integer).returns(T::Array[::SolidCache::Entry]) } + def first(limit = nil); end + + sig { returns(::SolidCache::Entry) } + def first!; end + + sig { returns(T.nilable(::SolidCache::Entry)) } + def forty_two; end + + sig { returns(::SolidCache::Entry) } + def forty_two!; end + + sig { returns(T.nilable(::SolidCache::Entry)) } + def fourth; end + + sig { returns(::SolidCache::Entry) } + def fourth!; end + + sig { returns(T::Array[::Integer]) } + def ids; end + + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped, + block: T.proc.params(object: PrivateRelation).void + ).void + end + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped + ).returns(::ActiveRecord::Batches::BatchEnumerator) + end + def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, cursor: primary_key, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert!(attributes, returning: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert_all(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert_all!(attributes, returning: nil); end + + sig { returns(T.nilable(::SolidCache::Entry)) } + sig { params(limit: Integer).returns(T::Array[::SolidCache::Entry]) } + def last(limit = nil); end + + sig { returns(::SolidCache::Entry) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::SolidCache::Entry).returns(T.untyped))).returns(T::Boolean) } + def many?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def maximum(column_name); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def member?(record); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def minimum(column_name); end + + sig { params(block: T.nilable(T.proc.params(object: ::SolidCache::Entry).void)).returns(::SolidCache::Entry) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidCache::Entry).void) + ).returns(T::Array[::SolidCache::Entry]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidCache::Entry).void) + ).returns(::SolidCache::Entry) + end + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::SolidCache::Entry).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::SolidCache::Entry).returns(T.untyped))).returns(T::Boolean) } + def one?(&block); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pick(*column_names); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pluck(*column_names); end + + sig { returns(T.nilable(::SolidCache::Entry)) } + def second; end + + sig { returns(::SolidCache::Entry) } + def second!; end + + sig { returns(T.nilable(::SolidCache::Entry)) } + def second_to_last; end + + sig { returns(::SolidCache::Entry) } + def second_to_last!; end + + sig { returns(::SolidCache::Entry) } + def sole; end + + sig { params(initial_value_or_column: T.untyped).returns(T.any(Integer, Float, BigDecimal)) } + sig do + type_parameters(:U) + .params( + initial_value_or_column: T.nilable(T.type_parameter(:U)), + block: T.proc.params(object: ::SolidCache::Entry).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::SolidCache::Entry)) } + sig { params(limit: Integer).returns(T::Array[::SolidCache::Entry]) } + def take(limit = nil); end + + sig { returns(::SolidCache::Entry) } + def take!; end + + sig { returns(T.nilable(::SolidCache::Entry)) } + def third; end + + sig { returns(::SolidCache::Entry) } + def third!; end + + sig { returns(T.nilable(::SolidCache::Entry)) } + def third_to_last; end + + sig { returns(::SolidCache::Entry) } + def third_to_last!; end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert_all(attributes, returning: nil, unique_by: nil); end + end + + module GeneratedAssociationRelationMethods + sig { returns(PrivateAssociationRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateAssociationRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def in_key_hash_range(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def largest_byte_sizes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + sig do + params( + blk: T.proc.params(record: ::SolidCache::Entry).returns(BasicObject) + ).returns(T::Array[::SolidCache::Entry]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def unscope(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def up_to_byte_size(*args, &blk); end + + sig { returns(PrivateAssociationRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::Integer) } + def byte_size; end + + sig { params(value: ::Integer).returns(::Integer) } + def byte_size=(value); end + + sig { returns(T::Boolean) } + def byte_size?; end + + sig { returns(T.nilable(::Integer)) } + def byte_size_before_last_save; end + + sig { returns(T.untyped) } + def byte_size_before_type_cast; end + + sig { returns(T::Boolean) } + def byte_size_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def byte_size_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def byte_size_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def byte_size_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def byte_size_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def byte_size_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def byte_size_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def byte_size_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def byte_size_was; end + + sig { void } + def byte_size_will_change!; end + + sig { returns(::ActiveSupport::TimeWithZone) } + def created_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def created_at=(value); end + + sig { returns(T::Boolean) } + def created_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_before_last_save; end + + sig { returns(T.untyped) } + def created_at_before_type_cast; end + + sig { returns(T::Boolean) } + def created_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_was; end + + sig { void } + def created_at_will_change!; end + + sig { returns(::Integer) } + def id; end + + sig { params(value: ::Integer).returns(::Integer) } + def id=(value); end + + sig { returns(T::Boolean) } + def id?; end + + sig { returns(T.nilable(::Integer)) } + def id_before_last_save; end + + sig { returns(T.untyped) } + def id_before_type_cast; end + + sig { returns(T::Boolean) } + def id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_previously_was; end + + sig { returns(::Integer) } + def id_value; end + + sig { params(value: ::Integer).returns(::Integer) } + def id_value=(value); end + + sig { returns(T::Boolean) } + def id_value?; end + + sig { returns(T.nilable(::Integer)) } + def id_value_before_last_save; end + + sig { returns(T.untyped) } + def id_value_before_type_cast; end + + sig { returns(T::Boolean) } + def id_value_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def id_value_was; end + + sig { void } + def id_value_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def id_was; end + + sig { void } + def id_will_change!; end + + sig { returns(::String) } + def key; end + + sig { params(value: ::String).returns(::String) } + def key=(value); end + + sig { returns(T::Boolean) } + def key?; end + + sig { returns(T.nilable(::String)) } + def key_before_last_save; end + + sig { returns(T.untyped) } + def key_before_type_cast; end + + sig { returns(T::Boolean) } + def key_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def key_change; end + + sig { returns(T.nilable([::String, ::String])) } + def key_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def key_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(::Integer) } + def key_hash; end + + sig { params(value: ::Integer).returns(::Integer) } + def key_hash=(value); end + + sig { returns(T::Boolean) } + def key_hash?; end + + sig { returns(T.nilable(::Integer)) } + def key_hash_before_last_save; end + + sig { returns(T.untyped) } + def key_hash_before_type_cast; end + + sig { returns(T::Boolean) } + def key_hash_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def key_hash_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def key_hash_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def key_hash_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def key_hash_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def key_hash_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def key_hash_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def key_hash_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def key_hash_was; end + + sig { void } + def key_hash_will_change!; end + + sig { returns(T.nilable(::String)) } + def key_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def key_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def key_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def key_previously_was; end + + sig { returns(T.nilable(::String)) } + def key_was; end + + sig { void } + def key_will_change!; end + + sig { void } + def restore_byte_size!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_key!; end + + sig { void } + def restore_key_hash!; end + + sig { void } + def restore_value!; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_byte_size; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_byte_size?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_created_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id_value; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_key; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_key?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_key_hash; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_key_hash?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_value; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(::String) } + def value; end + + sig { params(value: ::String).returns(::String) } + def value=(value); end + + sig { returns(T::Boolean) } + def value?; end + + sig { returns(T.nilable(::String)) } + def value_before_last_save; end + + sig { returns(T.untyped) } + def value_before_type_cast; end + + sig { returns(T::Boolean) } + def value_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def value_change; end + + sig { returns(T.nilable([::String, ::String])) } + def value_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def value_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def value_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def value_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def value_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def value_previously_was; end + + sig { returns(T.nilable(::String)) } + def value_was; end + + sig { void } + def value_will_change!; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_byte_size?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_key?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_key_hash?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + end + + module GeneratedRelationMethods + sig { returns(PrivateRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def in_key_hash_range(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def largest_byte_sizes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + sig do + params( + blk: T.proc.params(record: ::SolidCache::Entry).returns(BasicObject) + ).returns(T::Array[::SolidCache::Entry]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def unscope(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def up_to_byte_size(*args, &blk); end + + sig { returns(PrivateRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::SolidCache::Entry } } + + sig { returns(T::Array[::SolidCache::Entry]) } + def to_a; end + + sig { returns(T::Array[::SolidCache::Entry]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::SolidCache::Entry } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateAssociationRelationWhereChain + Elem = type_member { { fixed: ::SolidCache::Entry } } + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateAssociationRelation) } + def not(opts, *rest); end + end + + class PrivateCollectionProxy < ::ActiveRecord::Associations::CollectionProxy + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::SolidCache::Entry } } + + sig do + params( + records: T.any(::SolidCache::Entry, T::Enumerable[T.any(::SolidCache::Entry, T::Enumerable[::SolidCache::Entry])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::SolidCache::Entry, T::Enumerable[T.any(::SolidCache::Entry, T::Enumerable[::SolidCache::Entry])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::SolidCache::Entry, T::Enumerable[T.any(::SolidCache::Entry, T::Enumerable[::SolidCache::Entry])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig { returns(T::Array[::SolidCache::Entry]) } + def load_target; end + + sig do + params( + records: T.any(::SolidCache::Entry, T::Enumerable[T.any(::SolidCache::Entry, T::Enumerable[::SolidCache::Entry])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::SolidCache::Entry, T::Enumerable[T.any(::SolidCache::Entry, T::Enumerable[::SolidCache::Entry])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::SolidCache::Entry, T::Enumerable[T.any(::SolidCache::Entry, T::Enumerable[::SolidCache::Entry])]) + ).returns(T::Array[::SolidCache::Entry]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::SolidCache::Entry]) } + def target; end + + sig { returns(T::Array[::SolidCache::Entry]) } + def to_a; end + + sig { returns(T::Array[::SolidCache::Entry]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::SolidCache::Entry } } + + sig { returns(T::Array[::SolidCache::Entry]) } + def to_a; end + + sig { returns(T::Array[::SolidCache::Entry]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::SolidCache::Entry } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateRelationWhereChain + Elem = type_member { { fixed: ::SolidCache::Entry } } + + sig { params(args: T.untyped).returns(PrivateRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateRelation) } + def not(opts, *rest); end + end +end diff --git a/sorbet/rbi/dsl/solid_cache/expiry_job.rbi b/sorbet/rbi/dsl/solid_cache/expiry_job.rbi new file mode 100644 index 0000000..baac8de --- /dev/null +++ b/sorbet/rbi/dsl/solid_cache/expiry_job.rbi @@ -0,0 +1,33 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `SolidCache::ExpiryJob`. +# Please instead update this file by running `bin/tapioca dsl SolidCache::ExpiryJob`. + + +class SolidCache::ExpiryJob + class << self + sig do + params( + count: T.untyped, + shard: T.untyped, + max_age: T.untyped, + max_entries: T.untyped, + max_size: T.untyped, + block: T.nilable(T.proc.params(job: SolidCache::ExpiryJob).void) + ).returns(T.any(SolidCache::ExpiryJob, FalseClass)) + end + def perform_later(count, shard: T.unsafe(nil), max_age: T.unsafe(nil), max_entries: T.unsafe(nil), max_size: T.unsafe(nil), &block); end + + sig do + params( + count: T.untyped, + shard: T.untyped, + max_age: T.untyped, + max_entries: T.untyped, + max_size: T.untyped + ).returns(T.untyped) + end + def perform_now(count, shard: T.unsafe(nil), max_age: T.unsafe(nil), max_entries: T.unsafe(nil), max_size: T.unsafe(nil)); end + end +end diff --git a/sorbet/rbi/dsl/solid_queue/blocked_execution.rbi b/sorbet/rbi/dsl/solid_queue/blocked_execution.rbi new file mode 100644 index 0000000..8e33af0 --- /dev/null +++ b/sorbet/rbi/dsl/solid_queue/blocked_execution.rbi @@ -0,0 +1,1513 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `SolidQueue::BlockedExecution`. +# Please instead update this file by running `bin/tapioca dsl SolidQueue::BlockedExecution`. + + +class SolidQueue::BlockedExecution + include GeneratedAssociationMethods + include GeneratedAttributeMethods + extend CommonRelationMethods + extend GeneratedRelationMethods + + private + + sig { returns(NilClass) } + def to_ary; end + + class << self + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::BlockedExecution).void) + ).returns(::SolidQueue::BlockedExecution) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::BlockedExecution).returns(T.untyped)) + ).returns(T::Boolean) + end + def any?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def average(column_name); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::SolidQueue::BlockedExecution).void) + ).returns(::SolidQueue::BlockedExecution) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::BlockedExecution).void) + ).returns(T::Array[::SolidQueue::BlockedExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::BlockedExecution).void) + ).returns(::SolidQueue::BlockedExecution) + end + def build(attributes = nil, &block); end + + sig { params(operation: Symbol, column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def calculate(operation, column_name); end + + sig { params(column_name: T.nilable(T.any(String, Symbol))).returns(Integer) } + sig do + params( + column_name: NilClass, + block: T.proc.params(object: ::SolidQueue::BlockedExecution).void + ).returns(Integer) + end + def count(column_name = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::SolidQueue::BlockedExecution).void) + ).returns(::SolidQueue::BlockedExecution) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::BlockedExecution).void) + ).returns(T::Array[::SolidQueue::BlockedExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::BlockedExecution).void) + ).returns(::SolidQueue::BlockedExecution) + end + def create(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::SolidQueue::BlockedExecution).void) + ).returns(::SolidQueue::BlockedExecution) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::BlockedExecution).void) + ).returns(T::Array[::SolidQueue::BlockedExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::BlockedExecution).void) + ).returns(::SolidQueue::BlockedExecution) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::BlockedExecution).void) + ).returns(T::Array[::SolidQueue::BlockedExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::BlockedExecution).void) + ).returns(::SolidQueue::BlockedExecution) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::BlockedExecution).void) + ).returns(T::Array[::SolidQueue::BlockedExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::BlockedExecution).void) + ).returns(::SolidQueue::BlockedExecution) + end + def create_or_find_by!(attributes, &block); end + + sig do + params( + records: T.any(::SolidQueue::BlockedExecution, Integer, String, T::Enumerable[T.any(::SolidQueue::BlockedExecution, Integer, String, T::Enumerable[::SolidQueue::BlockedExecution])]) + ).returns(Integer) + end + def delete(*records); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(args); end + + sig do + params( + records: T.any(::SolidQueue::BlockedExecution, Integer, String, T::Enumerable[T.any(::SolidQueue::BlockedExecution, Integer, String, T::Enumerable[::SolidQueue::BlockedExecution])]) + ).returns(T::Array[::SolidQueue::BlockedExecution]) + end + def destroy(*records); end + + sig { returns(T::Array[::SolidQueue::BlockedExecution]) } + def destroy_all; end + + sig { returns(T::Array[::SolidQueue::BlockedExecution]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::SolidQueue::BlockedExecution]) } + def destroy_by(args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::SolidQueue::BlockedExecution)) } + def fifth; end + + sig { returns(::SolidQueue::BlockedExecution) } + def fifth!; end + + sig do + params( + args: T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything]) + ).returns(::SolidQueue::BlockedExecution) + end + sig do + params( + args: T::Array[T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything])] + ).returns(T::Enumerable[::SolidQueue::BlockedExecution]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::SolidQueue::BlockedExecution).void + ).returns(T.nilable(::SolidQueue::BlockedExecution)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::SolidQueue::BlockedExecution)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::SolidQueue::BlockedExecution) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: ::SolidQueue::BlockedExecution).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[::SolidQueue::BlockedExecution]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: T::Array[::SolidQueue::BlockedExecution]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[T::Enumerator[::SolidQueue::BlockedExecution]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::BlockedExecution).void) + ).returns(T::Array[::SolidQueue::BlockedExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::BlockedExecution).void) + ).returns(::SolidQueue::BlockedExecution) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::BlockedExecution).void) + ).returns(T::Array[::SolidQueue::BlockedExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::BlockedExecution).void) + ).returns(::SolidQueue::BlockedExecution) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::BlockedExecution).void) + ).returns(T::Array[::SolidQueue::BlockedExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::BlockedExecution).void) + ).returns(::SolidQueue::BlockedExecution) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::SolidQueue::BlockedExecution)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::SolidQueue::BlockedExecution) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::SolidQueue::BlockedExecution) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::SolidQueue::BlockedExecution)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::BlockedExecution]) } + def first(limit = nil); end + + sig { returns(::SolidQueue::BlockedExecution) } + def first!; end + + sig { returns(T.nilable(::SolidQueue::BlockedExecution)) } + def forty_two; end + + sig { returns(::SolidQueue::BlockedExecution) } + def forty_two!; end + + sig { returns(T.nilable(::SolidQueue::BlockedExecution)) } + def fourth; end + + sig { returns(::SolidQueue::BlockedExecution) } + def fourth!; end + + sig { returns(T::Array[::Integer]) } + def ids; end + + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped, + block: T.proc.params(object: PrivateRelation).void + ).void + end + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped + ).returns(::ActiveRecord::Batches::BatchEnumerator) + end + def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, cursor: primary_key, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert!(attributes, returning: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert_all(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert_all!(attributes, returning: nil); end + + sig { returns(T.nilable(::SolidQueue::BlockedExecution)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::BlockedExecution]) } + def last(limit = nil); end + + sig { returns(::SolidQueue::BlockedExecution) } + def last!; end + + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::BlockedExecution).returns(T.untyped)) + ).returns(T::Boolean) + end + def many?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def maximum(column_name); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def member?(record); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def minimum(column_name); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::SolidQueue::BlockedExecution).void) + ).returns(::SolidQueue::BlockedExecution) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::BlockedExecution).void) + ).returns(T::Array[::SolidQueue::BlockedExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::BlockedExecution).void) + ).returns(::SolidQueue::BlockedExecution) + end + def new(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::BlockedExecution).returns(T.untyped)) + ).returns(T::Boolean) + end + def none?(&block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::BlockedExecution).returns(T.untyped)) + ).returns(T::Boolean) + end + def one?(&block); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pick(*column_names); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pluck(*column_names); end + + sig { returns(T.nilable(::SolidQueue::BlockedExecution)) } + def second; end + + sig { returns(::SolidQueue::BlockedExecution) } + def second!; end + + sig { returns(T.nilable(::SolidQueue::BlockedExecution)) } + def second_to_last; end + + sig { returns(::SolidQueue::BlockedExecution) } + def second_to_last!; end + + sig { returns(::SolidQueue::BlockedExecution) } + def sole; end + + sig { params(initial_value_or_column: T.untyped).returns(T.any(Integer, Float, BigDecimal)) } + sig do + type_parameters(:U) + .params( + initial_value_or_column: T.nilable(T.type_parameter(:U)), + block: T.proc.params(object: ::SolidQueue::BlockedExecution).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::SolidQueue::BlockedExecution)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::BlockedExecution]) } + def take(limit = nil); end + + sig { returns(::SolidQueue::BlockedExecution) } + def take!; end + + sig { returns(T.nilable(::SolidQueue::BlockedExecution)) } + def third; end + + sig { returns(::SolidQueue::BlockedExecution) } + def third!; end + + sig { returns(T.nilable(::SolidQueue::BlockedExecution)) } + def third_to_last; end + + sig { returns(::SolidQueue::BlockedExecution) } + def third_to_last!; end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert_all(attributes, returning: nil, unique_by: nil); end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::Job) } + def build_job(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::Semaphore) } + def build_semaphore(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::Job) } + def create_job(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::Job) } + def create_job!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::Semaphore) } + def create_semaphore(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::Semaphore) } + def create_semaphore!(*args, &blk); end + + sig { returns(T.nilable(::SolidQueue::Job)) } + def job; end + + sig { params(value: T.nilable(::SolidQueue::Job)).void } + def job=(value); end + + sig { returns(T.nilable(::SolidQueue::Job)) } + def reload_job; end + + sig { returns(T.nilable(::SolidQueue::Semaphore)) } + def reload_semaphore; end + + sig { void } + def reset_job; end + + sig { void } + def reset_semaphore; end + + sig { returns(T.nilable(::SolidQueue::Semaphore)) } + def semaphore; end + + sig { params(value: T.nilable(::SolidQueue::Semaphore)).void } + def semaphore=(value); end + end + + module GeneratedAssociationRelationMethods + sig { returns(PrivateAssociationRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateAssociationRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def expired(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def ordered(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + sig do + params( + blk: T.proc.params(record: ::SolidQueue::BlockedExecution).returns(BasicObject) + ).returns(T::Array[::SolidQueue::BlockedExecution]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateAssociationRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::String) } + def concurrency_key; end + + sig { params(value: ::String).returns(::String) } + def concurrency_key=(value); end + + sig { returns(T::Boolean) } + def concurrency_key?; end + + sig { returns(T.nilable(::String)) } + def concurrency_key_before_last_save; end + + sig { returns(T.untyped) } + def concurrency_key_before_type_cast; end + + sig { returns(T::Boolean) } + def concurrency_key_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def concurrency_key_change; end + + sig { returns(T.nilable([::String, ::String])) } + def concurrency_key_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def concurrency_key_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def concurrency_key_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def concurrency_key_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def concurrency_key_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def concurrency_key_previously_was; end + + sig { returns(T.nilable(::String)) } + def concurrency_key_was; end + + sig { void } + def concurrency_key_will_change!; end + + sig { returns(::ActiveSupport::TimeWithZone) } + def created_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def created_at=(value); end + + sig { returns(T::Boolean) } + def created_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_before_last_save; end + + sig { returns(T.untyped) } + def created_at_before_type_cast; end + + sig { returns(T::Boolean) } + def created_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_was; end + + sig { void } + def created_at_will_change!; end + + sig { returns(::ActiveSupport::TimeWithZone) } + def expires_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def expires_at=(value); end + + sig { returns(T::Boolean) } + def expires_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def expires_at_before_last_save; end + + sig { returns(T.untyped) } + def expires_at_before_type_cast; end + + sig { returns(T::Boolean) } + def expires_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def expires_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def expires_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def expires_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def expires_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def expires_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def expires_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def expires_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def expires_at_was; end + + sig { void } + def expires_at_will_change!; end + + sig { returns(::Integer) } + def id; end + + sig { params(value: ::Integer).returns(::Integer) } + def id=(value); end + + sig { returns(T::Boolean) } + def id?; end + + sig { returns(T.nilable(::Integer)) } + def id_before_last_save; end + + sig { returns(T.untyped) } + def id_before_type_cast; end + + sig { returns(T::Boolean) } + def id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_previously_was; end + + sig { returns(::Integer) } + def id_value; end + + sig { params(value: ::Integer).returns(::Integer) } + def id_value=(value); end + + sig { returns(T::Boolean) } + def id_value?; end + + sig { returns(T.nilable(::Integer)) } + def id_value_before_last_save; end + + sig { returns(T.untyped) } + def id_value_before_type_cast; end + + sig { returns(T::Boolean) } + def id_value_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def id_value_was; end + + sig { void } + def id_value_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def id_was; end + + sig { void } + def id_will_change!; end + + sig { returns(::Integer) } + def job_id; end + + sig { params(value: ::Integer).returns(::Integer) } + def job_id=(value); end + + sig { returns(T::Boolean) } + def job_id?; end + + sig { returns(T.nilable(::Integer)) } + def job_id_before_last_save; end + + sig { returns(T.untyped) } + def job_id_before_type_cast; end + + sig { returns(T::Boolean) } + def job_id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def job_id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def job_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def job_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def job_id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def job_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def job_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def job_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def job_id_was; end + + sig { void } + def job_id_will_change!; end + + sig { returns(::Integer) } + def priority; end + + sig { params(value: ::Integer).returns(::Integer) } + def priority=(value); end + + sig { returns(T::Boolean) } + def priority?; end + + sig { returns(T.nilable(::Integer)) } + def priority_before_last_save; end + + sig { returns(T.untyped) } + def priority_before_type_cast; end + + sig { returns(T::Boolean) } + def priority_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def priority_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def priority_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def priority_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def priority_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def priority_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def priority_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def priority_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def priority_was; end + + sig { void } + def priority_will_change!; end + + sig { returns(::String) } + def queue_name; end + + sig { params(value: ::String).returns(::String) } + def queue_name=(value); end + + sig { returns(T::Boolean) } + def queue_name?; end + + sig { returns(T.nilable(::String)) } + def queue_name_before_last_save; end + + sig { returns(T.untyped) } + def queue_name_before_type_cast; end + + sig { returns(T::Boolean) } + def queue_name_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def queue_name_change; end + + sig { returns(T.nilable([::String, ::String])) } + def queue_name_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def queue_name_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def queue_name_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def queue_name_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def queue_name_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def queue_name_previously_was; end + + sig { returns(T.nilable(::String)) } + def queue_name_was; end + + sig { void } + def queue_name_will_change!; end + + sig { void } + def restore_concurrency_key!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_expires_at!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_job_id!; end + + sig { void } + def restore_priority!; end + + sig { void } + def restore_queue_name!; end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_concurrency_key; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_concurrency_key?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_created_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_expires_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_expires_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id_value; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_job_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_job_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_priority; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_priority?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_queue_name; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_queue_name?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_concurrency_key?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_expires_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_job_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_priority?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_queue_name?(from: T.unsafe(nil), to: T.unsafe(nil)); end + end + + module GeneratedRelationMethods + sig { returns(PrivateRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def expired(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def ordered(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + sig do + params( + blk: T.proc.params(record: ::SolidQueue::BlockedExecution).returns(BasicObject) + ).returns(T::Array[::SolidQueue::BlockedExecution]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::BlockedExecution } } + + sig { returns(T::Array[::SolidQueue::BlockedExecution]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::BlockedExecution]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::SolidQueue::BlockedExecution } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateAssociationRelationWhereChain + Elem = type_member { { fixed: ::SolidQueue::BlockedExecution } } + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateAssociationRelation) } + def not(opts, *rest); end + end + + class PrivateCollectionProxy < ::ActiveRecord::Associations::CollectionProxy + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::BlockedExecution } } + + sig do + params( + records: T.any(::SolidQueue::BlockedExecution, T::Enumerable[T.any(::SolidQueue::BlockedExecution, T::Enumerable[::SolidQueue::BlockedExecution])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::SolidQueue::BlockedExecution, T::Enumerable[T.any(::SolidQueue::BlockedExecution, T::Enumerable[::SolidQueue::BlockedExecution])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::SolidQueue::BlockedExecution, T::Enumerable[T.any(::SolidQueue::BlockedExecution, T::Enumerable[::SolidQueue::BlockedExecution])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig { returns(T::Array[::SolidQueue::BlockedExecution]) } + def load_target; end + + sig do + params( + records: T.any(::SolidQueue::BlockedExecution, T::Enumerable[T.any(::SolidQueue::BlockedExecution, T::Enumerable[::SolidQueue::BlockedExecution])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::SolidQueue::BlockedExecution, T::Enumerable[T.any(::SolidQueue::BlockedExecution, T::Enumerable[::SolidQueue::BlockedExecution])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::SolidQueue::BlockedExecution, T::Enumerable[T.any(::SolidQueue::BlockedExecution, T::Enumerable[::SolidQueue::BlockedExecution])]) + ).returns(T::Array[::SolidQueue::BlockedExecution]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::SolidQueue::BlockedExecution]) } + def target; end + + sig { returns(T::Array[::SolidQueue::BlockedExecution]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::BlockedExecution]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::BlockedExecution } } + + sig { returns(T::Array[::SolidQueue::BlockedExecution]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::BlockedExecution]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::SolidQueue::BlockedExecution } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateRelationWhereChain + Elem = type_member { { fixed: ::SolidQueue::BlockedExecution } } + + sig { params(args: T.untyped).returns(PrivateRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateRelation) } + def not(opts, *rest); end + end +end diff --git a/sorbet/rbi/dsl/solid_queue/claimed_execution.rbi b/sorbet/rbi/dsl/solid_queue/claimed_execution.rbi new file mode 100644 index 0000000..5da545f --- /dev/null +++ b/sorbet/rbi/dsl/solid_queue/claimed_execution.rbi @@ -0,0 +1,1348 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `SolidQueue::ClaimedExecution`. +# Please instead update this file by running `bin/tapioca dsl SolidQueue::ClaimedExecution`. + + +class SolidQueue::ClaimedExecution + include GeneratedAssociationMethods + include GeneratedAttributeMethods + extend CommonRelationMethods + extend GeneratedRelationMethods + + private + + sig { returns(NilClass) } + def to_ary; end + + class << self + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::ClaimedExecution).void) + ).returns(::SolidQueue::ClaimedExecution) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::ClaimedExecution).returns(T.untyped)) + ).returns(T::Boolean) + end + def any?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def average(column_name); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::SolidQueue::ClaimedExecution).void) + ).returns(::SolidQueue::ClaimedExecution) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::ClaimedExecution).void) + ).returns(T::Array[::SolidQueue::ClaimedExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::ClaimedExecution).void) + ).returns(::SolidQueue::ClaimedExecution) + end + def build(attributes = nil, &block); end + + sig { params(operation: Symbol, column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def calculate(operation, column_name); end + + sig { params(column_name: T.nilable(T.any(String, Symbol))).returns(Integer) } + sig do + params( + column_name: NilClass, + block: T.proc.params(object: ::SolidQueue::ClaimedExecution).void + ).returns(Integer) + end + def count(column_name = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::SolidQueue::ClaimedExecution).void) + ).returns(::SolidQueue::ClaimedExecution) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::ClaimedExecution).void) + ).returns(T::Array[::SolidQueue::ClaimedExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::ClaimedExecution).void) + ).returns(::SolidQueue::ClaimedExecution) + end + def create(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::SolidQueue::ClaimedExecution).void) + ).returns(::SolidQueue::ClaimedExecution) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::ClaimedExecution).void) + ).returns(T::Array[::SolidQueue::ClaimedExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::ClaimedExecution).void) + ).returns(::SolidQueue::ClaimedExecution) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::ClaimedExecution).void) + ).returns(T::Array[::SolidQueue::ClaimedExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::ClaimedExecution).void) + ).returns(::SolidQueue::ClaimedExecution) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::ClaimedExecution).void) + ).returns(T::Array[::SolidQueue::ClaimedExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::ClaimedExecution).void) + ).returns(::SolidQueue::ClaimedExecution) + end + def create_or_find_by!(attributes, &block); end + + sig do + params( + records: T.any(::SolidQueue::ClaimedExecution, Integer, String, T::Enumerable[T.any(::SolidQueue::ClaimedExecution, Integer, String, T::Enumerable[::SolidQueue::ClaimedExecution])]) + ).returns(Integer) + end + def delete(*records); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(args); end + + sig do + params( + records: T.any(::SolidQueue::ClaimedExecution, Integer, String, T::Enumerable[T.any(::SolidQueue::ClaimedExecution, Integer, String, T::Enumerable[::SolidQueue::ClaimedExecution])]) + ).returns(T::Array[::SolidQueue::ClaimedExecution]) + end + def destroy(*records); end + + sig { returns(T::Array[::SolidQueue::ClaimedExecution]) } + def destroy_all; end + + sig { returns(T::Array[::SolidQueue::ClaimedExecution]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::SolidQueue::ClaimedExecution]) } + def destroy_by(args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::SolidQueue::ClaimedExecution)) } + def fifth; end + + sig { returns(::SolidQueue::ClaimedExecution) } + def fifth!; end + + sig do + params( + args: T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything]) + ).returns(::SolidQueue::ClaimedExecution) + end + sig do + params( + args: T::Array[T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything])] + ).returns(T::Enumerable[::SolidQueue::ClaimedExecution]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::SolidQueue::ClaimedExecution).void + ).returns(T.nilable(::SolidQueue::ClaimedExecution)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::SolidQueue::ClaimedExecution)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::SolidQueue::ClaimedExecution) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: ::SolidQueue::ClaimedExecution).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[::SolidQueue::ClaimedExecution]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: T::Array[::SolidQueue::ClaimedExecution]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[T::Enumerator[::SolidQueue::ClaimedExecution]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::ClaimedExecution).void) + ).returns(T::Array[::SolidQueue::ClaimedExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::ClaimedExecution).void) + ).returns(::SolidQueue::ClaimedExecution) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::ClaimedExecution).void) + ).returns(T::Array[::SolidQueue::ClaimedExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::ClaimedExecution).void) + ).returns(::SolidQueue::ClaimedExecution) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::ClaimedExecution).void) + ).returns(T::Array[::SolidQueue::ClaimedExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::ClaimedExecution).void) + ).returns(::SolidQueue::ClaimedExecution) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::SolidQueue::ClaimedExecution)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::SolidQueue::ClaimedExecution) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::SolidQueue::ClaimedExecution) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::SolidQueue::ClaimedExecution)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::ClaimedExecution]) } + def first(limit = nil); end + + sig { returns(::SolidQueue::ClaimedExecution) } + def first!; end + + sig { returns(T.nilable(::SolidQueue::ClaimedExecution)) } + def forty_two; end + + sig { returns(::SolidQueue::ClaimedExecution) } + def forty_two!; end + + sig { returns(T.nilable(::SolidQueue::ClaimedExecution)) } + def fourth; end + + sig { returns(::SolidQueue::ClaimedExecution) } + def fourth!; end + + sig { returns(T::Array[::Integer]) } + def ids; end + + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped, + block: T.proc.params(object: PrivateRelation).void + ).void + end + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped + ).returns(::ActiveRecord::Batches::BatchEnumerator) + end + def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, cursor: primary_key, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert!(attributes, returning: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert_all(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert_all!(attributes, returning: nil); end + + sig { returns(T.nilable(::SolidQueue::ClaimedExecution)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::ClaimedExecution]) } + def last(limit = nil); end + + sig { returns(::SolidQueue::ClaimedExecution) } + def last!; end + + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::ClaimedExecution).returns(T.untyped)) + ).returns(T::Boolean) + end + def many?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def maximum(column_name); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def member?(record); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def minimum(column_name); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::SolidQueue::ClaimedExecution).void) + ).returns(::SolidQueue::ClaimedExecution) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::ClaimedExecution).void) + ).returns(T::Array[::SolidQueue::ClaimedExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::ClaimedExecution).void) + ).returns(::SolidQueue::ClaimedExecution) + end + def new(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::ClaimedExecution).returns(T.untyped)) + ).returns(T::Boolean) + end + def none?(&block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::ClaimedExecution).returns(T.untyped)) + ).returns(T::Boolean) + end + def one?(&block); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pick(*column_names); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pluck(*column_names); end + + sig { returns(T.nilable(::SolidQueue::ClaimedExecution)) } + def second; end + + sig { returns(::SolidQueue::ClaimedExecution) } + def second!; end + + sig { returns(T.nilable(::SolidQueue::ClaimedExecution)) } + def second_to_last; end + + sig { returns(::SolidQueue::ClaimedExecution) } + def second_to_last!; end + + sig { returns(::SolidQueue::ClaimedExecution) } + def sole; end + + sig { params(initial_value_or_column: T.untyped).returns(T.any(Integer, Float, BigDecimal)) } + sig do + type_parameters(:U) + .params( + initial_value_or_column: T.nilable(T.type_parameter(:U)), + block: T.proc.params(object: ::SolidQueue::ClaimedExecution).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::SolidQueue::ClaimedExecution)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::ClaimedExecution]) } + def take(limit = nil); end + + sig { returns(::SolidQueue::ClaimedExecution) } + def take!; end + + sig { returns(T.nilable(::SolidQueue::ClaimedExecution)) } + def third; end + + sig { returns(::SolidQueue::ClaimedExecution) } + def third!; end + + sig { returns(T.nilable(::SolidQueue::ClaimedExecution)) } + def third_to_last; end + + sig { returns(::SolidQueue::ClaimedExecution) } + def third_to_last!; end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert_all(attributes, returning: nil, unique_by: nil); end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::Job) } + def build_job(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::Process) } + def build_process(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::Job) } + def create_job(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::Job) } + def create_job!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::Process) } + def create_process(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::Process) } + def create_process!(*args, &blk); end + + sig { returns(T.nilable(::SolidQueue::Job)) } + def job; end + + sig { params(value: T.nilable(::SolidQueue::Job)).void } + def job=(value); end + + sig { returns(T.nilable(::SolidQueue::Process)) } + def process; end + + sig { params(value: T.nilable(::SolidQueue::Process)).void } + def process=(value); end + + sig { returns(T::Boolean) } + def process_changed?; end + + sig { returns(T::Boolean) } + def process_previously_changed?; end + + sig { returns(T.nilable(::SolidQueue::Job)) } + def reload_job; end + + sig { returns(T.nilable(::SolidQueue::Process)) } + def reload_process; end + + sig { void } + def reset_job; end + + sig { void } + def reset_process; end + end + + module GeneratedAssociationRelationMethods + sig { returns(PrivateAssociationRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateAssociationRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def ordered(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def orphaned(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + sig do + params( + blk: T.proc.params(record: ::SolidQueue::ClaimedExecution).returns(BasicObject) + ).returns(T::Array[::SolidQueue::ClaimedExecution]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateAssociationRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::ActiveSupport::TimeWithZone) } + def created_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def created_at=(value); end + + sig { returns(T::Boolean) } + def created_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_before_last_save; end + + sig { returns(T.untyped) } + def created_at_before_type_cast; end + + sig { returns(T::Boolean) } + def created_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_was; end + + sig { void } + def created_at_will_change!; end + + sig { returns(::Integer) } + def id; end + + sig { params(value: ::Integer).returns(::Integer) } + def id=(value); end + + sig { returns(T::Boolean) } + def id?; end + + sig { returns(T.nilable(::Integer)) } + def id_before_last_save; end + + sig { returns(T.untyped) } + def id_before_type_cast; end + + sig { returns(T::Boolean) } + def id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_previously_was; end + + sig { returns(::Integer) } + def id_value; end + + sig { params(value: ::Integer).returns(::Integer) } + def id_value=(value); end + + sig { returns(T::Boolean) } + def id_value?; end + + sig { returns(T.nilable(::Integer)) } + def id_value_before_last_save; end + + sig { returns(T.untyped) } + def id_value_before_type_cast; end + + sig { returns(T::Boolean) } + def id_value_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def id_value_was; end + + sig { void } + def id_value_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def id_was; end + + sig { void } + def id_will_change!; end + + sig { returns(::Integer) } + def job_id; end + + sig { params(value: ::Integer).returns(::Integer) } + def job_id=(value); end + + sig { returns(T::Boolean) } + def job_id?; end + + sig { returns(T.nilable(::Integer)) } + def job_id_before_last_save; end + + sig { returns(T.untyped) } + def job_id_before_type_cast; end + + sig { returns(T::Boolean) } + def job_id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def job_id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def job_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def job_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def job_id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def job_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def job_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def job_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def job_id_was; end + + sig { void } + def job_id_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def process_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def process_id=(value); end + + sig { returns(T::Boolean) } + def process_id?; end + + sig { returns(T.nilable(::Integer)) } + def process_id_before_last_save; end + + sig { returns(T.untyped) } + def process_id_before_type_cast; end + + sig { returns(T::Boolean) } + def process_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def process_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def process_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def process_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def process_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def process_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def process_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def process_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def process_id_was; end + + sig { void } + def process_id_will_change!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_job_id!; end + + sig { void } + def restore_process_id!; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_created_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id_value; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_job_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_job_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def saved_change_to_process_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_process_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_job_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_process_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + end + + module GeneratedRelationMethods + sig { returns(PrivateRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def ordered(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def orphaned(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + sig do + params( + blk: T.proc.params(record: ::SolidQueue::ClaimedExecution).returns(BasicObject) + ).returns(T::Array[::SolidQueue::ClaimedExecution]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::ClaimedExecution } } + + sig { returns(T::Array[::SolidQueue::ClaimedExecution]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::ClaimedExecution]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::SolidQueue::ClaimedExecution } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateAssociationRelationWhereChain + Elem = type_member { { fixed: ::SolidQueue::ClaimedExecution } } + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateAssociationRelation) } + def not(opts, *rest); end + end + + class PrivateCollectionProxy < ::ActiveRecord::Associations::CollectionProxy + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::ClaimedExecution } } + + sig do + params( + records: T.any(::SolidQueue::ClaimedExecution, T::Enumerable[T.any(::SolidQueue::ClaimedExecution, T::Enumerable[::SolidQueue::ClaimedExecution])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::SolidQueue::ClaimedExecution, T::Enumerable[T.any(::SolidQueue::ClaimedExecution, T::Enumerable[::SolidQueue::ClaimedExecution])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::SolidQueue::ClaimedExecution, T::Enumerable[T.any(::SolidQueue::ClaimedExecution, T::Enumerable[::SolidQueue::ClaimedExecution])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig { returns(T::Array[::SolidQueue::ClaimedExecution]) } + def load_target; end + + sig do + params( + records: T.any(::SolidQueue::ClaimedExecution, T::Enumerable[T.any(::SolidQueue::ClaimedExecution, T::Enumerable[::SolidQueue::ClaimedExecution])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::SolidQueue::ClaimedExecution, T::Enumerable[T.any(::SolidQueue::ClaimedExecution, T::Enumerable[::SolidQueue::ClaimedExecution])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::SolidQueue::ClaimedExecution, T::Enumerable[T.any(::SolidQueue::ClaimedExecution, T::Enumerable[::SolidQueue::ClaimedExecution])]) + ).returns(T::Array[::SolidQueue::ClaimedExecution]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::SolidQueue::ClaimedExecution]) } + def target; end + + sig { returns(T::Array[::SolidQueue::ClaimedExecution]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::ClaimedExecution]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::ClaimedExecution } } + + sig { returns(T::Array[::SolidQueue::ClaimedExecution]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::ClaimedExecution]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::SolidQueue::ClaimedExecution } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateRelationWhereChain + Elem = type_member { { fixed: ::SolidQueue::ClaimedExecution } } + + sig { params(args: T.untyped).returns(PrivateRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateRelation) } + def not(opts, *rest); end + end +end diff --git a/sorbet/rbi/dsl/solid_queue/execution/job_attributes.rbi b/sorbet/rbi/dsl/solid_queue/execution/job_attributes.rbi new file mode 100644 index 0000000..ad5f384 --- /dev/null +++ b/sorbet/rbi/dsl/solid_queue/execution/job_attributes.rbi @@ -0,0 +1,20 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `SolidQueue::Execution::JobAttributes`. +# Please instead update this file by running `bin/tapioca dsl SolidQueue::Execution::JobAttributes`. + + +module SolidQueue::Execution::JobAttributes + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def assumable_attributes_from_job; end + def assumable_attributes_from_job=(value); end + def assumable_attributes_from_job?; end + end + + module GeneratedInstanceMethods; end +end diff --git a/sorbet/rbi/dsl/solid_queue/failed_execution.rbi b/sorbet/rbi/dsl/solid_queue/failed_execution.rbi new file mode 100644 index 0000000..f4882ab --- /dev/null +++ b/sorbet/rbi/dsl/solid_queue/failed_execution.rbi @@ -0,0 +1,1315 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `SolidQueue::FailedExecution`. +# Please instead update this file by running `bin/tapioca dsl SolidQueue::FailedExecution`. + + +class SolidQueue::FailedExecution + include GeneratedAssociationMethods + include GeneratedAttributeMethods + extend CommonRelationMethods + extend GeneratedRelationMethods + + private + + sig { returns(NilClass) } + def to_ary; end + + class << self + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::FailedExecution).void) + ).returns(::SolidQueue::FailedExecution) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::FailedExecution).returns(T.untyped)) + ).returns(T::Boolean) + end + def any?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def average(column_name); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::SolidQueue::FailedExecution).void) + ).returns(::SolidQueue::FailedExecution) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::FailedExecution).void) + ).returns(T::Array[::SolidQueue::FailedExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::FailedExecution).void) + ).returns(::SolidQueue::FailedExecution) + end + def build(attributes = nil, &block); end + + sig { params(operation: Symbol, column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def calculate(operation, column_name); end + + sig { params(column_name: T.nilable(T.any(String, Symbol))).returns(Integer) } + sig do + params( + column_name: NilClass, + block: T.proc.params(object: ::SolidQueue::FailedExecution).void + ).returns(Integer) + end + def count(column_name = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::SolidQueue::FailedExecution).void) + ).returns(::SolidQueue::FailedExecution) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::FailedExecution).void) + ).returns(T::Array[::SolidQueue::FailedExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::FailedExecution).void) + ).returns(::SolidQueue::FailedExecution) + end + def create(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::SolidQueue::FailedExecution).void) + ).returns(::SolidQueue::FailedExecution) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::FailedExecution).void) + ).returns(T::Array[::SolidQueue::FailedExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::FailedExecution).void) + ).returns(::SolidQueue::FailedExecution) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::FailedExecution).void) + ).returns(T::Array[::SolidQueue::FailedExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::FailedExecution).void) + ).returns(::SolidQueue::FailedExecution) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::FailedExecution).void) + ).returns(T::Array[::SolidQueue::FailedExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::FailedExecution).void) + ).returns(::SolidQueue::FailedExecution) + end + def create_or_find_by!(attributes, &block); end + + sig do + params( + records: T.any(::SolidQueue::FailedExecution, Integer, String, T::Enumerable[T.any(::SolidQueue::FailedExecution, Integer, String, T::Enumerable[::SolidQueue::FailedExecution])]) + ).returns(Integer) + end + def delete(*records); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(args); end + + sig do + params( + records: T.any(::SolidQueue::FailedExecution, Integer, String, T::Enumerable[T.any(::SolidQueue::FailedExecution, Integer, String, T::Enumerable[::SolidQueue::FailedExecution])]) + ).returns(T::Array[::SolidQueue::FailedExecution]) + end + def destroy(*records); end + + sig { returns(T::Array[::SolidQueue::FailedExecution]) } + def destroy_all; end + + sig { returns(T::Array[::SolidQueue::FailedExecution]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::SolidQueue::FailedExecution]) } + def destroy_by(args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::SolidQueue::FailedExecution)) } + def fifth; end + + sig { returns(::SolidQueue::FailedExecution) } + def fifth!; end + + sig do + params( + args: T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything]) + ).returns(::SolidQueue::FailedExecution) + end + sig do + params( + args: T::Array[T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything])] + ).returns(T::Enumerable[::SolidQueue::FailedExecution]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::SolidQueue::FailedExecution).void + ).returns(T.nilable(::SolidQueue::FailedExecution)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::SolidQueue::FailedExecution)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::SolidQueue::FailedExecution) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: ::SolidQueue::FailedExecution).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[::SolidQueue::FailedExecution]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: T::Array[::SolidQueue::FailedExecution]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[T::Enumerator[::SolidQueue::FailedExecution]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::FailedExecution).void) + ).returns(T::Array[::SolidQueue::FailedExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::FailedExecution).void) + ).returns(::SolidQueue::FailedExecution) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::FailedExecution).void) + ).returns(T::Array[::SolidQueue::FailedExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::FailedExecution).void) + ).returns(::SolidQueue::FailedExecution) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::FailedExecution).void) + ).returns(T::Array[::SolidQueue::FailedExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::FailedExecution).void) + ).returns(::SolidQueue::FailedExecution) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::SolidQueue::FailedExecution)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::SolidQueue::FailedExecution) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::SolidQueue::FailedExecution) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::SolidQueue::FailedExecution)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::FailedExecution]) } + def first(limit = nil); end + + sig { returns(::SolidQueue::FailedExecution) } + def first!; end + + sig { returns(T.nilable(::SolidQueue::FailedExecution)) } + def forty_two; end + + sig { returns(::SolidQueue::FailedExecution) } + def forty_two!; end + + sig { returns(T.nilable(::SolidQueue::FailedExecution)) } + def fourth; end + + sig { returns(::SolidQueue::FailedExecution) } + def fourth!; end + + sig { returns(T::Array[::Integer]) } + def ids; end + + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped, + block: T.proc.params(object: PrivateRelation).void + ).void + end + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped + ).returns(::ActiveRecord::Batches::BatchEnumerator) + end + def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, cursor: primary_key, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert!(attributes, returning: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert_all(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert_all!(attributes, returning: nil); end + + sig { returns(T.nilable(::SolidQueue::FailedExecution)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::FailedExecution]) } + def last(limit = nil); end + + sig { returns(::SolidQueue::FailedExecution) } + def last!; end + + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::FailedExecution).returns(T.untyped)) + ).returns(T::Boolean) + end + def many?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def maximum(column_name); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def member?(record); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def minimum(column_name); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::SolidQueue::FailedExecution).void) + ).returns(::SolidQueue::FailedExecution) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::FailedExecution).void) + ).returns(T::Array[::SolidQueue::FailedExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::FailedExecution).void) + ).returns(::SolidQueue::FailedExecution) + end + def new(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::FailedExecution).returns(T.untyped)) + ).returns(T::Boolean) + end + def none?(&block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::FailedExecution).returns(T.untyped)) + ).returns(T::Boolean) + end + def one?(&block); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pick(*column_names); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pluck(*column_names); end + + sig { returns(T.nilable(::SolidQueue::FailedExecution)) } + def second; end + + sig { returns(::SolidQueue::FailedExecution) } + def second!; end + + sig { returns(T.nilable(::SolidQueue::FailedExecution)) } + def second_to_last; end + + sig { returns(::SolidQueue::FailedExecution) } + def second_to_last!; end + + sig { returns(::SolidQueue::FailedExecution) } + def sole; end + + sig { params(initial_value_or_column: T.untyped).returns(T.any(Integer, Float, BigDecimal)) } + sig do + type_parameters(:U) + .params( + initial_value_or_column: T.nilable(T.type_parameter(:U)), + block: T.proc.params(object: ::SolidQueue::FailedExecution).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::SolidQueue::FailedExecution)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::FailedExecution]) } + def take(limit = nil); end + + sig { returns(::SolidQueue::FailedExecution) } + def take!; end + + sig { returns(T.nilable(::SolidQueue::FailedExecution)) } + def third; end + + sig { returns(::SolidQueue::FailedExecution) } + def third!; end + + sig { returns(T.nilable(::SolidQueue::FailedExecution)) } + def third_to_last; end + + sig { returns(::SolidQueue::FailedExecution) } + def third_to_last!; end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert_all(attributes, returning: nil, unique_by: nil); end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::Job) } + def build_job(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::Job) } + def create_job(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::Job) } + def create_job!(*args, &blk); end + + sig { returns(T.nilable(::SolidQueue::Job)) } + def job; end + + sig { params(value: T.nilable(::SolidQueue::Job)).void } + def job=(value); end + + sig { returns(T.nilable(::SolidQueue::Job)) } + def reload_job; end + + sig { void } + def reset_job; end + end + + module GeneratedAssociationRelationMethods + sig { returns(PrivateAssociationRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateAssociationRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def ordered(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + sig do + params( + blk: T.proc.params(record: ::SolidQueue::FailedExecution).returns(BasicObject) + ).returns(T::Array[::SolidQueue::FailedExecution]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateAssociationRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::ActiveSupport::TimeWithZone) } + def created_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def created_at=(value); end + + sig { returns(T::Boolean) } + def created_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_before_last_save; end + + sig { returns(T.untyped) } + def created_at_before_type_cast; end + + sig { returns(T::Boolean) } + def created_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_was; end + + sig { void } + def created_at_will_change!; end + + sig { returns(T.untyped) } + def error; end + + sig { params(value: T.untyped).returns(T.untyped) } + def error=(value); end + + sig { returns(T::Boolean) } + def error?; end + + sig { returns(T.untyped) } + def error_before_last_save; end + + sig { returns(T.untyped) } + def error_before_type_cast; end + + sig { returns(T::Boolean) } + def error_came_from_user?; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def error_change; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def error_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def error_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.untyped) } + def error_in_database; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def error_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def error_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.untyped) } + def error_previously_was; end + + sig { returns(T.untyped) } + def error_was; end + + sig { void } + def error_will_change!; end + + sig { returns(::Integer) } + def id; end + + sig { params(value: ::Integer).returns(::Integer) } + def id=(value); end + + sig { returns(T::Boolean) } + def id?; end + + sig { returns(T.nilable(::Integer)) } + def id_before_last_save; end + + sig { returns(T.untyped) } + def id_before_type_cast; end + + sig { returns(T::Boolean) } + def id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_previously_was; end + + sig { returns(::Integer) } + def id_value; end + + sig { params(value: ::Integer).returns(::Integer) } + def id_value=(value); end + + sig { returns(T::Boolean) } + def id_value?; end + + sig { returns(T.nilable(::Integer)) } + def id_value_before_last_save; end + + sig { returns(T.untyped) } + def id_value_before_type_cast; end + + sig { returns(T::Boolean) } + def id_value_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def id_value_was; end + + sig { void } + def id_value_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def id_was; end + + sig { void } + def id_will_change!; end + + sig { returns(::Integer) } + def job_id; end + + sig { params(value: ::Integer).returns(::Integer) } + def job_id=(value); end + + sig { returns(T::Boolean) } + def job_id?; end + + sig { returns(T.nilable(::Integer)) } + def job_id_before_last_save; end + + sig { returns(T.untyped) } + def job_id_before_type_cast; end + + sig { returns(T::Boolean) } + def job_id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def job_id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def job_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def job_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def job_id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def job_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def job_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def job_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def job_id_was; end + + sig { void } + def job_id_will_change!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_error!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_job_id!; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_created_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def saved_change_to_error; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_error?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id_value; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_job_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_job_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_error?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_job_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + end + + module GeneratedRelationMethods + sig { returns(PrivateRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def ordered(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + sig do + params( + blk: T.proc.params(record: ::SolidQueue::FailedExecution).returns(BasicObject) + ).returns(T::Array[::SolidQueue::FailedExecution]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::FailedExecution } } + + sig { returns(T::Array[::SolidQueue::FailedExecution]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::FailedExecution]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::SolidQueue::FailedExecution } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateAssociationRelationWhereChain + Elem = type_member { { fixed: ::SolidQueue::FailedExecution } } + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateAssociationRelation) } + def not(opts, *rest); end + end + + class PrivateCollectionProxy < ::ActiveRecord::Associations::CollectionProxy + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::FailedExecution } } + + sig do + params( + records: T.any(::SolidQueue::FailedExecution, T::Enumerable[T.any(::SolidQueue::FailedExecution, T::Enumerable[::SolidQueue::FailedExecution])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::SolidQueue::FailedExecution, T::Enumerable[T.any(::SolidQueue::FailedExecution, T::Enumerable[::SolidQueue::FailedExecution])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::SolidQueue::FailedExecution, T::Enumerable[T.any(::SolidQueue::FailedExecution, T::Enumerable[::SolidQueue::FailedExecution])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig { returns(T::Array[::SolidQueue::FailedExecution]) } + def load_target; end + + sig do + params( + records: T.any(::SolidQueue::FailedExecution, T::Enumerable[T.any(::SolidQueue::FailedExecution, T::Enumerable[::SolidQueue::FailedExecution])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::SolidQueue::FailedExecution, T::Enumerable[T.any(::SolidQueue::FailedExecution, T::Enumerable[::SolidQueue::FailedExecution])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::SolidQueue::FailedExecution, T::Enumerable[T.any(::SolidQueue::FailedExecution, T::Enumerable[::SolidQueue::FailedExecution])]) + ).returns(T::Array[::SolidQueue::FailedExecution]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::SolidQueue::FailedExecution]) } + def target; end + + sig { returns(T::Array[::SolidQueue::FailedExecution]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::FailedExecution]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::FailedExecution } } + + sig { returns(T::Array[::SolidQueue::FailedExecution]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::FailedExecution]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::SolidQueue::FailedExecution } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateRelationWhereChain + Elem = type_member { { fixed: ::SolidQueue::FailedExecution } } + + sig { params(args: T.untyped).returns(PrivateRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateRelation) } + def not(opts, *rest); end + end +end diff --git a/sorbet/rbi/dsl/solid_queue/job.rbi b/sorbet/rbi/dsl/solid_queue/job.rbi new file mode 100644 index 0000000..64bc0d9 --- /dev/null +++ b/sorbet/rbi/dsl/solid_queue/job.rbi @@ -0,0 +1,1800 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `SolidQueue::Job`. +# Please instead update this file by running `bin/tapioca dsl SolidQueue::Job`. + + +class SolidQueue::Job + include GeneratedAssociationMethods + include GeneratedAttributeMethods + extend CommonRelationMethods + extend GeneratedRelationMethods + + private + + sig { returns(NilClass) } + def to_ary; end + + class << self + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Job).void) + ).returns(::SolidQueue::Job) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::SolidQueue::Job).returns(T.untyped))).returns(T::Boolean) } + def any?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def average(column_name); end + + sig { params(block: T.nilable(T.proc.params(object: ::SolidQueue::Job).void)).returns(::SolidQueue::Job) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Job).void) + ).returns(T::Array[::SolidQueue::Job]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Job).void) + ).returns(::SolidQueue::Job) + end + def build(attributes = nil, &block); end + + sig { params(operation: Symbol, column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def calculate(operation, column_name); end + + sig { params(column_name: T.nilable(T.any(String, Symbol))).returns(Integer) } + sig { params(column_name: NilClass, block: T.proc.params(object: ::SolidQueue::Job).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::SolidQueue::Job).void)).returns(::SolidQueue::Job) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Job).void) + ).returns(T::Array[::SolidQueue::Job]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Job).void) + ).returns(::SolidQueue::Job) + end + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::SolidQueue::Job).void)).returns(::SolidQueue::Job) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Job).void) + ).returns(T::Array[::SolidQueue::Job]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Job).void) + ).returns(::SolidQueue::Job) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Job).void) + ).returns(T::Array[::SolidQueue::Job]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Job).void) + ).returns(::SolidQueue::Job) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Job).void) + ).returns(T::Array[::SolidQueue::Job]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Job).void) + ).returns(::SolidQueue::Job) + end + def create_or_find_by!(attributes, &block); end + + sig do + params( + records: T.any(::SolidQueue::Job, Integer, String, T::Enumerable[T.any(::SolidQueue::Job, Integer, String, T::Enumerable[::SolidQueue::Job])]) + ).returns(Integer) + end + def delete(*records); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(args); end + + sig do + params( + records: T.any(::SolidQueue::Job, Integer, String, T::Enumerable[T.any(::SolidQueue::Job, Integer, String, T::Enumerable[::SolidQueue::Job])]) + ).returns(T::Array[::SolidQueue::Job]) + end + def destroy(*records); end + + sig { returns(T::Array[::SolidQueue::Job]) } + def destroy_all; end + + sig { returns(T::Array[::SolidQueue::Job]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::SolidQueue::Job]) } + def destroy_by(args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::SolidQueue::Job)) } + def fifth; end + + sig { returns(::SolidQueue::Job) } + def fifth!; end + + sig do + params( + args: T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything]) + ).returns(::SolidQueue::Job) + end + sig do + params( + args: T::Array[T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything])] + ).returns(T::Enumerable[::SolidQueue::Job]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::SolidQueue::Job).void + ).returns(T.nilable(::SolidQueue::Job)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::SolidQueue::Job)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::SolidQueue::Job) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: ::SolidQueue::Job).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[::SolidQueue::Job]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: T::Array[::SolidQueue::Job]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[T::Enumerator[::SolidQueue::Job]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Job).void) + ).returns(T::Array[::SolidQueue::Job]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Job).void) + ).returns(::SolidQueue::Job) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Job).void) + ).returns(T::Array[::SolidQueue::Job]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Job).void) + ).returns(::SolidQueue::Job) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Job).void) + ).returns(T::Array[::SolidQueue::Job]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Job).void) + ).returns(::SolidQueue::Job) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::SolidQueue::Job)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::SolidQueue::Job) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::SolidQueue::Job) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::SolidQueue::Job)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::Job]) } + def first(limit = nil); end + + sig { returns(::SolidQueue::Job) } + def first!; end + + sig { returns(T.nilable(::SolidQueue::Job)) } + def forty_two; end + + sig { returns(::SolidQueue::Job) } + def forty_two!; end + + sig { returns(T.nilable(::SolidQueue::Job)) } + def fourth; end + + sig { returns(::SolidQueue::Job) } + def fourth!; end + + sig { returns(T::Array[::Integer]) } + def ids; end + + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped, + block: T.proc.params(object: PrivateRelation).void + ).void + end + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped + ).returns(::ActiveRecord::Batches::BatchEnumerator) + end + def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, cursor: primary_key, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert!(attributes, returning: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert_all(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert_all!(attributes, returning: nil); end + + sig { returns(T.nilable(::SolidQueue::Job)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::Job]) } + def last(limit = nil); end + + sig { returns(::SolidQueue::Job) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::SolidQueue::Job).returns(T.untyped))).returns(T::Boolean) } + def many?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def maximum(column_name); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def member?(record); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def minimum(column_name); end + + sig { params(block: T.nilable(T.proc.params(object: ::SolidQueue::Job).void)).returns(::SolidQueue::Job) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Job).void) + ).returns(T::Array[::SolidQueue::Job]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Job).void) + ).returns(::SolidQueue::Job) + end + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::SolidQueue::Job).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::SolidQueue::Job).returns(T.untyped))).returns(T::Boolean) } + def one?(&block); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pick(*column_names); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pluck(*column_names); end + + sig { returns(T.nilable(::SolidQueue::Job)) } + def second; end + + sig { returns(::SolidQueue::Job) } + def second!; end + + sig { returns(T.nilable(::SolidQueue::Job)) } + def second_to_last; end + + sig { returns(::SolidQueue::Job) } + def second_to_last!; end + + sig { returns(::SolidQueue::Job) } + def sole; end + + sig { params(initial_value_or_column: T.untyped).returns(T.any(Integer, Float, BigDecimal)) } + sig do + type_parameters(:U) + .params( + initial_value_or_column: T.nilable(T.type_parameter(:U)), + block: T.proc.params(object: ::SolidQueue::Job).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::SolidQueue::Job)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::Job]) } + def take(limit = nil); end + + sig { returns(::SolidQueue::Job) } + def take!; end + + sig { returns(T.nilable(::SolidQueue::Job)) } + def third; end + + sig { returns(::SolidQueue::Job) } + def third!; end + + sig { returns(T.nilable(::SolidQueue::Job)) } + def third_to_last; end + + sig { returns(::SolidQueue::Job) } + def third_to_last!; end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert_all(attributes, returning: nil, unique_by: nil); end + end + + module GeneratedAssociationMethods + sig { returns(T.nilable(::SolidQueue::BlockedExecution)) } + def blocked_execution; end + + sig { params(value: T.nilable(::SolidQueue::BlockedExecution)).void } + def blocked_execution=(value); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::BlockedExecution) } + def build_blocked_execution(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::ClaimedExecution) } + def build_claimed_execution(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::FailedExecution) } + def build_failed_execution(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::ReadyExecution) } + def build_ready_execution(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::RecurringExecution) } + def build_recurring_execution(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::ScheduledExecution) } + def build_scheduled_execution(*args, &blk); end + + sig { returns(T.nilable(::SolidQueue::ClaimedExecution)) } + def claimed_execution; end + + sig { params(value: T.nilable(::SolidQueue::ClaimedExecution)).void } + def claimed_execution=(value); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::BlockedExecution) } + def create_blocked_execution(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::BlockedExecution) } + def create_blocked_execution!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::ClaimedExecution) } + def create_claimed_execution(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::ClaimedExecution) } + def create_claimed_execution!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::FailedExecution) } + def create_failed_execution(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::FailedExecution) } + def create_failed_execution!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::ReadyExecution) } + def create_ready_execution(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::ReadyExecution) } + def create_ready_execution!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::RecurringExecution) } + def create_recurring_execution(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::RecurringExecution) } + def create_recurring_execution!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::ScheduledExecution) } + def create_scheduled_execution(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::ScheduledExecution) } + def create_scheduled_execution!(*args, &blk); end + + sig { returns(T.nilable(::SolidQueue::FailedExecution)) } + def failed_execution; end + + sig { params(value: T.nilable(::SolidQueue::FailedExecution)).void } + def failed_execution=(value); end + + sig { returns(T.nilable(::SolidQueue::ReadyExecution)) } + def ready_execution; end + + sig { params(value: T.nilable(::SolidQueue::ReadyExecution)).void } + def ready_execution=(value); end + + sig { returns(T.nilable(::SolidQueue::RecurringExecution)) } + def recurring_execution; end + + sig { params(value: T.nilable(::SolidQueue::RecurringExecution)).void } + def recurring_execution=(value); end + + sig { returns(T.nilable(::SolidQueue::BlockedExecution)) } + def reload_blocked_execution; end + + sig { returns(T.nilable(::SolidQueue::ClaimedExecution)) } + def reload_claimed_execution; end + + sig { returns(T.nilable(::SolidQueue::FailedExecution)) } + def reload_failed_execution; end + + sig { returns(T.nilable(::SolidQueue::ReadyExecution)) } + def reload_ready_execution; end + + sig { returns(T.nilable(::SolidQueue::RecurringExecution)) } + def reload_recurring_execution; end + + sig { returns(T.nilable(::SolidQueue::ScheduledExecution)) } + def reload_scheduled_execution; end + + sig { void } + def reset_blocked_execution; end + + sig { void } + def reset_claimed_execution; end + + sig { void } + def reset_failed_execution; end + + sig { void } + def reset_ready_execution; end + + sig { void } + def reset_recurring_execution; end + + sig { void } + def reset_scheduled_execution; end + + sig { returns(T.nilable(::SolidQueue::ScheduledExecution)) } + def scheduled_execution; end + + sig { params(value: T.nilable(::SolidQueue::ScheduledExecution)).void } + def scheduled_execution=(value); end + end + + module GeneratedAssociationRelationMethods + sig { returns(PrivateAssociationRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def clearable(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateAssociationRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def failed(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def finished(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def scheduled(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + sig do + params( + blk: T.proc.params(record: ::SolidQueue::Job).returns(BasicObject) + ).returns(T::Array[::SolidQueue::Job]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateAssociationRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(T.nilable(::String)) } + def active_job_id; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def active_job_id=(value); end + + sig { returns(T::Boolean) } + def active_job_id?; end + + sig { returns(T.nilable(::String)) } + def active_job_id_before_last_save; end + + sig { returns(T.untyped) } + def active_job_id_before_type_cast; end + + sig { returns(T::Boolean) } + def active_job_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def active_job_id_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def active_job_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def active_job_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def active_job_id_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def active_job_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def active_job_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def active_job_id_previously_was; end + + sig { returns(T.nilable(::String)) } + def active_job_id_was; end + + sig { void } + def active_job_id_will_change!; end + + sig { returns(T.untyped) } + def arguments; end + + sig { params(value: T.untyped).returns(T.untyped) } + def arguments=(value); end + + sig { returns(T::Boolean) } + def arguments?; end + + sig { returns(T.untyped) } + def arguments_before_last_save; end + + sig { returns(T.untyped) } + def arguments_before_type_cast; end + + sig { returns(T::Boolean) } + def arguments_came_from_user?; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def arguments_change; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def arguments_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def arguments_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.untyped) } + def arguments_in_database; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def arguments_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def arguments_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.untyped) } + def arguments_previously_was; end + + sig { returns(T.untyped) } + def arguments_was; end + + sig { void } + def arguments_will_change!; end + + sig { returns(::String) } + def class_name; end + + sig { params(value: ::String).returns(::String) } + def class_name=(value); end + + sig { returns(T::Boolean) } + def class_name?; end + + sig { returns(T.nilable(::String)) } + def class_name_before_last_save; end + + sig { returns(T.untyped) } + def class_name_before_type_cast; end + + sig { returns(T::Boolean) } + def class_name_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def class_name_change; end + + sig { returns(T.nilable([::String, ::String])) } + def class_name_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def class_name_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def class_name_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def class_name_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def class_name_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def class_name_previously_was; end + + sig { returns(T.nilable(::String)) } + def class_name_was; end + + sig { void } + def class_name_will_change!; end + + sig { returns(T.nilable(::String)) } + def concurrency_key; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def concurrency_key=(value); end + + sig { returns(T::Boolean) } + def concurrency_key?; end + + sig { returns(T.nilable(::String)) } + def concurrency_key_before_last_save; end + + sig { returns(T.untyped) } + def concurrency_key_before_type_cast; end + + sig { returns(T::Boolean) } + def concurrency_key_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def concurrency_key_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def concurrency_key_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def concurrency_key_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def concurrency_key_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def concurrency_key_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def concurrency_key_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def concurrency_key_previously_was; end + + sig { returns(T.nilable(::String)) } + def concurrency_key_was; end + + sig { void } + def concurrency_key_will_change!; end + + sig { returns(::ActiveSupport::TimeWithZone) } + def created_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def created_at=(value); end + + sig { returns(T::Boolean) } + def created_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_before_last_save; end + + sig { returns(T.untyped) } + def created_at_before_type_cast; end + + sig { returns(T::Boolean) } + def created_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_was; end + + sig { void } + def created_at_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def finished_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def finished_at=(value); end + + sig { returns(T::Boolean) } + def finished_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def finished_at_before_last_save; end + + sig { returns(T.untyped) } + def finished_at_before_type_cast; end + + sig { returns(T::Boolean) } + def finished_at_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def finished_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def finished_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def finished_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def finished_at_in_database; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def finished_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def finished_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def finished_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def finished_at_was; end + + sig { void } + def finished_at_will_change!; end + + sig { returns(::Integer) } + def id; end + + sig { params(value: ::Integer).returns(::Integer) } + def id=(value); end + + sig { returns(T::Boolean) } + def id?; end + + sig { returns(T.nilable(::Integer)) } + def id_before_last_save; end + + sig { returns(T.untyped) } + def id_before_type_cast; end + + sig { returns(T::Boolean) } + def id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_previously_was; end + + sig { returns(::Integer) } + def id_value; end + + sig { params(value: ::Integer).returns(::Integer) } + def id_value=(value); end + + sig { returns(T::Boolean) } + def id_value?; end + + sig { returns(T.nilable(::Integer)) } + def id_value_before_last_save; end + + sig { returns(T.untyped) } + def id_value_before_type_cast; end + + sig { returns(T::Boolean) } + def id_value_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def id_value_was; end + + sig { void } + def id_value_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def id_was; end + + sig { void } + def id_will_change!; end + + sig { returns(::Integer) } + def priority; end + + sig { params(value: ::Integer).returns(::Integer) } + def priority=(value); end + + sig { returns(T::Boolean) } + def priority?; end + + sig { returns(T.nilable(::Integer)) } + def priority_before_last_save; end + + sig { returns(T.untyped) } + def priority_before_type_cast; end + + sig { returns(T::Boolean) } + def priority_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def priority_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def priority_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def priority_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def priority_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def priority_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def priority_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def priority_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def priority_was; end + + sig { void } + def priority_will_change!; end + + sig { returns(::String) } + def queue_name; end + + sig { params(value: ::String).returns(::String) } + def queue_name=(value); end + + sig { returns(T::Boolean) } + def queue_name?; end + + sig { returns(T.nilable(::String)) } + def queue_name_before_last_save; end + + sig { returns(T.untyped) } + def queue_name_before_type_cast; end + + sig { returns(T::Boolean) } + def queue_name_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def queue_name_change; end + + sig { returns(T.nilable([::String, ::String])) } + def queue_name_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def queue_name_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def queue_name_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def queue_name_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def queue_name_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def queue_name_previously_was; end + + sig { returns(T.nilable(::String)) } + def queue_name_was; end + + sig { void } + def queue_name_will_change!; end + + sig { void } + def restore_active_job_id!; end + + sig { void } + def restore_arguments!; end + + sig { void } + def restore_class_name!; end + + sig { void } + def restore_concurrency_key!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_finished_at!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_priority!; end + + sig { void } + def restore_queue_name!; end + + sig { void } + def restore_scheduled_at!; end + + sig { void } + def restore_updated_at!; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_active_job_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_active_job_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def saved_change_to_arguments; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_arguments?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_class_name; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_class_name?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_concurrency_key; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_concurrency_key?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_created_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def saved_change_to_finished_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_finished_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id_value; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_priority; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_priority?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_queue_name; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_queue_name?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def saved_change_to_scheduled_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_scheduled_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_updated_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_updated_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def scheduled_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def scheduled_at=(value); end + + sig { returns(T::Boolean) } + def scheduled_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def scheduled_at_before_last_save; end + + sig { returns(T.untyped) } + def scheduled_at_before_type_cast; end + + sig { returns(T::Boolean) } + def scheduled_at_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def scheduled_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def scheduled_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def scheduled_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def scheduled_at_in_database; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def scheduled_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def scheduled_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def scheduled_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def scheduled_at_was; end + + sig { void } + def scheduled_at_will_change!; end + + sig { returns(::ActiveSupport::TimeWithZone) } + def updated_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def updated_at=(value); end + + sig { returns(T::Boolean) } + def updated_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_before_last_save; end + + sig { returns(T.untyped) } + def updated_at_before_type_cast; end + + sig { returns(T::Boolean) } + def updated_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def updated_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def updated_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def updated_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def updated_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def updated_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_was; end + + sig { void } + def updated_at_will_change!; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_active_job_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_arguments?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_class_name?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_concurrency_key?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_finished_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_priority?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_queue_name?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_scheduled_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_updated_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + end + + module GeneratedRelationMethods + sig { returns(PrivateRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def clearable(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def failed(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def finished(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def scheduled(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + sig do + params( + blk: T.proc.params(record: ::SolidQueue::Job).returns(BasicObject) + ).returns(T::Array[::SolidQueue::Job]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::Job } } + + sig { returns(T::Array[::SolidQueue::Job]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::Job]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::SolidQueue::Job } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateAssociationRelationWhereChain + Elem = type_member { { fixed: ::SolidQueue::Job } } + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateAssociationRelation) } + def not(opts, *rest); end + end + + class PrivateCollectionProxy < ::ActiveRecord::Associations::CollectionProxy + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::Job } } + + sig do + params( + records: T.any(::SolidQueue::Job, T::Enumerable[T.any(::SolidQueue::Job, T::Enumerable[::SolidQueue::Job])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::SolidQueue::Job, T::Enumerable[T.any(::SolidQueue::Job, T::Enumerable[::SolidQueue::Job])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::SolidQueue::Job, T::Enumerable[T.any(::SolidQueue::Job, T::Enumerable[::SolidQueue::Job])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig { returns(T::Array[::SolidQueue::Job]) } + def load_target; end + + sig do + params( + records: T.any(::SolidQueue::Job, T::Enumerable[T.any(::SolidQueue::Job, T::Enumerable[::SolidQueue::Job])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::SolidQueue::Job, T::Enumerable[T.any(::SolidQueue::Job, T::Enumerable[::SolidQueue::Job])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::SolidQueue::Job, T::Enumerable[T.any(::SolidQueue::Job, T::Enumerable[::SolidQueue::Job])]) + ).returns(T::Array[::SolidQueue::Job]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::SolidQueue::Job]) } + def target; end + + sig { returns(T::Array[::SolidQueue::Job]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::Job]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::Job } } + + sig { returns(T::Array[::SolidQueue::Job]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::Job]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::SolidQueue::Job } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateRelationWhereChain + Elem = type_member { { fixed: ::SolidQueue::Job } } + + sig { params(args: T.untyped).returns(PrivateRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateRelation) } + def not(opts, *rest); end + end +end diff --git a/sorbet/rbi/dsl/solid_queue/pause.rbi b/sorbet/rbi/dsl/solid_queue/pause.rbi new file mode 100644 index 0000000..9874b9d --- /dev/null +++ b/sorbet/rbi/dsl/solid_queue/pause.rbi @@ -0,0 +1,1191 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `SolidQueue::Pause`. +# Please instead update this file by running `bin/tapioca dsl SolidQueue::Pause`. + + +class SolidQueue::Pause + include GeneratedAttributeMethods + extend CommonRelationMethods + extend GeneratedRelationMethods + + private + + sig { returns(NilClass) } + def to_ary; end + + class << self + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Pause).void) + ).returns(::SolidQueue::Pause) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::SolidQueue::Pause).returns(T.untyped))).returns(T::Boolean) } + def any?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def average(column_name); end + + sig { params(block: T.nilable(T.proc.params(object: ::SolidQueue::Pause).void)).returns(::SolidQueue::Pause) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Pause).void) + ).returns(T::Array[::SolidQueue::Pause]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Pause).void) + ).returns(::SolidQueue::Pause) + end + def build(attributes = nil, &block); end + + sig { params(operation: Symbol, column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def calculate(operation, column_name); end + + sig { params(column_name: T.nilable(T.any(String, Symbol))).returns(Integer) } + sig { params(column_name: NilClass, block: T.proc.params(object: ::SolidQueue::Pause).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::SolidQueue::Pause).void)).returns(::SolidQueue::Pause) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Pause).void) + ).returns(T::Array[::SolidQueue::Pause]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Pause).void) + ).returns(::SolidQueue::Pause) + end + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::SolidQueue::Pause).void)).returns(::SolidQueue::Pause) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Pause).void) + ).returns(T::Array[::SolidQueue::Pause]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Pause).void) + ).returns(::SolidQueue::Pause) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Pause).void) + ).returns(T::Array[::SolidQueue::Pause]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Pause).void) + ).returns(::SolidQueue::Pause) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Pause).void) + ).returns(T::Array[::SolidQueue::Pause]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Pause).void) + ).returns(::SolidQueue::Pause) + end + def create_or_find_by!(attributes, &block); end + + sig do + params( + records: T.any(::SolidQueue::Pause, Integer, String, T::Enumerable[T.any(::SolidQueue::Pause, Integer, String, T::Enumerable[::SolidQueue::Pause])]) + ).returns(Integer) + end + def delete(*records); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(args); end + + sig do + params( + records: T.any(::SolidQueue::Pause, Integer, String, T::Enumerable[T.any(::SolidQueue::Pause, Integer, String, T::Enumerable[::SolidQueue::Pause])]) + ).returns(T::Array[::SolidQueue::Pause]) + end + def destroy(*records); end + + sig { returns(T::Array[::SolidQueue::Pause]) } + def destroy_all; end + + sig { returns(T::Array[::SolidQueue::Pause]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::SolidQueue::Pause]) } + def destroy_by(args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::SolidQueue::Pause)) } + def fifth; end + + sig { returns(::SolidQueue::Pause) } + def fifth!; end + + sig do + params( + args: T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything]) + ).returns(::SolidQueue::Pause) + end + sig do + params( + args: T::Array[T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything])] + ).returns(T::Enumerable[::SolidQueue::Pause]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::SolidQueue::Pause).void + ).returns(T.nilable(::SolidQueue::Pause)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::SolidQueue::Pause)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::SolidQueue::Pause) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: ::SolidQueue::Pause).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[::SolidQueue::Pause]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: T::Array[::SolidQueue::Pause]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[T::Enumerator[::SolidQueue::Pause]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Pause).void) + ).returns(T::Array[::SolidQueue::Pause]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Pause).void) + ).returns(::SolidQueue::Pause) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Pause).void) + ).returns(T::Array[::SolidQueue::Pause]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Pause).void) + ).returns(::SolidQueue::Pause) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Pause).void) + ).returns(T::Array[::SolidQueue::Pause]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Pause).void) + ).returns(::SolidQueue::Pause) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::SolidQueue::Pause)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::SolidQueue::Pause) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::SolidQueue::Pause) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::SolidQueue::Pause)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::Pause]) } + def first(limit = nil); end + + sig { returns(::SolidQueue::Pause) } + def first!; end + + sig { returns(T.nilable(::SolidQueue::Pause)) } + def forty_two; end + + sig { returns(::SolidQueue::Pause) } + def forty_two!; end + + sig { returns(T.nilable(::SolidQueue::Pause)) } + def fourth; end + + sig { returns(::SolidQueue::Pause) } + def fourth!; end + + sig { returns(T::Array[::Integer]) } + def ids; end + + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped, + block: T.proc.params(object: PrivateRelation).void + ).void + end + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped + ).returns(::ActiveRecord::Batches::BatchEnumerator) + end + def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, cursor: primary_key, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert!(attributes, returning: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert_all(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert_all!(attributes, returning: nil); end + + sig { returns(T.nilable(::SolidQueue::Pause)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::Pause]) } + def last(limit = nil); end + + sig { returns(::SolidQueue::Pause) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::SolidQueue::Pause).returns(T.untyped))).returns(T::Boolean) } + def many?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def maximum(column_name); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def member?(record); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def minimum(column_name); end + + sig { params(block: T.nilable(T.proc.params(object: ::SolidQueue::Pause).void)).returns(::SolidQueue::Pause) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Pause).void) + ).returns(T::Array[::SolidQueue::Pause]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Pause).void) + ).returns(::SolidQueue::Pause) + end + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::SolidQueue::Pause).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::SolidQueue::Pause).returns(T.untyped))).returns(T::Boolean) } + def one?(&block); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pick(*column_names); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pluck(*column_names); end + + sig { returns(T.nilable(::SolidQueue::Pause)) } + def second; end + + sig { returns(::SolidQueue::Pause) } + def second!; end + + sig { returns(T.nilable(::SolidQueue::Pause)) } + def second_to_last; end + + sig { returns(::SolidQueue::Pause) } + def second_to_last!; end + + sig { returns(::SolidQueue::Pause) } + def sole; end + + sig { params(initial_value_or_column: T.untyped).returns(T.any(Integer, Float, BigDecimal)) } + sig do + type_parameters(:U) + .params( + initial_value_or_column: T.nilable(T.type_parameter(:U)), + block: T.proc.params(object: ::SolidQueue::Pause).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::SolidQueue::Pause)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::Pause]) } + def take(limit = nil); end + + sig { returns(::SolidQueue::Pause) } + def take!; end + + sig { returns(T.nilable(::SolidQueue::Pause)) } + def third; end + + sig { returns(::SolidQueue::Pause) } + def third!; end + + sig { returns(T.nilable(::SolidQueue::Pause)) } + def third_to_last; end + + sig { returns(::SolidQueue::Pause) } + def third_to_last!; end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert_all(attributes, returning: nil, unique_by: nil); end + end + + module GeneratedAssociationRelationMethods + sig { returns(PrivateAssociationRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateAssociationRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + sig do + params( + blk: T.proc.params(record: ::SolidQueue::Pause).returns(BasicObject) + ).returns(T::Array[::SolidQueue::Pause]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateAssociationRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::ActiveSupport::TimeWithZone) } + def created_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def created_at=(value); end + + sig { returns(T::Boolean) } + def created_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_before_last_save; end + + sig { returns(T.untyped) } + def created_at_before_type_cast; end + + sig { returns(T::Boolean) } + def created_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_was; end + + sig { void } + def created_at_will_change!; end + + sig { returns(::Integer) } + def id; end + + sig { params(value: ::Integer).returns(::Integer) } + def id=(value); end + + sig { returns(T::Boolean) } + def id?; end + + sig { returns(T.nilable(::Integer)) } + def id_before_last_save; end + + sig { returns(T.untyped) } + def id_before_type_cast; end + + sig { returns(T::Boolean) } + def id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_previously_was; end + + sig { returns(::Integer) } + def id_value; end + + sig { params(value: ::Integer).returns(::Integer) } + def id_value=(value); end + + sig { returns(T::Boolean) } + def id_value?; end + + sig { returns(T.nilable(::Integer)) } + def id_value_before_last_save; end + + sig { returns(T.untyped) } + def id_value_before_type_cast; end + + sig { returns(T::Boolean) } + def id_value_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def id_value_was; end + + sig { void } + def id_value_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def id_was; end + + sig { void } + def id_will_change!; end + + sig { returns(::String) } + def queue_name; end + + sig { params(value: ::String).returns(::String) } + def queue_name=(value); end + + sig { returns(T::Boolean) } + def queue_name?; end + + sig { returns(T.nilable(::String)) } + def queue_name_before_last_save; end + + sig { returns(T.untyped) } + def queue_name_before_type_cast; end + + sig { returns(T::Boolean) } + def queue_name_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def queue_name_change; end + + sig { returns(T.nilable([::String, ::String])) } + def queue_name_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def queue_name_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def queue_name_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def queue_name_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def queue_name_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def queue_name_previously_was; end + + sig { returns(T.nilable(::String)) } + def queue_name_was; end + + sig { void } + def queue_name_will_change!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_queue_name!; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_created_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id_value; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_queue_name; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_queue_name?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_queue_name?(from: T.unsafe(nil), to: T.unsafe(nil)); end + end + + module GeneratedRelationMethods + sig { returns(PrivateRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + sig do + params( + blk: T.proc.params(record: ::SolidQueue::Pause).returns(BasicObject) + ).returns(T::Array[::SolidQueue::Pause]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::Pause } } + + sig { returns(T::Array[::SolidQueue::Pause]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::Pause]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::SolidQueue::Pause } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateAssociationRelationWhereChain + Elem = type_member { { fixed: ::SolidQueue::Pause } } + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateAssociationRelation) } + def not(opts, *rest); end + end + + class PrivateCollectionProxy < ::ActiveRecord::Associations::CollectionProxy + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::Pause } } + + sig do + params( + records: T.any(::SolidQueue::Pause, T::Enumerable[T.any(::SolidQueue::Pause, T::Enumerable[::SolidQueue::Pause])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::SolidQueue::Pause, T::Enumerable[T.any(::SolidQueue::Pause, T::Enumerable[::SolidQueue::Pause])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::SolidQueue::Pause, T::Enumerable[T.any(::SolidQueue::Pause, T::Enumerable[::SolidQueue::Pause])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig { returns(T::Array[::SolidQueue::Pause]) } + def load_target; end + + sig do + params( + records: T.any(::SolidQueue::Pause, T::Enumerable[T.any(::SolidQueue::Pause, T::Enumerable[::SolidQueue::Pause])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::SolidQueue::Pause, T::Enumerable[T.any(::SolidQueue::Pause, T::Enumerable[::SolidQueue::Pause])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::SolidQueue::Pause, T::Enumerable[T.any(::SolidQueue::Pause, T::Enumerable[::SolidQueue::Pause])]) + ).returns(T::Array[::SolidQueue::Pause]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::SolidQueue::Pause]) } + def target; end + + sig { returns(T::Array[::SolidQueue::Pause]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::Pause]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::Pause } } + + sig { returns(T::Array[::SolidQueue::Pause]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::Pause]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::SolidQueue::Pause } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateRelationWhereChain + Elem = type_member { { fixed: ::SolidQueue::Pause } } + + sig { params(args: T.untyped).returns(PrivateRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateRelation) } + def not(opts, *rest); end + end +end diff --git a/sorbet/rbi/dsl/solid_queue/process.rbi b/sorbet/rbi/dsl/solid_queue/process.rbi new file mode 100644 index 0000000..7cae55c --- /dev/null +++ b/sorbet/rbi/dsl/solid_queue/process.rbi @@ -0,0 +1,1613 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `SolidQueue::Process`. +# Please instead update this file by running `bin/tapioca dsl SolidQueue::Process`. + + +class SolidQueue::Process + include GeneratedAssociationMethods + include GeneratedAttributeMethods + extend CommonRelationMethods + extend GeneratedRelationMethods + + private + + sig { returns(NilClass) } + def to_ary; end + + class << self + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Process).void) + ).returns(::SolidQueue::Process) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::Process).returns(T.untyped)) + ).returns(T::Boolean) + end + def any?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def average(column_name); end + + sig { params(block: T.nilable(T.proc.params(object: ::SolidQueue::Process).void)).returns(::SolidQueue::Process) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Process).void) + ).returns(T::Array[::SolidQueue::Process]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Process).void) + ).returns(::SolidQueue::Process) + end + def build(attributes = nil, &block); end + + sig { params(operation: Symbol, column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def calculate(operation, column_name); end + + sig { params(column_name: T.nilable(T.any(String, Symbol))).returns(Integer) } + sig { params(column_name: NilClass, block: T.proc.params(object: ::SolidQueue::Process).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::SolidQueue::Process).void)).returns(::SolidQueue::Process) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Process).void) + ).returns(T::Array[::SolidQueue::Process]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Process).void) + ).returns(::SolidQueue::Process) + end + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::SolidQueue::Process).void)).returns(::SolidQueue::Process) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Process).void) + ).returns(T::Array[::SolidQueue::Process]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Process).void) + ).returns(::SolidQueue::Process) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Process).void) + ).returns(T::Array[::SolidQueue::Process]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Process).void) + ).returns(::SolidQueue::Process) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Process).void) + ).returns(T::Array[::SolidQueue::Process]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Process).void) + ).returns(::SolidQueue::Process) + end + def create_or_find_by!(attributes, &block); end + + sig do + params( + records: T.any(::SolidQueue::Process, Integer, String, T::Enumerable[T.any(::SolidQueue::Process, Integer, String, T::Enumerable[::SolidQueue::Process])]) + ).returns(Integer) + end + def delete(*records); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(args); end + + sig do + params( + records: T.any(::SolidQueue::Process, Integer, String, T::Enumerable[T.any(::SolidQueue::Process, Integer, String, T::Enumerable[::SolidQueue::Process])]) + ).returns(T::Array[::SolidQueue::Process]) + end + def destroy(*records); end + + sig { returns(T::Array[::SolidQueue::Process]) } + def destroy_all; end + + sig { returns(T::Array[::SolidQueue::Process]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::SolidQueue::Process]) } + def destroy_by(args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::SolidQueue::Process)) } + def fifth; end + + sig { returns(::SolidQueue::Process) } + def fifth!; end + + sig do + params( + args: T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything]) + ).returns(::SolidQueue::Process) + end + sig do + params( + args: T::Array[T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything])] + ).returns(T::Enumerable[::SolidQueue::Process]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::SolidQueue::Process).void + ).returns(T.nilable(::SolidQueue::Process)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::SolidQueue::Process)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::SolidQueue::Process) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: ::SolidQueue::Process).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[::SolidQueue::Process]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: T::Array[::SolidQueue::Process]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[T::Enumerator[::SolidQueue::Process]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Process).void) + ).returns(T::Array[::SolidQueue::Process]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Process).void) + ).returns(::SolidQueue::Process) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Process).void) + ).returns(T::Array[::SolidQueue::Process]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Process).void) + ).returns(::SolidQueue::Process) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Process).void) + ).returns(T::Array[::SolidQueue::Process]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Process).void) + ).returns(::SolidQueue::Process) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::SolidQueue::Process)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::SolidQueue::Process) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::SolidQueue::Process) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::SolidQueue::Process)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::Process]) } + def first(limit = nil); end + + sig { returns(::SolidQueue::Process) } + def first!; end + + sig { returns(T.nilable(::SolidQueue::Process)) } + def forty_two; end + + sig { returns(::SolidQueue::Process) } + def forty_two!; end + + sig { returns(T.nilable(::SolidQueue::Process)) } + def fourth; end + + sig { returns(::SolidQueue::Process) } + def fourth!; end + + sig { returns(T::Array[::Integer]) } + def ids; end + + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped, + block: T.proc.params(object: PrivateRelation).void + ).void + end + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped + ).returns(::ActiveRecord::Batches::BatchEnumerator) + end + def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, cursor: primary_key, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert!(attributes, returning: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert_all(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert_all!(attributes, returning: nil); end + + sig { returns(T.nilable(::SolidQueue::Process)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::Process]) } + def last(limit = nil); end + + sig { returns(::SolidQueue::Process) } + def last!; end + + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::Process).returns(T.untyped)) + ).returns(T::Boolean) + end + def many?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def maximum(column_name); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def member?(record); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def minimum(column_name); end + + sig { params(block: T.nilable(T.proc.params(object: ::SolidQueue::Process).void)).returns(::SolidQueue::Process) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Process).void) + ).returns(T::Array[::SolidQueue::Process]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Process).void) + ).returns(::SolidQueue::Process) + end + def new(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::Process).returns(T.untyped)) + ).returns(T::Boolean) + end + def none?(&block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::Process).returns(T.untyped)) + ).returns(T::Boolean) + end + def one?(&block); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pick(*column_names); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pluck(*column_names); end + + sig { returns(T.nilable(::SolidQueue::Process)) } + def second; end + + sig { returns(::SolidQueue::Process) } + def second!; end + + sig { returns(T.nilable(::SolidQueue::Process)) } + def second_to_last; end + + sig { returns(::SolidQueue::Process) } + def second_to_last!; end + + sig { returns(::SolidQueue::Process) } + def sole; end + + sig { params(initial_value_or_column: T.untyped).returns(T.any(Integer, Float, BigDecimal)) } + sig do + type_parameters(:U) + .params( + initial_value_or_column: T.nilable(T.type_parameter(:U)), + block: T.proc.params(object: ::SolidQueue::Process).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::SolidQueue::Process)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::Process]) } + def take(limit = nil); end + + sig { returns(::SolidQueue::Process) } + def take!; end + + sig { returns(T.nilable(::SolidQueue::Process)) } + def third; end + + sig { returns(::SolidQueue::Process) } + def third!; end + + sig { returns(T.nilable(::SolidQueue::Process)) } + def third_to_last; end + + sig { returns(::SolidQueue::Process) } + def third_to_last!; end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert_all(attributes, returning: nil, unique_by: nil); end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::Process) } + def build_supervisor(*args, &blk); end + + sig { returns(T::Array[T.untyped]) } + def claimed_execution_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def claimed_execution_ids=(ids); end + + # This method is created by ActiveRecord on the `SolidQueue::Process` class because it declared `has_many :claimed_executions`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::SolidQueue::ClaimedExecution::PrivateCollectionProxy) } + def claimed_executions; end + + sig { params(value: T::Enumerable[::SolidQueue::ClaimedExecution]).void } + def claimed_executions=(value); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::Process) } + def create_supervisor(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::Process) } + def create_supervisor!(*args, &blk); end + + sig { returns(T.nilable(::SolidQueue::Process)) } + def reload_supervisor; end + + sig { void } + def reset_supervisor; end + + sig { returns(T::Array[T.untyped]) } + def supervisee_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def supervisee_ids=(ids); end + + # This method is created by ActiveRecord on the `SolidQueue::Process` class because it declared `has_many :supervisees`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::SolidQueue::Process::PrivateCollectionProxy) } + def supervisees; end + + sig { params(value: T::Enumerable[::SolidQueue::Process]).void } + def supervisees=(value); end + + sig { returns(T.nilable(::SolidQueue::Process)) } + def supervisor; end + + sig { params(value: T.nilable(::SolidQueue::Process)).void } + def supervisor=(value); end + + sig { returns(T::Boolean) } + def supervisor_changed?; end + + sig { returns(T::Boolean) } + def supervisor_previously_changed?; end + end + + module GeneratedAssociationRelationMethods + sig { returns(PrivateAssociationRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateAssociationRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def prunable(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + sig do + params( + blk: T.proc.params(record: ::SolidQueue::Process).returns(BasicObject) + ).returns(T::Array[::SolidQueue::Process]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateAssociationRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::ActiveSupport::TimeWithZone) } + def created_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def created_at=(value); end + + sig { returns(T::Boolean) } + def created_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_before_last_save; end + + sig { returns(T.untyped) } + def created_at_before_type_cast; end + + sig { returns(T::Boolean) } + def created_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_was; end + + sig { void } + def created_at_will_change!; end + + sig { returns(T.nilable(::String)) } + def hostname; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def hostname=(value); end + + sig { returns(T::Boolean) } + def hostname?; end + + sig { returns(T.nilable(::String)) } + def hostname_before_last_save; end + + sig { returns(T.untyped) } + def hostname_before_type_cast; end + + sig { returns(T::Boolean) } + def hostname_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def hostname_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def hostname_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def hostname_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def hostname_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def hostname_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def hostname_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def hostname_previously_was; end + + sig { returns(T.nilable(::String)) } + def hostname_was; end + + sig { void } + def hostname_will_change!; end + + sig { returns(::Integer) } + def id; end + + sig { params(value: ::Integer).returns(::Integer) } + def id=(value); end + + sig { returns(T::Boolean) } + def id?; end + + sig { returns(T.nilable(::Integer)) } + def id_before_last_save; end + + sig { returns(T.untyped) } + def id_before_type_cast; end + + sig { returns(T::Boolean) } + def id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_previously_was; end + + sig { returns(::Integer) } + def id_value; end + + sig { params(value: ::Integer).returns(::Integer) } + def id_value=(value); end + + sig { returns(T::Boolean) } + def id_value?; end + + sig { returns(T.nilable(::Integer)) } + def id_value_before_last_save; end + + sig { returns(T.untyped) } + def id_value_before_type_cast; end + + sig { returns(T::Boolean) } + def id_value_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def id_value_was; end + + sig { void } + def id_value_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def id_was; end + + sig { void } + def id_will_change!; end + + sig { returns(::String) } + def kind; end + + sig { params(value: ::String).returns(::String) } + def kind=(value); end + + sig { returns(T::Boolean) } + def kind?; end + + sig { returns(T.nilable(::String)) } + def kind_before_last_save; end + + sig { returns(T.untyped) } + def kind_before_type_cast; end + + sig { returns(T::Boolean) } + def kind_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def kind_change; end + + sig { returns(T.nilable([::String, ::String])) } + def kind_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def kind_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def kind_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def kind_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def kind_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def kind_previously_was; end + + sig { returns(T.nilable(::String)) } + def kind_was; end + + sig { void } + def kind_will_change!; end + + sig { returns(::ActiveSupport::TimeWithZone) } + def last_heartbeat_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def last_heartbeat_at=(value); end + + sig { returns(T::Boolean) } + def last_heartbeat_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def last_heartbeat_at_before_last_save; end + + sig { returns(T.untyped) } + def last_heartbeat_at_before_type_cast; end + + sig { returns(T::Boolean) } + def last_heartbeat_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def last_heartbeat_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def last_heartbeat_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def last_heartbeat_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def last_heartbeat_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def last_heartbeat_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def last_heartbeat_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def last_heartbeat_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def last_heartbeat_at_was; end + + sig { void } + def last_heartbeat_at_will_change!; end + + sig { returns(T.untyped) } + def metadata; end + + sig { params(value: T.untyped).returns(T.untyped) } + def metadata=(value); end + + sig { returns(T::Boolean) } + def metadata?; end + + sig { returns(T.untyped) } + def metadata_before_last_save; end + + sig { returns(T.untyped) } + def metadata_before_type_cast; end + + sig { returns(T::Boolean) } + def metadata_came_from_user?; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def metadata_change; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def metadata_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def metadata_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.untyped) } + def metadata_in_database; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def metadata_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def metadata_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.untyped) } + def metadata_previously_was; end + + sig { returns(T.untyped) } + def metadata_was; end + + sig { void } + def metadata_will_change!; end + + sig { returns(::String) } + def name; end + + sig { params(value: ::String).returns(::String) } + def name=(value); end + + sig { returns(T::Boolean) } + def name?; end + + sig { returns(T.nilable(::String)) } + def name_before_last_save; end + + sig { returns(T.untyped) } + def name_before_type_cast; end + + sig { returns(T::Boolean) } + def name_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def name_change; end + + sig { returns(T.nilable([::String, ::String])) } + def name_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def name_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def name_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def name_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def name_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def name_previously_was; end + + sig { returns(T.nilable(::String)) } + def name_was; end + + sig { void } + def name_will_change!; end + + sig { returns(::Integer) } + def pid; end + + sig { params(value: ::Integer).returns(::Integer) } + def pid=(value); end + + sig { returns(T::Boolean) } + def pid?; end + + sig { returns(T.nilable(::Integer)) } + def pid_before_last_save; end + + sig { returns(T.untyped) } + def pid_before_type_cast; end + + sig { returns(T::Boolean) } + def pid_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def pid_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def pid_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def pid_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def pid_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def pid_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def pid_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def pid_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def pid_was; end + + sig { void } + def pid_will_change!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_hostname!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_kind!; end + + sig { void } + def restore_last_heartbeat_at!; end + + sig { void } + def restore_metadata!; end + + sig { void } + def restore_name!; end + + sig { void } + def restore_pid!; end + + sig { void } + def restore_supervisor_id!; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_created_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_hostname; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_hostname?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id_value; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_kind; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_kind?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_last_heartbeat_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_last_heartbeat_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def saved_change_to_metadata; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_metadata?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_name; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_name?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_pid; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_pid?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def saved_change_to_supervisor_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_supervisor_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def supervisor_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def supervisor_id=(value); end + + sig { returns(T::Boolean) } + def supervisor_id?; end + + sig { returns(T.nilable(::Integer)) } + def supervisor_id_before_last_save; end + + sig { returns(T.untyped) } + def supervisor_id_before_type_cast; end + + sig { returns(T::Boolean) } + def supervisor_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def supervisor_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def supervisor_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def supervisor_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def supervisor_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def supervisor_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def supervisor_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def supervisor_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def supervisor_id_was; end + + sig { void } + def supervisor_id_will_change!; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_hostname?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_kind?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_last_heartbeat_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_metadata?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_name?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_pid?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_supervisor_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + end + + module GeneratedRelationMethods + sig { returns(PrivateRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def prunable(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + sig do + params( + blk: T.proc.params(record: ::SolidQueue::Process).returns(BasicObject) + ).returns(T::Array[::SolidQueue::Process]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::Process } } + + sig { returns(T::Array[::SolidQueue::Process]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::Process]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::SolidQueue::Process } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateAssociationRelationWhereChain + Elem = type_member { { fixed: ::SolidQueue::Process } } + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateAssociationRelation) } + def not(opts, *rest); end + end + + class PrivateCollectionProxy < ::ActiveRecord::Associations::CollectionProxy + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::Process } } + + sig do + params( + records: T.any(::SolidQueue::Process, T::Enumerable[T.any(::SolidQueue::Process, T::Enumerable[::SolidQueue::Process])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::SolidQueue::Process, T::Enumerable[T.any(::SolidQueue::Process, T::Enumerable[::SolidQueue::Process])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::SolidQueue::Process, T::Enumerable[T.any(::SolidQueue::Process, T::Enumerable[::SolidQueue::Process])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig { returns(T::Array[::SolidQueue::Process]) } + def load_target; end + + sig do + params( + records: T.any(::SolidQueue::Process, T::Enumerable[T.any(::SolidQueue::Process, T::Enumerable[::SolidQueue::Process])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::SolidQueue::Process, T::Enumerable[T.any(::SolidQueue::Process, T::Enumerable[::SolidQueue::Process])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::SolidQueue::Process, T::Enumerable[T.any(::SolidQueue::Process, T::Enumerable[::SolidQueue::Process])]) + ).returns(T::Array[::SolidQueue::Process]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::SolidQueue::Process]) } + def target; end + + sig { returns(T::Array[::SolidQueue::Process]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::Process]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::Process } } + + sig { returns(T::Array[::SolidQueue::Process]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::Process]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::SolidQueue::Process } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateRelationWhereChain + Elem = type_member { { fixed: ::SolidQueue::Process } } + + sig { params(args: T.untyped).returns(PrivateRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateRelation) } + def not(opts, *rest); end + end +end diff --git a/sorbet/rbi/dsl/solid_queue/processes/callbacks.rbi b/sorbet/rbi/dsl/solid_queue/processes/callbacks.rbi new file mode 100644 index 0000000..99f23a5 --- /dev/null +++ b/sorbet/rbi/dsl/solid_queue/processes/callbacks.rbi @@ -0,0 +1,21 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `SolidQueue::Processes::Callbacks`. +# Please instead update this file by running `bin/tapioca dsl SolidQueue::Processes::Callbacks`. + + +module SolidQueue::Processes::Callbacks + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + end + + module GeneratedInstanceMethods + def __callbacks; end + end +end diff --git a/sorbet/rbi/dsl/solid_queue/ready_execution.rbi b/sorbet/rbi/dsl/solid_queue/ready_execution.rbi new file mode 100644 index 0000000..87c5f21 --- /dev/null +++ b/sorbet/rbi/dsl/solid_queue/ready_execution.rbi @@ -0,0 +1,1378 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `SolidQueue::ReadyExecution`. +# Please instead update this file by running `bin/tapioca dsl SolidQueue::ReadyExecution`. + + +class SolidQueue::ReadyExecution + include GeneratedAssociationMethods + include GeneratedAttributeMethods + extend CommonRelationMethods + extend GeneratedRelationMethods + + private + + sig { returns(NilClass) } + def to_ary; end + + class << self + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::ReadyExecution).void) + ).returns(::SolidQueue::ReadyExecution) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::ReadyExecution).returns(T.untyped)) + ).returns(T::Boolean) + end + def any?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def average(column_name); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::SolidQueue::ReadyExecution).void) + ).returns(::SolidQueue::ReadyExecution) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::ReadyExecution).void) + ).returns(T::Array[::SolidQueue::ReadyExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::ReadyExecution).void) + ).returns(::SolidQueue::ReadyExecution) + end + def build(attributes = nil, &block); end + + sig { params(operation: Symbol, column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def calculate(operation, column_name); end + + sig { params(column_name: T.nilable(T.any(String, Symbol))).returns(Integer) } + sig do + params( + column_name: NilClass, + block: T.proc.params(object: ::SolidQueue::ReadyExecution).void + ).returns(Integer) + end + def count(column_name = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::SolidQueue::ReadyExecution).void) + ).returns(::SolidQueue::ReadyExecution) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::ReadyExecution).void) + ).returns(T::Array[::SolidQueue::ReadyExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::ReadyExecution).void) + ).returns(::SolidQueue::ReadyExecution) + end + def create(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::SolidQueue::ReadyExecution).void) + ).returns(::SolidQueue::ReadyExecution) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::ReadyExecution).void) + ).returns(T::Array[::SolidQueue::ReadyExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::ReadyExecution).void) + ).returns(::SolidQueue::ReadyExecution) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::ReadyExecution).void) + ).returns(T::Array[::SolidQueue::ReadyExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::ReadyExecution).void) + ).returns(::SolidQueue::ReadyExecution) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::ReadyExecution).void) + ).returns(T::Array[::SolidQueue::ReadyExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::ReadyExecution).void) + ).returns(::SolidQueue::ReadyExecution) + end + def create_or_find_by!(attributes, &block); end + + sig do + params( + records: T.any(::SolidQueue::ReadyExecution, Integer, String, T::Enumerable[T.any(::SolidQueue::ReadyExecution, Integer, String, T::Enumerable[::SolidQueue::ReadyExecution])]) + ).returns(Integer) + end + def delete(*records); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(args); end + + sig do + params( + records: T.any(::SolidQueue::ReadyExecution, Integer, String, T::Enumerable[T.any(::SolidQueue::ReadyExecution, Integer, String, T::Enumerable[::SolidQueue::ReadyExecution])]) + ).returns(T::Array[::SolidQueue::ReadyExecution]) + end + def destroy(*records); end + + sig { returns(T::Array[::SolidQueue::ReadyExecution]) } + def destroy_all; end + + sig { returns(T::Array[::SolidQueue::ReadyExecution]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::SolidQueue::ReadyExecution]) } + def destroy_by(args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::SolidQueue::ReadyExecution)) } + def fifth; end + + sig { returns(::SolidQueue::ReadyExecution) } + def fifth!; end + + sig do + params( + args: T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything]) + ).returns(::SolidQueue::ReadyExecution) + end + sig do + params( + args: T::Array[T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything])] + ).returns(T::Enumerable[::SolidQueue::ReadyExecution]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::SolidQueue::ReadyExecution).void + ).returns(T.nilable(::SolidQueue::ReadyExecution)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::SolidQueue::ReadyExecution)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::SolidQueue::ReadyExecution) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: ::SolidQueue::ReadyExecution).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[::SolidQueue::ReadyExecution]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: T::Array[::SolidQueue::ReadyExecution]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[T::Enumerator[::SolidQueue::ReadyExecution]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::ReadyExecution).void) + ).returns(T::Array[::SolidQueue::ReadyExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::ReadyExecution).void) + ).returns(::SolidQueue::ReadyExecution) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::ReadyExecution).void) + ).returns(T::Array[::SolidQueue::ReadyExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::ReadyExecution).void) + ).returns(::SolidQueue::ReadyExecution) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::ReadyExecution).void) + ).returns(T::Array[::SolidQueue::ReadyExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::ReadyExecution).void) + ).returns(::SolidQueue::ReadyExecution) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::SolidQueue::ReadyExecution)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::SolidQueue::ReadyExecution) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::SolidQueue::ReadyExecution) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::SolidQueue::ReadyExecution)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::ReadyExecution]) } + def first(limit = nil); end + + sig { returns(::SolidQueue::ReadyExecution) } + def first!; end + + sig { returns(T.nilable(::SolidQueue::ReadyExecution)) } + def forty_two; end + + sig { returns(::SolidQueue::ReadyExecution) } + def forty_two!; end + + sig { returns(T.nilable(::SolidQueue::ReadyExecution)) } + def fourth; end + + sig { returns(::SolidQueue::ReadyExecution) } + def fourth!; end + + sig { returns(T::Array[::Integer]) } + def ids; end + + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped, + block: T.proc.params(object: PrivateRelation).void + ).void + end + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped + ).returns(::ActiveRecord::Batches::BatchEnumerator) + end + def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, cursor: primary_key, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert!(attributes, returning: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert_all(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert_all!(attributes, returning: nil); end + + sig { returns(T.nilable(::SolidQueue::ReadyExecution)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::ReadyExecution]) } + def last(limit = nil); end + + sig { returns(::SolidQueue::ReadyExecution) } + def last!; end + + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::ReadyExecution).returns(T.untyped)) + ).returns(T::Boolean) + end + def many?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def maximum(column_name); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def member?(record); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def minimum(column_name); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::SolidQueue::ReadyExecution).void) + ).returns(::SolidQueue::ReadyExecution) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::ReadyExecution).void) + ).returns(T::Array[::SolidQueue::ReadyExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::ReadyExecution).void) + ).returns(::SolidQueue::ReadyExecution) + end + def new(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::ReadyExecution).returns(T.untyped)) + ).returns(T::Boolean) + end + def none?(&block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::ReadyExecution).returns(T.untyped)) + ).returns(T::Boolean) + end + def one?(&block); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pick(*column_names); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pluck(*column_names); end + + sig { returns(T.nilable(::SolidQueue::ReadyExecution)) } + def second; end + + sig { returns(::SolidQueue::ReadyExecution) } + def second!; end + + sig { returns(T.nilable(::SolidQueue::ReadyExecution)) } + def second_to_last; end + + sig { returns(::SolidQueue::ReadyExecution) } + def second_to_last!; end + + sig { returns(::SolidQueue::ReadyExecution) } + def sole; end + + sig { params(initial_value_or_column: T.untyped).returns(T.any(Integer, Float, BigDecimal)) } + sig do + type_parameters(:U) + .params( + initial_value_or_column: T.nilable(T.type_parameter(:U)), + block: T.proc.params(object: ::SolidQueue::ReadyExecution).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::SolidQueue::ReadyExecution)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::ReadyExecution]) } + def take(limit = nil); end + + sig { returns(::SolidQueue::ReadyExecution) } + def take!; end + + sig { returns(T.nilable(::SolidQueue::ReadyExecution)) } + def third; end + + sig { returns(::SolidQueue::ReadyExecution) } + def third!; end + + sig { returns(T.nilable(::SolidQueue::ReadyExecution)) } + def third_to_last; end + + sig { returns(::SolidQueue::ReadyExecution) } + def third_to_last!; end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert_all(attributes, returning: nil, unique_by: nil); end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::Job) } + def build_job(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::Job) } + def create_job(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::Job) } + def create_job!(*args, &blk); end + + sig { returns(T.nilable(::SolidQueue::Job)) } + def job; end + + sig { params(value: T.nilable(::SolidQueue::Job)).void } + def job=(value); end + + sig { returns(T.nilable(::SolidQueue::Job)) } + def reload_job; end + + sig { void } + def reset_job; end + end + + module GeneratedAssociationRelationMethods + sig { returns(PrivateAssociationRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateAssociationRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def ordered(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def queued_as(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + sig do + params( + blk: T.proc.params(record: ::SolidQueue::ReadyExecution).returns(BasicObject) + ).returns(T::Array[::SolidQueue::ReadyExecution]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateAssociationRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::ActiveSupport::TimeWithZone) } + def created_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def created_at=(value); end + + sig { returns(T::Boolean) } + def created_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_before_last_save; end + + sig { returns(T.untyped) } + def created_at_before_type_cast; end + + sig { returns(T::Boolean) } + def created_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_was; end + + sig { void } + def created_at_will_change!; end + + sig { returns(::Integer) } + def id; end + + sig { params(value: ::Integer).returns(::Integer) } + def id=(value); end + + sig { returns(T::Boolean) } + def id?; end + + sig { returns(T.nilable(::Integer)) } + def id_before_last_save; end + + sig { returns(T.untyped) } + def id_before_type_cast; end + + sig { returns(T::Boolean) } + def id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_previously_was; end + + sig { returns(::Integer) } + def id_value; end + + sig { params(value: ::Integer).returns(::Integer) } + def id_value=(value); end + + sig { returns(T::Boolean) } + def id_value?; end + + sig { returns(T.nilable(::Integer)) } + def id_value_before_last_save; end + + sig { returns(T.untyped) } + def id_value_before_type_cast; end + + sig { returns(T::Boolean) } + def id_value_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def id_value_was; end + + sig { void } + def id_value_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def id_was; end + + sig { void } + def id_will_change!; end + + sig { returns(::Integer) } + def job_id; end + + sig { params(value: ::Integer).returns(::Integer) } + def job_id=(value); end + + sig { returns(T::Boolean) } + def job_id?; end + + sig { returns(T.nilable(::Integer)) } + def job_id_before_last_save; end + + sig { returns(T.untyped) } + def job_id_before_type_cast; end + + sig { returns(T::Boolean) } + def job_id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def job_id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def job_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def job_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def job_id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def job_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def job_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def job_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def job_id_was; end + + sig { void } + def job_id_will_change!; end + + sig { returns(::Integer) } + def priority; end + + sig { params(value: ::Integer).returns(::Integer) } + def priority=(value); end + + sig { returns(T::Boolean) } + def priority?; end + + sig { returns(T.nilable(::Integer)) } + def priority_before_last_save; end + + sig { returns(T.untyped) } + def priority_before_type_cast; end + + sig { returns(T::Boolean) } + def priority_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def priority_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def priority_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def priority_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def priority_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def priority_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def priority_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def priority_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def priority_was; end + + sig { void } + def priority_will_change!; end + + sig { returns(::String) } + def queue_name; end + + sig { params(value: ::String).returns(::String) } + def queue_name=(value); end + + sig { returns(T::Boolean) } + def queue_name?; end + + sig { returns(T.nilable(::String)) } + def queue_name_before_last_save; end + + sig { returns(T.untyped) } + def queue_name_before_type_cast; end + + sig { returns(T::Boolean) } + def queue_name_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def queue_name_change; end + + sig { returns(T.nilable([::String, ::String])) } + def queue_name_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def queue_name_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def queue_name_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def queue_name_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def queue_name_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def queue_name_previously_was; end + + sig { returns(T.nilable(::String)) } + def queue_name_was; end + + sig { void } + def queue_name_will_change!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_job_id!; end + + sig { void } + def restore_priority!; end + + sig { void } + def restore_queue_name!; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_created_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id_value; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_job_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_job_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_priority; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_priority?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_queue_name; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_queue_name?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_job_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_priority?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_queue_name?(from: T.unsafe(nil), to: T.unsafe(nil)); end + end + + module GeneratedRelationMethods + sig { returns(PrivateRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def ordered(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def queued_as(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + sig do + params( + blk: T.proc.params(record: ::SolidQueue::ReadyExecution).returns(BasicObject) + ).returns(T::Array[::SolidQueue::ReadyExecution]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::ReadyExecution } } + + sig { returns(T::Array[::SolidQueue::ReadyExecution]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::ReadyExecution]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::SolidQueue::ReadyExecution } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateAssociationRelationWhereChain + Elem = type_member { { fixed: ::SolidQueue::ReadyExecution } } + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateAssociationRelation) } + def not(opts, *rest); end + end + + class PrivateCollectionProxy < ::ActiveRecord::Associations::CollectionProxy + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::ReadyExecution } } + + sig do + params( + records: T.any(::SolidQueue::ReadyExecution, T::Enumerable[T.any(::SolidQueue::ReadyExecution, T::Enumerable[::SolidQueue::ReadyExecution])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::SolidQueue::ReadyExecution, T::Enumerable[T.any(::SolidQueue::ReadyExecution, T::Enumerable[::SolidQueue::ReadyExecution])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::SolidQueue::ReadyExecution, T::Enumerable[T.any(::SolidQueue::ReadyExecution, T::Enumerable[::SolidQueue::ReadyExecution])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig { returns(T::Array[::SolidQueue::ReadyExecution]) } + def load_target; end + + sig do + params( + records: T.any(::SolidQueue::ReadyExecution, T::Enumerable[T.any(::SolidQueue::ReadyExecution, T::Enumerable[::SolidQueue::ReadyExecution])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::SolidQueue::ReadyExecution, T::Enumerable[T.any(::SolidQueue::ReadyExecution, T::Enumerable[::SolidQueue::ReadyExecution])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::SolidQueue::ReadyExecution, T::Enumerable[T.any(::SolidQueue::ReadyExecution, T::Enumerable[::SolidQueue::ReadyExecution])]) + ).returns(T::Array[::SolidQueue::ReadyExecution]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::SolidQueue::ReadyExecution]) } + def target; end + + sig { returns(T::Array[::SolidQueue::ReadyExecution]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::ReadyExecution]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::ReadyExecution } } + + sig { returns(T::Array[::SolidQueue::ReadyExecution]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::ReadyExecution]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::SolidQueue::ReadyExecution } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateRelationWhereChain + Elem = type_member { { fixed: ::SolidQueue::ReadyExecution } } + + sig { params(args: T.untyped).returns(PrivateRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateRelation) } + def not(opts, *rest); end + end +end diff --git a/sorbet/rbi/dsl/solid_queue/recurring_execution.rbi b/sorbet/rbi/dsl/solid_queue/recurring_execution.rbi new file mode 100644 index 0000000..be766f7 --- /dev/null +++ b/sorbet/rbi/dsl/solid_queue/recurring_execution.rbi @@ -0,0 +1,1378 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `SolidQueue::RecurringExecution`. +# Please instead update this file by running `bin/tapioca dsl SolidQueue::RecurringExecution`. + + +class SolidQueue::RecurringExecution + include GeneratedAssociationMethods + include GeneratedAttributeMethods + extend CommonRelationMethods + extend GeneratedRelationMethods + + private + + sig { returns(NilClass) } + def to_ary; end + + class << self + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringExecution).void) + ).returns(::SolidQueue::RecurringExecution) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::RecurringExecution).returns(T.untyped)) + ).returns(T::Boolean) + end + def any?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def average(column_name); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringExecution).void) + ).returns(::SolidQueue::RecurringExecution) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringExecution).void) + ).returns(T::Array[::SolidQueue::RecurringExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringExecution).void) + ).returns(::SolidQueue::RecurringExecution) + end + def build(attributes = nil, &block); end + + sig { params(operation: Symbol, column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def calculate(operation, column_name); end + + sig { params(column_name: T.nilable(T.any(String, Symbol))).returns(Integer) } + sig do + params( + column_name: NilClass, + block: T.proc.params(object: ::SolidQueue::RecurringExecution).void + ).returns(Integer) + end + def count(column_name = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringExecution).void) + ).returns(::SolidQueue::RecurringExecution) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringExecution).void) + ).returns(T::Array[::SolidQueue::RecurringExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringExecution).void) + ).returns(::SolidQueue::RecurringExecution) + end + def create(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringExecution).void) + ).returns(::SolidQueue::RecurringExecution) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringExecution).void) + ).returns(T::Array[::SolidQueue::RecurringExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringExecution).void) + ).returns(::SolidQueue::RecurringExecution) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringExecution).void) + ).returns(T::Array[::SolidQueue::RecurringExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringExecution).void) + ).returns(::SolidQueue::RecurringExecution) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringExecution).void) + ).returns(T::Array[::SolidQueue::RecurringExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringExecution).void) + ).returns(::SolidQueue::RecurringExecution) + end + def create_or_find_by!(attributes, &block); end + + sig do + params( + records: T.any(::SolidQueue::RecurringExecution, Integer, String, T::Enumerable[T.any(::SolidQueue::RecurringExecution, Integer, String, T::Enumerable[::SolidQueue::RecurringExecution])]) + ).returns(Integer) + end + def delete(*records); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(args); end + + sig do + params( + records: T.any(::SolidQueue::RecurringExecution, Integer, String, T::Enumerable[T.any(::SolidQueue::RecurringExecution, Integer, String, T::Enumerable[::SolidQueue::RecurringExecution])]) + ).returns(T::Array[::SolidQueue::RecurringExecution]) + end + def destroy(*records); end + + sig { returns(T::Array[::SolidQueue::RecurringExecution]) } + def destroy_all; end + + sig { returns(T::Array[::SolidQueue::RecurringExecution]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::SolidQueue::RecurringExecution]) } + def destroy_by(args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::SolidQueue::RecurringExecution)) } + def fifth; end + + sig { returns(::SolidQueue::RecurringExecution) } + def fifth!; end + + sig do + params( + args: T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything]) + ).returns(::SolidQueue::RecurringExecution) + end + sig do + params( + args: T::Array[T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything])] + ).returns(T::Enumerable[::SolidQueue::RecurringExecution]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::SolidQueue::RecurringExecution).void + ).returns(T.nilable(::SolidQueue::RecurringExecution)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::SolidQueue::RecurringExecution)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::SolidQueue::RecurringExecution) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: ::SolidQueue::RecurringExecution).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[::SolidQueue::RecurringExecution]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: T::Array[::SolidQueue::RecurringExecution]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[T::Enumerator[::SolidQueue::RecurringExecution]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringExecution).void) + ).returns(T::Array[::SolidQueue::RecurringExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringExecution).void) + ).returns(::SolidQueue::RecurringExecution) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringExecution).void) + ).returns(T::Array[::SolidQueue::RecurringExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringExecution).void) + ).returns(::SolidQueue::RecurringExecution) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringExecution).void) + ).returns(T::Array[::SolidQueue::RecurringExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringExecution).void) + ).returns(::SolidQueue::RecurringExecution) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::SolidQueue::RecurringExecution)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::SolidQueue::RecurringExecution) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::SolidQueue::RecurringExecution) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::SolidQueue::RecurringExecution)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::RecurringExecution]) } + def first(limit = nil); end + + sig { returns(::SolidQueue::RecurringExecution) } + def first!; end + + sig { returns(T.nilable(::SolidQueue::RecurringExecution)) } + def forty_two; end + + sig { returns(::SolidQueue::RecurringExecution) } + def forty_two!; end + + sig { returns(T.nilable(::SolidQueue::RecurringExecution)) } + def fourth; end + + sig { returns(::SolidQueue::RecurringExecution) } + def fourth!; end + + sig { returns(T::Array[::Integer]) } + def ids; end + + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped, + block: T.proc.params(object: PrivateRelation).void + ).void + end + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped + ).returns(::ActiveRecord::Batches::BatchEnumerator) + end + def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, cursor: primary_key, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert!(attributes, returning: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert_all(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert_all!(attributes, returning: nil); end + + sig { returns(T.nilable(::SolidQueue::RecurringExecution)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::RecurringExecution]) } + def last(limit = nil); end + + sig { returns(::SolidQueue::RecurringExecution) } + def last!; end + + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::RecurringExecution).returns(T.untyped)) + ).returns(T::Boolean) + end + def many?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def maximum(column_name); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def member?(record); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def minimum(column_name); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringExecution).void) + ).returns(::SolidQueue::RecurringExecution) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringExecution).void) + ).returns(T::Array[::SolidQueue::RecurringExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringExecution).void) + ).returns(::SolidQueue::RecurringExecution) + end + def new(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::RecurringExecution).returns(T.untyped)) + ).returns(T::Boolean) + end + def none?(&block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::RecurringExecution).returns(T.untyped)) + ).returns(T::Boolean) + end + def one?(&block); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pick(*column_names); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pluck(*column_names); end + + sig { returns(T.nilable(::SolidQueue::RecurringExecution)) } + def second; end + + sig { returns(::SolidQueue::RecurringExecution) } + def second!; end + + sig { returns(T.nilable(::SolidQueue::RecurringExecution)) } + def second_to_last; end + + sig { returns(::SolidQueue::RecurringExecution) } + def second_to_last!; end + + sig { returns(::SolidQueue::RecurringExecution) } + def sole; end + + sig { params(initial_value_or_column: T.untyped).returns(T.any(Integer, Float, BigDecimal)) } + sig do + type_parameters(:U) + .params( + initial_value_or_column: T.nilable(T.type_parameter(:U)), + block: T.proc.params(object: ::SolidQueue::RecurringExecution).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::SolidQueue::RecurringExecution)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::RecurringExecution]) } + def take(limit = nil); end + + sig { returns(::SolidQueue::RecurringExecution) } + def take!; end + + sig { returns(T.nilable(::SolidQueue::RecurringExecution)) } + def third; end + + sig { returns(::SolidQueue::RecurringExecution) } + def third!; end + + sig { returns(T.nilable(::SolidQueue::RecurringExecution)) } + def third_to_last; end + + sig { returns(::SolidQueue::RecurringExecution) } + def third_to_last!; end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert_all(attributes, returning: nil, unique_by: nil); end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::Job) } + def build_job(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::Job) } + def create_job(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::Job) } + def create_job!(*args, &blk); end + + sig { returns(T.nilable(::SolidQueue::Job)) } + def job; end + + sig { params(value: T.nilable(::SolidQueue::Job)).void } + def job=(value); end + + sig { returns(T.nilable(::SolidQueue::Job)) } + def reload_job; end + + sig { void } + def reset_job; end + end + + module GeneratedAssociationRelationMethods + sig { returns(PrivateAssociationRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def clearable(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateAssociationRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def ordered(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + sig do + params( + blk: T.proc.params(record: ::SolidQueue::RecurringExecution).returns(BasicObject) + ).returns(T::Array[::SolidQueue::RecurringExecution]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateAssociationRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::ActiveSupport::TimeWithZone) } + def created_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def created_at=(value); end + + sig { returns(T::Boolean) } + def created_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_before_last_save; end + + sig { returns(T.untyped) } + def created_at_before_type_cast; end + + sig { returns(T::Boolean) } + def created_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_was; end + + sig { void } + def created_at_will_change!; end + + sig { returns(::Integer) } + def id; end + + sig { params(value: ::Integer).returns(::Integer) } + def id=(value); end + + sig { returns(T::Boolean) } + def id?; end + + sig { returns(T.nilable(::Integer)) } + def id_before_last_save; end + + sig { returns(T.untyped) } + def id_before_type_cast; end + + sig { returns(T::Boolean) } + def id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_previously_was; end + + sig { returns(::Integer) } + def id_value; end + + sig { params(value: ::Integer).returns(::Integer) } + def id_value=(value); end + + sig { returns(T::Boolean) } + def id_value?; end + + sig { returns(T.nilable(::Integer)) } + def id_value_before_last_save; end + + sig { returns(T.untyped) } + def id_value_before_type_cast; end + + sig { returns(T::Boolean) } + def id_value_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def id_value_was; end + + sig { void } + def id_value_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def id_was; end + + sig { void } + def id_will_change!; end + + sig { returns(::Integer) } + def job_id; end + + sig { params(value: ::Integer).returns(::Integer) } + def job_id=(value); end + + sig { returns(T::Boolean) } + def job_id?; end + + sig { returns(T.nilable(::Integer)) } + def job_id_before_last_save; end + + sig { returns(T.untyped) } + def job_id_before_type_cast; end + + sig { returns(T::Boolean) } + def job_id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def job_id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def job_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def job_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def job_id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def job_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def job_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def job_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def job_id_was; end + + sig { void } + def job_id_will_change!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_job_id!; end + + sig { void } + def restore_run_at!; end + + sig { void } + def restore_task_key!; end + + sig { returns(::ActiveSupport::TimeWithZone) } + def run_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def run_at=(value); end + + sig { returns(T::Boolean) } + def run_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def run_at_before_last_save; end + + sig { returns(T.untyped) } + def run_at_before_type_cast; end + + sig { returns(T::Boolean) } + def run_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def run_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def run_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def run_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def run_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def run_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def run_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def run_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def run_at_was; end + + sig { void } + def run_at_will_change!; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_created_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id_value; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_job_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_job_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_run_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_run_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_task_key; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_task_key?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(::String) } + def task_key; end + + sig { params(value: ::String).returns(::String) } + def task_key=(value); end + + sig { returns(T::Boolean) } + def task_key?; end + + sig { returns(T.nilable(::String)) } + def task_key_before_last_save; end + + sig { returns(T.untyped) } + def task_key_before_type_cast; end + + sig { returns(T::Boolean) } + def task_key_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def task_key_change; end + + sig { returns(T.nilable([::String, ::String])) } + def task_key_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def task_key_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def task_key_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def task_key_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def task_key_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def task_key_previously_was; end + + sig { returns(T.nilable(::String)) } + def task_key_was; end + + sig { void } + def task_key_will_change!; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_job_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_run_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_task_key?(from: T.unsafe(nil), to: T.unsafe(nil)); end + end + + module GeneratedRelationMethods + sig { returns(PrivateRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def clearable(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def ordered(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + sig do + params( + blk: T.proc.params(record: ::SolidQueue::RecurringExecution).returns(BasicObject) + ).returns(T::Array[::SolidQueue::RecurringExecution]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::RecurringExecution } } + + sig { returns(T::Array[::SolidQueue::RecurringExecution]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::RecurringExecution]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::SolidQueue::RecurringExecution } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateAssociationRelationWhereChain + Elem = type_member { { fixed: ::SolidQueue::RecurringExecution } } + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateAssociationRelation) } + def not(opts, *rest); end + end + + class PrivateCollectionProxy < ::ActiveRecord::Associations::CollectionProxy + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::RecurringExecution } } + + sig do + params( + records: T.any(::SolidQueue::RecurringExecution, T::Enumerable[T.any(::SolidQueue::RecurringExecution, T::Enumerable[::SolidQueue::RecurringExecution])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::SolidQueue::RecurringExecution, T::Enumerable[T.any(::SolidQueue::RecurringExecution, T::Enumerable[::SolidQueue::RecurringExecution])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::SolidQueue::RecurringExecution, T::Enumerable[T.any(::SolidQueue::RecurringExecution, T::Enumerable[::SolidQueue::RecurringExecution])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig { returns(T::Array[::SolidQueue::RecurringExecution]) } + def load_target; end + + sig do + params( + records: T.any(::SolidQueue::RecurringExecution, T::Enumerable[T.any(::SolidQueue::RecurringExecution, T::Enumerable[::SolidQueue::RecurringExecution])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::SolidQueue::RecurringExecution, T::Enumerable[T.any(::SolidQueue::RecurringExecution, T::Enumerable[::SolidQueue::RecurringExecution])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::SolidQueue::RecurringExecution, T::Enumerable[T.any(::SolidQueue::RecurringExecution, T::Enumerable[::SolidQueue::RecurringExecution])]) + ).returns(T::Array[::SolidQueue::RecurringExecution]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::SolidQueue::RecurringExecution]) } + def target; end + + sig { returns(T::Array[::SolidQueue::RecurringExecution]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::RecurringExecution]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::RecurringExecution } } + + sig { returns(T::Array[::SolidQueue::RecurringExecution]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::RecurringExecution]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::SolidQueue::RecurringExecution } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateRelationWhereChain + Elem = type_member { { fixed: ::SolidQueue::RecurringExecution } } + + sig { params(args: T.untyped).returns(PrivateRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateRelation) } + def not(opts, *rest); end + end +end diff --git a/sorbet/rbi/dsl/solid_queue/recurring_job.rbi b/sorbet/rbi/dsl/solid_queue/recurring_job.rbi new file mode 100644 index 0000000..ac07142 --- /dev/null +++ b/sorbet/rbi/dsl/solid_queue/recurring_job.rbi @@ -0,0 +1,21 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `SolidQueue::RecurringJob`. +# Please instead update this file by running `bin/tapioca dsl SolidQueue::RecurringJob`. + + +class SolidQueue::RecurringJob + class << self + sig do + params( + command: T.untyped, + block: T.nilable(T.proc.params(job: SolidQueue::RecurringJob).void) + ).returns(T.any(SolidQueue::RecurringJob, FalseClass)) + end + def perform_later(command, &block); end + + sig { params(command: T.untyped).returns(T.untyped) } + def perform_now(command); end + end +end diff --git a/sorbet/rbi/dsl/solid_queue/recurring_task.rbi b/sorbet/rbi/dsl/solid_queue/recurring_task.rbi new file mode 100644 index 0000000..98f0573 --- /dev/null +++ b/sorbet/rbi/dsl/solid_queue/recurring_task.rbi @@ -0,0 +1,1764 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `SolidQueue::RecurringTask`. +# Please instead update this file by running `bin/tapioca dsl SolidQueue::RecurringTask`. + + +class SolidQueue::RecurringTask + include GeneratedAssociationMethods + include GeneratedAttributeMethods + extend CommonRelationMethods + extend GeneratedRelationMethods + + private + + sig { returns(NilClass) } + def to_ary; end + + class << self + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringTask).void) + ).returns(::SolidQueue::RecurringTask) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::RecurringTask).returns(T.untyped)) + ).returns(T::Boolean) + end + def any?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def average(column_name); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringTask).void) + ).returns(::SolidQueue::RecurringTask) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringTask).void) + ).returns(T::Array[::SolidQueue::RecurringTask]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringTask).void) + ).returns(::SolidQueue::RecurringTask) + end + def build(attributes = nil, &block); end + + sig { params(operation: Symbol, column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def calculate(operation, column_name); end + + sig { params(column_name: T.nilable(T.any(String, Symbol))).returns(Integer) } + sig do + params( + column_name: NilClass, + block: T.proc.params(object: ::SolidQueue::RecurringTask).void + ).returns(Integer) + end + def count(column_name = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringTask).void) + ).returns(::SolidQueue::RecurringTask) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringTask).void) + ).returns(T::Array[::SolidQueue::RecurringTask]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringTask).void) + ).returns(::SolidQueue::RecurringTask) + end + def create(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringTask).void) + ).returns(::SolidQueue::RecurringTask) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringTask).void) + ).returns(T::Array[::SolidQueue::RecurringTask]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringTask).void) + ).returns(::SolidQueue::RecurringTask) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringTask).void) + ).returns(T::Array[::SolidQueue::RecurringTask]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringTask).void) + ).returns(::SolidQueue::RecurringTask) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringTask).void) + ).returns(T::Array[::SolidQueue::RecurringTask]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringTask).void) + ).returns(::SolidQueue::RecurringTask) + end + def create_or_find_by!(attributes, &block); end + + sig do + params( + records: T.any(::SolidQueue::RecurringTask, Integer, String, T::Enumerable[T.any(::SolidQueue::RecurringTask, Integer, String, T::Enumerable[::SolidQueue::RecurringTask])]) + ).returns(Integer) + end + def delete(*records); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(args); end + + sig do + params( + records: T.any(::SolidQueue::RecurringTask, Integer, String, T::Enumerable[T.any(::SolidQueue::RecurringTask, Integer, String, T::Enumerable[::SolidQueue::RecurringTask])]) + ).returns(T::Array[::SolidQueue::RecurringTask]) + end + def destroy(*records); end + + sig { returns(T::Array[::SolidQueue::RecurringTask]) } + def destroy_all; end + + sig { returns(T::Array[::SolidQueue::RecurringTask]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::SolidQueue::RecurringTask]) } + def destroy_by(args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::SolidQueue::RecurringTask)) } + def fifth; end + + sig { returns(::SolidQueue::RecurringTask) } + def fifth!; end + + sig do + params( + args: T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything]) + ).returns(::SolidQueue::RecurringTask) + end + sig do + params( + args: T::Array[T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything])] + ).returns(T::Enumerable[::SolidQueue::RecurringTask]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::SolidQueue::RecurringTask).void + ).returns(T.nilable(::SolidQueue::RecurringTask)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::SolidQueue::RecurringTask)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::SolidQueue::RecurringTask) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: ::SolidQueue::RecurringTask).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[::SolidQueue::RecurringTask]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: T::Array[::SolidQueue::RecurringTask]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[T::Enumerator[::SolidQueue::RecurringTask]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringTask).void) + ).returns(T::Array[::SolidQueue::RecurringTask]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringTask).void) + ).returns(::SolidQueue::RecurringTask) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringTask).void) + ).returns(T::Array[::SolidQueue::RecurringTask]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringTask).void) + ).returns(::SolidQueue::RecurringTask) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringTask).void) + ).returns(T::Array[::SolidQueue::RecurringTask]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringTask).void) + ).returns(::SolidQueue::RecurringTask) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::SolidQueue::RecurringTask)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::SolidQueue::RecurringTask) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::SolidQueue::RecurringTask) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::SolidQueue::RecurringTask)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::RecurringTask]) } + def first(limit = nil); end + + sig { returns(::SolidQueue::RecurringTask) } + def first!; end + + sig { returns(T.nilable(::SolidQueue::RecurringTask)) } + def forty_two; end + + sig { returns(::SolidQueue::RecurringTask) } + def forty_two!; end + + sig { returns(T.nilable(::SolidQueue::RecurringTask)) } + def fourth; end + + sig { returns(::SolidQueue::RecurringTask) } + def fourth!; end + + sig { returns(T::Array[::Integer]) } + def ids; end + + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped, + block: T.proc.params(object: PrivateRelation).void + ).void + end + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped + ).returns(::ActiveRecord::Batches::BatchEnumerator) + end + def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, cursor: primary_key, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert!(attributes, returning: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert_all(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert_all!(attributes, returning: nil); end + + sig { returns(T.nilable(::SolidQueue::RecurringTask)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::RecurringTask]) } + def last(limit = nil); end + + sig { returns(::SolidQueue::RecurringTask) } + def last!; end + + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::RecurringTask).returns(T.untyped)) + ).returns(T::Boolean) + end + def many?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def maximum(column_name); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def member?(record); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def minimum(column_name); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringTask).void) + ).returns(::SolidQueue::RecurringTask) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringTask).void) + ).returns(T::Array[::SolidQueue::RecurringTask]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::RecurringTask).void) + ).returns(::SolidQueue::RecurringTask) + end + def new(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::RecurringTask).returns(T.untyped)) + ).returns(T::Boolean) + end + def none?(&block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::RecurringTask).returns(T.untyped)) + ).returns(T::Boolean) + end + def one?(&block); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pick(*column_names); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pluck(*column_names); end + + sig { returns(T.nilable(::SolidQueue::RecurringTask)) } + def second; end + + sig { returns(::SolidQueue::RecurringTask) } + def second!; end + + sig { returns(T.nilable(::SolidQueue::RecurringTask)) } + def second_to_last; end + + sig { returns(::SolidQueue::RecurringTask) } + def second_to_last!; end + + sig { returns(::SolidQueue::RecurringTask) } + def sole; end + + sig { params(initial_value_or_column: T.untyped).returns(T.any(Integer, Float, BigDecimal)) } + sig do + type_parameters(:U) + .params( + initial_value_or_column: T.nilable(T.type_parameter(:U)), + block: T.proc.params(object: ::SolidQueue::RecurringTask).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::SolidQueue::RecurringTask)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::RecurringTask]) } + def take(limit = nil); end + + sig { returns(::SolidQueue::RecurringTask) } + def take!; end + + sig { returns(T.nilable(::SolidQueue::RecurringTask)) } + def third; end + + sig { returns(::SolidQueue::RecurringTask) } + def third!; end + + sig { returns(T.nilable(::SolidQueue::RecurringTask)) } + def third_to_last; end + + sig { returns(::SolidQueue::RecurringTask) } + def third_to_last!; end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert_all(attributes, returning: nil, unique_by: nil); end + end + + module GeneratedAssociationMethods + sig { returns(T::Array[T.untyped]) } + def recurring_execution_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def recurring_execution_ids=(ids); end + + # This method is created by ActiveRecord on the `SolidQueue::RecurringTask` class because it declared `has_many :recurring_executions`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::SolidQueue::RecurringExecution::PrivateCollectionProxy) } + def recurring_executions; end + + sig { params(value: T::Enumerable[::SolidQueue::RecurringExecution]).void } + def recurring_executions=(value); end + end + + module GeneratedAssociationRelationMethods + sig { returns(PrivateAssociationRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateAssociationRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + sig do + params( + blk: T.proc.params(record: ::SolidQueue::RecurringTask).returns(BasicObject) + ).returns(T::Array[::SolidQueue::RecurringTask]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def static(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateAssociationRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(T.untyped) } + def arguments; end + + sig { params(value: T.untyped).returns(T.untyped) } + def arguments=(value); end + + sig { returns(T::Boolean) } + def arguments?; end + + sig { returns(T.untyped) } + def arguments_before_last_save; end + + sig { returns(T.untyped) } + def arguments_before_type_cast; end + + sig { returns(T::Boolean) } + def arguments_came_from_user?; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def arguments_change; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def arguments_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def arguments_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.untyped) } + def arguments_in_database; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def arguments_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def arguments_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.untyped) } + def arguments_previously_was; end + + sig { returns(T.untyped) } + def arguments_was; end + + sig { void } + def arguments_will_change!; end + + sig { returns(T.nilable(::String)) } + def class_name; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def class_name=(value); end + + sig { returns(T::Boolean) } + def class_name?; end + + sig { returns(T.nilable(::String)) } + def class_name_before_last_save; end + + sig { returns(T.untyped) } + def class_name_before_type_cast; end + + sig { returns(T::Boolean) } + def class_name_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def class_name_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def class_name_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def class_name_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def class_name_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def class_name_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def class_name_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def class_name_previously_was; end + + sig { returns(T.nilable(::String)) } + def class_name_was; end + + sig { void } + def class_name_will_change!; end + + sig { returns(T.nilable(::String)) } + def command; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def command=(value); end + + sig { returns(T::Boolean) } + def command?; end + + sig { returns(T.nilable(::String)) } + def command_before_last_save; end + + sig { returns(T.untyped) } + def command_before_type_cast; end + + sig { returns(T::Boolean) } + def command_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def command_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def command_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def command_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def command_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def command_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def command_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def command_previously_was; end + + sig { returns(T.nilable(::String)) } + def command_was; end + + sig { void } + def command_will_change!; end + + sig { returns(::ActiveSupport::TimeWithZone) } + def created_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def created_at=(value); end + + sig { returns(T::Boolean) } + def created_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_before_last_save; end + + sig { returns(T.untyped) } + def created_at_before_type_cast; end + + sig { returns(T::Boolean) } + def created_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_was; end + + sig { void } + def created_at_will_change!; end + + sig { returns(T.nilable(::String)) } + def description; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def description=(value); end + + sig { returns(T::Boolean) } + def description?; end + + sig { returns(T.nilable(::String)) } + def description_before_last_save; end + + sig { returns(T.untyped) } + def description_before_type_cast; end + + sig { returns(T::Boolean) } + def description_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def description_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def description_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def description_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def description_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def description_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def description_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def description_previously_was; end + + sig { returns(T.nilable(::String)) } + def description_was; end + + sig { void } + def description_will_change!; end + + sig { returns(::Integer) } + def id; end + + sig { params(value: ::Integer).returns(::Integer) } + def id=(value); end + + sig { returns(T::Boolean) } + def id?; end + + sig { returns(T.nilable(::Integer)) } + def id_before_last_save; end + + sig { returns(T.untyped) } + def id_before_type_cast; end + + sig { returns(T::Boolean) } + def id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_previously_was; end + + sig { returns(::Integer) } + def id_value; end + + sig { params(value: ::Integer).returns(::Integer) } + def id_value=(value); end + + sig { returns(T::Boolean) } + def id_value?; end + + sig { returns(T.nilable(::Integer)) } + def id_value_before_last_save; end + + sig { returns(T.untyped) } + def id_value_before_type_cast; end + + sig { returns(T::Boolean) } + def id_value_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def id_value_was; end + + sig { void } + def id_value_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def id_was; end + + sig { void } + def id_will_change!; end + + sig { returns(::String) } + def key; end + + sig { params(value: ::String).returns(::String) } + def key=(value); end + + sig { returns(T::Boolean) } + def key?; end + + sig { returns(T.nilable(::String)) } + def key_before_last_save; end + + sig { returns(T.untyped) } + def key_before_type_cast; end + + sig { returns(T::Boolean) } + def key_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def key_change; end + + sig { returns(T.nilable([::String, ::String])) } + def key_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def key_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def key_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def key_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def key_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def key_previously_was; end + + sig { returns(T.nilable(::String)) } + def key_was; end + + sig { void } + def key_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def priority; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def priority=(value); end + + sig { returns(T::Boolean) } + def priority?; end + + sig { returns(T.nilable(::Integer)) } + def priority_before_last_save; end + + sig { returns(T.untyped) } + def priority_before_type_cast; end + + sig { returns(T::Boolean) } + def priority_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def priority_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def priority_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def priority_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def priority_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def priority_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def priority_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def priority_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def priority_was; end + + sig { void } + def priority_will_change!; end + + sig { returns(T.nilable(::String)) } + def queue_name; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def queue_name=(value); end + + sig { returns(T::Boolean) } + def queue_name?; end + + sig { returns(T.nilable(::String)) } + def queue_name_before_last_save; end + + sig { returns(T.untyped) } + def queue_name_before_type_cast; end + + sig { returns(T::Boolean) } + def queue_name_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def queue_name_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def queue_name_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def queue_name_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def queue_name_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def queue_name_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def queue_name_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def queue_name_previously_was; end + + sig { returns(T.nilable(::String)) } + def queue_name_was; end + + sig { void } + def queue_name_will_change!; end + + sig { void } + def restore_arguments!; end + + sig { void } + def restore_class_name!; end + + sig { void } + def restore_command!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_description!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_key!; end + + sig { void } + def restore_priority!; end + + sig { void } + def restore_queue_name!; end + + sig { void } + def restore_schedule!; end + + sig { void } + def restore_static!; end + + sig { void } + def restore_updated_at!; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def saved_change_to_arguments; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_arguments?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_class_name; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_class_name?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_command; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_command?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_created_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_description; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_description?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id_value; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_key; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_key?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def saved_change_to_priority; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_priority?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_queue_name; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_queue_name?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_schedule; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_schedule?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def saved_change_to_static; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_static?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_updated_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_updated_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(::String) } + def schedule; end + + sig { params(value: ::String).returns(::String) } + def schedule=(value); end + + sig { returns(T::Boolean) } + def schedule?; end + + sig { returns(T.nilable(::String)) } + def schedule_before_last_save; end + + sig { returns(T.untyped) } + def schedule_before_type_cast; end + + sig { returns(T::Boolean) } + def schedule_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def schedule_change; end + + sig { returns(T.nilable([::String, ::String])) } + def schedule_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def schedule_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def schedule_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def schedule_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def schedule_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def schedule_previously_was; end + + sig { returns(T.nilable(::String)) } + def schedule_was; end + + sig { void } + def schedule_will_change!; end + + sig { returns(T::Boolean) } + def static; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def static=(value); end + + sig { returns(T::Boolean) } + def static?; end + + sig { returns(T.nilable(T::Boolean)) } + def static_before_last_save; end + + sig { returns(T.untyped) } + def static_before_type_cast; end + + sig { returns(T::Boolean) } + def static_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def static_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def static_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def static_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def static_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def static_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def static_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def static_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def static_was; end + + sig { void } + def static_will_change!; end + + sig { returns(::ActiveSupport::TimeWithZone) } + def updated_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def updated_at=(value); end + + sig { returns(T::Boolean) } + def updated_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_before_last_save; end + + sig { returns(T.untyped) } + def updated_at_before_type_cast; end + + sig { returns(T::Boolean) } + def updated_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def updated_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def updated_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def updated_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def updated_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def updated_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_was; end + + sig { void } + def updated_at_will_change!; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_arguments?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_class_name?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_command?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_description?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_key?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_priority?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_queue_name?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_schedule?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_static?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_updated_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + end + + module GeneratedRelationMethods + sig { returns(PrivateRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + sig do + params( + blk: T.proc.params(record: ::SolidQueue::RecurringTask).returns(BasicObject) + ).returns(T::Array[::SolidQueue::RecurringTask]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def static(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::RecurringTask } } + + sig { returns(T::Array[::SolidQueue::RecurringTask]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::RecurringTask]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::SolidQueue::RecurringTask } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateAssociationRelationWhereChain + Elem = type_member { { fixed: ::SolidQueue::RecurringTask } } + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateAssociationRelation) } + def not(opts, *rest); end + end + + class PrivateCollectionProxy < ::ActiveRecord::Associations::CollectionProxy + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::RecurringTask } } + + sig do + params( + records: T.any(::SolidQueue::RecurringTask, T::Enumerable[T.any(::SolidQueue::RecurringTask, T::Enumerable[::SolidQueue::RecurringTask])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::SolidQueue::RecurringTask, T::Enumerable[T.any(::SolidQueue::RecurringTask, T::Enumerable[::SolidQueue::RecurringTask])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::SolidQueue::RecurringTask, T::Enumerable[T.any(::SolidQueue::RecurringTask, T::Enumerable[::SolidQueue::RecurringTask])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig { returns(T::Array[::SolidQueue::RecurringTask]) } + def load_target; end + + sig do + params( + records: T.any(::SolidQueue::RecurringTask, T::Enumerable[T.any(::SolidQueue::RecurringTask, T::Enumerable[::SolidQueue::RecurringTask])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::SolidQueue::RecurringTask, T::Enumerable[T.any(::SolidQueue::RecurringTask, T::Enumerable[::SolidQueue::RecurringTask])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::SolidQueue::RecurringTask, T::Enumerable[T.any(::SolidQueue::RecurringTask, T::Enumerable[::SolidQueue::RecurringTask])]) + ).returns(T::Array[::SolidQueue::RecurringTask]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::SolidQueue::RecurringTask]) } + def target; end + + sig { returns(T::Array[::SolidQueue::RecurringTask]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::RecurringTask]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::RecurringTask } } + + sig { returns(T::Array[::SolidQueue::RecurringTask]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::RecurringTask]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::SolidQueue::RecurringTask } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateRelationWhereChain + Elem = type_member { { fixed: ::SolidQueue::RecurringTask } } + + sig { params(args: T.untyped).returns(PrivateRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateRelation) } + def not(opts, *rest); end + end +end diff --git a/sorbet/rbi/dsl/solid_queue/scheduled_execution.rbi b/sorbet/rbi/dsl/solid_queue/scheduled_execution.rbi new file mode 100644 index 0000000..bde690c --- /dev/null +++ b/sorbet/rbi/dsl/solid_queue/scheduled_execution.rbi @@ -0,0 +1,1441 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `SolidQueue::ScheduledExecution`. +# Please instead update this file by running `bin/tapioca dsl SolidQueue::ScheduledExecution`. + + +class SolidQueue::ScheduledExecution + include GeneratedAssociationMethods + include GeneratedAttributeMethods + extend CommonRelationMethods + extend GeneratedRelationMethods + + private + + sig { returns(NilClass) } + def to_ary; end + + class << self + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::ScheduledExecution).void) + ).returns(::SolidQueue::ScheduledExecution) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::ScheduledExecution).returns(T.untyped)) + ).returns(T::Boolean) + end + def any?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def average(column_name); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::SolidQueue::ScheduledExecution).void) + ).returns(::SolidQueue::ScheduledExecution) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::ScheduledExecution).void) + ).returns(T::Array[::SolidQueue::ScheduledExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::ScheduledExecution).void) + ).returns(::SolidQueue::ScheduledExecution) + end + def build(attributes = nil, &block); end + + sig { params(operation: Symbol, column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def calculate(operation, column_name); end + + sig { params(column_name: T.nilable(T.any(String, Symbol))).returns(Integer) } + sig do + params( + column_name: NilClass, + block: T.proc.params(object: ::SolidQueue::ScheduledExecution).void + ).returns(Integer) + end + def count(column_name = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::SolidQueue::ScheduledExecution).void) + ).returns(::SolidQueue::ScheduledExecution) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::ScheduledExecution).void) + ).returns(T::Array[::SolidQueue::ScheduledExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::ScheduledExecution).void) + ).returns(::SolidQueue::ScheduledExecution) + end + def create(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::SolidQueue::ScheduledExecution).void) + ).returns(::SolidQueue::ScheduledExecution) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::ScheduledExecution).void) + ).returns(T::Array[::SolidQueue::ScheduledExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::ScheduledExecution).void) + ).returns(::SolidQueue::ScheduledExecution) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::ScheduledExecution).void) + ).returns(T::Array[::SolidQueue::ScheduledExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::ScheduledExecution).void) + ).returns(::SolidQueue::ScheduledExecution) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::ScheduledExecution).void) + ).returns(T::Array[::SolidQueue::ScheduledExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::ScheduledExecution).void) + ).returns(::SolidQueue::ScheduledExecution) + end + def create_or_find_by!(attributes, &block); end + + sig do + params( + records: T.any(::SolidQueue::ScheduledExecution, Integer, String, T::Enumerable[T.any(::SolidQueue::ScheduledExecution, Integer, String, T::Enumerable[::SolidQueue::ScheduledExecution])]) + ).returns(Integer) + end + def delete(*records); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(args); end + + sig do + params( + records: T.any(::SolidQueue::ScheduledExecution, Integer, String, T::Enumerable[T.any(::SolidQueue::ScheduledExecution, Integer, String, T::Enumerable[::SolidQueue::ScheduledExecution])]) + ).returns(T::Array[::SolidQueue::ScheduledExecution]) + end + def destroy(*records); end + + sig { returns(T::Array[::SolidQueue::ScheduledExecution]) } + def destroy_all; end + + sig { returns(T::Array[::SolidQueue::ScheduledExecution]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::SolidQueue::ScheduledExecution]) } + def destroy_by(args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::SolidQueue::ScheduledExecution)) } + def fifth; end + + sig { returns(::SolidQueue::ScheduledExecution) } + def fifth!; end + + sig do + params( + args: T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything]) + ).returns(::SolidQueue::ScheduledExecution) + end + sig do + params( + args: T::Array[T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything])] + ).returns(T::Enumerable[::SolidQueue::ScheduledExecution]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::SolidQueue::ScheduledExecution).void + ).returns(T.nilable(::SolidQueue::ScheduledExecution)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::SolidQueue::ScheduledExecution)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::SolidQueue::ScheduledExecution) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: ::SolidQueue::ScheduledExecution).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[::SolidQueue::ScheduledExecution]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: T::Array[::SolidQueue::ScheduledExecution]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[T::Enumerator[::SolidQueue::ScheduledExecution]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::ScheduledExecution).void) + ).returns(T::Array[::SolidQueue::ScheduledExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::ScheduledExecution).void) + ).returns(::SolidQueue::ScheduledExecution) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::ScheduledExecution).void) + ).returns(T::Array[::SolidQueue::ScheduledExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::ScheduledExecution).void) + ).returns(::SolidQueue::ScheduledExecution) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::ScheduledExecution).void) + ).returns(T::Array[::SolidQueue::ScheduledExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::ScheduledExecution).void) + ).returns(::SolidQueue::ScheduledExecution) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::SolidQueue::ScheduledExecution)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::SolidQueue::ScheduledExecution) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::SolidQueue::ScheduledExecution) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::SolidQueue::ScheduledExecution)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::ScheduledExecution]) } + def first(limit = nil); end + + sig { returns(::SolidQueue::ScheduledExecution) } + def first!; end + + sig { returns(T.nilable(::SolidQueue::ScheduledExecution)) } + def forty_two; end + + sig { returns(::SolidQueue::ScheduledExecution) } + def forty_two!; end + + sig { returns(T.nilable(::SolidQueue::ScheduledExecution)) } + def fourth; end + + sig { returns(::SolidQueue::ScheduledExecution) } + def fourth!; end + + sig { returns(T::Array[::Integer]) } + def ids; end + + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped, + block: T.proc.params(object: PrivateRelation).void + ).void + end + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped + ).returns(::ActiveRecord::Batches::BatchEnumerator) + end + def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, cursor: primary_key, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert!(attributes, returning: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert_all(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert_all!(attributes, returning: nil); end + + sig { returns(T.nilable(::SolidQueue::ScheduledExecution)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::ScheduledExecution]) } + def last(limit = nil); end + + sig { returns(::SolidQueue::ScheduledExecution) } + def last!; end + + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::ScheduledExecution).returns(T.untyped)) + ).returns(T::Boolean) + end + def many?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def maximum(column_name); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def member?(record); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def minimum(column_name); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::SolidQueue::ScheduledExecution).void) + ).returns(::SolidQueue::ScheduledExecution) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::ScheduledExecution).void) + ).returns(T::Array[::SolidQueue::ScheduledExecution]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::ScheduledExecution).void) + ).returns(::SolidQueue::ScheduledExecution) + end + def new(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::ScheduledExecution).returns(T.untyped)) + ).returns(T::Boolean) + end + def none?(&block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::ScheduledExecution).returns(T.untyped)) + ).returns(T::Boolean) + end + def one?(&block); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pick(*column_names); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pluck(*column_names); end + + sig { returns(T.nilable(::SolidQueue::ScheduledExecution)) } + def second; end + + sig { returns(::SolidQueue::ScheduledExecution) } + def second!; end + + sig { returns(T.nilable(::SolidQueue::ScheduledExecution)) } + def second_to_last; end + + sig { returns(::SolidQueue::ScheduledExecution) } + def second_to_last!; end + + sig { returns(::SolidQueue::ScheduledExecution) } + def sole; end + + sig { params(initial_value_or_column: T.untyped).returns(T.any(Integer, Float, BigDecimal)) } + sig do + type_parameters(:U) + .params( + initial_value_or_column: T.nilable(T.type_parameter(:U)), + block: T.proc.params(object: ::SolidQueue::ScheduledExecution).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::SolidQueue::ScheduledExecution)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::ScheduledExecution]) } + def take(limit = nil); end + + sig { returns(::SolidQueue::ScheduledExecution) } + def take!; end + + sig { returns(T.nilable(::SolidQueue::ScheduledExecution)) } + def third; end + + sig { returns(::SolidQueue::ScheduledExecution) } + def third!; end + + sig { returns(T.nilable(::SolidQueue::ScheduledExecution)) } + def third_to_last; end + + sig { returns(::SolidQueue::ScheduledExecution) } + def third_to_last!; end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert_all(attributes, returning: nil, unique_by: nil); end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::Job) } + def build_job(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::Job) } + def create_job(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SolidQueue::Job) } + def create_job!(*args, &blk); end + + sig { returns(T.nilable(::SolidQueue::Job)) } + def job; end + + sig { params(value: T.nilable(::SolidQueue::Job)).void } + def job=(value); end + + sig { returns(T.nilable(::SolidQueue::Job)) } + def reload_job; end + + sig { void } + def reset_job; end + end + + module GeneratedAssociationRelationMethods + sig { returns(PrivateAssociationRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateAssociationRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def due(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def next_batch(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def ordered(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + sig do + params( + blk: T.proc.params(record: ::SolidQueue::ScheduledExecution).returns(BasicObject) + ).returns(T::Array[::SolidQueue::ScheduledExecution]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateAssociationRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::ActiveSupport::TimeWithZone) } + def created_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def created_at=(value); end + + sig { returns(T::Boolean) } + def created_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_before_last_save; end + + sig { returns(T.untyped) } + def created_at_before_type_cast; end + + sig { returns(T::Boolean) } + def created_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_was; end + + sig { void } + def created_at_will_change!; end + + sig { returns(::Integer) } + def id; end + + sig { params(value: ::Integer).returns(::Integer) } + def id=(value); end + + sig { returns(T::Boolean) } + def id?; end + + sig { returns(T.nilable(::Integer)) } + def id_before_last_save; end + + sig { returns(T.untyped) } + def id_before_type_cast; end + + sig { returns(T::Boolean) } + def id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_previously_was; end + + sig { returns(::Integer) } + def id_value; end + + sig { params(value: ::Integer).returns(::Integer) } + def id_value=(value); end + + sig { returns(T::Boolean) } + def id_value?; end + + sig { returns(T.nilable(::Integer)) } + def id_value_before_last_save; end + + sig { returns(T.untyped) } + def id_value_before_type_cast; end + + sig { returns(T::Boolean) } + def id_value_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def id_value_was; end + + sig { void } + def id_value_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def id_was; end + + sig { void } + def id_will_change!; end + + sig { returns(::Integer) } + def job_id; end + + sig { params(value: ::Integer).returns(::Integer) } + def job_id=(value); end + + sig { returns(T::Boolean) } + def job_id?; end + + sig { returns(T.nilable(::Integer)) } + def job_id_before_last_save; end + + sig { returns(T.untyped) } + def job_id_before_type_cast; end + + sig { returns(T::Boolean) } + def job_id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def job_id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def job_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def job_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def job_id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def job_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def job_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def job_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def job_id_was; end + + sig { void } + def job_id_will_change!; end + + sig { returns(::Integer) } + def priority; end + + sig { params(value: ::Integer).returns(::Integer) } + def priority=(value); end + + sig { returns(T::Boolean) } + def priority?; end + + sig { returns(T.nilable(::Integer)) } + def priority_before_last_save; end + + sig { returns(T.untyped) } + def priority_before_type_cast; end + + sig { returns(T::Boolean) } + def priority_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def priority_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def priority_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def priority_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def priority_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def priority_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def priority_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def priority_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def priority_was; end + + sig { void } + def priority_will_change!; end + + sig { returns(::String) } + def queue_name; end + + sig { params(value: ::String).returns(::String) } + def queue_name=(value); end + + sig { returns(T::Boolean) } + def queue_name?; end + + sig { returns(T.nilable(::String)) } + def queue_name_before_last_save; end + + sig { returns(T.untyped) } + def queue_name_before_type_cast; end + + sig { returns(T::Boolean) } + def queue_name_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def queue_name_change; end + + sig { returns(T.nilable([::String, ::String])) } + def queue_name_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def queue_name_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def queue_name_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def queue_name_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def queue_name_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def queue_name_previously_was; end + + sig { returns(T.nilable(::String)) } + def queue_name_was; end + + sig { void } + def queue_name_will_change!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_job_id!; end + + sig { void } + def restore_priority!; end + + sig { void } + def restore_queue_name!; end + + sig { void } + def restore_scheduled_at!; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_created_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id_value; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_job_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_job_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_priority; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_priority?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_queue_name; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_queue_name?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_scheduled_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_scheduled_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(::ActiveSupport::TimeWithZone) } + def scheduled_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def scheduled_at=(value); end + + sig { returns(T::Boolean) } + def scheduled_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def scheduled_at_before_last_save; end + + sig { returns(T.untyped) } + def scheduled_at_before_type_cast; end + + sig { returns(T::Boolean) } + def scheduled_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def scheduled_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def scheduled_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def scheduled_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def scheduled_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def scheduled_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def scheduled_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def scheduled_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def scheduled_at_was; end + + sig { void } + def scheduled_at_will_change!; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_job_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_priority?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_queue_name?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_scheduled_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + end + + module GeneratedRelationMethods + sig { returns(PrivateRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def due(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def next_batch(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def ordered(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + sig do + params( + blk: T.proc.params(record: ::SolidQueue::ScheduledExecution).returns(BasicObject) + ).returns(T::Array[::SolidQueue::ScheduledExecution]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::ScheduledExecution } } + + sig { returns(T::Array[::SolidQueue::ScheduledExecution]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::ScheduledExecution]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::SolidQueue::ScheduledExecution } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateAssociationRelationWhereChain + Elem = type_member { { fixed: ::SolidQueue::ScheduledExecution } } + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateAssociationRelation) } + def not(opts, *rest); end + end + + class PrivateCollectionProxy < ::ActiveRecord::Associations::CollectionProxy + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::ScheduledExecution } } + + sig do + params( + records: T.any(::SolidQueue::ScheduledExecution, T::Enumerable[T.any(::SolidQueue::ScheduledExecution, T::Enumerable[::SolidQueue::ScheduledExecution])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::SolidQueue::ScheduledExecution, T::Enumerable[T.any(::SolidQueue::ScheduledExecution, T::Enumerable[::SolidQueue::ScheduledExecution])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::SolidQueue::ScheduledExecution, T::Enumerable[T.any(::SolidQueue::ScheduledExecution, T::Enumerable[::SolidQueue::ScheduledExecution])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig { returns(T::Array[::SolidQueue::ScheduledExecution]) } + def load_target; end + + sig do + params( + records: T.any(::SolidQueue::ScheduledExecution, T::Enumerable[T.any(::SolidQueue::ScheduledExecution, T::Enumerable[::SolidQueue::ScheduledExecution])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::SolidQueue::ScheduledExecution, T::Enumerable[T.any(::SolidQueue::ScheduledExecution, T::Enumerable[::SolidQueue::ScheduledExecution])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::SolidQueue::ScheduledExecution, T::Enumerable[T.any(::SolidQueue::ScheduledExecution, T::Enumerable[::SolidQueue::ScheduledExecution])]) + ).returns(T::Array[::SolidQueue::ScheduledExecution]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::SolidQueue::ScheduledExecution]) } + def target; end + + sig { returns(T::Array[::SolidQueue::ScheduledExecution]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::ScheduledExecution]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::ScheduledExecution } } + + sig { returns(T::Array[::SolidQueue::ScheduledExecution]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::ScheduledExecution]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::SolidQueue::ScheduledExecution } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateRelationWhereChain + Elem = type_member { { fixed: ::SolidQueue::ScheduledExecution } } + + sig { params(args: T.untyped).returns(PrivateRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateRelation) } + def not(opts, *rest); end + end +end diff --git a/sorbet/rbi/dsl/solid_queue/semaphore.rbi b/sorbet/rbi/dsl/solid_queue/semaphore.rbi new file mode 100644 index 0000000..fcf0261 --- /dev/null +++ b/sorbet/rbi/dsl/solid_queue/semaphore.rbi @@ -0,0 +1,1406 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `SolidQueue::Semaphore`. +# Please instead update this file by running `bin/tapioca dsl SolidQueue::Semaphore`. + + +class SolidQueue::Semaphore + include GeneratedAttributeMethods + extend CommonRelationMethods + extend GeneratedRelationMethods + + private + + sig { returns(NilClass) } + def to_ary; end + + class << self + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Semaphore).void) + ).returns(::SolidQueue::Semaphore) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::Semaphore).returns(T.untyped)) + ).returns(T::Boolean) + end + def any?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def average(column_name); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::SolidQueue::Semaphore).void) + ).returns(::SolidQueue::Semaphore) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Semaphore).void) + ).returns(T::Array[::SolidQueue::Semaphore]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Semaphore).void) + ).returns(::SolidQueue::Semaphore) + end + def build(attributes = nil, &block); end + + sig { params(operation: Symbol, column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def calculate(operation, column_name); end + + sig { params(column_name: T.nilable(T.any(String, Symbol))).returns(Integer) } + sig { params(column_name: NilClass, block: T.proc.params(object: ::SolidQueue::Semaphore).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::SolidQueue::Semaphore).void) + ).returns(::SolidQueue::Semaphore) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Semaphore).void) + ).returns(T::Array[::SolidQueue::Semaphore]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Semaphore).void) + ).returns(::SolidQueue::Semaphore) + end + def create(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::SolidQueue::Semaphore).void) + ).returns(::SolidQueue::Semaphore) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Semaphore).void) + ).returns(T::Array[::SolidQueue::Semaphore]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Semaphore).void) + ).returns(::SolidQueue::Semaphore) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Semaphore).void) + ).returns(T::Array[::SolidQueue::Semaphore]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Semaphore).void) + ).returns(::SolidQueue::Semaphore) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Semaphore).void) + ).returns(T::Array[::SolidQueue::Semaphore]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Semaphore).void) + ).returns(::SolidQueue::Semaphore) + end + def create_or_find_by!(attributes, &block); end + + sig do + params( + records: T.any(::SolidQueue::Semaphore, Integer, String, T::Enumerable[T.any(::SolidQueue::Semaphore, Integer, String, T::Enumerable[::SolidQueue::Semaphore])]) + ).returns(Integer) + end + def delete(*records); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(args); end + + sig do + params( + records: T.any(::SolidQueue::Semaphore, Integer, String, T::Enumerable[T.any(::SolidQueue::Semaphore, Integer, String, T::Enumerable[::SolidQueue::Semaphore])]) + ).returns(T::Array[::SolidQueue::Semaphore]) + end + def destroy(*records); end + + sig { returns(T::Array[::SolidQueue::Semaphore]) } + def destroy_all; end + + sig { returns(T::Array[::SolidQueue::Semaphore]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::SolidQueue::Semaphore]) } + def destroy_by(args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::SolidQueue::Semaphore)) } + def fifth; end + + sig { returns(::SolidQueue::Semaphore) } + def fifth!; end + + sig do + params( + args: T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything]) + ).returns(::SolidQueue::Semaphore) + end + sig do + params( + args: T::Array[T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything])] + ).returns(T::Enumerable[::SolidQueue::Semaphore]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::SolidQueue::Semaphore).void + ).returns(T.nilable(::SolidQueue::Semaphore)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::SolidQueue::Semaphore)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::SolidQueue::Semaphore) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: ::SolidQueue::Semaphore).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[::SolidQueue::Semaphore]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: T::Array[::SolidQueue::Semaphore]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[T::Enumerator[::SolidQueue::Semaphore]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Semaphore).void) + ).returns(T::Array[::SolidQueue::Semaphore]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Semaphore).void) + ).returns(::SolidQueue::Semaphore) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Semaphore).void) + ).returns(T::Array[::SolidQueue::Semaphore]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Semaphore).void) + ).returns(::SolidQueue::Semaphore) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Semaphore).void) + ).returns(T::Array[::SolidQueue::Semaphore]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Semaphore).void) + ).returns(::SolidQueue::Semaphore) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::SolidQueue::Semaphore)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::SolidQueue::Semaphore) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::SolidQueue::Semaphore) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::SolidQueue::Semaphore)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::Semaphore]) } + def first(limit = nil); end + + sig { returns(::SolidQueue::Semaphore) } + def first!; end + + sig { returns(T.nilable(::SolidQueue::Semaphore)) } + def forty_two; end + + sig { returns(::SolidQueue::Semaphore) } + def forty_two!; end + + sig { returns(T.nilable(::SolidQueue::Semaphore)) } + def fourth; end + + sig { returns(::SolidQueue::Semaphore) } + def fourth!; end + + sig { returns(T::Array[::Integer]) } + def ids; end + + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped, + block: T.proc.params(object: PrivateRelation).void + ).void + end + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped + ).returns(::ActiveRecord::Batches::BatchEnumerator) + end + def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, cursor: primary_key, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert!(attributes, returning: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert_all(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert_all!(attributes, returning: nil); end + + sig { returns(T.nilable(::SolidQueue::Semaphore)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::Semaphore]) } + def last(limit = nil); end + + sig { returns(::SolidQueue::Semaphore) } + def last!; end + + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::Semaphore).returns(T.untyped)) + ).returns(T::Boolean) + end + def many?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def maximum(column_name); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def member?(record); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def minimum(column_name); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::SolidQueue::Semaphore).void) + ).returns(::SolidQueue::Semaphore) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SolidQueue::Semaphore).void) + ).returns(T::Array[::SolidQueue::Semaphore]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SolidQueue::Semaphore).void) + ).returns(::SolidQueue::Semaphore) + end + def new(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::Semaphore).returns(T.untyped)) + ).returns(T::Boolean) + end + def none?(&block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::SolidQueue::Semaphore).returns(T.untyped)) + ).returns(T::Boolean) + end + def one?(&block); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pick(*column_names); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pluck(*column_names); end + + sig { returns(T.nilable(::SolidQueue::Semaphore)) } + def second; end + + sig { returns(::SolidQueue::Semaphore) } + def second!; end + + sig { returns(T.nilable(::SolidQueue::Semaphore)) } + def second_to_last; end + + sig { returns(::SolidQueue::Semaphore) } + def second_to_last!; end + + sig { returns(::SolidQueue::Semaphore) } + def sole; end + + sig { params(initial_value_or_column: T.untyped).returns(T.any(Integer, Float, BigDecimal)) } + sig do + type_parameters(:U) + .params( + initial_value_or_column: T.nilable(T.type_parameter(:U)), + block: T.proc.params(object: ::SolidQueue::Semaphore).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::SolidQueue::Semaphore)) } + sig { params(limit: Integer).returns(T::Array[::SolidQueue::Semaphore]) } + def take(limit = nil); end + + sig { returns(::SolidQueue::Semaphore) } + def take!; end + + sig { returns(T.nilable(::SolidQueue::Semaphore)) } + def third; end + + sig { returns(::SolidQueue::Semaphore) } + def third!; end + + sig { returns(T.nilable(::SolidQueue::Semaphore)) } + def third_to_last; end + + sig { returns(::SolidQueue::Semaphore) } + def third_to_last!; end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert_all(attributes, returning: nil, unique_by: nil); end + end + + module GeneratedAssociationRelationMethods + sig { returns(PrivateAssociationRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def available(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateAssociationRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def expired(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + sig do + params( + blk: T.proc.params(record: ::SolidQueue::Semaphore).returns(BasicObject) + ).returns(T::Array[::SolidQueue::Semaphore]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateAssociationRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::ActiveSupport::TimeWithZone) } + def created_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def created_at=(value); end + + sig { returns(T::Boolean) } + def created_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_before_last_save; end + + sig { returns(T.untyped) } + def created_at_before_type_cast; end + + sig { returns(T::Boolean) } + def created_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_was; end + + sig { void } + def created_at_will_change!; end + + sig { returns(::ActiveSupport::TimeWithZone) } + def expires_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def expires_at=(value); end + + sig { returns(T::Boolean) } + def expires_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def expires_at_before_last_save; end + + sig { returns(T.untyped) } + def expires_at_before_type_cast; end + + sig { returns(T::Boolean) } + def expires_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def expires_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def expires_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def expires_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def expires_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def expires_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def expires_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def expires_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def expires_at_was; end + + sig { void } + def expires_at_will_change!; end + + sig { returns(::Integer) } + def id; end + + sig { params(value: ::Integer).returns(::Integer) } + def id=(value); end + + sig { returns(T::Boolean) } + def id?; end + + sig { returns(T.nilable(::Integer)) } + def id_before_last_save; end + + sig { returns(T.untyped) } + def id_before_type_cast; end + + sig { returns(T::Boolean) } + def id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_previously_was; end + + sig { returns(::Integer) } + def id_value; end + + sig { params(value: ::Integer).returns(::Integer) } + def id_value=(value); end + + sig { returns(T::Boolean) } + def id_value?; end + + sig { returns(T.nilable(::Integer)) } + def id_value_before_last_save; end + + sig { returns(T.untyped) } + def id_value_before_type_cast; end + + sig { returns(T::Boolean) } + def id_value_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def id_value_was; end + + sig { void } + def id_value_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def id_was; end + + sig { void } + def id_will_change!; end + + sig { returns(::String) } + def key; end + + sig { params(value: ::String).returns(::String) } + def key=(value); end + + sig { returns(T::Boolean) } + def key?; end + + sig { returns(T.nilable(::String)) } + def key_before_last_save; end + + sig { returns(T.untyped) } + def key_before_type_cast; end + + sig { returns(T::Boolean) } + def key_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def key_change; end + + sig { returns(T.nilable([::String, ::String])) } + def key_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def key_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def key_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def key_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def key_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def key_previously_was; end + + sig { returns(T.nilable(::String)) } + def key_was; end + + sig { void } + def key_will_change!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_expires_at!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_key!; end + + sig { void } + def restore_updated_at!; end + + sig { void } + def restore_value!; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_created_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_expires_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_expires_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id_value; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_key; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_key?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_updated_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_updated_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_value; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(::ActiveSupport::TimeWithZone) } + def updated_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def updated_at=(value); end + + sig { returns(T::Boolean) } + def updated_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_before_last_save; end + + sig { returns(T.untyped) } + def updated_at_before_type_cast; end + + sig { returns(T::Boolean) } + def updated_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def updated_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def updated_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def updated_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def updated_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def updated_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_was; end + + sig { void } + def updated_at_will_change!; end + + sig { returns(::Integer) } + def value; end + + sig { params(value: ::Integer).returns(::Integer) } + def value=(value); end + + sig { returns(T::Boolean) } + def value?; end + + sig { returns(T.nilable(::Integer)) } + def value_before_last_save; end + + sig { returns(T.untyped) } + def value_before_type_cast; end + + sig { returns(T::Boolean) } + def value_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def value_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def value_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def value_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def value_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def value_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def value_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def value_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def value_was; end + + sig { void } + def value_will_change!; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_expires_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_key?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_updated_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + end + + module GeneratedRelationMethods + sig { returns(PrivateRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def available(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def expired(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + sig do + params( + blk: T.proc.params(record: ::SolidQueue::Semaphore).returns(BasicObject) + ).returns(T::Array[::SolidQueue::Semaphore]) + end + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::Semaphore } } + + sig { returns(T::Array[::SolidQueue::Semaphore]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::Semaphore]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::SolidQueue::Semaphore } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateAssociationRelationWhereChain + Elem = type_member { { fixed: ::SolidQueue::Semaphore } } + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateAssociationRelation) } + def not(opts, *rest); end + end + + class PrivateCollectionProxy < ::ActiveRecord::Associations::CollectionProxy + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::Semaphore } } + + sig do + params( + records: T.any(::SolidQueue::Semaphore, T::Enumerable[T.any(::SolidQueue::Semaphore, T::Enumerable[::SolidQueue::Semaphore])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::SolidQueue::Semaphore, T::Enumerable[T.any(::SolidQueue::Semaphore, T::Enumerable[::SolidQueue::Semaphore])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::SolidQueue::Semaphore, T::Enumerable[T.any(::SolidQueue::Semaphore, T::Enumerable[::SolidQueue::Semaphore])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig { returns(T::Array[::SolidQueue::Semaphore]) } + def load_target; end + + sig do + params( + records: T.any(::SolidQueue::Semaphore, T::Enumerable[T.any(::SolidQueue::Semaphore, T::Enumerable[::SolidQueue::Semaphore])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::SolidQueue::Semaphore, T::Enumerable[T.any(::SolidQueue::Semaphore, T::Enumerable[::SolidQueue::Semaphore])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::SolidQueue::Semaphore, T::Enumerable[T.any(::SolidQueue::Semaphore, T::Enumerable[::SolidQueue::Semaphore])]) + ).returns(T::Array[::SolidQueue::Semaphore]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::SolidQueue::Semaphore]) } + def target; end + + sig { returns(T::Array[::SolidQueue::Semaphore]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::Semaphore]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::SolidQueue::Semaphore } } + + sig { returns(T::Array[::SolidQueue::Semaphore]) } + def to_a; end + + sig { returns(T::Array[::SolidQueue::Semaphore]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::SolidQueue::Semaphore } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateRelationWhereChain + Elem = type_member { { fixed: ::SolidQueue::Semaphore } } + + sig { params(args: T.untyped).returns(PrivateRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateRelation) } + def not(opts, *rest); end + end +end diff --git a/sorbet/rbi/dsl/subproject.rbi b/sorbet/rbi/dsl/subproject.rbi new file mode 100644 index 0000000..56ace0c --- /dev/null +++ b/sorbet/rbi/dsl/subproject.rbi @@ -0,0 +1,1548 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Subproject`. +# Please instead update this file by running `bin/tapioca dsl Subproject`. + + +class Subproject + include GeneratedAssociationMethods + include GeneratedAttributeMethods + extend CommonRelationMethods + extend GeneratedRelationMethods + + private + + sig { returns(NilClass) } + def to_ary; end + + class << self + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Subproject).void) + ).returns(::Subproject) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::Subproject).returns(T.untyped))).returns(T::Boolean) } + def any?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def average(column_name); end + + sig { params(block: T.nilable(T.proc.params(object: ::Subproject).void)).returns(::Subproject) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Subproject).void) + ).returns(T::Array[::Subproject]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Subproject).void) + ).returns(::Subproject) + end + def build(attributes = nil, &block); end + + sig { params(operation: Symbol, column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def calculate(operation, column_name); end + + sig { params(column_name: T.nilable(T.any(String, Symbol))).returns(Integer) } + sig { params(column_name: NilClass, block: T.proc.params(object: ::Subproject).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Subproject).void)).returns(::Subproject) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Subproject).void) + ).returns(T::Array[::Subproject]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Subproject).void) + ).returns(::Subproject) + end + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Subproject).void)).returns(::Subproject) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Subproject).void) + ).returns(T::Array[::Subproject]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Subproject).void) + ).returns(::Subproject) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Subproject).void) + ).returns(T::Array[::Subproject]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Subproject).void) + ).returns(::Subproject) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Subproject).void) + ).returns(T::Array[::Subproject]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Subproject).void) + ).returns(::Subproject) + end + def create_or_find_by!(attributes, &block); end + + sig do + params( + records: T.any(::Subproject, Integer, String, T::Enumerable[T.any(::Subproject, Integer, String, T::Enumerable[::Subproject])]) + ).returns(Integer) + end + def delete(*records); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(args); end + + sig do + params( + records: T.any(::Subproject, Integer, String, T::Enumerable[T.any(::Subproject, Integer, String, T::Enumerable[::Subproject])]) + ).returns(T::Array[::Subproject]) + end + def destroy(*records); end + + sig { returns(T::Array[::Subproject]) } + def destroy_all; end + + sig { returns(T::Array[::Subproject]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::Subproject]) } + def destroy_by(args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::Subproject)) } + def fifth; end + + sig { returns(::Subproject) } + def fifth!; end + + sig do + params( + args: T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything]) + ).returns(::Subproject) + end + sig do + params( + args: T::Array[T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything])] + ).returns(T::Enumerable[::Subproject]) + end + sig { params(args: NilClass, block: T.proc.params(object: ::Subproject).void).returns(T.nilable(::Subproject)) } + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::Subproject)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::Subproject) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: ::Subproject).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[::Subproject]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: T::Array[::Subproject]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[T::Enumerator[::Subproject]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Subproject).void) + ).returns(T::Array[::Subproject]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Subproject).void) + ).returns(::Subproject) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Subproject).void) + ).returns(T::Array[::Subproject]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Subproject).void) + ).returns(::Subproject) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Subproject).void) + ).returns(T::Array[::Subproject]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Subproject).void) + ).returns(::Subproject) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::Subproject)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::Subproject) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::Subproject) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::Subproject)) } + sig { params(limit: Integer).returns(T::Array[::Subproject]) } + def first(limit = nil); end + + sig { returns(::Subproject) } + def first!; end + + sig { returns(T.nilable(::Subproject)) } + def forty_two; end + + sig { returns(::Subproject) } + def forty_two!; end + + sig { returns(T.nilable(::Subproject)) } + def fourth; end + + sig { returns(::Subproject) } + def fourth!; end + + sig { returns(T::Array[::Integer]) } + def ids; end + + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped, + block: T.proc.params(object: PrivateRelation).void + ).void + end + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped + ).returns(::ActiveRecord::Batches::BatchEnumerator) + end + def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, cursor: primary_key, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert!(attributes, returning: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert_all(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert_all!(attributes, returning: nil); end + + sig { returns(T.nilable(::Subproject)) } + sig { params(limit: Integer).returns(T::Array[::Subproject]) } + def last(limit = nil); end + + sig { returns(::Subproject) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::Subproject).returns(T.untyped))).returns(T::Boolean) } + def many?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def maximum(column_name); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def member?(record); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def minimum(column_name); end + + sig { params(block: T.nilable(T.proc.params(object: ::Subproject).void)).returns(::Subproject) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Subproject).void) + ).returns(T::Array[::Subproject]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Subproject).void) + ).returns(::Subproject) + end + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Subproject).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Subproject).returns(T.untyped))).returns(T::Boolean) } + def one?(&block); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pick(*column_names); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pluck(*column_names); end + + sig { returns(T.nilable(::Subproject)) } + def second; end + + sig { returns(::Subproject) } + def second!; end + + sig { returns(T.nilable(::Subproject)) } + def second_to_last; end + + sig { returns(::Subproject) } + def second_to_last!; end + + sig { returns(::Subproject) } + def sole; end + + sig { params(initial_value_or_column: T.untyped).returns(T.any(Integer, Float, BigDecimal)) } + sig do + type_parameters(:U) + .params( + initial_value_or_column: T.nilable(T.type_parameter(:U)), + block: T.proc.params(object: ::Subproject).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::Subproject)) } + sig { params(limit: Integer).returns(T::Array[::Subproject]) } + def take(limit = nil); end + + sig { returns(::Subproject) } + def take!; end + + sig { returns(T.nilable(::Subproject)) } + def third; end + + sig { returns(::Subproject) } + def third!; end + + sig { returns(T.nilable(::Subproject)) } + def third_to_last; end + + sig { returns(::Subproject) } + def third_to_last!; end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert_all(attributes, returning: nil, unique_by: nil); end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::Project) } + def build_project(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Region) } + def build_region(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Project) } + def create_project(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Project) } + def create_project!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Region) } + def create_region(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Region) } + def create_region!(*args, &blk); end + + sig { returns(T::Array[T.untyped]) } + def journal_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def journal_ids=(ids); end + + # This method is created by ActiveRecord on the `Subproject` class because it declared `has_many :journals`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::Journal::PrivateCollectionProxy) } + def journals; end + + sig { params(value: T::Enumerable[::Journal]).void } + def journals=(value); end + + # This method is created by ActiveRecord on the `Subproject` class because it declared `has_many :log_entries`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::LogEntry::PrivateCollectionProxy) } + def log_entries; end + + sig { params(value: T::Enumerable[::LogEntry]).void } + def log_entries=(value); end + + sig { returns(T::Array[T.untyped]) } + def log_entry_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def log_entry_ids=(ids); end + + sig { returns(T.nilable(::Project)) } + def project; end + + sig { params(value: T.nilable(::Project)).void } + def project=(value); end + + sig { returns(T::Boolean) } + def project_changed?; end + + sig { returns(T::Boolean) } + def project_previously_changed?; end + + sig { returns(T.nilable(::Region)) } + def region; end + + sig { params(value: T.nilable(::Region)).void } + def region=(value); end + + sig { returns(T::Boolean) } + def region_changed?; end + + sig { returns(T::Boolean) } + def region_previously_changed?; end + + sig { returns(T.nilable(::Project)) } + def reload_project; end + + sig { returns(T.nilable(::Region)) } + def reload_region; end + + sig { void } + def reset_project; end + + sig { void } + def reset_region; end + end + + module GeneratedAssociationRelationMethods + sig { returns(PrivateAssociationRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateAssociationRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + sig { params(blk: T.proc.params(record: ::Subproject).returns(BasicObject)).returns(T::Array[::Subproject]) } + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateAssociationRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(T.nilable(::String)) } + def address; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def address=(value); end + + sig { returns(T::Boolean) } + def address?; end + + sig { returns(T.nilable(::String)) } + def address_before_last_save; end + + sig { returns(T.untyped) } + def address_before_type_cast; end + + sig { returns(T::Boolean) } + def address_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def address_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def address_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def address_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def address_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def address_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def address_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def address_previously_was; end + + sig { returns(T.nilable(::String)) } + def address_was; end + + sig { void } + def address_will_change!; end + + sig { returns(::ActiveSupport::TimeWithZone) } + def created_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def created_at=(value); end + + sig { returns(T::Boolean) } + def created_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_before_last_save; end + + sig { returns(T.untyped) } + def created_at_before_type_cast; end + + sig { returns(T::Boolean) } + def created_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def created_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def created_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at_was; end + + sig { void } + def created_at_will_change!; end + + sig { returns(T.nilable(::String)) } + def description; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def description=(value); end + + sig { returns(T::Boolean) } + def description?; end + + sig { returns(T.nilable(::String)) } + def description_before_last_save; end + + sig { returns(T.untyped) } + def description_before_type_cast; end + + sig { returns(T::Boolean) } + def description_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def description_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def description_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def description_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def description_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def description_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def description_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def description_previously_was; end + + sig { returns(T.nilable(::String)) } + def description_was; end + + sig { void } + def description_will_change!; end + + sig { returns(::Integer) } + def id; end + + sig { params(value: ::Integer).returns(::Integer) } + def id=(value); end + + sig { returns(T::Boolean) } + def id?; end + + sig { returns(T.nilable(::Integer)) } + def id_before_last_save; end + + sig { returns(T.untyped) } + def id_before_type_cast; end + + sig { returns(T::Boolean) } + def id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_previously_was; end + + sig { returns(::Integer) } + def id_value; end + + sig { params(value: ::Integer).returns(::Integer) } + def id_value=(value); end + + sig { returns(T::Boolean) } + def id_value?; end + + sig { returns(T.nilable(::Integer)) } + def id_value_before_last_save; end + + sig { returns(T.untyped) } + def id_value_before_type_cast; end + + sig { returns(T::Boolean) } + def id_value_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def id_value_was; end + + sig { void } + def id_value_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def id_was; end + + sig { void } + def id_will_change!; end + + sig { returns(T.nilable(::String)) } + def name; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def name=(value); end + + sig { returns(T::Boolean) } + def name?; end + + sig { returns(T.nilable(::String)) } + def name_before_last_save; end + + sig { returns(T.untyped) } + def name_before_type_cast; end + + sig { returns(T::Boolean) } + def name_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def name_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def name_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def name_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def name_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def name_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def name_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def name_previously_was; end + + sig { returns(T.nilable(::String)) } + def name_was; end + + sig { void } + def name_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def project_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def project_id=(value); end + + sig { returns(T::Boolean) } + def project_id?; end + + sig { returns(T.nilable(::Integer)) } + def project_id_before_last_save; end + + sig { returns(T.untyped) } + def project_id_before_type_cast; end + + sig { returns(T::Boolean) } + def project_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def project_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def project_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def project_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def project_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def project_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def project_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def project_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def project_id_was; end + + sig { void } + def project_id_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def region_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def region_id=(value); end + + sig { returns(T::Boolean) } + def region_id?; end + + sig { returns(T.nilable(::Integer)) } + def region_id_before_last_save; end + + sig { returns(T.untyped) } + def region_id_before_type_cast; end + + sig { returns(T::Boolean) } + def region_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def region_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def region_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def region_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def region_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def region_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def region_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def region_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def region_id_was; end + + sig { void } + def region_id_will_change!; end + + sig { void } + def restore_address!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_description!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_name!; end + + sig { void } + def restore_project_id!; end + + sig { void } + def restore_region_id!; end + + sig { void } + def restore_updated_at!; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_address; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_address?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_created_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_description; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_description?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id_value; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_name; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_name?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def saved_change_to_project_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_project_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def saved_change_to_region_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_region_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def saved_change_to_updated_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_updated_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(::ActiveSupport::TimeWithZone) } + def updated_at; end + + sig { params(value: ::ActiveSupport::TimeWithZone).returns(::ActiveSupport::TimeWithZone) } + def updated_at=(value); end + + sig { returns(T::Boolean) } + def updated_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_before_last_save; end + + sig { returns(T.untyped) } + def updated_at_before_type_cast; end + + sig { returns(T::Boolean) } + def updated_at_came_from_user?; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def updated_at_change; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def updated_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def updated_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_in_database; end + + sig { returns(T.nilable([::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeWithZone])) } + def updated_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def updated_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at_was; end + + sig { void } + def updated_at_will_change!; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_address?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_created_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_description?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_name?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_project_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_region_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_updated_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + end + + module GeneratedRelationMethods + sig { returns(PrivateRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + sig { params(blk: T.proc.params(record: ::Subproject).returns(BasicObject)).returns(T::Array[::Subproject]) } + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::Subproject } } + + sig { returns(T::Array[::Subproject]) } + def to_a; end + + sig { returns(T::Array[::Subproject]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::Subproject } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateAssociationRelationWhereChain + Elem = type_member { { fixed: ::Subproject } } + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateAssociationRelation) } + def not(opts, *rest); end + end + + class PrivateCollectionProxy < ::ActiveRecord::Associations::CollectionProxy + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::Subproject } } + + sig do + params( + records: T.any(::Subproject, T::Enumerable[T.any(::Subproject, T::Enumerable[::Subproject])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::Subproject, T::Enumerable[T.any(::Subproject, T::Enumerable[::Subproject])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::Subproject, T::Enumerable[T.any(::Subproject, T::Enumerable[::Subproject])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig { returns(T::Array[::Subproject]) } + def load_target; end + + sig do + params( + records: T.any(::Subproject, T::Enumerable[T.any(::Subproject, T::Enumerable[::Subproject])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::Subproject, T::Enumerable[T.any(::Subproject, T::Enumerable[::Subproject])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::Subproject, T::Enumerable[T.any(::Subproject, T::Enumerable[::Subproject])]) + ).returns(T::Array[::Subproject]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::Subproject]) } + def target; end + + sig { returns(T::Array[::Subproject]) } + def to_a; end + + sig { returns(T::Array[::Subproject]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::Subproject } } + + sig { returns(T::Array[::Subproject]) } + def to_a; end + + sig { returns(T::Array[::Subproject]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::Subproject } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateRelationWhereChain + Elem = type_member { { fixed: ::Subproject } } + + sig { params(args: T.untyped).returns(PrivateRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateRelation) } + def not(opts, *rest); end + end +end diff --git a/sorbet/rbi/dsl/time.rbi b/sorbet/rbi/dsl/time.rbi new file mode 100644 index 0000000..8b24b57 --- /dev/null +++ b/sorbet/rbi/dsl/time.rbi @@ -0,0 +1,13 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Time`. +# Please instead update this file by running `bin/tapioca dsl Time`. + + +class Time + class << self + sig { returns(::ActiveSupport::TimeWithZone) } + def current; end + end +end diff --git a/sorbet/rbi/dsl/turbo/streams/action_broadcast_job.rbi b/sorbet/rbi/dsl/turbo/streams/action_broadcast_job.rbi new file mode 100644 index 0000000..e197176 --- /dev/null +++ b/sorbet/rbi/dsl/turbo/streams/action_broadcast_job.rbi @@ -0,0 +1,33 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Turbo::Streams::ActionBroadcastJob`. +# Please instead update this file by running `bin/tapioca dsl Turbo::Streams::ActionBroadcastJob`. + + +class Turbo::Streams::ActionBroadcastJob + class << self + sig do + params( + stream: T.untyped, + action: T.untyped, + target: T.untyped, + attributes: T.untyped, + rendering: T.untyped, + block: T.nilable(T.proc.params(job: Turbo::Streams::ActionBroadcastJob).void) + ).returns(T.any(Turbo::Streams::ActionBroadcastJob, FalseClass)) + end + def perform_later(stream, action:, target:, attributes: T.unsafe(nil), **rendering, &block); end + + sig do + params( + stream: T.untyped, + action: T.untyped, + target: T.untyped, + attributes: T.untyped, + rendering: T.untyped + ).returns(T.untyped) + end + def perform_now(stream, action:, target:, attributes: T.unsafe(nil), **rendering); end + end +end diff --git a/sorbet/rbi/dsl/turbo/streams/broadcast_job.rbi b/sorbet/rbi/dsl/turbo/streams/broadcast_job.rbi new file mode 100644 index 0000000..bdda7f6 --- /dev/null +++ b/sorbet/rbi/dsl/turbo/streams/broadcast_job.rbi @@ -0,0 +1,22 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Turbo::Streams::BroadcastJob`. +# Please instead update this file by running `bin/tapioca dsl Turbo::Streams::BroadcastJob`. + + +class Turbo::Streams::BroadcastJob + class << self + sig do + params( + stream: T.untyped, + rendering: T.untyped, + block: T.nilable(T.proc.params(job: Turbo::Streams::BroadcastJob).void) + ).returns(T.any(Turbo::Streams::BroadcastJob, FalseClass)) + end + def perform_later(stream, **rendering, &block); end + + sig { params(stream: T.untyped, rendering: T.untyped).returns(T.untyped) } + def perform_now(stream, **rendering); end + end +end diff --git a/sorbet/rbi/dsl/turbo/streams/broadcast_stream_job.rbi b/sorbet/rbi/dsl/turbo/streams/broadcast_stream_job.rbi new file mode 100644 index 0000000..4a21674 --- /dev/null +++ b/sorbet/rbi/dsl/turbo/streams/broadcast_stream_job.rbi @@ -0,0 +1,22 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Turbo::Streams::BroadcastStreamJob`. +# Please instead update this file by running `bin/tapioca dsl Turbo::Streams::BroadcastStreamJob`. + + +class Turbo::Streams::BroadcastStreamJob + class << self + sig do + params( + stream: T.untyped, + content: T.untyped, + block: T.nilable(T.proc.params(job: Turbo::Streams::BroadcastStreamJob).void) + ).returns(T.any(Turbo::Streams::BroadcastStreamJob, FalseClass)) + end + def perform_later(stream, content:, &block); end + + sig { params(stream: T.untyped, content: T.untyped).returns(T.untyped) } + def perform_now(stream, content:); end + end +end diff --git a/sorbet/rbi/dsl/user.rbi b/sorbet/rbi/dsl/user.rbi new file mode 100644 index 0000000..6e0712c --- /dev/null +++ b/sorbet/rbi/dsl/user.rbi @@ -0,0 +1,1209 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `User`. +# Please instead update this file by running `bin/tapioca dsl User`. + + +class User + include GeneratedAssociationMethods + include GeneratedAttributeMethods + extend CommonRelationMethods + extend GeneratedRelationMethods + + sig { params(unencrypted_password: T.untyped).returns(T.any(User, FalseClass)) } + def authenticate(unencrypted_password); end + + sig { params(unencrypted_password: T.untyped).returns(T.any(User, FalseClass)) } + def authenticate_password(unencrypted_password); end + + sig { returns(T.untyped) } + def password; end + + sig { params(unencrypted_password: T.untyped).returns(T.untyped) } + def password=(unencrypted_password); end + + sig { returns(T.untyped) } + def password_challenge; end + + sig { params(_arg0: T.untyped).returns(T.untyped) } + def password_challenge=(_arg0); end + + sig { returns(T.untyped) } + def password_confirmation; end + + sig { returns(T.untyped) } + def password_confirmation; end + + sig { params(_arg0: T.untyped).returns(T.untyped) } + def password_confirmation=(_arg0); end + + sig { params(password_confirmation: T.untyped).returns(T.untyped) } + def password_confirmation=(password_confirmation); end + + sig { returns(T.untyped) } + def password_reset_token; end + + sig { returns(T.untyped) } + def password_salt; end + + private + + sig { returns(NilClass) } + def to_ary; end + + class << self + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::User).void)).returns(::User) } + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::User).returns(T.untyped))).returns(T::Boolean) } + def any?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def average(column_name); end + + sig { params(block: T.nilable(T.proc.params(object: ::User).void)).returns(::User) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::User).void) + ).returns(T::Array[::User]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::User).void)).returns(::User) } + def build(attributes = nil, &block); end + + sig { params(operation: Symbol, column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def calculate(operation, column_name); end + + sig { params(column_name: T.nilable(T.any(String, Symbol))).returns(Integer) } + sig { params(column_name: NilClass, block: T.proc.params(object: ::User).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::User).void)).returns(::User) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::User).void) + ).returns(T::Array[::User]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::User).void)).returns(::User) } + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::User).void)).returns(::User) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::User).void) + ).returns(T::Array[::User]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::User).void)).returns(::User) } + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::User).void) + ).returns(T::Array[::User]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::User).void)).returns(::User) } + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::User).void) + ).returns(T::Array[::User]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::User).void)).returns(::User) } + def create_or_find_by!(attributes, &block); end + + sig do + params( + records: T.any(::User, Integer, String, T::Enumerable[T.any(::User, Integer, String, T::Enumerable[::User])]) + ).returns(Integer) + end + def delete(*records); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(args); end + + sig do + params( + records: T.any(::User, Integer, String, T::Enumerable[T.any(::User, Integer, String, T::Enumerable[::User])]) + ).returns(T::Array[::User]) + end + def destroy(*records); end + + sig { returns(T::Array[::User]) } + def destroy_all; end + + sig { returns(T::Array[::User]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::User]) } + def destroy_by(args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::User)) } + def fifth; end + + sig { returns(::User) } + def fifth!; end + + sig do + params( + args: T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything]) + ).returns(::User) + end + sig do + params( + args: T::Array[T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything])] + ).returns(T::Enumerable[::User]) + end + sig { params(args: NilClass, block: T.proc.params(object: ::User).void).returns(T.nilable(::User)) } + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::User)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::User) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: ::User).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[::User]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: T::Array[::User]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[T::Enumerator[::User]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::User).void) + ).returns(T::Array[::User]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::User).void)).returns(::User) } + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::User).void) + ).returns(T::Array[::User]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::User).void)).returns(::User) } + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::User).void) + ).returns(T::Array[::User]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::User).void)).returns(::User) } + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::User)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::User) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::User) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::User)) } + sig { params(limit: Integer).returns(T::Array[::User]) } + def first(limit = nil); end + + sig { returns(::User) } + def first!; end + + sig { returns(T.nilable(::User)) } + def forty_two; end + + sig { returns(::User) } + def forty_two!; end + + sig { returns(T.nilable(::User)) } + def fourth; end + + sig { returns(::User) } + def fourth!; end + + sig { returns(T::Array[::Integer]) } + def ids; end + + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped, + block: T.proc.params(object: PrivateRelation).void + ).void + end + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped + ).returns(::ActiveRecord::Batches::BatchEnumerator) + end + def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, cursor: primary_key, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert!(attributes, returning: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert_all(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert_all!(attributes, returning: nil); end + + sig { returns(T.nilable(::User)) } + sig { params(limit: Integer).returns(T::Array[::User]) } + def last(limit = nil); end + + sig { returns(::User) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::User).returns(T.untyped))).returns(T::Boolean) } + def many?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def maximum(column_name); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def member?(record); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def minimum(column_name); end + + sig { params(block: T.nilable(T.proc.params(object: ::User).void)).returns(::User) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::User).void) + ).returns(T::Array[::User]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::User).void)).returns(::User) } + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::User).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::User).returns(T.untyped))).returns(T::Boolean) } + def one?(&block); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pick(*column_names); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pluck(*column_names); end + + sig { returns(T.nilable(::User)) } + def second; end + + sig { returns(::User) } + def second!; end + + sig { returns(T.nilable(::User)) } + def second_to_last; end + + sig { returns(::User) } + def second_to_last!; end + + sig { returns(::User) } + def sole; end + + sig { params(initial_value_or_column: T.untyped).returns(T.any(Integer, Float, BigDecimal)) } + sig do + type_parameters(:U) + .params( + initial_value_or_column: T.nilable(T.type_parameter(:U)), + block: T.proc.params(object: ::User).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::User)) } + sig { params(limit: Integer).returns(T::Array[::User]) } + def take(limit = nil); end + + sig { returns(::User) } + def take!; end + + sig { returns(T.nilable(::User)) } + def third; end + + sig { returns(::User) } + def third!; end + + sig { returns(T.nilable(::User)) } + def third_to_last; end + + sig { returns(::User) } + def third_to_last!; end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert_all(attributes, returning: nil, unique_by: nil); end + end + + module GeneratedAssociationMethods + sig { returns(T::Array[T.untyped]) } + def journal_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def journal_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :journals`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::Journal::PrivateCollectionProxy) } + def journals; end + + sig { params(value: T::Enumerable[::Journal]).void } + def journals=(value); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :log_entries`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::LogEntry::PrivateCollectionProxy) } + def log_entries; end + + sig { params(value: T::Enumerable[::LogEntry]).void } + def log_entries=(value); end + + sig { returns(T::Array[T.untyped]) } + def log_entry_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def log_entry_ids=(ids); end + + sig { returns(T::Array[T.untyped]) } + def user_role_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def user_role_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :user_roles`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::UserRole::PrivateCollectionProxy) } + def user_roles; end + + sig { params(value: T::Enumerable[::UserRole]).void } + def user_roles=(value); end + end + + module GeneratedAssociationRelationMethods + sig { returns(PrivateAssociationRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateAssociationRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + sig { params(blk: T.proc.params(record: ::User).returns(BasicObject)).returns(T::Array[::User]) } + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateAssociationRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::Integer) } + def id; end + + sig { params(value: ::Integer).returns(::Integer) } + def id=(value); end + + sig { returns(T::Boolean) } + def id?; end + + sig { returns(T.nilable(::Integer)) } + def id_before_last_save; end + + sig { returns(T.untyped) } + def id_before_type_cast; end + + sig { returns(T::Boolean) } + def id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_previously_was; end + + sig { returns(::Integer) } + def id_value; end + + sig { params(value: ::Integer).returns(::Integer) } + def id_value=(value); end + + sig { returns(T::Boolean) } + def id_value?; end + + sig { returns(T.nilable(::Integer)) } + def id_value_before_last_save; end + + sig { returns(T.untyped) } + def id_value_before_type_cast; end + + sig { returns(T::Boolean) } + def id_value_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def id_value_was; end + + sig { void } + def id_value_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def id_was; end + + sig { void } + def id_will_change!; end + + sig { returns(T.nilable(::String)) } + def password_digest; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def password_digest=(value); end + + sig { returns(T::Boolean) } + def password_digest?; end + + sig { returns(T.nilable(::String)) } + def password_digest_before_last_save; end + + sig { returns(T.untyped) } + def password_digest_before_type_cast; end + + sig { returns(T::Boolean) } + def password_digest_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def password_digest_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def password_digest_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def password_digest_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def password_digest_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def password_digest_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def password_digest_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def password_digest_previously_was; end + + sig { returns(T.nilable(::String)) } + def password_digest_was; end + + sig { void } + def password_digest_will_change!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_password_digest!; end + + sig { void } + def restore_username!; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id_value; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_password_digest; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_password_digest?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_username; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_username?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def username; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def username=(value); end + + sig { returns(T::Boolean) } + def username?; end + + sig { returns(T.nilable(::String)) } + def username_before_last_save; end + + sig { returns(T.untyped) } + def username_before_type_cast; end + + sig { returns(T::Boolean) } + def username_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def username_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def username_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def username_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def username_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def username_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def username_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def username_previously_was; end + + sig { returns(T.nilable(::String)) } + def username_was; end + + sig { void } + def username_will_change!; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_password_digest?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_username?(from: T.unsafe(nil), to: T.unsafe(nil)); end + end + + module GeneratedRelationMethods + sig { returns(PrivateRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + sig { params(blk: T.proc.params(record: ::User).returns(BasicObject)).returns(T::Array[::User]) } + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::User } } + + sig { returns(T::Array[::User]) } + def to_a; end + + sig { returns(T::Array[::User]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::User } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateAssociationRelationWhereChain + Elem = type_member { { fixed: ::User } } + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateAssociationRelation) } + def not(opts, *rest); end + end + + class PrivateCollectionProxy < ::ActiveRecord::Associations::CollectionProxy + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::User } } + + sig do + params( + records: T.any(::User, T::Enumerable[T.any(::User, T::Enumerable[::User])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::User, T::Enumerable[T.any(::User, T::Enumerable[::User])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::User, T::Enumerable[T.any(::User, T::Enumerable[::User])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig { returns(T::Array[::User]) } + def load_target; end + + sig do + params( + records: T.any(::User, T::Enumerable[T.any(::User, T::Enumerable[::User])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::User, T::Enumerable[T.any(::User, T::Enumerable[::User])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::User, T::Enumerable[T.any(::User, T::Enumerable[::User])]) + ).returns(T::Array[::User]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::User]) } + def target; end + + sig { returns(T::Array[::User]) } + def to_a; end + + sig { returns(T::Array[::User]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::User } } + + sig { returns(T::Array[::User]) } + def to_a; end + + sig { returns(T::Array[::User]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::User } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateRelationWhereChain + Elem = type_member { { fixed: ::User } } + + sig { params(args: T.untyped).returns(PrivateRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateRelation) } + def not(opts, *rest); end + end +end diff --git a/sorbet/rbi/dsl/user_role.rbi b/sorbet/rbi/dsl/user_role.rbi new file mode 100644 index 0000000..9aa0b64 --- /dev/null +++ b/sorbet/rbi/dsl/user_role.rbi @@ -0,0 +1,1218 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `UserRole`. +# Please instead update this file by running `bin/tapioca dsl UserRole`. + + +class UserRole + include GeneratedAssociationMethods + include GeneratedAttributeMethods + include EnumMethodsModule + extend CommonRelationMethods + extend GeneratedRelationMethods + + private + + sig { returns(NilClass) } + def to_ary; end + + class << self + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::UserRole).void)).returns(::UserRole) } + def new(attributes = nil, &block); end + + sig { returns(T::Hash[T.any(String, Symbol), String]) } + def roles; end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::UserRole).returns(T.untyped))).returns(T::Boolean) } + def any?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def average(column_name); end + + sig { params(block: T.nilable(T.proc.params(object: ::UserRole).void)).returns(::UserRole) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UserRole).void) + ).returns(T::Array[::UserRole]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::UserRole).void)).returns(::UserRole) } + def build(attributes = nil, &block); end + + sig { params(operation: Symbol, column_name: T.any(String, Symbol)).returns(T.any(Integer, Float, BigDecimal)) } + def calculate(operation, column_name); end + + sig { params(column_name: T.nilable(T.any(String, Symbol))).returns(Integer) } + sig { params(column_name: NilClass, block: T.proc.params(object: ::UserRole).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::UserRole).void)).returns(::UserRole) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UserRole).void) + ).returns(T::Array[::UserRole]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::UserRole).void)).returns(::UserRole) } + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::UserRole).void)).returns(::UserRole) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UserRole).void) + ).returns(T::Array[::UserRole]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::UserRole).void)).returns(::UserRole) } + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UserRole).void) + ).returns(T::Array[::UserRole]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::UserRole).void)).returns(::UserRole) } + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UserRole).void) + ).returns(T::Array[::UserRole]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::UserRole).void)).returns(::UserRole) } + def create_or_find_by!(attributes, &block); end + + sig do + params( + records: T.any(::UserRole, Integer, String, T::Enumerable[T.any(::UserRole, Integer, String, T::Enumerable[::UserRole])]) + ).returns(Integer) + end + def delete(*records); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(args); end + + sig do + params( + records: T.any(::UserRole, Integer, String, T::Enumerable[T.any(::UserRole, Integer, String, T::Enumerable[::UserRole])]) + ).returns(T::Array[::UserRole]) + end + def destroy(*records); end + + sig { returns(T::Array[::UserRole]) } + def destroy_all; end + + sig { returns(T::Array[::UserRole]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::UserRole]) } + def destroy_by(args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::UserRole)) } + def fifth; end + + sig { returns(::UserRole) } + def fifth!; end + + sig do + params( + args: T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything]) + ).returns(::UserRole) + end + sig do + params( + args: T::Array[T.any(String, Symbol, ::ActiveSupport::Multibyte::Chars, T::Boolean, BigDecimal, Numeric, ::ActiveRecord::Type::Binary::Data, ::ActiveRecord::Type::Time::Value, Date, Time, ::ActiveSupport::Duration, T::Class[T.anything])] + ).returns(T::Enumerable[::UserRole]) + end + sig { params(args: NilClass, block: T.proc.params(object: ::UserRole).void).returns(T.nilable(::UserRole)) } + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::UserRole)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::UserRole) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: ::UserRole).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[::UserRole]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + block: T.proc.params(object: T::Array[::UserRole]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol + ).returns(T::Enumerator[T::Enumerator[::UserRole]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, cursor: primary_key, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UserRole).void) + ).returns(T::Array[::UserRole]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::UserRole).void)).returns(::UserRole) } + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UserRole).void) + ).returns(T::Array[::UserRole]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::UserRole).void)).returns(::UserRole) } + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UserRole).void) + ).returns(T::Array[::UserRole]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::UserRole).void)).returns(::UserRole) } + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::UserRole)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::UserRole) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::UserRole) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::UserRole)) } + sig { params(limit: Integer).returns(T::Array[::UserRole]) } + def first(limit = nil); end + + sig { returns(::UserRole) } + def first!; end + + sig { returns(T.nilable(::UserRole)) } + def forty_two; end + + sig { returns(::UserRole) } + def forty_two!; end + + sig { returns(T.nilable(::UserRole)) } + def fourth; end + + sig { returns(::UserRole) } + def fourth!; end + + sig { returns(T::Array[::Integer]) } + def ids; end + + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped, + block: T.proc.params(object: PrivateRelation).void + ).void + end + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + cursor: T.untyped, + order: Symbol, + use_ranges: T.untyped + ).returns(::ActiveRecord::Batches::BatchEnumerator) + end + def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil, cursor: primary_key, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert!(attributes, returning: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def insert_all(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)) + ).returns(ActiveRecord::Result) + end + def insert_all!(attributes, returning: nil); end + + sig { returns(T.nilable(::UserRole)) } + sig { params(limit: Integer).returns(T::Array[::UserRole]) } + def last(limit = nil); end + + sig { returns(::UserRole) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::UserRole).returns(T.untyped))).returns(T::Boolean) } + def many?(&block); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def maximum(column_name); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def member?(record); end + + sig { params(column_name: T.any(String, Symbol)).returns(T.untyped) } + def minimum(column_name); end + + sig { params(block: T.nilable(T.proc.params(object: ::UserRole).void)).returns(::UserRole) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UserRole).void) + ).returns(T::Array[::UserRole]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::UserRole).void)).returns(::UserRole) } + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::UserRole).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::UserRole).returns(T.untyped))).returns(T::Boolean) } + def one?(&block); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pick(*column_names); end + + sig { params(column_names: T.untyped).returns(T.untyped) } + def pluck(*column_names); end + + sig { returns(T.nilable(::UserRole)) } + def second; end + + sig { returns(::UserRole) } + def second!; end + + sig { returns(T.nilable(::UserRole)) } + def second_to_last; end + + sig { returns(::UserRole) } + def second_to_last!; end + + sig { returns(::UserRole) } + def sole; end + + sig { params(initial_value_or_column: T.untyped).returns(T.any(Integer, Float, BigDecimal)) } + sig do + type_parameters(:U) + .params( + initial_value_or_column: T.nilable(T.type_parameter(:U)), + block: T.proc.params(object: ::UserRole).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::UserRole)) } + sig { params(limit: Integer).returns(T::Array[::UserRole]) } + def take(limit = nil); end + + sig { returns(::UserRole) } + def take!; end + + sig { returns(T.nilable(::UserRole)) } + def third; end + + sig { returns(::UserRole) } + def third!; end + + sig { returns(T.nilable(::UserRole)) } + def third_to_last; end + + sig { returns(::UserRole) } + def third_to_last!; end + + sig do + params( + attributes: Hash, + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert(attributes, returning: nil, unique_by: nil); end + + sig do + params( + attributes: T::Array[Hash], + returning: T.nilable(T.any(T::Array[Symbol], FalseClass)), + unique_by: T.nilable(T.any(T::Array[Symbol], Symbol)) + ).returns(ActiveRecord::Result) + end + def upsert_all(attributes, returning: nil, unique_by: nil); end + end + + module EnumMethodsModule + sig { void } + def admin!; end + + sig { returns(T::Boolean) } + def admin?; end + + sig { void } + def analyst!; end + + sig { returns(T::Boolean) } + def analyst?; end + + sig { void } + def reporter!; end + + sig { returns(T::Boolean) } + def reporter?; end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::User) } + def build_user(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::User) } + def create_user(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::User) } + def create_user!(*args, &blk); end + + sig { returns(T.nilable(::User)) } + def reload_user; end + + sig { void } + def reset_user; end + + sig { returns(T.nilable(::User)) } + def user; end + + sig { params(value: T.nilable(::User)).void } + def user=(value); end + + sig { returns(T::Boolean) } + def user_changed?; end + + sig { returns(T::Boolean) } + def user_previously_changed?; end + end + + module GeneratedAssociationRelationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def admin(*args, &blk); end + + sig { returns(PrivateAssociationRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def analyst(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateAssociationRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def not_admin(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def not_analyst(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def not_reporter(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reporter(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + sig { params(blk: T.proc.params(record: ::UserRole).returns(BasicObject)).returns(T::Array[::UserRole]) } + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateAssociationRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::Integer) } + def id; end + + sig { params(value: ::Integer).returns(::Integer) } + def id=(value); end + + sig { returns(T::Boolean) } + def id?; end + + sig { returns(T.nilable(::Integer)) } + def id_before_last_save; end + + sig { returns(T.untyped) } + def id_before_type_cast; end + + sig { returns(T::Boolean) } + def id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_previously_was; end + + sig { returns(::Integer) } + def id_value; end + + sig { params(value: ::Integer).returns(::Integer) } + def id_value=(value); end + + sig { returns(T::Boolean) } + def id_value?; end + + sig { returns(T.nilable(::Integer)) } + def id_value_before_last_save; end + + sig { returns(T.untyped) } + def id_value_before_type_cast; end + + sig { returns(T::Boolean) } + def id_value_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def id_value_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def id_value_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def id_value_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def id_value_was; end + + sig { void } + def id_value_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def id_was; end + + sig { void } + def id_will_change!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_role!; end + + sig { void } + def restore_user_id!; end + + sig { returns(::String) } + def role; end + + sig { params(value: T.any(::String, ::Symbol)).returns(T.any(::String, ::Symbol)) } + def role=(value); end + + sig { returns(T::Boolean) } + def role?; end + + sig { returns(T.nilable(::String)) } + def role_before_last_save; end + + sig { returns(T.untyped) } + def role_before_type_cast; end + + sig { returns(T::Boolean) } + def role_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def role_change; end + + sig { returns(T.nilable([::String, ::String])) } + def role_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def role_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def role_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def role_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def role_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def role_previously_was; end + + sig { returns(T.nilable(::String)) } + def role_was; end + + sig { void } + def role_will_change!; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_id_value; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_role; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_role?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_user_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_user_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(::Integer) } + def user_id; end + + sig { params(value: ::Integer).returns(::Integer) } + def user_id=(value); end + + sig { returns(T::Boolean) } + def user_id?; end + + sig { returns(T.nilable(::Integer)) } + def user_id_before_last_save; end + + sig { returns(T.untyped) } + def user_id_before_type_cast; end + + sig { returns(T::Boolean) } + def user_id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def user_id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def user_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def user_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def user_id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def user_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def user_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def user_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def user_id_was; end + + sig { void } + def user_id_will_change!; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_id_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_role?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_user_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + end + + module GeneratedRelationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def admin(*args, &blk); end + + sig { returns(PrivateRelation) } + def all; end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def analyst(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def and(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def annotate(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def arel_columns(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def create_with(*args, &blk); end + + sig { params(value: T::Boolean).returns(PrivateRelation) } + def distinct(value = true); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def eager_load(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def except(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def excluding(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def extending(*args, &blk); end + + sig { params(association: Symbol).returns(T::Array[T.untyped]) } + def extract_associated(association); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def from(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelationGroupChain) } + def group(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def having(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def in_order_of(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def includes(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def invert_where(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def left_outer_joins(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def limit(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def lock(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def merge(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def none(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def not_admin(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def not_analyst(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def not_reporter(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def null_relation?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def offset(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def optimizer_hints(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def or(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def preload(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def readonly(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def references(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def regroup(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reorder(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reporter(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reselect(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def reverse_order(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def rewhere(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + sig { params(blk: T.proc.params(record: ::UserRole).returns(BasicObject)).returns(T::Array[::UserRole]) } + def select(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def strict_loading(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def structurally_compatible?(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def uniq!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def unscope(*args, &blk); end + + sig { returns(PrivateRelationWhereChain) } + sig { params(args: T.untyped).returns(PrivateRelation) } + def where(*args); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def with_recursive(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::UserRole } } + + sig { returns(T::Array[::UserRole]) } + def to_a; end + + sig { returns(T::Array[::UserRole]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::UserRole } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateAssociationRelationWhereChain + Elem = type_member { { fixed: ::UserRole } } + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateAssociationRelation) } + def not(opts, *rest); end + end + + class PrivateCollectionProxy < ::ActiveRecord::Associations::CollectionProxy + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::UserRole } } + + sig do + params( + records: T.any(::UserRole, T::Enumerable[T.any(::UserRole, T::Enumerable[::UserRole])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::UserRole, T::Enumerable[T.any(::UserRole, T::Enumerable[::UserRole])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::UserRole, T::Enumerable[T.any(::UserRole, T::Enumerable[::UserRole])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig { returns(T::Array[::UserRole]) } + def load_target; end + + sig do + params( + records: T.any(::UserRole, T::Enumerable[T.any(::UserRole, T::Enumerable[::UserRole])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::UserRole, T::Enumerable[T.any(::UserRole, T::Enumerable[::UserRole])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::UserRole, T::Enumerable[T.any(::UserRole, T::Enumerable[::UserRole])]) + ).returns(T::Array[::UserRole]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::UserRole]) } + def target; end + + sig { returns(T::Array[::UserRole]) } + def to_a; end + + sig { returns(T::Array[::UserRole]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::UserRole } } + + sig { returns(T::Array[::UserRole]) } + def to_a; end + + sig { returns(T::Array[::UserRole]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::UserRole } } + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) } + def average(column_name); end + + sig do + params( + operation: Symbol, + column_name: T.any(String, Symbol) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def calculate(operation, column_name); end + + sig { params(column_name: T.untyped).returns(T::Hash[T.untyped, Integer]) } + def count(column_name = nil); end + + sig { params(args: T.untyped, blk: T.untyped).returns(T.self_type) } + def having(*args, &blk); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def maximum(column_name); end + + sig { params(column_name: T.any(String, Symbol)).returns(T::Hash[T.untyped, T.untyped]) } + def minimum(column_name); end + + sig { returns(T::Hash[T.untyped, Integer]) } + def size; end + + sig do + params( + column_name: T.nilable(T.any(String, Symbol)), + block: T.nilable(T.proc.params(record: T.untyped).returns(T.untyped)) + ).returns(T::Hash[T.untyped, T.any(Integer, Float, BigDecimal)]) + end + def sum(column_name = nil, &block); end + end + + class PrivateRelationWhereChain + Elem = type_member { { fixed: ::UserRole } } + + sig { params(args: T.untyped).returns(PrivateRelation) } + def associated(*args); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + def missing(*args); end + + sig { params(opts: T.untyped, rest: T.untyped).returns(PrivateRelation) } + def not(opts, *rest); end + end +end diff --git a/sorbet/rbi/dsl/view_component/base.rbi b/sorbet/rbi/dsl/view_component/base.rbi new file mode 100644 index 0000000..92d053f --- /dev/null +++ b/sorbet/rbi/dsl/view_component/base.rbi @@ -0,0 +1,11 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ViewComponent::Base`. +# Please instead update this file by running `bin/tapioca dsl ViewComponent::Base`. + + +class ViewComponent::Base + include GeneratedUrlHelpersModule + include GeneratedPathHelpersModule +end diff --git a/sorbet/rbi/dsl/view_component/preview.rbi b/sorbet/rbi/dsl/view_component/preview.rbi new file mode 100644 index 0000000..993ede2 --- /dev/null +++ b/sorbet/rbi/dsl/view_component/preview.rbi @@ -0,0 +1,11 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ViewComponent::Preview`. +# Please instead update this file by running `bin/tapioca dsl ViewComponent::Preview`. + + +class ViewComponent::Preview + include GeneratedUrlHelpersModule + include GeneratedPathHelpersModule +end diff --git a/sorbet/rbi/dsl/view_component/slotable.rbi b/sorbet/rbi/dsl/view_component/slotable.rbi new file mode 100644 index 0000000..b75def9 --- /dev/null +++ b/sorbet/rbi/dsl/view_component/slotable.rbi @@ -0,0 +1,24 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ViewComponent::Slotable`. +# Please instead update this file by running `bin/tapioca dsl ViewComponent::Slotable`. + + +module ViewComponent::Slotable + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def registered_slots; end + def registered_slots=(value); end + def registered_slots?; end + end + + module GeneratedInstanceMethods + def registered_slots; end + def registered_slots=(value); end + def registered_slots?; end + end +end diff --git a/sorbet/rbi/dsl/view_component/translatable.rbi b/sorbet/rbi/dsl/view_component/translatable.rbi new file mode 100644 index 0000000..0118ac1 --- /dev/null +++ b/sorbet/rbi/dsl/view_component/translatable.rbi @@ -0,0 +1,21 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ViewComponent::Translatable`. +# Please instead update this file by running `bin/tapioca dsl ViewComponent::Translatable`. + + +module ViewComponent::Translatable + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def __vc_i18n_backend; end + def __vc_i18n_backend=(value); end + end + + module GeneratedInstanceMethods + def __vc_i18n_backend; end + end +end diff --git a/sorbet/rbi/dsl/view_components_system_test_controller.rbi b/sorbet/rbi/dsl/view_components_system_test_controller.rbi new file mode 100644 index 0000000..d89328e --- /dev/null +++ b/sorbet/rbi/dsl/view_components_system_test_controller.rbi @@ -0,0 +1,35 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ViewComponentsSystemTestController`. +# Please instead update this file by running `bin/tapioca dsl ViewComponentsSystemTestController`. + + +class ViewComponentsSystemTestController + include GeneratedUrlHelpersModule + include GeneratedPathHelpersModule + + sig { returns(HelperProxy) } + def helpers; end + + module HelperMethods + include ::Turbo::DriveHelper + include ::Turbo::FramesHelper + include ::Turbo::IncludesHelper + include ::Turbo::StreamsHelper + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + include ::ActionView::Helpers::TagHelper + include ::Turbo::Streams::ActionHelper + include ::ActionText::ContentHelper + include ::ActionText::TagHelper + include ::Importmap::ImportmapTagsHelper + include ::ActionController::Base::HelperMethods + include ::ApplicationHelper + include ::FizzBuzzHelper + end + + class HelperProxy < ::ActionView::Base + include HelperMethods + end +end diff --git a/sorbet/rbi/gems/.gitattributes b/sorbet/rbi/gems/.gitattributes new file mode 100644 index 0000000..d9bb82a --- /dev/null +++ b/sorbet/rbi/gems/.gitattributes @@ -0,0 +1 @@ +**/*.rbi linguist-generated=true diff --git a/sorbet/rbi/gems/action_text-trix@2.1.15.rbi b/sorbet/rbi/gems/action_text-trix@2.1.15.rbi new file mode 100644 index 0000000..af0e707 --- /dev/null +++ b/sorbet/rbi/gems/action_text-trix@2.1.15.rbi @@ -0,0 +1,15 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `action_text-trix` gem. +# Please instead update this file by running `bin/tapioca gem action_text-trix`. + + +# source://action_text-trix//lib/action_text/trix/version.rb#1 +module Trix; end + +# source://action_text-trix//lib/action_text/trix/engine.rb#2 +class Trix::Engine < ::Rails::Engine; end + +# source://action_text-trix//lib/action_text/trix/version.rb#2 +Trix::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/actioncable@8.1.1.rbi b/sorbet/rbi/gems/actioncable@8.1.1.rbi new file mode 100644 index 0000000..4da3e13 --- /dev/null +++ b/sorbet/rbi/gems/actioncable@8.1.1.rbi @@ -0,0 +1,3168 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `actioncable` gem. +# Please instead update this file by running `bin/tapioca gem actioncable`. + + +# :markup: markdown +# :include: ../README.md +# +# source://actioncable//lib/action_cable.rb#54 +module ActionCable + private + + # Singleton instance of the server + # + # source://actioncable//lib/action_cable.rb#77 + def server; end + + class << self + # source://actioncable//lib/action_cable/deprecator.rb#6 + def deprecator; end + + # Returns the currently loaded version of Action Cable as a `Gem::Version`. + # + # source://actioncable//lib/action_cable/gem_version.rb#7 + def gem_version; end + + # Singleton instance of the server + # + # source://actioncable//lib/action_cable.rb#77 + def server; end + + # Returns the currently loaded version of Action Cable as a `Gem::Version`. + # + # source://actioncable//lib/action_cable/version.rb#9 + def version; end + end +end + +# source://actioncable//lib/action_cable/channel/base.rb#9 +module ActionCable::Channel; end + +# # Action Cable Channel Base +# +# The channel provides the basic structure of grouping behavior into logical +# units when communicating over the WebSocket connection. You can think of a +# channel like a form of controller, but one that's capable of pushing content +# to the subscriber in addition to simply responding to the subscriber's direct +# requests. +# +# Channel instances are long-lived. A channel object will be instantiated when +# the cable consumer becomes a subscriber, and then lives until the consumer +# disconnects. This may be seconds, minutes, hours, or even days. That means you +# have to take special care not to do anything silly in a channel that would +# balloon its memory footprint or whatever. The references are forever, so they +# won't be released as is normally the case with a controller instance that gets +# thrown away after every request. +# +# Long-lived channels (and connections) also mean you're responsible for +# ensuring that the data is fresh. If you hold a reference to a user record, but +# the name is changed while that reference is held, you may be sending stale +# data if you don't take precautions to avoid it. +# +# The upside of long-lived channel instances is that you can use instance +# variables to keep reference to objects that future subscriber requests can +# interact with. Here's a quick example: +# +# class ChatChannel < ApplicationCable::Channel +# def subscribed +# @room = Chat::Room[params[:room_number]] +# end +# +# def speak(data) +# @room.speak data, user: current_user +# end +# end +# +# The #speak action simply uses the Chat::Room object that was created when the +# channel was first subscribed to by the consumer when that subscriber wants to +# say something in the room. +# +# ## Action processing +# +# Unlike subclasses of ActionController::Base, channels do not follow a RESTful +# constraint form for their actions. Instead, Action Cable operates through a +# remote-procedure call model. You can declare any public method on the channel +# (optionally taking a `data` argument), and this method is automatically +# exposed as callable to the client. +# +# Example: +# +# class AppearanceChannel < ApplicationCable::Channel +# def subscribed +# @connection_token = generate_connection_token +# end +# +# def unsubscribed +# current_user.disappear @connection_token +# end +# +# def appear(data) +# current_user.appear @connection_token, on: data['appearing_on'] +# end +# +# def away +# current_user.away @connection_token +# end +# +# private +# def generate_connection_token +# SecureRandom.hex(36) +# end +# end +# +# In this example, the subscribed and unsubscribed methods are not callable +# methods, as they were already declared in ActionCable::Channel::Base, but +# `#appear` and `#away` are. `#generate_connection_token` is also not callable, +# since it's a private method. You'll see that appear accepts a data parameter, +# which it then uses as part of its model call. `#away` does not, since it's +# simply a trigger action. +# +# Also note that in this example, `current_user` is available because it was +# marked as an identifying attribute on the connection. All such identifiers +# will automatically create a delegation method of the same name on the channel +# instance. +# +# ## Rejecting subscription requests +# +# A channel can reject a subscription request in the #subscribed callback by +# invoking the #reject method: +# +# class ChatChannel < ApplicationCable::Channel +# def subscribed +# @room = Chat::Room[params[:room_number]] +# reject unless current_user.can_access?(@room) +# end +# end +# +# In this example, the subscription will be rejected if the `current_user` does +# not have access to the chat room. On the client-side, the `Channel#rejected` +# callback will get invoked when the server rejects the subscription request. +# +# source://actioncable//lib/action_cable/channel/base.rb#109 +class ActionCable::Channel::Base + include ::ActiveSupport::Callbacks + include ::ActionCable::Channel::Callbacks + include ::ActionCable::Channel::PeriodicTimers + include ::ActionCable::Channel::Streams + include ::ActionCable::Channel::Naming + include ::ActionCable::Channel::Broadcasting + include ::ActiveSupport::Rescuable + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::ActiveSupport::DescendantsTracker + extend ::ActionCable::Channel::Callbacks::ClassMethods + extend ::ActionCable::Channel::PeriodicTimers::ClassMethods + extend ::ActionCable::Channel::Naming::ClassMethods + extend ::ActionCable::Channel::Broadcasting::ClassMethods + extend ::ActiveSupport::Rescuable::ClassMethods + + # @return [Base] a new instance of Base + # + # source://actioncable//lib/action_cable/channel/base.rb#154 + def initialize(connection, identifier, params = T.unsafe(nil)); end + + # source://actioncable//lib/action_cable/channel/base.rb#110 + def __callbacks; end + + # source://actioncable//lib/action_cable/channel/base.rb#110 + def _run_subscribe_callbacks(&block); end + + # source://actioncable//lib/action_cable/channel/base.rb#110 + def _run_subscribe_callbacks!(&block); end + + # source://actioncable//lib/action_cable/channel/base.rb#110 + def _run_unsubscribe_callbacks(&block); end + + # source://actioncable//lib/action_cable/channel/base.rb#110 + def _run_unsubscribe_callbacks!(&block); end + + # source://actioncable//lib/action_cable/channel/base.rb#110 + def _subscribe_callbacks; end + + # source://actioncable//lib/action_cable/channel/base.rb#110 + def _unsubscribe_callbacks; end + + # Returns the value of attribute connection. + # + # source://actioncable//lib/action_cable/channel/base.rb#117 + def connection; end + + # Returns the value of attribute identifier. + # + # source://actioncable//lib/action_cable/channel/base.rb#117 + def identifier; end + + # source://actioncable//lib/action_cable/channel/base.rb#118 + def logger(*_arg0, **_arg1, &_arg2); end + + # Returns the value of attribute params. + # + # source://actioncable//lib/action_cable/channel/base.rb#117 + def params; end + + # Extract the action name from the passed data and process it via the channel. + # The process will ensure that the action requested is a public method on the + # channel declared by the user (so not one of the callbacks like #subscribed). + # + # source://actioncable//lib/action_cable/channel/base.rb#154 + def perform_action(data); end + + # source://actioncable//lib/action_cable/channel/base.rb#111 + def periodic_timers=(_arg0); end + + # source://actioncable//lib/action_cable/channel/base.rb#115 + def rescue_handlers; end + + # source://actioncable//lib/action_cable/channel/base.rb#115 + def rescue_handlers=(_arg0); end + + # source://actioncable//lib/action_cable/channel/base.rb#115 + def rescue_handlers?; end + + # This method is called after subscription has been added to the connection and + # confirms or rejects the subscription. + # + # source://actioncable//lib/action_cable/channel/base.rb#154 + def subscribe_to_channel; end + + # Called by the cable connection when it's cut, so the channel has a chance to + # cleanup with callbacks. This method is not intended to be called directly by + # the user. Instead, override the #unsubscribed callback. + # + # source://actioncable//lib/action_cable/channel/base.rb#154 + def unsubscribe_from_channel; end + + # @return [Boolean] + # + # source://actioncable//lib/action_cable/channel/base.rb#154 + def unsubscribed?; end + + private + + # source://actioncable//lib/action_cable/channel/base.rb#154 + def action_signature(action, data); end + + # source://actioncable//lib/action_cable/channel/base.rb#154 + def defer_subscription_confirmation!; end + + # @return [Boolean] + # + # source://actioncable//lib/action_cable/channel/base.rb#154 + def defer_subscription_confirmation?; end + + # source://actioncable//lib/action_cable/channel/base.rb#154 + def delegate_connection_identifiers; end + + # source://actioncable//lib/action_cable/channel/base.rb#154 + def dispatch_action(action, data); end + + # source://actioncable//lib/action_cable/channel/base.rb#154 + def ensure_confirmation_sent; end + + # source://actioncable//lib/action_cable/channel/base.rb#154 + def extract_action(data); end + + # source://actioncable//lib/action_cable/channel/base.rb#154 + def parameter_filter; end + + # @return [Boolean] + # + # source://actioncable//lib/action_cable/channel/base.rb#154 + def processable_action?(action); end + + # source://actioncable//lib/action_cable/channel/base.rb#154 + def reject; end + + # source://actioncable//lib/action_cable/channel/base.rb#154 + def reject_subscription; end + + # Called once a consumer has become a subscriber of the channel. Usually the + # place to set up any streams you want this channel to be sending to the + # subscriber. + # + # source://actioncable//lib/action_cable/channel/base.rb#154 + def subscribed; end + + # @return [Boolean] + # + # source://actioncable//lib/action_cable/channel/base.rb#154 + def subscription_confirmation_sent?; end + + # @return [Boolean] + # + # source://actioncable//lib/action_cable/channel/base.rb#154 + def subscription_rejected?; end + + # Transmit a hash of data to the subscriber. The hash will automatically be + # wrapped in a JSON envelope with the proper channel identifier marked as the + # recipient. + # + # source://actioncable//lib/action_cable/channel/base.rb#154 + def transmit(data, via: T.unsafe(nil)); end + + # source://actioncable//lib/action_cable/channel/base.rb#154 + def transmit_subscription_confirmation; end + + # source://actioncable//lib/action_cable/channel/base.rb#154 + def transmit_subscription_rejection; end + + # Called once a consumer has cut its cable connection. Can be used for cleaning + # up connections or marking users as offline or the like. + # + # source://actioncable//lib/action_cable/channel/base.rb#154 + def unsubscribed; end + + class << self + # source://actioncable//lib/action_cable/channel/base.rb#110 + def __callbacks; end + + # source://actioncable//lib/action_cable/channel/base.rb#110 + def __callbacks=(value); end + + # source://actioncable//lib/action_cable/channel/base.rb#110 + def _subscribe_callbacks; end + + # source://actioncable//lib/action_cable/channel/base.rb#110 + def _subscribe_callbacks=(value); end + + # source://actioncable//lib/action_cable/channel/base.rb#110 + def _unsubscribe_callbacks; end + + # source://actioncable//lib/action_cable/channel/base.rb#110 + def _unsubscribe_callbacks=(value); end + + # A list of method names that should be considered actions. This includes all + # public instance methods on a channel, less any internal methods (defined on + # Base), adding back in any methods that are internal, but still exist on the + # class itself. + # + # #### Returns + # * `Set` - A set of all methods that should be considered actions. + # + # source://actioncable//lib/action_cable/channel/base.rb#128 + def action_methods; end + + # source://actioncable//lib/action_cable/channel/base.rb#111 + def periodic_timers; end + + # source://actioncable//lib/action_cable/channel/base.rb#111 + def periodic_timers=(value); end + + # source://actioncable//lib/action_cable/channel/base.rb#111 + def periodic_timers?; end + + # source://actioncable//lib/action_cable/channel/base.rb#115 + def rescue_handlers; end + + # source://actioncable//lib/action_cable/channel/base.rb#115 + def rescue_handlers=(value); end + + # source://actioncable//lib/action_cable/channel/base.rb#115 + def rescue_handlers?; end + + private + + # source://actioncable//lib/action_cable/channel/base.rb#110 + def __class_attr___callbacks; end + + # source://actioncable//lib/action_cable/channel/base.rb#110 + def __class_attr___callbacks=(new_value); end + + # source://actioncable//lib/action_cable/channel/base.rb#111 + def __class_attr_periodic_timers; end + + # source://actioncable//lib/action_cable/channel/base.rb#111 + def __class_attr_periodic_timers=(new_value); end + + # source://actioncable//lib/action_cable/channel/base.rb#115 + def __class_attr_rescue_handlers; end + + # source://actioncable//lib/action_cable/channel/base.rb#115 + def __class_attr_rescue_handlers=(new_value); end + + # action_methods are cached and there is sometimes need to refresh them. + # ::clear_action_methods! allows you to do that, so next time you run + # action_methods, they will be recalculated. + # + # source://actioncable//lib/action_cable/channel/base.rb#148 + def clear_action_methods!; end + + # source://actioncable//lib/action_cable/channel/base.rb#158 + def internal_methods; end + + # Refresh the cached action_methods when a new action_method is added. + # + # source://actioncable//lib/action_cable/channel/base.rb#153 + def method_added(name); end + end +end + +# source://actioncable//lib/action_cable/channel/broadcasting.rb#9 +module ActionCable::Channel::Broadcasting + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionCable::Channel::Broadcasting::ClassMethods + + # source://actioncable//lib/action_cable/channel/broadcasting.rb#45 + def broadcast_to(model, message); end + + # source://actioncable//lib/action_cable/channel/broadcasting.rb#41 + def broadcasting_for(model); end +end + +# source://actioncable//lib/action_cable/channel/broadcasting.rb#12 +module ActionCable::Channel::Broadcasting::ClassMethods + # Broadcast a hash to a unique broadcasting for this array of `broadcastables` in this channel. + # + # source://actioncable//lib/action_cable/channel/broadcasting.rb#14 + def broadcast_to(broadcastables, message); end + + # Returns a unique broadcasting identifier for this `model` in this channel: + # + # CommentsChannel.broadcasting_for("all") # => "comments:all" + # + # You can pass an array of objects as a target (e.g. Active Record model), and it would + # be serialized into a string under the hood. + # + # source://actioncable//lib/action_cable/channel/broadcasting.rb#24 + def broadcasting_for(broadcastables); end + + private + + # source://actioncable//lib/action_cable/channel/broadcasting.rb#29 + def serialize_broadcasting(object); end +end + +# # Action Cable Channel Callbacks +# +# Action Cable Channel provides callback hooks that are invoked during the life +# cycle of a channel: +# +# * [before_subscribe](rdoc-ref:ClassMethods#before_subscribe) +# * [after_subscribe](rdoc-ref:ClassMethods#after_subscribe) (aliased as +# [on_subscribe](rdoc-ref:ClassMethods#on_subscribe)) +# * [before_unsubscribe](rdoc-ref:ClassMethods#before_unsubscribe) +# * [after_unsubscribe](rdoc-ref:ClassMethods#after_unsubscribe) (aliased as +# [on_unsubscribe](rdoc-ref:ClassMethods#on_unsubscribe)) +# +# +# #### Example +# +# class ChatChannel < ApplicationCable::Channel +# after_subscribe :send_welcome_message, unless: :subscription_rejected? +# after_subscribe :track_subscription +# +# private +# def send_welcome_message +# broadcast_to(...) +# end +# +# def track_subscription +# # ... +# end +# end +# +# source://actioncable//lib/action_cable/channel/callbacks.rb#38 +module ActionCable::Channel::Callbacks + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActiveSupport::Callbacks + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods + mixes_in_class_methods ::ActiveSupport::DescendantsTracker + mixes_in_class_methods ::ActionCable::Channel::Callbacks::ClassMethods + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + end + + module GeneratedInstanceMethods + def __callbacks; end + end +end + +# source://actioncable//lib/action_cable/channel/callbacks.rb#49 +module ActionCable::Channel::Callbacks::ClassMethods + # This callback will be triggered after the Base#subscribed method is called, + # even if the subscription was rejected with the Base#reject method. + # + # To trigger the callback only on successful subscriptions, use the + # Base#subscription_rejected? method: + # + # after_subscribe :my_method, unless: :subscription_rejected? + # + # source://actioncable//lib/action_cable/channel/callbacks.rb#62 + def after_subscribe(*methods, &block); end + + # source://actioncable//lib/action_cable/channel/callbacks.rb#71 + def after_unsubscribe(*methods, &block); end + + # source://actioncable//lib/action_cable/channel/callbacks.rb#50 + def before_subscribe(*methods, &block); end + + # source://actioncable//lib/action_cable/channel/callbacks.rb#67 + def before_unsubscribe(*methods, &block); end + + # This callback will be triggered after the Base#subscribed method is called, + # even if the subscription was rejected with the Base#reject method. + # + # To trigger the callback only on successful subscriptions, use the + # Base#subscription_rejected? method: + # + # after_subscribe :my_method, unless: :subscription_rejected? + # + # source://actioncable//lib/action_cable/channel/callbacks.rb#65 + def on_subscribe(*methods, &block); end + + # source://actioncable//lib/action_cable/channel/callbacks.rb#74 + def on_unsubscribe(*methods, &block); end + + private + + # source://actioncable//lib/action_cable/channel/callbacks.rb#77 + def internal_methods; end +end + +# source://actioncable//lib/action_cable/channel/callbacks.rb#42 +ActionCable::Channel::Callbacks::INTERNAL_METHODS = T.let(T.unsafe(nil), Array) + +# # Action Cable Channel Stub +# +# Stub `stream_from` to track streams for the channel. Add public aliases for +# `subscription_confirmation_sent?` and `subscription_rejected?`. +# +# source://actioncable//lib/action_cable/channel/test_case.rb#24 +module ActionCable::Channel::ChannelStub + # @return [Boolean] + # + # source://actioncable//lib/action_cable/channel/test_case.rb#25 + def confirmed?; end + + # @return [Boolean] + # + # source://actioncable//lib/action_cable/channel/test_case.rb#29 + def rejected?; end + + # Make periodic timers no-op + # + # source://actioncable//lib/action_cable/channel/test_case.rb#46 + def start_periodic_timers; end + + # source://actioncable//lib/action_cable/channel/test_case.rb#37 + def stop_all_streams; end + + # Make periodic timers no-op + # + # source://actioncable//lib/action_cable/channel/test_case.rb#47 + def stop_periodic_timers; end + + # source://actioncable//lib/action_cable/channel/test_case.rb#33 + def stream_from(broadcasting, *_arg1); end + + # source://actioncable//lib/action_cable/channel/test_case.rb#41 + def streams; end +end + +# source://actioncable//lib/action_cable/channel/test_case.rb#50 +class ActionCable::Channel::ConnectionStub + # @return [ConnectionStub] a new instance of ConnectionStub + # + # source://actioncable//lib/action_cable/channel/test_case.rb#55 + def initialize(identifiers = T.unsafe(nil)); end + + # source://actioncable//lib/action_cable/channel/test_case.rb#53 + def config(*_arg0, **_arg1, &_arg2); end + + # source://actioncable//lib/action_cable/channel/test_case.rb#72 + def connection_identifier; end + + # Returns the value of attribute identifiers. + # + # source://actioncable//lib/action_cable/channel/test_case.rb#51 + def identifiers; end + + # Returns the value of attribute logger. + # + # source://actioncable//lib/action_cable/channel/test_case.rb#51 + def logger; end + + # source://actioncable//lib/action_cable/channel/test_case.rb#53 + def pubsub(*_arg0, **_arg1, &_arg2); end + + # Returns the value of attribute server. + # + # source://actioncable//lib/action_cable/channel/test_case.rb#51 + def server; end + + # Returns the value of attribute subscriptions. + # + # source://actioncable//lib/action_cable/channel/test_case.rb#51 + def subscriptions; end + + # Returns the value of attribute transmissions. + # + # source://actioncable//lib/action_cable/channel/test_case.rb#51 + def transmissions; end + + # source://actioncable//lib/action_cable/channel/test_case.rb#68 + def transmit(cable_message); end + + private + + # source://actioncable//lib/action_cable/channel/test_case.rb#77 + def connection_gid(ids); end +end + +# source://actioncable//lib/action_cable/channel/naming.rb#7 +module ActionCable::Channel::Naming + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionCable::Channel::Naming::ClassMethods + + # source://actioncable//lib/action_cable/channel/naming.rb#23 + def channel_name; end +end + +# source://actioncable//lib/action_cable/channel/naming.rb#10 +module ActionCable::Channel::Naming::ClassMethods + # Returns the name of the channel, underscored, without the `Channel` ending. If + # the channel is in a namespace, then the namespaces are represented by single + # colon separators in the channel name. + # + # ChatChannel.channel_name # => 'chat' + # Chats::AppearancesChannel.channel_name # => 'chats:appearances' + # FooChats::BarAppearancesChannel.channel_name # => 'foo_chats:bar_appearances' + # + # source://actioncable//lib/action_cable/channel/naming.rb#18 + def channel_name; end +end + +# source://actioncable//lib/action_cable/channel/test_case.rb#12 +class ActionCable::Channel::NonInferrableChannelError < ::StandardError + # @return [NonInferrableChannelError] a new instance of NonInferrableChannelError + # + # source://actioncable//lib/action_cable/channel/test_case.rb#13 + def initialize(name); end +end + +# source://actioncable//lib/action_cable/channel/periodic_timers.rb#7 +module ActionCable::Channel::PeriodicTimers + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionCable::Channel::PeriodicTimers::ClassMethods + + private + + # source://actioncable//lib/action_cable/channel/periodic_timers.rb#56 + def active_periodic_timers; end + + # source://actioncable//lib/action_cable/channel/periodic_timers.rb#66 + def start_periodic_timer(callback, every:); end + + # source://actioncable//lib/action_cable/channel/periodic_timers.rb#60 + def start_periodic_timers; end + + # source://actioncable//lib/action_cable/channel/periodic_timers.rb#72 + def stop_periodic_timers; end + + module GeneratedClassMethods + def periodic_timers; end + def periodic_timers=(value); end + def periodic_timers?; end + end + + module GeneratedInstanceMethods + def periodic_timers=(value); end + end +end + +# source://actioncable//lib/action_cable/channel/periodic_timers.rb#17 +module ActionCable::Channel::PeriodicTimers::ClassMethods + # Periodically performs a task on the channel, like updating an online user + # counter, polling a backend for new status messages, sending regular + # "heartbeat" messages, or doing some internal work and giving progress updates. + # + # Pass a method name or lambda argument or provide a block to call. Specify the + # calling period in seconds using the `every:` keyword argument. + # + # periodically :transmit_progress, every: 5.seconds + # + # periodically every: 3.minutes do + # transmit action: :update_count, count: current_count + # end + # + # source://actioncable//lib/action_cable/channel/periodic_timers.rb#31 + def periodically(callback_or_method_name = T.unsafe(nil), every:, &block); end +end + +# # Action Cable Channel Streams +# +# Streams allow channels to route broadcastings to the subscriber. A +# broadcasting is, as discussed elsewhere, a pubsub queue where any data placed +# into it is automatically sent to the clients that are connected at that time. +# It's purely an online queue, though. If you're not streaming a broadcasting at +# the very moment it sends out an update, you will not get that update, even if +# you connect after it has been sent. +# +# Most commonly, the streamed broadcast is sent straight to the subscriber on +# the client-side. The channel just acts as a connector between the two parties +# (the broadcaster and the channel subscriber). Here's an example of a channel +# that allows subscribers to get all new comments on a given page: +# +# class CommentsChannel < ApplicationCable::Channel +# def follow(data) +# stream_from "comments_for_#{data['recording_id']}" +# end +# +# def unfollow +# stop_all_streams +# end +# end +# +# Based on the above example, the subscribers of this channel will get whatever +# data is put into the, let's say, `comments_for_45` broadcasting as soon as +# it's put there. +# +# An example broadcasting for this channel looks like so: +# +# ActionCable.server.broadcast "comments_for_45", { author: 'DHH', content: 'Rails is just swell' } +# +# If you have a stream that is related to a model, then the broadcasting used +# can be generated from the model and channel. The following example would +# subscribe to a broadcasting like `comments:Z2lkOi8vVGVzdEFwcC9Qb3N0LzE`. +# +# class CommentsChannel < ApplicationCable::Channel +# def subscribed +# post = Post.find(params[:id]) +# stream_for post +# end +# end +# +# You can then broadcast to this channel using: +# +# CommentsChannel.broadcast_to(@post, @comment) +# +# If you don't just want to parlay the broadcast unfiltered to the subscriber, +# you can also supply a callback that lets you alter what is sent out. The below +# example shows how you can use this to provide performance introspection in the +# process: +# +# class ChatChannel < ApplicationCable::Channel +# def subscribed +# @room = Chat::Room[params[:room_number]] +# +# stream_for @room, coder: ActiveSupport::JSON do |message| +# if message['originated_at'].present? +# elapsed_time = (Time.now.to_f - message['originated_at']).round(2) +# +# ActiveSupport::Notifications.instrument :performance, measurement: 'Chat.message_delay', value: elapsed_time, action: :timing +# logger.info "Message took #{elapsed_time}s to arrive" +# end +# +# transmit message +# end +# end +# end +# +# You can stop streaming from all broadcasts by calling #stop_all_streams. +# +# source://actioncable//lib/action_cable/channel/streams.rb#77 +module ActionCable::Channel::Streams + extend ::ActiveSupport::Concern + + # source://actioncable//lib/action_cable/channel/streams.rb#155 + def pubsub(*_arg0, **_arg1, &_arg2); end + + # Unsubscribes all streams associated with this channel from the pubsub queue. + # + # source://actioncable//lib/action_cable/channel/streams.rb#137 + def stop_all_streams; end + + # Unsubscribes streams for the `model`. + # + # source://actioncable//lib/action_cable/channel/streams.rb#132 + def stop_stream_for(model); end + + # Unsubscribes streams from the named `broadcasting`. + # + # source://actioncable//lib/action_cable/channel/streams.rb#123 + def stop_stream_from(broadcasting); end + + # Start streaming the pubsub queue for the `broadcastables` in this channel. Optionally, + # you can pass a `callback` that'll be used instead of the default of just + # transmitting the updates straight to the subscriber. + # + # Pass `coder: ActiveSupport::JSON` to decode messages as JSON before passing to + # the callback. Defaults to `coder: nil` which does no decoding, passes raw + # messages. + # + # source://actioncable//lib/action_cable/channel/streams.rb#118 + def stream_for(broadcastables, callback = T.unsafe(nil), coder: T.unsafe(nil), &block); end + + # Start streaming from the named `broadcasting` pubsub queue. Optionally, you + # can pass a `callback` that'll be used instead of the default of just + # transmitting the updates straight to the subscriber. Pass `coder: + # ActiveSupport::JSON` to decode messages as JSON before passing to the + # callback. Defaults to `coder: nil` which does no decoding, passes raw + # messages. + # + # source://actioncable//lib/action_cable/channel/streams.rb#90 + def stream_from(broadcasting, callback = T.unsafe(nil), coder: T.unsafe(nil), &block); end + + # Calls stream_for with the given `model` if it's present to start streaming, + # otherwise rejects the subscription. + # + # source://actioncable//lib/action_cable/channel/streams.rb#146 + def stream_or_reject_for(model); end + + private + + # May be overridden to change the default stream handling behavior which decodes + # JSON and transmits to the client. + # + # TODO: Tests demonstrating this. + # + # TODO: Room for optimization. Update transmit API to be coder-aware so we can + # no-op when pubsub and connection are both JSON-encoded. Then we can skip + # decode+encode if we're just proxying messages. + # + # source://actioncable//lib/action_cable/channel/streams.rb#191 + def default_stream_handler(broadcasting, coder:); end + + # source://actioncable//lib/action_cable/channel/streams.rb#212 + def identity_handler; end + + # source://actioncable//lib/action_cable/channel/streams.rb#196 + def stream_decoder(handler = T.unsafe(nil), coder:); end + + # May be overridden to add instrumentation, logging, specialized error handling, + # or other forms of handler decoration. + # + # TODO: Tests demonstrating this. + # + # source://actioncable//lib/action_cable/channel/streams.rb#175 + def stream_handler(broadcasting, user_handler, coder: T.unsafe(nil)); end + + # source://actioncable//lib/action_cable/channel/streams.rb#204 + def stream_transmitter(handler = T.unsafe(nil), broadcasting:); end + + # source://actioncable//lib/action_cable/channel/streams.rb#157 + def streams; end + + # Always wrap the outermost handler to invoke the user handler on the worker + # pool rather than blocking the event loop. + # + # source://actioncable//lib/action_cable/channel/streams.rb#163 + def worker_pool_stream_handler(broadcasting, user_handler, coder: T.unsafe(nil)); end +end + +# Superclass for Action Cable channel functional tests. +# +# ## Basic example +# +# Functional tests are written as follows: +# 1. First, one uses the `subscribe` method to simulate subscription creation. +# 2. Then, one asserts whether the current state is as expected. "State" can be +# anything: transmitted messages, subscribed streams, etc. +# +# +# For example: +# +# class ChatChannelTest < ActionCable::Channel::TestCase +# def test_subscribed_with_room_number +# # Simulate a subscription creation +# subscribe room_number: 1 +# +# # Asserts that the subscription was successfully created +# assert subscription.confirmed? +# +# # Asserts that the channel subscribes connection to a stream +# assert_has_stream "chat_1" +# +# # Asserts that the channel subscribes connection to a specific +# # stream created for a model +# assert_has_stream_for Room.find(1) +# end +# +# def test_does_not_stream_with_incorrect_room_number +# subscribe room_number: -1 +# +# # Asserts that not streams was started +# assert_no_streams +# end +# +# def test_does_not_subscribe_without_room_number +# subscribe +# +# # Asserts that the subscription was rejected +# assert subscription.rejected? +# end +# end +# +# You can also perform actions: +# def test_perform_speak +# subscribe room_number: 1 +# +# perform :speak, message: "Hello, Rails!" +# +# assert_equal "Hello, Rails!", transmissions.last["text"] +# end +# +# ## Special methods +# +# ActionCable::Channel::TestCase will also automatically provide the following +# instance methods for use in the tests: +# +# connection +# connection. +# +# subscription +# +# transmissions +# +# +# ## Channel is automatically inferred +# +# ActionCable::Channel::TestCase will automatically infer the channel under test +# from the test class name. If the channel cannot be inferred from the test +# class name, you can explicitly set it with `tests`. +# +# class SpecialEdgeCaseChannelTest < ActionCable::Channel::TestCase +# tests SpecialChannel +# end +# +# ## Specifying connection identifiers +# +# You need to set up your connection manually to provide values for the +# identifiers. To do this just use: +# +# stub_connection(user: users(:john)) +# +# ## Testing broadcasting +# +# ActionCable::Channel::TestCase enhances ActionCable::TestHelper assertions +# (e.g. `assert_broadcasts`) to handle broadcasting to models: +# +# # in your channel +# def speak(data) +# broadcast_to room, text: data["message"] +# end +# +# def test_speak +# subscribe room_id: rooms(:chat).id +# +# assert_broadcast_on(rooms(:chat), text: "Hello, Rails!") do +# perform :speak, message: "Hello, Rails!" +# end +# end +# +# source://actioncable//lib/action_cable/channel/test_case.rb#190 +class ActionCable::Channel::TestCase < ::ActiveSupport::TestCase + include ::ActiveSupport::Testing::ConstantLookup + include ::ActionCable::Channel::TestCase::Behavior + extend ::ActiveSupport::Testing::ConstantLookup::ClassMethods + extend ::ActionCable::Channel::TestCase::Behavior::ClassMethods + + # source://actioncable//lib/action_cable/channel/test_case.rb#200 + def _channel_class; end + + # source://actioncable//lib/action_cable/channel/test_case.rb#200 + def _channel_class=(_arg0); end + + # source://actioncable//lib/action_cable/channel/test_case.rb#200 + def _channel_class?; end + + # source://actioncable//lib/action_cable/channel/test_case.rb#202 + def connection; end + + # source://actioncable//lib/action_cable/channel/test_case.rb#202 + def subscription; end + + class << self + # source://actioncable//lib/action_cable/channel/test_case.rb#200 + def _channel_class; end + + # source://actioncable//lib/action_cable/channel/test_case.rb#200 + def _channel_class=(value); end + + # source://actioncable//lib/action_cable/channel/test_case.rb#200 + def _channel_class?; end + + private + + # source://actioncable//lib/action_cable/channel/test_case.rb#200 + def __class_attr__channel_class; end + + # source://actioncable//lib/action_cable/channel/test_case.rb#200 + def __class_attr__channel_class=(new_value); end + end +end + +# source://actioncable//lib/action_cable/channel/test_case.rb#191 +module ActionCable::Channel::TestCase::Behavior + include ::ActionCable::TestHelper + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActiveSupport::Testing::ConstantLookup + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveSupport::Testing::ConstantLookup::ClassMethods + mixes_in_class_methods ::ActionCable::Channel::TestCase::Behavior::ClassMethods + + # source://actioncable//lib/action_cable/channel/test_case.rb#282 + def assert_broadcast_on(stream_or_object, *args); end + + # Enhance TestHelper assertions to handle non-String broadcastings + # + # source://actioncable//lib/action_cable/channel/test_case.rb#278 + def assert_broadcasts(stream_or_object, *args); end + + # Asserts that the specified stream has not been started. + # + # def test_assert_no_started_stream + # subscribe + # assert_has_no_stream 'messages' + # end + # + # source://actioncable//lib/action_cable/channel/test_case.rb#326 + def assert_has_no_stream(stream); end + + # Asserts that the specified stream for a model has not started. + # + # def test_assert_no_started_stream_for + # subscribe id: 41 + # assert_has_no_stream_for User.find(42) + # end + # + # source://actioncable//lib/action_cable/channel/test_case.rb#337 + def assert_has_no_stream_for(object); end + + # Asserts that the specified stream has been started. + # + # def test_assert_started_stream + # subscribe + # assert_has_stream 'messages' + # end + # + # source://actioncable//lib/action_cable/channel/test_case.rb#304 + def assert_has_stream(stream); end + + # Asserts that the specified stream for a model has started. + # + # def test_assert_started_stream_for + # subscribe id: 42 + # assert_has_stream_for User.find(42) + # end + # + # source://actioncable//lib/action_cable/channel/test_case.rb#315 + def assert_has_stream_for(object); end + + # Asserts that no streams have been started. + # + # def test_assert_no_started_stream + # subscribe + # assert_no_streams + # end + # + # source://actioncable//lib/action_cable/channel/test_case.rb#293 + def assert_no_streams; end + + # Perform action on a channel. + # + # NOTE: Must be subscribed. + # + # source://actioncable//lib/action_cable/channel/test_case.rb#266 + def perform(action, data = T.unsafe(nil)); end + + # Set up test connection with the specified identifiers: + # + # class ApplicationCable < ActionCable::Connection::Base + # identified_by :user, :token + # end + # + # stub_connection(user: users[:john], token: 'my-secret-token') + # + # source://actioncable//lib/action_cable/channel/test_case.rb#243 + def stub_connection(identifiers = T.unsafe(nil)); end + + # Subscribe to the channel under test. Optionally pass subscription parameters + # as a Hash. + # + # source://actioncable//lib/action_cable/channel/test_case.rb#249 + def subscribe(params = T.unsafe(nil)); end + + # Returns messages transmitted into channel + # + # source://actioncable//lib/action_cable/channel/test_case.rb#272 + def transmissions; end + + # Unsubscribe the subscription under test. + # + # source://actioncable//lib/action_cable/channel/test_case.rb#258 + def unsubscribe; end + + private + + # source://actioncable//lib/action_cable/channel/test_case.rb#346 + def broadcasting_for(stream_or_object); end + + # source://actioncable//lib/action_cable/channel/test_case.rb#342 + def check_subscribed!; end + + module GeneratedClassMethods + def _channel_class; end + def _channel_class=(value); end + def _channel_class?; end + end + + module GeneratedInstanceMethods + def _channel_class; end + def _channel_class=(value); end + def _channel_class?; end + end +end + +# source://actioncable//lib/action_cable/channel/test_case.rb#197 +ActionCable::Channel::TestCase::Behavior::CHANNEL_IDENTIFIER = T.let(T.unsafe(nil), String) + +# source://actioncable//lib/action_cable/channel/test_case.rb#207 +module ActionCable::Channel::TestCase::Behavior::ClassMethods + # source://actioncable//lib/action_cable/channel/test_case.rb#219 + def channel_class; end + + # @raise [NonInferrableChannelError] + # + # source://actioncable//lib/action_cable/channel/test_case.rb#227 + def determine_default_channel(name); end + + # source://actioncable//lib/action_cable/channel/test_case.rb#208 + def tests(channel); end +end + +# source://actioncable//lib/action_cable/connection/identification.rb#6 +module ActionCable::Connection; end + +# source://actioncable//lib/action_cable/connection/test_case.rb#22 +module ActionCable::Connection::Assertions + # Asserts that the connection is rejected (via + # `reject_unauthorized_connection`). + # + # # Asserts that connection without user_id fails + # assert_reject_connection { connect params: { user_id: '' } } + # + # source://actioncable//lib/action_cable/connection/test_case.rb#28 + def assert_reject_connection(&block); end +end + +# source://actioncable//lib/action_cable/connection/authorization.rb#7 +module ActionCable::Connection::Authorization + # Closes the WebSocket connection if it is open and returns an "unauthorized" + # reason. + # + # @raise [UnauthorizedError] + # + # source://actioncable//lib/action_cable/connection/authorization.rb#12 + def reject_unauthorized_connection; end +end + +# source://actioncable//lib/action_cable/connection/authorization.rb#8 +class ActionCable::Connection::Authorization::UnauthorizedError < ::StandardError; end + +# # Action Cable Connection Base +# +# For every WebSocket connection the Action Cable server accepts, a Connection +# object will be instantiated. This instance becomes the parent of all of the +# channel subscriptions that are created from there on. Incoming messages are +# then routed to these channel subscriptions based on an identifier sent by the +# Action Cable consumer. The Connection itself does not deal with any specific +# application logic beyond authentication and authorization. +# +# Here's a basic example: +# +# module ApplicationCable +# class Connection < ActionCable::Connection::Base +# identified_by :current_user +# +# def connect +# self.current_user = find_verified_user +# logger.add_tags current_user.name +# end +# +# def disconnect +# # Any cleanup work needed when the cable connection is cut. +# end +# +# private +# def find_verified_user +# User.find_by_identity(cookies.encrypted[:identity_id]) || +# reject_unauthorized_connection +# end +# end +# end +# +# First, we declare that this connection can be identified by its current_user. +# This allows us to later be able to find all connections established for that +# current_user (and potentially disconnect them). You can declare as many +# identification indexes as you like. Declaring an identification means that an +# attr_accessor is automatically set for that key. +# +# Second, we rely on the fact that the WebSocket connection is established with +# the cookies from the domain being sent along. This makes it easy to use signed +# cookies that were set when logging in via a web interface to authorize the +# WebSocket connection. +# +# Finally, we add a tag to the connection-specific logger with the name of the +# current user to easily distinguish their messages in the log. +# +# Pretty simple, eh? +# +# source://actioncable//lib/action_cable/connection/base.rb#57 +class ActionCable::Connection::Base + include ::ActionCable::Connection::Identification + include ::ActionCable::Connection::InternalChannel + include ::ActionCable::Connection::Authorization + include ::ActiveSupport::Callbacks + include ::ActionCable::Connection::Callbacks + include ::ActiveSupport::Rescuable + extend ::ActionCable::Connection::Identification::ClassMethods + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::ActiveSupport::DescendantsTracker + extend ::ActionCable::Connection::Callbacks::ClassMethods + extend ::ActiveSupport::Rescuable::ClassMethods + + # @return [Base] a new instance of Base + # + # source://actioncable//lib/action_cable/connection/base.rb#67 + def initialize(server, env, coder: T.unsafe(nil)); end + + # source://actioncable//lib/action_cable/connection/base.rb#61 + def __callbacks; end + + # source://actioncable//lib/action_cable/connection/base.rb#61 + def _command_callbacks; end + + # source://actioncable//lib/action_cable/connection/base.rb#61 + def _run_command_callbacks; end + + # source://actioncable//lib/action_cable/connection/base.rb#61 + def _run_command_callbacks!(&block); end + + # source://actioncable//lib/action_cable/connection/base.rb#147 + def beat; end + + # Close the WebSocket connection. + # + # source://actioncable//lib/action_cable/connection/base.rb#120 + def close(reason: T.unsafe(nil), reconnect: T.unsafe(nil)); end + + # source://actioncable//lib/action_cable/connection/base.rb#65 + def config(*_arg0, **_arg1, &_arg2); end + + # source://actioncable//lib/action_cable/connection/base.rb#101 + def dispatch_websocket_message(websocket_message); end + + # Returns the value of attribute env. + # + # source://actioncable//lib/action_cable/connection/base.rb#64 + def env; end + + # source://actioncable//lib/action_cable/connection/base.rb#65 + def event_loop(*_arg0, **_arg1, &_arg2); end + + # source://actioncable//lib/action_cable/connection/base.rb#109 + def handle_channel_command(payload); end + + # source://actioncable//lib/action_cable/connection/base.rb#58 + def identifiers; end + + # source://actioncable//lib/action_cable/connection/base.rb#58 + def identifiers=(_arg0); end + + # source://actioncable//lib/action_cable/connection/base.rb#58 + def identifiers?; end + + # source://actioncable//lib/action_cable/connection/base.rb#168 + def inspect; end + + # Returns the value of attribute logger. + # + # source://actioncable//lib/action_cable/connection/base.rb#64 + def logger; end + + # source://actioncable//lib/action_cable/connection/base.rb#164 + def on_close(reason, code); end + + # source://actioncable//lib/action_cable/connection/base.rb#159 + def on_error(message); end + + # source://actioncable//lib/action_cable/connection/base.rb#155 + def on_message(message); end + + # source://actioncable//lib/action_cable/connection/base.rb#151 + def on_open; end + + # Called by the server when a new WebSocket connection is established. This + # configures the callbacks intended for overwriting by the user. This method + # should not be called directly -- instead rely upon on the #connect (and + # #disconnect) callbacks. + # + # source://actioncable//lib/action_cable/connection/base.rb#85 + def process; end + + # Returns the value of attribute protocol. + # + # source://actioncable//lib/action_cable/connection/base.rb#64 + def protocol; end + + # source://actioncable//lib/action_cable/connection/base.rb#65 + def pubsub(*_arg0, **_arg1, &_arg2); end + + # Decodes WebSocket messages and dispatches them to subscribed channels. + # WebSocket message transfer encoding is always JSON. + # + # source://actioncable//lib/action_cable/connection/base.rb#97 + def receive(websocket_message); end + + # source://actioncable//lib/action_cable/connection/base.rb#62 + def rescue_handlers; end + + # source://actioncable//lib/action_cable/connection/base.rb#62 + def rescue_handlers=(_arg0); end + + # source://actioncable//lib/action_cable/connection/base.rb#62 + def rescue_handlers?; end + + # Invoke a method on the connection asynchronously through the pool of thread + # workers. + # + # source://actioncable//lib/action_cable/connection/base.rb#131 + def send_async(method, *arguments); end + + # Returns the value of attribute server. + # + # source://actioncable//lib/action_cable/connection/base.rb#64 + def server; end + + # Return a basic hash of statistics for the connection keyed with `identifier`, + # `started_at`, `subscriptions`, and `request_id`. This can be returned by a + # health check against the connection. + # + # source://actioncable//lib/action_cable/connection/base.rb#138 + def statistics; end + + # Returns the value of attribute subscriptions. + # + # source://actioncable//lib/action_cable/connection/base.rb#64 + def subscriptions; end + + # source://actioncable//lib/action_cable/connection/base.rb#115 + def transmit(cable_message); end + + # Returns the value of attribute worker_pool. + # + # source://actioncable//lib/action_cable/connection/base.rb#64 + def worker_pool; end + + private + + # @return [Boolean] + # + # source://actioncable//lib/action_cable/connection/base.rb#228 + def allow_request_origin?; end + + # The cookies of the request that initiated the WebSocket connection. Useful for + # performing authorization checks. + # + # source://actioncable//lib/action_cable/connection/base.rb#187 + def cookies; end + + # source://actioncable//lib/action_cable/connection/base.rb#195 + def decode(websocket_message); end + + # source://actioncable//lib/action_cable/connection/base.rb#191 + def encode(cable_message); end + + # source://actioncable//lib/action_cable/connection/base.rb#271 + def finished_request_message; end + + # source://actioncable//lib/action_cable/connection/base.rb#211 + def handle_close; end + + # source://actioncable//lib/action_cable/connection/base.rb#199 + def handle_open; end + + # source://actioncable//lib/action_cable/connection/base.rb#279 + def invalid_request_message; end + + # Returns the value of attribute message_buffer. + # + # source://actioncable//lib/action_cable/connection/base.rb#174 + def message_buffer; end + + # Tags are declared in the server but computed in the connection. This allows us + # per-connection tailored tags. + # + # source://actioncable//lib/action_cable/connection/base.rb#257 + def new_tagged_logger; end + + # The request that initiated the WebSocket connection is available here. This + # gives access to the environment, cookies, etc. + # + # source://actioncable//lib/action_cable/connection/base.rb#178 + def request; end + + # source://actioncable//lib/action_cable/connection/base.rb#247 + def respond_to_invalid_request; end + + # source://actioncable//lib/action_cable/connection/base.rb#242 + def respond_to_successful_request; end + + # source://actioncable//lib/action_cable/connection/base.rb#222 + def send_welcome_message; end + + # source://actioncable//lib/action_cable/connection/base.rb#262 + def started_request_message; end + + # source://actioncable//lib/action_cable/connection/base.rb#285 + def successful_request_message; end + + # Returns the value of attribute websocket. + # + # source://actioncable//lib/action_cable/connection/base.rb#173 + def websocket; end + + class << self + # source://actioncable//lib/action_cable/connection/base.rb#61 + def __callbacks; end + + # source://actioncable//lib/action_cable/connection/base.rb#61 + def __callbacks=(value); end + + # source://actioncable//lib/action_cable/connection/base.rb#61 + def _command_callbacks; end + + # source://actioncable//lib/action_cable/connection/base.rb#61 + def _command_callbacks=(value); end + + # source://actioncable//lib/action_cable/connection/base.rb#58 + def identifiers; end + + # source://actioncable//lib/action_cable/connection/base.rb#58 + def identifiers=(value); end + + # source://actioncable//lib/action_cable/connection/base.rb#58 + def identifiers?; end + + # source://actioncable//lib/action_cable/connection/base.rb#62 + def rescue_handlers; end + + # source://actioncable//lib/action_cable/connection/base.rb#62 + def rescue_handlers=(value); end + + # source://actioncable//lib/action_cable/connection/base.rb#62 + def rescue_handlers?; end + + private + + # source://actioncable//lib/action_cable/connection/base.rb#61 + def __class_attr___callbacks; end + + # source://actioncable//lib/action_cable/connection/base.rb#61 + def __class_attr___callbacks=(new_value); end + + # source://actioncable//lib/action_cable/connection/base.rb#58 + def __class_attr_identifiers; end + + # source://actioncable//lib/action_cable/connection/base.rb#58 + def __class_attr_identifiers=(new_value); end + + # source://actioncable//lib/action_cable/connection/base.rb#62 + def __class_attr_rescue_handlers; end + + # source://actioncable//lib/action_cable/connection/base.rb#62 + def __class_attr_rescue_handlers=(new_value); end + end +end + +# # Action Cable Connection Callbacks +# +# The [before_command](rdoc-ref:ClassMethods#before_command), +# [after_command](rdoc-ref:ClassMethods#after_command), and +# [around_command](rdoc-ref:ClassMethods#around_command) callbacks are invoked +# when sending commands to the client, such as when subscribing, unsubscribing, +# or performing an action. +# +# #### Example +# +# module ApplicationCable +# class Connection < ActionCable::Connection::Base +# identified_by :user +# +# around_command :set_current_account +# +# private +# +# def set_current_account +# # Now all channels could use Current.account +# Current.set(account: user.account) { yield } +# end +# end +# end +# +# source://actioncable//lib/action_cable/connection/callbacks.rb#34 +module ActionCable::Connection::Callbacks + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActiveSupport::Callbacks + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods + mixes_in_class_methods ::ActiveSupport::DescendantsTracker + mixes_in_class_methods ::ActionCable::Connection::Callbacks::ClassMethods + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + end + + module GeneratedInstanceMethods + def __callbacks; end + end +end + +# source://actioncable//lib/action_cable/connection/callbacks.rb#42 +module ActionCable::Connection::Callbacks::ClassMethods + # source://actioncable//lib/action_cable/connection/callbacks.rb#47 + def after_command(*methods, &block); end + + # source://actioncable//lib/action_cable/connection/callbacks.rb#51 + def around_command(*methods, &block); end + + # source://actioncable//lib/action_cable/connection/callbacks.rb#43 + def before_command(*methods, &block); end +end + +# source://actioncable//lib/action_cable/connection/client_socket.rb#13 +class ActionCable::Connection::ClientSocket + # @return [ClientSocket] a new instance of ClientSocket + # + # source://actioncable//lib/action_cable/connection/client_socket.rb#36 + def initialize(env, event_target, event_loop, protocols); end + + # @return [Boolean] + # + # source://actioncable//lib/action_cable/connection/client_socket.rb#114 + def alive?; end + + # source://actioncable//lib/action_cable/connection/client_socket.rb#110 + def client_gone; end + + # source://actioncable//lib/action_cable/connection/client_socket.rb#92 + def close(code = T.unsafe(nil), reason = T.unsafe(nil)); end + + # Returns the value of attribute env. + # + # source://actioncable//lib/action_cable/connection/client_socket.rb#34 + def env; end + + # source://actioncable//lib/action_cable/connection/client_socket.rb#106 + def parse(data); end + + # source://actioncable//lib/action_cable/connection/client_socket.rb#118 + def protocol; end + + # source://actioncable//lib/action_cable/connection/client_socket.rb#71 + def rack_response; end + + # source://actioncable//lib/action_cable/connection/client_socket.rb#59 + def start_driver; end + + # source://actioncable//lib/action_cable/connection/client_socket.rb#82 + def transmit(message); end + + # Returns the value of attribute url. + # + # source://actioncable//lib/action_cable/connection/client_socket.rb#34 + def url; end + + # source://actioncable//lib/action_cable/connection/client_socket.rb#76 + def write(data); end + + private + + # source://actioncable//lib/action_cable/connection/client_socket.rb#142 + def begin_close(reason, code); end + + # source://actioncable//lib/action_cable/connection/client_socket.rb#136 + def emit_error(message); end + + # source://actioncable//lib/action_cable/connection/client_socket.rb#151 + def finalize_close; end + + # source://actioncable//lib/action_cable/connection/client_socket.rb#123 + def open; end + + # source://actioncable//lib/action_cable/connection/client_socket.rb#130 + def receive_message(data); end + + class << self + # source://actioncable//lib/action_cable/connection/client_socket.rb#14 + def determine_url(env); end + + # @return [Boolean] + # + # source://actioncable//lib/action_cable/connection/client_socket.rb#19 + def secure_request?(env); end + end +end + +# source://actioncable//lib/action_cable/connection/client_socket.rb#32 +ActionCable::Connection::ClientSocket::CLOSED = T.let(T.unsafe(nil), Integer) + +# source://actioncable//lib/action_cable/connection/client_socket.rb#31 +ActionCable::Connection::ClientSocket::CLOSING = T.let(T.unsafe(nil), Integer) + +# source://actioncable//lib/action_cable/connection/client_socket.rb#29 +ActionCable::Connection::ClientSocket::CONNECTING = T.let(T.unsafe(nil), Integer) + +# source://actioncable//lib/action_cable/connection/client_socket.rb#30 +ActionCable::Connection::ClientSocket::OPEN = T.let(T.unsafe(nil), Integer) + +# source://actioncable//lib/action_cable/connection/identification.rb#7 +module ActionCable::Connection::Identification + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionCable::Connection::Identification::ClassMethods + + # Return a single connection identifier that combines the value of all the + # registered identifiers into a single gid. + # + # source://actioncable//lib/action_cable/connection/identification.rb#29 + def connection_identifier; end + + private + + # source://actioncable//lib/action_cable/connection/identification.rb#38 + def connection_gid(ids); end + + module GeneratedClassMethods + def identifiers; end + def identifiers=(value); end + def identifiers?; end + end + + module GeneratedInstanceMethods + def identifiers; end + def identifiers=(value); end + def identifiers?; end + end +end + +# source://actioncable//lib/action_cable/connection/identification.rb#14 +module ActionCable::Connection::Identification::ClassMethods + # Mark a key as being a connection identifier index that can then be used to + # find the specific connection again later. Common identifiers are current_user + # and current_account, but could be anything, really. + # + # Note that anything marked as an identifier will automatically create a + # delegate by the same name on any channel instances created off the connection. + # + # source://actioncable//lib/action_cable/connection/identification.rb#21 + def identified_by(*identifiers); end +end + +# # Action Cable InternalChannel +# +# Makes it possible for the RemoteConnection to disconnect a specific +# connection. +# +# source://actioncable//lib/action_cable/connection/internal_channel.rb#11 +module ActionCable::Connection::InternalChannel + extend ::ActiveSupport::Concern + + private + + # source://actioncable//lib/action_cable/connection/internal_channel.rb#15 + def internal_channel; end + + # source://actioncable//lib/action_cable/connection/internal_channel.rb#36 + def process_internal_message(message); end + + # source://actioncable//lib/action_cable/connection/internal_channel.rb#19 + def subscribe_to_internal_channel; end + + # source://actioncable//lib/action_cable/connection/internal_channel.rb#30 + def unsubscribe_from_internal_channel; end +end + +# Allows us to buffer messages received from the WebSocket before the Connection +# has been fully initialized, and is ready to receive them. +# +# source://actioncable//lib/action_cable/connection/message_buffer.rb#9 +class ActionCable::Connection::MessageBuffer + # @return [MessageBuffer] a new instance of MessageBuffer + # + # source://actioncable//lib/action_cable/connection/message_buffer.rb#10 + def initialize(connection); end + + # source://actioncable//lib/action_cable/connection/message_buffer.rb#15 + def append(message); end + + # source://actioncable//lib/action_cable/connection/message_buffer.rb#31 + def process!; end + + # @return [Boolean] + # + # source://actioncable//lib/action_cable/connection/message_buffer.rb#27 + def processing?; end + + private + + # source://actioncable//lib/action_cable/connection/message_buffer.rb#48 + def buffer(message); end + + # Returns the value of attribute buffered_messages. + # + # source://actioncable//lib/action_cable/connection/message_buffer.rb#38 + def buffered_messages; end + + # Returns the value of attribute connection. + # + # source://actioncable//lib/action_cable/connection/message_buffer.rb#37 + def connection; end + + # source://actioncable//lib/action_cable/connection/message_buffer.rb#44 + def receive(message); end + + # source://actioncable//lib/action_cable/connection/message_buffer.rb#52 + def receive_buffered_messages; end + + # @return [Boolean] + # + # source://actioncable//lib/action_cable/connection/message_buffer.rb#40 + def valid?(message); end +end + +# source://actioncable//lib/action_cable/connection/test_case.rb#14 +class ActionCable::Connection::NonInferrableConnectionError < ::StandardError + # @return [NonInferrableConnectionError] a new instance of NonInferrableConnectionError + # + # source://actioncable//lib/action_cable/connection/test_case.rb#15 + def initialize(name); end +end + +# source://actioncable//lib/action_cable/connection/stream.rb#11 +class ActionCable::Connection::Stream + # @return [Stream] a new instance of Stream + # + # source://actioncable//lib/action_cable/connection/stream.rb#12 + def initialize(event_loop, socket); end + + # source://actioncable//lib/action_cable/connection/stream.rb#28 + def close; end + + # source://actioncable//lib/action_cable/connection/stream.rb#24 + def each(&callback); end + + # source://actioncable//lib/action_cable/connection/stream.rb#72 + def flush_write_buffer; end + + # source://actioncable//lib/action_cable/connection/stream.rb#98 + def hijack_rack_socket; end + + # source://actioncable//lib/action_cable/connection/stream.rb#94 + def receive(data); end + + # source://actioncable//lib/action_cable/connection/stream.rb#33 + def shutdown; end + + # source://actioncable//lib/action_cable/connection/stream.rb#37 + def write(data); end + + private + + # source://actioncable//lib/action_cable/connection/stream.rb#110 + def clean_rack_hijack; end +end + +# source://actioncable//lib/action_cable/connection/stream_event_loop.rb#9 +class ActionCable::Connection::StreamEventLoop + # @return [StreamEventLoop] a new instance of StreamEventLoop + # + # source://actioncable//lib/action_cable/connection/stream_event_loop.rb#10 + def initialize; end + + # source://actioncable//lib/action_cable/connection/stream_event_loop.rb#30 + def attach(io, stream); end + + # source://actioncable//lib/action_cable/connection/stream_event_loop.rb#38 + def detach(io, stream); end + + # source://actioncable//lib/action_cable/connection/stream_event_loop.rb#23 + def post(task = T.unsafe(nil), &block); end + + # source://actioncable//lib/action_cable/connection/stream_event_loop.rb#56 + def stop; end + + # source://actioncable//lib/action_cable/connection/stream_event_loop.rb#19 + def timer(interval, &block); end + + # source://actioncable//lib/action_cable/connection/stream_event_loop.rb#47 + def writes_pending(io); end + + private + + # source://actioncable//lib/action_cable/connection/stream_event_loop.rb#87 + def run; end + + # source://actioncable//lib/action_cable/connection/stream_event_loop.rb#62 + def spawn; end + + # source://actioncable//lib/action_cable/connection/stream_event_loop.rb#83 + def wakeup; end +end + +# # Action Cable Connection Subscriptions +# +# Collection class for all the channel subscriptions established on a given +# connection. Responsible for routing incoming commands that arrive on the +# connection to the proper channel. +# +# source://actioncable//lib/action_cable/connection/subscriptions.rb#14 +class ActionCable::Connection::Subscriptions + # @return [Subscriptions] a new instance of Subscriptions + # + # source://actioncable//lib/action_cable/connection/subscriptions.rb#15 + def initialize(connection); end + + # source://actioncable//lib/action_cable/connection/subscriptions.rb#33 + def add(data); end + + # source://actioncable//lib/action_cable/connection/subscriptions.rb#20 + def execute_command(data); end + + # source://actioncable//lib/action_cable/connection/subscriptions.rb#64 + def identifiers; end + + # source://actioncable//lib/action_cable/connection/subscriptions.rb#74 + def logger(*_arg0, **_arg1, &_arg2); end + + # source://actioncable//lib/action_cable/connection/subscriptions.rb#60 + def perform_action(data); end + + # source://actioncable//lib/action_cable/connection/subscriptions.rb#50 + def remove(data); end + + # source://actioncable//lib/action_cable/connection/subscriptions.rb#55 + def remove_subscription(subscription); end + + # source://actioncable//lib/action_cable/connection/subscriptions.rb#68 + def unsubscribe_from_all; end + + private + + # Returns the value of attribute connection. + # + # source://actioncable//lib/action_cable/connection/subscriptions.rb#73 + def connection; end + + # source://actioncable//lib/action_cable/connection/subscriptions.rb#76 + def find(data); end + + # Returns the value of attribute subscriptions. + # + # source://actioncable//lib/action_cable/connection/subscriptions.rb#73 + def subscriptions; end +end + +# # Action Cable Connection TaggedLoggerProxy +# +# Allows the use of per-connection tags against the server logger. This wouldn't +# work using the traditional ActiveSupport::TaggedLogging enhanced Rails.logger, +# as that logger will reset the tags between requests. The connection is +# long-lived, so it needs its own set of tags for its independent duration. +# +# source://actioncable//lib/action_cable/connection/tagged_logger_proxy.rb#13 +class ActionCable::Connection::TaggedLoggerProxy + # @return [TaggedLoggerProxy] a new instance of TaggedLoggerProxy + # + # source://actioncable//lib/action_cable/connection/tagged_logger_proxy.rb#16 + def initialize(logger, tags:); end + + # source://actioncable//lib/action_cable/connection/tagged_logger_proxy.rb#21 + def add_tags(*tags); end + + # source://actioncable//lib/action_cable/connection/tagged_logger_proxy.rb#36 + def debug(message = T.unsafe(nil), &block); end + + # source://actioncable//lib/action_cable/connection/tagged_logger_proxy.rb#36 + def error(message = T.unsafe(nil), &block); end + + # source://actioncable//lib/action_cable/connection/tagged_logger_proxy.rb#36 + def fatal(message = T.unsafe(nil), &block); end + + # source://actioncable//lib/action_cable/connection/tagged_logger_proxy.rb#36 + def info(message = T.unsafe(nil), &block); end + + # source://actioncable//lib/action_cable/connection/tagged_logger_proxy.rb#26 + def tag(logger, &block); end + + # Returns the value of attribute tags. + # + # source://actioncable//lib/action_cable/connection/tagged_logger_proxy.rb#14 + def tags; end + + # source://actioncable//lib/action_cable/connection/tagged_logger_proxy.rb#36 + def unknown(message = T.unsafe(nil), &block); end + + # source://actioncable//lib/action_cable/connection/tagged_logger_proxy.rb#36 + def warn(message = T.unsafe(nil), &block); end + + private + + # source://actioncable//lib/action_cable/connection/tagged_logger_proxy.rb#42 + def log(type, message, &block); end +end + +# # Action Cable Connection TestCase +# +# Unit test Action Cable connections. +# +# Useful to check whether a connection's `identified_by` gets assigned properly +# and that any improper connection requests are rejected. +# +# ## Basic example +# +# Unit tests are written by first simulating a connection attempt by calling +# `connect` and then asserting state, e.g. identifiers, have been assigned. +# +# class ApplicationCable::ConnectionTest < ActionCable::Connection::TestCase +# def test_connects_with_proper_cookie +# # Simulate the connection request with a cookie. +# cookies["user_id"] = users(:john).id +# +# connect +# +# # Assert the connection identifier matches the fixture. +# assert_equal users(:john).id, connection.user.id +# end +# +# def test_rejects_connection_without_proper_cookie +# assert_reject_connection { connect } +# end +# end +# +# `connect` accepts additional information about the HTTP request with the +# `params`, `headers`, `session`, and Rack `env` options. +# +# def test_connect_with_headers_and_query_string +# connect params: { user_id: 1 }, headers: { "X-API-TOKEN" => "secret-my" } +# +# assert_equal "1", connection.user.id +# assert_equal "secret-my", connection.token +# end +# +# def test_connect_with_params +# connect params: { user_id: 1 } +# +# assert_equal "1", connection.user.id +# end +# +# You can also set up the correct cookies before the connection request: +# +# def test_connect_with_cookies +# # Plain cookies: +# cookies["user_id"] = 1 +# +# # Or signed/encrypted: +# # cookies.signed["user_id"] = 1 +# # cookies.encrypted["user_id"] = 1 +# +# connect +# +# assert_equal "1", connection.user_id +# end +# +# ## Connection is automatically inferred +# +# ActionCable::Connection::TestCase will automatically infer the connection +# under test from the test class name. If the channel cannot be inferred from +# the test class name, you can explicitly set it with `tests`. +# +# class ConnectionTest < ActionCable::Connection::TestCase +# tests ApplicationCable::Connection +# end +# +# source://actioncable//lib/action_cable/connection/test_case.rb#138 +class ActionCable::Connection::TestCase < ::ActiveSupport::TestCase + include ::ActiveSupport::Testing::ConstantLookup + include ::ActionCable::Connection::Assertions + include ::ActionCable::Connection::TestCase::Behavior + extend ::ActiveSupport::Testing::ConstantLookup::ClassMethods + extend ::ActionCable::Connection::TestCase::Behavior::ClassMethods + + # source://actioncable//lib/action_cable/connection/test_case.rb#148 + def _connection_class; end + + # source://actioncable//lib/action_cable/connection/test_case.rb#148 + def _connection_class=(_arg0); end + + # source://actioncable//lib/action_cable/connection/test_case.rb#148 + def _connection_class?; end + + # source://actioncable//lib/action_cable/connection/test_case.rb#150 + def connection; end + + class << self + # source://actioncable//lib/action_cable/connection/test_case.rb#148 + def _connection_class; end + + # source://actioncable//lib/action_cable/connection/test_case.rb#148 + def _connection_class=(value); end + + # source://actioncable//lib/action_cable/connection/test_case.rb#148 + def _connection_class?; end + + private + + # source://actioncable//lib/action_cable/connection/test_case.rb#148 + def __class_attr__connection_class; end + + # source://actioncable//lib/action_cable/connection/test_case.rb#148 + def __class_attr__connection_class=(new_value); end + end +end + +# source://actioncable//lib/action_cable/connection/test_case.rb#139 +module ActionCable::Connection::TestCase::Behavior + include ::ActionCable::Connection::Assertions + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActiveSupport::Testing::ConstantLookup + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveSupport::Testing::ConstantLookup::ClassMethods + mixes_in_class_methods ::ActionCable::Connection::TestCase::Behavior::ClassMethods + + # Performs connection attempt to exert #connect on the connection under test. + # + # Accepts request path as the first argument and the following request options: + # + # * params – URL parameters (Hash) + # * headers – request headers (Hash) + # * session – session data (Hash) + # * env – additional Rack env configuration (Hash) + # + # source://actioncable//lib/action_cable/connection/test_case.rb#192 + def connect(path = T.unsafe(nil), **request_params); end + + # source://actioncable//lib/action_cable/connection/test_case.rb#212 + def cookies; end + + # Exert #disconnect on the connection under test. + # + # source://actioncable//lib/action_cable/connection/test_case.rb#205 + def disconnect; end + + private + + # source://actioncable//lib/action_cable/connection/test_case.rb#217 + def build_test_request(path, params: T.unsafe(nil), headers: T.unsafe(nil), session: T.unsafe(nil), env: T.unsafe(nil)); end + + module GeneratedClassMethods + def _connection_class; end + def _connection_class=(value); end + def _connection_class?; end + end + + module GeneratedInstanceMethods + def _connection_class; end + def _connection_class=(value); end + def _connection_class?; end + end +end + +# source://actioncable//lib/action_cable/connection/test_case.rb#155 +module ActionCable::Connection::TestCase::Behavior::ClassMethods + # source://actioncable//lib/action_cable/connection/test_case.rb#167 + def connection_class; end + + # @raise [NonInferrableConnectionError] + # + # source://actioncable//lib/action_cable/connection/test_case.rb#175 + def determine_default_connection(name); end + + # source://actioncable//lib/action_cable/connection/test_case.rb#156 + def tests(connection); end +end + +# source://actioncable//lib/action_cable/connection/test_case.rb#142 +ActionCable::Connection::TestCase::Behavior::DEFAULT_PATH = T.let(T.unsafe(nil), String) + +# source://actioncable//lib/action_cable/connection/test_case.rb#57 +module ActionCable::Connection::TestConnection + # source://actioncable//lib/action_cable/connection/test_case.rb#60 + def initialize(request); end + + # Returns the value of attribute logger. + # + # source://actioncable//lib/action_cable/connection/test_case.rb#58 + def logger; end + + # Returns the value of attribute request. + # + # source://actioncable//lib/action_cable/connection/test_case.rb#58 + def request; end +end + +# We don't want to use the whole "encryption stack" for connection unit-tests, +# but we want to make sure that users test against the correct types of cookies +# (i.e. signed or encrypted or plain) +# +# source://actioncable//lib/action_cable/connection/test_case.rb#43 +class ActionCable::Connection::TestCookieJar < ::ActionCable::Connection::TestCookies + # source://actioncable//lib/action_cable/connection/test_case.rb#48 + def encrypted; end + + # source://actioncable//lib/action_cable/connection/test_case.rb#44 + def signed; end +end + +# source://actioncable//lib/action_cable/connection/test_case.rb#33 +class ActionCable::Connection::TestCookies < ::ActiveSupport::HashWithIndifferentAccess + # source://actioncable//lib/action_cable/connection/test_case.rb#34 + def []=(name, options); end +end + +# source://actioncable//lib/action_cable/connection/test_case.rb#53 +class ActionCable::Connection::TestRequest < ::ActionDispatch::TestRequest + # Returns the value of attribute cookie_jar. + # + # source://actioncable//lib/action_cable/connection/test_case.rb#54 + def cookie_jar; end + + # Sets the attribute cookie_jar + # + # @param value the value to set the attribute cookie_jar to. + # + # source://actioncable//lib/action_cable/connection/test_case.rb#54 + def cookie_jar=(_arg0); end + + # Returns the value of attribute session. + # + # source://actioncable//lib/action_cable/connection/test_case.rb#54 + def session; end + + # Sets the attribute session + # + # @param value the value to set the attribute session to. + # + # source://actioncable//lib/action_cable/connection/test_case.rb#54 + def session=(_arg0); end +end + +# # Action Cable Connection WebSocket +# +# Wrap the real socket to minimize the externally-presented API +# +# source://actioncable//lib/action_cable/connection/web_socket.rb#12 +class ActionCable::Connection::WebSocket + # @return [WebSocket] a new instance of WebSocket + # + # source://actioncable//lib/action_cable/connection/web_socket.rb#13 + def initialize(env, event_target, event_loop, protocols: T.unsafe(nil)); end + + # @return [Boolean] + # + # source://actioncable//lib/action_cable/connection/web_socket.rb#21 + def alive?; end + + # source://actioncable//lib/action_cable/connection/web_socket.rb#29 + def close(*_arg0, **_arg1, &_arg2); end + + # @return [Boolean] + # + # source://actioncable//lib/action_cable/connection/web_socket.rb#17 + def possible?; end + + # source://actioncable//lib/action_cable/connection/web_socket.rb#33 + def protocol; end + + # source://actioncable//lib/action_cable/connection/web_socket.rb#37 + def rack_response; end + + # source://actioncable//lib/action_cable/connection/web_socket.rb#25 + def transmit(*_arg0, **_arg1, &_arg2); end + + private + + # Returns the value of attribute websocket. + # + # source://actioncable//lib/action_cable/connection/web_socket.rb#42 + def websocket; end +end + +# source://actioncable//lib/action_cable/engine.rb#10 +class ActionCable::Engine < ::Rails::Engine; end + +# source://actioncable//lib/action_cable/helpers/action_cable_helper.rb#6 +module ActionCable::Helpers; end + +# source://actioncable//lib/action_cable/helpers/action_cable_helper.rb#7 +module ActionCable::Helpers::ActionCableHelper + # Returns an "action-cable-url" meta tag with the value of the URL specified in + # your configuration. Ensure this is above your JavaScript tag: + # + # + # <%= action_cable_meta_tag %> + # <%= javascript_include_tag 'application', 'data-turbo-track' => 'reload' %> + # + # + # This is then used by Action Cable to determine the URL of your WebSocket + # server. Your JavaScript can then connect to the server without needing to + # specify the URL directly: + # + # import Cable from "@rails/actioncable" + # window.Cable = Cable + # window.App = {} + # App.cable = Cable.createConsumer() + # + # Make sure to specify the correct server location in each of your environment + # config files: + # + # config.action_cable.mount_path = "/cable123" + # <%= action_cable_meta_tag %> would render: + # => + # + # config.action_cable.url = "ws://actioncable.com" + # <%= action_cable_meta_tag %> would render: + # => + # + # source://actioncable//lib/action_cable/helpers/action_cable_helper.rb#36 + def action_cable_meta_tag; end +end + +# source://actioncable//lib/action_cable.rb#58 +ActionCable::INTERNAL = T.let(T.unsafe(nil), Hash) + +# # Action Cable Remote Connections +# +# If you need to disconnect a given connection, you can go through the +# RemoteConnections. You can find the connections you're looking for by +# searching for the identifier declared on the connection. For example: +# +# module ApplicationCable +# class Connection < ActionCable::Connection::Base +# identified_by :current_user +# .... +# end +# end +# +# ActionCable.server.remote_connections.where(current_user: User.find(1)).disconnect +# +# This will disconnect all the connections established for `User.find(1)`, +# across all servers running on all machines, because it uses the internal +# channel that all of these servers are subscribed to. +# +# By default, server sends a "disconnect" message with "reconnect" flag set to +# true. You can override it by specifying the `reconnect` option: +# +# ActionCable.server.remote_connections.where(current_user: User.find(1)).disconnect(reconnect: false) +# +# source://actioncable//lib/action_cable/remote_connections.rb#31 +class ActionCable::RemoteConnections + # @return [RemoteConnections] a new instance of RemoteConnections + # + # source://actioncable//lib/action_cable/remote_connections.rb#34 + def initialize(server); end + + # Returns the value of attribute server. + # + # source://actioncable//lib/action_cable/remote_connections.rb#32 + def server; end + + # source://actioncable//lib/action_cable/remote_connections.rb#38 + def where(identifier); end +end + +# # Action Cable Remote Connection +# +# Represents a single remote connection found via +# `ActionCable.server.remote_connections.where(*)`. Exists solely for the +# purpose of calling #disconnect on that connection. +# +# source://actioncable//lib/action_cable/remote_connections.rb#47 +class ActionCable::RemoteConnections::RemoteConnection + include ::ActionCable::Connection::InternalChannel + include ::ActionCable::Connection::Identification + extend ::ActionCable::Connection::Identification::ClassMethods + + # @return [RemoteConnection] a new instance of RemoteConnection + # + # source://actioncable//lib/action_cable/remote_connections.rb#52 + def initialize(server, ids); end + + # Uses the internal channel to disconnect the connection. + # + # source://actioncable//lib/action_cable/remote_connections.rb#58 + def disconnect(reconnect: T.unsafe(nil)); end + + # source://actioncable//lib/action_cable/remote_connections.rb#50 + def identifiers; end + + # source://actioncable//lib/action_cable/remote_connections.rb#50 + def identifiers=(_arg0); end + + # source://actioncable//lib/action_cable/remote_connections.rb#50 + def identifiers?; end + + protected + + # Returns the value of attribute server. + # + # source://actioncable//lib/action_cable/remote_connections.rb#68 + def server; end + + private + + # @raise [InvalidIdentifiersError] + # + # source://actioncable//lib/action_cable/remote_connections.rb#71 + def set_identifier_instance_vars(ids); end + + # @return [Boolean] + # + # source://actioncable//lib/action_cable/remote_connections.rb#76 + def valid_identifiers?(ids); end + + class << self + # source://actioncable//lib/action_cable/remote_connections.rb#50 + def identifiers; end + + # source://actioncable//lib/action_cable/remote_connections.rb#50 + def identifiers=(value); end + + # source://actioncable//lib/action_cable/remote_connections.rb#50 + def identifiers?; end + + private + + # source://actioncable//lib/action_cable/remote_connections.rb#50 + def __class_attr_identifiers; end + + # source://actioncable//lib/action_cable/remote_connections.rb#50 + def __class_attr_identifiers=(new_value); end + end +end + +# source://actioncable//lib/action_cable/remote_connections.rb#48 +class ActionCable::RemoteConnections::RemoteConnection::InvalidIdentifiersError < ::StandardError; end + +# source://actioncable//lib/action_cable/server/base.rb#8 +module ActionCable::Server; end + +# # Action Cable Server Base +# +# A singleton ActionCable::Server instance is available via ActionCable.server. +# It's used by the Rack process that starts the Action Cable server, but is also +# used by the user to reach the RemoteConnections object, which is used for +# finding and disconnecting connections across all servers. +# +# Also, this is the server instance used for broadcasting. See Broadcasting for +# more information. +# +# source://actioncable//lib/action_cable/server/base.rb#18 +class ActionCable::Server::Base + include ::ActionCable::Server::Broadcasting + include ::ActionCable::Server::Connections + + # @return [Base] a new instance of Base + # + # source://actioncable//lib/action_cable/server/base.rb#31 + def initialize(config: T.unsafe(nil)); end + + # Called by Rack to set up the server. + # + # source://actioncable//lib/action_cable/server/base.rb#38 + def call(env); end + + # Returns the value of attribute config. + # + # source://actioncable//lib/action_cable/server/base.rb#24 + def config; end + + # All of the identifiers applied to the connection class associated with this + # server. + # + # source://actioncable//lib/action_cable/server/base.rb#102 + def connection_identifiers; end + + # Disconnect all the connections identified by `identifiers` on this server or + # any others via RemoteConnections. + # + # source://actioncable//lib/action_cable/server/base.rb#46 + def disconnect(identifiers); end + + # source://actioncable//lib/action_cable/server/base.rb#71 + def event_loop; end + + # source://actioncable//lib/action_cable/server/base.rb#27 + def logger(*_arg0, **_arg1, &_arg2); end + + # Returns the value of attribute mutex. + # + # source://actioncable//lib/action_cable/server/base.rb#29 + def mutex; end + + # Adapter used for all streams/broadcasting. + # + # source://actioncable//lib/action_cable/server/base.rb#96 + def pubsub; end + + # Gateway to RemoteConnections. See that class for details. + # + # source://actioncable//lib/action_cable/server/base.rb#67 + def remote_connections; end + + # source://actioncable//lib/action_cable/server/base.rb#50 + def restart; end + + # The worker pool is where we run connection callbacks and channel actions. We + # do as little as possible on the server's main thread. The worker pool is an + # executor service that's backed by a pool of threads working from a task queue. + # The thread pool size maxes out at 4 worker threads by default. Tune the size + # yourself with `config.action_cable.worker_pool_size`. + # + # Using Active Record, Redis, etc within your channel actions means you'll get a + # separate connection from each thread in the worker pool. Plan your deployment + # accordingly: 5 servers each running 5 Puma workers each running an 8-thread + # worker pool means at least 200 database connections. + # + # Also, ensure that your database connection pool size is as least as large as + # your worker pool size. Otherwise, workers may oversubscribe the database + # connection pool and block while they wait for other workers to release their + # connections. Use a smaller worker pool or a larger database connection pool + # instead. + # + # source://actioncable//lib/action_cable/server/base.rb#91 + def worker_pool; end + + class << self + # source://actioncable//lib/action_cable/server/base.rb#22 + def config; end + + # source://actioncable//lib/action_cable/server/base.rb#22 + def config=(val); end + + # source://actioncable//lib/action_cable/server/base.rb#26 + def logger; end + end +end + +# # Action Cable Server Broadcasting +# +# Broadcasting is how other parts of your application can send messages to a +# channel's subscribers. As explained in Channel, most of the time, these +# broadcastings are streamed directly to the clients subscribed to the named +# broadcasting. Let's explain with a full-stack example: +# +# class WebNotificationsChannel < ApplicationCable::Channel +# def subscribed +# stream_from "web_notifications_#{current_user.id}" +# end +# end +# +# # Somewhere in your app this is called, perhaps from a NewCommentJob: +# ActionCable.server.broadcast \ +# "web_notifications_1", { title: "New things!", body: "All that's fit for print" } +# +# # Client-side JavaScript, which assumes you've already requested the right to send web notifications: +# App.cable.subscriptions.create("WebNotificationsChannel", { +# received: function(data) { +# new Notification(data['title'], { body: data['body'] }) +# } +# }) +# +# source://actioncable//lib/action_cable/server/broadcasting.rb#30 +module ActionCable::Server::Broadcasting + # Broadcast a hash directly to a named `broadcasting`. This will later be JSON + # encoded. + # + # source://actioncable//lib/action_cable/server/broadcasting.rb#33 + def broadcast(broadcasting, message, coder: T.unsafe(nil)); end + + # Returns a broadcaster for a named `broadcasting` that can be reused. Useful + # when you have an object that may need multiple spots to transmit to a specific + # broadcasting over and over. + # + # source://actioncable//lib/action_cable/server/broadcasting.rb#40 + def broadcaster_for(broadcasting, coder: T.unsafe(nil)); end +end + +# source://actioncable//lib/action_cable/server/broadcasting.rb#45 +class ActionCable::Server::Broadcasting::Broadcaster + # @return [Broadcaster] a new instance of Broadcaster + # + # source://actioncable//lib/action_cable/server/broadcasting.rb#48 + def initialize(server, broadcasting, coder:); end + + # source://actioncable//lib/action_cable/server/broadcasting.rb#52 + def broadcast(message); end + + # Returns the value of attribute broadcasting. + # + # source://actioncable//lib/action_cable/server/broadcasting.rb#46 + def broadcasting; end + + # Returns the value of attribute coder. + # + # source://actioncable//lib/action_cable/server/broadcasting.rb#46 + def coder; end + + # Returns the value of attribute server. + # + # source://actioncable//lib/action_cable/server/broadcasting.rb#46 + def server; end +end + +# # Action Cable Server Configuration +# +# An instance of this configuration object is available via +# ActionCable.server.config, which allows you to tweak Action Cable +# configuration in a Rails config initializer. +# +# source://actioncable//lib/action_cable/server/configuration.rb#14 +class ActionCable::Server::Configuration + # @return [Configuration] a new instance of Configuration + # + # source://actioncable//lib/action_cable/server/configuration.rb#22 + def initialize; end + + # Returns the value of attribute allow_same_origin_as_host. + # + # source://actioncable//lib/action_cable/server/configuration.rb#17 + def allow_same_origin_as_host; end + + # Sets the attribute allow_same_origin_as_host + # + # @param value the value to set the attribute allow_same_origin_as_host to. + # + # source://actioncable//lib/action_cable/server/configuration.rb#17 + def allow_same_origin_as_host=(_arg0); end + + # Returns the value of attribute allowed_request_origins. + # + # source://actioncable//lib/action_cable/server/configuration.rb#17 + def allowed_request_origins; end + + # Sets the attribute allowed_request_origins + # + # @param value the value to set the attribute allowed_request_origins to. + # + # source://actioncable//lib/action_cable/server/configuration.rb#17 + def allowed_request_origins=(_arg0); end + + # Returns the value of attribute cable. + # + # source://actioncable//lib/action_cable/server/configuration.rb#18 + def cable; end + + # Sets the attribute cable + # + # @param value the value to set the attribute cable to. + # + # source://actioncable//lib/action_cable/server/configuration.rb#18 + def cable=(_arg0); end + + # Returns the value of attribute connection_class. + # + # source://actioncable//lib/action_cable/server/configuration.rb#16 + def connection_class; end + + # Sets the attribute connection_class + # + # @param value the value to set the attribute connection_class to. + # + # source://actioncable//lib/action_cable/server/configuration.rb#16 + def connection_class=(_arg0); end + + # Returns the value of attribute disable_request_forgery_protection. + # + # source://actioncable//lib/action_cable/server/configuration.rb#17 + def disable_request_forgery_protection; end + + # Sets the attribute disable_request_forgery_protection + # + # @param value the value to set the attribute disable_request_forgery_protection to. + # + # source://actioncable//lib/action_cable/server/configuration.rb#17 + def disable_request_forgery_protection=(_arg0); end + + # Returns the value of attribute filter_parameters. + # + # source://actioncable//lib/action_cable/server/configuration.rb#17 + def filter_parameters; end + + # Sets the attribute filter_parameters + # + # @param value the value to set the attribute filter_parameters to. + # + # source://actioncable//lib/action_cable/server/configuration.rb#17 + def filter_parameters=(_arg0); end + + # Returns the value of attribute health_check_application. + # + # source://actioncable//lib/action_cable/server/configuration.rb#20 + def health_check_application; end + + # Sets the attribute health_check_application + # + # @param value the value to set the attribute health_check_application to. + # + # source://actioncable//lib/action_cable/server/configuration.rb#20 + def health_check_application=(_arg0); end + + # Returns the value of attribute health_check_path. + # + # source://actioncable//lib/action_cable/server/configuration.rb#20 + def health_check_path; end + + # Sets the attribute health_check_path + # + # @param value the value to set the attribute health_check_path to. + # + # source://actioncable//lib/action_cable/server/configuration.rb#20 + def health_check_path=(_arg0); end + + # Returns the value of attribute log_tags. + # + # source://actioncable//lib/action_cable/server/configuration.rb#15 + def log_tags; end + + # Sets the attribute log_tags + # + # @param value the value to set the attribute log_tags to. + # + # source://actioncable//lib/action_cable/server/configuration.rb#15 + def log_tags=(_arg0); end + + # Returns the value of attribute logger. + # + # source://actioncable//lib/action_cable/server/configuration.rb#15 + def logger; end + + # Sets the attribute logger + # + # @param value the value to set the attribute logger to. + # + # source://actioncable//lib/action_cable/server/configuration.rb#15 + def logger=(_arg0); end + + # Returns the value of attribute mount_path. + # + # source://actioncable//lib/action_cable/server/configuration.rb#18 + def mount_path; end + + # Sets the attribute mount_path + # + # @param value the value to set the attribute mount_path to. + # + # source://actioncable//lib/action_cable/server/configuration.rb#18 + def mount_path=(_arg0); end + + # Returns the value of attribute precompile_assets. + # + # source://actioncable//lib/action_cable/server/configuration.rb#19 + def precompile_assets; end + + # Sets the attribute precompile_assets + # + # @param value the value to set the attribute precompile_assets to. + # + # source://actioncable//lib/action_cable/server/configuration.rb#19 + def precompile_assets=(_arg0); end + + # Returns constant of subscription adapter specified in config/cable.yml. If the + # adapter cannot be found, this will default to the Redis adapter. Also makes + # sure proper dependencies are required. + # + # source://actioncable//lib/action_cable/server/configuration.rb#40 + def pubsub_adapter; end + + # Returns the value of attribute url. + # + # source://actioncable//lib/action_cable/server/configuration.rb#18 + def url; end + + # Sets the attribute url + # + # @param value the value to set the attribute url to. + # + # source://actioncable//lib/action_cable/server/configuration.rb#18 + def url=(_arg0); end + + # Returns the value of attribute worker_pool_size. + # + # source://actioncable//lib/action_cable/server/configuration.rb#16 + def worker_pool_size; end + + # Sets the attribute worker_pool_size + # + # @param value the value to set the attribute worker_pool_size to. + # + # source://actioncable//lib/action_cable/server/configuration.rb#16 + def worker_pool_size=(_arg0); end +end + +# # Action Cable Server Connections +# +# Collection class for all the connections that have been established on this +# specific server. Remember, usually you'll run many Action Cable servers, so +# you can't use this collection as a full list of all of the connections +# established against your application. Instead, use RemoteConnections for that. +# +# source://actioncable//lib/action_cable/server/connections.rb#13 +module ActionCable::Server::Connections + # source://actioncable//lib/action_cable/server/connections.rb#20 + def add_connection(connection); end + + # source://actioncable//lib/action_cable/server/connections.rb#16 + def connections; end + + # source://actioncable//lib/action_cable/server/connections.rb#39 + def open_connections_statistics; end + + # source://actioncable//lib/action_cable/server/connections.rb#24 + def remove_connection(connection); end + + # WebSocket connection implementations differ on when they'll mark a connection + # as stale. We basically never want a connection to go stale, as you then can't + # rely on being able to communicate with the connection. To solve this, a 3 + # second heartbeat runs on all connections. If the beat fails, we automatically + # disconnect. + # + # source://actioncable//lib/action_cable/server/connections.rb#33 + def setup_heartbeat_timer; end +end + +# source://actioncable//lib/action_cable/server/connections.rb#14 +ActionCable::Server::Connections::BEAT_INTERVAL = T.let(T.unsafe(nil), Integer) + +# Worker used by Server.send_async to do connection work in threads. +# +# source://actioncable//lib/action_cable/server/worker.rb#12 +class ActionCable::Server::Worker + include ::ActiveSupport::Callbacks + include ::ActionCable::Server::Worker::ActiveRecordConnectionManagement + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::ActiveSupport::DescendantsTracker + + # @return [Worker] a new instance of Worker + # + # source://actioncable//lib/action_cable/server/worker.rb#21 + def initialize(max_size: T.unsafe(nil)); end + + # source://actioncable//lib/action_cable/server/worker.rb#13 + def __callbacks; end + + # source://actioncable//lib/action_cable/server/worker.rb#16 + def _run_work_callbacks(&block); end + + # source://actioncable//lib/action_cable/server/worker.rb#16 + def _run_work_callbacks!(&block); end + + # source://actioncable//lib/action_cable/server/worker.rb#16 + def _work_callbacks; end + + # source://actioncable//lib/action_cable/server/worker.rb#48 + def async_exec(receiver, *args, connection:, &block); end + + # source://actioncable//lib/action_cable/server/worker.rb#52 + def async_invoke(receiver, method, *args, connection: T.unsafe(nil), &block); end + + # source://actioncable//lib/action_cable/server/worker.rb#15 + def connection; end + + # source://actioncable//lib/action_cable/server/worker.rb#15 + def connection=(obj); end + + # Returns the value of attribute executor. + # + # source://actioncable//lib/action_cable/server/worker.rb#19 + def executor; end + + # Stop processing work: any work that has not already started running will be + # discarded from the queue + # + # source://actioncable//lib/action_cable/server/worker.rb#32 + def halt; end + + # source://actioncable//lib/action_cable/server/worker.rb#58 + def invoke(receiver, method, *args, connection:, &block); end + + # @return [Boolean] + # + # source://actioncable//lib/action_cable/server/worker.rb#36 + def stopping?; end + + # source://actioncable//lib/action_cable/server/worker.rb#40 + def work(connection, &block); end + + private + + # source://actioncable//lib/action_cable/server/worker.rb#70 + def logger; end + + class << self + # source://actioncable//lib/action_cable/server/worker.rb#13 + def __callbacks; end + + # source://actioncable//lib/action_cable/server/worker.rb#13 + def __callbacks=(value); end + + # source://actioncable//lib/action_cable/server/worker.rb#16 + def _work_callbacks; end + + # source://actioncable//lib/action_cable/server/worker.rb#16 + def _work_callbacks=(value); end + + # source://actioncable//lib/action_cable/server/worker.rb#15 + def connection; end + + # source://actioncable//lib/action_cable/server/worker.rb#15 + def connection=(obj); end + + private + + # source://actioncable//lib/action_cable/server/worker.rb#13 + def __class_attr___callbacks; end + + # source://actioncable//lib/action_cable/server/worker.rb#13 + def __class_attr___callbacks=(new_value); end + end +end + +# source://actioncable//lib/action_cable/server/worker/active_record_connection_management.rb#8 +module ActionCable::Server::Worker::ActiveRecordConnectionManagement + extend ::ActiveSupport::Concern + + # source://actioncable//lib/action_cable/server/worker/active_record_connection_management.rb#17 + def with_database_connections(&block); end +end + +# source://actioncable//lib/action_cable/subscription_adapter/base.rb#6 +module ActionCable::SubscriptionAdapter; end + +# source://actioncable//lib/action_cable/subscription_adapter/async.rb#7 +class ActionCable::SubscriptionAdapter::Async < ::ActionCable::SubscriptionAdapter::Inline + private + + # source://actioncable//lib/action_cable/subscription_adapter/async.rb#9 + def new_subscriber_map; end +end + +# source://actioncable//lib/action_cable/subscription_adapter/async.rb#13 +class ActionCable::SubscriptionAdapter::Async::AsyncSubscriberMap < ::ActionCable::SubscriptionAdapter::SubscriberMap + # @return [AsyncSubscriberMap] a new instance of AsyncSubscriberMap + # + # source://actioncable//lib/action_cable/subscription_adapter/async.rb#14 + def initialize(event_loop); end + + # source://actioncable//lib/action_cable/subscription_adapter/async.rb#19 + def add_subscriber(*_arg0); end + + # source://actioncable//lib/action_cable/subscription_adapter/async.rb#23 + def invoke_callback(*_arg0); end +end + +# source://actioncable//lib/action_cable/subscription_adapter/base.rb#7 +class ActionCable::SubscriptionAdapter::Base + # @return [Base] a new instance of Base + # + # source://actioncable//lib/action_cable/subscription_adapter/base.rb#10 + def initialize(server); end + + # @raise [NotImplementedError] + # + # source://actioncable//lib/action_cable/subscription_adapter/base.rb#15 + def broadcast(channel, payload); end + + # source://actioncable//lib/action_cable/subscription_adapter/base.rb#31 + def identifier; end + + # Returns the value of attribute logger. + # + # source://actioncable//lib/action_cable/subscription_adapter/base.rb#8 + def logger; end + + # Returns the value of attribute server. + # + # source://actioncable//lib/action_cable/subscription_adapter/base.rb#8 + def server; end + + # @raise [NotImplementedError] + # + # source://actioncable//lib/action_cable/subscription_adapter/base.rb#27 + def shutdown; end + + # @raise [NotImplementedError] + # + # source://actioncable//lib/action_cable/subscription_adapter/base.rb#19 + def subscribe(channel, message_callback, success_callback = T.unsafe(nil)); end + + # @raise [NotImplementedError] + # + # source://actioncable//lib/action_cable/subscription_adapter/base.rb#23 + def unsubscribe(channel, message_callback); end +end + +# source://actioncable//lib/action_cable/subscription_adapter/channel_prefix.rb#7 +module ActionCable::SubscriptionAdapter::ChannelPrefix + # source://actioncable//lib/action_cable/subscription_adapter/channel_prefix.rb#8 + def broadcast(channel, payload); end + + # source://actioncable//lib/action_cable/subscription_adapter/channel_prefix.rb#13 + def subscribe(channel, callback, success_callback = T.unsafe(nil)); end + + # source://actioncable//lib/action_cable/subscription_adapter/channel_prefix.rb#18 + def unsubscribe(channel, callback); end + + private + + # Returns the channel name, including channel_prefix specified in cable.yml + # + # source://actioncable//lib/action_cable/subscription_adapter/channel_prefix.rb#25 + def channel_with_prefix(channel); end +end + +# source://actioncable//lib/action_cable/subscription_adapter/inline.rb#7 +class ActionCable::SubscriptionAdapter::Inline < ::ActionCable::SubscriptionAdapter::Base + # @return [Inline] a new instance of Inline + # + # source://actioncable//lib/action_cable/subscription_adapter/inline.rb#8 + def initialize(*_arg0); end + + # source://actioncable//lib/action_cable/subscription_adapter/inline.rb#13 + def broadcast(channel, payload); end + + # source://actioncable//lib/action_cable/subscription_adapter/inline.rb#25 + def shutdown; end + + # source://actioncable//lib/action_cable/subscription_adapter/inline.rb#17 + def subscribe(channel, callback, success_callback = T.unsafe(nil)); end + + # source://actioncable//lib/action_cable/subscription_adapter/inline.rb#21 + def unsubscribe(channel, callback); end + + private + + # source://actioncable//lib/action_cable/subscription_adapter/inline.rb#34 + def new_subscriber_map; end + + # source://actioncable//lib/action_cable/subscription_adapter/inline.rb#30 + def subscriber_map; end +end + +class ActionCable::SubscriptionAdapter::SolidCable < ::ActionCable::SubscriptionAdapter::Base; end + +# source://actioncable//lib/action_cable/subscription_adapter/subscriber_map.rb#7 +class ActionCable::SubscriptionAdapter::SubscriberMap + # @return [SubscriberMap] a new instance of SubscriberMap + # + # source://actioncable//lib/action_cable/subscription_adapter/subscriber_map.rb#8 + def initialize; end + + # source://actioncable//lib/action_cable/subscription_adapter/subscriber_map.rb#49 + def add_channel(channel, on_success); end + + # source://actioncable//lib/action_cable/subscription_adapter/subscriber_map.rb#13 + def add_subscriber(channel, subscriber, on_success); end + + # source://actioncable//lib/action_cable/subscription_adapter/subscriber_map.rb#38 + def broadcast(channel, message); end + + # source://actioncable//lib/action_cable/subscription_adapter/subscriber_map.rb#56 + def invoke_callback(callback, message); end + + # source://actioncable//lib/action_cable/subscription_adapter/subscriber_map.rb#53 + def remove_channel(channel); end + + # source://actioncable//lib/action_cable/subscription_adapter/subscriber_map.rb#27 + def remove_subscriber(channel, subscriber); end +end + +# ## Test adapter for Action Cable +# +# The test adapter should be used only in testing. Along with +# ActionCable::TestHelper it makes a great tool to test your Rails application. +# +# To use the test adapter set `adapter` value to `test` in your +# `config/cable.yml` file. +# +# NOTE: `Test` adapter extends the `ActionCable::SubscriptionAdapter::Async` +# adapter, so it could be used in system tests too. +# +# source://actioncable//lib/action_cable/subscription_adapter/test.rb#17 +class ActionCable::SubscriptionAdapter::Test < ::ActionCable::SubscriptionAdapter::Async + # source://actioncable//lib/action_cable/subscription_adapter/test.rb#18 + def broadcast(channel, payload); end + + # source://actioncable//lib/action_cable/subscription_adapter/test.rb#23 + def broadcasts(channel); end + + # source://actioncable//lib/action_cable/subscription_adapter/test.rb#31 + def clear; end + + # source://actioncable//lib/action_cable/subscription_adapter/test.rb#27 + def clear_messages(channel); end + + private + + # source://actioncable//lib/action_cable/subscription_adapter/test.rb#36 + def channels_data; end +end + +# source://actioncable//lib/action_cable/test_case.rb#8 +class ActionCable::TestCase < ::ActiveSupport::TestCase; end + +# Provides helper methods for testing Action Cable broadcasting +# +# source://actioncable//lib/action_cable/test_helper.rb#7 +module ActionCable::TestHelper + # source://actioncable//lib/action_cable/test_helper.rb#18 + def after_teardown; end + + # Asserts that the specified message has been sent to the stream. + # + # def test_assert_transmitted_message + # ActionCable.server.broadcast 'messages', text: 'hello' + # assert_broadcast_on('messages', text: 'hello') + # end + # + # If a block is passed, that block should cause a message with the specified + # data to be sent. + # + # def test_assert_broadcast_on_again + # assert_broadcast_on('messages', text: 'hello') do + # ActionCable.server.broadcast 'messages', text: 'hello' + # end + # end + # + # source://actioncable//lib/action_cable/test_helper.rb#116 + def assert_broadcast_on(stream, data, &block); end + + # Asserts that the number of broadcasted messages to the stream matches the + # given number. + # + # def test_broadcasts + # assert_broadcasts 'messages', 0 + # ActionCable.server.broadcast 'messages', { text: 'hello' } + # assert_broadcasts 'messages', 1 + # ActionCable.server.broadcast 'messages', { text: 'world' } + # assert_broadcasts 'messages', 2 + # end + # + # If a block is passed, that block should cause the specified number of messages + # to be broadcasted. + # + # def test_broadcasts_again + # assert_broadcasts('messages', 1) do + # ActionCable.server.broadcast 'messages', { text: 'hello' } + # end + # + # assert_broadcasts('messages', 2) do + # ActionCable.server.broadcast 'messages', { text: 'hi' } + # ActionCable.server.broadcast 'messages', { text: 'how are you?' } + # end + # end + # + # source://actioncable//lib/action_cable/test_helper.rb#48 + def assert_broadcasts(stream, number, &block); end + + # Asserts that no messages have been sent to the stream. + # + # def test_no_broadcasts + # assert_no_broadcasts 'messages' + # ActionCable.server.broadcast 'messages', { text: 'hi' } + # assert_broadcasts 'messages', 1 + # end + # + # If a block is passed, that block should not cause any message to be sent. + # + # def test_broadcasts_again + # assert_no_broadcasts 'messages' do + # # No job messages should be sent from this block + # end + # end + # + # Note: This assertion is simply a shortcut for: + # + # assert_broadcasts 'messages', 0, &block + # + # source://actioncable//lib/action_cable/test_helper.rb#80 + def assert_no_broadcasts(stream, &block); end + + # source://actioncable//lib/action_cable/test_helper.rb#8 + def before_setup; end + + # source://actioncable//lib/action_cable/test_helper.rb#146 + def broadcasts(*_arg0, **_arg1, &_arg2); end + + # Returns the messages that are broadcasted in the block. + # + # def test_broadcasts + # messages = capture_broadcasts('messages') do + # ActionCable.server.broadcast 'messages', { text: 'hi' } + # ActionCable.server.broadcast 'messages', { text: 'how are you?' } + # end + # assert_equal 2, messages.length + # assert_equal({ text: 'hi' }, messages.first) + # assert_equal({ text: 'how are you?' }, messages.last) + # end + # + # source://actioncable//lib/action_cable/test_helper.rb#96 + def capture_broadcasts(stream, &block); end + + # source://actioncable//lib/action_cable/test_helper.rb#146 + def clear_messages(*_arg0, **_arg1, &_arg2); end + + # source://actioncable//lib/action_cable/test_helper.rb#142 + def pubsub_adapter; end + + private + + # source://actioncable//lib/action_cable/test_helper.rb#149 + def new_broadcasts_from(current_messages, stream, assertion, &block); end +end + +# source://actioncable//lib/action_cable/gem_version.rb#11 +module ActionCable::VERSION; end + +# source://actioncable//lib/action_cable/gem_version.rb#12 +ActionCable::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# source://actioncable//lib/action_cable/gem_version.rb#13 +ActionCable::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# source://actioncable//lib/action_cable/gem_version.rb#15 +ActionCable::VERSION::PRE = T.let(T.unsafe(nil), T.untyped) + +# source://actioncable//lib/action_cable/gem_version.rb#17 +ActionCable::VERSION::STRING = T.let(T.unsafe(nil), String) + +# source://actioncable//lib/action_cable/gem_version.rb#14 +ActionCable::VERSION::TINY = T.let(T.unsafe(nil), Integer) + +class ActiveSupport::TestCase < ::Minitest::Test + include ::Turbo::Broadcastable::TestHelper + include ::ActionCable::TestHelper + include ::Turbo::Streams::StreamName +end diff --git a/sorbet/rbi/gems/actionmailbox@8.1.1.rbi b/sorbet/rbi/gems/actionmailbox@8.1.1.rbi new file mode 100644 index 0000000..0a55e61 --- /dev/null +++ b/sorbet/rbi/gems/actionmailbox@8.1.1.rbi @@ -0,0 +1,1031 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `actionmailbox` gem. +# Please instead update this file by running `bin/tapioca gem actionmailbox`. + + +# :markup: markdown +# :include: ../README.md +# +# source://actionmailbox//lib/action_mailbox/gem_version.rb#3 +module ActionMailbox + extend ::ActiveSupport::Autoload + + # source://actionmailbox//lib/action_mailbox.rb#22 + def incinerate; end + + # source://actionmailbox//lib/action_mailbox.rb#22 + def incinerate=(val); end + + # source://actionmailbox//lib/action_mailbox.rb#23 + def incinerate_after; end + + # source://actionmailbox//lib/action_mailbox.rb#23 + def incinerate_after=(val); end + + # source://actionmailbox//lib/action_mailbox.rb#20 + def ingress; end + + # source://actionmailbox//lib/action_mailbox.rb#20 + def ingress=(val); end + + # source://actionmailbox//lib/action_mailbox.rb#21 + def logger; end + + # source://actionmailbox//lib/action_mailbox.rb#21 + def logger=(val); end + + # source://actionmailbox//lib/action_mailbox.rb#24 + def queues; end + + # source://actionmailbox//lib/action_mailbox.rb#24 + def queues=(val); end + + # source://actionmailbox//lib/action_mailbox.rb#25 + def storage_service; end + + # source://actionmailbox//lib/action_mailbox.rb#25 + def storage_service=(val); end + + class << self + # source://actionmailbox//lib/action_mailbox/deprecator.rb#4 + def deprecator; end + + # Returns the currently loaded version of Action Mailbox as a +Gem::Version+. + # + # source://actionmailbox//lib/action_mailbox/gem_version.rb#5 + def gem_version; end + + # source://actionmailbox//lib/action_mailbox.rb#22 + def incinerate; end + + # source://actionmailbox//lib/action_mailbox.rb#22 + def incinerate=(val); end + + # source://actionmailbox//lib/action_mailbox.rb#23 + def incinerate_after; end + + # source://actionmailbox//lib/action_mailbox.rb#23 + def incinerate_after=(val); end + + # source://actionmailbox//lib/action_mailbox.rb#20 + def ingress; end + + # source://actionmailbox//lib/action_mailbox.rb#20 + def ingress=(val); end + + # source://actionmailbox//lib/action_mailbox.rb#21 + def logger; end + + # source://actionmailbox//lib/action_mailbox.rb#21 + def logger=(val); end + + # source://actionmailbox//lib/action_mailbox.rb#24 + def queues; end + + # source://actionmailbox//lib/action_mailbox.rb#24 + def queues=(val); end + + # source://actionmailbox//lib/action_mailbox/engine.rb#13 + def railtie_helpers_paths; end + + # source://actionmailbox//lib/action_mailbox/engine.rb#13 + def railtie_namespace; end + + # source://actionmailbox//lib/action_mailbox/engine.rb#13 + def railtie_routes_url_helpers(include_path_helpers = T.unsafe(nil)); end + + # source://actionmailbox//lib/action_mailbox.rb#25 + def storage_service; end + + # source://actionmailbox//lib/action_mailbox.rb#25 + def storage_service=(val); end + + # source://actionmailbox//lib/action_mailbox/engine.rb#13 + def table_name_prefix; end + + # source://actionmailbox//lib/action_mailbox/engine.rb#13 + def use_relative_model_naming?; end + + # Returns the currently loaded version of Action Mailbox as a +Gem::Version+. + # + # source://actionmailbox//lib/action_mailbox/version.rb#7 + def version; end + end +end + +# = Action Mailbox \Base +# +# The base class for all application mailboxes. Not intended to be inherited from directly. Inherit from +# +ApplicationMailbox+ instead, as that's where the app-specific routing is configured. This routing +# is specified in the following ways: +# +# class ApplicationMailbox < ActionMailbox::Base +# # Any of the recipients of the mail (whether to, cc, bcc) are matched against the regexp. +# routing /^replies@/i => :replies +# +# # Any of the recipients of the mail (whether to, cc, bcc) needs to be an exact match for the string. +# routing "help@example.com" => :help +# +# # Any callable (proc, lambda, etc) object is passed the inbound_email record and is a match if true. +# routing ->(inbound_email) { inbound_email.mail.to.size > 2 } => :multiple_recipients +# +# # Any object responding to #match? is called with the inbound_email record as an argument. Match if true. +# routing CustomAddress.new => :custom +# +# # Any inbound_email that has not been already matched will be sent to the BackstopMailbox. +# routing :all => :backstop +# end +# +# Application mailboxes need to override the #process method, which is invoked by the framework after +# callbacks have been run. The callbacks available are: +before_processing+, +after_processing+, and +# +around_processing+. The primary use case is to ensure that certain preconditions to processing are fulfilled +# using +before_processing+ callbacks. +# +# If a precondition fails to be met, you can halt the processing using the +#bounced!+ method, +# which will silently prevent any further processing, but not actually send out any bounce notice. You +# can also pair this behavior with the invocation of an Action Mailer class responsible for sending out +# an actual bounce email. This is done using the #bounce_with method, which takes the mail object returned +# by an Action Mailer method, like so: +# +# class ForwardsMailbox < ApplicationMailbox +# before_processing :ensure_sender_is_a_user +# +# private +# def ensure_sender_is_a_user +# unless User.exist?(email_address: mail.from) +# bounce_with UserRequiredMailer.missing(inbound_email) +# end +# end +# end +# +# During the processing of the inbound email, the status will be tracked. Before processing begins, +# the email will normally have the +pending+ status. Once processing begins, just before callbacks +# and the #process method is called, the status is changed to +processing+. If processing is allowed to +# complete, the status is changed to +delivered+. If a bounce is triggered, then +bounced+. If an unhandled +# exception is bubbled up, then +failed+. +# +# Exceptions can be handled at the class level using the familiar +# ActiveSupport::Rescuable approach: +# +# class ForwardsMailbox < ApplicationMailbox +# rescue_from(ApplicationSpecificVerificationError) { bounced! } +# end +# +# source://actionmailbox//lib/action_mailbox/base.rb#66 +class ActionMailbox::Base + include ::ActiveSupport::Rescuable + include ::ActionMailbox::Routing + include ::ActiveSupport::Callbacks + include ::ActionMailbox::Callbacks + extend ::ActiveSupport::Rescuable::ClassMethods + extend ::ActionMailbox::Routing::ClassMethods + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::ActiveSupport::DescendantsTracker + extend ::ActionMailbox::Callbacks::ClassMethods + + # @return [Base] a new instance of Base + # + # source://actionmailbox//lib/action_mailbox/base.rb#79 + def initialize(inbound_email); end + + # source://actionmailbox//lib/action_mailbox/base.rb#68 + def __callbacks; end + + # source://actionmailbox//lib/action_mailbox/base.rb#68 + def _process_callbacks; end + + # source://actionmailbox//lib/action_mailbox/base.rb#68 + def _run_process_callbacks; end + + # source://actionmailbox//lib/action_mailbox/base.rb#68 + def _run_process_callbacks!(&block); end + + # Immediately sends the given +message+ and changes the inbound email's status to +:bounced+. + # + # source://actionmailbox//lib/action_mailbox/base.rb#111 + def bounce_now_with(message); end + + # Enqueues the given +message+ for delivery and changes the inbound email's status to +:bounced+. + # + # source://actionmailbox//lib/action_mailbox/base.rb#105 + def bounce_with(message); end + + # source://actionmailbox//lib/action_mailbox/base.rb#71 + def bounced!(*_arg0, **_arg1, &_arg2); end + + # source://actionmailbox//lib/action_mailbox/base.rb#71 + def delivered!(*_arg0, **_arg1, &_arg2); end + + # @return [Boolean] + # + # source://actionmailbox//lib/action_mailbox/base.rb#100 + def finished_processing?; end + + # Returns the value of attribute inbound_email. + # + # source://actionmailbox//lib/action_mailbox/base.rb#70 + def inbound_email; end + + # source://actionmailbox//lib/action_mailbox/base.rb#73 + def logger(&_arg0); end + + # source://actionmailbox//lib/action_mailbox/base.rb#71 + def mail(*_arg0, **_arg1, &_arg2); end + + # source://actionmailbox//lib/action_mailbox/base.rb#83 + def perform_processing; end + + # source://actionmailbox//lib/action_mailbox/base.rb#96 + def process; end + + # source://actionmailbox//lib/action_mailbox/base.rb#67 + def rescue_handlers; end + + # source://actionmailbox//lib/action_mailbox/base.rb#67 + def rescue_handlers=(_arg0); end + + # source://actionmailbox//lib/action_mailbox/base.rb#67 + def rescue_handlers?; end + + # source://actionmailbox//lib/action_mailbox/base.rb#68 + def router; end + + # source://actionmailbox//lib/action_mailbox/base.rb#68 + def router=(val); end + + private + + # source://actionmailbox//lib/action_mailbox/base.rb#117 + def instrumentation_payload; end + + # source://actionmailbox//lib/action_mailbox/base.rb#124 + def track_status_of_inbound_email; end + + class << self + # source://actionmailbox//lib/action_mailbox/base.rb#68 + def __callbacks; end + + # source://actionmailbox//lib/action_mailbox/base.rb#68 + def __callbacks=(value); end + + # source://actionmailbox//lib/action_mailbox/base.rb#68 + def _process_callbacks; end + + # source://actionmailbox//lib/action_mailbox/base.rb#68 + def _process_callbacks=(value); end + + # source://actionmailbox//lib/action_mailbox/base.rb#75 + def receive(inbound_email); end + + # source://actionmailbox//lib/action_mailbox/base.rb#67 + def rescue_handlers; end + + # source://actionmailbox//lib/action_mailbox/base.rb#67 + def rescue_handlers=(value); end + + # source://actionmailbox//lib/action_mailbox/base.rb#67 + def rescue_handlers?; end + + # source://actionmailbox//lib/action_mailbox/base.rb#68 + def router; end + + # source://actionmailbox//lib/action_mailbox/base.rb#68 + def router=(val); end + + private + + # source://actionmailbox//lib/action_mailbox/base.rb#68 + def __class_attr___callbacks; end + + # source://actionmailbox//lib/action_mailbox/base.rb#68 + def __class_attr___callbacks=(new_value); end + + # source://actionmailbox//lib/action_mailbox/base.rb#67 + def __class_attr_rescue_handlers; end + + # source://actionmailbox//lib/action_mailbox/base.rb#67 + def __class_attr_rescue_handlers=(new_value); end + end +end + +class ActionMailbox::BaseController < ::ActionController::Base + private + + def _layout(lookup_context, formats, keys); end + def _layout_from_proc; end + def authenticate_by_password; end + def ensure_configured; end + def ingress_name; end + def password; end + + class << self + private + + def __class_attr___callbacks; end + def __class_attr___callbacks=(new_value); end + def __class_attr_config; end + def __class_attr_config=(new_value); end + def __class_attr_middleware_stack; end + def __class_attr_middleware_stack=(new_value); end + end +end + +# = Action Mailbox \Callbacks +# +# Defines the callbacks related to processing. +# +# source://actionmailbox//lib/action_mailbox/callbacks.rb#9 +module ActionMailbox::Callbacks + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActiveSupport::Callbacks + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods + mixes_in_class_methods ::ActiveSupport::DescendantsTracker + mixes_in_class_methods ::ActionMailbox::Callbacks::ClassMethods + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + end + + module GeneratedInstanceMethods + def __callbacks; end + end +end + +# source://actionmailbox//lib/action_mailbox/callbacks.rb#22 +module ActionMailbox::Callbacks::ClassMethods + # source://actionmailbox//lib/action_mailbox/callbacks.rb#27 + def after_processing(*methods, &block); end + + # source://actionmailbox//lib/action_mailbox/callbacks.rb#31 + def around_processing(*methods, &block); end + + # source://actionmailbox//lib/action_mailbox/callbacks.rb#23 + def before_processing(*methods, &block); end +end + +# source://actionmailbox//lib/action_mailbox/callbacks.rb#13 +ActionMailbox::Callbacks::TERMINATOR = T.let(T.unsafe(nil), Proc) + +# source://actionmailbox//lib/action_mailbox/engine.rb#12 +class ActionMailbox::Engine < ::Rails::Engine; end + +class ActionMailbox::InboundEmail < ::ActionMailbox::Record + include ::ActionMailbox::InboundEmail::GeneratedAttributeMethods + include ::ActionMailbox::InboundEmail::GeneratedAssociationMethods + include ::ActionMailbox::InboundEmail::Routable + include ::ActionMailbox::InboundEmail::MessageId + include ::ActionMailbox::InboundEmail::Incineratable + extend ::ActionMailbox::InboundEmail::MessageId::ClassMethods + + def _run_commit_callbacks(&block); end + def _run_create_callbacks(&block); end + def _run_destroy_callbacks(&block); end + def _run_save_callbacks(&block); end + def _run_update_callbacks(&block); end + def autosave_associated_records_for_raw_email_attachment(*args); end + def autosave_associated_records_for_raw_email_blob(*args); end + def instrumentation_payload; end + def mail; end + def processed?; end + def source; end + + class << self + def bounced(*args, **_arg1); end + def delivered(*args, **_arg1); end + def failed(*args, **_arg1); end + def not_bounced(*args, **_arg1); end + def not_delivered(*args, **_arg1); end + def not_failed(*args, **_arg1); end + def not_pending(*args, **_arg1); end + def not_processing(*args, **_arg1); end + def pending(*args, **_arg1); end + def processing(*args, **_arg1); end + def statuses; end + def with_attached_raw_email(*args, **_arg1); end + + private + + def __class_attr___callbacks; end + def __class_attr___callbacks=(new_value); end + def __class_attr__reflections; end + def __class_attr__reflections=(new_value); end + def __class_attr__validators; end + def __class_attr__validators=(new_value); end + def __class_attr_attachment_reflections; end + def __class_attr_attachment_reflections=(new_value); end + def __class_attr_defined_enums; end + def __class_attr_defined_enums=(new_value); end + end +end + +module ActionMailbox::InboundEmail::GeneratedAssociationMethods + def build_raw_email_attachment(*args, &block); end + def build_raw_email_blob(*args, &block); end + def create_raw_email_attachment(*args, &block); end + def create_raw_email_attachment!(*args, &block); end + def create_raw_email_blob(*args, &block); end + def create_raw_email_blob!(*args, &block); end + def raw_email; end + def raw_email=(attachable); end + def raw_email_attachment; end + def raw_email_attachment=(value); end + def raw_email_blob; end + def raw_email_blob=(value); end + def reload_raw_email_attachment; end + def reload_raw_email_blob; end + def reset_raw_email_attachment; end + def reset_raw_email_blob; end +end + +module ActionMailbox::InboundEmail::GeneratedAttributeMethods; end + +module ActionMailbox::InboundEmail::Incineratable + extend ::ActiveSupport::Concern + + def incinerate; end + def incinerate_later; end +end + +class ActionMailbox::InboundEmail::Incineratable::Incineration + def initialize(inbound_email); end + + def run; end + + private + + def due?; end + def processed?; end +end + +module ActionMailbox::InboundEmail::MessageId + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionMailbox::InboundEmail::MessageId::ClassMethods +end + +module ActionMailbox::InboundEmail::MessageId::ClassMethods + def create_and_extract_message_id!(source, **options); end + + private + + def create_and_upload_raw_email!(source); end + def extract_message_id(source); end + def generate_missing_message_id(message_checksum); end +end + +module ActionMailbox::InboundEmail::Routable + extend ::ActiveSupport::Concern + + def route; end + def route_later; end +end + +class ActionMailbox::IncinerationJob < ::ActiveJob::Base + def perform(inbound_email); end + + class << self + def schedule(inbound_email); end + + private + + def __class_attr_queue_name; end + def __class_attr_queue_name=(new_value); end + def __class_attr_rescue_handlers; end + def __class_attr_rescue_handlers=(new_value); end + end +end + +module ActionMailbox::Ingresses; end +module ActionMailbox::Ingresses::Mailgun; end + +class ActionMailbox::Ingresses::Mailgun::InboundEmailsController < ::ActionMailbox::BaseController + def create; end + + private + + def _layout(lookup_context, formats, keys); end + def _layout_from_proc; end + def authenticate; end + def authenticated?; end + def key; end + def mail; end + + class << self + private + + def __class_attr___callbacks; end + def __class_attr___callbacks=(new_value); end + def __class_attr_config; end + def __class_attr_config=(new_value); end + def __class_attr_middleware_stack; end + def __class_attr_middleware_stack=(new_value); end + end +end + +class ActionMailbox::Ingresses::Mailgun::InboundEmailsController::Authenticator + def initialize(key:, timestamp:, token:, signature:); end + + def authenticated?; end + def key; end + def signature; end + def timestamp; end + def token; end + + private + + def expected_signature; end + def recent?; end + def signed?; end +end + +module ActionMailbox::Ingresses::Mandrill; end + +class ActionMailbox::Ingresses::Mandrill::InboundEmailsController < ::ActionMailbox::BaseController + def create; end + def health_check; end + + private + + def _layout(lookup_context, formats, keys); end + def _layout_from_proc; end + def authenticate; end + def authenticated?; end + def events; end + def key; end + def raw_emails; end + + class << self + private + + def __class_attr___callbacks; end + def __class_attr___callbacks=(new_value); end + def __class_attr_config; end + def __class_attr_config=(new_value); end + def __class_attr_middleware_stack; end + def __class_attr_middleware_stack=(new_value); end + end +end + +class ActionMailbox::Ingresses::Mandrill::InboundEmailsController::Authenticator + def initialize(request, key); end + + def authenticated?; end + def key; end + def request; end + + private + + def expected_signature; end + def given_signature; end + def message; end +end + +module ActionMailbox::Ingresses::Postmark; end + +class ActionMailbox::Ingresses::Postmark::InboundEmailsController < ::ActionMailbox::BaseController + def create; end + + private + + def _layout(lookup_context, formats, keys); end + def _layout_from_proc; end + def mail; end + + class << self + private + + def __class_attr___callbacks; end + def __class_attr___callbacks=(new_value); end + def __class_attr_config; end + def __class_attr_config=(new_value); end + def __class_attr_middleware_stack; end + def __class_attr_middleware_stack=(new_value); end + end +end + +module ActionMailbox::Ingresses::Relay; end + +class ActionMailbox::Ingresses::Relay::InboundEmailsController < ::ActionMailbox::BaseController + def create; end + + private + + def _layout(lookup_context, formats, keys); end + def _layout_from_proc; end + def require_valid_rfc822_message; end + + class << self + private + + def __class_attr___callbacks; end + def __class_attr___callbacks=(new_value); end + def __class_attr_config; end + def __class_attr_config=(new_value); end + def __class_attr_middleware_stack; end + def __class_attr_middleware_stack=(new_value); end + end +end + +module ActionMailbox::Ingresses::Sendgrid; end + +class ActionMailbox::Ingresses::Sendgrid::InboundEmailsController < ::ActionMailbox::BaseController + def create; end + + private + + def _layout(lookup_context, formats, keys); end + def _layout_from_proc; end + def envelope; end + def mail; end + + class << self + private + + def __class_attr___callbacks; end + def __class_attr___callbacks=(new_value); end + def __class_attr_config; end + def __class_attr_config=(new_value); end + def __class_attr_middleware_stack; end + def __class_attr_middleware_stack=(new_value); end + end +end + +class ActionMailbox::Record < ::ActiveRecord::Base + include ::ActionMailbox::Record::GeneratedAttributeMethods + include ::ActionMailbox::Record::GeneratedAssociationMethods + + class << self + private + + def __class_attr__validators; end + def __class_attr__validators=(new_value); end + def __class_attr_defined_enums; end + def __class_attr_defined_enums=(new_value); end + end +end + +module ActionMailbox::Record::GeneratedAssociationMethods; end +module ActionMailbox::Record::GeneratedAttributeMethods; end + +# = Action Mailbox \Router +# +# Encapsulates the routes that live on the ApplicationMailbox and performs the actual routing when +# an inbound_email is received. +# +# source://actionmailbox//lib/action_mailbox/router.rb#8 +class ActionMailbox::Router + # @return [Router] a new instance of Router + # + # source://actionmailbox//lib/action_mailbox/router.rb#11 + def initialize; end + + # source://actionmailbox//lib/action_mailbox/router.rb#21 + def add_route(address, to:); end + + # source://actionmailbox//lib/action_mailbox/router.rb#15 + def add_routes(routes); end + + # source://actionmailbox//lib/action_mailbox/router.rb#35 + def mailbox_for(inbound_email); end + + # source://actionmailbox//lib/action_mailbox/router.rb#25 + def route(inbound_email); end + + private + + # Returns the value of attribute routes. + # + # source://actionmailbox//lib/action_mailbox/router.rb#40 + def routes; end +end + +# source://actionmailbox//lib/action_mailbox/router/route.rb#7 +class ActionMailbox::Router::Route + # source://actionmailbox//lib/action_mailbox/router/route.rb#10 + def initialize(address, to:); end + + # source://actionmailbox//lib/action_mailbox/router/route.rb#8 + def address; end + + # source://actionmailbox//lib/action_mailbox/router/route.rb#31 + def mailbox_class; end + + # source://actionmailbox//lib/action_mailbox/router/route.rb#8 + def mailbox_name; end + + # source://actionmailbox//lib/action_mailbox/router/route.rb#16 + def match?(inbound_email); end + + private + + # source://actionmailbox//lib/action_mailbox/router/route.rb#36 + def ensure_valid_address; end +end + +# source://actionmailbox//lib/action_mailbox/router.rb#9 +class ActionMailbox::Router::RoutingError < ::StandardError; end + +# See ActionMailbox::Base for how to specify routing. +# +# source://actionmailbox//lib/action_mailbox/routing.rb#5 +module ActionMailbox::Routing + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionMailbox::Routing::ClassMethods +end + +# source://actionmailbox//lib/action_mailbox/routing.rb#12 +module ActionMailbox::Routing::ClassMethods + # source://actionmailbox//lib/action_mailbox/routing.rb#21 + def mailbox_for(inbound_email); end + + # source://actionmailbox//lib/action_mailbox/routing.rb#17 + def route(inbound_email); end + + # source://actionmailbox//lib/action_mailbox/routing.rb#13 + def routing(routes); end +end + +class ActionMailbox::RoutingJob < ::ActiveJob::Base + def perform(inbound_email); end + + class << self + private + + def __class_attr_queue_name; end + def __class_attr_queue_name=(new_value); end + end +end + +# source://actionmailbox//lib/action_mailbox/test_case.rb#7 +class ActionMailbox::TestCase < ::ActiveSupport::TestCase + include ::ActionMailbox::TestHelper +end + +# source://actionmailbox//lib/action_mailbox/test_helper.rb#6 +module ActionMailbox::TestHelper + # Create an InboundEmail record using an eml fixture in the format of message/rfc822 + # referenced with +fixture_name+ located in +test/fixtures/files/fixture_name+. + # + # source://actionmailbox//lib/action_mailbox/test_helper.rb#9 + def create_inbound_email_from_fixture(fixture_name, status: T.unsafe(nil)); end + + # Creates an InboundEmail by specifying through options or a block. + # + # ==== Options + # + # * :status - The +status+ to set for the created InboundEmail. + # For possible statuses, see its documentation. + # + # ==== Creating a simple email + # + # When you only need to set basic fields like +from+, +to+, +subject+, and + # +body+, you can pass them directly as options. + # + # create_inbound_email_from_mail(from: "david@loudthinking.com", subject: "Hello!") + # + # ==== Creating a multi-part email + # + # When you need to create a more intricate email, like a multi-part email + # that contains both a plaintext version and an HTML version, you can pass a + # block. + # + # create_inbound_email_from_mail do + # to "David Heinemeier Hansson " + # from "Bilbo Baggins " + # subject "Come down to the Shire!" + # + # text_part do + # body "Please join us for a party at Bag End" + # end + # + # html_part do + # body "

Please join us for a party at Bag End

" + # end + # end + # + # As with +Mail.new+, you can also use a block parameter to define the parts + # of the message: + # + # create_inbound_email_from_mail do |mail| + # mail.to "David Heinemeier Hansson " + # mail.from "Bilbo Baggins " + # mail.subject "Come down to the Shire!" + # + # mail.text_part do |part| + # part.body "Please join us for a party at Bag End" + # end + # + # mail.html_part do |part| + # part.body "

Please join us for a party at Bag End

" + # end + # end + # + # source://actionmailbox//lib/action_mailbox/test_helper.rb#63 + def create_inbound_email_from_mail(status: T.unsafe(nil), **mail_options, &block); end + + # Create an InboundEmail using the raw rfc822 +source+ as text. + # + # source://actionmailbox//lib/action_mailbox/test_helper.rb#72 + def create_inbound_email_from_source(source, status: T.unsafe(nil)); end + + # Create an InboundEmail from fixture using the same arguments as create_inbound_email_from_fixture + # and immediately route it to processing. + # + # source://actionmailbox//lib/action_mailbox/test_helper.rb#79 + def receive_inbound_email_from_fixture(*args); end + + # Create an InboundEmail using the same options or block as + # create_inbound_email_from_mail, then immediately route it for processing. + # + # source://actionmailbox//lib/action_mailbox/test_helper.rb#85 + def receive_inbound_email_from_mail(**kwargs, &block); end + + # Create an InboundEmail using the same arguments as create_inbound_email_from_source and immediately route it + # to processing. + # + # source://actionmailbox//lib/action_mailbox/test_helper.rb#91 + def receive_inbound_email_from_source(*args); end +end + +# source://actionmailbox//lib/action_mailbox/gem_version.rb#9 +module ActionMailbox::VERSION; end + +# source://actionmailbox//lib/action_mailbox/gem_version.rb#10 +ActionMailbox::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# source://actionmailbox//lib/action_mailbox/gem_version.rb#11 +ActionMailbox::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# source://actionmailbox//lib/action_mailbox/gem_version.rb#13 +ActionMailbox::VERSION::PRE = T.let(T.unsafe(nil), T.untyped) + +# source://actionmailbox//lib/action_mailbox/gem_version.rb#15 +ActionMailbox::VERSION::STRING = T.let(T.unsafe(nil), String) + +# source://actionmailbox//lib/action_mailbox/gem_version.rb#12 +ActionMailbox::VERSION::TINY = T.let(T.unsafe(nil), Integer) + +# source://actionmailbox//lib/action_mailbox/mail_ext/address_equality.rb#3 +module Mail + class << self + # source://actionmailbox//lib/action_mailbox/mail_ext/from_source.rb#4 + def from_source(source); end + end +end + +# source://actionmailbox//lib/action_mailbox/mail_ext/address_equality.rb#4 +class Mail::Address + # source://actionmailbox//lib/action_mailbox/mail_ext/address_equality.rb#5 + def ==(other_address); end + + class << self + # source://actionmailbox//lib/action_mailbox/mail_ext/address_wrapping.rb#5 + def wrap(address); end + end +end + +# source://actionmailbox//lib/action_mailbox/mail_ext/addresses.rb#4 +class Mail::Message + # source://actionmailbox//lib/action_mailbox/mail_ext/addresses.rb#25 + def bcc_addresses; end + + # source://actionmailbox//lib/action_mailbox/mail_ext/addresses.rb#21 + def cc_addresses; end + + # source://actionmailbox//lib/action_mailbox/mail_ext/addresses.rb#5 + def from_address; end + + # source://actionmailbox//lib/action_mailbox/mail_ext/recipients.rb#5 + def recipients; end + + # source://actionmailbox//lib/action_mailbox/mail_ext/addresses.rb#13 + def recipients_addresses; end + + # source://actionmailbox//lib/action_mailbox/mail_ext/addresses.rb#9 + def reply_to_address; end + + # source://actionmailbox//lib/action_mailbox/mail_ext/addresses.rb#17 + def to_addresses; end + + # source://actionmailbox//lib/action_mailbox/mail_ext/addresses.rb#33 + def x_forwarded_to_addresses; end + + # source://actionmailbox//lib/action_mailbox/mail_ext/addresses.rb#29 + def x_original_to_addresses; end + + private + + # source://actionmailbox//lib/action_mailbox/mail_ext/addresses.rb#38 + def address_list(obj); end +end + +module Rails; end +module Rails::Conductor; end +module Rails::Conductor::ActionMailbox; end +module Rails::Conductor::ActionMailbox::InboundEmails; end + +class Rails::Conductor::ActionMailbox::InboundEmails::SourcesController < ::Rails::Conductor::BaseController + def create; end + def new; end + + private + + def _layout(lookup_context, formats, keys); end + + class << self + private + + def __class_attr_config; end + def __class_attr_config=(new_value); end + def __class_attr_middleware_stack; end + def __class_attr_middleware_stack=(new_value); end + end +end + +class Rails::Conductor::ActionMailbox::InboundEmailsController < ::Rails::Conductor::BaseController + def create; end + def index; end + def new; end + def show; end + + private + + def _layout(lookup_context, formats, keys); end + def create_inbound_email(mail); end + def mail_params; end + def new_mail; end + + class << self + private + + def __class_attr_config; end + def __class_attr_config=(new_value); end + def __class_attr_middleware_stack; end + def __class_attr_middleware_stack=(new_value); end + end +end + +class Rails::Conductor::ActionMailbox::IncineratesController < ::Rails::Conductor::BaseController + def create; end + + private + + def _layout(lookup_context, formats, keys); end + + class << self + private + + def __class_attr_config; end + def __class_attr_config=(new_value); end + def __class_attr_middleware_stack; end + def __class_attr_middleware_stack=(new_value); end + end +end + +class Rails::Conductor::ActionMailbox::ReroutesController < ::Rails::Conductor::BaseController + def create; end + + private + + def _layout(lookup_context, formats, keys); end + def reroute(inbound_email); end + + class << self + private + + def __class_attr_config; end + def __class_attr_config=(new_value); end + def __class_attr_middleware_stack; end + def __class_attr_middleware_stack=(new_value); end + end +end + +class Rails::Conductor::BaseController < ::ActionController::Base + private + + def _layout(lookup_context, formats, keys); end + def _layout_from_proc; end + def ensure_development_env; end + + class << self + private + + def __class_attr___callbacks; end + def __class_attr___callbacks=(new_value); end + def __class_attr__layout; end + def __class_attr__layout=(new_value); end + def __class_attr__layout_conditions; end + def __class_attr__layout_conditions=(new_value); end + def __class_attr_config; end + def __class_attr_config=(new_value); end + def __class_attr_middleware_stack; end + def __class_attr_middleware_stack=(new_value); end + end +end diff --git a/sorbet/rbi/gems/actionmailer@8.1.1.rbi b/sorbet/rbi/gems/actionmailer@8.1.1.rbi new file mode 100644 index 0000000..3e4497e --- /dev/null +++ b/sorbet/rbi/gems/actionmailer@8.1.1.rbi @@ -0,0 +1,2838 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `actionmailer` gem. +# Please instead update this file by running `bin/tapioca gem actionmailer`. + + +# :include: ../README.rdoc +# +# source://actionmailer//lib/action_mailer/gem_version.rb#3 +module ActionMailer + extend ::ActiveSupport::Autoload + + class << self + # Enqueue many emails at once to be delivered through Active Job. + # When the individual job runs, it will send the email using +deliver_now+. + # + # source://actionmailer//lib/action_mailer/message_delivery.rb#9 + def deliver_all_later(*deliveries, **options); end + + # Enqueue many emails at once to be delivered through Active Job. + # When the individual job runs, it will send the email using +deliver_now!+. + # That means that the message will be sent bypassing checking +perform_deliveries+ + # and +raise_delivery_errors+, so use with caution. + # + # source://actionmailer//lib/action_mailer/message_delivery.rb#17 + def deliver_all_later!(*deliveries, **options); end + + # source://actionmailer//lib/action_mailer/deprecator.rb#4 + def deprecator; end + + # source://actionmailer//lib/action_mailer.rb#61 + def eager_load!; end + + # Returns the currently loaded version of Action Mailer as a +Gem::Version+. + # + # source://actionmailer//lib/action_mailer/gem_version.rb#5 + def gem_version; end + + # Returns the currently loaded version of Action Mailer as a + # +Gem::Version+. + # + # source://actionmailer//lib/action_mailer/version.rb#8 + def version; end + + private + + # source://actionmailer//lib/action_mailer/message_delivery.rb#22 + def _deliver_all_later(delivery_method, *deliveries, **options); end + end +end + +# = Action Mailer \Base +# +# Action Mailer allows you to send email from your application using a mailer model and views. +# +# == Mailer Models +# +# To use Action Mailer, you need to create a mailer model. +# +# $ bin/rails generate mailer Notifier +# +# The generated model inherits from ApplicationMailer which in turn +# inherits from +ActionMailer::Base+. A mailer model defines methods +# used to generate an email message. In these methods, you can set up variables to be used in +# the mailer views, options on the mail itself such as the :from address, and attachments. +# +# class ApplicationMailer < ActionMailer::Base +# default from: 'from@example.com' +# layout 'mailer' +# end +# +# class NotifierMailer < ApplicationMailer +# default from: 'no-reply@example.com', +# return_path: 'system@example.com' +# +# def welcome(recipient) +# @account = recipient +# mail(to: recipient.email_address_with_name, +# bcc: ["bcc@example.com", "Order Watcher "]) +# end +# end +# +# Within the mailer method, you have access to the following methods: +# +# * attachments[]= - Allows you to add attachments to your email in an intuitive +# manner; attachments['filename.png'] = File.read('path/to/filename.png') +# +# * attachments.inline[]= - Allows you to add an inline attachment to your email +# in the same manner as attachments[]= +# +# * headers[]= - Allows you to specify any header field in your email such +# as headers['X-No-Spam'] = 'True'. Note that declaring a header multiple times +# will add many fields of the same name. Read #headers doc for more information. +# +# * headers(hash) - Allows you to specify multiple headers in your email such +# as headers({'X-No-Spam' => 'True', 'In-Reply-To' => '1234@message.id'}) +# +# * mail - Allows you to specify email to be sent. +# +# The hash passed to the mail method allows you to specify any header that a +Mail::Message+ +# will accept (any valid email header including optional fields). +# +# The +mail+ method, if not passed a block, will inspect your views and send all the views with +# the same name as the method, so the above action would send the +welcome.text.erb+ view +# file as well as the +welcome.html.erb+ view file in a +multipart/alternative+ email. +# +# If you want to explicitly render only certain templates, pass a block: +# +# mail(to: user.email) do |format| +# format.text +# format.html +# end +# +# The block syntax is also useful in providing information specific to a part: +# +# mail(to: user.email) do |format| +# format.html +# end +# +# Or even to render a special view: +# +# mail(to: user.email) do |format| +# format.text +# format.html { render "some_other_template" } +# end +# +# == Mailer views +# +# Like Action Controller, each mailer class has a corresponding view directory in which each +# method of the class looks for a template with its name. +# +# To define a template to be used with a mailer, create an .erb file with the same +# name as the method in your mailer model. For example, in the mailer defined above, the template at +# app/views/notifier_mailer/welcome.text.erb would be used to generate the email. +# +# Variables defined in the methods of your mailer model are accessible as instance variables in their +# corresponding view. +# +# Emails by default are sent in plain text, so a sample view for our model example might look like this: +# +# Hi <%= @account.name %>, +# Thanks for joining our service! Please check back often. +# +# You can even use Action View helpers in these views. For example: +# +# You got a new note! +# <%= truncate(@note.body, length: 25) %> +# +# If you need to access the subject, from, or the recipients in the view, you can do that through message object: +# +# You got a new note from <%= message.from %>! +# <%= truncate(@note.body, length: 25) %> +# +# +# == Generating URLs +# +# URLs can be generated in mailer views using url_for or named routes. Unlike controllers from +# Action Pack, the mailer instance doesn't have any context about the incoming request, so you'll need +# to provide all of the details needed to generate a URL. +# +# When using url_for you'll need to provide the :host, :controller, and :action: +# +# <%= url_for(host: "example.com", controller: "welcome", action: "greeting") %> +# +# When using named routes you only need to supply the :host: +# +# <%= users_url(host: "example.com") %> +# +# You should use the named_route_url style (which generates absolute URLs) and avoid using the +# named_route_path style (which generates relative URLs), since clients reading the mail will +# have no concept of a current URL from which to determine a relative path. +# +# It is also possible to set a default host that will be used in all mailers by setting the :host +# option as a configuration option in config/application.rb: +# +# config.action_mailer.default_url_options = { host: "example.com" } +# +# You can also define a default_url_options method on individual mailers to override these +# default settings per-mailer. +# +# By default when config.force_ssl is +true+, URLs generated for hosts will use the HTTPS protocol. +# +# == Sending mail +# +# Once a mailer action and template are defined, you can deliver your message or defer its creation and +# delivery for later: +# +# NotifierMailer.welcome(User.first).deliver_now # sends the email +# mail = NotifierMailer.welcome(User.first) # => an ActionMailer::MessageDelivery object +# mail.deliver_now # generates and sends the email now +# +# The ActionMailer::MessageDelivery class is a wrapper around a delegate that will call +# your method to generate the mail. If you want direct access to the delegator, or +Mail::Message+, +# you can call the message method on the ActionMailer::MessageDelivery object. +# +# NotifierMailer.welcome(User.first).message # => a Mail::Message object +# +# Action Mailer is nicely integrated with Active Job so you can generate and send emails in the background +# (example: outside of the request-response cycle, so the user doesn't have to wait on it): +# +# NotifierMailer.welcome(User.first).deliver_later # enqueue the email sending to Active Job +# +# Note that deliver_later will execute your method from the background job. +# +# You never instantiate your mailer class. Rather, you just call the method you defined on the class itself. +# All instance methods are expected to return a message object to be sent. +# +# == Multipart Emails +# +# Multipart messages can also be used implicitly because Action Mailer will automatically detect and use +# multipart templates, where each template is named after the name of the action, followed by the content +# type. Each such detected template will be added to the message, as a separate part. +# +# For example, if the following templates exist: +# * signup_notification.text.erb +# * signup_notification.html.erb +# * signup_notification.xml.builder +# * signup_notification.yml.erb +# +# Each would be rendered and added as a separate part to the message, with the corresponding content +# type. The content type for the entire message is automatically set to multipart/alternative, +# which indicates that the email contains multiple different representations of the same email +# body. The same instance variables defined in the action are passed to all email templates. +# +# Implicit template rendering is not performed if any attachments or parts have been added to the email. +# This means that you'll have to manually add each part to the email and set the content type of the email +# to multipart/alternative. +# +# == Attachments +# +# Sending attachment in emails is easy: +# +# class NotifierMailer < ApplicationMailer +# def welcome(recipient) +# attachments['free_book.pdf'] = File.read('path/to/file.pdf') +# mail(to: recipient, subject: "New account information") +# end +# end +# +# Which will (if it had both a welcome.text.erb and welcome.html.erb +# template in the view directory), send a complete multipart/mixed email with two parts, +# the first part being a multipart/alternative with the text and HTML email parts inside, +# and the second being a application/pdf with a Base64 encoded copy of the file.pdf book +# with the filename +free_book.pdf+. +# +# If you need to send attachments with no content, you need to create an empty view for it, +# or add an empty body parameter like this: +# +# class NotifierMailer < ApplicationMailer +# def welcome(recipient) +# attachments['free_book.pdf'] = File.read('path/to/file.pdf') +# mail(to: recipient, subject: "New account information", body: "") +# end +# end +# +# You can also send attachments with HTML template, in this case you need to add body, attachments, +# and custom content type like this: +# +# class NotifierMailer < ApplicationMailer +# def welcome(recipient) +# attachments["free_book.pdf"] = File.read("path/to/file.pdf") +# mail(to: recipient, +# subject: "New account information", +# content_type: "text/html", +# body: "Hello there") +# end +# end +# +# == Inline Attachments +# +# You can also specify that a file should be displayed inline with other HTML. This is useful +# if you want to display a corporate logo or a photo. +# +# class NotifierMailer < ApplicationMailer +# def welcome(recipient) +# attachments.inline['photo.png'] = File.read('path/to/photo.png') +# mail(to: recipient, subject: "Here is what we look like") +# end +# end +# +# And then to reference the image in the view, you create a welcome.html.erb file and +# make a call to +image_tag+ passing in the attachment you want to display and then call +# +url+ on the attachment to get the relative content id path for the image source: +# +#

Please Don't Cringe

+# +# <%= image_tag attachments['photo.png'].url -%> +# +# As we are using Action View's +image_tag+ method, you can pass in any other options you want: +# +#

Please Don't Cringe

+# +# <%= image_tag attachments['photo.png'].url, alt: 'Our Photo', class: 'photo' -%> +# +# == Observing and Intercepting Mails +# +# Action Mailer provides hooks into the Mail observer and interceptor methods. These allow you to +# register classes that are called during the mail delivery life cycle. +# +# An observer class must implement the :delivered_email(message) method which will be +# called once for every email sent after the email has been sent. +# +# An interceptor class must implement the :delivering_email(message) method which will be +# called before the email is sent, allowing you to make modifications to the email before it hits +# the delivery agents. Your class should make any needed modifications directly to the passed +# in +Mail::Message+ instance. +# +# == Default \Hash +# +# Action Mailer provides some intelligent defaults for your emails, these are usually specified in a +# default method inside the class definition: +# +# class NotifierMailer < ApplicationMailer +# default sender: 'system@example.com' +# end +# +# You can pass in any header value that a +Mail::Message+ accepts. Out of the box, +# +ActionMailer::Base+ sets the following: +# +# * mime_version: "1.0" +# * charset: "UTF-8" +# * content_type: "text/plain" +# * parts_order: [ "text/plain", "text/enriched", "text/html" ] +# +# parts_order and charset are not actually valid +Mail::Message+ header fields, +# but Action Mailer translates them appropriately and sets the correct values. +# +# As you can pass in any header, you need to either quote the header as a string, or pass it in as +# an underscored symbol, so the following will work: +# +# class NotifierMailer < ApplicationMailer +# default 'Content-Transfer-Encoding' => '7bit', +# content_description: 'This is a description' +# end +# +# Finally, Action Mailer also supports passing Proc and Lambda objects into the default hash, +# so you can define methods that evaluate as the message is being generated: +# +# class NotifierMailer < ApplicationMailer +# default 'X-Special-Header' => Proc.new { my_method }, to: -> { @inviter.email_address } +# +# private +# def my_method +# 'some complex call' +# end +# end +# +# Note that the proc/lambda is evaluated right at the start of the mail message generation, so if you +# set something in the default hash using a proc, and then set the same thing inside of your +# mailer method, it will get overwritten by the mailer method. +# +# It is also possible to set these default options that will be used in all mailers through +# the default_options= configuration in config/application.rb: +# +# config.action_mailer.default_options = { from: "no-reply@example.org" } +# +# == \Callbacks +# +# You can specify callbacks using before_action and after_action for configuring your messages, +# and using before_deliver and after_deliver for wrapping the delivery process. +# For example, when you want to add default inline attachments and log delivery for all messages +# sent out by a certain mailer class: +# +# class NotifierMailer < ApplicationMailer +# before_action :add_inline_attachment! +# after_deliver :log_delivery +# +# def welcome +# mail +# end +# +# private +# def add_inline_attachment! +# attachments.inline["footer.jpg"] = File.read('/path/to/filename.jpg') +# end +# +# def log_delivery +# Rails.logger.info "Sent email with message id '#{message.message_id}' at #{Time.current}." +# end +# end +# +# Action callbacks in Action Mailer are implemented using +# AbstractController::Callbacks, so you can define and configure +# callbacks in the same manner that you would use callbacks in classes that +# inherit from ActionController::Base. +# +# Note that unless you have a specific reason to do so, you should prefer +# using before_action rather than after_action in your +# Action Mailer classes so that headers are parsed properly. +# +# == Rescuing Errors +# +# +rescue+ blocks inside of a mailer method cannot rescue errors that occur +# outside of rendering -- for example, record deserialization errors in a +# background job, or errors from a third-party mail delivery service. +# +# To rescue errors that occur during any part of the mailing process, use +# {rescue_from}[rdoc-ref:ActiveSupport::Rescuable::ClassMethods#rescue_from]: +# +# class NotifierMailer < ApplicationMailer +# rescue_from ActiveJob::DeserializationError do +# # ... +# end +# +# rescue_from "SomeThirdPartyService::ApiError" do +# # ... +# end +# +# def notify(recipient) +# mail(to: recipient, subject: "Notification") +# end +# end +# +# == Previewing emails +# +# You can preview your email templates visually by adding a mailer preview file to the +# ActionMailer::Base.preview_paths. Since most emails do something interesting +# with database data, you'll need to write some scenarios to load messages with fake data: +# +# class NotifierMailerPreview < ActionMailer::Preview +# def welcome +# NotifierMailer.welcome(User.first) +# end +# end +# +# Methods must return a +Mail::Message+ object which can be generated by calling the mailer +# method without the additional deliver_now / deliver_later. The location of the +# mailer preview directories can be configured using the preview_paths option which has a default +# of test/mailers/previews: +# +# config.action_mailer.preview_paths << "#{Rails.root}/lib/mailer_previews" +# +# An overview of all previews is accessible at http://localhost:3000/rails/mailers +# on a running development server instance. +# +# Previews can also be intercepted in a similar manner as deliveries can be by registering +# a preview interceptor that has a previewing_email method: +# +# class CssInlineStyler +# def self.previewing_email(message) +# # inline CSS styles +# end +# end +# +# config.action_mailer.preview_interceptors :css_inline_styler +# +# Note that interceptors need to be registered both with register_interceptor +# and register_preview_interceptor if they should operate on both sending and +# previewing emails. +# +# == Configuration options +# +# These options are specified on the class level, like +# ActionMailer::Base.raise_delivery_errors = true +# +# * default_options - You can pass this in at a class level as well as within the class itself as +# per the above section. +# +# * logger - the logger is used for generating information on the mailing run if available. +# Can be set to +nil+ for no logging. Compatible with both Ruby's own +Logger+ and Log4r loggers. +# +# * smtp_settings - Allows detailed configuration for :smtp delivery method: +# * :address - Allows you to use a remote mail server. Just change it from its default +# "localhost" setting. +# * :port - On the off chance that your mail server doesn't run on port 25, you can change it. +# * :domain - If you need to specify a HELO domain, you can do it here. +# * :user_name - If your mail server requires authentication, set the username in this setting. +# * :password - If your mail server requires authentication, set the password in this setting. +# * :authentication - If your mail server requires authentication, you need to specify the +# authentication type here. +# This is a symbol and one of :plain (will send the password Base64 encoded), :login (will +# send the password Base64 encoded) or :cram_md5 (combines a Challenge/Response mechanism to exchange +# information and a cryptographic Message Digest 5 algorithm to hash important information) +# * :enable_starttls - Use STARTTLS when connecting to your SMTP server and fail if unsupported. Defaults +# to false. Requires at least version 2.7 of the Mail gem. +# * :enable_starttls_auto - Detects if STARTTLS is enabled in your SMTP server and starts +# to use it. Defaults to true. +# * :openssl_verify_mode - When using TLS, you can set how OpenSSL checks the certificate. This is +# really useful if you need to validate a self-signed and/or a wildcard certificate. You can use the name +# of an OpenSSL verify constant ('none' or 'peer') or directly the constant +# (+OpenSSL::SSL::VERIFY_NONE+ or +OpenSSL::SSL::VERIFY_PEER+). +# * :ssl/:tls Enables the SMTP connection to use SMTP/TLS (SMTPS: SMTP over direct TLS connection) +# * :open_timeout Number of seconds to wait while attempting to open a connection. +# * :read_timeout Number of seconds to wait until timing-out a read(2) call. +# +# * sendmail_settings - Allows you to override options for the :sendmail delivery method. +# * :location - The location of the sendmail executable. Defaults to /usr/sbin/sendmail. +# * :arguments - The command line arguments. Defaults to %w[ -i ] with -f sender@address +# added automatically before the message is sent. +# +# * file_settings - Allows you to override options for the :file delivery method. +# * :location - The directory into which emails will be written. Defaults to the application +# tmp/mails. +# +# * raise_delivery_errors - Whether or not errors should be raised if the email fails to be delivered. +# +# * delivery_method - Defines a delivery method. Possible values are :smtp (default), +# :sendmail, :test, and :file. Or you may provide a custom delivery method +# object e.g. +MyOwnDeliveryMethodClass+. See the Mail gem documentation on the interface you need to +# implement for a custom delivery agent. +# +# * perform_deliveries - Determines whether emails are actually sent from Action Mailer when you +# call .deliver on an email message or on an Action Mailer method. This is on by default but can +# be turned off to aid in functional testing. +# +# * deliveries - Keeps an array of all the emails sent out through the Action Mailer with +# delivery_method :test. Most useful for unit and functional testing. +# +# * delivery_job - The job class used with deliver_later. Mailers can set this to use a +# custom delivery job. Defaults to +ActionMailer::MailDeliveryJob+. +# +# * deliver_later_queue_name - The queue name used by deliver_later with the default +# delivery_job. Mailers can set this to use a custom queue name. +# +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://actionmailer//lib/action_mailer/base.rb#477 +class ActionMailer::Base < ::AbstractController::Base + include ::ActionMailer::Callbacks + include ::ActiveSupport::Callbacks + include ::ActionMailer::DeliveryMethods + include ::ActionMailer::QueuedDelivery + include ::ActiveSupport::Rescuable + include ::ActionMailer::Rescuable + include ::ActionMailer::Parameterized + include ::ActionMailer::Previews + include ::ActionMailer::FormBuilder + include ::ActionView::ViewPaths + include ::AbstractController::Rendering + include ::AbstractController::Logger + include ::ActiveSupport::Benchmarkable + include ::AbstractController::Helpers + include ::AbstractController::Translation + include ::AbstractController::AssetPaths + include ::AbstractController::Callbacks + include ::AbstractController::Caching::Fragments + include ::AbstractController::Caching::ConfigMethods + include ::AbstractController::Caching + include ::ActionView::Rendering + include ::ActionView::Layouts + extend ::ActionMailer::Callbacks::ClassMethods + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::ActionMailer::DeliveryMethods::ClassMethods + extend ::ActiveSupport::Rescuable::ClassMethods + extend ::ActionMailer::Rescuable::ClassMethods + extend ::ActionMailer::Parameterized::ClassMethods + extend ::ActionMailer::Previews::ClassMethods + extend ::ActionMailer::FormBuilder::ClassMethods + extend ::ActionView::ViewPaths::ClassMethods + extend ::AbstractController::Helpers::Resolution + extend ::AbstractController::Helpers::ClassMethods + extend ::AbstractController::Callbacks::ClassMethods + extend ::AbstractController::Caching::Fragments::ClassMethods + extend ::AbstractController::Caching::ClassMethods + extend ::AbstractController::Caching::ConfigMethods + extend ::ActionView::Rendering::ClassMethods + extend ::ActionView::Layouts::ClassMethods + + # @return [Base] a new instance of Base + # + # source://actionmailer//lib/action_mailer/base.rb#639 + def initialize; end + + # source://actionmailer//lib/action_mailer/base.rb#478 + def __callbacks; end + + # source://actionmailer//lib/action_mailer/base.rb#478 + def _deliver_callbacks; end + + # source://actionmailer//lib/action_mailer/base.rb#491 + def _helper_methods; end + + # source://actionmailer//lib/action_mailer/base.rb#491 + def _helper_methods=(_arg0); end + + # source://actionmailer//lib/action_mailer/base.rb#491 + def _helper_methods?; end + + # source://actionmailer//lib/action_mailer/base.rb#497 + def _layout_conditions; end + + # source://actionmailer//lib/action_mailer/base.rb#497 + def _layout_conditions?; end + + # source://actionmailer//lib/action_mailer/base.rb#494 + def _process_action_callbacks; end + + # source://actionmailer//lib/action_mailer/base.rb#478 + def _run_deliver_callbacks; end + + # source://actionmailer//lib/action_mailer/base.rb#478 + def _run_deliver_callbacks!(&block); end + + # source://actionmailer//lib/action_mailer/base.rb#494 + def _run_process_action_callbacks(&block); end + + # source://actionmailer//lib/action_mailer/base.rb#494 + def _run_process_action_callbacks!(&block); end + + # source://actionmailer//lib/action_mailer/base.rb#495 + def _view_cache_dependencies; end + + # source://actionmailer//lib/action_mailer/base.rb#495 + def _view_cache_dependencies=(_arg0); end + + # source://actionmailer//lib/action_mailer/base.rb#495 + def _view_cache_dependencies?; end + + # source://actionmailer//lib/action_mailer/base.rb#493 + def asset_host(*_arg0, **_arg1, &_arg2); end + + # source://actionmailer//lib/action_mailer/base.rb#493 + def asset_host=(arg); end + + # source://actionmailer//lib/action_mailer/base.rb#493 + def assets_dir(*_arg0, **_arg1, &_arg2); end + + # source://actionmailer//lib/action_mailer/base.rb#493 + def assets_dir=(arg); end + + # Allows you to add attachments to an email, like so: + # + # mail.attachments['filename.jpg'] = File.read('/path/to/filename.jpg') + # + # If you do this, then Mail will take the file name and work out the mime type. + # It will also set the +Content-Type+, +Content-Disposition+, and +Content-Transfer-Encoding+, + # and encode the contents of the attachment in Base64. + # + # You can also specify overrides if you want by passing a hash instead of a string: + # + # mail.attachments['filename.jpg'] = {mime_type: 'application/gzip', + # content: File.read('/path/to/filename.jpg')} + # + # If you want to use encoding other than Base64 then you will need to pass encoding + # type along with the pre-encoded content as Mail doesn't know how to decode the + # data: + # + # file_content = SpecialEncode(File.read('/path/to/filename.jpg')) + # mail.attachments['filename.jpg'] = {mime_type: 'application/gzip', + # content: file_content } + # + # You can also search for specific attachments: + # + # # By Filename + # mail.attachments['filename.jpg'] # => Mail::Part object or nil + # + # # or by index + # mail.attachments[0] # => Mail::Part (first attachment) + # + # source://actionmailer//lib/action_mailer/base.rb#756 + def attachments; end + + # source://actionmailer//lib/action_mailer/base.rb#493 + def default_asset_host_protocol(*_arg0, **_arg1, &_arg2); end + + # source://actionmailer//lib/action_mailer/base.rb#493 + def default_asset_host_protocol=(arg); end + + # source://actionmailer//lib/action_mailer/base.rb#503 + def default_params; end + + # source://actionmailer//lib/action_mailer/base.rb#503 + def default_params=(_arg0); end + + # source://actionmailer//lib/action_mailer/base.rb#503 + def default_params?; end + + # source://actionmailer//lib/action_mailer/base.rb#495 + def default_static_extension(*_arg0, **_arg1, &_arg2); end + + # source://actionmailer//lib/action_mailer/base.rb#495 + def default_static_extension=(arg); end + + # source://actionmailer//lib/action_mailer/base.rb#480 + def deliver_later_queue_name; end + + # source://actionmailer//lib/action_mailer/base.rb#480 + def deliver_later_queue_name=(_arg0); end + + # source://actionmailer//lib/action_mailer/base.rb#480 + def deliver_later_queue_name?; end + + # source://actionmailer//lib/action_mailer/base.rb#480 + def delivery_job; end + + # source://actionmailer//lib/action_mailer/base.rb#480 + def delivery_job=(_arg0); end + + # source://actionmailer//lib/action_mailer/base.rb#480 + def delivery_job?; end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def delivery_method; end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def delivery_method=(_arg0); end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def delivery_method?; end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def delivery_methods; end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def delivery_methods=(_arg0); end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def delivery_methods?; end + + # Returns an email in the format "Name ". + # + # If the name is a blank string, it returns just the address. + # + # source://actionmailer//lib/action_mailer/base.rb#680 + def email_address_with_name(address, name); end + + # source://actionmailer//lib/action_mailer/base.rb#495 + def enable_fragment_cache_logging(*_arg0, **_arg1, &_arg2); end + + # source://actionmailer//lib/action_mailer/base.rb#495 + def enable_fragment_cache_logging=(arg); end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def file_settings; end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def file_settings=(_arg0); end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def file_settings?; end + + # source://actionmailer//lib/action_mailer/base.rb#495 + def fragment_cache_keys; end + + # source://actionmailer//lib/action_mailer/base.rb#495 + def fragment_cache_keys=(_arg0); end + + # source://actionmailer//lib/action_mailer/base.rb#495 + def fragment_cache_keys?; end + + # Allows you to pass random and unusual headers to the new +Mail::Message+ + # object which will add them to itself. + # + # headers['X-Special-Domain-Specific-Header'] = "SecretValue" + # + # You can also pass a hash into headers of header field names and values, + # which will then be set on the +Mail::Message+ object: + # + # headers 'X-Special-Domain-Specific-Header' => "SecretValue", + # 'In-Reply-To' => incoming.message_id + # + # The resulting +Mail::Message+ will have the following in its header: + # + # X-Special-Domain-Specific-Header: SecretValue + # + # Note about replacing already defined headers: + # + # * +subject+ + # * +sender+ + # * +from+ + # * +to+ + # * +cc+ + # * +bcc+ + # * +reply-to+ + # * +orig-date+ + # * +message-id+ + # * +references+ + # + # Fields can only appear once in email headers while other fields such as + # X-Anything can appear multiple times. + # + # If you want to replace any header which already exists, first set it to + # +nil+ in order to reset the value otherwise another field will be added + # for the same header. + # + # source://actionmailer//lib/action_mailer/base.rb#718 + def headers(args = T.unsafe(nil)); end + + # source://actionmailer//lib/action_mailer/base.rb#493 + def javascripts_dir(*_arg0, **_arg1, &_arg2); end + + # source://actionmailer//lib/action_mailer/base.rb#493 + def javascripts_dir=(arg); end + + # source://actionmailer//lib/action_mailer/base.rb#490 + def logger(*_arg0, **_arg1, &_arg2); end + + # source://actionmailer//lib/action_mailer/base.rb#490 + def logger=(arg); end + + # The main method that creates the message and renders the email templates. There are + # two ways to call this method, with a block, or without a block. + # + # It accepts a headers hash. This hash allows you to specify + # the most used headers in an email message, these are: + # + # * +:subject+ - The subject of the message, if this is omitted, Action Mailer will + # ask the \Rails I18n class for a translated +:subject+ in the scope of + # [mailer_scope, action_name] or if this is missing, will translate the + # humanized version of the +action_name+ + # * +:to+ - Who the message is destined for, can be a string of addresses, or an array + # of addresses. + # * +:from+ - Who the message is from + # * +:cc+ - Who you would like to Carbon-Copy on this email, can be a string of addresses, + # or an array of addresses. + # * +:bcc+ - Who you would like to Blind-Carbon-Copy on this email, can be a string of + # addresses, or an array of addresses. + # * +:reply_to+ - Who to set the +Reply-To+ header of the email to. + # * +:date+ - The date to say the email was sent on. + # + # You can set default values for any of the above headers (except +:date+) + # by using the ::default class method: + # + # class Notifier < ActionMailer::Base + # default from: 'no-reply@test.lindsaar.net', + # bcc: 'email_logger@test.lindsaar.net', + # reply_to: 'bounces@test.lindsaar.net' + # end + # + # If you need other headers not listed above, you can either pass them in + # as part of the headers hash or use the headers['name'] = value + # method. + # + # When a +:return_path+ is specified as header, that value will be used as + # the 'envelope from' address for the Mail message. Setting this is useful + # when you want delivery notifications sent to a different address than the + # one in +:from+. Mail will actually use the +:return_path+ in preference + # to the +:sender+ in preference to the +:from+ field for the 'envelope + # from' value. + # + # If you do not pass a block to the +mail+ method, it will find all + # templates in the view paths using by default the mailer name and the + # method name that it is being called from, it will then create parts for + # each of these templates intelligently, making educated guesses on correct + # content type and sequence, and return a fully prepared +Mail::Message+ + # ready to call :deliver on to send. + # + # For example: + # + # class Notifier < ActionMailer::Base + # default from: 'no-reply@test.lindsaar.net' + # + # def welcome + # mail(to: 'mikel@test.lindsaar.net') + # end + # end + # + # Will look for all templates at "app/views/notifier" with name "welcome". + # If no welcome template exists, it will raise an ActionView::MissingTemplate error. + # + # However, those can be customized: + # + # mail(template_path: 'notifications', template_name: 'another') + # + # And now it will look for all templates at "app/views/notifications" with name "another". + # + # If you do pass a block, you can render specific templates of your choice: + # + # mail(to: 'mikel@test.lindsaar.net') do |format| + # format.text + # format.html + # end + # + # You can even render plain text directly without using a template: + # + # mail(to: 'mikel@test.lindsaar.net') do |format| + # format.text { render plain: "Hello Mikel!" } + # format.html { render html: "

Hello Mikel!

".html_safe } + # end + # + # Which will render a +multipart/alternative+ email with +text/plain+ and + # +text/html+ parts. + # + # The block syntax also allows you to customize the part headers if desired: + # + # mail(to: 'mikel@test.lindsaar.net') do |format| + # format.html + # end + # + # source://actionmailer//lib/action_mailer/base.rb#865 + def mail(headers = T.unsafe(nil), &block); end + + # Returns the name of the mailer object. + # + # source://actionmailer//lib/action_mailer/base.rb#673 + def mailer_name; end + + # source://actionmailer//lib/action_mailer/base.rb#637 + def message; end + + # source://actionmailer//lib/action_mailer/base.rb#637 + def message=(_arg0); end + + # source://actionmailer//lib/action_mailer/base.rb#482 + def params; end + + # source://actionmailer//lib/action_mailer/base.rb#482 + def params=(_arg0); end + + # source://actionmailer//lib/action_mailer/base.rb#495 + def perform_caching(*_arg0, **_arg1, &_arg2); end + + # source://actionmailer//lib/action_mailer/base.rb#495 + def perform_caching=(arg); end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def perform_deliveries; end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def perform_deliveries=(val); end + + # source://actionmailer//lib/action_mailer/base.rb#483 + def preview_interceptors; end + + # source://actionmailer//lib/action_mailer/base.rb#483 + def preview_paths; end + + # source://actionmailer//lib/action_mailer/base.rb#645 + def process(method_name, *args, **_arg2); end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def raise_delivery_errors; end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def raise_delivery_errors=(val); end + + # source://actionmailer//lib/action_mailer/base.rb#494 + def raise_on_missing_callback_actions; end + + # source://actionmailer//lib/action_mailer/base.rb#494 + def raise_on_missing_callback_actions=(val); end + + # source://actionmailer//lib/action_mailer/base.rb#493 + def relative_url_root(*_arg0, **_arg1, &_arg2); end + + # source://actionmailer//lib/action_mailer/base.rb#493 + def relative_url_root=(arg); end + + # source://actionmailer//lib/action_mailer/base.rb#481 + def rescue_handlers; end + + # source://actionmailer//lib/action_mailer/base.rb#481 + def rescue_handlers=(_arg0); end + + # source://actionmailer//lib/action_mailer/base.rb#481 + def rescue_handlers?; end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def sendmail_settings; end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def sendmail_settings=(_arg0); end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def sendmail_settings?; end + + # source://actionmailer//lib/action_mailer/base.rb#483 + def show_previews; end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def smtp_settings; end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def smtp_settings=(_arg0); end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def smtp_settings?; end + + # source://actionmailer//lib/action_mailer/base.rb#493 + def stylesheets_dir(*_arg0, **_arg1, &_arg2); end + + # source://actionmailer//lib/action_mailer/base.rb#493 + def stylesheets_dir=(arg); end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def test_settings; end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def test_settings=(_arg0); end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def test_settings?; end + + private + + # source://actionmailer//lib/action_mailer/base.rb#497 + def _layout(lookup_context, formats, keys); end + + # source://actionmailer//lib/action_mailer/base.rb#1066 + def _protected_ivars; end + + # source://actionmailer//lib/action_mailer/base.rb#942 + def apply_defaults(headers); end + + # source://actionmailer//lib/action_mailer/base.rb#962 + def assign_headers_to_message(message, headers); end + + # source://actionmailer//lib/action_mailer/base.rb#968 + def collect_responses(headers, &block); end + + # @yield [collector] + # + # source://actionmailer//lib/action_mailer/base.rb#978 + def collect_responses_from_block(headers); end + + # source://actionmailer//lib/action_mailer/base.rb#992 + def collect_responses_from_templates(headers); end + + # source://actionmailer//lib/action_mailer/base.rb#985 + def collect_responses_from_text(headers); end + + # source://actionmailer//lib/action_mailer/base.rb#952 + def compute_default(value); end + + # source://actionmailer//lib/action_mailer/base.rb#1035 + def create_parts_from_responses(m, responses); end + + # Translates the +subject+ using \Rails I18n class under [mailer_scope, action_name] scope. + # If it does not find a translation for the +subject+ under the specified scope it will default to a + # humanized version of the action_name. + # If the subject has interpolations, you can pass them through the +interpolations+ parameter. + # + # source://actionmailer//lib/action_mailer/base.rb#932 + def default_i18n_subject(interpolations = T.unsafe(nil)); end + + # source://actionmailer//lib/action_mailer/base.rb#1005 + def each_template(paths, name, &block); end + + # source://actionmailer//lib/action_mailer/base.rb#1048 + def insert_part(container, response, charset); end + + # source://actionmailer//lib/action_mailer/base.rb#1062 + def instrument_name; end + + # This and #instrument_name is for caching instrument + # + # source://actionmailer//lib/action_mailer/base.rb#1055 + def instrument_payload(key); end + + # Used by #mail to set the content type of the message. + # + # It will use the given +user_content_type+, or multipart if the mail + # message has any attachments. If the attachments are inline, the content + # type will be "multipart/related", otherwise "multipart/mixed". + # + # If there is no content type passed in via headers, and there are no + # attachments, or the message is multipart, then the default content type is + # used. + # + # source://actionmailer//lib/action_mailer/base.rb#910 + def set_content_type(m, user_content_type, class_default); end + + # source://actionmailer//lib/action_mailer/base.rb#1014 + def wrap_inline_attachments(message); end + + class << self + # source://actionmailer//lib/action_mailer/base.rb#478 + def __callbacks; end + + # source://actionmailer//lib/action_mailer/base.rb#478 + def __callbacks=(value); end + + # source://actionmailer//lib/action_mailer/base.rb#484 + def _default_form_builder; end + + # source://actionmailer//lib/action_mailer/base.rb#484 + def _default_form_builder=(value); end + + # source://actionmailer//lib/action_mailer/base.rb#484 + def _default_form_builder?; end + + # source://actionmailer//lib/action_mailer/base.rb#478 + def _deliver_callbacks; end + + # source://actionmailer//lib/action_mailer/base.rb#478 + def _deliver_callbacks=(value); end + + # source://actionmailer//lib/action_mailer/base.rb#491 + def _helper_methods; end + + # source://actionmailer//lib/action_mailer/base.rb#491 + def _helper_methods=(value); end + + # source://actionmailer//lib/action_mailer/base.rb#491 + def _helper_methods?; end + + # source://actionmailer//lib/action_mailer/base.rb#491 + def _helpers; end + + # source://actionmailer//lib/action_mailer/base.rb#497 + def _layout; end + + # source://actionmailer//lib/action_mailer/base.rb#497 + def _layout=(value); end + + # source://actionmailer//lib/action_mailer/base.rb#497 + def _layout?; end + + # source://actionmailer//lib/action_mailer/base.rb#497 + def _layout_conditions; end + + # source://actionmailer//lib/action_mailer/base.rb#497 + def _layout_conditions=(value); end + + # source://actionmailer//lib/action_mailer/base.rb#497 + def _layout_conditions?; end + + # source://actionmailer//lib/action_mailer/base.rb#494 + def _process_action_callbacks; end + + # source://actionmailer//lib/action_mailer/base.rb#494 + def _process_action_callbacks=(value); end + + # source://actionmailer//lib/action_mailer/base.rb#495 + def _view_cache_dependencies; end + + # source://actionmailer//lib/action_mailer/base.rb#495 + def _view_cache_dependencies=(value); end + + # source://actionmailer//lib/action_mailer/base.rb#495 + def _view_cache_dependencies?; end + + # source://actionmailer//lib/action_mailer/base.rb#493 + def asset_host(*_arg0, **_arg1, &_arg2); end + + # source://actionmailer//lib/action_mailer/base.rb#493 + def asset_host=(arg); end + + # source://actionmailer//lib/action_mailer/base.rb#493 + def assets_dir(*_arg0, **_arg1, &_arg2); end + + # source://actionmailer//lib/action_mailer/base.rb#493 + def assets_dir=(arg); end + + # Returns the name of the current mailer. This method is also being used as a path for a view lookup. + # If this is an anonymous mailer, this method will return +anonymous+ instead. + # + # source://actionmailer//lib/action_mailer/base.rb#576 + def controller_path; end + + # Allows to set defaults through app configuration: + # + # config.action_mailer.default_options = { from: "no-reply@example.org" } + # + # source://actionmailer//lib/action_mailer/base.rb#581 + def default(value = T.unsafe(nil)); end + + # source://actionmailer//lib/action_mailer/base.rb#493 + def default_asset_host_protocol(*_arg0, **_arg1, &_arg2); end + + # source://actionmailer//lib/action_mailer/base.rb#493 + def default_asset_host_protocol=(arg); end + + # Allows to set defaults through app configuration: + # + # config.action_mailer.default_options = { from: "no-reply@example.org" } + # + # source://actionmailer//lib/action_mailer/base.rb#585 + def default_options=(value = T.unsafe(nil)); end + + # source://actionmailer//lib/action_mailer/base.rb#503 + def default_params; end + + # source://actionmailer//lib/action_mailer/base.rb#503 + def default_params=(value); end + + # source://actionmailer//lib/action_mailer/base.rb#503 + def default_params?; end + + # source://actionmailer//lib/action_mailer/base.rb#495 + def default_static_extension(*_arg0, **_arg1, &_arg2); end + + # source://actionmailer//lib/action_mailer/base.rb#495 + def default_static_extension=(arg); end + + # source://actionmailer//lib/action_mailer/base.rb#480 + def deliver_later_queue_name; end + + # source://actionmailer//lib/action_mailer/base.rb#480 + def deliver_later_queue_name=(value); end + + # source://actionmailer//lib/action_mailer/base.rb#480 + def deliver_later_queue_name?; end + + # Wraps an email delivery inside of ActiveSupport::Notifications instrumentation. + # + # This method is actually called by the +Mail::Message+ object itself + # through a callback when you call :deliver on the +Mail::Message+, + # calling +deliver_mail+ directly and passing a +Mail::Message+ will do + # nothing except tell the logger you sent the email. + # + # source://actionmailer//lib/action_mailer/base.rb#593 + def deliver_mail(mail); end + + # source://actionmailer//lib/action_mailer/base.rb#480 + def delivery_job; end + + # source://actionmailer//lib/action_mailer/base.rb#480 + def delivery_job=(value); end + + # source://actionmailer//lib/action_mailer/base.rb#480 + def delivery_job?; end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def delivery_method; end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def delivery_method=(value); end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def delivery_method?; end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def delivery_methods; end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def delivery_methods=(value); end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def delivery_methods?; end + + # Returns an email in the format "Name ". + # + # If the name is a blank string, it returns just the address. + # + # source://actionmailer//lib/action_mailer/base.rb#603 + def email_address_with_name(address, name); end + + # source://actionmailer//lib/action_mailer/base.rb#495 + def enable_fragment_cache_logging(*_arg0, **_arg1, &_arg2); end + + # source://actionmailer//lib/action_mailer/base.rb#495 + def enable_fragment_cache_logging=(arg); end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def file_settings; end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def file_settings=(value); end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def file_settings?; end + + # source://actionmailer//lib/action_mailer/base.rb#495 + def fragment_cache_keys; end + + # source://actionmailer//lib/action_mailer/base.rb#495 + def fragment_cache_keys=(value); end + + # source://actionmailer//lib/action_mailer/base.rb#495 + def fragment_cache_keys?; end + + # source://actionmailer//lib/action_mailer/base.rb#493 + def javascripts_dir(*_arg0, **_arg1, &_arg2); end + + # source://actionmailer//lib/action_mailer/base.rb#493 + def javascripts_dir=(arg); end + + # source://actionmailer//lib/action_mailer/base.rb#490 + def logger(*_arg0, **_arg1, &_arg2); end + + # source://actionmailer//lib/action_mailer/base.rb#490 + def logger=(arg); end + + # Returns the name of the current mailer. This method is also being used as a path for a view lookup. + # If this is an anonymous mailer, this method will return +anonymous+ instead. + # + # source://actionmailer//lib/action_mailer/base.rb#571 + def mailer_name; end + + # Allows to set the name of current mailer. + # + # source://actionmailer//lib/action_mailer/base.rb#575 + def mailer_name=(_arg0); end + + # source://actionmailer//lib/action_mailer/base.rb#495 + def perform_caching(*_arg0, **_arg1, &_arg2); end + + # source://actionmailer//lib/action_mailer/base.rb#495 + def perform_caching=(arg); end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def perform_deliveries; end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def perform_deliveries=(val); end + + # source://actionmailer//lib/action_mailer/base.rb#483 + def preview_interceptors; end + + # source://actionmailer//lib/action_mailer/base.rb#483 + def preview_interceptors=(val); end + + # source://actionmailer//lib/action_mailer/base.rb#483 + def preview_paths; end + + # source://actionmailer//lib/action_mailer/base.rb#483 + def preview_paths=(val); end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def raise_delivery_errors; end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def raise_delivery_errors=(val); end + + # source://actionmailer//lib/action_mailer/base.rb#494 + def raise_on_missing_callback_actions; end + + # source://actionmailer//lib/action_mailer/base.rb#494 + def raise_on_missing_callback_actions=(val); end + + # Register an Interceptor which will be called before mail is sent. + # Either a class, string, or symbol can be passed in as the Interceptor. + # If a string or symbol is passed in it will be camelized and constantized. + # + # source://actionmailer//lib/action_mailer/base.rb#548 + def register_interceptor(interceptor); end + + # Register one or more Interceptors which will be called before mail is sent. + # + # source://actionmailer//lib/action_mailer/base.rb#522 + def register_interceptors(*interceptors); end + + # Register an Observer which will be notified when mail is delivered. + # Either a class, string, or symbol can be passed in as the Observer. + # If a string or symbol is passed in it will be camelized and constantized. + # + # source://actionmailer//lib/action_mailer/base.rb#534 + def register_observer(observer); end + + # Register one or more Observers which will be notified when mail is delivered. + # + # source://actionmailer//lib/action_mailer/base.rb#512 + def register_observers(*observers); end + + # source://actionmailer//lib/action_mailer/base.rb#493 + def relative_url_root(*_arg0, **_arg1, &_arg2); end + + # source://actionmailer//lib/action_mailer/base.rb#493 + def relative_url_root=(arg); end + + # source://actionmailer//lib/action_mailer/base.rb#481 + def rescue_handlers; end + + # source://actionmailer//lib/action_mailer/base.rb#481 + def rescue_handlers=(value); end + + # source://actionmailer//lib/action_mailer/base.rb#481 + def rescue_handlers?; end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def sendmail_settings; end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def sendmail_settings=(value); end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def sendmail_settings?; end + + # source://actionmailer//lib/action_mailer/base.rb#483 + def show_previews; end + + # source://actionmailer//lib/action_mailer/base.rb#483 + def show_previews=(val); end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def smtp_settings; end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def smtp_settings=(value); end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def smtp_settings?; end + + # source://actionmailer//lib/action_mailer/base.rb#493 + def stylesheets_dir(*_arg0, **_arg1, &_arg2); end + + # source://actionmailer//lib/action_mailer/base.rb#493 + def stylesheets_dir=(arg); end + + # Emails do not support relative path links. + # + # @return [Boolean] + # + # source://actionmailer//lib/action_mailer/base.rb#938 + def supports_path?; end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def test_settings; end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def test_settings=(value); end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def test_settings?; end + + # Unregister a previously registered Interceptor. + # Either a class, string, or symbol can be passed in as the Interceptor. + # If a string or symbol is passed in it will be camelized and constantized. + # + # source://actionmailer//lib/action_mailer/base.rb#555 + def unregister_interceptor(interceptor); end + + # Unregister one or more previously registered Interceptors. + # + # source://actionmailer//lib/action_mailer/base.rb#527 + def unregister_interceptors(*interceptors); end + + # Unregister a previously registered Observer. + # Either a class, string, or symbol can be passed in as the Observer. + # If a string or symbol is passed in it will be camelized and constantized. + # + # source://actionmailer//lib/action_mailer/base.rb#541 + def unregister_observer(observer); end + + # Unregister one or more previously registered Observers. + # + # source://actionmailer//lib/action_mailer/base.rb#517 + def unregister_observers(*observers); end + + private + + # source://actionmailer//lib/action_mailer/base.rb#478 + def __class_attr___callbacks; end + + # source://actionmailer//lib/action_mailer/base.rb#478 + def __class_attr___callbacks=(new_value); end + + # source://actionmailer//lib/action_mailer/base.rb#484 + def __class_attr__default_form_builder; end + + # source://actionmailer//lib/action_mailer/base.rb#484 + def __class_attr__default_form_builder=(new_value); end + + # source://actionmailer//lib/action_mailer/base.rb#491 + def __class_attr__helper_methods; end + + # source://actionmailer//lib/action_mailer/base.rb#491 + def __class_attr__helper_methods=(new_value); end + + # source://actionmailer//lib/action_mailer/base.rb#497 + def __class_attr__layout; end + + # source://actionmailer//lib/action_mailer/base.rb#497 + def __class_attr__layout=(new_value); end + + # source://actionmailer//lib/action_mailer/base.rb#497 + def __class_attr__layout_conditions; end + + # source://actionmailer//lib/action_mailer/base.rb#497 + def __class_attr__layout_conditions=(new_value); end + + # source://actionmailer//lib/action_mailer/base.rb#495 + def __class_attr__view_cache_dependencies; end + + # source://actionmailer//lib/action_mailer/base.rb#495 + def __class_attr__view_cache_dependencies=(new_value); end + + # source://actionmailer//lib/action_mailer/base.rb#477 + def __class_attr_config; end + + # source://actionmailer//lib/action_mailer/base.rb#477 + def __class_attr_config=(new_value); end + + # source://actionmailer//lib/action_mailer/base.rb#503 + def __class_attr_default_params; end + + # source://actionmailer//lib/action_mailer/base.rb#503 + def __class_attr_default_params=(new_value); end + + # source://actionmailer//lib/action_mailer/base.rb#480 + def __class_attr_deliver_later_queue_name; end + + # source://actionmailer//lib/action_mailer/base.rb#480 + def __class_attr_deliver_later_queue_name=(new_value); end + + # source://actionmailer//lib/action_mailer/base.rb#480 + def __class_attr_delivery_job; end + + # source://actionmailer//lib/action_mailer/base.rb#480 + def __class_attr_delivery_job=(new_value); end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def __class_attr_delivery_method; end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def __class_attr_delivery_method=(new_value); end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def __class_attr_delivery_methods; end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def __class_attr_delivery_methods=(new_value); end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def __class_attr_file_settings; end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def __class_attr_file_settings=(new_value); end + + # source://actionmailer//lib/action_mailer/base.rb#495 + def __class_attr_fragment_cache_keys; end + + # source://actionmailer//lib/action_mailer/base.rb#495 + def __class_attr_fragment_cache_keys=(new_value); end + + # source://actionmailer//lib/action_mailer/base.rb#481 + def __class_attr_rescue_handlers; end + + # source://actionmailer//lib/action_mailer/base.rb#481 + def __class_attr_rescue_handlers=(new_value); end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def __class_attr_sendmail_settings; end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def __class_attr_sendmail_settings=(new_value); end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def __class_attr_smtp_settings; end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def __class_attr_smtp_settings=(new_value); end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def __class_attr_test_settings; end + + # source://actionmailer//lib/action_mailer/base.rb#479 + def __class_attr_test_settings=(new_value); end + + # source://actionmailer//lib/action_mailer/base.rb#624 + def method_missing(method_name, *_arg1, **_arg2, &_arg3); end + + # source://actionmailer//lib/action_mailer/base.rb#559 + def observer_class_for(value); end + + # @return [Boolean] + # + # source://actionmailer//lib/action_mailer/base.rb#632 + def respond_to_missing?(method, include_all = T.unsafe(nil)); end + + # source://actionmailer//lib/action_mailer/base.rb#611 + def set_payload_for_mail(payload, mail); end + end +end + +# source://actionmailer//lib/action_mailer/base.rb#491 +module ActionMailer::Base::HelperMethods + include ::ActionMailer::MailHelper + include ::ActionText::ContentHelper + include ::ActionText::TagHelper + + # source://actionmailer//lib/action_mailer/base.rb#495 + def combined_fragment_cache_key(*_arg0, **_arg1, &_arg2); end + + # source://actionmailer//lib/action_mailer/base.rb#495 + def view_cache_dependencies(*_arg0, **_arg1, &_arg2); end +end + +# source://actionmailer//lib/action_mailer/base.rb#764 +class ActionMailer::Base::LateAttachmentsProxy < ::SimpleDelegator + # source://actionmailer//lib/action_mailer/base.rb#766 + def []=(_name, _content); end + + # source://actionmailer//lib/action_mailer/base.rb#765 + def inline; end + + private + + # @raise [RuntimeError] + # + # source://actionmailer//lib/action_mailer/base.rb#769 + def _raise_error; end +end + +# source://actionmailer//lib/action_mailer/base.rb#659 +class ActionMailer::Base::NullMail + # source://actionmailer//lib/action_mailer/base.rb#660 + def body; end + + # source://actionmailer//lib/action_mailer/base.rb#661 + def header; end + + # source://actionmailer//lib/action_mailer/base.rb#667 + def method_missing(*_arg0, **_arg1, &_arg2); end + + # @return [Boolean] + # + # source://actionmailer//lib/action_mailer/base.rb#663 + def respond_to?(string, include_all = T.unsafe(nil)); end +end + +# source://actionmailer//lib/action_mailer/base.rb#499 +ActionMailer::Base::PROTECTED_IVARS = T.let(T.unsafe(nil), Array) + +# source://actionmailer//lib/action_mailer/callbacks.rb#4 +module ActionMailer::Callbacks + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActiveSupport::Callbacks + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionMailer::Callbacks::ClassMethods + mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods + mixes_in_class_methods ::ActiveSupport::DescendantsTracker + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + end + + module GeneratedInstanceMethods + def __callbacks; end + end +end + +# source://actionmailer//lib/action_mailer/callbacks.rb#14 +module ActionMailer::Callbacks::ClassMethods + # Defines a callback that will get called right after the + # message's delivery method is finished. + # + # source://actionmailer//lib/action_mailer/callbacks.rb#23 + def after_deliver(*filters, &blk); end + + # Defines a callback that will get called around the message's deliver method. + # + # source://actionmailer//lib/action_mailer/callbacks.rb#28 + def around_deliver(*filters, &blk); end + + # Defines a callback that will get called right before the + # message is sent to the delivery method. + # + # source://actionmailer//lib/action_mailer/callbacks.rb#17 + def before_deliver(*filters, &blk); end + + # source://actionmailer//lib/action_mailer/callbacks.rb#32 + def internal_methods; end +end + +# source://actionmailer//lib/action_mailer/callbacks.rb#7 +ActionMailer::Callbacks::DEFAULT_INTERNAL_METHODS = T.let(T.unsafe(nil), Array) + +# source://actionmailer//lib/action_mailer/collector.rb#8 +class ActionMailer::Collector + include ::AbstractController::Collector + + # @return [Collector] a new instance of Collector + # + # source://actionmailer//lib/action_mailer/collector.rb#12 + def initialize(context, &block); end + + # @raise [ArgumentError] + # + # source://actionmailer//lib/action_mailer/collector.rb#23 + def all(*args, &block); end + + # @raise [ArgumentError] + # + # source://actionmailer//lib/action_mailer/collector.rb#18 + def any(*args, &block); end + + # source://actionmailer//lib/action_mailer/collector.rb#25 + def custom(mime, options = T.unsafe(nil)); end + + # Returns the value of attribute responses. + # + # source://actionmailer//lib/action_mailer/collector.rb#10 + def responses; end +end + +# = Action Mailer \DeliveryMethods +# +# This module handles everything related to mail delivery, from registering +# new delivery methods to configuring the mail object to be sent. +# +# source://actionmailer//lib/action_mailer/delivery_methods.rb#10 +module ActionMailer::DeliveryMethods + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionMailer::DeliveryMethods::ClassMethods + + # source://actionmailer//lib/action_mailer/delivery_methods.rb#79 + def wrap_delivery_behavior!(*args); end + + module GeneratedClassMethods + def delivery_method; end + def delivery_method=(value); end + def delivery_method?; end + def delivery_methods; end + def delivery_methods=(value); end + def delivery_methods?; end + def file_settings; end + def file_settings=(value); end + def file_settings?; end + def sendmail_settings; end + def sendmail_settings=(value); end + def sendmail_settings?; end + def smtp_settings; end + def smtp_settings=(value); end + def smtp_settings?; end + def test_settings; end + def test_settings=(value); end + def test_settings?; end + end + + module GeneratedInstanceMethods + def delivery_method; end + def delivery_method=(value); end + def delivery_method?; end + def delivery_methods; end + def delivery_methods=(value); end + def delivery_methods?; end + def file_settings; end + def file_settings=(value); end + def file_settings?; end + def sendmail_settings; end + def sendmail_settings=(value); end + def sendmail_settings?; end + def smtp_settings; end + def smtp_settings=(value); end + def smtp_settings?; end + def test_settings; end + def test_settings=(value); end + def test_settings?; end + end +end + +# Helpers for creating and wrapping delivery behavior, used by DeliveryMethods. +# +# source://actionmailer//lib/action_mailer/delivery_methods.rb#41 +module ActionMailer::DeliveryMethods::ClassMethods + # Adds a new delivery method through the given class using the given + # symbol as alias and the default options supplied. + # + # add_delivery_method :sendmail, Mail::Sendmail, + # location: '/usr/sbin/sendmail', + # arguments: %w[ -i ] + # + # source://actionmailer//lib/action_mailer/delivery_methods.rb#51 + def add_delivery_method(symbol, klass, default_options = T.unsafe(nil)); end + + # source://actionmailer//lib/action_mailer/delivery_methods.rb#43 + def deliveries(&_arg0); end + + # source://actionmailer//lib/action_mailer/delivery_methods.rb#43 + def deliveries=(arg); end + + # source://actionmailer//lib/action_mailer/delivery_methods.rb#57 + def wrap_delivery_behavior(mail, method = T.unsafe(nil), options = T.unsafe(nil)); end +end + +# = Action Mailer Form Builder +# +# Override the default form builder for all views rendered by this +# mailer and any of its descendants. Accepts a subclass of +# ActionView::Helpers::FormBuilder. +# +# While emails typically will not include forms, this can be used +# by views that are shared between controllers and mailers. +# +# For more information, see +ActionController::FormBuilder+. +# +# source://actionmailer//lib/action_mailer/form_builder.rb#14 +module ActionMailer::FormBuilder + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionMailer::FormBuilder::ClassMethods + + # Default form builder for the mailer + # + # source://actionmailer//lib/action_mailer/form_builder.rb#33 + def default_form_builder; end + + module GeneratedClassMethods + def _default_form_builder; end + def _default_form_builder=(value); end + def _default_form_builder?; end + end + + module GeneratedInstanceMethods; end +end + +# source://actionmailer//lib/action_mailer/form_builder.rb#21 +module ActionMailer::FormBuilder::ClassMethods + # Set the form builder to be used as the default for all forms + # in the views rendered by this mailer and its subclasses. + # + # ==== Parameters + # * builder - Default form builder. Accepts a subclass of ActionView::Helpers::FormBuilder + # + # source://actionmailer//lib/action_mailer/form_builder.rb#27 + def default_form_builder(builder); end +end + +# = Action Mailer \InlinePreviewInterceptor +# +# Implements a mailer preview interceptor that converts image tag src attributes +# that use inline +cid:+ style URLs to +data:+ style URLs so that they are visible +# when previewing an HTML email in a web browser. +# +# This interceptor is enabled by default. To disable it, delete it from the +# ActionMailer::Base.preview_interceptors array: +# +# ActionMailer::Base.preview_interceptors.delete(ActionMailer::InlinePreviewInterceptor) +# +# source://actionmailer//lib/action_mailer/inline_preview_interceptor.rb#17 +class ActionMailer::InlinePreviewInterceptor + include ::Base64 + + # @return [InlinePreviewInterceptor] a new instance of InlinePreviewInterceptor + # + # source://actionmailer//lib/action_mailer/inline_preview_interceptor.rb#26 + def initialize(message); end + + # source://actionmailer//lib/action_mailer/inline_preview_interceptor.rb#30 + def transform!; end + + private + + # source://actionmailer//lib/action_mailer/inline_preview_interceptor.rb#51 + def data_url(part); end + + # source://actionmailer//lib/action_mailer/inline_preview_interceptor.rb#55 + def find_part(cid); end + + # source://actionmailer//lib/action_mailer/inline_preview_interceptor.rb#47 + def html_part; end + + # Returns the value of attribute message. + # + # source://actionmailer//lib/action_mailer/inline_preview_interceptor.rb#45 + def message; end + + class << self + # source://actionmailer//lib/action_mailer/inline_preview_interceptor.rb#22 + def previewing_email(message); end + end +end + +# source://actionmailer//lib/action_mailer/inline_preview_interceptor.rb#18 +ActionMailer::InlinePreviewInterceptor::PATTERN = T.let(T.unsafe(nil), Regexp) + +# source://actionmailer//lib/action_mailer/log_subscriber.rb#7 +class ActionMailer::LogSubscriber < ::ActiveSupport::LogSubscriber + # An email was delivered. + # + # source://actionmailer//lib/action_mailer/log_subscriber.rb#8 + def deliver(event); end + + # Use the logger configured for ActionMailer::Base. + # + # source://actionmailer//lib/action_mailer/log_subscriber.rb#34 + def logger; end + + # An email was generated. + # + # source://actionmailer//lib/action_mailer/log_subscriber.rb#24 + def process(event); end + + class << self + private + + # source://actionmailer//lib/action_mailer/log_subscriber.rb#21 + def __class_attr_log_levels; end + + # source://actionmailer//lib/action_mailer/log_subscriber.rb#21 + def __class_attr_log_levels=(new_value); end + end +end + +# = Action Mailer \MailDeliveryJob +# +# The +ActionMailer::MailDeliveryJob+ class is used when you +# want to send emails outside of the request-response cycle. It supports +# sending either parameterized or normal mail. +# +# Exceptions are rescued and handled by the mailer class. +# +# source://actionmailer//lib/action_mailer/mail_delivery_job.rb#13 +class ActionMailer::MailDeliveryJob < ::ActiveJob::Base + # source://actionmailer//lib/action_mailer/mail_delivery_job.rb#21 + def perform(mailer, mail_method, delivery_method, args:, kwargs: T.unsafe(nil), params: T.unsafe(nil)); end + + private + + # source://actionmailer//lib/action_mailer/mail_delivery_job.rb#40 + def handle_exception_with_mailer_class(exception); end + + # "Deserialize" the mailer class name by hand in case another argument + # (like a Global ID reference) raised DeserializationError. + # + # source://actionmailer//lib/action_mailer/mail_delivery_job.rb#34 + def mailer_class; end + + class << self + private + + # source://actionmailer//lib/action_mailer/mail_delivery_job.rb#14 + def __class_attr_queue_name; end + + # source://actionmailer//lib/action_mailer/mail_delivery_job.rb#14 + def __class_attr_queue_name=(new_value); end + + # source://actionmailer//lib/action_mailer/mail_delivery_job.rb#19 + def __class_attr_rescue_handlers; end + + # source://actionmailer//lib/action_mailer/mail_delivery_job.rb#19 + def __class_attr_rescue_handlers=(new_value); end + end +end + +# = Action Mailer \MailHelper +# +# Provides helper methods for ActionMailer::Base that can be used for easily +# formatting messages, accessing mailer or message instances, and the +# attachments list. +# +# source://actionmailer//lib/action_mailer/mail_helper.rb#9 +module ActionMailer::MailHelper + # Access the message attachments list. + # + # source://actionmailer//lib/action_mailer/mail_helper.rb#53 + def attachments; end + + # Take the text and format it, indented two spaces for each line, and + # wrapped at 72 columns: + # + # text = <<-TEXT + # This is + # the paragraph. + # + # * item1 * item2 + # TEXT + # + # block_format text + # # => " This is the paragraph.\n\n * item1\n * item2\n" + # + # source://actionmailer//lib/action_mailer/mail_helper.rb#22 + def block_format(text); end + + # Returns +text+ wrapped at +len+ columns and indented +indent+ spaces. + # By default column length +len+ equals 72 characters and indent + # +indent+ equal two spaces. + # + # my_text = 'Here is a sample text with more than 40 characters' + # + # format_paragraph(my_text, 25, 4) + # # => " Here is a sample text with\n more than 40 characters" + # + # source://actionmailer//lib/action_mailer/mail_helper.rb#65 + def format_paragraph(text, len = T.unsafe(nil), indent = T.unsafe(nil)); end + + # Access the mailer instance. + # + # source://actionmailer//lib/action_mailer/mail_helper.rb#43 + def mailer; end + + # Access the message instance. + # + # source://actionmailer//lib/action_mailer/mail_helper.rb#48 + def message; end +end + +# = Action Mailer \MessageDelivery +# +# The +ActionMailer::MessageDelivery+ class is used by +# ActionMailer::Base when creating a new mailer. +# MessageDelivery is a wrapper (+Delegator+ subclass) around a lazy +# created +Mail::Message+. You can get direct access to the +# +Mail::Message+, deliver the email or schedule the email to be sent +# through Active Job. +# +# Notifier.welcome(User.first) # an ActionMailer::MessageDelivery object +# Notifier.welcome(User.first).deliver_now # sends the email +# Notifier.welcome(User.first).deliver_later # enqueue email delivery as a job through Active Job +# Notifier.welcome(User.first).message # a Mail::Message object +# +# source://actionmailer//lib/action_mailer/message_delivery.rb#51 +class ActionMailer::MessageDelivery + # @return [MessageDelivery] a new instance of MessageDelivery + # + # source://actionmailer//lib/action_mailer/message_delivery.rb#54 + def initialize(mailer_class, action, *args, **_arg3); end + + # Method calls are delegated to the Mail::Message that's ready to deliver. + # + # source://actionmailer//lib/action_mailer/message_delivery.rb#65 + def __getobj__; end + + # Unused except for delegator internals (dup, marshalling). + # + # source://actionmailer//lib/action_mailer/message_delivery.rb#70 + def __setobj__(mail_message); end + + # source://actionmailer//lib/action_mailer/message_delivery.rb#52 + def action; end + + # source://actionmailer//lib/action_mailer/message_delivery.rb#52 + def args; end + + # Enqueues the email to be delivered through Active Job. When the + # job runs it will send the email using +deliver_now+. + # + # Notifier.welcome(User.first).deliver_later + # Notifier.welcome(User.first).deliver_later(wait: 1.hour) + # Notifier.welcome(User.first).deliver_later(wait_until: 10.hours.from_now) + # Notifier.welcome(User.first).deliver_later(priority: 10) + # + # Options: + # + # * :wait - Enqueue the email to be delivered with a delay. + # * :wait_until - Enqueue the email to be delivered at (after) a specific date / time. + # * :queue - Enqueue the email on the specified queue. + # * :priority - Enqueues the email with the specified priority + # + # By default, the email will be enqueued using ActionMailer::MailDeliveryJob on + # the default queue. Mailer classes can customize the queue name used for the default + # job by assigning a +deliver_later_queue_name+ class variable, or provide a custom job + # by assigning a +delivery_job+. When a custom job is used, it controls the queue name. + # + # class AccountRegistrationMailer < ApplicationMailer + # self.delivery_job = RegistrationDeliveryJob + # end + # + # source://actionmailer//lib/action_mailer/message_delivery.rb#136 + def deliver_later(options = T.unsafe(nil)); end + + # Enqueues the email to be delivered through Active Job. When the + # job runs it will send the email using +deliver_now!+. That means + # that the message will be sent bypassing checking +perform_deliveries+ + # and +raise_delivery_errors+, so use with caution. + # + # Notifier.welcome(User.first).deliver_later! + # Notifier.welcome(User.first).deliver_later!(wait: 1.hour) + # Notifier.welcome(User.first).deliver_later!(wait_until: 10.hours.from_now) + # Notifier.welcome(User.first).deliver_later!(priority: 10) + # + # Options: + # + # * :wait - Enqueue the email to be delivered with a delay + # * :wait_until - Enqueue the email to be delivered at (after) a specific date / time + # * :queue - Enqueue the email on the specified queue + # * :priority - Enqueues the email with the specified priority + # + # By default, the email will be enqueued using ActionMailer::MailDeliveryJob on + # the default queue. Mailer classes can customize the queue name used for the default + # job by assigning a +deliver_later_queue_name+ class variable, or provide a custom job + # by assigning a +delivery_job+. When a custom job is used, it controls the queue name. + # + # class AccountRegistrationMailer < ApplicationMailer + # self.delivery_job = RegistrationDeliveryJob + # end + # + # source://actionmailer//lib/action_mailer/message_delivery.rb#109 + def deliver_later!(options = T.unsafe(nil)); end + + # Delivers an email: + # + # Notifier.welcome(User.first).deliver_now + # + # source://actionmailer//lib/action_mailer/message_delivery.rb#157 + def deliver_now; end + + # Delivers an email without checking +perform_deliveries+ and +raise_delivery_errors+, + # so use with caution. + # + # Notifier.welcome(User.first).deliver_now! + # + # source://actionmailer//lib/action_mailer/message_delivery.rb#145 + def deliver_now!; end + + # source://actionmailer//lib/action_mailer/message_delivery.rb#52 + def mailer_class; end + + # Returns the resulting Mail::Message + # + # source://actionmailer//lib/action_mailer/message_delivery.rb#75 + def message; end + + # source://actionmailer//lib/action_mailer/message_delivery.rb#52 + def params; end + + # Was the delegate loaded, causing the mailer action to be processed? + # + # @return [Boolean] + # + # source://actionmailer//lib/action_mailer/message_delivery.rb#80 + def processed?; end + + private + + # source://actionmailer//lib/action_mailer/message_delivery.rb#174 + def enqueue_delivery(delivery_method, options = T.unsafe(nil)); end + + # Returns the processed Mailer instance. We keep this instance + # on hand so we can run callbacks and delegate exception handling to it. + # + # source://actionmailer//lib/action_mailer/message_delivery.rb#168 + def processed_mailer; end +end + +# source://actionmailer//lib/action_mailer/test_case.rb#7 +class ActionMailer::NonInferrableMailerError < ::StandardError + # @return [NonInferrableMailerError] a new instance of NonInferrableMailerError + # + # source://actionmailer//lib/action_mailer/test_case.rb#8 + def initialize(name); end +end + +# = Action Mailer \Parameterized +# +# Provides the option to parameterize mailers in order to share instance variable +# setup, processing, and common headers. +# +# Consider this example that does not use parameterization: +# +# class InvitationsMailer < ApplicationMailer +# def account_invitation(inviter, invitee) +# @account = inviter.account +# @inviter = inviter +# @invitee = invitee +# +# subject = "#{@inviter.name} invited you to their Basecamp (#{@account.name})" +# +# mail \ +# subject: subject, +# to: invitee.email_address, +# from: common_address(inviter), +# reply_to: inviter.email_address_with_name +# end +# +# def project_invitation(project, inviter, invitee) +# @account = inviter.account +# @project = project +# @inviter = inviter +# @invitee = invitee +# @summarizer = ProjectInvitationSummarizer.new(@project.bucket) +# +# subject = "#{@inviter.name.familiar} added you to a project in Basecamp (#{@account.name})" +# +# mail \ +# subject: subject, +# to: invitee.email_address, +# from: common_address(inviter), +# reply_to: inviter.email_address_with_name +# end +# +# def bulk_project_invitation(projects, inviter, invitee) +# @account = inviter.account +# @projects = projects.sort_by(&:name) +# @inviter = inviter +# @invitee = invitee +# +# subject = "#{@inviter.name.familiar} added you to some new stuff in Basecamp (#{@account.name})" +# +# mail \ +# subject: subject, +# to: invitee.email_address, +# from: common_address(inviter), +# reply_to: inviter.email_address_with_name +# end +# end +# +# InvitationsMailer.account_invitation(person_a, person_b).deliver_later +# +# Using parameterized mailers, this can be rewritten as: +# +# class InvitationsMailer < ApplicationMailer +# before_action { @inviter, @invitee = params[:inviter], params[:invitee] } +# before_action { @account = params[:inviter].account } +# +# default to: -> { @invitee.email_address }, +# from: -> { common_address(@inviter) }, +# reply_to: -> { @inviter.email_address_with_name } +# +# def account_invitation +# mail subject: "#{@inviter.name} invited you to their Basecamp (#{@account.name})" +# end +# +# def project_invitation +# @project = params[:project] +# @summarizer = ProjectInvitationSummarizer.new(@project.bucket) +# +# mail subject: "#{@inviter.name.familiar} added you to a project in Basecamp (#{@account.name})" +# end +# +# def bulk_project_invitation +# @projects = params[:projects].sort_by(&:name) +# +# mail subject: "#{@inviter.name.familiar} added you to some new stuff in Basecamp (#{@account.name})" +# end +# end +# +# InvitationsMailer.with(inviter: person_a, invitee: person_b).account_invitation.deliver_later +# +# source://actionmailer//lib/action_mailer/parameterized.rb#89 +module ActionMailer::Parameterized + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionMailer::Parameterized::ClassMethods +end + +# source://actionmailer//lib/action_mailer/parameterized.rb#100 +module ActionMailer::Parameterized::ClassMethods + # Provide the parameters to the mailer in order to use them in the instance methods and callbacks. + # + # InvitationsMailer.with(inviter: person_a, invitee: person_b).account_invitation.deliver_later + # + # See Parameterized documentation for full example. + # + # source://actionmailer//lib/action_mailer/parameterized.rb#106 + def with(params); end +end + +# source://actionmailer//lib/action_mailer/parameterized.rb#111 +class ActionMailer::Parameterized::Mailer + # @return [Mailer] a new instance of Mailer + # + # source://actionmailer//lib/action_mailer/parameterized.rb#112 + def initialize(mailer, params); end + + private + + # source://actionmailer//lib/action_mailer/parameterized.rb#117 + def method_missing(method_name, *_arg1, **_arg2, &_arg3); end + + # @return [Boolean] + # + # source://actionmailer//lib/action_mailer/parameterized.rb#125 + def respond_to_missing?(method, include_all = T.unsafe(nil)); end +end + +# source://actionmailer//lib/action_mailer/parameterized.rb#130 +class ActionMailer::Parameterized::MessageDelivery < ::ActionMailer::MessageDelivery + # @return [MessageDelivery] a new instance of MessageDelivery + # + # source://actionmailer//lib/action_mailer/parameterized.rb#131 + def initialize(mailer_class, action, params, *_arg3, **_arg4, &_arg5); end + + private + + # source://actionmailer//lib/action_mailer/parameterized.rb#144 + def enqueue_delivery(delivery_method, options = T.unsafe(nil)); end + + # source://actionmailer//lib/action_mailer/parameterized.rb#137 + def processed_mailer; end +end + +# source://actionmailer//lib/action_mailer/preview.rb#69 +class ActionMailer::Preview + extend ::ActiveSupport::DescendantsTracker + + # @return [Preview] a new instance of Preview + # + # source://actionmailer//lib/action_mailer/preview.rb#74 + def initialize(params = T.unsafe(nil)); end + + # Returns the value of attribute params. + # + # source://actionmailer//lib/action_mailer/preview.rb#72 + def params; end + + class << self + # Returns all mailer preview classes. + # + # source://actionmailer//lib/action_mailer/preview.rb#80 + def all; end + + # Returns the mail object for the given email name. The registered preview + # interceptors will be informed so that they can transform the message + # as they would if the mail was actually being delivered. + # + # source://actionmailer//lib/action_mailer/preview.rb#88 + def call(email, params = T.unsafe(nil)); end + + # Returns +true+ if the email exists. + # + # @return [Boolean] + # + # source://actionmailer//lib/action_mailer/preview.rb#101 + def email_exists?(email); end + + # Returns all of the available email previews. + # + # source://actionmailer//lib/action_mailer/preview.rb#96 + def emails; end + + # Returns +true+ if the preview exists. + # + # @return [Boolean] + # + # source://actionmailer//lib/action_mailer/preview.rb#106 + def exists?(preview); end + + # Find a mailer preview by its underscored class name. + # + # source://actionmailer//lib/action_mailer/preview.rb#111 + def find(preview); end + + # Returns the underscored name of the mailer preview without the suffix. + # + # source://actionmailer//lib/action_mailer/preview.rb#116 + def preview_name; end + + private + + # source://actionmailer//lib/action_mailer/preview.rb#135 + def inform_preview_interceptors(message); end + + # source://actionmailer//lib/action_mailer/preview.rb#121 + def load_previews; end + + # source://actionmailer//lib/action_mailer/preview.rb#127 + def preview_paths; end + + # source://actionmailer//lib/action_mailer/preview.rb#131 + def show_previews; end + end +end + +# source://actionmailer//lib/action_mailer/preview.rb#6 +module ActionMailer::Previews + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionMailer::Previews::ClassMethods +end + +# source://actionmailer//lib/action_mailer/preview.rb#28 +module ActionMailer::Previews::ClassMethods + # Register an Interceptor which will be called before mail is previewed. + # Either a class or a string can be passed in as the Interceptor. If a + # string is passed in it will be constantized. + # + # source://actionmailer//lib/action_mailer/preview.rb#42 + def register_preview_interceptor(interceptor); end + + # Register one or more Interceptors which will be called before mail is previewed. + # + # source://actionmailer//lib/action_mailer/preview.rb#30 + def register_preview_interceptors(*interceptors); end + + # Unregister a previously registered Interceptor. + # Either a class or a string can be passed in as the Interceptor. If a + # string is passed in it will be constantized. + # + # source://actionmailer//lib/action_mailer/preview.rb#53 + def unregister_preview_interceptor(interceptor); end + + # Unregister one or more previously registered Interceptors. + # + # source://actionmailer//lib/action_mailer/preview.rb#35 + def unregister_preview_interceptors(*interceptors); end + + private + + # source://actionmailer//lib/action_mailer/preview.rb#58 + def interceptor_class_for(interceptor); end +end + +# source://actionmailer//lib/action_mailer/queued_delivery.rb#4 +module ActionMailer::QueuedDelivery + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def deliver_later_queue_name; end + def deliver_later_queue_name=(value); end + def deliver_later_queue_name?; end + def delivery_job; end + def delivery_job=(value); end + def delivery_job?; end + end + + module GeneratedInstanceMethods + def deliver_later_queue_name; end + def deliver_later_queue_name=(value); end + def deliver_later_queue_name?; end + def delivery_job; end + def delivery_job=(value); end + def delivery_job?; end + end +end + +# source://actionmailer//lib/action_mailer/railtie.rb#9 +class ActionMailer::Railtie < ::Rails::Railtie; end + +# = Action Mailer \Rescuable +# +# Provides +# {rescue_from}[rdoc-ref:ActiveSupport::Rescuable::ClassMethods#rescue_from] +# for mailers. Wraps mailer action processing, mail job processing, and mail +# delivery to handle configured errors. +# +# source://actionmailer//lib/action_mailer/rescuable.rb#10 +module ActionMailer::Rescuable + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActiveSupport::Rescuable + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveSupport::Rescuable::ClassMethods + mixes_in_class_methods ::ActionMailer::Rescuable::ClassMethods + + # source://actionmailer//lib/action_mailer/rescuable.rb#20 + def handle_exceptions; end + + private + + # source://actionmailer//lib/action_mailer/rescuable.rb#27 + def process(*_arg0, **_arg1, &_arg2); end + + module GeneratedClassMethods + def rescue_handlers; end + def rescue_handlers=(value); end + def rescue_handlers?; end + end + + module GeneratedInstanceMethods + def rescue_handlers; end + def rescue_handlers=(value); end + def rescue_handlers?; end + end +end + +# source://actionmailer//lib/action_mailer/rescuable.rb#14 +module ActionMailer::Rescuable::ClassMethods + # source://actionmailer//lib/action_mailer/rescuable.rb#15 + def handle_exception(exception); end +end + +# source://actionmailer//lib/action_mailer/structured_event_subscriber.rb#7 +class ActionMailer::StructuredEventSubscriber < ::ActiveSupport::StructuredEventSubscriber + # An email was delivered. + # + # source://actionmailer//lib/action_mailer/structured_event_subscriber.rb#8 + def deliver(event); end + + # An email was generated. + # + # source://actionmailer//lib/action_mailer/structured_event_subscriber.rb#27 + def process(event); end +end + +# source://actionmailer//lib/action_mailer/test_case.rb#15 +class ActionMailer::TestCase < ::ActiveSupport::TestCase + include ::ActiveSupport::Testing::ConstantLookup + include ::ActiveJob::TestHelper + include ::ActionMailer::TestHelper + include ::Rails::Dom::Testing::Assertions::SelectorAssertions + include ::Rails::Dom::Testing::Assertions::DomAssertions + include ::ActionMailer::TestCase::Behavior + extend ::ActiveSupport::Testing::ConstantLookup::ClassMethods + extend ::ActionMailer::TestCase::Behavior::ClassMethods + + # source://actionmailer//lib/action_mailer/test_case.rb#41 + def _mailer_class; end + + # source://actionmailer//lib/action_mailer/test_case.rb#41 + def _mailer_class=(_arg0); end + + # source://actionmailer//lib/action_mailer/test_case.rb#41 + def _mailer_class?; end + + # source://actionmailer//lib/action_mailer/test_case.rb#42 + def _run_setup_callbacks(&block); end + + # source://actionmailer//lib/action_mailer/test_case.rb#44 + def _run_teardown_callbacks(&block); end + + class << self + # source://actionmailer//lib/action_mailer/test_case.rb#41 + def _mailer_class; end + + # source://actionmailer//lib/action_mailer/test_case.rb#41 + def _mailer_class=(value); end + + # source://actionmailer//lib/action_mailer/test_case.rb#41 + def _mailer_class?; end + + private + + # source://actionmailer//lib/action_mailer/test_case.rb#42 + def __class_attr___callbacks; end + + # source://actionmailer//lib/action_mailer/test_case.rb#42 + def __class_attr___callbacks=(new_value); end + + # source://actionmailer//lib/action_mailer/test_case.rb#41 + def __class_attr__mailer_class; end + + # source://actionmailer//lib/action_mailer/test_case.rb#41 + def __class_attr__mailer_class=(new_value); end + end +end + +# source://actionmailer//lib/action_mailer/test_case.rb#32 +module ActionMailer::TestCase::Behavior + include ::ActiveSupport::Testing::Assertions + include ::ActiveJob::TestHelper + include ::ActionMailer::TestHelper + include ::Rails::Dom::Testing::Assertions::SelectorAssertions + include ::Rails::Dom::Testing::Assertions::DomAssertions + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActiveSupport::Testing::ConstantLookup + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveSupport::Testing::ConstantLookup::ClassMethods + mixes_in_class_methods ::ActionMailer::TestCase::Behavior::ClassMethods + + # Reads the fixture file for the given mailer. + # + # This is useful when testing mailers by being able to write the body of + # an email inside a fixture. See the testing guide for a concrete example: + # https://guides.rubyonrails.org/testing.html#revenge-of-the-fixtures + # + # source://actionmailer//lib/action_mailer/test_case.rb#82 + def read_fixture(action); end + + private + + # source://actionmailer//lib/action_mailer/test_case.rb#115 + def charset; end + + # source://actionmailer//lib/action_mailer/test_case.rb#119 + def encode(subject); end + + # source://actionmailer//lib/action_mailer/test_case.rb#87 + def initialize_test_deliveries; end + + # source://actionmailer//lib/action_mailer/test_case.rb#104 + def restore_delivery_method; end + + # source://actionmailer//lib/action_mailer/test_case.rb#94 + def restore_test_deliveries; end + + # source://actionmailer//lib/action_mailer/test_case.rb#99 + def set_delivery_method(method); end + + # source://actionmailer//lib/action_mailer/test_case.rb#109 + def set_expected_mail; end + + module GeneratedClassMethods + def _mailer_class; end + def _mailer_class=(value); end + def _mailer_class?; end + end + + module GeneratedInstanceMethods + def _mailer_class; end + def _mailer_class=(value); end + def _mailer_class?; end + end +end + +# source://actionmailer//lib/action_mailer/test_case.rb#48 +module ActionMailer::TestCase::Behavior::ClassMethods + # @raise [NonInferrableMailerError] + # + # source://actionmailer//lib/action_mailer/test_case.rb#68 + def determine_default_mailer(name); end + + # source://actionmailer//lib/action_mailer/test_case.rb#60 + def mailer_class; end + + # source://actionmailer//lib/action_mailer/test_case.rb#49 + def tests(mailer); end +end + +# source://actionmailer//lib/action_mailer/test_case.rb#16 +module ActionMailer::TestCase::ClearTestDeliveries + extend ::ActiveSupport::Concern + + private + + # source://actionmailer//lib/action_mailer/test_case.rb#25 + def clear_test_deliveries; end +end + +# Provides helper methods for testing Action Mailer, including #assert_emails +# and #assert_no_emails. +# +# source://actionmailer//lib/action_mailer/test_helper.rb#9 +module ActionMailer::TestHelper + include ::ActiveSupport::Testing::Assertions + include ::ActiveJob::TestHelper + + # Asserts that the number of emails sent matches the given number. + # + # def test_emails + # assert_emails 0 + # ContactMailer.welcome.deliver_now + # assert_emails 1 + # ContactMailer.welcome.deliver_now + # assert_emails 2 + # end + # + # If a block is passed, that block should cause the specified number of + # emails to be sent. + # + # def test_emails_again + # assert_emails 1 do + # ContactMailer.welcome.deliver_now + # end + # + # assert_emails 2 do + # ContactMailer.welcome.deliver_now + # ContactMailer.welcome.deliver_later + # end + # end + # + # source://actionmailer//lib/action_mailer/test_helper.rb#35 + def assert_emails(number, &block); end + + # Asserts that a specific email has been enqueued, optionally + # matching arguments and/or params. + # + # def test_email + # ContactMailer.welcome.deliver_later + # assert_enqueued_email_with ContactMailer, :welcome + # end + # + # def test_email_with_parameters + # ContactMailer.with(greeting: "Hello").welcome.deliver_later + # assert_enqueued_email_with ContactMailer, :welcome, args: { greeting: "Hello" } + # end + # + # def test_email_with_arguments + # ContactMailer.welcome("Hello", "Goodbye").deliver_later + # assert_enqueued_email_with ContactMailer, :welcome, args: ["Hello", "Goodbye"] + # end + # + # def test_email_with_named_arguments + # ContactMailer.welcome(greeting: "Hello", farewell: "Goodbye").deliver_later + # assert_enqueued_email_with ContactMailer, :welcome, args: [{ greeting: "Hello", farewell: "Goodbye" }] + # end + # + # def test_email_with_parameters_and_arguments + # ContactMailer.with(greeting: "Hello").welcome("Cheers", "Goodbye").deliver_later + # assert_enqueued_email_with ContactMailer, :welcome, params: { greeting: "Hello" }, args: ["Cheers", "Goodbye"] + # end + # + # def test_email_with_parameters_and_named_arguments + # ContactMailer.with(greeting: "Hello").welcome(farewell: "Goodbye").deliver_later + # assert_enqueued_email_with ContactMailer, :welcome, params: { greeting: "Hello" }, args: [{farewell: "Goodbye"}] + # end + # + # def test_email_with_parameterized_mailer + # ContactMailer.with(greeting: "Hello").welcome.deliver_later + # assert_enqueued_email_with ContactMailer.with(greeting: "Hello"), :welcome + # end + # + # def test_email_with_matchers + # ContactMailer.with(greeting: "Hello").welcome("Cheers", "Goodbye").deliver_later + # assert_enqueued_email_with ContactMailer, :welcome, + # params: ->(params) { /hello/i.match?(params[:greeting]) }, + # args: ->(args) { /cheers/i.match?(args[0]) } + # end + # + # If a block is passed, that block should cause the specified email + # to be enqueued. + # + # def test_email_in_block + # assert_enqueued_email_with ContactMailer, :welcome do + # ContactMailer.welcome.deliver_later + # end + # end + # + # If +args+ is provided as a Hash, a parameterized email is matched. + # + # def test_parameterized_email + # assert_enqueued_email_with ContactMailer, :welcome, + # args: {email: 'user@example.com'} do + # ContactMailer.with(email: 'user@example.com').welcome.deliver_later + # end + # end + # + # source://actionmailer//lib/action_mailer/test_helper.rb#157 + def assert_enqueued_email_with(mailer, method, params: T.unsafe(nil), args: T.unsafe(nil), queue: T.unsafe(nil), &block); end + + # Asserts that the number of emails enqueued for later delivery matches + # the given number. + # + # def test_emails + # assert_enqueued_emails 0 + # ContactMailer.welcome.deliver_later + # assert_enqueued_emails 1 + # ContactMailer.welcome.deliver_later + # assert_enqueued_emails 2 + # end + # + # If a block is passed, that block should cause the specified number of + # emails to be enqueued. + # + # def test_emails_again + # assert_enqueued_emails 1 do + # ContactMailer.welcome.deliver_later + # end + # + # assert_enqueued_emails 2 do + # ContactMailer.welcome.deliver_later + # ContactMailer.welcome.deliver_later + # end + # end + # + # source://actionmailer//lib/action_mailer/test_helper.rb#91 + def assert_enqueued_emails(number, &block); end + + # Asserts that no emails have been sent. + # + # def test_emails + # assert_no_emails + # ContactMailer.welcome.deliver_now + # assert_emails 1 + # end + # + # If a block is passed, that block should not cause any emails to be sent. + # + # def test_emails_again + # assert_no_emails do + # # No emails should be sent from this block + # end + # end + # + # Note: This assertion is simply a shortcut for: + # + # assert_emails 0, &block + # + # source://actionmailer//lib/action_mailer/test_helper.rb#63 + def assert_no_emails(&block); end + + # Asserts that no emails are enqueued for later delivery. + # + # def test_no_emails + # assert_no_enqueued_emails + # ContactMailer.welcome.deliver_later + # assert_enqueued_emails 1 + # end + # + # If a block is provided, it should not cause any emails to be enqueued. + # + # def test_no_emails + # assert_no_enqueued_emails do + # # No emails should be enqueued from this block + # end + # end + # + # source://actionmailer//lib/action_mailer/test_helper.rb#191 + def assert_no_enqueued_emails(&block); end + + # Returns any emails that are sent in the block. + # + # def test_emails + # emails = capture_emails do + # ContactMailer.welcome.deliver_now + # end + # assert_equal "Hi there", emails.first.subject + # + # emails = capture_emails do + # ContactMailer.welcome.deliver_now + # ContactMailer.welcome.deliver_later + # end + # assert_equal "Hi there", emails.first.subject + # end + # + # source://actionmailer//lib/action_mailer/test_helper.rb#249 + def capture_emails(&block); end + + # Delivers all enqueued emails. If a block is given, delivers all of the emails + # that were enqueued throughout the duration of the block. If a block is + # not given, delivers all the enqueued emails up to this point in the test. + # + # def test_deliver_enqueued_emails + # deliver_enqueued_emails do + # ContactMailer.welcome.deliver_later + # end + # + # assert_emails 1 + # end + # + # def test_deliver_enqueued_emails_without_block + # ContactMailer.welcome.deliver_later + # + # deliver_enqueued_emails + # + # assert_emails 1 + # end + # + # If the +:queue+ option is specified, + # then only the emails(s) enqueued to a specific queue will be performed. + # + # def test_deliver_enqueued_emails_with_queue + # deliver_enqueued_emails queue: :external_mailers do + # CustomerMailer.deliver_later_queue_name = :external_mailers + # CustomerMailer.welcome.deliver_later # will be performed + # EmployeeMailer.deliver_later_queue_name = :internal_mailers + # EmployeeMailer.welcome.deliver_later # will not be performed + # end + # + # assert_emails 1 + # end + # + # If the +:at+ option is specified, then only delivers emails enqueued to deliver + # immediately or before the given time. + # + # source://actionmailer//lib/action_mailer/test_helper.rb#231 + def deliver_enqueued_emails(queue: T.unsafe(nil), at: T.unsafe(nil), &block); end + + private + + # source://actionmailer//lib/action_mailer/test_helper.rb#258 + def delivery_job_filter(job); end +end + +# source://actionmailer//lib/action_mailer/gem_version.rb#9 +module ActionMailer::VERSION; end + +# source://actionmailer//lib/action_mailer/gem_version.rb#10 +ActionMailer::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# source://actionmailer//lib/action_mailer/gem_version.rb#11 +ActionMailer::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# source://actionmailer//lib/action_mailer/gem_version.rb#13 +ActionMailer::VERSION::PRE = T.let(T.unsafe(nil), T.untyped) + +# source://actionmailer//lib/action_mailer/gem_version.rb#15 +ActionMailer::VERSION::STRING = T.let(T.unsafe(nil), String) + +# source://actionmailer//lib/action_mailer/gem_version.rb#12 +ActionMailer::VERSION::TINY = T.let(T.unsafe(nil), Integer) diff --git a/sorbet/rbi/gems/actionpack@8.1.1.rbi b/sorbet/rbi/gems/actionpack@8.1.1.rbi new file mode 100644 index 0000000..a58aa41 --- /dev/null +++ b/sorbet/rbi/gems/actionpack@8.1.1.rbi @@ -0,0 +1,22386 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `actionpack` gem. +# Please instead update this file by running `bin/tapioca gem actionpack`. + + +# :markup: markdown +# +# source://actionpack//lib/abstract_controller/deprecator.rb#5 +module AbstractController + extend ::ActiveSupport::Autoload + + class << self + # source://actionpack//lib/abstract_controller/deprecator.rb#6 + def deprecator; end + + # source://actionpack//lib/abstract_controller.rb#27 + def eager_load!; end + end +end + +# Raised when a non-existing controller action is triggered. +# +# source://actionpack//lib/abstract_controller/base.rb#12 +class AbstractController::ActionNotFound < ::StandardError + include ::DidYouMean::Correctable + + # @return [ActionNotFound] a new instance of ActionNotFound + # + # source://actionpack//lib/abstract_controller/base.rb#15 + def initialize(message = T.unsafe(nil), controller = T.unsafe(nil), action = T.unsafe(nil)); end + + # source://actionpack//lib/abstract_controller/base.rb#13 + def action; end + + # source://actionpack//lib/abstract_controller/base.rb#13 + def controller; end + + # source://actionpack//lib/abstract_controller/base.rb#24 + def corrections; end +end + +# source://actionpack//lib/abstract_controller/asset_paths.rb#6 +module AbstractController::AssetPaths + extend ::ActiveSupport::Concern +end + +# # Abstract Controller Base +# +# AbstractController::Base is a low-level API. Nobody should be using it +# directly, and subclasses (like ActionController::Base) are expected to provide +# their own `render` method, since rendering means different things depending on +# the context. +# +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://actionpack//lib/abstract_controller/base.rb#36 +class AbstractController::Base + extend ::ActiveSupport::DescendantsTracker + + # Delegates to the class's ::action_methods. + # + # source://actionpack//lib/abstract_controller/base.rb#128 + def action_methods; end + + # Returns the name of the action this controller is processing. + # + # source://actionpack//lib/abstract_controller/base.rb#43 + def action_name; end + + # source://actionpack//lib/abstract_controller/base.rb#43 + def action_name=(_arg0); end + + # Returns true if a method for the action is available and can be dispatched, + # false otherwise. + # + # Notice that `action_methods.include?("foo")` may return false and + # `available_action?("foo")` returns true because this method considers actions + # that are also available through other means, for example, implicit render + # ones. + # + # #### Parameters + # * `action_name` - The name of an action to be tested + # + # @return [Boolean] + # + # source://actionpack//lib/abstract_controller/base.rb#128 + def available_action?(action_name); end + + # source://actionpack//lib/abstract_controller/base.rb#49 + def config; end + + # source://actionpack//lib/abstract_controller/base.rb#49 + def config=(_arg0); end + + # Delegates to the class's ::controller_path. + # + # source://actionpack//lib/abstract_controller/base.rb#128 + def controller_path; end + + # Returns the formats that can be processed by the controller. + # + # source://actionpack//lib/abstract_controller/base.rb#47 + def formats; end + + # source://actionpack//lib/abstract_controller/base.rb#47 + def formats=(_arg0); end + + # source://actionpack//lib/abstract_controller/base.rb#128 + def inspect; end + + # Tests if a response body is set. Used to determine if the `process_action` + # callback needs to be terminated in AbstractController::Callbacks. + # + # @return [Boolean] + # + # source://actionpack//lib/abstract_controller/base.rb#128 + def performed?; end + + # Calls the action going through the entire Action Dispatch stack. + # + # The actual method that is called is determined by calling #method_for_action. + # If no method can handle the action, then an AbstractController::ActionNotFound + # error is raised. + # + # source://actionpack//lib/abstract_controller/base.rb#128 + def process(action, *_arg1, **_arg2, &_arg3); end + + # Returns the body of the HTTP response sent by the controller. + # + # source://actionpack//lib/abstract_controller/base.rb#39 + def response_body; end + + # source://actionpack//lib/abstract_controller/base.rb#39 + def response_body=(_arg0); end + + # Actually call the method associated with the action. Override this method if + # you wish to change how action methods are called, not to add additional + # behavior around it. For example, you would override #send_action if you want + # to inject arguments into the method. + # + # source://actionpack//lib/abstract_controller/base.rb#128 + def send_action(*_arg0); end + + private + + # Takes an action name and returns the name of the method that will handle the + # action. + # + # It checks if the action name is valid and returns false otherwise. + # + # See method_for_action for more information. + # + # #### Parameters + # * `action_name` - An action name to find a method name for + # + # + # #### Returns + # * `string` - The name of the method that handles the action + # * false - No valid method name could be found. + # + # Raise `AbstractController::ActionNotFound`. + # + # source://actionpack//lib/abstract_controller/base.rb#128 + def _find_action_name(action_name); end + + # If the action name was not found, but a method called "action_missing" was + # found, #method_for_action will return "_handle_action_missing". This method + # calls #action_missing with the current action name. + # + # source://actionpack//lib/abstract_controller/base.rb#128 + def _handle_action_missing(*args); end + + # Checks if the action name is valid and returns false otherwise. + # + # @return [Boolean] + # + # source://actionpack//lib/abstract_controller/base.rb#128 + def _valid_action_name?(action_name); end + + # Returns true if the name can be considered an action because it has a method + # defined in the controller. + # + # #### Parameters + # * `name` - The name of an action to be tested + # + # @return [Boolean] + # + # source://actionpack//lib/abstract_controller/base.rb#128 + def action_method?(name); end + + # Takes an action name and returns the name of the method that will handle the + # action. In normal cases, this method returns the same name as it receives. By + # default, if #method_for_action receives a name that is not an action, it will + # look for an #action_missing method and return "_handle_action_missing" if one + # is found. + # + # Subclasses may override this method to add additional conditions that should + # be considered an action. For instance, an HTTP controller with a template + # matching the action name is considered to exist. + # + # If you override this method to handle additional cases, you may also provide a + # method (like `_handle_method_missing`) to handle the case. + # + # If none of these conditions are true, and `method_for_action` returns `nil`, + # an `AbstractController::ActionNotFound` exception will be raised. + # + # #### Parameters + # * `action_name` - An action name to find a method name for + # + # + # #### Returns + # * `string` - The name of the method that handles the action + # * `nil` - No method name could be found. + # + # source://actionpack//lib/abstract_controller/base.rb#128 + def method_for_action(action_name); end + + # Call the action. Override this in a subclass to modify the behavior around + # processing an action. This, and not #process, is the intended way to override + # action dispatching. + # + # Notice that the first argument is the method to be dispatched which is **not** + # necessarily the same as the action name. + # + # source://actionpack//lib/abstract_controller/base.rb#128 + def process_action(*_arg0, **_arg1, &_arg2); end + + class << self + # Returns the value of attribute abstract. + # + # source://actionpack//lib/abstract_controller/base.rb#53 + def abstract; end + + # Define a controller as abstract. See internal_methods for more details. + # + # source://actionpack//lib/abstract_controller/base.rb#57 + def abstract!; end + + # Returns the value of attribute abstract. + # + # source://actionpack//lib/abstract_controller/base.rb#54 + def abstract?; end + + # A `Set` of method names that should be considered actions. This includes all + # public instance methods on a controller, less any internal methods (see + # internal_methods), adding back in any methods that are internal, but still + # exist on the class itself. + # + # source://actionpack//lib/abstract_controller/base.rb#93 + def action_methods; end + + # action_methods are cached and there is sometimes a need to refresh them. + # ::clear_action_methods! allows you to do that, so next time you run + # action_methods, they will be recalculated. + # + # source://actionpack//lib/abstract_controller/base.rb#106 + def clear_action_methods!; end + + # source://actionpack//lib/abstract_controller/base.rb#49 + def config; end + + # source://actionpack//lib/abstract_controller/base.rb#49 + def config=(value); end + + # @yield [config] + # + # source://actionpack//lib/abstract_controller/base.rb#122 + def configure; end + + # Returns the full controller name, underscored, without the ending Controller. + # + # class MyApp::MyPostsController < AbstractController::Base + # + # end + # + # MyApp::MyPostsController.controller_path # => "my_app/my_posts" + # + # source://actionpack//lib/abstract_controller/base.rb#118 + def controller_path; end + + # source://actionpack//lib/abstract_controller/base.rb#132 + def eager_load!; end + + # source://actionpack//lib/abstract_controller/base.rb#61 + def inherited(klass); end + + # A list of all internal methods for a controller. This finds the first abstract + # superclass of a controller, and gets a list of all public instance methods on + # that abstract class. Public instance methods of a controller would normally be + # considered action methods, so methods declared on abstract classes are being + # removed. (ActionController::Metal and ActionController::Base are defined as + # abstract) + # + # source://actionpack//lib/abstract_controller/base.rb#77 + def internal_methods; end + + # Refresh the cached action_methods when a new action_method is added. + # + # source://actionpack//lib/abstract_controller/base.rb#127 + def method_added(name); end + + # Returns true if the given controller is capable of rendering a path. A + # subclass of `AbstractController::Base` may return false. An Email controller + # for example does not support paths, only full URLs. + # + # @return [Boolean] + # + # source://actionpack//lib/abstract_controller/base.rb#191 + def supports_path?; end + + private + + # source://actionpack//lib/abstract_controller/base.rb#49 + def __class_attr_config; end + + # source://actionpack//lib/abstract_controller/base.rb#49 + def __class_attr_config=(new_value); end + end +end + +# source://actionpack//lib/abstract_controller/caching.rb#6 +module AbstractController::Caching + include ::AbstractController::Caching::ConfigMethods + extend ::ActiveSupport::Concern + extend ::ActiveSupport::Autoload + include GeneratedInstanceMethods + include ::AbstractController::Caching::Fragments + + mixes_in_class_methods GeneratedClassMethods + + # source://actionpack//lib/abstract_controller/caching.rb#57 + def view_cache_dependencies; end + + private + + # Convenience accessor. + # + # source://actionpack//lib/abstract_controller/caching.rb#63 + def cache(key, options = T.unsafe(nil), &block); end + + module GeneratedClassMethods + def fragment_cache_keys; end + def fragment_cache_keys=(value); end + def fragment_cache_keys?; end + end + + module GeneratedInstanceMethods + def fragment_cache_keys; end + def fragment_cache_keys=(value); end + def fragment_cache_keys?; end + end +end + +# source://actionpack//lib/abstract_controller/caching.rb#51 +module AbstractController::Caching::ClassMethods + # source://actionpack//lib/abstract_controller/caching.rb#52 + def view_cache_dependency(&dependency); end +end + +# source://actionpack//lib/abstract_controller/caching.rb#14 +module AbstractController::Caching::ConfigMethods + # source://actionpack//lib/abstract_controller/caching.rb#15 + def cache_store; end + + # source://actionpack//lib/abstract_controller/caching.rb#19 + def cache_store=(store); end + + private + + # @return [Boolean] + # + # source://actionpack//lib/abstract_controller/caching.rb#24 + def cache_configured?; end +end + +# # Abstract Controller Caching Fragments +# +# Fragment caching is used for caching various blocks within views without +# caching the entire action as a whole. This is useful when certain elements of +# an action change frequently or depend on complicated state while other parts +# rarely change or can be shared amongst multiple parties. The caching is done +# using the `cache` helper available in the Action View. See +# ActionView::Helpers::CacheHelper for more information. +# +# While it's strongly recommended that you use key-based cache expiration (see +# links in CacheHelper for more information), it is also possible to manually +# expire caches. For example: +# +# expire_fragment('name_of_cache') +# +# source://actionpack//lib/abstract_controller/caching/fragments.rb#21 +module AbstractController::Caching::Fragments + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::AbstractController::Caching::Fragments::ClassMethods + + # Given a key (as described in `expire_fragment`), returns a key array suitable + # for use in reading, writing, or expiring a cached fragment. All keys begin + # with `:views`, followed by `ENV["RAILS_CACHE_ID"]` or + # `ENV["RAILS_APP_VERSION"]` if set, followed by any controller-wide key prefix + # values, ending with the specified `key` value. + # + # source://actionpack//lib/abstract_controller/caching/fragments.rb#68 + def combined_fragment_cache_key(key); end + + # Removes fragments from the cache. + # + # `key` can take one of three forms: + # + # * String - This would normally take the form of a path, like + # `pages/45/notes`. + # * Hash - Treated as an implicit call to `url_for`, like `{ controller: + # 'pages', action: 'notes', id: 45}` + # * Regexp - Will remove any fragment that matches, so `%r{pages/\d*/notes}` + # might remove all notes. Make sure you don't use anchors in the regex (`^` + # or `$`) because the actual filename matched looks like + # `./cache/filename/path.cache`. Note: Regexp expiration is only supported + # on caches that can iterate over all keys (unlike memcached). + # + # + # `options` is passed through to the cache store's `delete` method (or + # `delete_matched`, for Regexp keys). + # + # source://actionpack//lib/abstract_controller/caching/fragments.rb#131 + def expire_fragment(key, options = T.unsafe(nil)); end + + # Check if a cached fragment from the location signified by `key` exists (see + # `expire_fragment` for acceptable formats). + # + # @return [Boolean] + # + # source://actionpack//lib/abstract_controller/caching/fragments.rb#105 + def fragment_exist?(key, options = T.unsafe(nil)); end + + # source://actionpack//lib/abstract_controller/caching/fragments.rb#144 + def instrument_fragment_cache(name, key, &block); end + + # Reads a cached fragment from the location signified by `key` (see + # `expire_fragment` for acceptable formats). + # + # source://actionpack//lib/abstract_controller/caching/fragments.rb#93 + def read_fragment(key, options = T.unsafe(nil)); end + + # Writes `content` to the location signified by `key` (see `expire_fragment` for + # acceptable formats). + # + # source://actionpack//lib/abstract_controller/caching/fragments.rb#80 + def write_fragment(key, content, options = T.unsafe(nil)); end + + module GeneratedClassMethods + def fragment_cache_keys; end + def fragment_cache_keys=(value); end + def fragment_cache_keys?; end + end + + module GeneratedInstanceMethods + def fragment_cache_keys; end + def fragment_cache_keys=(value); end + def fragment_cache_keys?; end + end +end + +# source://actionpack//lib/abstract_controller/caching/fragments.rb#38 +module AbstractController::Caching::Fragments::ClassMethods + # Allows you to specify controller-wide key prefixes for cache fragments. Pass + # either a constant `value`, or a block which computes a value each time a cache + # key is generated. + # + # For example, you may want to prefix all fragment cache keys with a global + # version identifier, so you can easily invalidate all caches. + # + # class ApplicationController + # fragment_cache_key "v1" + # end + # + # When it's time to invalidate all fragments, simply change the string constant. + # Or, progressively roll out the cache invalidation using a computed value: + # + # class ApplicationController + # fragment_cache_key do + # @account.id.odd? ? "v1" : "v2" + # end + # end + # + # source://actionpack//lib/abstract_controller/caching/fragments.rb#58 + def fragment_cache_key(value = T.unsafe(nil), &key); end +end + +# # Abstract Controller Callbacks +# +# Abstract Controller provides hooks during the life cycle of a controller +# action. Callbacks allow you to trigger logic during this cycle. Available +# callbacks are: +# +# * `after_action` +# * `append_after_action` +# * `append_around_action` +# * `append_before_action` +# * `around_action` +# * `before_action` +# * `prepend_after_action` +# * `prepend_around_action` +# * `prepend_before_action` +# * `skip_after_action` +# * `skip_around_action` +# * `skip_before_action` +# +# source://actionpack//lib/abstract_controller/callbacks.rb#24 +module AbstractController::Callbacks + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActiveSupport::Callbacks + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods + mixes_in_class_methods ::ActiveSupport::DescendantsTracker + mixes_in_class_methods ::AbstractController::Callbacks::ClassMethods + + private + + # Override `AbstractController::Base#process_action` to run the `process_action` + # callbacks around the normal behavior. + # + # source://actionpack//lib/abstract_controller/callbacks.rb#265 + def process_action(*_arg0, **_arg1, &_arg2); end + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + end + + module GeneratedInstanceMethods + def __callbacks; end + end +end + +# source://actionpack//lib/abstract_controller/callbacks.rb#41 +class AbstractController::Callbacks::ActionFilter + # @return [ActionFilter] a new instance of ActionFilter + # + # source://actionpack//lib/abstract_controller/callbacks.rb#42 + def initialize(filters, conditional_key, actions); end + + # @return [Boolean] + # + # source://actionpack//lib/abstract_controller/callbacks.rb#71 + def after(controller); end + + # @return [Boolean] + # + # source://actionpack//lib/abstract_controller/callbacks.rb#73 + def around(controller); end + + # @return [Boolean] + # + # source://actionpack//lib/abstract_controller/callbacks.rb#72 + def before(controller); end + + # @return [Boolean] + # + # source://actionpack//lib/abstract_controller/callbacks.rb#48 + def match?(controller); end +end + +# source://actionpack//lib/abstract_controller/callbacks.rb#76 +module AbstractController::Callbacks::ClassMethods + # Take callback names and an optional callback proc, normalize them, then call + # the block with each callback. This allows us to abstract the normalization + # across several methods that use it. + # + # #### Parameters + # * `callbacks` - An array of callbacks, with an optional options hash as the + # last parameter. + # * `block` - A proc that should be added to the callbacks. + # + # + # #### Block Parameters + # * `name` - The callback to be added. + # * `options` - A hash of options to be used when adding the callback. + # + # source://actionpack//lib/abstract_controller/callbacks.rb#122 + def _insert_callbacks(callbacks, block = T.unsafe(nil)); end + + # source://actionpack//lib/abstract_controller/callbacks.rb#100 + def _normalize_callback_option(options, from, to); end + + # If `:only` or `:except` are used, convert the options into the `:if` and + # `:unless` options of ActiveSupport::Callbacks. + # + # The basic idea is that `:only => :index` gets converted to `:if => proc {|c| + # c.action_name == "index" }`. + # + # Note that `:only` has priority over `:if` in case they are used together. + # + # only: :index, if: -> { true } # the :if option will be ignored. + # + # Note that `:if` has priority over `:except` in case they are used together. + # + # except: :index, if: -> { true } # the :except option will be ignored. + # + # #### Options + # * `only` - The callback should be run only for this action. + # * `except` - The callback should be run for all actions except this action. + # + # source://actionpack//lib/abstract_controller/callbacks.rb#95 + def _normalize_callback_options(options); end + + # source://actionpack//lib/abstract_controller/callbacks.rb#233 + def after_action(*names, &blk); end + + # source://actionpack//lib/abstract_controller/callbacks.rb#254 + def append_after_action(*names, &blk); end + + # source://actionpack//lib/abstract_controller/callbacks.rb#254 + def append_around_action(*names, &blk); end + + # source://actionpack//lib/abstract_controller/callbacks.rb#254 + def append_before_action(*names, &blk); end + + # source://actionpack//lib/abstract_controller/callbacks.rb#233 + def around_action(*names, &blk); end + + # source://actionpack//lib/abstract_controller/callbacks.rb#233 + def before_action(*names, &blk); end + + # source://actionpack//lib/abstract_controller/callbacks.rb#257 + def internal_methods; end + + # source://actionpack//lib/abstract_controller/callbacks.rb#239 + def prepend_after_action(*names, &blk); end + + # source://actionpack//lib/abstract_controller/callbacks.rb#239 + def prepend_around_action(*names, &blk); end + + # source://actionpack//lib/abstract_controller/callbacks.rb#239 + def prepend_before_action(*names, &blk); end + + # source://actionpack//lib/abstract_controller/callbacks.rb#247 + def skip_after_action(*names); end + + # source://actionpack//lib/abstract_controller/callbacks.rb#247 + def skip_around_action(*names); end + + # source://actionpack//lib/abstract_controller/callbacks.rb#247 + def skip_before_action(*names); end +end + +# source://actionpack//lib/abstract_controller/callbacks.rb#32 +AbstractController::Callbacks::DEFAULT_INTERNAL_METHODS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/abstract_controller/collector.rb#8 +module AbstractController::Collector + # source://actionpack//lib/abstract_controller/collector.rb#11 + def atom(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def bmp(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def css(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def csv(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def gif(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def gzip(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def html(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def ics(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def jpeg(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def js(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def json(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def m4a(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def md(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def mp3(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def mp4(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def mpeg(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def multipart_form(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def ogg(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def otf(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def pdf(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def png(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def rss(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def svg(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def text(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def tiff(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def ttf(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def turbo_stream(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def url_encoded_form(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def vcf(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def vtt(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def webm(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def webp(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def woff(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def woff2(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def xml(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def yaml(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def zip(*_arg0, **_arg1, &_arg2); end + + private + + # source://actionpack//lib/abstract_controller/collector.rb#27 + def method_missing(symbol, *_arg1, **_arg2, &_arg3); end + + class << self + # source://actionpack//lib/abstract_controller/collector.rb#9 + def generate_method_for_mime(mime); end + end +end + +# source://actionpack//lib/abstract_controller/rendering.rb#10 +class AbstractController::DoubleRenderError < ::AbstractController::Error + # @return [DoubleRenderError] a new instance of DoubleRenderError + # + # source://actionpack//lib/abstract_controller/rendering.rb#13 + def initialize(message = T.unsafe(nil)); end +end + +# source://actionpack//lib/abstract_controller/rendering.rb#11 +AbstractController::DoubleRenderError::DEFAULT_MESSAGE = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/abstract_controller/error.rb#6 +class AbstractController::Error < ::StandardError; end + +# source://actionpack//lib/abstract_controller/helpers.rb#9 +module AbstractController::Helpers + extend ::ActiveSupport::Concern + extend ::AbstractController::Helpers::Resolution + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::AbstractController::Helpers::ClassMethods + + # source://actionpack//lib/abstract_controller/helpers.rb#28 + def _helpers; end + + module GeneratedClassMethods + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + end + + module GeneratedInstanceMethods + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + end +end + +# source://actionpack//lib/abstract_controller/helpers.rb#64 +module AbstractController::Helpers::ClassMethods + include ::AbstractController::Helpers::Resolution + + # Sets the attribute _helpers + # + # @param value the value to set the attribute _helpers to. + # + # source://actionpack//lib/abstract_controller/helpers.rb#76 + def _helpers=(_arg0); end + + # source://actionpack//lib/abstract_controller/helpers.rb#218 + def _helpers_for_modification; end + + # Clears up all existing helpers in this class, only keeping the helper with the + # same name as this class. + # + # source://actionpack//lib/abstract_controller/helpers.rb#209 + def clear_helpers; end + + # Includes the given modules in the template class. + # + # Modules can be specified in different ways. All of the following calls include + # `FooHelper`: + # + # # Module, recommended. + # helper FooHelper + # + # # String/symbol without the "helper" suffix, camel or snake case. + # helper "Foo" + # helper :Foo + # helper "foo" + # helper :foo + # + # The last two assume that `"foo".camelize` returns "Foo". + # + # When strings or symbols are passed, the method finds the actual module object + # using String#constantize. Therefore, if the module has not been yet loaded, it + # has to be autoloadable, which is normally the case. + # + # Namespaces are supported. The following calls include `Foo::BarHelper`: + # + # # Module, recommended. + # helper Foo::BarHelper + # + # # String/symbol without the "helper" suffix, camel or snake case. + # helper "Foo::Bar" + # helper :"Foo::Bar" + # helper "foo/bar" + # helper :"foo/bar" + # + # The last two assume that `"foo/bar".camelize` returns "Foo::Bar". + # + # The method accepts a block too. If present, the block is evaluated in the + # context of the controller helper module. This simple call makes the `wadus` + # method available in templates of the enclosing controller: + # + # helper do + # def wadus + # "wadus" + # end + # end + # + # Furthermore, all the above styles can be mixed together: + # + # helper FooHelper, "woo", "bar/baz" do + # def wadus + # "wadus" + # end + # end + # + # source://actionpack//lib/abstract_controller/helpers.rb#198 + def helper(*args, &block); end + + # Declare a controller method as a helper. For example, the following + # makes the `current_user` and `logged_in?` controller methods available + # to the view: + # + # class ApplicationController < ActionController::Base + # helper_method :current_user, :logged_in? + # + # private + # def current_user + # @current_user ||= User.find_by(id: session[:user]) + # end + # + # def logged_in? + # current_user != nil + # end + # end + # + # In a view: + # + # <% if logged_in? -%>Welcome, <%= current_user.name %><% end -%> + # + # #### Parameters + # * `method[, method]` - A name or names of a method on the controller to be + # made available on the view. + # + # source://actionpack//lib/abstract_controller/helpers.rb#128 + def helper_method(*methods); end + + # When a class is inherited, wrap its helper module in a new module. This + # ensures that the parent class's module can be changed independently of the + # child class's. + # + # source://actionpack//lib/abstract_controller/helpers.rb#68 + def inherited(klass); end + + private + + # source://actionpack//lib/abstract_controller/helpers.rb#237 + def default_helper_module!; end + + # source://actionpack//lib/abstract_controller/helpers.rb#226 + def define_helpers_module(klass, helpers = T.unsafe(nil)); end +end + +# source://actionpack//lib/abstract_controller/helpers.rb#32 +module AbstractController::Helpers::Resolution + # source://actionpack//lib/abstract_controller/helpers.rb#48 + def all_helpers_from_path(path); end + + # source://actionpack//lib/abstract_controller/helpers.rb#57 + def helper_modules_from_paths(paths); end + + # source://actionpack//lib/abstract_controller/helpers.rb#33 + def modules_for_helpers(modules_or_helper_prefixes); end +end + +# source://actionpack//lib/abstract_controller/logger.rb#8 +module AbstractController::Logger + extend ::ActiveSupport::Concern + include ::ActiveSupport::Benchmarkable +end + +# source://actionpack//lib/abstract_controller/railties/routes_helpers.rb#8 +module AbstractController::Railties; end + +# source://actionpack//lib/abstract_controller/railties/routes_helpers.rb#9 +module AbstractController::Railties::RoutesHelpers + class << self + # source://actionpack//lib/abstract_controller/railties/routes_helpers.rb#10 + def with(routes, include_path_helpers = T.unsafe(nil)); end + end +end + +# source://actionpack//lib/abstract_controller/rendering.rb#18 +module AbstractController::Rendering + extend ::ActiveSupport::Concern + include ::ActionView::ViewPaths + + mixes_in_class_methods ::ActionView::ViewPaths::ClassMethods + + # Normalizes arguments and options, and then delegates to render_to_body and + # sticks the result in `self.response_body`. + # + # Supported options depend on the underlying `render_to_body` implementation. + # + # source://actionpack//lib/abstract_controller/rendering.rb#26 + def render(*args, &block); end + + # Performs the actual template rendering. + # + # source://actionpack//lib/abstract_controller/rendering.rb#50 + def render_to_body(options = T.unsafe(nil)); end + + # Similar to #render, but only returns the rendered template as a string, + # instead of setting `self.response_body`. + # + # If a component extends the semantics of `response_body` (as ActionController + # extends it to be anything that responds to the method each), this method needs + # to be overridden in order to still return a string. + # + # source://actionpack//lib/abstract_controller/rendering.rb#44 + def render_to_string(*args, &block); end + + # Returns `Content-Type` of rendered content. + # + # source://actionpack//lib/abstract_controller/rendering.rb#54 + def rendered_format; end + + # This method should return a hash with assigns. You can overwrite this + # configuration per controller. + # + # source://actionpack//lib/abstract_controller/rendering.rb#62 + def view_assigns; end + + private + + # Normalize args by converting `render "foo"` to `render action: "foo"` and + # `render "foo/bar"` to `render file: "foo/bar"`. + # + # source://actionpack//lib/abstract_controller/rendering.rb#73 + def _normalize_args(action = T.unsafe(nil), options = T.unsafe(nil)); end + + # Normalize options. + # + # source://actionpack//lib/abstract_controller/rendering.rb#88 + def _normalize_options(options); end + + # Normalize args and options. + # + # source://actionpack//lib/abstract_controller/rendering.rb#114 + def _normalize_render(*args, &block); end + + # Process the rendered format. + # + # source://actionpack//lib/abstract_controller/rendering.rb#98 + def _process_format(format); end + + # Process extra options. + # + # source://actionpack//lib/abstract_controller/rendering.rb#93 + def _process_options(options); end + + # source://actionpack//lib/abstract_controller/rendering.rb#101 + def _process_variant(options); end + + # source://actionpack//lib/abstract_controller/rendering.rb#121 + def _protected_ivars; end + + # source://actionpack//lib/abstract_controller/rendering.rb#104 + def _set_html_content_type; end + + # source://actionpack//lib/abstract_controller/rendering.rb#110 + def _set_rendered_content_type(format); end + + # source://actionpack//lib/abstract_controller/rendering.rb#107 + def _set_vary_header; end +end + +# source://actionpack//lib/abstract_controller/rendering.rb#58 +AbstractController::Rendering::DEFAULT_PROTECTED_INSTANCE_VARIABLES = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/abstract_controller/translation.rb#8 +module AbstractController::Translation + # Delegates to `I18n.localize`. + # + # source://actionpack//lib/abstract_controller/translation.rb#40 + def l(object, **options); end + + # Delegates to `I18n.localize`. + # + # source://actionpack//lib/abstract_controller/translation.rb#37 + def localize(object, **options); end + + # Delegates to `I18n.translate`. + # + # When the given key starts with a period, it will be scoped by the current + # controller and action. So if you call `translate(".foo")` from + # `PeopleController#index`, it will convert the call to + # `I18n.translate("people.index.foo")`. This makes it less repetitive to + # translate many keys within the same controller / action and gives you a simple + # framework for scoping them consistently. + # + # source://actionpack//lib/abstract_controller/translation.rb#34 + def t(key, **options); end + + # Delegates to `I18n.translate`. + # + # When the given key starts with a period, it will be scoped by the current + # controller and action. So if you call `translate(".foo")` from + # `PeopleController#index`, it will convert the call to + # `I18n.translate("people.index.foo")`. This makes it less repetitive to + # translate many keys within the same controller / action and gives you a simple + # framework for scoping them consistently. + # + # source://actionpack//lib/abstract_controller/translation.rb#17 + def translate(key, **options); end +end + +# # URL For +# +# Includes `url_for` into the host class (e.g. an abstract controller or +# mailer). The class has to provide a `RouteSet` by implementing the `_routes` +# methods. Otherwise, an exception will be raised. +# +# Note that this module is completely decoupled from HTTP - the only requirement +# is a valid `_routes` implementation. +# +# source://actionpack//lib/abstract_controller/url_for.rb#14 +module AbstractController::UrlFor + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActionDispatch::Routing::UrlFor + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::AbstractController::UrlFor::ClassMethods + + # source://actionpack//lib/abstract_controller/url_for.rb#18 + def _routes; end + + module GeneratedClassMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end + + module GeneratedInstanceMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end +end + +# source://actionpack//lib/abstract_controller/url_for.rb#23 +module AbstractController::UrlFor::ClassMethods + # source://actionpack//lib/abstract_controller/url_for.rb#24 + def _routes; end + + # source://actionpack//lib/abstract_controller/url_for.rb#28 + def action_methods; end +end + +# # Action Controller +# +# Action Controller is a module of Action Pack. +# +# Action Controller provides a base controller class that can be subclassed to +# implement filters and actions to handle requests. The result of an action is +# typically content generated from views. +# +# source://actionpack//lib/action_controller/deprecator.rb#5 +module ActionController + extend ::ActiveSupport::Autoload + + class << self + # See Renderers.add + # + # source://actionpack//lib/action_controller/metal/renderers.rb#7 + def add_renderer(key, &block); end + + # source://actionpack//lib/action_controller/deprecator.rb#6 + def deprecator; end + + # See Renderers.remove + # + # source://actionpack//lib/action_controller/metal/renderers.rb#12 + def remove_renderer(key); end + end +end + +# # Action Controller API +# +# API Controller is a lightweight version of ActionController::Base, created for +# applications that don't require all functionalities that a complete Rails +# controller provides, allowing you to create controllers with just the features +# that you need for API only applications. +# +# An API Controller is different from a normal controller in the sense that by +# default it doesn't include a number of features that are usually required by +# browser access only: layouts and templates rendering, flash, assets, and so +# on. This makes the entire controller stack thinner, suitable for API +# applications. It doesn't mean you won't have such features if you need them: +# they're all available for you to include in your application, they're just not +# part of the default API controller stack. +# +# Normally, `ApplicationController` is the only controller that inherits from +# `ActionController::API`. All other controllers in turn inherit from +# `ApplicationController`. +# +# A sample controller could look like this: +# +# class PostsController < ApplicationController +# def index +# posts = Post.all +# render json: posts +# end +# end +# +# Request, response, and parameters objects all work the exact same way as +# ActionController::Base. +# +# ## Renders +# +# The default API Controller stack includes all renderers, which means you can +# use `render :json` and siblings freely in your controllers. Keep in mind that +# templates are not going to be rendered, so you need to ensure your controller +# is calling either `render` or `redirect_to` in all actions, otherwise it will +# return `204 No Content`. +# +# def show +# post = Post.find(params[:id]) +# render json: post +# end +# +# ## Redirects +# +# Redirects are used to move from one action to another. You can use the +# `redirect_to` method in your controllers in the same way as in +# ActionController::Base. For example: +# +# def create +# redirect_to root_url and return if not_authorized? +# # do stuff here +# end +# +# ## Adding New Behavior +# +# In some scenarios you may want to add back some functionality provided by +# ActionController::Base that is not present by default in +# `ActionController::API`, for instance `MimeResponds`. This module gives you +# the `respond_to` method. Adding it is quite simple, you just need to include +# the module in a specific controller or in `ApplicationController` in case you +# want it available in your entire application: +# +# class ApplicationController < ActionController::API +# include ActionController::MimeResponds +# end +# +# class PostsController < ApplicationController +# def index +# posts = Post.all +# +# respond_to do |format| +# format.json { render json: posts } +# format.xml { render xml: posts } +# end +# end +# end +# +# Make sure to check the modules included in ActionController::Base if you want +# to use any other functionality that is not provided by `ActionController::API` +# out of the box. +# +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://actionpack//lib/action_controller/api.rb#93 +class ActionController::API < ::ActionController::Metal + include ::ActionView::ViewPaths + include ::AbstractController::Rendering + include ::ActionDispatch::Routing::PolymorphicRoutes + include ::ActionDispatch::Routing::UrlFor + include ::AbstractController::UrlFor + include ::ActionController::UrlFor + include ::AbstractController::Logger + include ::ActiveSupport::Benchmarkable + include ::ActionController::Redirecting + include ::ActionController::ApiRendering + include ::ActionController::Rendering + include ::ActionController::Renderers + include ::ActionController::Renderers::All + include ::ActionController::Head + include ::ActionController::ConditionalGet + include ::ActionController::BasicImplicitRender + include ::ActionController::StrongParameters + include ::ActionController::RateLimiting + include ::ActionController::Caching + include ::AbstractController::Caching::Fragments + include ::AbstractController::Caching::ConfigMethods + include ::AbstractController::Caching + include ::ActionController::DataStreaming + include ::ActionController::DefaultHeaders + include ::ActionController::Logging + include ::ActiveSupport::Callbacks + include ::AbstractController::Callbacks + include ::ActiveSupport::Rescuable + include ::ActionController::Rescue + include ::ActionController::Instrumentation + include ::ActionController::ParamsWrapper + include ::Turbo::RequestIdTracking + extend ::ActionView::ViewPaths::ClassMethods + extend ::AbstractController::UrlFor::ClassMethods + extend ::ActionController::Redirecting::ClassMethods + extend ::ActionController::Rendering::ClassMethods + extend ::ActionController::Renderers::ClassMethods + extend ::ActionController::ConditionalGet::ClassMethods + extend ::ActionController::RateLimiting::ClassMethods + extend ::AbstractController::Caching::Fragments::ClassMethods + extend ::AbstractController::Caching::ClassMethods + extend ::AbstractController::Caching::ConfigMethods + extend ::ActionController::DefaultHeaders::ClassMethods + extend ::ActionController::Logging::ClassMethods + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::AbstractController::Callbacks::ClassMethods + extend ::ActiveSupport::Rescuable::ClassMethods + extend ::ActionController::Rescue::ClassMethods + extend ::ActionController::Instrumentation::ClassMethods + extend ::ActionController::ParamsWrapper::ClassMethods + extend ::ActionController::Renderers::DeprecatedEscapeJsonResponses + + # source://actionpack//lib/action_controller/api.rb#150 + def __callbacks; end + + # source://actionpack//lib/action_controller/api.rb#150 + def _process_action_callbacks; end + + # source://actionpack//lib/action_controller/api.rb#150 + def _renderers; end + + # source://actionpack//lib/action_controller/api.rb#150 + def _renderers=(_arg0); end + + # source://actionpack//lib/action_controller/api.rb#150 + def _renderers?; end + + # source://actionpack//lib/action_controller/api.rb#150 + def _run_process_action_callbacks(&block); end + + # source://actionpack//lib/action_controller/api.rb#150 + def _run_process_action_callbacks!(&block); end + + # source://actionpack//lib/action_controller/api.rb#150 + def _view_cache_dependencies; end + + # source://actionpack//lib/action_controller/api.rb#150 + def _view_cache_dependencies=(_arg0); end + + # source://actionpack//lib/action_controller/api.rb#150 + def _view_cache_dependencies?; end + + # source://actionpack//lib/action_controller/api.rb#150 + def _wrapper_options; end + + # source://actionpack//lib/action_controller/api.rb#150 + def _wrapper_options=(_arg0); end + + # source://actionpack//lib/action_controller/api.rb#150 + def _wrapper_options?; end + + # source://actionpack//lib/action_controller/api.rb#150 + def action_on_open_redirect; end + + # source://actionpack//lib/action_controller/api.rb#150 + def action_on_open_redirect=(val); end + + # source://actionpack//lib/action_controller/api.rb#150 + def action_on_path_relative_redirect; end + + # source://actionpack//lib/action_controller/api.rb#150 + def action_on_path_relative_redirect=(val); end + + # source://actionpack//lib/action_controller/api.rb#150 + def default_static_extension(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/api.rb#150 + def default_static_extension=(arg); end + + # source://actionpack//lib/action_controller/api.rb#150 + def default_url_options; end + + # source://actionpack//lib/action_controller/api.rb#150 + def default_url_options=(_arg0); end + + # source://actionpack//lib/action_controller/api.rb#150 + def default_url_options?; end + + # source://actionpack//lib/action_controller/api.rb#150 + def enable_fragment_cache_logging(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/api.rb#150 + def enable_fragment_cache_logging=(arg); end + + # source://actionpack//lib/action_controller/api.rb#150 + def etaggers; end + + # source://actionpack//lib/action_controller/api.rb#150 + def etaggers=(_arg0); end + + # source://actionpack//lib/action_controller/api.rb#150 + def etaggers?; end + + # source://actionpack//lib/action_controller/api.rb#150 + def fragment_cache_keys; end + + # source://actionpack//lib/action_controller/api.rb#150 + def fragment_cache_keys=(_arg0); end + + # source://actionpack//lib/action_controller/api.rb#150 + def fragment_cache_keys?; end + + # source://actionpack//lib/action_controller/api.rb#150 + def logger(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/api.rb#150 + def logger=(arg); end + + # source://actionpack//lib/action_controller/api.rb#150 + def perform_caching(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/api.rb#150 + def perform_caching=(arg); end + + # source://actionpack//lib/action_controller/api.rb#150 + def raise_on_missing_callback_actions; end + + # source://actionpack//lib/action_controller/api.rb#150 + def raise_on_missing_callback_actions=(val); end + + # source://actionpack//lib/action_controller/api.rb#150 + def raise_on_open_redirects; end + + # source://actionpack//lib/action_controller/api.rb#150 + def raise_on_open_redirects=(val); end + + # source://actionpack//lib/action_controller/api.rb#150 + def rescue_handlers; end + + # source://actionpack//lib/action_controller/api.rb#150 + def rescue_handlers=(_arg0); end + + # source://actionpack//lib/action_controller/api.rb#150 + def rescue_handlers?; end + + class << self + # source://actionpack//lib/action_controller/api.rb#150 + def __callbacks; end + + # source://actionpack//lib/action_controller/api.rb#150 + def __callbacks=(value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def _allowed_redirect_hosts; end + + # source://actionpack//lib/action_controller/api.rb#150 + def _allowed_redirect_hosts=(value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def _process_action_callbacks; end + + # source://actionpack//lib/action_controller/api.rb#150 + def _process_action_callbacks=(value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def _renderers; end + + # source://actionpack//lib/action_controller/api.rb#150 + def _renderers=(value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def _renderers?; end + + # source://actionpack//lib/action_controller/api.rb#150 + def _view_cache_dependencies; end + + # source://actionpack//lib/action_controller/api.rb#150 + def _view_cache_dependencies=(value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def _view_cache_dependencies?; end + + # source://actionpack//lib/action_controller/api.rb#150 + def _wrapper_options; end + + # source://actionpack//lib/action_controller/api.rb#150 + def _wrapper_options=(value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def _wrapper_options?; end + + # source://actionpack//lib/action_controller/api.rb#150 + def action_on_open_redirect; end + + # source://actionpack//lib/action_controller/api.rb#150 + def action_on_open_redirect=(val); end + + # source://actionpack//lib/action_controller/api.rb#150 + def action_on_path_relative_redirect; end + + # source://actionpack//lib/action_controller/api.rb#150 + def action_on_path_relative_redirect=(val); end + + # source://actionpack//lib/action_controller/api.rb#150 + def allowed_redirect_hosts; end + + # source://actionpack//lib/action_controller/api.rb#150 + def allowed_redirect_hosts_permissions; end + + # source://actionpack//lib/action_controller/api.rb#150 + def allowed_redirect_hosts_permissions=(value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def default_static_extension(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/api.rb#150 + def default_static_extension=(arg); end + + # source://actionpack//lib/action_controller/api.rb#150 + def default_url_options; end + + # source://actionpack//lib/action_controller/api.rb#150 + def default_url_options=(value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def default_url_options?; end + + # source://actionpack//lib/action_controller/api.rb#150 + def enable_fragment_cache_logging(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/api.rb#150 + def enable_fragment_cache_logging=(arg); end + + # source://actionpack//lib/action_controller/api.rb#150 + def escape_json_responses; end + + # source://actionpack//lib/action_controller/api.rb#150 + def escape_json_responses=(value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def escape_json_responses?; end + + # source://actionpack//lib/action_controller/api.rb#150 + def etaggers; end + + # source://actionpack//lib/action_controller/api.rb#150 + def etaggers=(value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def etaggers?; end + + # source://actionpack//lib/action_controller/api.rb#150 + def fragment_cache_keys; end + + # source://actionpack//lib/action_controller/api.rb#150 + def fragment_cache_keys=(value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def fragment_cache_keys?; end + + # source://actionpack//lib/action_controller/api.rb#150 + def logger(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/api.rb#150 + def logger=(arg); end + + # source://actionpack//lib/action_controller/api.rb#150 + def perform_caching(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/api.rb#150 + def perform_caching=(arg); end + + # source://actionpack//lib/action_controller/api.rb#150 + def raise_on_missing_callback_actions; end + + # source://actionpack//lib/action_controller/api.rb#150 + def raise_on_missing_callback_actions=(val); end + + # source://actionpack//lib/action_controller/api.rb#150 + def raise_on_open_redirects; end + + # source://actionpack//lib/action_controller/api.rb#150 + def raise_on_open_redirects=(val); end + + # source://actionpack//lib/action_controller/api.rb#150 + def rescue_handlers; end + + # source://actionpack//lib/action_controller/api.rb#150 + def rescue_handlers=(value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def rescue_handlers?; end + + # Shortcut helper that returns all the ActionController::API modules except the + # ones passed as arguments: + # + # class MyAPIBaseController < ActionController::Metal + # ActionController::API.without_modules(:UrlFor).each do |left| + # include left + # end + # end + # + # This gives better control over what you want to exclude and makes it easier to + # create an API controller class, instead of listing the modules required + # manually. + # + # source://actionpack//lib/action_controller/api.rb#108 + def without_modules(*modules); end + + private + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr___callbacks; end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr___callbacks=(new_value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr__allowed_redirect_hosts; end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr__allowed_redirect_hosts=(new_value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr__renderers; end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr__renderers=(new_value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr__view_cache_dependencies; end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr__view_cache_dependencies=(new_value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr__wrapper_options; end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr__wrapper_options=(new_value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr_allowed_redirect_hosts_permissions; end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr_allowed_redirect_hosts_permissions=(new_value); end + + # source://actionpack//lib/action_controller/api.rb#93 + def __class_attr_config; end + + # source://actionpack//lib/action_controller/api.rb#93 + def __class_attr_config=(new_value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr_default_url_options; end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr_default_url_options=(new_value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr_escape_json_responses; end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr_escape_json_responses=(new_value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr_etaggers; end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr_etaggers=(new_value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr_fragment_cache_keys; end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr_fragment_cache_keys=(new_value); end + + # source://actionpack//lib/action_controller/api.rb#93 + def __class_attr_middleware_stack; end + + # source://actionpack//lib/action_controller/api.rb#93 + def __class_attr_middleware_stack=(new_value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr_rescue_handlers; end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr_rescue_handlers=(new_value); end + end +end + +# source://actionpack//lib/action_controller/api.rb#116 +ActionController::API::MODULES = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_controller/metal/exceptions.rb#6 +class ActionController::ActionControllerError < ::StandardError; end + +# source://actionpack//lib/action_controller/metal/allow_browser.rb#6 +module ActionController::AllowBrowser + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionController::AllowBrowser::ClassMethods + + private + + # source://actionpack//lib/action_controller/metal/allow_browser.rb#63 + def allow_browser(versions:, block:); end +end + +# source://actionpack//lib/action_controller/metal/allow_browser.rb#73 +class ActionController::AllowBrowser::BrowserBlocker + # @return [BrowserBlocker] a new instance of BrowserBlocker + # + # source://actionpack//lib/action_controller/metal/allow_browser.rb#80 + def initialize(request, versions:); end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/allow_browser.rb#84 + def blocked?; end + + # Returns the value of attribute request. + # + # source://actionpack//lib/action_controller/metal/allow_browser.rb#78 + def request; end + + # Returns the value of attribute versions. + # + # source://actionpack//lib/action_controller/metal/allow_browser.rb#78 + def versions; end + + private + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/allow_browser.rb#105 + def bot?; end + + # source://actionpack//lib/action_controller/metal/allow_browser.rb#121 + def expanded_versions; end + + # source://actionpack//lib/action_controller/metal/allow_browser.rb#117 + def minimum_browser_version_for_browser; end + + # source://actionpack//lib/action_controller/metal/allow_browser.rb#125 + def normalized_browser_name; end + + # source://actionpack//lib/action_controller/metal/allow_browser.rb#89 + def parsed_user_agent; end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/allow_browser.rb#97 + def unsupported_browser?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/allow_browser.rb#93 + def user_agent_version_reported?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/allow_browser.rb#109 + def version_below_minimum_required?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/allow_browser.rb#101 + def version_guarded_browser?; end +end + +# source://actionpack//lib/action_controller/metal/allow_browser.rb#74 +ActionController::AllowBrowser::BrowserBlocker::SETS = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_controller/metal/allow_browser.rb#9 +module ActionController::AllowBrowser::ClassMethods + # Specify the browser versions that will be allowed to access all actions (or + # some, as limited by `only:` or `except:`). Only browsers matched in the hash + # or named set passed to `versions:` will be blocked if they're below the + # versions specified. This means that all other browsers, as well as agents that + # aren't reporting a user-agent header, will be allowed access. + # + # A browser that's blocked will by default be served the file in + # public/406-unsupported-browser.html with an HTTP status code of "406 Not + # Acceptable". + # + # In addition to specifically named browser versions, you can also pass + # `:modern` as the set to restrict support to browsers natively supporting webp + # images, web push, badges, import maps, CSS nesting, and CSS :has. This + # includes Safari 17.2+, Chrome 120+, Firefox 121+, Opera 106+. + # + # You can use https://caniuse.com to check for browser versions supporting the + # features you use. + # + # You can use `ActiveSupport::Notifications` to subscribe to events of browsers + # being blocked using the `browser_block.action_controller` event name. + # + # Examples: + # + # class ApplicationController < ActionController::Base + # # Allow only browsers natively supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has + # allow_browser versions: :modern + # end + # + # class ApplicationController < ActionController::Base + # # Allow only browsers natively supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has + # allow_browser versions: :modern, block: :handle_outdated_browser + # + # private + # def handle_outdated_browser + # render file: Rails.root.join("public/custom-error.html"), status: :not_acceptable + # end + # end + # + # class ApplicationController < ActionController::Base + # # All versions of Chrome and Opera will be allowed, but no versions of "internet explorer" (ie). Safari needs to be 16.4+ and Firefox 121+. + # allow_browser versions: { safari: 16.4, firefox: 121, ie: false } + # end + # + # class MessagesController < ApplicationController + # # In addition to the browsers blocked by ApplicationController, also block Opera below 104 and Chrome below 119 for the show action. + # allow_browser versions: { opera: 104, chrome: 119 }, only: :show + # end + # + # source://actionpack//lib/action_controller/metal/allow_browser.rb#57 + def allow_browser(versions:, block: T.unsafe(nil), **options); end +end + +# source://actionpack//lib/action_controller/api/api_rendering.rb#6 +module ActionController::ApiRendering + extend ::ActiveSupport::Concern + include ::ActionController::Rendering + + mixes_in_class_methods ::ActionController::Rendering::ClassMethods + + # source://actionpack//lib/action_controller/api/api_rendering.rb#13 + def render_to_body(options = T.unsafe(nil)); end +end + +# source://actionpack//lib/action_controller/metal/exceptions.rb#9 +class ActionController::BadRequest < ::ActionController::ActionControllerError + # @return [BadRequest] a new instance of BadRequest + # + # source://actionpack//lib/action_controller/metal/exceptions.rb#10 + def initialize(msg = T.unsafe(nil)); end +end + +# # Action Controller Base +# +# Action Controllers are the core of a web request in Rails. They are made up of +# one or more actions that are executed on request and then either it renders a +# template or redirects to another action. An action is defined as a public +# method on the controller, which will automatically be made accessible to the +# web-server through Rails Routes. +# +# By default, only the ApplicationController in a Rails application inherits +# from `ActionController::Base`. All other controllers inherit from +# ApplicationController. This gives you one class to configure things such as +# request forgery protection and filtering of sensitive request parameters. +# +# A sample controller could look like this: +# +# class PostsController < ApplicationController +# def index +# @posts = Post.all +# end +# +# def create +# @post = Post.create params[:post] +# redirect_to posts_path +# end +# end +# +# Actions, by default, render a template in the `app/views` directory +# corresponding to the name of the controller and action after executing code in +# the action. For example, the `index` action of the PostsController would +# render the template `app/views/posts/index.html.erb` by default after +# populating the `@posts` instance variable. +# +# Unlike index, the create action will not render a template. After performing +# its main purpose (creating a new post), it initiates a redirect instead. This +# redirect works by returning an external `302 Moved` HTTP response that takes +# the user to the index action. +# +# These two methods represent the two basic action archetypes used in Action +# Controllers: Get-and-show and do-and-redirect. Most actions are variations on +# these themes. +# +# ## Requests +# +# For every request, the router determines the value of the `controller` and +# `action` keys. These determine which controller and action are called. The +# remaining request parameters, the session (if one is available), and the full +# request with all the HTTP headers are made available to the action through +# accessor methods. Then the action is performed. +# +# The full request object is available via the request accessor and is primarily +# used to query for HTTP headers: +# +# def server_ip +# location = request.env["REMOTE_ADDR"] +# render plain: "This server hosted at #{location}" +# end +# +# ## Parameters +# +# All request parameters, whether they come from a query string in the URL or +# form data submitted through a POST request are available through the `params` +# method which returns a hash. For example, an action that was performed through +# `/posts?category=All&limit=5` will include `{ "category" => "All", "limit" => +# "5" }` in `params`. +# +# It's also possible to construct multi-dimensional parameter hashes by +# specifying keys using brackets, such as: +# +# +# +# +# A request coming from a form holding these inputs will include `{ "post" => { +# "name" => "david", "address" => "hyacintvej" } }`. If the address input had +# been named `post[address][street]`, the `params` would have included `{ "post" +# => { "address" => { "street" => "hyacintvej" } } }`. There's no limit to the +# depth of the nesting. +# +# ## Sessions +# +# Sessions allow you to store objects in between requests. This is useful for +# objects that are not yet ready to be persisted, such as a Signup object +# constructed in a multi-paged process, or objects that don't change much and +# are needed all the time, such as a User object for a system that requires +# login. The session should not be used, however, as a cache for objects where +# it's likely they could be changed unknowingly. It's usually too much work to +# keep it all synchronized -- something databases already excel at. +# +# You can place objects in the session by using the `session` method, which +# accesses a hash: +# +# session[:person] = Person.authenticate(user_name, password) +# +# You can retrieve it again through the same hash: +# +# "Hello #{session[:person]}" +# +# For removing objects from the session, you can either assign a single key to +# `nil`: +# +# # removes :person from session +# session[:person] = nil +# +# or you can remove the entire session with `reset_session`. +# +# By default, sessions are stored in an encrypted browser cookie (see +# ActionDispatch::Session::CookieStore). Thus the user will not be able to read +# or edit the session data. However, the user can keep a copy of the cookie even +# after it has expired, so you should avoid storing sensitive information in +# cookie-based sessions. +# +# ## Responses +# +# Each action results in a response, which holds the headers and document to be +# sent to the user's browser. The actual response object is generated +# automatically through the use of renders and redirects and requires no user +# intervention. +# +# ## Renders +# +# Action Controller sends content to the user by using one of five rendering +# methods. The most versatile and common is the rendering of a template. +# Also included with \Rails is Action View, which enables rendering of ERB +# templates. It's automatically configured. The controller passes objects to the +# view by assigning instance variables: +# +# def show +# @post = Post.find(params[:id]) +# end +# +# Which are then automatically available to the view: +# +# Title: <%= @post.title %> +# +# You don't have to rely on the automated rendering. For example, actions that +# could result in the rendering of different templates will use the manual +# rendering methods: +# +# def search +# @results = Search.find(params[:query]) +# case @results.count +# when 0 then render action: "no_results" +# when 1 then render action: "show" +# when 2..10 then render action: "show_many" +# end +# end +# +# Read more about writing ERB and Builder templates in ActionView::Base. +# +# ## Redirects +# +# Redirects are used to move from one action to another. For example, after a +# `create` action, which stores a blog entry to the database, we might like to +# show the user the new entry. Because we're following good DRY principles +# (Don't Repeat Yourself), we're going to reuse (and redirect to) a `show` +# action that we'll assume has already been created. The code might look like +# this: +# +# def create +# @entry = Entry.new(params[:entry]) +# if @entry.save +# # The entry was saved correctly, redirect to show +# redirect_to action: 'show', id: @entry.id +# else +# # things didn't go so well, do something else +# end +# end +# +# In this case, after saving our new entry to the database, the user is +# redirected to the `show` method, which is then executed. Note that this is an +# external HTTP-level redirection which will cause the browser to make a second +# request (a GET to the show action), and not some internal re-routing which +# calls both "create" and then "show" within one request. +# +# Learn more about `redirect_to` and what options you have in +# ActionController::Redirecting. +# +# ## Calling multiple redirects or renders +# +# An action may perform only a single render or a single redirect. Attempting to +# do either again will result in a DoubleRenderError: +# +# def do_something +# redirect_to action: "elsewhere" +# render action: "overthere" # raises DoubleRenderError +# end +# +# If you need to redirect on the condition of something, then be sure to add +# "return" to halt execution. +# +# def do_something +# if monkeys.nil? +# redirect_to(action: "elsewhere") +# return +# end +# render action: "overthere" # won't be called if monkeys is nil +# end +# +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://actionpack//lib/action_controller/base.rb#208 +class ActionController::Base < ::ActionController::Metal + include ::ActionView::ViewPaths + include ::AbstractController::Rendering + include ::AbstractController::Translation + include ::AbstractController::AssetPaths + include ::AbstractController::Helpers + include ::ActionController::Helpers + include ::ActionDispatch::Routing::PolymorphicRoutes + include ::ActionDispatch::Routing::UrlFor + include ::AbstractController::UrlFor + include ::ActionController::UrlFor + include ::AbstractController::Logger + include ::ActiveSupport::Benchmarkable + include ::ActionController::Redirecting + include ::ActionView::Rendering + include ::ActionView::Layouts + include ::ActionController::Rendering + include ::ActionController::Renderers + include ::ActionController::Renderers::All + include ::ActionController::Head + include ::ActionController::ConditionalGet + include ::ActionController::EtagWithTemplateDigest + include ::ActionController::EtagWithFlash + include ::ActionController::Caching + include ::AbstractController::Caching::Fragments + include ::AbstractController::Caching::ConfigMethods + include ::AbstractController::Caching + include ::ActionController::MimeResponds + include ::ActionController::BasicImplicitRender + include ::ActionController::ImplicitRender + include ::ActionController::StrongParameters + include ::ActionController::ParameterEncoding + include ::ActionController::Cookies + include ::ActionController::Flash + include ::ActionController::FormBuilder + include ::ActiveSupport::Callbacks + include ::AbstractController::Callbacks + include ::ActionController::RequestForgeryProtection + include ::ActionController::ContentSecurityPolicy + include ::ActionController::PermissionsPolicy + include ::ActionController::RateLimiting + include ::ActionController::AllowBrowser + include ::ActionController::Streaming + include ::ActionController::DataStreaming + include ::ActionController::HttpAuthentication::Basic::ControllerMethods + include ::ActionController::HttpAuthentication::Digest::ControllerMethods + include ::ActionController::HttpAuthentication::Token::ControllerMethods + include ::ActionController::DefaultHeaders + include ::ActionController::Logging + include ::ActiveSupport::Rescuable + include ::ActionController::Rescue + include ::ActionController::Instrumentation + include ::ActionController::ParamsWrapper + include ::Turbo::Native::Navigation + include ::Turbo::Frames::FrameRequest + include ::Turbo::Streams::TurboStreamsTagBuilder + include ::Turbo::RequestIdTracking + extend ::ActionView::ViewPaths::ClassMethods + extend ::AbstractController::Helpers::Resolution + extend ::AbstractController::Helpers::ClassMethods + extend ::ActionController::Helpers::ClassMethods + extend ::AbstractController::UrlFor::ClassMethods + extend ::ActionController::Redirecting::ClassMethods + extend ::ActionView::Rendering::ClassMethods + extend ::ActionView::Layouts::ClassMethods + extend ::ActionController::Rendering::ClassMethods + extend ::ActionController::Renderers::ClassMethods + extend ::ActionController::ConditionalGet::ClassMethods + extend ::AbstractController::Caching::Fragments::ClassMethods + extend ::AbstractController::Caching::ClassMethods + extend ::AbstractController::Caching::ConfigMethods + extend ::ActionController::ParameterEncoding::ClassMethods + extend ::ActionController::Flash::ClassMethods + extend ::ActionController::FormBuilder::ClassMethods + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::AbstractController::Callbacks::ClassMethods + extend ::ActionController::RequestForgeryProtection::ClassMethods + extend ::ActionController::ContentSecurityPolicy::ClassMethods + extend ::ActionController::PermissionsPolicy::ClassMethods + extend ::ActionController::RateLimiting::ClassMethods + extend ::ActionController::AllowBrowser::ClassMethods + extend ::ActionController::HttpAuthentication::Basic::ControllerMethods::ClassMethods + extend ::ActionController::DefaultHeaders::ClassMethods + extend ::ActionController::Logging::ClassMethods + extend ::ActiveSupport::Rescuable::ClassMethods + extend ::ActionController::Rescue::ClassMethods + extend ::ActionController::Instrumentation::ClassMethods + extend ::ActionController::ParamsWrapper::ClassMethods + extend ::Importmap::Freshness + extend ::ActionController::Renderers::DeprecatedEscapeJsonResponses + + # source://actionpack//lib/action_controller/base.rb#292 + def __callbacks; end + + # source://actionpack//lib/action_controller/base.rb#275 + def _helper_methods; end + + # source://actionpack//lib/action_controller/base.rb#275 + def _helper_methods=(_arg0); end + + # source://actionpack//lib/action_controller/base.rb#275 + def _helper_methods?; end + + # source://actionpack//lib/action_controller/base.rb#278 + def _layout_conditions; end + + # source://actionpack//lib/action_controller/base.rb#278 + def _layout_conditions?; end + + # source://actionpack//lib/action_controller/base.rb#292 + def _process_action_callbacks; end + + # source://actionpack//lib/action_controller/base.rb#280 + def _renderers; end + + # source://actionpack//lib/action_controller/base.rb#280 + def _renderers=(_arg0); end + + # source://actionpack//lib/action_controller/base.rb#280 + def _renderers?; end + + # source://actionpack//lib/action_controller/base.rb#292 + def _run_process_action_callbacks(&block); end + + # source://actionpack//lib/action_controller/base.rb#292 + def _run_process_action_callbacks!(&block); end + + # source://actionpack//lib/action_controller/base.rb#284 + def _view_cache_dependencies; end + + # source://actionpack//lib/action_controller/base.rb#284 + def _view_cache_dependencies=(_arg0); end + + # source://actionpack//lib/action_controller/base.rb#284 + def _view_cache_dependencies?; end + + # source://actionpack//lib/action_controller/base.rb#314 + def _wrapper_options; end + + # source://actionpack//lib/action_controller/base.rb#314 + def _wrapper_options=(_arg0); end + + # source://actionpack//lib/action_controller/base.rb#314 + def _wrapper_options?; end + + # source://actionpack//lib/action_controller/base.rb#277 + def action_on_open_redirect; end + + # source://actionpack//lib/action_controller/base.rb#277 + def action_on_open_redirect=(val); end + + # source://actionpack//lib/action_controller/base.rb#277 + def action_on_path_relative_redirect; end + + # source://actionpack//lib/action_controller/base.rb#277 + def action_on_path_relative_redirect=(val); end + + # source://actionpack//lib/action_controller/base.rb#292 + def allow_forgery_protection(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def allow_forgery_protection=(arg); end + + # source://actionpack//lib/action_controller/base.rb#274 + def asset_host(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#274 + def asset_host=(arg); end + + # source://actionpack//lib/action_controller/base.rb#274 + def assets_dir(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#274 + def assets_dir=(arg); end + + # source://actionpack//lib/action_controller/base.rb#292 + def csrf_token_storage_strategy(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def csrf_token_storage_strategy=(arg); end + + # source://actionpack//lib/action_controller/base.rb#274 + def default_asset_host_protocol(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#274 + def default_asset_host_protocol=(arg); end + + # source://actionpack//lib/action_controller/base.rb#284 + def default_static_extension(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#284 + def default_static_extension=(arg); end + + # source://actionpack//lib/action_controller/base.rb#276 + def default_url_options; end + + # source://actionpack//lib/action_controller/base.rb#276 + def default_url_options=(_arg0); end + + # source://actionpack//lib/action_controller/base.rb#276 + def default_url_options?; end + + # source://actionpack//lib/action_controller/base.rb#284 + def enable_fragment_cache_logging(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#284 + def enable_fragment_cache_logging=(arg); end + + # source://actionpack//lib/action_controller/base.rb#282 + def etag_with_template_digest; end + + # source://actionpack//lib/action_controller/base.rb#282 + def etag_with_template_digest=(_arg0); end + + # source://actionpack//lib/action_controller/base.rb#282 + def etag_with_template_digest?; end + + # source://actionpack//lib/action_controller/base.rb#281 + def etaggers; end + + # source://actionpack//lib/action_controller/base.rb#281 + def etaggers=(_arg0); end + + # source://actionpack//lib/action_controller/base.rb#281 + def etaggers?; end + + # source://actionpack//lib/action_controller/base.rb#290 + def flash(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def forgery_protection_origin_check(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def forgery_protection_origin_check=(arg); end + + # source://actionpack//lib/action_controller/base.rb#292 + def forgery_protection_strategy(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def forgery_protection_strategy=(arg); end + + # source://actionpack//lib/action_controller/base.rb#284 + def fragment_cache_keys; end + + # source://actionpack//lib/action_controller/base.rb#284 + def fragment_cache_keys=(_arg0); end + + # source://actionpack//lib/action_controller/base.rb#284 + def fragment_cache_keys?; end + + # source://actionpack//lib/action_controller/base.rb#275 + def helpers_path; end + + # source://actionpack//lib/action_controller/base.rb#275 + def helpers_path=(_arg0); end + + # source://actionpack//lib/action_controller/base.rb#275 + def helpers_path?; end + + # source://actionpack//lib/action_controller/base.rb#275 + def include_all_helpers; end + + # source://actionpack//lib/action_controller/base.rb#275 + def include_all_helpers=(_arg0); end + + # source://actionpack//lib/action_controller/base.rb#275 + def include_all_helpers?; end + + # source://actionpack//lib/action_controller/base.rb#274 + def javascripts_dir(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#274 + def javascripts_dir=(arg); end + + # source://actionpack//lib/action_controller/base.rb#292 + def log_warning_on_csrf_failure(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def log_warning_on_csrf_failure=(arg); end + + # source://actionpack//lib/action_controller/base.rb#277 + def logger(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#277 + def logger=(arg); end + + # source://actionpack//lib/action_controller/base.rb#292 + def per_form_csrf_tokens(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def per_form_csrf_tokens=(arg); end + + # source://actionpack//lib/action_controller/base.rb#284 + def perform_caching(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#284 + def perform_caching=(arg); end + + # source://actionpack//lib/action_controller/base.rb#292 + def raise_on_missing_callback_actions; end + + # source://actionpack//lib/action_controller/base.rb#292 + def raise_on_missing_callback_actions=(val); end + + # source://actionpack//lib/action_controller/base.rb#277 + def raise_on_open_redirects; end + + # source://actionpack//lib/action_controller/base.rb#277 + def raise_on_open_redirects=(val); end + + # source://actionpack//lib/action_controller/base.rb#274 + def relative_url_root(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#274 + def relative_url_root=(arg); end + + # source://actionpack//lib/action_controller/base.rb#292 + def request_forgery_protection_token(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def request_forgery_protection_token=(arg); end + + # source://actionpack//lib/action_controller/base.rb#308 + def rescue_handlers; end + + # source://actionpack//lib/action_controller/base.rb#308 + def rescue_handlers=(_arg0); end + + # source://actionpack//lib/action_controller/base.rb#308 + def rescue_handlers?; end + + # source://actionpack//lib/action_controller/base.rb#274 + def stylesheets_dir(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#274 + def stylesheets_dir=(arg); end + + private + + # source://actionpack//lib/action_controller/base.rb#278 + def _layout(lookup_context, formats, keys); end + + # source://actionpack//lib/action_controller/base.rb#330 + def _layout_from_proc; end + + # source://actionpack//lib/action_controller/base.rb#325 + def _protected_ivars; end + + # source://actionpack//lib/action_controller/base.rb#290 + def alert; end + + # source://actionpack//lib/action_controller/base.rb#290 + def notice; end + + class << self + # source://actionpack//lib/action_controller/base.rb#292 + def __callbacks; end + + # source://actionpack//lib/action_controller/base.rb#292 + def __callbacks=(value); end + + # source://actionpack//lib/action_controller/base.rb#277 + def _allowed_redirect_hosts; end + + # source://actionpack//lib/action_controller/base.rb#277 + def _allowed_redirect_hosts=(value); end + + # source://actionpack//lib/action_controller/base.rb#291 + def _default_form_builder; end + + # source://actionpack//lib/action_controller/base.rb#291 + def _default_form_builder=(value); end + + # source://actionpack//lib/action_controller/base.rb#291 + def _default_form_builder?; end + + # source://actionpack//lib/action_controller/base.rb#290 + def _flash_types; end + + # source://actionpack//lib/action_controller/base.rb#290 + def _flash_types=(value); end + + # source://actionpack//lib/action_controller/base.rb#290 + def _flash_types?; end + + # source://actionpack//lib/action_controller/base.rb#275 + def _helper_methods; end + + # source://actionpack//lib/action_controller/base.rb#275 + def _helper_methods=(value); end + + # source://actionpack//lib/action_controller/base.rb#275 + def _helper_methods?; end + + # source://actionpack//lib/action_controller/base.rb#275 + def _helpers; end + + # source://actionpack//lib/action_controller/base.rb#278 + def _layout; end + + # source://actionpack//lib/action_controller/base.rb#278 + def _layout=(value); end + + # source://actionpack//lib/action_controller/base.rb#278 + def _layout?; end + + # source://actionpack//lib/action_controller/base.rb#278 + def _layout_conditions; end + + # source://actionpack//lib/action_controller/base.rb#278 + def _layout_conditions=(value); end + + # source://actionpack//lib/action_controller/base.rb#278 + def _layout_conditions?; end + + # source://actionpack//lib/action_controller/base.rb#292 + def _process_action_callbacks; end + + # source://actionpack//lib/action_controller/base.rb#292 + def _process_action_callbacks=(value); end + + # source://actionpack//lib/action_controller/base.rb#280 + def _renderers; end + + # source://actionpack//lib/action_controller/base.rb#280 + def _renderers=(value); end + + # source://actionpack//lib/action_controller/base.rb#280 + def _renderers?; end + + # source://actionpack//lib/action_controller/base.rb#284 + def _view_cache_dependencies; end + + # source://actionpack//lib/action_controller/base.rb#284 + def _view_cache_dependencies=(value); end + + # source://actionpack//lib/action_controller/base.rb#284 + def _view_cache_dependencies?; end + + # source://actionpack//lib/action_controller/base.rb#314 + def _wrapper_options; end + + # source://actionpack//lib/action_controller/base.rb#314 + def _wrapper_options=(value); end + + # source://actionpack//lib/action_controller/base.rb#314 + def _wrapper_options?; end + + # source://actionpack//lib/action_controller/base.rb#277 + def action_on_open_redirect; end + + # source://actionpack//lib/action_controller/base.rb#277 + def action_on_open_redirect=(val); end + + # source://actionpack//lib/action_controller/base.rb#277 + def action_on_path_relative_redirect; end + + # source://actionpack//lib/action_controller/base.rb#277 + def action_on_path_relative_redirect=(val); end + + # source://actionpack//lib/action_controller/base.rb#292 + def allow_forgery_protection(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def allow_forgery_protection=(arg); end + + # source://actionpack//lib/action_controller/base.rb#277 + def allowed_redirect_hosts; end + + # source://actionpack//lib/action_controller/base.rb#277 + def allowed_redirect_hosts_permissions; end + + # source://actionpack//lib/action_controller/base.rb#277 + def allowed_redirect_hosts_permissions=(value); end + + # source://actionpack//lib/action_controller/base.rb#274 + def asset_host(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#274 + def asset_host=(arg); end + + # source://actionpack//lib/action_controller/base.rb#274 + def assets_dir(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#274 + def assets_dir=(arg); end + + # source://actionpack//lib/action_controller/base.rb#292 + def csrf_token_storage_strategy(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def csrf_token_storage_strategy=(arg); end + + # source://actionpack//lib/action_controller/base.rb#274 + def default_asset_host_protocol(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#274 + def default_asset_host_protocol=(arg); end + + # source://actionpack//lib/action_controller/base.rb#284 + def default_static_extension(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#284 + def default_static_extension=(arg); end + + # source://actionpack//lib/action_controller/base.rb#276 + def default_url_options; end + + # source://actionpack//lib/action_controller/base.rb#276 + def default_url_options=(value); end + + # source://actionpack//lib/action_controller/base.rb#276 + def default_url_options?; end + + # source://actionpack//lib/action_controller/base.rb#284 + def enable_fragment_cache_logging(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#284 + def enable_fragment_cache_logging=(arg); end + + # source://actionpack//lib/action_controller/base.rb#280 + def escape_json_responses; end + + # source://actionpack//lib/action_controller/base.rb#280 + def escape_json_responses=(value); end + + # source://actionpack//lib/action_controller/base.rb#280 + def escape_json_responses?; end + + # source://actionpack//lib/action_controller/base.rb#282 + def etag_with_template_digest; end + + # source://actionpack//lib/action_controller/base.rb#282 + def etag_with_template_digest=(value); end + + # source://actionpack//lib/action_controller/base.rb#282 + def etag_with_template_digest?; end + + # source://actionpack//lib/action_controller/base.rb#281 + def etaggers; end + + # source://actionpack//lib/action_controller/base.rb#281 + def etaggers=(value); end + + # source://actionpack//lib/action_controller/base.rb#281 + def etaggers?; end + + # source://actionpack//lib/action_controller/base.rb#292 + def forgery_protection_origin_check(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def forgery_protection_origin_check=(arg); end + + # source://actionpack//lib/action_controller/base.rb#292 + def forgery_protection_strategy(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def forgery_protection_strategy=(arg); end + + # source://actionpack//lib/action_controller/base.rb#284 + def fragment_cache_keys; end + + # source://actionpack//lib/action_controller/base.rb#284 + def fragment_cache_keys=(value); end + + # source://actionpack//lib/action_controller/base.rb#284 + def fragment_cache_keys?; end + + # source://actionpack//lib/action_controller/base.rb#275 + def helpers_path; end + + # source://actionpack//lib/action_controller/base.rb#275 + def helpers_path=(value); end + + # source://actionpack//lib/action_controller/base.rb#275 + def helpers_path?; end + + # source://actionpack//lib/action_controller/base.rb#275 + def include_all_helpers; end + + # source://actionpack//lib/action_controller/base.rb#275 + def include_all_helpers=(value); end + + # source://actionpack//lib/action_controller/base.rb#275 + def include_all_helpers?; end + + # source://actionpack//lib/action_controller/base.rb#274 + def javascripts_dir(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#274 + def javascripts_dir=(arg); end + + # source://actionpack//lib/action_controller/base.rb#292 + def log_warning_on_csrf_failure(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def log_warning_on_csrf_failure=(arg); end + + # source://actionpack//lib/action_controller/base.rb#277 + def logger(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#277 + def logger=(arg); end + + # source://actionpack//lib/action_controller/base.rb#292 + def per_form_csrf_tokens(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def per_form_csrf_tokens=(arg); end + + # source://actionpack//lib/action_controller/base.rb#284 + def perform_caching(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#284 + def perform_caching=(arg); end + + # source://actionpack//lib/action_controller/base.rb#292 + def raise_on_missing_callback_actions; end + + # source://actionpack//lib/action_controller/base.rb#292 + def raise_on_missing_callback_actions=(val); end + + # source://actionpack//lib/action_controller/base.rb#277 + def raise_on_open_redirects; end + + # source://actionpack//lib/action_controller/base.rb#277 + def raise_on_open_redirects=(val); end + + # source://actionpack//lib/action_controller/base.rb#274 + def relative_url_root(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#274 + def relative_url_root=(arg); end + + # source://actionpack//lib/action_controller/base.rb#292 + def request_forgery_protection_token(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def request_forgery_protection_token=(arg); end + + # source://actionpack//lib/action_controller/base.rb#308 + def rescue_handlers; end + + # source://actionpack//lib/action_controller/base.rb#308 + def rescue_handlers=(value); end + + # source://actionpack//lib/action_controller/base.rb#308 + def rescue_handlers?; end + + # source://actionpack//lib/action_controller/base.rb#274 + def stylesheets_dir(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#274 + def stylesheets_dir=(arg); end + + # Shortcut helper that returns all the modules included in + # ActionController::Base except the ones passed as arguments: + # + # class MyBaseController < ActionController::Metal + # ActionController::Base.without_modules(:ParamsWrapper, :Streaming).each do |left| + # include left + # end + # end + # + # This gives better control over what you want to exclude and makes it easier to + # create a bare controller class, instead of listing the modules required + # manually. + # + # source://actionpack//lib/action_controller/base.rb#223 + def without_modules(*modules); end + + private + + # source://actionpack//lib/action_controller/base.rb#292 + def __class_attr___callbacks; end + + # source://actionpack//lib/action_controller/base.rb#292 + def __class_attr___callbacks=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#277 + def __class_attr__allowed_redirect_hosts; end + + # source://actionpack//lib/action_controller/base.rb#277 + def __class_attr__allowed_redirect_hosts=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#291 + def __class_attr__default_form_builder; end + + # source://actionpack//lib/action_controller/base.rb#291 + def __class_attr__default_form_builder=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#290 + def __class_attr__flash_types; end + + # source://actionpack//lib/action_controller/base.rb#290 + def __class_attr__flash_types=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#275 + def __class_attr__helper_methods; end + + # source://actionpack//lib/action_controller/base.rb#275 + def __class_attr__helper_methods=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#278 + def __class_attr__layout; end + + # source://actionpack//lib/action_controller/base.rb#278 + def __class_attr__layout=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#278 + def __class_attr__layout_conditions; end + + # source://actionpack//lib/action_controller/base.rb#278 + def __class_attr__layout_conditions=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#280 + def __class_attr__renderers; end + + # source://actionpack//lib/action_controller/base.rb#280 + def __class_attr__renderers=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#284 + def __class_attr__view_cache_dependencies; end + + # source://actionpack//lib/action_controller/base.rb#284 + def __class_attr__view_cache_dependencies=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#314 + def __class_attr__wrapper_options; end + + # source://actionpack//lib/action_controller/base.rb#314 + def __class_attr__wrapper_options=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#277 + def __class_attr_allowed_redirect_hosts_permissions; end + + # source://actionpack//lib/action_controller/base.rb#277 + def __class_attr_allowed_redirect_hosts_permissions=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#208 + def __class_attr_config; end + + # source://actionpack//lib/action_controller/base.rb#208 + def __class_attr_config=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#276 + def __class_attr_default_url_options; end + + # source://actionpack//lib/action_controller/base.rb#276 + def __class_attr_default_url_options=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#280 + def __class_attr_escape_json_responses; end + + # source://actionpack//lib/action_controller/base.rb#280 + def __class_attr_escape_json_responses=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#282 + def __class_attr_etag_with_template_digest; end + + # source://actionpack//lib/action_controller/base.rb#282 + def __class_attr_etag_with_template_digest=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#281 + def __class_attr_etaggers; end + + # source://actionpack//lib/action_controller/base.rb#281 + def __class_attr_etaggers=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#284 + def __class_attr_fragment_cache_keys; end + + # source://actionpack//lib/action_controller/base.rb#284 + def __class_attr_fragment_cache_keys=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#275 + def __class_attr_helpers_path; end + + # source://actionpack//lib/action_controller/base.rb#275 + def __class_attr_helpers_path=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#275 + def __class_attr_include_all_helpers; end + + # source://actionpack//lib/action_controller/base.rb#275 + def __class_attr_include_all_helpers=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#208 + def __class_attr_middleware_stack; end + + # source://actionpack//lib/action_controller/base.rb#208 + def __class_attr_middleware_stack=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#308 + def __class_attr_rescue_handlers; end + + # source://actionpack//lib/action_controller/base.rb#308 + def __class_attr_rescue_handlers=(new_value); end + end +end + +# source://actionpack//lib/action_controller/base.rb#275 +module ActionController::Base::HelperMethods + include ::ActionText::ContentHelper + include ::ActionText::TagHelper + include ::Importmap::ImportmapTagsHelper + include ::Turbo::DriveHelper + include ::Turbo::FramesHelper + include ::Turbo::IncludesHelper + include ::Turbo::StreamsHelper + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + include ::ActionView::Helpers::TagHelper + include ::Turbo::Streams::ActionHelper + + # source://actionpack//lib/action_controller/base.rb#290 + def alert(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#284 + def combined_fragment_cache_key(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#293 + def content_security_policy?(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#293 + def content_security_policy_nonce(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#289 + def cookies(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def form_authenticity_token(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#330 + def hotwire_native_app?(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#290 + def notice(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def protect_against_forgery?(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#330 + def turbo_frame_request?(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#330 + def turbo_frame_request_id(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#330 + def turbo_native_app?(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#284 + def view_cache_dependencies(*_arg0, **_arg1, &_arg2); end +end + +# source://actionpack//lib/action_controller/base.rb#231 +ActionController::Base::MODULES = T.let(T.unsafe(nil), Array) + +# Define some internal variables that should not be propagated to the view. +# +# source://actionpack//lib/action_controller/base.rb#319 +ActionController::Base::PROTECTED_IVARS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_controller/metal/basic_implicit_render.rb#6 +module ActionController::BasicImplicitRender + # source://actionpack//lib/action_controller/metal/basic_implicit_render.rb#13 + def default_render; end + + # source://actionpack//lib/action_controller/metal/basic_implicit_render.rb#7 + def send_action(method, *args); end +end + +# # Action Controller Caching +# +# Caching is a cheap way of speeding up slow applications by keeping the result +# of calculations, renderings, and database calls around for subsequent +# requests. +# +# Note: To turn off all caching provided by Action Controller, set +# +# config.action_controller.perform_caching = false +# +# ## Caching stores +# +# All the caching stores from ActiveSupport::Cache are available to be used as +# backends for Action Controller caching. +# +# Configuration examples (FileStore is the default): +# +# config.action_controller.cache_store = :memory_store +# config.action_controller.cache_store = :file_store, '/path/to/cache/directory' +# config.action_controller.cache_store = :mem_cache_store, 'localhost' +# config.action_controller.cache_store = :mem_cache_store, Memcached::Rails.new('localhost:11211') +# config.action_controller.cache_store = MyOwnStore.new('parameter') +# +# source://actionpack//lib/action_controller/caching.rb#28 +module ActionController::Caching + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::AbstractController::Caching::Fragments + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::AbstractController::Caching::Fragments::ClassMethods + mixes_in_class_methods ::AbstractController::Caching::ClassMethods + mixes_in_class_methods ::AbstractController::Caching::ConfigMethods + + private + + # source://actionpack//lib/action_controller/caching.rb#44 + def instrument_name; end + + # source://actionpack//lib/action_controller/caching.rb#36 + def instrument_payload(key); end + + module GeneratedClassMethods + def fragment_cache_keys; end + def fragment_cache_keys=(value); end + def fragment_cache_keys?; end + end + + module GeneratedInstanceMethods + def fragment_cache_keys; end + def fragment_cache_keys=(value); end + def fragment_cache_keys?; end + end +end + +# source://actionpack//lib/action_controller/metal/conditional_get.rb#9 +module ActionController::ConditionalGet + include ::ActionController::Head + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionController::ConditionalGet::ClassMethods + + # Sets the `Cache-Control` header, overwriting existing directives. This method + # will also ensure an HTTP `Date` header for client compatibility. + # + # Defaults to issuing the `private` directive, so that intermediate caches must + # not cache the response. + # + # #### Options + # + # `:public` + # directive. + # + # `:must_revalidate` + # + # `:stale_while_revalidate` + # + # `:stale_if_error` + # + # `:immutable` + # + # + # Any additional key-value pairs are concatenated as directives. For a list of + # supported `Cache-Control` directives, see the [article on + # MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control). + # + # #### Examples + # + # expires_in 10.minutes + # # => Cache-Control: max-age=600, private + # + # expires_in 10.minutes, public: true + # # => Cache-Control: max-age=600, public + # + # expires_in 10.minutes, public: true, must_revalidate: true + # # => Cache-Control: max-age=600, public, must-revalidate + # + # expires_in 1.hour, stale_while_revalidate: 60.seconds + # # => Cache-Control: max-age=3600, private, stale-while-revalidate=60 + # + # expires_in 1.hour, stale_if_error: 5.minutes + # # => Cache-Control: max-age=3600, private, stale-if-error=300 + # + # expires_in 1.hour, public: true, "s-maxage": 3.hours, "no-transform": true + # # => Cache-Control: max-age=3600, public, s-maxage=10800, no-transform=true + # + # source://actionpack//lib/action_controller/metal/conditional_get.rb#290 + def expires_in(seconds, options = T.unsafe(nil)); end + + # Sets an HTTP 1.1 `Cache-Control` header of `no-cache`. This means the resource + # will be marked as stale, so clients must always revalidate. + # Intermediate/browser caches may still store the asset. + # + # source://actionpack//lib/action_controller/metal/conditional_get.rb#309 + def expires_now; end + + # Sets the `etag`, `last_modified`, or both on the response, and renders a `304 + # Not Modified` response if the request is already fresh. + # + # #### Options + # + # `:etag` + # + # `:weak_etag` + # `If-None-Match` header may receive a `304 Not Modified` response if the + # ETag matches exactly. + # + # they're good for caching HTML pages in browser caches. They can't be used + # for responses that must be byte-identical, like serving `Range` requests + # within a PDF file. + # + # `:strong_etag` + # `If-None-Match` header may receive a `304 Not Modified` response if the + # ETag matches exactly. + # + # byte. This is necessary for serving `Range` requests within a large video + # or PDF file, for example, or for compatibility with some CDNs that don't + # support weak ETags. + # + # `:last_modified` + # that specify an `If-Modified-Since` header may receive a `304 Not + # Modified` response if `last_modified` <= `If-Modified-Since`. + # + # `:public` + # `true` if you want your application to be cacheable by other devices, such + # as proxy caches. + # + # `:cache_control` + # of `Cache-Control` directives, see the [article on + # MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control). + # + # `:template` + # included in ETags. If the action renders a different template, you can + # include its digest instead. If the action doesn't render a template at + # all, you can pass `template: false` to skip any attempt to check for a + # template digest. + # + # + # #### Examples + # + # def show + # @article = Article.find(params[:id]) + # fresh_when(etag: @article, last_modified: @article.updated_at, public: true) + # end + # + # This will send a `304 Not Modified` response if the request specifies a + # matching ETag and `If-Modified-Since` header. Otherwise, it will render the + # `show` template. + # + # You can also just pass a record: + # + # def show + # @article = Article.find(params[:id]) + # fresh_when(@article) + # end + # + # `etag` will be set to the record, and `last_modified` will be set to the + # record's `updated_at`. + # + # You can also pass an object that responds to `maximum`, such as a collection + # of records: + # + # def index + # @articles = Article.all + # fresh_when(@articles) + # end + # + # In this case, `etag` will be set to the collection, and `last_modified` will + # be set to `maximum(:updated_at)` (the timestamp of the most recently updated + # record). + # + # When passing a record or a collection, you can still specify other options, + # such as `:public` and `:cache_control`: + # + # def show + # @article = Article.find(params[:id]) + # fresh_when(@article, public: true, cache_control: { no_cache: true }) + # end + # + # The above will set `Cache-Control: public, no-cache` in the response. + # + # When rendering a different template than the controller/action's default + # template, you can indicate which digest to include in the ETag: + # + # before_action { fresh_when @article, template: "widgets/show" } + # + # source://actionpack//lib/action_controller/metal/conditional_get.rb#137 + def fresh_when(object = T.unsafe(nil), etag: T.unsafe(nil), weak_etag: T.unsafe(nil), strong_etag: T.unsafe(nil), last_modified: T.unsafe(nil), public: T.unsafe(nil), cache_control: T.unsafe(nil), template: T.unsafe(nil)); end + + # Cache or yield the block. The cache is supposed to never expire. + # + # You can use this method when you have an HTTP response that never changes, and + # the browser and proxies should cache it indefinitely. + # + # * `public`: By default, HTTP responses are private, cached only on the + # user's web browser. To allow proxies to cache the response, set `true` to + # indicate that they can serve the cached response to all users. + # + # source://actionpack//lib/action_controller/metal/conditional_get.rb#321 + def http_cache_forever(public: T.unsafe(nil)); end + + # Adds the `must-understand` directive to the `Cache-Control` header, which indicates + # that a cache MUST understand the semantics of the response status code that has been + # received, or discard the response. + # + # This is particularly useful when returning responses with new or uncommon + # status codes that might not be properly interpreted by older caches. + # + # #### Example + # + # def show + # @article = Article.find(params[:id]) + # + # if @article.early_access? + # must_understand + # render status: 203 # Non-Authoritative Information + # else + # fresh_when @article + # end + # end + # + # source://actionpack//lib/action_controller/metal/conditional_get.rb#355 + def must_understand; end + + # Sets an HTTP 1.1 `Cache-Control` header of `no-store`. This means the resource + # may not be stored in any cache. + # + # source://actionpack//lib/action_controller/metal/conditional_get.rb#331 + def no_store; end + + # Sets the `etag` and/or `last_modified` on the response and checks them against + # the request. If the request doesn't match the provided options, it is + # considered stale, and the response should be rendered from scratch. Otherwise, + # it is fresh, and a `304 Not Modified` is sent. + # + # #### Options + # + # See #fresh_when for supported options. + # + # #### Examples + # + # def show + # @article = Article.find(params[:id]) + # + # if stale?(etag: @article, last_modified: @article.updated_at) + # @statistics = @article.really_expensive_call + # respond_to do |format| + # # all the supported formats + # end + # end + # end + # + # You can also just pass a record: + # + # def show + # @article = Article.find(params[:id]) + # + # if stale?(@article) + # @statistics = @article.really_expensive_call + # respond_to do |format| + # # all the supported formats + # end + # end + # end + # + # `etag` will be set to the record, and `last_modified` will be set to the + # record's `updated_at`. + # + # You can also pass an object that responds to `maximum`, such as a collection + # of records: + # + # def index + # @articles = Article.all + # + # if stale?(@articles) + # @statistics = @articles.really_expensive_call + # respond_to do |format| + # # all the supported formats + # end + # end + # end + # + # In this case, `etag` will be set to the collection, and `last_modified` will + # be set to `maximum(:updated_at)` (the timestamp of the most recently updated + # record). + # + # When passing a record or a collection, you can still specify other options, + # such as `:public` and `:cache_control`: + # + # def show + # @article = Article.find(params[:id]) + # + # if stale?(@article, public: true, cache_control: { no_cache: true }) + # @statistics = @articles.really_expensive_call + # respond_to do |format| + # # all the supported formats + # end + # end + # end + # + # The above will set `Cache-Control: public, no-cache` in the response. + # + # When rendering a different template than the controller/action's default + # template, you can indicate which digest to include in the ETag: + # + # def show + # super if stale?(@article, template: "widgets/show") + # end + # + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/conditional_get.rb#236 + def stale?(object = T.unsafe(nil), **freshness_kwargs); end + + private + + # source://actionpack//lib/action_controller/metal/conditional_get.rb#361 + def combine_etags(validator, options); end + + module GeneratedClassMethods + def etaggers; end + def etaggers=(value); end + def etaggers?; end + end + + module GeneratedInstanceMethods + def etaggers; end + def etaggers=(value); end + def etaggers?; end + end +end + +# source://actionpack//lib/action_controller/metal/conditional_get.rb#18 +module ActionController::ConditionalGet::ClassMethods + # Allows you to consider additional controller-wide information when generating + # an ETag. For example, if you serve pages tailored depending on who's logged in + # at the moment, you may want to add the current user id to be part of the ETag + # to prevent unauthorized displaying of cached pages. + # + # class InvoicesController < ApplicationController + # etag { current_user&.id } + # + # def show + # # Etag will differ even for the same invoice when it's viewed by a different current_user + # @invoice = Invoice.find(params[:id]) + # fresh_when etag: @invoice + # end + # end + # + # source://actionpack//lib/action_controller/metal/conditional_get.rb#33 + def etag(&etagger); end +end + +# source://actionpack//lib/action_controller/metal/content_security_policy.rb#6 +module ActionController::ContentSecurityPolicy + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::AbstractController::Helpers + include ::ActiveSupport::Callbacks + include ::AbstractController::Callbacks + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::AbstractController::Helpers::ClassMethods + mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods + mixes_in_class_methods ::ActiveSupport::DescendantsTracker + mixes_in_class_methods ::AbstractController::Callbacks::ClassMethods + mixes_in_class_methods ::ActionController::ContentSecurityPolicy::ClassMethods + + private + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/content_security_policy.rb#74 + def content_security_policy?; end + + # source://actionpack//lib/action_controller/metal/content_security_policy.rb#78 + def content_security_policy_nonce; end + + # source://actionpack//lib/action_controller/metal/content_security_policy.rb#82 + def current_content_security_policy; end + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + end +end + +# source://actionpack//lib/action_controller/metal/content_security_policy.rb#17 +module ActionController::ContentSecurityPolicy::ClassMethods + # Overrides parts of the globally configured `Content-Security-Policy` header: + # + # class PostsController < ApplicationController + # content_security_policy do |policy| + # policy.base_uri "https://www.example.com" + # end + # end + # + # Options can be passed similar to `before_action`. For example, pass `only: + # :index` to override the header on the index action only: + # + # class PostsController < ApplicationController + # content_security_policy(only: :index) do |policy| + # policy.default_src :self, :https + # end + # end + # + # Pass `false` to remove the `Content-Security-Policy` header: + # + # class PostsController < ApplicationController + # content_security_policy false, only: :index + # end + # + # source://actionpack//lib/action_controller/metal/content_security_policy.rb#40 + def content_security_policy(enabled = T.unsafe(nil), **options, &block); end + + # Overrides the globally configured `Content-Security-Policy-Report-Only` + # header: + # + # class PostsController < ApplicationController + # content_security_policy_report_only only: :index + # end + # + # Pass `false` to remove the `Content-Security-Policy-Report-Only` header: + # + # class PostsController < ApplicationController + # content_security_policy_report_only false, only: :index + # end + # + # source://actionpack//lib/action_controller/metal/content_security_policy.rb#66 + def content_security_policy_report_only(report_only = T.unsafe(nil), **options); end +end + +# source://actionpack//lib/action_controller/metal/cookies.rb#6 +module ActionController::Cookies + extend ::ActiveSupport::Concern + + private + + # The cookies for the current request. See ActionDispatch::Cookies for more + # information. + # + # source://actionpack//lib/action_controller/metal/cookies.rb#16 + def cookies; end +end + +# # Action Controller Data Streaming +# +# Methods for sending arbitrary data and for streaming files to the browser, +# instead of rendering. +# +# source://actionpack//lib/action_controller/metal/data_streaming.rb#13 +module ActionController::DataStreaming + extend ::ActiveSupport::Concern + include ::ActionController::Rendering + + mixes_in_class_methods ::ActionController::Rendering::ClassMethods + + private + + # Sends the given binary data to the browser. This method is similar to `render + # plain: data`, but also allows you to specify whether the browser should + # display the response as a file attachment (i.e. in a download dialog) or as + # inline data. You may also set the content type, the file name, and other + # things. + # + # #### Options: + # + # * `:filename` - suggests a filename for the browser to use. + # * `:type` - specifies an HTTP content type. Defaults to + # `application/octet-stream`. You can specify either a string or a symbol + # for a registered type with `Mime::Type.register`, for example `:json`. If + # omitted, type will be inferred from the file extension specified in + # `:filename`. If no content type is registered for the extension, the + # default type `application/octet-stream` will be used. + # * `:disposition` - specifies whether the file will be shown inline or + # downloaded. Valid values are `"inline"` and `"attachment"` (default). + # * `:status` - specifies the status code to send with the response. Defaults + # to 200. + # + # + # Generic data download: + # + # send_data buffer + # + # Download a dynamically-generated tarball: + # + # send_data generate_tgz('dir'), filename: 'dir.tgz' + # + # Display an image Active Record in the browser: + # + # send_data image.data, type: image.content_type, disposition: 'inline' + # + # See `send_file` for more information on HTTP `Content-*` headers and caching. + # + # source://actionpack//lib/action_controller/metal/data_streaming.rb#122 + def send_data(data, options = T.unsafe(nil)); end + + # Sends the file. This uses a server-appropriate method (such as `X-Sendfile`) + # via the `Rack::Sendfile` middleware. The header to use is set via + # `config.action_dispatch.x_sendfile_header`. Your server can also configure + # this for you by setting the `X-Sendfile-Type` header. + # + # Be careful to sanitize the path parameter if it is coming from a web page. + # `send_file(params[:path])` allows a malicious user to download any file on + # your server. + # + # #### Options: + # + # * `:filename` - suggests a filename for the browser to use. Defaults to + # `File.basename(path)`. + # * `:type` - specifies an HTTP content type. You can specify either a string + # or a symbol for a registered type with `Mime::Type.register`, for example + # `:json`. If omitted, the type will be inferred from the file extension + # specified in `:filename`. If no content type is registered for the + # extension, the default type `application/octet-stream` will be used. + # * `:disposition` - specifies whether the file will be shown inline or + # downloaded. Valid values are `"inline"` and `"attachment"` (default). + # * `:status` - specifies the status code to send with the response. Defaults + # to 200. + # * `:url_based_filename` - set to `true` if you want the browser to guess the + # filename from the URL, which is necessary for i18n filenames on certain + # browsers (setting `:filename` overrides this option). + # + # + # The default `Content-Type` and `Content-Disposition` headers are set to + # download arbitrary binary files in as many browsers as possible. IE versions + # 4, 5, 5.5, and 6 are all known to have a variety of quirks (especially when + # downloading over SSL). + # + # Simple download: + # + # send_file '/path/to.zip' + # + # Show a JPEG in the browser: + # + # send_file '/path/to.jpeg', type: 'image/jpeg', disposition: 'inline' + # + # Show a 404 page in the browser: + # + # send_file '/path/to/404.html', type: 'text/html; charset=utf-8', disposition: 'inline', status: 404 + # + # You can use other `Content-*` HTTP headers to provide additional information + # to the client. See MDN for a [list of HTTP + # headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers). + # + # Also be aware that the document may be cached by proxies and browsers. The + # `Pragma` and `Cache-Control` headers declare how the file may be cached by + # intermediaries. They default to require clients to validate with the server + # before releasing cached responses. See https://www.mnot.net/cache_docs/ for an + # overview of web caching and [RFC + # 9111](https://www.rfc-editor.org/rfc/rfc9111.html#name-cache-control) for the + # `Cache-Control` header spec. + # + # @raise [MissingFile] + # + # source://actionpack//lib/action_controller/metal/data_streaming.rb#77 + def send_file(path, options = T.unsafe(nil)); end + + # @raise [ArgumentError] + # + # source://actionpack//lib/action_controller/metal/data_streaming.rb#127 + def send_file_headers!(options); end +end + +# source://actionpack//lib/action_controller/metal/data_streaming.rb#19 +ActionController::DataStreaming::DEFAULT_SEND_FILE_DISPOSITION = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_controller/metal/data_streaming.rb#18 +ActionController::DataStreaming::DEFAULT_SEND_FILE_TYPE = T.let(T.unsafe(nil), String) + +# # Action Controller Default Headers +# +# Allows configuring default headers that will be automatically merged into each +# response. +# +# source://actionpack//lib/action_controller/metal/default_headers.rb#10 +module ActionController::DefaultHeaders + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionController::DefaultHeaders::ClassMethods +end + +# source://actionpack//lib/action_controller/metal/default_headers.rb#13 +module ActionController::DefaultHeaders::ClassMethods + # source://actionpack//lib/action_controller/metal/default_headers.rb#14 + def make_response!(request); end +end + +# # Action Controller Etag With Flash +# +# When you're using the flash, it's generally used as a conditional on the view. +# This means the content of the view depends on the flash. Which in turn means +# that the ETag for a response should be computed with the content of the flash +# in mind. This does that by including the content of the flash as a component +# in the ETag that's generated for a response. +# +# source://actionpack//lib/action_controller/metal/etag_with_flash.rb#13 +module ActionController::EtagWithFlash + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActionController::ConditionalGet + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionController::ConditionalGet::ClassMethods + + module GeneratedClassMethods + def etaggers; end + def etaggers=(value); end + def etaggers?; end + end + + module GeneratedInstanceMethods + def etaggers; end + def etaggers=(value); end + def etaggers?; end + end +end + +# # Action Controller Etag With Template Digest +# +# When our views change, they should bubble up into HTTP cache freshness and +# bust browser caches. So the template digest for the current action is +# automatically included in the ETag. +# +# Enabled by default for apps that use Action View. Disable by setting +# +# config.action_controller.etag_with_template_digest = false +# +# Override the template to digest by passing `:template` to `fresh_when` and +# `stale?` calls. For example: +# +# # We're going to render widgets/show, not posts/show +# fresh_when @post, template: 'widgets/show' +# +# # We're not going to render a template, so omit it from the ETag. +# fresh_when @post, template: false +# +# source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#25 +module ActionController::EtagWithTemplateDigest + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActionController::ConditionalGet + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionController::ConditionalGet::ClassMethods + + private + + # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#39 + def determine_template_etag(options); end + + # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#55 + def lookup_and_digest_template(template); end + + # Pick the template digest to include in the ETag. If the `:template` option is + # present, use the named template. If `:template` is `nil` or absent, use the + # default controller/action template. If `:template` is false, omit the template + # digest from the ETag. + # + # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#49 + def pick_template_for_etag(options); end + + module GeneratedClassMethods + def etag_with_template_digest; end + def etag_with_template_digest=(value); end + def etag_with_template_digest?; end + def etaggers; end + def etaggers=(value); end + def etaggers?; end + end + + module GeneratedInstanceMethods + def etag_with_template_digest; end + def etag_with_template_digest=(value); end + def etag_with_template_digest?; end + def etaggers; end + def etaggers=(value); end + def etaggers?; end + end +end + +# Raised from `expect!` when an expected parameter is missing or is of an +# incompatible type. +# +# params = ActionController::Parameters.new(a: {}) +# params.expect!(:a) +# # => ActionController::ExpectedParameterMissing: param is missing or the value is empty or invalid: a +# +# source://actionpack//lib/action_controller/metal/strong_parameters.rb#49 +class ActionController::ExpectedParameterMissing < ::ActionController::ParameterMissing; end + +# source://actionpack//lib/action_controller/metal/flash.rb#6 +module ActionController::Flash + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionController::Flash::ClassMethods + + private + + # source://actionpack//lib/action_controller/metal/flash.rb#50 + def redirect_to(options = T.unsafe(nil), response_options_and_flash = T.unsafe(nil)); end + + module GeneratedClassMethods + def _flash_types; end + def _flash_types=(value); end + def _flash_types?; end + end + + module GeneratedInstanceMethods; end +end + +# source://actionpack//lib/action_controller/metal/flash.rb#16 +module ActionController::Flash::ClassMethods + # Creates new flash types. You can pass as many types as you want to create + # flash types other than the default `alert` and `notice` in your controllers + # and views. For instance: + # + # # in application_controller.rb + # class ApplicationController < ActionController::Base + # add_flash_types :warning + # end + # + # # in your controller + # redirect_to user_path(@user), warning: "Incomplete profile" + # + # # in your view + # <%= warning %> + # + # This method will automatically define a new method for each of the given + # names, and it will be available in your views. + # + # source://actionpack//lib/action_controller/metal/flash.rb#34 + def add_flash_types(*types); end +end + +# # Action Controller Form Builder +# +# Override the default form builder for all views rendered by this controller +# and any of its descendants. Accepts a subclass of +# ActionView::Helpers::FormBuilder. +# +# For example, given a form builder: +# +# class AdminFormBuilder < ActionView::Helpers::FormBuilder +# def special_field(name) +# end +# end +# +# The controller specifies a form builder as its default: +# +# class AdminAreaController < ApplicationController +# default_form_builder AdminFormBuilder +# end +# +# Then in the view any form using `form_with` or `form_for` will be an +# instance of the specified form builder: +# +# <%= form_with(model: @instance) do |builder| %> +# <%= builder.special_field(:name) %> +# <% end %> +# +# source://actionpack//lib/action_controller/form_builder.rb#31 +module ActionController::FormBuilder + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionController::FormBuilder::ClassMethods + + # Default form builder for the controller + # + # source://actionpack//lib/action_controller/form_builder.rb#51 + def default_form_builder; end + + module GeneratedClassMethods + def _default_form_builder; end + def _default_form_builder=(value); end + def _default_form_builder?; end + end + + module GeneratedInstanceMethods; end +end + +# source://actionpack//lib/action_controller/form_builder.rb#38 +module ActionController::FormBuilder::ClassMethods + # Set the form builder to be used as the default for all forms in the views + # rendered by this controller and its subclasses. + # + # #### Parameters + # * `builder` - Default form builder. Accepts a subclass of + # ActionView::Helpers::FormBuilder + # + # source://actionpack//lib/action_controller/form_builder.rb#45 + def default_form_builder(builder); end +end + +# source://actionpack//lib/action_controller/metal/head.rb#6 +module ActionController::Head + # Returns a response that has no content (merely headers). The options argument + # is interpreted to be a hash of header names and values. This allows you to + # easily return a response that consists only of significant headers: + # + # head :created, location: person_path(@person) + # + # head :created, location: @person + # + # It can also be used to return exceptional conditions: + # + # return head(:method_not_allowed) unless request.post? + # return head(:bad_request) unless valid_request? + # render + # + # See `Rack::Utils::SYMBOL_TO_STATUS_CODE` for a full list of valid `status` + # symbols. + # + # @raise [::AbstractController::DoubleRenderError] + # + # source://actionpack//lib/action_controller/metal/head.rb#23 + def head(status, options = T.unsafe(nil)); end + + private + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/head.rb#58 + def include_content?(status); end +end + +# # Action Controller Helpers +# +# The Rails framework provides a large number of helpers for working with +# assets, dates, forms, numbers and model objects, to name a few. These helpers +# are available to all templates by default. +# +# In addition to using the standard template helpers provided, creating custom +# helpers to extract complicated logic or reusable functionality is strongly +# encouraged. By default, each controller will include all helpers. These +# helpers are only accessible on the controller through `#helpers` +# +# In previous versions of Rails the controller will include a helper which +# matches the name of the controller, e.g., `MyController` will automatically +# include `MyHelper`. You can revert to the old behavior with the following: +# +# # config/application.rb +# class Application < Rails::Application +# config.action_controller.include_all_helpers = false +# end +# +# Additional helpers can be specified using the `helper` class method in +# ActionController::Base or any controller which inherits from it. +# +# The `to_s` method from the Time class can be wrapped in a helper method to +# display a custom message if a Time object is blank: +# +# module FormattedTimeHelper +# def format_time(time, format=:long, blank_message=" ") +# time.blank? ? blank_message : time.to_fs(format) +# end +# end +# +# FormattedTimeHelper can now be included in a controller, using the `helper` +# class method: +# +# class EventsController < ActionController::Base +# helper FormattedTimeHelper +# def index +# @events = Event.all +# end +# end +# +# Then, in any view rendered by `EventsController`, the `format_time` method can +# be called: +# +# <% @events.each do |event| -%> +#

+# <%= format_time(event.time, :short, "N/A") %> | <%= event.name %> +#

+# <% end -%> +# +# Finally, assuming we have two event instances, one which has a time and one +# which does not, the output might look like this: +# +# 23 Aug 11:30 | Carolina Railhawks Soccer Match +# N/A | Carolina Railhawks Training Workshop +# +# source://actionpack//lib/action_controller/metal/helpers.rb#63 +module ActionController::Helpers + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::AbstractController::Helpers + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::AbstractController::Helpers::ClassMethods + mixes_in_class_methods ::ActionController::Helpers::ClassMethods + + # Provides a proxy to access helper methods from outside the view. + # + # source://actionpack//lib/action_controller/metal/helpers.rb#125 + def helpers; end + + class << self + # Returns the value of attribute helpers_path. + # + # source://actionpack//lib/action_controller/metal/helpers.rb#66 + def helpers_path; end + + # Sets the attribute helpers_path + # + # @param value the value to set the attribute helpers_path to. + # + # source://actionpack//lib/action_controller/metal/helpers.rb#66 + def helpers_path=(_arg0); end + end + + module GeneratedClassMethods + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + def helpers_path; end + def helpers_path=(value); end + def helpers_path?; end + def include_all_helpers; end + def include_all_helpers=(value); end + def include_all_helpers?; end + end + + module GeneratedInstanceMethods + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + def helpers_path; end + def helpers_path=(value); end + def helpers_path?; end + def include_all_helpers; end + def include_all_helpers=(value); end + def include_all_helpers?; end + end +end + +# source://actionpack//lib/action_controller/metal/helpers.rb#74 +module ActionController::Helpers::ClassMethods + # Declares helper accessors for controller attributes. For example, the + # following adds new `name` and `name=` instance methods to a controller and + # makes them available to the view: + # attr_accessor :name + # helper_attr :name + # + # #### Parameters + # * `attrs` - Names of attributes to be converted into helpers. + # + # source://actionpack//lib/action_controller/metal/helpers.rb#84 + def helper_attr(*attrs); end + + # Provides a proxy to access helper methods from outside the view. + # + # Note that the proxy is rendered under a different view context. This may cause + # incorrect behavior with capture methods. Consider using + # [helper](rdoc-ref:AbstractController::Helpers::ClassMethods#helper) instead + # when using `capture`. + # + # source://actionpack//lib/action_controller/metal/helpers.rb#94 + def helpers; end + + # Override modules_for_helpers to accept `:all` as argument, which loads all + # helpers in helpers_path. + # + # #### Parameters + # * `args` - A list of helpers + # + # + # #### Returns + # * `array` - A normalized list of modules for the list of helpers provided. + # + # source://actionpack//lib/action_controller/metal/helpers.rb#112 + def modules_for_helpers(args); end + + private + + # Extract helper names from files in `app/helpers/***/**_helper.rb` + # + # source://actionpack//lib/action_controller/metal/helpers.rb#119 + def all_application_helpers; end +end + +# HTTP Basic, Digest, and Token authentication. +# +# source://actionpack//lib/action_controller/metal/http_authentication.rb#11 +module ActionController::HttpAuthentication; end + +# # HTTP Basic authentication +# +# ### Simple Basic example +# +# class PostsController < ApplicationController +# http_basic_authenticate_with name: "dhh", password: "secret", except: :index +# +# def index +# render plain: "Everyone can see me!" +# end +# +# def edit +# render plain: "I'm only accessible if you know the password" +# end +# end +# +# ### Advanced Basic example +# +# Here is a more advanced Basic example where only Atom feeds and the XML API +# are protected by HTTP authentication. The regular HTML interface is protected +# by a session approach: +# +# class ApplicationController < ActionController::Base +# before_action :set_account, :authenticate +# +# private +# def set_account +# @account = Account.find_by(url_name: request.subdomains.first) +# end +# +# def authenticate +# case request.format +# when Mime[:xml], Mime[:atom] +# if user = authenticate_with_http_basic { |u, p| @account.users.authenticate(u, p) } +# @current_user = user +# else +# request_http_basic_authentication +# end +# else +# if session_authenticated? +# @current_user = @account.users.find(session[:authenticated][:user_id]) +# else +# redirect_to(login_url) and return false +# end +# end +# end +# end +# +# In your integration tests, you can do something like this: +# +# def test_access_granted_from_xml +# authorization = ActionController::HttpAuthentication::Basic.encode_credentials(users(:dhh).name, users(:dhh).password) +# +# get "/notes/1.xml", headers: { 'HTTP_AUTHORIZATION' => authorization } +# +# assert_equal 200, status +# end +# +# source://actionpack//lib/action_controller/metal/http_authentication.rb#69 +module ActionController::HttpAuthentication::Basic + extend ::ActionController::HttpAuthentication::Basic + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#130 + def auth_param(request); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#126 + def auth_scheme(request); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#108 + def authenticate(request, &login_procedure); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#138 + def authentication_request(controller, realm, message); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#122 + def decode_credentials(request); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#134 + def encode_credentials(user_name, password); end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#114 + def has_basic_credentials?(request); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#118 + def user_name_and_password(request); end +end + +# source://actionpack//lib/action_controller/metal/http_authentication.rb#72 +module ActionController::HttpAuthentication::Basic::ControllerMethods + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionController::HttpAuthentication::Basic::ControllerMethods::ClassMethods + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#95 + def authenticate_or_request_with_http_basic(realm = T.unsafe(nil), message = T.unsafe(nil), &login_procedure); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#99 + def authenticate_with_http_basic(&login_procedure); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#86 + def http_basic_authenticate_or_request_with(name:, password:, realm: T.unsafe(nil), message: T.unsafe(nil)); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#103 + def request_http_basic_authentication(realm = T.unsafe(nil), message = T.unsafe(nil)); end +end + +# source://actionpack//lib/action_controller/metal/http_authentication.rb#75 +module ActionController::HttpAuthentication::Basic::ControllerMethods::ClassMethods + # Enables HTTP Basic authentication. + # + # See ActionController::HttpAuthentication::Basic for example usage. + # + # @raise [ArgumentError] + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#79 + def http_basic_authenticate_with(name:, password:, realm: T.unsafe(nil), **options); end +end + +# # HTTP Digest authentication +# +# ### Simple Digest example +# +# require "openssl" +# class PostsController < ApplicationController +# REALM = "SuperSecret" +# USERS = {"dhh" => "secret", #plain text password +# "dap" => OpenSSL::Digest::MD5.hexdigest(["dap",REALM,"secret"].join(":"))} #ha1 digest password +# +# before_action :authenticate, except: [:index] +# +# def index +# render plain: "Everyone can see me!" +# end +# +# def edit +# render plain: "I'm only accessible if you know the password" +# end +# +# private +# def authenticate +# authenticate_or_request_with_http_digest(REALM) do |username| +# USERS[username] +# end +# end +# end +# +# ### Notes +# +# The `authenticate_or_request_with_http_digest` block must return the user's +# password or the ha1 digest hash so the framework can appropriately hash to +# check the user's credentials. Returning `nil` will cause authentication to +# fail. +# +# Storing the ha1 hash: MD5(username:realm:password), is better than storing a +# plain password. If the password file or database is compromised, the attacker +# would be able to use the ha1 hash to authenticate as the user at this `realm`, +# but would not have the user's password to try using at other sites. +# +# In rare instances, web servers or front proxies strip authorization headers +# before they reach your application. You can debug this situation by logging +# all environment variables, and check for HTTP_AUTHORIZATION, amongst others. +# +# source://actionpack//lib/action_controller/metal/http_authentication.rb#189 +module ActionController::HttpAuthentication::Digest + extend ::ActionController::HttpAuthentication::Digest + + # Returns true on a valid response, false otherwise. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#215 + def authenticate(request, realm, &password_procedure); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#274 + def authentication_header(controller, realm); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#281 + def authentication_request(controller, realm, message = T.unsafe(nil)); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#267 + def decode_credentials(header); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#263 + def decode_credentials_header(request); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#258 + def encode_credentials(http_method, credentials, password, password_is_ha1); end + + # Returns the expected response for a request of `http_method` to `uri` with the + # decoded `credentials` and the expected `password` Optional parameter + # `password_is_ha1` is set to `true` by default, since best practice is to store + # ha1 digest instead of a plain-text password. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#248 + def expected_response(http_method, uri, credentials, password, password_is_ha1 = T.unsafe(nil)); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#254 + def ha1(credentials, password); end + + # Uses an MD5 digest based on time to generate a value to be used only once. + # + # A server-specified data string which should be uniquely generated each time a + # 401 response is made. It is recommended that this string be base64 or + # hexadecimal data. Specifically, since the string is passed in the header lines + # as a quoted string, the double-quote character is not allowed. + # + # The contents of the nonce are implementation dependent. The quality of the + # implementation depends on a good choice. A nonce might, for example, be + # constructed as the base 64 encoding of + # + # time-stamp H(time-stamp ":" ETag ":" private-key) + # + # where time-stamp is a server-generated time or other non-repeating value, ETag + # is the value of the HTTP ETag header associated with the requested entity, and + # private-key is data known only to the server. With a nonce of this form a + # server would recalculate the hash portion after receiving the client + # authentication header and reject the request if it did not match the nonce + # from that header or if the time-stamp value is not recent enough. In this way + # the server can limit the time of the nonce's validity. The inclusion of the + # ETag prevents a replay request for an updated version of the resource. (Note: + # including the IP address of the client in the nonce would appear to offer the + # server the ability to limit the reuse of the nonce to the same client that + # originally got it. However, that would break proxy farms, where requests from + # a single user often go through different proxies in the farm. Also, IP address + # spoofing is not that hard.) + # + # An implementation might choose not to accept a previously used nonce or a + # previously used digest, in order to protect against a replay attack. Or, an + # implementation might choose to use one-time nonces or digests for POST, PUT, + # or PATCH requests, and a time-stamp for GET requests. For more details on the + # issues involved see Section 4 of this document. + # + # The nonce is opaque to the client. Composed of Time, and hash of Time with + # secret key from the Rails session secret generated upon creation of project. + # Ensures the time cannot be modified by client. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#330 + def nonce(secret_key, time = T.unsafe(nil)); end + + # Opaque based on digest of secret key + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#348 + def opaque(secret_key); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#288 + def secret_token(request); end + + # Returns false unless the request credentials response value matches the + # expected value. First try the password as a ha1 digest password. If this + # fails, then try it as a plain text password. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#222 + def validate_digest_response(request, realm, &password_procedure); end + + # Might want a shorter timeout depending on whether the request is a PATCH, PUT, + # or POST, and if the client is a browser or web service. Can be much shorter if + # the Stale directive is implemented. This would allow a user to use new nonce + # without prompting the user again for their username and password. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#341 + def validate_nonce(secret_key, request, value, seconds_to_timeout = T.unsafe(nil)); end +end + +# source://actionpack//lib/action_controller/metal/http_authentication.rb#192 +module ActionController::HttpAuthentication::Digest::ControllerMethods + # Authenticate using an HTTP Digest, or otherwise render an HTTP header + # requesting the client to send a Digest. + # + # See ActionController::HttpAuthentication::Digest for example usage. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#197 + def authenticate_or_request_with_http_digest(realm = T.unsafe(nil), message = T.unsafe(nil), &password_procedure); end + + # Authenticate using an HTTP Digest. Returns true if authentication is + # successful, false otherwise. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#203 + def authenticate_with_http_digest(realm = T.unsafe(nil), &password_procedure); end + + # Render an HTTP header requesting the client to send a Digest for + # authentication. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#209 + def request_http_digest_authentication(realm = T.unsafe(nil), message = T.unsafe(nil)); end +end + +# # HTTP Token authentication +# +# ### Simple Token example +# +# class PostsController < ApplicationController +# TOKEN = "secret" +# +# before_action :authenticate, except: [ :index ] +# +# def index +# render plain: "Everyone can see me!" +# end +# +# def edit +# render plain: "I'm only accessible if you know the password" +# end +# +# private +# def authenticate +# authenticate_or_request_with_http_token do |token, options| +# # Compare the tokens in a time-constant manner, to mitigate +# # timing attacks. +# ActiveSupport::SecurityUtils.secure_compare(token, TOKEN) +# end +# end +# end +# +# Here is a more advanced Token example where only Atom feeds and the XML API +# are protected by HTTP token authentication. The regular HTML interface is +# protected by a session approach: +# +# class ApplicationController < ActionController::Base +# before_action :set_account, :authenticate +# +# private +# def set_account +# @account = Account.find_by(url_name: request.subdomains.first) +# end +# +# def authenticate +# case request.format +# when Mime[:xml], Mime[:atom] +# if user = authenticate_with_http_token { |t, o| @account.users.authenticate(t, o) } +# @current_user = user +# else +# request_http_token_authentication +# end +# else +# if session_authenticated? +# @current_user = @account.users.find(session[:authenticated][:user_id]) +# else +# redirect_to(login_url) and return false +# end +# end +# end +# end +# +# In your integration tests, you can do something like this: +# +# def test_access_granted_from_xml +# authorization = ActionController::HttpAuthentication::Token.encode_credentials(users(:dhh).token) +# +# get "/notes/1.xml", headers: { 'HTTP_AUTHORIZATION' => authorization } +# +# assert_equal 200, status +# end +# +# On shared hosts, Apache sometimes doesn't pass authentication headers to FCGI +# instances. If your environment matches this description and you cannot +# authenticate, try this rule in your Apache setup: +# +# RewriteRule ^(.*)$ dispatch.fcgi [E=X-HTTP_AUTHORIZATION:%{HTTP:Authorization},QSA,L] +# +# source://actionpack//lib/action_controller/metal/http_authentication.rb#425 +module ActionController::HttpAuthentication::Token + extend ::ActionController::HttpAuthentication::Token + + # If token Authorization header is present, call the login procedure with the + # present token and options. + # + # Returns the return value of `login_procedure` if a token is found. Returns + # `nil` if no token is found. + # + # #### Parameters + # + # * `controller` - ActionController::Base instance for the current request. + # * `login_procedure` - Proc to call if a token is present. The Proc should + # take two arguments: + # + # authenticate(controller) { |token, options| ... } + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#472 + def authenticate(controller, &login_procedure); end + + # Sets a WWW-Authenticate header to let the client know a token is desired. + # + # Returns nothing. + # + # #### Parameters + # + # * `controller` - ActionController::Base instance for the outgoing response. + # * `realm` - String realm to use in the header. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#555 + def authentication_request(controller, realm, message = T.unsafe(nil)); end + + # Encodes the given token and options into an Authorization header value. + # + # Returns String. + # + # #### Parameters + # + # * `token` - String token. + # * `options` - Optional Hash of the options. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#539 + def encode_credentials(token, options = T.unsafe(nil)); end + + # Takes `raw_params` and turns it into an array of parameters. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#507 + def params_array_from(raw_params); end + + # This method takes an authorization body and splits up the key-value pairs by + # the standardized `:`, `;`, or `\t` delimiters defined in + # `AUTHN_PAIR_DELIMITERS`. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#519 + def raw_params(auth); end + + # This removes the `"` characters wrapping the value. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#512 + def rewrite_param_values(array_params); end + + # Parses the token and options out of the token Authorization header. The value + # for the Authorization header is expected to have the prefix `"Token"` or + # `"Bearer"`. If the header looks like this: + # + # Authorization: Token token="abc", nonce="def" + # + # Then the returned token is `"abc"`, and the options are `{nonce: "def"}`. + # + # Returns an `Array` of `[String, Hash]` if a token is present. Returns `nil` if + # no token is found. + # + # #### Parameters + # + # * `request` - ActionDispatch::Request instance with the current headers. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#494 + def token_and_options(request); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#502 + def token_params_from(auth); end +end + +# source://actionpack//lib/action_controller/metal/http_authentication.rb#428 +ActionController::HttpAuthentication::Token::AUTHN_PAIR_DELIMITERS = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_controller/metal/http_authentication.rb#431 +module ActionController::HttpAuthentication::Token::ControllerMethods + # Authenticate using an HTTP Bearer token, or otherwise render an HTTP header + # requesting the client to send a Bearer token. For the authentication to be + # considered successful, `login_procedure` must not return a false value. + # Typically, the authenticated user is returned. + # + # See ActionController::HttpAuthentication::Token for example usage. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#438 + def authenticate_or_request_with_http_token(realm = T.unsafe(nil), message = T.unsafe(nil), &login_procedure); end + + # Authenticate using an HTTP Bearer token. Returns the return value of + # `login_procedure` if a token is found. Returns `nil` if no token is found. + # + # See ActionController::HttpAuthentication::Token for example usage. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#446 + def authenticate_with_http_token(&login_procedure); end + + # Render an HTTP header requesting the client to send a Bearer token for + # authentication. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#452 + def request_http_token_authentication(realm = T.unsafe(nil), message = T.unsafe(nil)); end +end + +# source://actionpack//lib/action_controller/metal/http_authentication.rb#426 +ActionController::HttpAuthentication::Token::TOKEN_KEY = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_controller/metal/http_authentication.rb#427 +ActionController::HttpAuthentication::Token::TOKEN_REGEX = T.let(T.unsafe(nil), Regexp) + +# # Action Controller Implicit Render +# +# Handles implicit rendering for a controller action that does not explicitly +# respond with `render`, `respond_to`, `redirect`, or `head`. +# +# For API controllers, the implicit response is always `204 No Content`. +# +# For all other controllers, we use these heuristics to decide whether to render +# a template, raise an error for a missing template, or respond with `204 No +# Content`: +# +# First, if we DO find a template, it's rendered. Template lookup accounts for +# the action name, locales, format, variant, template handlers, and more (see +# `render` for details). +# +# Second, if we DON'T find a template but the controller action does have +# templates for other formats, variants, etc., then we trust that you meant to +# provide a template for this response, too, and we raise +# ActionController::UnknownFormat with an explanation. +# +# Third, if we DON'T find a template AND the request is a page load in a web +# browser (technically, a non-XHR GET request for an HTML response) where you +# reasonably expect to have rendered a template, then we raise +# ActionController::MissingExactTemplate with an explanation. +# +# Finally, if we DON'T find a template AND the request isn't a browser page +# load, then we implicitly respond with `204 No Content`. +# +# source://actionpack//lib/action_controller/metal/implicit_render.rb#33 +module ActionController::ImplicitRender + include ::ActionController::BasicImplicitRender + + # source://actionpack//lib/action_controller/metal/implicit_render.rb#37 + def default_render; end + + # source://actionpack//lib/action_controller/metal/implicit_render.rb#56 + def method_for_action(action_name); end + + private + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/implicit_render.rb#63 + def interactive_browser_request?; end +end + +# # Action Controller Instrumentation +# +# Adds instrumentation to several ends in ActionController::Base. It also +# provides some hooks related with process_action. This allows an ORM like +# Active Record and/or DataMapper to plug in ActionController and show related +# information. +# +# Check ActiveRecord::Railties::ControllerRuntime for an example. +# +# source://actionpack//lib/action_controller/metal/instrumentation.rb#16 +module ActionController::Instrumentation + extend ::ActiveSupport::Concern + include ::ActiveSupport::Benchmarkable + include ::AbstractController::Logger + + mixes_in_class_methods ::ActionController::Instrumentation::ClassMethods + + # source://actionpack//lib/action_controller/metal/instrumentation.rb#23 + def initialize(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/metal/instrumentation.rb#49 + def redirect_to(*_arg0); end + + # source://actionpack//lib/action_controller/metal/instrumentation.rb#28 + def render(*_arg0); end + + # source://actionpack//lib/action_controller/metal/instrumentation.rb#43 + def send_data(data, options = T.unsafe(nil)); end + + # source://actionpack//lib/action_controller/metal/instrumentation.rb#36 + def send_file(path, options = T.unsafe(nil)); end + + # source://actionpack//lib/action_controller/metal/instrumentation.rb#21 + def view_runtime; end + + # source://actionpack//lib/action_controller/metal/instrumentation.rb#21 + def view_runtime=(_arg0); end + + private + + # Every time after an action is processed, this method is invoked with the + # payload, so you can add more information. + # + # source://actionpack//lib/action_controller/metal/instrumentation.rb#105 + def append_info_to_payload(payload); end + + # A hook which allows you to clean up any time, wrongly taken into account in + # views, like database querying time. + # + # def cleanup_view_runtime + # super - time_taken_in_something_expensive + # end + # + # source://actionpack//lib/action_controller/metal/instrumentation.rb#99 + def cleanup_view_runtime; end + + # A hook invoked every time a before callback is halted. + # + # source://actionpack//lib/action_controller/metal/instrumentation.rb#89 + def halted_callback_hook(filter, _); end + + # source://actionpack//lib/action_controller/metal/instrumentation.rb#59 + def process_action(*_arg0); end +end + +# source://actionpack//lib/action_controller/metal/instrumentation.rb#109 +module ActionController::Instrumentation::ClassMethods + # A hook which allows other frameworks to log what happened during controller + # process action. This method should return an array with the messages to be + # added. + # + # source://actionpack//lib/action_controller/metal/instrumentation.rb#113 + def log_process_action(payload); end +end + +# source://actionpack//lib/action_controller/metal/request_forgery_protection.rb#10 +class ActionController::InvalidAuthenticityToken < ::ActionController::ActionControllerError; end + +# source://actionpack//lib/action_controller/metal/request_forgery_protection.rb#13 +class ActionController::InvalidCrossOriginRequest < ::ActionController::ActionControllerError; end + +# Raised when initializing Parameters with keys that aren't strings or symbols. +# +# ActionController::Parameters.new(123 => 456) +# # => ActionController::InvalidParameterKey: all keys must be Strings or Symbols, got: Integer +# +# source://actionpack//lib/action_controller/metal/strong_parameters.rb#84 +class ActionController::InvalidParameterKey < ::ArgumentError; end + +# # Action Controller Live +# +# Mix this module into your controller, and all actions in that controller will +# be able to stream data to the client as it's written. +# +# class MyController < ActionController::Base +# include ActionController::Live +# +# def stream +# response.headers['Content-Type'] = 'text/event-stream' +# 100.times { +# response.stream.write "hello world\n" +# sleep 1 +# } +# ensure +# response.stream.close +# end +# end +# +# There are a few caveats with this module. You **cannot** write headers after +# the response has been committed (Response#committed? will return truthy). +# Calling `write` or `close` on the response stream will cause the response +# object to be committed. Make sure all headers are set before calling write or +# close on your stream. +# +# You **must** call close on your stream when you're finished, otherwise the +# socket may be left open forever. +# +# The final caveat is that your actions are executed in a separate thread than +# the main thread. Make sure your actions are thread safe, and this shouldn't be +# a problem (don't share state across threads, etc). +# +# Note that Rails includes `Rack::ETag` by default, which will buffer your +# response. As a result, streaming responses may not work properly with Rack +# 2.2.x, and you may need to implement workarounds in your application. You can +# either set the `ETag` or `Last-Modified` response headers or remove +# `Rack::ETag` from the middleware stack to address this issue. +# +# Here's an example of how you can set the `Last-Modified` header if your Rack +# version is 2.2.x: +# +# def stream +# response.headers["Content-Type"] = "text/event-stream" +# response.headers["Last-Modified"] = Time.now.httpdate # Add this line if your Rack version is 2.2.x +# ... +# end +# +# source://actionpack//lib/action_controller/metal/live.rb#56 +module ActionController::Live + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionController::Live::ClassMethods + + # source://actionpack//lib/action_controller/metal/live.rb#371 + def clean_up_thread_locals(*args); end + + # source://actionpack//lib/action_controller/metal/live.rb#362 + def new_controller_thread; end + + # source://actionpack//lib/action_controller/metal/live.rb#266 + def process(name); end + + # source://actionpack//lib/action_controller/metal/live.rb#310 + def response_body=(body); end + + # Sends a stream to the browser, which is helpful when you're generating exports + # or other running data where you don't want the entire file buffered in memory + # first. Similar to send_data, but where the data is generated live. + # + # #### Options: + # + # * `:filename` - suggests a filename for the browser to use. + # * `:type` - specifies an HTTP content type. You can specify either a string + # or a symbol for a registered type with `Mime::Type.register`, for example + # :json. If omitted, type will be inferred from the file extension specified + # in `:filename`. If no content type is registered for the extension, the + # default type 'application/octet-stream' will be used. + # * `:disposition` - specifies whether the file will be shown inline or + # downloaded. Valid values are 'inline' and 'attachment' (default). + # + # + # Example of generating a csv export: + # + # send_stream(filename: "subscribers.csv") do |stream| + # stream.write "email_address,updated_at\n" + # + # @subscribers.find_each do |subscriber| + # stream.write "#{subscriber.email_address},#{subscriber.updated_at}\n" + # end + # end + # + # source://actionpack//lib/action_controller/metal/live.rb#340 + def send_stream(filename:, disposition: T.unsafe(nil), type: T.unsafe(nil)); end + + private + + # source://actionpack//lib/action_controller/metal/live.rb#379 + def log_error(exception); end + + # Ensure we clean up any thread locals we copied so that the thread can reused. + # Because of the above, we need to prevent the clearing of thread locals, since + # no new thread is actually spawned in the test environment. + # + # source://actionpack//lib/action_controller/test_case.rb#34 + def original_clean_up_thread_locals(locals, thread); end + + # Spawn a new thread to serve up the controller in. This is to get around the + # fact that Rack isn't based around IOs and we need to use a thread to stream + # data from the response bodies. Nobody should call this method except in Rails + # internals. Seriously! + # Disable controller / rendering threads in tests. User tests can access the + # database on the main thread, so they could open a txn, then the controller + # thread will open a new connection and try to access data that's only visible + # to the main thread's txn. This is the problem in #23483. + # + # source://actionpack//lib/action_controller/test_case.rb#25 + def original_new_controller_thread; end + + class << self + # source://actionpack//lib/action_controller/metal/live.rb#375 + def live_thread_pool_executor; end + end +end + +# source://actionpack//lib/action_controller/metal/live.rb#152 +class ActionController::Live::Buffer < ::ActionDispatch::Response::Buffer + include ::MonitorMixin + + # @return [Buffer] a new instance of Buffer + # + # source://actionpack//lib/action_controller/metal/live.rb#167 + def initialize(response); end + + # Inform the producer/writing thread that the client has disconnected; the + # reading thread is no longer interested in anything that's being written. + # + # See also #close. + # + # source://actionpack//lib/action_controller/metal/live.rb#215 + def abort; end + + # source://actionpack//lib/action_controller/metal/live.rb#234 + def call_on_error; end + + # Write a 'close' event to the buffer; the producer/writing thread uses this to + # notify us that it's finished supplying content. + # + # See also #abort. + # + # source://actionpack//lib/action_controller/metal/live.rb#203 + def close; end + + # Is the client still connected and waiting for content? + # + # The result of calling `write` when this is `false` is determined by + # `ignore_disconnect`. + # + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/live.rb#226 + def connected?; end + + # Ignore that the client has disconnected. + # + # If this value is `true`, calling `write` after the client disconnects will + # result in the written content being silently discarded. If this value is + # `false` (the default), a ClientDisconnected exception will be raised. + # + # source://actionpack//lib/action_controller/metal/live.rb#165 + def ignore_disconnect; end + + # Ignore that the client has disconnected. + # + # If this value is `true`, calling `write` after the client disconnects will + # result in the written content being silently discarded. If this value is + # `false` (the default), a ClientDisconnected exception will be raised. + # + # source://actionpack//lib/action_controller/metal/live.rb#165 + def ignore_disconnect=(_arg0); end + + # source://actionpack//lib/action_controller/metal/live.rb#230 + def on_error(&block); end + + # source://actionpack//lib/action_controller/metal/live.rb#175 + def write(string); end + + # Same as `write` but automatically include a newline at the end of the string. + # + # source://actionpack//lib/action_controller/metal/live.rb#195 + def writeln(string); end + + private + + # source://actionpack//lib/action_controller/metal/live.rb#245 + def build_queue(queue_size); end + + # source://actionpack//lib/action_controller/metal/live.rb#239 + def each_chunk(&block); end + + class << self + # Returns the value of attribute queue_size. + # + # source://actionpack//lib/action_controller/metal/live.rb#156 + def queue_size; end + + # Sets the attribute queue_size + # + # @param value the value to set the attribute queue_size to. + # + # source://actionpack//lib/action_controller/metal/live.rb#156 + def queue_size=(_arg0); end + end +end + +# source://actionpack//lib/action_controller/metal/live.rb#59 +module ActionController::Live::ClassMethods + # source://actionpack//lib/action_controller/metal/live.rb#60 + def make_response!(request); end +end + +# source://actionpack//lib/action_controller/metal/live.rb#149 +class ActionController::Live::ClientDisconnected < ::RuntimeError; end + +# source://actionpack//lib/action_controller/metal/live.rb#250 +class ActionController::Live::Response < ::ActionDispatch::Response + private + + # source://actionpack//lib/action_controller/metal/live.rb#252 + def before_committed; end + + # source://actionpack//lib/action_controller/metal/live.rb#259 + def build_buffer(response, body); end +end + +# # Action Controller Live Server Sent Events +# +# This class provides the ability to write an SSE (Server Sent Event) to an IO +# stream. The class is initialized with a stream and can be used to either write +# a JSON string or an object which can be converted to JSON. +# +# Writing an object will convert it into standard SSE format with whatever +# options you have configured. You may choose to set the following options: +# +# `:event` +# +# `:retry` +# +# `:id` +# server will receive a `Last-Event-ID` header with value equal to `id`. +# +# After setting an option in the constructor of the SSE object, all future SSEs +# sent across the stream will use those options unless overridden. +# +# Example Usage: +# +# class MyController < ActionController::Base +# include ActionController::Live +# +# def index +# response.headers['Content-Type'] = 'text/event-stream' +# sse = SSE.new(response.stream, retry: 300, event: "event-name") +# sse.write({ name: 'John'}) +# sse.write({ name: 'John'}, id: 10) +# sse.write({ name: 'John'}, id: 10, event: "other-event") +# sse.write({ name: 'John'}, id: 10, event: "other-event", retry: 500) +# ensure +# sse.close +# end +# end +# +# Note: SSEs are not currently supported by IE. However, they are supported by +# Chrome, Firefox, Opera, and Safari. +# +# source://actionpack//lib/action_controller/metal/live.rb#112 +class ActionController::Live::SSE + # @return [SSE] a new instance of SSE + # + # source://actionpack//lib/action_controller/metal/live.rb#115 + def initialize(stream, options = T.unsafe(nil)); end + + # source://actionpack//lib/action_controller/metal/live.rb#120 + def close; end + + # source://actionpack//lib/action_controller/metal/live.rb#124 + def write(object, options = T.unsafe(nil)); end + + private + + # source://actionpack//lib/action_controller/metal/live.rb#134 + def perform_write(json, options); end +end + +# source://actionpack//lib/action_controller/metal/live.rb#113 +ActionController::Live::SSE::PERMITTED_OPTIONS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_controller/test_case.rb#184 +class ActionController::LiveTestResponse < ::ActionController::Live::Response + # Was there a server-side error? + # + # source://actionpack//lib/action_controller/test_case.rb#192 + def error?; end + + # Was the URL not found? + # + # source://actionpack//lib/action_controller/test_case.rb#189 + def missing?; end + + # Was the response successful? + # + # source://actionpack//lib/action_controller/test_case.rb#186 + def success?; end +end + +# source://actionpack//lib/action_controller/log_subscriber.rb#4 +class ActionController::LogSubscriber < ::ActiveSupport::LogSubscriber + # source://actionpack//lib/action_controller/log_subscriber.rb#7 + def backtrace_cleaner; end + + # source://actionpack//lib/action_controller/log_subscriber.rb#7 + def backtrace_cleaner=(_arg0); end + + # source://actionpack//lib/action_controller/log_subscriber.rb#7 + def backtrace_cleaner?; end + + # source://actionpack//lib/action_controller/log_subscriber.rb#89 + def exist_fragment?(event); end + + # source://actionpack//lib/action_controller/log_subscriber.rb#89 + def expire_fragment(event); end + + # source://actionpack//lib/action_controller/log_subscriber.rb#47 + def halted_callback(event); end + + # source://actionpack//lib/action_controller/log_subscriber.rb#101 + def logger; end + + # source://actionpack//lib/action_controller/log_subscriber.rb#26 + def process_action(event); end + + # source://actionpack//lib/action_controller/log_subscriber.rb#89 + def read_fragment(event); end + + # source://actionpack//lib/action_controller/log_subscriber.rb#105 + def redirect_source_location; end + + # source://actionpack//lib/action_controller/log_subscriber.rb#64 + def redirect_to(event); end + + # Manually subscribed below + # + # source://actionpack//lib/action_controller/log_subscriber.rb#53 + def rescue_from_callback(event); end + + # source://actionpack//lib/action_controller/log_subscriber.rb#73 + def send_data(event); end + + # source://actionpack//lib/action_controller/log_subscriber.rb#59 + def send_file(event); end + + # source://actionpack//lib/action_controller/log_subscriber.rb#9 + def start_processing(event); end + + # source://actionpack//lib/action_controller/log_subscriber.rb#78 + def unpermitted_parameters(event); end + + # source://actionpack//lib/action_controller/log_subscriber.rb#89 + def write_fragment(event); end + + class << self + # source://actionpack//lib/action_controller/log_subscriber.rb#7 + def backtrace_cleaner; end + + # source://actionpack//lib/action_controller/log_subscriber.rb#7 + def backtrace_cleaner=(value); end + + # source://actionpack//lib/action_controller/log_subscriber.rb#7 + def backtrace_cleaner?; end + + private + + # source://actionpack//lib/action_controller/log_subscriber.rb#7 + def __class_attr_backtrace_cleaner; end + + # source://actionpack//lib/action_controller/log_subscriber.rb#7 + def __class_attr_backtrace_cleaner=(new_value); end + + # source://actionpack//lib/action_controller/log_subscriber.rb#24 + def __class_attr_log_levels; end + + # source://actionpack//lib/action_controller/log_subscriber.rb#24 + def __class_attr_log_levels=(new_value); end + end +end + +# source://actionpack//lib/action_controller/log_subscriber.rb#5 +ActionController::LogSubscriber::INTERNAL_PARAMS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_controller/metal/logging.rb#6 +module ActionController::Logging + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionController::Logging::ClassMethods +end + +# source://actionpack//lib/action_controller/metal/logging.rb#9 +module ActionController::Logging::ClassMethods + # Set a different log level per request. + # + # # Use the debug log level if a particular cookie is set. + # class ApplicationController < ActionController::Base + # log_at :debug, if: -> { cookies[:debug] } + # end + # + # source://actionpack//lib/action_controller/metal/logging.rb#17 + def log_at(level, **options); end +end + +# # Action Controller Metal +# +# `ActionController::Metal` is the simplest possible controller, providing a +# valid Rack interface without the additional niceties provided by +# ActionController::Base. +# +# A sample metal controller might look like this: +# +# class HelloController < ActionController::Metal +# def index +# self.response_body = "Hello World!" +# end +# end +# +# And then to route requests to your metal controller, you would add something +# like this to `config/routes.rb`: +# +# get 'hello', to: HelloController.action(:index) +# +# The ::action method returns a valid Rack application for the Rails router to +# dispatch to. +# +# ## Rendering Helpers +# +# By default, `ActionController::Metal` provides no utilities for rendering +# views, partials, or other responses aside from some low-level setters such +# as #response_body=, #content_type=, and #status=. To add the render helpers +# you're used to having in a normal controller, you can do the following: +# +# class HelloController < ActionController::Metal +# include AbstractController::Rendering +# include ActionView::Layouts +# append_view_path "#{Rails.root}/app/views" +# +# def index +# render "hello/index" +# end +# end +# +# ## Redirection Helpers +# +# To add redirection helpers to your metal controller, do the following: +# +# class HelloController < ActionController::Metal +# include ActionController::Redirecting +# include Rails.application.routes.url_helpers +# +# def index +# redirect_to root_url +# end +# end +# +# ## Other Helpers +# +# You can refer to the modules included in ActionController::Base to see other +# features you can bring into your metal controller. +# +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://actionpack//lib/action_controller/metal.rb#121 +class ActionController::Metal < ::AbstractController::Base + include ::ActionController::Testing::Functional + + # @return [Metal] a new instance of Metal + # + # source://actionpack//lib/action_controller/metal.rb#210 + def initialize; end + + # Delegates to ActionDispatch::Response#content_type + # + # source://actionpack//lib/action_controller/metal.rb#204 + def content_type(*_arg0, **_arg1, &_arg2); end + + # Delegates to ActionDispatch::Response#content_type= + # + # source://actionpack//lib/action_controller/metal.rb#192 + def content_type=(arg); end + + # Delegates to the class's ::controller_name. + # + # source://actionpack//lib/action_controller/metal.rb#156 + def controller_name; end + + # source://actionpack//lib/action_controller/metal.rb#249 + def dispatch(name, request, response); end + + # Delegates to ActionDispatch::Response#headers. + # + # source://actionpack//lib/action_controller/metal.rb#180 + def headers(*_arg0, **_arg1, &_arg2); end + + # Delegates to ActionDispatch::Response#location + # + # source://actionpack//lib/action_controller/metal.rb#200 + def location(*_arg0, **_arg1, &_arg2); end + + # Delegates to ActionDispatch::Response#location= + # + # source://actionpack//lib/action_controller/metal.rb#188 + def location=(arg); end + + # Delegates to ActionDispatch::Response#media_type + # + # source://actionpack//lib/action_controller/metal.rb#208 + def media_type(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/metal.rb#288 + def middleware_stack; end + + # source://actionpack//lib/action_controller/metal.rb#288 + def middleware_stack=(_arg0); end + + # source://actionpack//lib/action_controller/metal.rb#288 + def middleware_stack?; end + + # source://actionpack//lib/action_controller/metal.rb#219 + def params; end + + # source://actionpack//lib/action_controller/metal.rb#223 + def params=(val); end + + # Tests if render or redirect has already happened. + # + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal.rb#245 + def performed?; end + + # :attr_reader: request + # + # The ActionDispatch::Request instance for the current request. + # + # source://actionpack//lib/action_controller/metal.rb#164 + def request; end + + # source://actionpack//lib/action_controller/metal.rb#164 + def request=(_arg0); end + + # source://actionpack//lib/action_controller/metal.rb#284 + def reset_session; end + + # :attr_reader: response + # + # The ActionDispatch::Response instance for the current response. + # + # source://actionpack//lib/action_controller/metal.rb#170 + def response; end + + # Assign the response and mark it as committed. No further processing will + # occur. + # + # source://actionpack//lib/action_controller/metal.rb#268 + def response=(response); end + + # source://actionpack//lib/action_controller/metal.rb#234 + def response_body=(body); end + + # Delegates to ActionDispatch::Response#status + # + # source://actionpack//lib/action_controller/metal.rb#227 + def response_code(*_arg0, **_arg1, &_arg2); end + + # The ActionDispatch::Request::Session instance for the current request. + # See further details in the + # [Active Controller Session guide](https://guides.rubyonrails.org/action_controller_overview.html#session). + # + # source://actionpack//lib/action_controller/metal.rb#176 + def session(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/metal.rb#275 + def set_request!(request); end + + # source://actionpack//lib/action_controller/metal.rb#257 + def set_response!(response); end + + # Delegates to ActionDispatch::Response#status + # + # source://actionpack//lib/action_controller/metal.rb#196 + def status(*_arg0, **_arg1, &_arg2); end + + # Delegates to ActionDispatch::Response#status= + # + # source://actionpack//lib/action_controller/metal.rb#184 + def status=(arg); end + + # source://actionpack//lib/action_controller/metal.rb#280 + def to_a; end + + # Basic `url_for` that can be overridden for more robust functionality. + # + # source://actionpack//lib/action_controller/metal.rb#230 + def url_for(string); end + + class << self + # Returns a Rack endpoint for the given action name. + # + # source://actionpack//lib/action_controller/metal.rb#315 + def action(name); end + + # source://actionpack//lib/action_controller/metal.rb#140 + def action_encoding_template(action); end + + # Returns the last part of the controller's name, underscored, without the + # ending `Controller`. For instance, `PostsController` returns `posts`. + # Namespaces are left out, so `Admin::PostsController` returns `posts` as well. + # + # #### Returns + # * `string` + # + # source://actionpack//lib/action_controller/metal.rb#130 + def controller_name; end + + # Direct dispatch to the controller. Instantiates the controller, then executes + # the action named `name`. + # + # source://actionpack//lib/action_controller/metal.rb#331 + def dispatch(name, req, res); end + + # source://actionpack//lib/action_controller/metal.rb#134 + def make_response!(request); end + + # The middleware stack used by this controller. + # + # By default uses a variation of ActionDispatch::MiddlewareStack which allows + # for the following syntax: + # + # class PostsController < ApplicationController + # use AuthenticationMiddleware, except: [:index, :show] + # end + # + # Read more about [Rails middleware stack] + # (https://guides.rubyonrails.org/rails_on_rack.html#action-dispatcher-middleware-stack) + # in the guides. + # + # source://actionpack//lib/action_controller/metal.rb#310 + def middleware; end + + # source://actionpack//lib/action_controller/metal.rb#288 + def middleware_stack; end + + # source://actionpack//lib/action_controller/metal.rb#288 + def middleware_stack=(value); end + + # source://actionpack//lib/action_controller/metal.rb#288 + def middleware_stack?; end + + # Pushes the given Rack middleware and its arguments to the bottom of the + # middleware stack. + # + # source://actionpack//lib/action_controller/metal.rb#293 + def use(*_arg0, **_arg1, &_arg2); end + + private + + # source://actionpack//lib/action_controller/metal.rb#121 + def __class_attr_config; end + + # source://actionpack//lib/action_controller/metal.rb#121 + def __class_attr_config=(new_value); end + + # source://actionpack//lib/action_controller/metal.rb#288 + def __class_attr_middleware_stack; end + + # source://actionpack//lib/action_controller/metal.rb#288 + def __class_attr_middleware_stack=(new_value); end + + # @private + # + # source://actionpack//lib/action_controller/metal.rb#146 + def inherited(subclass); end + end +end + +# source://actionpack//lib/action_controller/metal/exceptions.rb#52 +class ActionController::MethodNotAllowed < ::ActionController::ActionControllerError + # @return [MethodNotAllowed] a new instance of MethodNotAllowed + # + # source://actionpack//lib/action_controller/metal/exceptions.rb#53 + def initialize(*allowed_methods); end +end + +# # Action Controller MiddlewareStack +# +# Extend ActionDispatch middleware stack to make it aware of options allowing +# the following syntax in controllers: +# +# class PostsController < ApplicationController +# use AuthenticationMiddleware, except: [:index, :show] +# end +# +# source://actionpack//lib/action_controller/metal.rb#18 +class ActionController::MiddlewareStack < ::ActionDispatch::MiddlewareStack + # source://actionpack//lib/action_controller/metal.rb#31 + def build(action, app = T.unsafe(nil), &block); end + + private + + # source://actionpack//lib/action_controller/metal.rb#44 + def build_middleware(klass, args, block); end +end + +# source://actionpack//lib/action_controller/metal.rb#41 +ActionController::MiddlewareStack::EXCLUDE = T.let(T.unsafe(nil), Proc) + +# source://actionpack//lib/action_controller/metal.rb#40 +ActionController::MiddlewareStack::INCLUDE = T.let(T.unsafe(nil), Proc) + +# source://actionpack//lib/action_controller/metal.rb#19 +class ActionController::MiddlewareStack::Middleware < ::ActionDispatch::MiddlewareStack::Middleware + # @return [Middleware] a new instance of Middleware + # + # source://actionpack//lib/action_controller/metal.rb#20 + def initialize(klass, args, actions, strategy, block); end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal.rb#26 + def valid?(action); end +end + +# source://actionpack//lib/action_controller/metal.rb#42 +ActionController::MiddlewareStack::NULL = T.let(T.unsafe(nil), Proc) + +# source://actionpack//lib/action_controller/metal/mime_responds.rb#8 +module ActionController::MimeResponds + # Without web-service support, an action which collects the data for displaying + # a list of people might look something like this: + # + # def index + # @people = Person.all + # end + # + # That action implicitly responds to all formats, but formats can also be + # explicitly enumerated: + # + # def index + # @people = Person.all + # respond_to :html, :js + # end + # + # Here's the same action, with web-service support baked in: + # + # def index + # @people = Person.all + # + # respond_to do |format| + # format.html + # format.js + # format.xml { render xml: @people } + # end + # end + # + # What that says is, "if the client wants HTML or JS in response to this action, + # just respond as we would have before, but if the client wants XML, return them + # the list of people in XML format." (Rails determines the desired response + # format from the HTTP Accept header submitted by the client.) + # + # Supposing you have an action that adds a new person, optionally creating their + # company (by name) if it does not already exist, without web-services, it might + # look like this: + # + # def create + # @company = Company.find_or_create_by(name: params[:company][:name]) + # @person = @company.people.create(params[:person]) + # + # redirect_to(person_list_url) + # end + # + # Here's the same action, with web-service support baked in: + # + # def create + # company = params[:person].delete(:company) + # @company = Company.find_or_create_by(name: company[:name]) + # @person = @company.people.create(params[:person]) + # + # respond_to do |format| + # format.html { redirect_to(person_list_url) } + # format.js + # format.xml { render xml: @person.to_xml(include: @company) } + # end + # end + # + # If the client wants HTML, we just redirect them back to the person list. If + # they want JavaScript, then it is an Ajax request and we render the JavaScript + # template associated with this action. Lastly, if the client wants XML, we + # render the created person as XML, but with a twist: we also include the + # person's company in the rendered XML, so you get something like this: + # + # + # ... + # ... + # + # ... + # ... + # ... + # + # + # + # Note, however, the extra bit at the top of that action: + # + # company = params[:person].delete(:company) + # @company = Company.find_or_create_by(name: company[:name]) + # + # This is because the incoming XML document (if a web-service request is in + # process) can only contain a single root-node. So, we have to rearrange things + # so that the request looks like this (url-encoded): + # + # person[name]=...&person[company][name]=...&... + # + # And, like this (xml-encoded): + # + # + # ... + # + # ... + # + # + # + # In other words, we make the request so that it operates on a single entity's + # person. Then, in the action, we extract the company data from the request, + # find or create the company, and then create the new person with the remaining + # data. + # + # Note that you can define your own XML parameter parser which would allow you + # to describe multiple entities in a single request (i.e., by wrapping them all + # in a single root node), but if you just go with the flow and accept Rails' + # defaults, life will be much easier. + # + # If you need to use a MIME type which isn't supported by default, you can + # register your own handlers in `config/initializers/mime_types.rb` as follows. + # + # Mime::Type.register "image/jpeg", :jpg + # + # `respond_to` also allows you to specify a common block for different formats + # by using `any`: + # + # def index + # @people = Person.all + # + # respond_to do |format| + # format.html + # format.any(:xml, :json) { render request.format.to_sym => @people } + # end + # end + # + # In the example above, if the format is xml, it will render: + # + # render xml: @people + # + # Or if the format is json: + # + # render json: @people + # + # `any` can also be used with no arguments, in which case it will be used for + # any format requested by the user: + # + # respond_to do |format| + # format.html + # format.any { redirect_to support_path } + # end + # + # Formats can have different variants. + # + # The request variant is a specialization of the request format, like `:tablet`, + # `:phone`, or `:desktop`. + # + # We often want to render different html/json/xml templates for phones, tablets, + # and desktop browsers. Variants make it easy. + # + # You can set the variant in a `before_action`: + # + # request.variant = :tablet if /iPad/.match?(request.user_agent) + # + # Respond to variants in the action just like you respond to formats: + # + # respond_to do |format| + # format.html do |variant| + # variant.tablet # renders app/views/projects/show.html+tablet.erb + # variant.phone { extra_setup; render ... } + # variant.none { special_setup } # executed only if there is no variant set + # end + # end + # + # Provide separate templates for each format and variant: + # + # app/views/projects/show.html.erb + # app/views/projects/show.html+tablet.erb + # app/views/projects/show.html+phone.erb + # + # When you're not sharing any code within the format, you can simplify defining + # variants using the inline syntax: + # + # respond_to do |format| + # format.js { render "trash" } + # format.html.phone { redirect_to progress_path } + # format.html.none { render "trash" } + # end + # + # Variants also support common `any`/`all` block that formats have. + # + # It works for both inline: + # + # respond_to do |format| + # format.html.any { render html: "any" } + # format.html.phone { render html: "phone" } + # end + # + # and block syntax: + # + # respond_to do |format| + # format.html do |variant| + # variant.any(:tablet, :phablet){ render html: "any" } + # variant.phone { render html: "phone" } + # end + # end + # + # You can also set an array of variants: + # + # request.variant = [:tablet, :phone] + # + # This will work similarly to formats and MIME types negotiation. If there is no + # `:tablet` variant declared, the `:phone` variant will be used: + # + # respond_to do |format| + # format.html.none + # format.html.phone # this gets rendered + # end + # + # @raise [ArgumentError] + # @yield [collector] + # + # source://actionpack//lib/action_controller/metal/mime_responds.rb#211 + def respond_to(*mimes); end +end + +# A container for responses available from the current controller for requests +# for different mime-types sent to a particular action. +# +# The public controller methods `respond_to` may be called with a block that is +# used to define responses to different mime-types, e.g. for `respond_to` : +# +# respond_to do |format| +# format.html +# format.xml { render xml: @people } +# end +# +# In this usage, the argument passed to the block (`format` above) is an +# instance of the ActionController::MimeResponds::Collector class. This object +# serves as a container in which available responses can be stored by calling +# any of the dynamically generated, mime-type-specific methods such as `html`, +# `xml` etc on the Collector. Each response is represented by a corresponding +# block if present. +# +# A subsequent call to #negotiate_format(request) will enable the Collector to +# determine which specific mime-type it should respond with for the current +# request, with this response then being accessible by calling #response. +# +# source://actionpack//lib/action_controller/metal/mime_responds.rb#251 +class ActionController::MimeResponds::Collector + include ::AbstractController::Collector + + # @return [Collector] a new instance of Collector + # + # source://actionpack//lib/action_controller/metal/mime_responds.rb#255 + def initialize(mimes, variant = T.unsafe(nil)); end + + # source://actionpack//lib/action_controller/metal/mime_responds.rb#269 + def all(*args, &block); end + + # source://actionpack//lib/action_controller/metal/mime_responds.rb#262 + def any(*args, &block); end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/mime_responds.rb#280 + def any_response?; end + + # source://actionpack//lib/action_controller/metal/mime_responds.rb#271 + def custom(mime_type, &block); end + + # Returns the value of attribute format. + # + # source://actionpack//lib/action_controller/metal/mime_responds.rb#253 + def format; end + + # Sets the attribute format + # + # @param value the value to set the attribute format to. + # + # source://actionpack//lib/action_controller/metal/mime_responds.rb#253 + def format=(_arg0); end + + # source://actionpack//lib/action_controller/metal/mime_responds.rb#297 + def negotiate_format(request); end + + # source://actionpack//lib/action_controller/metal/mime_responds.rb#284 + def response; end +end + +# source://actionpack//lib/action_controller/metal/mime_responds.rb#301 +class ActionController::MimeResponds::Collector::VariantCollector + # @return [VariantCollector] a new instance of VariantCollector + # + # source://actionpack//lib/action_controller/metal/mime_responds.rb#302 + def initialize(variant = T.unsafe(nil)); end + + # source://actionpack//lib/action_controller/metal/mime_responds.rb#316 + def all(*args, &block); end + + # source://actionpack//lib/action_controller/metal/mime_responds.rb#307 + def any(*args, &block); end + + # source://actionpack//lib/action_controller/metal/mime_responds.rb#318 + def method_missing(name, *_arg1, &block); end + + # source://actionpack//lib/action_controller/metal/mime_responds.rb#322 + def variant; end + + private + + # source://actionpack//lib/action_controller/metal/mime_responds.rb#331 + def variant_key; end +end + +# source://actionpack//lib/action_controller/metal/exceptions.rb#96 +class ActionController::MissingExactTemplate < ::ActionController::UnknownFormat + # @return [MissingExactTemplate] a new instance of MissingExactTemplate + # + # source://actionpack//lib/action_controller/metal/exceptions.rb#99 + def initialize(message, controller, action_name); end + + # Returns the value of attribute action_name. + # + # source://actionpack//lib/action_controller/metal/exceptions.rb#97 + def action_name; end + + # Returns the value of attribute controller. + # + # source://actionpack//lib/action_controller/metal/exceptions.rb#97 + def controller; end +end + +# source://actionpack//lib/action_controller/metal/exceptions.rb#61 +class ActionController::MissingFile < ::ActionController::ActionControllerError; end + +# See `Responder#api_behavior` +# +# source://actionpack//lib/action_controller/metal/renderers.rb#17 +class ActionController::MissingRenderer < ::LoadError + # @return [MissingRenderer] a new instance of MissingRenderer + # + # source://actionpack//lib/action_controller/metal/renderers.rb#18 + def initialize(format); end +end + +# source://actionpack//lib/action_controller/metal/exceptions.rb#58 +class ActionController::NotImplemented < ::ActionController::MethodNotAllowed; end + +# Specify binary encoding for parameters for a given action. +# +# source://actionpack//lib/action_controller/metal/parameter_encoding.rb#7 +module ActionController::ParameterEncoding + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionController::ParameterEncoding::ClassMethods +end + +# source://actionpack//lib/action_controller/metal/parameter_encoding.rb#10 +module ActionController::ParameterEncoding::ClassMethods + # source://actionpack//lib/action_controller/metal/parameter_encoding.rb#20 + def action_encoding_template(action); end + + # source://actionpack//lib/action_controller/metal/parameter_encoding.rb#11 + def inherited(klass); end + + # Specify the encoding for a parameter on an action. If not specified the + # default is UTF-8. + # + # You can specify a binary (ASCII_8BIT) parameter with: + # + # class RepositoryController < ActionController::Base + # # This specifies that file_path is not UTF-8 and is instead ASCII_8BIT + # param_encoding :show, :file_path, Encoding::ASCII_8BIT + # + # def show + # @repo = Repository.find_by_filesystem_path params[:file_path] + # + # # params[:repo_name] remains UTF-8 encoded + # @repo_name = params[:repo_name] + # end + # + # def index + # @repositories = Repository.all + # end + # end + # + # The file_path parameter on the show action would be encoded as ASCII-8BIT, but + # all other arguments will remain UTF-8 encoded. This is useful in the case + # where an application must handle data but encoding of the data is unknown, + # like file system data. + # + # source://actionpack//lib/action_controller/metal/parameter_encoding.rb#79 + def param_encoding(action, param, encoding); end + + # source://actionpack//lib/action_controller/metal/parameter_encoding.rb#16 + def setup_param_encode; end + + # Specify that a given action's parameters should all be encoded as ASCII-8BIT + # (it "skips" the encoding default of UTF-8). + # + # For example, a controller would use it like this: + # + # class RepositoryController < ActionController::Base + # skip_parameter_encoding :show + # + # def show + # @repo = Repository.find_by_filesystem_path params[:file_path] + # + # # `repo_name` is guaranteed to be UTF-8, but was ASCII-8BIT, so + # # tag it as such + # @repo_name = params[:repo_name].force_encoding 'UTF-8' + # end + # + # def index + # @repositories = Repository.all + # end + # end + # + # The show action in the above controller would have all parameter values + # encoded as ASCII-8BIT. This is useful in the case where an application must + # handle data but encoding of the data is unknown, like file system data. + # + # source://actionpack//lib/action_controller/metal/parameter_encoding.rb#50 + def skip_parameter_encoding(action); end +end + +# Raised when a required parameter is missing. +# +# params = ActionController::Parameters.new(a: {}) +# params.fetch(:b) +# # => ActionController::ParameterMissing: param is missing or the value is empty or invalid: b +# params.require(:a) +# # => ActionController::ParameterMissing: param is missing or the value is empty or invalid: a +# params.expect(a: []) +# # => ActionController::ParameterMissing: param is missing or the value is empty or invalid: a +# +# source://actionpack//lib/action_controller/metal/strong_parameters.rb#25 +class ActionController::ParameterMissing < ::KeyError + # @return [ParameterMissing] a new instance of ParameterMissing + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#28 + def initialize(param, keys = T.unsafe(nil)); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#37 + def corrections; end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#26 + def keys; end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#26 + def param; end +end + +# # Action Controller Parameters +# +# Allows you to choose which attributes should be permitted for mass updating +# and thus prevent accidentally exposing that which shouldn't be exposed. +# +# Provides methods for filtering and requiring params: +# +# * `expect` to safely permit and require parameters in one step. +# * `permit` to filter params for mass assignment. +# * `require` to require a parameter or raise an error. +# +# Examples: +# +# params = ActionController::Parameters.new({ +# person: { +# name: "Francesco", +# age: 22, +# role: "admin" +# } +# }) +# +# permitted = params.expect(person: [:name, :age]) +# permitted # => #"Francesco", "age"=>22} permitted: true> +# +# Person.first.update!(permitted) +# # => # +# +# Parameters provides two options that control the top-level behavior of new +# instances: +# +# * `permit_all_parameters` - If it's `true`, all the parameters will be +# permitted by default. The default is `false`. +# * `action_on_unpermitted_parameters` - Controls behavior when parameters +# that are not explicitly permitted are found. The default value is `:log` +# in test and development environments, `false` otherwise. The values can +# be: +# * `false` to take no action. +# * `:log` to emit an `ActiveSupport::Notifications.instrument` event on +# the `unpermitted_parameters.action_controller` topic and log at the +# DEBUG level. +# * `:raise` to raise an ActionController::UnpermittedParameters +# exception. +# +# Examples: +# +# params = ActionController::Parameters.new +# params.permitted? # => false +# +# ActionController::Parameters.permit_all_parameters = true +# +# params = ActionController::Parameters.new +# params.permitted? # => true +# +# params = ActionController::Parameters.new(a: "123", b: "456") +# params.permit(:c) +# # => # +# +# ActionController::Parameters.action_on_unpermitted_parameters = :raise +# +# params = ActionController::Parameters.new(a: "123", b: "456") +# params.permit(:c) +# # => ActionController::UnpermittedParameters: found unpermitted keys: a, b +# +# Please note that these options *are not thread-safe*. In a multi-threaded +# environment they should only be set once at boot-time and never mutated at +# runtime. +# +# You can fetch values of `ActionController::Parameters` using either `:key` or +# `"key"`. +# +# params = ActionController::Parameters.new(key: "value") +# params[:key] # => "value" +# params["key"] # => "value" +# +# source://actionpack//lib/action_controller/metal/strong_parameters.rb#160 +class ActionController::Parameters + include ::ActiveSupport::DeepMergeable + + # Returns a new `ActionController::Parameters` instance. Also, sets the + # `permitted` attribute to the default value of + # `ActionController::Parameters.permit_all_parameters`. + # + # class Person < ActiveRecord::Base + # end + # + # params = ActionController::Parameters.new(name: "Francesco") + # params.permitted? # => false + # Person.new(params) # => ActiveModel::ForbiddenAttributesError + # + # ActionController::Parameters.permit_all_parameters = true + # + # params = ActionController::Parameters.new(name: "Francesco") + # params.permitted? # => true + # Person.new(params) # => # + # + # @return [Parameters] a new instance of Parameters + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#287 + def initialize(parameters = T.unsafe(nil), logging_context = T.unsafe(nil)); end + + # Returns true if another `Parameters` object contains the same content and + # permitted flag. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#301 + def ==(other); end + + # Returns a parameter for the given `key`. If not found, returns `nil`. + # + # params = ActionController::Parameters.new(person: { name: "Francesco" }) + # params[:person] # => #"Francesco"} permitted: false> + # params[:none] # => nil + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#797 + def [](key); end + + # Assigns a value to a given `key`. The given key may still get filtered out + # when #permit is called. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#803 + def []=(key, value); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#263 + def always_permitted_parameters; end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#263 + def always_permitted_parameters=(val); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#250 + def as_json(*_arg0, **_arg1, &_arg2); end + + # Returns a new `ActionController::Parameters` instance with `nil` values + # removed. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#974 + def compact; end + + # Removes all `nil` values in place and returns `self`, or `nil` if no changes + # were made. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#980 + def compact!; end + + # Returns a new `ActionController::Parameters` instance without the blank + # values. Uses Object#blank? for determining if a value is blank. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#986 + def compact_blank; end + + # Removes all blank values in place and returns self. Uses Object#blank? for + # determining if a value is blank. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#992 + def compact_blank!; end + + # Attribute that keeps track of converted arrays, if any, to avoid double + # looping in the common use case permit + mass-assignment. Defined in a method + # to instantiate it only if needed. + # + # Testing membership still loops, but it's going to be faster than our own loop + # that converts values. Also, we are not going to build a new array object per + # fetch. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#435 + def converted_arrays; end + + # Returns a duplicate `ActionController::Parameters` instance with the same + # permitted parameters. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1092 + def deep_dup; end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1027 + def deep_merge?(other_hash); end + + # Returns a new `ActionController::Parameters` instance with the results of + # running `block` once for every key. This includes the keys from the root hash + # and from all nested hashes and arrays. The values are unchanged. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#924 + def deep_transform_keys(&block); end + + # Returns the same `ActionController::Parameters` instance with changed keys. + # This includes the keys from the root hash and from all nested hashes and + # arrays. The values are unchanged. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#933 + def deep_transform_keys!(&block); end + + # Deletes a key-value pair from `Parameters` and returns the value. If `key` is + # not found, returns `nil` (or, with optional code block, yields `key` and + # returns the result). This method is similar to #extract!, which returns the + # corresponding `ActionController::Parameters` object. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#942 + def delete(key, &block); end + + # Removes items that the block evaluates to true and returns self. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#970 + def delete_if(&block); end + + # Extracts the nested parameter from the given `keys` by calling `dig` at each + # step. Returns `nil` if any intermediate step is `nil`. + # + # params = ActionController::Parameters.new(foo: { bar: { baz: 1 } }) + # params.dig(:foo, :bar, :baz) # => 1 + # params.dig(:foo, :zot, :xyz) # => nil + # + # params2 = ActionController::Parameters.new(foo: [10, 11, 12]) + # params2.dig(:foo, 1) # => 11 + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#841 + def dig(*keys); end + + # Convert all hashes in values into parameters, then yield each pair in the same + # way as `Hash#each_pair`. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#410 + def each(&block); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#250 + def each_key(*_arg0, **_arg1, &_arg2); end + + # Convert all hashes in values into parameters, then yield each pair in the same + # way as `Hash#each_pair`. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#402 + def each_pair(&block); end + + # Convert all hashes in values into parameters, then yield each value in the + # same way as `Hash#each_value`. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#414 + def each_value(&block); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#250 + def empty?(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1086 + def encode_with(coder); end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#309 + def eql?(other); end + + # Returns a new `ActionController::Parameters` instance that filters out the + # given `keys`. + # + # params = ActionController::Parameters.new(a: 1, b: 2, c: 3) + # params.except(:a, :b) # => #3} permitted: false> + # params.except(:d) # => #1, "b"=>2, "c"=>3} permitted: false> + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#869 + def except(*keys); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#250 + def exclude?(*_arg0, **_arg1, &_arg2); end + + # `expect` is the preferred way to require and permit parameters. + # It is safer than the previous recommendation to call `permit` and `require` + # in sequence, which could allow user triggered 500 errors. + # + # `expect` is more strict with types to avoid a number of potential pitfalls + # that may be encountered with the `.require.permit` pattern. + # + # For example: + # + # params = ActionController::Parameters.new(comment: { text: "hello" }) + # params.expect(comment: [:text]) + # # => # + # + # params = ActionController::Parameters.new(comment: [{ text: "hello" }, { text: "world" }]) + # params.expect(comment: [:text]) + # # => ActionController::ParameterMissing: param is missing or the value is empty or invalid: comment + # + # In order to permit an array of parameters, the array must be defined + # explicitly. Use double array brackets, an array inside an array, to + # declare that an array of parameters is expected. + # + # params = ActionController::Parameters.new(comments: [{ text: "hello" }, { text: "world" }]) + # params.expect(comments: [[:text]]) + # # => [# "hello" } permitted: true>, + # # # "world" } permitted: true>] + # + # params = ActionController::Parameters.new(comments: { text: "hello" }) + # params.expect(comments: [[:text]]) + # # => ActionController::ParameterMissing: param is missing or the value is empty or invalid: comments + # + # `expect` is intended to protect against array tampering. + # + # params = ActionController::Parameters.new(user: "hack") + # # The previous way of requiring and permitting parameters will error + # params.require(:user).permit(:name, pets: [:name]) # wrong + # # => NoMethodError: undefined method `permit' for an instance of String + # + # # similarly with nested parameters + # params = ActionController::Parameters.new(user: { name: "Martin", pets: { name: "hack" } }) + # user_params = params.require(:user).permit(:name, pets: [:name]) # wrong + # # user_params[:pets] is expected to be an array but is a hash + # + # `expect` solves this by being more strict with types. + # + # params = ActionController::Parameters.new(user: "hack") + # params.expect(user: [ :name, pets: [[:name]] ]) + # # => ActionController::ParameterMissing: param is missing or the value is empty or invalid: user + # + # # with nested parameters + # params = ActionController::Parameters.new(user: { name: "Martin", pets: { name: "hack" } }) + # user_params = params.expect(user: [:name, pets: [[:name]] ]) + # user_params[:pets] # => nil + # + # As the examples show, `expect` requires the `:user` key, and any root keys + # similar to the `.require.permit` pattern. If multiple root keys are + # expected, they will all be required. + # + # params = ActionController::Parameters.new(name: "Martin", pies: [{ type: "dessert", flavor: "pumpkin"}]) + # name, pies = params.expect(:name, pies: [[:type, :flavor]]) + # name # => "Martin" + # pies # => [#"dessert", "flavor"=>"pumpkin"} permitted: true>] + # + # When called with a hash with multiple keys, `expect` will permit the + # parameters and require the keys in the order they are given in the hash, + # returning an array of the permitted parameters. + # + # params = ActionController::Parameters.new(subject: { name: "Martin" }, object: { pie: "pumpkin" }) + # subject, object = params.expect(subject: [:name], object: [:pie]) + # subject # => #"Martin"} permitted: true> + # object # => #"pumpkin"} permitted: true> + # + # Besides being more strict about array vs hash params, `expect` uses permit + # internally, so it will behave similarly. + # + # params = ActionController::Parameters.new({ + # person: { + # name: "Francesco", + # age: 22, + # pets: [{ + # name: "Purplish", + # category: "dogs" + # }] + # } + # }) + # + # permitted = params.expect(person: [ :name, { pets: [[:name]] } ]) + # permitted.permitted? # => true + # permitted[:name] # => "Francesco" + # permitted[:age] # => nil + # permitted[:pets][0][:name] # => "Purplish" + # permitted[:pets][0][:category] # => nil + # + # An array of permitted scalars may be expected with the following: + # + # params = ActionController::Parameters.new(tags: ["rails", "parameters"]) + # permitted = params.expect(tags: []) + # permitted # => ["rails", "parameters"] + # permitted.is_a?(Array) # => true + # permitted.size # => 2 + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#772 + def expect(*filters); end + + # Same as `expect`, but raises an `ActionController::ExpectedParameterMissing` + # instead of `ActionController::ParameterMissing`. Unlike `expect` which + # will render a 400 response, `expect!` will raise an exception that is + # not handled. This is intended for debugging invalid params for an + # internal API where incorrectly formatted params would indicate a bug + # in a client library that should be fixed. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#786 + def expect!(*filters); end + + # Removes and returns the key/value pairs matching the given keys. + # + # params = ActionController::Parameters.new(a: 1, b: 2, c: 3) + # params.extract!(:a, :b) # => #1, "b"=>2} permitted: false> + # params # => #3} permitted: false> + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#879 + def extract!(*keys); end + + # Returns parameter value for the given `key` separated by `delimiter`. + # + # params = ActionController::Parameters.new(id: "1_123", tags: "ruby,rails") + # params.extract_value(:id) # => ["1", "123"] + # params.extract_value(:tags, delimiter: ",") # => ["ruby", "rails"] + # params.extract_value(:non_existent_key) # => nil + # + # Note that if the given `key`'s value contains blank elements, then the + # returned array will include empty strings. + # + # params = ActionController::Parameters.new(tags: "ruby,rails,,web") + # params.extract_value(:tags, delimiter: ",") # => ["ruby", "rails", "", "web"] + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1110 + def extract_value(key, delimiter: T.unsafe(nil)); end + + # Returns a parameter for the given `key`. If the `key` can't be found, there + # are several options: With no other arguments, it will raise an + # ActionController::ParameterMissing error; if a second argument is given, then + # that is returned (converted to an instance of `ActionController::Parameters` + # if possible); if a block is given, then that will be run and its result + # returned. + # + # params = ActionController::Parameters.new(person: { name: "Francesco" }) + # params.fetch(:person) # => #"Francesco"} permitted: false> + # params.fetch(:none) # => ActionController::ParameterMissing: param is missing or the value is empty or invalid: none + # params.fetch(:none, {}) # => # + # params.fetch(:none, "Francesco") # => "Francesco" + # params.fetch(:none) { "Francesco" } # => "Francesco" + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#820 + def fetch(key, *args); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#253 + def has_key?(*_arg0, **_arg1, &_arg2); end + + # Returns true if the given value is present for some key in the parameters. + # + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#997 + def has_value?(value); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#315 + def hash; end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#250 + def include?(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1068 + def init_with(coder); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1055 + def inspect; end + + # Equivalent to Hash#keep_if, but returns `nil` if no changes were made. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#957 + def keep_if(&block); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#254 + def key?(*_arg0, **_arg1, &_arg2); end + + # :method: to_s + # + # :call-seq: + # to_s() + # + # Returns the content of the parameters as a string. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#250 + def keys(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#255 + def member?(*_arg0, **_arg1, &_arg2); end + + # Returns a new `ActionController::Parameters` instance with all keys from + # `other_hash` merged into current hash. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1011 + def merge(other_hash); end + + # :call-seq: merge!(other_hash) + # + # Returns the current `ActionController::Parameters` instance with `other_hash` + # merged into current hash. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1022 + def merge!(other_hash, &block); end + + # Returns a new `ActionController::Parameters` instance that includes only the + # given `filters` and sets the `permitted` attribute for the object to `true`. + # This is useful for limiting which attributes should be allowed for mass + # updating. + # + # params = ActionController::Parameters.new(name: "Francesco", age: 22, role: "admin") + # permitted = params.permit(:name, :age) + # permitted.permitted? # => true + # permitted.has_key?(:name) # => true + # permitted.has_key?(:age) # => true + # permitted.has_key?(:role) # => false + # + # Only permitted scalars pass the filter. For example, given + # + # params.permit(:name) + # + # `:name` passes if it is a key of `params` whose associated value is of type + # `String`, `Symbol`, `NilClass`, `Numeric`, `TrueClass`, `FalseClass`, `Date`, + # `Time`, `DateTime`, `StringIO`, `IO`, ActionDispatch::Http::UploadedFile or + # `Rack::Test::UploadedFile`. Otherwise, the key `:name` is filtered out. + # + # You may declare that the parameter should be an array of permitted scalars by + # mapping it to an empty array: + # + # params = ActionController::Parameters.new(tags: ["rails", "parameters"]) + # params.permit(tags: []) + # + # Sometimes it is not possible or convenient to declare the valid keys of a hash + # parameter or its internal structure. Just map to an empty hash: + # + # params.permit(preferences: {}) + # + # Be careful because this opens the door to arbitrary input. In this case, + # `permit` ensures values in the returned structure are permitted scalars and + # filters out anything else. + # + # You can also use `permit` on nested parameters: + # + # params = ActionController::Parameters.new({ + # person: { + # name: "Francesco", + # age: 22, + # pets: [{ + # name: "Purplish", + # category: "dogs" + # }] + # } + # }) + # + # permitted = params.permit(person: [ :name, { pets: :name } ]) + # permitted.permitted? # => true + # permitted[:person][:name] # => "Francesco" + # permitted[:person][:age] # => nil + # permitted[:person][:pets][0][:name] # => "Purplish" + # permitted[:person][:pets][0][:category] # => nil + # + # This has the added benefit of rejecting user-modified inputs that send a + # string when a hash is expected. + # + # When followed by `require`, you can both filter and require parameters + # following the typical pattern of a Rails form. The `expect` method was + # made specifically for this use case and is the recommended way to require + # and permit parameters. + # + # permitted = params.expect(person: [:name, :age]) + # + # When using `permit` and `require` separately, pay careful attention to the + # order of the method calls. + # + # params = ActionController::Parameters.new(person: { name: "Martin", age: 40, role: "admin" }) + # permitted = params.permit(person: [:name, :age]).require(:person) # correct + # + # When require is used first, it is possible for users of your application to + # trigger a NoMethodError when the user, for example, sends a string for :person. + # + # params = ActionController::Parameters.new(person: "tampered") + # permitted = params.require(:person).permit(:name, :age) # not recommended + # # => NoMethodError: undefined method `permit' for an instance of String + # + # Note that if you use `permit` in a key that points to a hash, it won't allow + # all the hash. You also need to specify which attributes inside the hash should + # be permitted. + # + # params = ActionController::Parameters.new({ + # person: { + # contact: { + # email: "none@test.com", + # phone: "555-1234" + # } + # } + # }) + # + # params.permit(person: :contact).require(:person) + # # => ActionController::ParameterMissing: param is missing or the value is empty or invalid: person + # + # params.permit(person: { contact: :phone }).require(:person) + # # => ##"555-1234"} permitted: true>} permitted: true> + # + # params.permit(person: { contact: [ :email, :phone ] }).require(:person) + # # => ##"none@test.com", "phone"=>"555-1234"} permitted: true>} permitted: true> + # + # If your parameters specify multiple parameters indexed by a number, you can + # permit each set of parameters under the numeric key to be the same using the + # same syntax as permitting a single item. + # + # params = ActionController::Parameters.new({ + # person: { + # '0': { + # email: "none@test.com", + # phone: "555-1234" + # }, + # '1': { + # email: "nothing@test.com", + # phone: "555-6789" + # }, + # } + # }) + # params.permit(person: [:email]).to_h + # # => {"person"=>{"0"=>{"email"=>"none@test.com"}, "1"=>{"email"=>"nothing@test.com"}}} + # + # If you want to specify what keys you want from each numeric key, you can + # instead specify each one individually + # + # params = ActionController::Parameters.new({ + # person: { + # '0': { + # email: "none@test.com", + # phone: "555-1234" + # }, + # '1': { + # email: "nothing@test.com", + # phone: "555-6789" + # }, + # } + # }) + # params.permit(person: { '0': [:email], '1': [:phone]}).to_h + # # => {"person"=>{"0"=>{"email"=>"none@test.com"}, "1"=>{"phone"=>"555-6789"}}} + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#668 + def permit(*filters); end + + # Sets the `permitted` attribute to `true`. This can be used to pass mass + # assignment. Returns `self`. + # + # class Person < ActiveRecord::Base + # end + # + # params = ActionController::Parameters.new(name: "Francesco") + # params.permitted? # => false + # Person.new(params) # => ActiveModel::ForbiddenAttributesError + # params.permit! + # params.permitted? # => true + # Person.new(params) # => # + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#461 + def permit!; end + + # Returns `true` if the parameter is permitted, `false` otherwise. + # + # params = ActionController::Parameters.new + # params.permitted? # => false + # params.permit! + # params.permitted? # => true + # + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#445 + def permitted?; end + + # Returns a new `ActionController::Parameters` instance with items that the + # block evaluates to true removed. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#961 + def reject(&block); end + + # Removes items that the block evaluates to true and returns self. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#966 + def reject!(&block); end + + # This method accepts both a single key and an array of keys. + # + # When passed a single key, if it exists and its associated value is either + # present or the singleton `false`, returns said value: + # + # ActionController::Parameters.new(person: { name: "Francesco" }).require(:person) + # # => #"Francesco"} permitted: false> + # + # Otherwise raises ActionController::ParameterMissing: + # + # ActionController::Parameters.new.require(:person) + # # ActionController::ParameterMissing: param is missing or the value is empty or invalid: person + # + # ActionController::Parameters.new(person: nil).require(:person) + # # ActionController::ParameterMissing: param is missing or the value is empty or invalid: person + # + # ActionController::Parameters.new(person: "\t").require(:person) + # # ActionController::ParameterMissing: param is missing or the value is empty or invalid: person + # + # ActionController::Parameters.new(person: {}).require(:person) + # # ActionController::ParameterMissing: param is missing or the value is empty or invalid: person + # + # When given an array of keys, the method tries to require each one of them in + # order. If it succeeds, an array with the respective return values is returned: + # + # params = ActionController::Parameters.new(user: { ... }, profile: { ... }) + # user_params, profile_params = params.require([:user, :profile]) + # + # Otherwise, the method re-raises the first exception found: + # + # params = ActionController::Parameters.new(user: {}, profile: {}) + # user_params, profile_params = params.require([:user, :profile]) + # # ActionController::ParameterMissing: param is missing or the value is empty or invalid: user + # + # This method is not recommended for fetching terminal values because it does + # not permit the values. For example, this can cause problems: + # + # # CAREFUL + # params = ActionController::Parameters.new(person: { name: "Finn" }) + # name = params.require(:person).require(:name) # CAREFUL + # + # It is recommended to use `expect` instead: + # + # def person_params + # params.expect(person: :name).require(:name) + # end + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#519 + def require(key); end + + # This method accepts both a single key and an array of keys. + # + # When passed a single key, if it exists and its associated value is either + # present or the singleton `false`, returns said value: + # + # ActionController::Parameters.new(person: { name: "Francesco" }).require(:person) + # # => #"Francesco"} permitted: false> + # + # Otherwise raises ActionController::ParameterMissing: + # + # ActionController::Parameters.new.require(:person) + # # ActionController::ParameterMissing: param is missing or the value is empty or invalid: person + # + # ActionController::Parameters.new(person: nil).require(:person) + # # ActionController::ParameterMissing: param is missing or the value is empty or invalid: person + # + # ActionController::Parameters.new(person: "\t").require(:person) + # # ActionController::ParameterMissing: param is missing or the value is empty or invalid: person + # + # ActionController::Parameters.new(person: {}).require(:person) + # # ActionController::ParameterMissing: param is missing or the value is empty or invalid: person + # + # When given an array of keys, the method tries to require each one of them in + # order. If it succeeds, an array with the respective return values is returned: + # + # params = ActionController::Parameters.new(user: { ... }, profile: { ... }) + # user_params, profile_params = params.require([:user, :profile]) + # + # Otherwise, the method re-raises the first exception found: + # + # params = ActionController::Parameters.new(user: {}, profile: {}) + # user_params, profile_params = params.require([:user, :profile]) + # # ActionController::ParameterMissing: param is missing or the value is empty or invalid: user + # + # This method is not recommended for fetching terminal values because it does + # not permit the values. For example, this can cause problems: + # + # # CAREFUL + # params = ActionController::Parameters.new(person: { name: "Finn" }) + # name = params.require(:person).require(:name) # CAREFUL + # + # It is recommended to use `expect` instead: + # + # def person_params + # params.expect(person: :name).require(:name) + # end + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#529 + def required(key); end + + # Returns a new `ActionController::Parameters` instance with all keys from + # current hash merged into `other_hash`. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1033 + def reverse_merge(other_hash); end + + # Returns the current `ActionController::Parameters` instance with current hash + # merged into `other_hash`. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1042 + def reverse_merge!(other_hash); end + + # Returns a new `ActionController::Parameters` instance with only items that the + # block evaluates to true. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#948 + def select(&block); end + + # Equivalent to Hash#keep_if, but returns `nil` if no changes were made. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#953 + def select!(&block); end + + # Returns a new `ActionController::Parameters` instance that includes only the + # given `keys`. If the given `keys` don't exist, returns an empty hash. + # + # params = ActionController::Parameters.new(a: 1, b: 2, c: 3) + # params.slice(:a, :b) # => #1, "b"=>2} permitted: false> + # params.slice(:d) # => # + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#852 + def slice(*keys); end + + # Returns the current `ActionController::Parameters` instance which contains + # only the given `keys`. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#858 + def slice!(*keys); end + + # This is required by ActiveModel attribute assignment, so that user can pass + # `Parameters` to a mass assignment methods in a model. It should not matter as + # we are using `HashWithIndifferentAccess` internally. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1051 + def stringify_keys; end + + # Returns a safe ActiveSupport::HashWithIndifferentAccess representation of the + # parameters with all unpermitted keys removed. + # + # params = ActionController::Parameters.new({ + # name: "Senjougahara Hitagi", + # oddity: "Heavy stone crab" + # }) + # params.to_h + # # => ActionController::UnfilteredParameters: unable to convert unpermitted parameters to hash + # + # safe_params = params.permit(:name) + # safe_params.to_h # => {"name"=>"Senjougahara Hitagi"} + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#331 + def to_h(&block); end + + # Returns a safe `Hash` representation of the parameters with all unpermitted + # keys removed. + # + # params = ActionController::Parameters.new({ + # name: "Senjougahara Hitagi", + # oddity: "Heavy stone crab" + # }) + # params.to_hash + # # => ActionController::UnfilteredParameters: unable to convert unpermitted parameters to hash + # + # safe_params = params.permit(:name) + # safe_params.to_hash # => {"name"=>"Senjougahara Hitagi"} + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#351 + def to_hash; end + + # Returns a string representation of the receiver suitable for use as a URL + # query string: + # + # params = ActionController::Parameters.new({ + # name: "David", + # nationality: "Danish" + # }) + # params.to_query + # # => ActionController::UnfilteredParameters: unable to convert unpermitted parameters to hash + # + # safe_params = params.permit(:name, :nationality) + # safe_params.to_query + # # => "name=David&nationality=Danish" + # + # An optional namespace can be passed to enclose key names: + # + # params = ActionController::Parameters.new({ + # name: "David", + # nationality: "Danish" + # }) + # safe_params = params.permit(:name, :nationality) + # safe_params.to_query("user") + # # => "user%5Bname%5D=David&user%5Bnationality%5D=Danish" + # + # The string pairs `"key=value"` that conform the query string are sorted + # lexicographically in ascending order. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#384 + def to_param(*args); end + + # Returns a string representation of the receiver suitable for use as a URL + # query string: + # + # params = ActionController::Parameters.new({ + # name: "David", + # nationality: "Danish" + # }) + # params.to_query + # # => ActionController::UnfilteredParameters: unable to convert unpermitted parameters to hash + # + # safe_params = params.permit(:name, :nationality) + # safe_params.to_query + # # => "name=David&nationality=Danish" + # + # An optional namespace can be passed to enclose key names: + # + # params = ActionController::Parameters.new({ + # name: "David", + # nationality: "Danish" + # }) + # safe_params = params.permit(:name, :nationality) + # safe_params.to_query("user") + # # => "user%5Bname%5D=David&user%5Bnationality%5D=Danish" + # + # The string pairs `"key=value"` that conform the query string are sorted + # lexicographically in ascending order. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#381 + def to_query(*args); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#250 + def to_s(*_arg0, **_arg1, &_arg2); end + + # Returns an unsafe, unfiltered ActiveSupport::HashWithIndifferentAccess + # representation of the parameters. + # + # params = ActionController::Parameters.new({ + # name: "Senjougahara Hitagi", + # oddity: "Heavy stone crab" + # }) + # params.to_unsafe_h + # # => {"name"=>"Senjougahara Hitagi", "oddity" => "Heavy stone crab"} + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#395 + def to_unsafe_h; end + + # Returns an unsafe, unfiltered ActiveSupport::HashWithIndifferentAccess + # representation of the parameters. + # + # params = ActionController::Parameters.new({ + # name: "Senjougahara Hitagi", + # oddity: "Heavy stone crab" + # }) + # params.to_unsafe_h + # # => {"name"=>"Senjougahara Hitagi", "oddity" => "Heavy stone crab"} + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#398 + def to_unsafe_hash; end + + # Returns a new `ActionController::Parameters` instance with the results of + # running `block` once for every key. The values are unchanged. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#906 + def transform_keys(&block); end + + # Performs keys transformation and returns the altered + # `ActionController::Parameters` instance. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#915 + def transform_keys!(&block); end + + # Returns a new `ActionController::Parameters` instance with the results of + # running `block` once for every value. The keys are unchanged. + # + # params = ActionController::Parameters.new(a: 1, b: 2, c: 3) + # params.transform_values { |x| x * 2 } + # # => #2, "b"=>4, "c"=>6} permitted: false> + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#889 + def transform_values; end + + # Performs values transformation and returns the altered + # `ActionController::Parameters` instance. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#898 + def transform_values!; end + + # Returns true if the given value is present for some key in the parameters. + # + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1001 + def value?(value); end + + # Returns a new array of the values of the parameters. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#424 + def values; end + + # Returns values that were assigned to the given `keys`. Note that all the + # `Hash` objects will be converted to `ActionController::Parameters`. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1005 + def values_at(*keys); end + + # Returns a new `ActionController::Parameters` instance with all keys from + # current hash merged into `other_hash`. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1038 + def with_defaults(other_hash); end + + # Returns the current `ActionController::Parameters` instance with current hash + # merged into `other_hash`. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1046 + def with_defaults!(other_hash); end + + # Returns a new `ActionController::Parameters` instance that filters out the + # given `keys`. + # + # params = ActionController::Parameters.new(a: 1, b: 2, c: 3) + # params.except(:a, :b) # => #3} permitted: false> + # params.except(:d) # => #1, "b"=>2, "c"=>3} permitted: false> + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#872 + def without(*keys); end + + protected + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1123 + def each_nested_attribute; end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1119 + def nested_attributes?; end + + # Returns the value of attribute parameters. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1115 + def parameters; end + + # Filters self and optionally checks for unpermitted keys + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1130 + def permit_filters(filters, on_unpermitted: T.unsafe(nil), explicit_arrays: T.unsafe(nil)); end + + # Sets the attribute permitted + # + # @param value the value to set the attribute permitted to. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1117 + def permitted=(_arg0); end + + private + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1192 + def _deep_transform_keys_in_object(object, &block); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1211 + def _deep_transform_keys_in_object!(object, &block); end + + # When an array is expected, you must specify an array explicitly + # using the following format: + # + # params.expect(comments: [[:flavor]]) + # + # Which will match only the following array formats: + # + # { pies: [{ flavor: "rhubarb" }, { flavor: "apple" }] } + # { pies: { "0" => { flavor: "key lime" }, "1" => { flavor: "mince" } } } + # + # When using `permit`, arrays are specified the same way as hashes: + # + # params.expect(pies: [:flavor]) + # + # In this case, `permit` would also allow matching with a hash (or vice versa): + # + # { pies: { flavor: "cherry" } } + # + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1256 + def array_filter?(filter); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1172 + def convert_hashes_to_parameters(key, value); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1156 + def convert_parameters_to_hashes(value, using, &block); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1178 + def convert_value_to_parameters(value); end + + # Called when an explicit array filter is encountered. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1261 + def each_array_element(object, filter, &block); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1349 + def hash_filter(params, filter, on_unpermitted: T.unsafe(nil), explicit_arrays: T.unsafe(nil)); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1434 + def initialize_copy(source); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1150 + def new_instance_with_inherited_permitted_status(hash); end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1343 + def non_scalar?(value); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1417 + def permit_any_in_array(array); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1400 + def permit_any_in_parameters(params); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1379 + def permit_array_of_hashes(value, filter, on_unpermitted:, explicit_arrays:); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1375 + def permit_array_of_scalars(value); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1385 + def permit_hash(value, filter, on_unpermitted:, explicit_arrays:); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1395 + def permit_hash_or_array(value, filter, on_unpermitted:, explicit_arrays:); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1361 + def permit_value(value, filter, on_unpermitted:, explicit_arrays:); end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1314 + def permitted_scalar?(value); end + + # Adds existing keys to the params if their values are scalar. + # + # For example: + # + # puts self.keys #=> ["zipcode(90210i)"] + # params = {} + # + # permitted_scalar_filter(params, "zipcode") + # + # puts params.keys # => ["zipcode"] + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1328 + def permitted_scalar_filter(params, permitted_key); end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1232 + def specify_numeric_keys?(filter); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1286 + def unpermitted_keys(params); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1272 + def unpermitted_parameters!(params, on_unpermitted: T.unsafe(nil)); end + + class << self + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#165 + def action_on_unpermitted_parameters; end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#165 + def action_on_unpermitted_parameters=(val); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#263 + def always_permitted_parameters; end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#263 + def always_permitted_parameters=(val); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1059 + def hook_into_yaml_loading; end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#266 + def nested_attribute?(key, value); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#163 + def permit_all_parameters; end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#163 + def permit_all_parameters=(val); end + end +end + +# source://actionpack//lib/action_controller/metal/strong_parameters.rb#1347 +ActionController::Parameters::EMPTY_ARRAY = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_controller/metal/strong_parameters.rb#1348 +ActionController::Parameters::EMPTY_HASH = T.let(T.unsafe(nil), Hash) + +# This is a list of permitted scalar types that includes the ones supported in +# XML and JSON requests. +# +# This list is in particular used to filter ordinary requests, String goes as +# first element to quickly short-circuit the common case. +# +# If you modify this collection please update the one in the #permit doc as +# well. +# +# source://actionpack//lib/action_controller/metal/strong_parameters.rb#1298 +ActionController::Parameters::PERMITTED_SCALAR_TYPES = T.let(T.unsafe(nil), Array) + +# # Action Controller Params Wrapper +# +# Wraps the parameters hash into a nested hash. This will allow clients to +# submit requests without having to specify any root elements. +# +# This functionality is enabled by default for JSON, and can be customized by +# setting the format array: +# +# class ApplicationController < ActionController::Base +# wrap_parameters format: [:json, :xml] +# end +# +# You could also turn it on per controller: +# +# class UsersController < ApplicationController +# wrap_parameters format: [:json, :xml, :url_encoded_form, :multipart_form] +# end +# +# If you enable `ParamsWrapper` for `:json` format, instead of having to send +# JSON parameters like this: +# +# {"user": {"name": "Konata"}} +# +# You can send parameters like this: +# +# {"name": "Konata"} +# +# And it will be wrapped into a nested hash with the key name matching the +# controller's name. For example, if you're posting to `UsersController`, your +# new `params` hash will look like this: +# +# {"name" => "Konata", "user" => {"name" => "Konata"}} +# +# You can also specify the key in which the parameters should be wrapped to, and +# also the list of attributes it should wrap by using either `:include` or +# `:exclude` options like this: +# +# class UsersController < ApplicationController +# wrap_parameters :person, include: [:username, :password] +# end +# +# On Active Record models with no `:include` or `:exclude` option set, it will +# only wrap the parameters returned by the class method `attribute_names`. +# +# If you're going to pass the parameters to an `ActiveModel` object (such as +# `User.new(params[:user])`), you might consider passing the model class to the +# method instead. The `ParamsWrapper` will actually try to determine the list of +# attribute names from the model and only wrap those attributes: +# +# class UsersController < ApplicationController +# wrap_parameters Person +# end +# +# You still could pass `:include` and `:exclude` to set the list of attributes +# you want to wrap. +# +# By default, if you don't specify the key in which the parameters would be +# wrapped to, `ParamsWrapper` will actually try to determine if there's a model +# related to it or not. This controller, for example: +# +# class Admin::UsersController < ApplicationController +# end +# +# will try to check if `Admin::User` or `User` model exists, and use it to +# determine the wrapper key respectively. If both models don't exist, it will +# then fall back to use `user` as the key. +# +# To disable this functionality for a controller: +# +# class UsersController < ApplicationController +# wrap_parameters false +# end +# +# source://actionpack//lib/action_controller/metal/params_wrapper.rb#83 +module ActionController::ParamsWrapper + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionController::ParamsWrapper::ClassMethods + + private + + # source://actionpack//lib/action_controller/metal/params_wrapper.rb#277 + def _extract_parameters(parameters); end + + # source://actionpack//lib/action_controller/metal/params_wrapper.rb#299 + def _perform_parameter_wrapping; end + + # Returns the list of parameters which will be selected for wrapped. + # + # source://actionpack//lib/action_controller/metal/params_wrapper.rb#273 + def _wrap_parameters(parameters); end + + # Checks if we should perform parameters wrapping. + # + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/params_wrapper.rb#289 + def _wrapper_enabled?; end + + # Returns the list of enabled formats. + # + # source://actionpack//lib/action_controller/metal/params_wrapper.rb#268 + def _wrapper_formats; end + + # Returns the wrapper key which will be used to store wrapped parameters. + # + # source://actionpack//lib/action_controller/metal/params_wrapper.rb#263 + def _wrapper_key; end + + # Performs parameters wrapping upon the request. Called automatically by the + # metal call stack. + # + # source://actionpack//lib/action_controller/metal/params_wrapper.rb#257 + def process_action(*_arg0); end + + module GeneratedClassMethods + def _wrapper_options; end + def _wrapper_options=(value); end + def _wrapper_options?; end + end + + module GeneratedInstanceMethods + def _wrapper_options; end + def _wrapper_options=(value); end + def _wrapper_options?; end + end +end + +# source://actionpack//lib/action_controller/metal/params_wrapper.rb#188 +module ActionController::ParamsWrapper::ClassMethods + # source://actionpack//lib/action_controller/metal/params_wrapper.rb#189 + def _set_wrapper_options(options); end + + # Sets the default wrapper key or model which will be used to determine wrapper + # key and attribute names. Called automatically when the module is inherited. + # + # source://actionpack//lib/action_controller/metal/params_wrapper.rb#244 + def inherited(klass); end + + # Sets the name of the wrapper key, or the model which `ParamsWrapper` would use + # to determine the attribute names from. + # + # #### Examples + # wrap_parameters format: :xml + # # enables the parameter wrapper for XML format + # + # wrap_parameters :person + # # wraps parameters into params[:person] hash + # + # wrap_parameters Person + # # wraps parameters by determining the wrapper key from Person class + # # (:person, in this case) and the list of attribute names + # + # wrap_parameters include: [:username, :title] + # # wraps only :username and :title attributes from parameters. + # + # wrap_parameters false + # # disables parameters wrapping for this controller altogether. + # + # #### Options + # * `:format` - The list of formats in which the parameters wrapper will be + # enabled. + # * `:include` - The list of attribute names which parameters wrapper will + # wrap into a nested hash. + # * `:exclude` - The list of attribute names which parameters wrapper will + # exclude from a nested hash. + # + # source://actionpack//lib/action_controller/metal/params_wrapper.rb#221 + def wrap_parameters(name_or_model_or_options, options = T.unsafe(nil)); end +end + +# source://actionpack//lib/action_controller/metal/params_wrapper.rb#86 +ActionController::ParamsWrapper::EXCLUDE_PARAMETERS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_controller/metal/params_wrapper.rb#88 +class ActionController::ParamsWrapper::Options < ::Struct + # @return [Options] a new instance of Options + # + # source://actionpack//lib/action_controller/metal/params_wrapper.rb#97 + def initialize(name, format, include, exclude, klass, model); end + + # Returns the value of attribute include + # + # @return [Object] the current value of include + # + # source://actionpack//lib/action_controller/metal/params_wrapper.rb#108 + def include; end + + # Returns the value of attribute model + # + # @return [Object] the current value of model + # + # source://actionpack//lib/action_controller/metal/params_wrapper.rb#104 + def model; end + + # Returns the value of attribute name + # + # @return [Object] the current value of name + # + # source://actionpack//lib/action_controller/metal/params_wrapper.rb#141 + def name; end + + private + + # Determine the wrapper model from the controller's name. By convention, this + # could be done by trying to find the defined model that has the same singular + # name as the controller. For example, `UsersController` will try to find if the + # `User` model exists. + # + # This method also does namespace lookup. Foo::Bar::UsersController will try to + # find Foo::Bar::User, Foo::User and finally User. + # + # source://actionpack//lib/action_controller/metal/params_wrapper.rb#165 + def _default_wrap_model; end + + class << self + # source://actionpack//lib/action_controller/metal/params_wrapper.rb#89 + def from_hash(hash); end + end +end + +# source://actionpack//lib/action_controller/metal/permissions_policy.rb#6 +module ActionController::PermissionsPolicy + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionController::PermissionsPolicy::ClassMethods +end + +# source://actionpack//lib/action_controller/metal/permissions_policy.rb#9 +module ActionController::PermissionsPolicy::ClassMethods + # Overrides parts of the globally configured `Feature-Policy` header: + # + # class PagesController < ApplicationController + # permissions_policy do |policy| + # policy.geolocation "https://example.com" + # end + # end + # + # Options can be passed similar to `before_action`. For example, pass `only: + # :index` to override the header on the index action only: + # + # class PagesController < ApplicationController + # permissions_policy(only: :index) do |policy| + # policy.camera :self + # end + # end + # + # Requires a global policy defined in an initializer, which can be + # empty: + # + # Rails.application.config.permissions_policy do |policy| + # # policy.gyroscope :none + # end + # + # source://actionpack//lib/action_controller/metal/permissions_policy.rb#33 + def permissions_policy(**options, &block); end +end + +# source://actionpack//lib/action_controller/railtie.rb#13 +class ActionController::Railtie < ::Rails::Railtie; end + +# source://actionpack//lib/action_controller/railties/helpers.rb#6 +module ActionController::Railties; end + +# source://actionpack//lib/action_controller/railties/helpers.rb#7 +module ActionController::Railties::Helpers + # source://actionpack//lib/action_controller/railties/helpers.rb#8 + def inherited(klass); end +end + +# source://actionpack//lib/action_controller/metal/rate_limiting.rb#6 +module ActionController::RateLimiting + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionController::RateLimiting::ClassMethods + + private + + # source://actionpack//lib/action_controller/metal/rate_limiting.rb#72 + def rate_limiting(to:, within:, by:, with:, store:, name:, scope:); end +end + +# source://actionpack//lib/action_controller/metal/rate_limiting.rb#9 +module ActionController::RateLimiting::ClassMethods + # Applies a rate limit to all actions or those specified by the normal + # `before_action` filters with `only:` and `except:`. + # + # The maximum number of requests allowed is specified `to:` and constrained to + # the window of time given by `within:`. + # + # Rate limits are by default unique to the ip address making the request, but + # you can provide your own identity function by passing a callable in the `by:` + # parameter. It's evaluated within the context of the controller processing the + # request. + # + # By default, rate limits are scoped to the controller's path. If you want to + # share rate limits across multiple controllers, you can provide your own scope, + # by passing value in the `scope:` parameter. + # + # Requests that exceed the rate limit will raise an `ActionController::TooManyRequests` + # error. By default, Action Dispatch will rescue from the error and refuse the request + # with a `429 Too Many Requests` response. You can specialize this by passing a callable in the `with:` + # parameter. It's evaluated within the context of the controller processing the + # request. + # + # Rate limiting relies on a backing `ActiveSupport::Cache` store and defaults to + # `config.action_controller.cache_store`, which itself defaults to the global + # `config.cache_store`. If you don't want to store rate limits in the same + # datastore as your general caches, you can pass a custom store in the `store` + # parameter. + # + # If you want to use multiple rate limits per controller, you need to give each of + # them an explicit name via the `name:` option. + # + # Examples: + # + # class SessionsController < ApplicationController + # rate_limit to: 10, within: 3.minutes, only: :create + # end + # + # class SignupsController < ApplicationController + # rate_limit to: 1000, within: 10.seconds, + # by: -> { request.domain }, with: :redirect_to_busy, only: :new + # + # private + # def redirect_to_busy + # redirect_to busy_controller_url, alert: "Too many signups on domain!" + # end + # end + # + # class APIController < ApplicationController + # RATE_LIMIT_STORE = ActiveSupport::Cache::RedisCacheStore.new(url: ENV["REDIS_URL"]) + # rate_limit to: 10, within: 3.minutes, store: RATE_LIMIT_STORE + # rate_limit to: 100, within: 5.minutes, scope: :api_global + # end + # + # class SessionsController < ApplicationController + # rate_limit to: 3, within: 2.seconds, name: "short-term" + # rate_limit to: 10, within: 5.minutes, name: "long-term" + # end + # + # source://actionpack//lib/action_controller/metal/rate_limiting.rb#66 + def rate_limit(to:, within:, by: T.unsafe(nil), with: T.unsafe(nil), store: T.unsafe(nil), name: T.unsafe(nil), scope: T.unsafe(nil), **options); end +end + +# source://actionpack//lib/action_controller/metal/redirecting.rb#6 +module ActionController::Redirecting + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActiveSupport::Benchmarkable + include ::AbstractController::Logger + include ::ActionDispatch::Routing::UrlFor + include ::AbstractController::UrlFor + include ::ActionController::UrlFor + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::AbstractController::UrlFor::ClassMethods + mixes_in_class_methods ::ActionController::Redirecting::ClassMethods + + # source://actionpack//lib/action_controller/metal/redirecting.rb#206 + def _compute_redirect_to_location(request, options); end + + # Soft deprecated alias for #redirect_back_or_to where the `fallback_location` + # location is supplied as a keyword argument instead of the first positional + # argument. + # + # source://actionpack//lib/action_controller/metal/redirecting.rb#169 + def redirect_back(fallback_location:, allow_other_host: T.unsafe(nil), **args); end + + # Redirects the browser to the page that issued the request (the referrer) if + # possible, otherwise redirects to the provided default fallback location. + # + # The referrer information is pulled from the HTTP `Referer` (sic) header on the + # request. This is an optional header and its presence on the request is subject + # to browser security settings and user preferences. If the request is missing + # this header, the `fallback_location` will be used. + # + # redirect_back_or_to({ action: "show", id: 5 }) + # redirect_back_or_to @post + # redirect_back_or_to "http://www.rubyonrails.org" + # redirect_back_or_to "/images/screenshot.jpg" + # redirect_back_or_to posts_url + # redirect_back_or_to proc { edit_post_url(@post) } + # redirect_back_or_to '/', allow_other_host: false + # + # #### Options + # * `:allow_other_host` - Allow or disallow redirection to the host that is + # different to the current host, defaults to true. + # + # + # All other options that can be passed to #redirect_to are accepted as options, + # and the behavior is identical. + # + # source://actionpack//lib/action_controller/metal/redirecting.rb#196 + def redirect_back_or_to(fallback_location, allow_other_host: T.unsafe(nil), **options); end + + # Redirects the browser to the target specified in `options`. This parameter can + # be any one of: + # + # * `Hash` - The URL will be generated by calling url_for with the `options`. + # * `Record` - The URL will be generated by calling url_for with the + # `options`, which will reference a named URL for that record. + # * `String` starting with `protocol://` (like `http://`) or a protocol + # relative reference (like `//`) - Is passed straight through as the target + # for redirection. + # * `String` not containing a protocol - The current protocol and host is + # prepended to the string. + # * `Proc` - A block that will be executed in the controller's context. Should + # return any option accepted by `redirect_to`. + # + # + # ### Examples + # + # redirect_to action: "show", id: 5 + # redirect_to @post + # redirect_to "http://www.rubyonrails.org" + # redirect_to "/images/screenshot.jpg" + # redirect_to posts_url + # redirect_to proc { edit_post_url(@post) } + # + # The redirection happens as a `302 Found` header unless otherwise specified + # using the `:status` option: + # + # redirect_to post_url(@post), status: :found + # redirect_to action: 'atom', status: :moved_permanently + # redirect_to post_url(@post), status: 301 + # redirect_to action: 'atom', status: 302 + # + # The status code can either be a standard [HTTP Status + # code](https://www.iana.org/assignments/http-status-codes) as an integer, or a + # symbol representing the downcased, underscored and symbolized description. + # Note that the status code must be a 3xx HTTP code, or redirection will not + # occur. + # + # If you are using XHR requests other than GET or POST and redirecting after the + # request then some browsers will follow the redirect using the original request + # method. This may lead to undesirable behavior such as a double DELETE. To work + # around this you can return a `303 See Other` status code which will be + # followed using a GET request. + # + # redirect_to posts_url, status: :see_other + # redirect_to action: 'index', status: 303 + # + # It is also possible to assign a flash message as part of the redirection. + # There are two special accessors for the commonly used flash names `alert` and + # `notice` as well as a general purpose `flash` bucket. + # + # redirect_to post_url(@post), alert: "Watch it, mister!" + # redirect_to post_url(@post), status: :found, notice: "Pay attention to the road" + # redirect_to post_url(@post), status: 301, flash: { updated_post_id: @post.id } + # redirect_to({ action: 'atom' }, alert: "Something serious happened") + # + # Statements after `redirect_to` in our controller get executed, so + # `redirect_to` doesn't stop the execution of the function. To terminate the + # execution of the function immediately after the `redirect_to`, use return. + # + # redirect_to post_url(@post) and return + # + # ### Open Redirect protection + # + # By default, Rails protects against redirecting to external hosts for your + # app's safety, so called open redirects. + # + # Here #redirect_to automatically validates the potentially-unsafe URL: + # + # redirect_to params[:redirect_url] + # + # The `action_on_open_redirect` configuration option controls the behavior when an unsafe + # redirect is detected: + # * `:log` - Logs a warning but allows the redirect + # * `:notify` - Sends an ActiveSupport notification for monitoring + # * `:raise` - Raises an UnsafeRedirectError + # + # To allow any external redirects pass `allow_other_host: true`, though using a + # user-provided param in that case is unsafe. + # + # redirect_to "https://rubyonrails.org", allow_other_host: true + # + # See #url_from for more information on what an internal and safe URL is, or how + # to fall back to an alternate redirect URL in the unsafe case. + # + # ### Path Relative URL Redirect Protection + # + # Rails also protects against potentially unsafe path relative URL redirects that don't + # start with a leading slash. These can create security vulnerabilities: + # + # redirect_to "example.com" # Creates http://yourdomain.comexample.com + # redirect_to "@attacker.com" # Creates http://yourdomain.com@attacker.com + # # which browsers interpret as user@host + # + # You can configure how Rails handles these cases using: + # + # config.action_controller.action_on_path_relative_redirect = :log # default + # config.action_controller.action_on_path_relative_redirect = :notify + # config.action_controller.action_on_path_relative_redirect = :raise + # + # * `:log` - Logs a warning but allows the redirect + # * `:notify` - Sends an ActiveSupport notification but allows the redirect + # (includes stack trace to help identify the source) + # * `:raise` - Raises an UnsafeRedirectError + # + # @raise [ActionControllerError] + # + # source://actionpack//lib/action_controller/metal/redirecting.rb#150 + def redirect_to(options = T.unsafe(nil), response_options = T.unsafe(nil)); end + + # Verifies the passed `location` is an internal URL that's safe to redirect to + # and returns it, or nil if not. Useful to wrap a params provided redirect URL + # and fall back to an alternate URL to redirect to: + # + # redirect_to url_from(params[:redirect_url]) || root_url + # + # The `location` is considered internal, and safe, if it's on the same host as + # `request.host`: + # + # # If request.host is example.com: + # url_from("https://example.com/profile") # => "https://example.com/profile" + # url_from("http://example.com/profile") # => "http://example.com/profile" + # url_from("http://evil.com/profile") # => nil + # + # Subdomains are considered part of the host: + # + # # If request.host is on https://example.com or https://app.example.com, you'd get: + # url_from("https://dev.example.com/profile") # => nil + # + # NOTE: there's a similarity with + # [url_for](rdoc-ref:ActionDispatch::Routing::UrlFor#url_for), which generates + # an internal URL from various options from within the app, e.g. + # `url_for(@post)`. However, #url_from is meant to take an external parameter to + # verify as in `url_from(params[:redirect_url])`. + # + # source://actionpack//lib/action_controller/metal/redirecting.rb#254 + def url_from(location); end + + private + + # source://actionpack//lib/action_controller/metal/redirecting.rb#260 + def _allow_other_host; end + + # source://actionpack//lib/action_controller/metal/redirecting.rb#276 + def _enforce_open_redirect_protection(location, allow_other_host:); end + + # source://actionpack//lib/action_controller/metal/redirecting.rb#317 + def _ensure_url_is_http_header_safe(url); end + + # source://actionpack//lib/action_controller/metal/redirecting.rb#266 + def _extract_redirect_to_status(options, response_options); end + + # source://actionpack//lib/action_controller/metal/redirecting.rb#327 + def _handle_path_relative_redirect(url); end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/redirecting.rb#304 + def _url_host_allowed?(url); end + + class << self + # source://actionpack//lib/action_controller/metal/redirecting.rb#227 + def _compute_redirect_to_location(request, options); end + end + + module GeneratedClassMethods + def _allowed_redirect_hosts; end + def _allowed_redirect_hosts=(value); end + def allowed_redirect_hosts_permissions; end + def allowed_redirect_hosts_permissions=(value); end + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end + + module GeneratedInstanceMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end +end + +# source://actionpack//lib/action_controller/metal/redirecting.rb#36 +module ActionController::Redirecting::ClassMethods + # source://actionpack//lib/action_controller/metal/redirecting.rb#37 + def allowed_redirect_hosts=(hosts); end +end + +# source://actionpack//lib/action_controller/metal/redirecting.rb#26 +ActionController::Redirecting::ILLEGAL_HEADER_VALUE_REGEX = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_controller/metal/redirecting.rb#14 +class ActionController::Redirecting::OpenRedirectError < ::ActionController::Redirecting::UnsafeRedirectError + # @return [OpenRedirectError] a new instance of OpenRedirectError + # + # source://actionpack//lib/action_controller/metal/redirecting.rb#15 + def initialize(location); end +end + +# source://actionpack//lib/action_controller/metal/redirecting.rb#20 +class ActionController::Redirecting::PathRelativeRedirectError < ::ActionController::Redirecting::UnsafeRedirectError + # @return [PathRelativeRedirectError] a new instance of PathRelativeRedirectError + # + # source://actionpack//lib/action_controller/metal/redirecting.rb#21 + def initialize(url); end +end + +# source://actionpack//lib/action_controller/metal/redirecting.rb#12 +class ActionController::Redirecting::UnsafeRedirectError < ::StandardError; end + +# source://actionpack//lib/action_controller/metal/exceptions.rb#16 +class ActionController::RenderError < ::ActionController::ActionControllerError; end + +# # Action Controller Renderer +# +# ActionController::Renderer allows you to render arbitrary templates without +# being inside a controller action. +# +# You can get a renderer instance by calling `renderer` on a controller class: +# +# ApplicationController.renderer +# PostsController.renderer +# +# and render a template by calling the #render method: +# +# ApplicationController.renderer.render template: "posts/show", assigns: { post: Post.first } +# PostsController.renderer.render :show, assigns: { post: Post.first } +# +# As a shortcut, you can also call `render` directly on the controller class +# itself: +# +# ApplicationController.render template: "posts/show", assigns: { post: Post.first } +# PostsController.render :show, assigns: { post: Post.first } +# +# source://actionpack//lib/action_controller/renderer.rb#27 +class ActionController::Renderer + # Initializes a new Renderer. + # + # #### Parameters + # + # * `controller` - The controller class to instantiate for rendering. + # * `env` - The Rack env to use for mocking a request when rendering. Entries + # can be typical Rack env keys and values, or they can be any of the + # following, which will be converted appropriately: + # * `:http_host` - The HTTP host for the incoming request. Converts to + # Rack's `HTTP_HOST`. + # * `:https` - Boolean indicating whether the incoming request uses HTTPS. + # Converts to Rack's `HTTPS`. + # * `:method` - The HTTP method for the incoming request, + # case-insensitive. Converts to Rack's `REQUEST_METHOD`. + # * `:script_name` - The portion of the incoming request's URL path that + # corresponds to the application. Converts to Rack's `SCRIPT_NAME`. + # * `:input` - The input stream. Converts to Rack's `rack.input`. + # * `defaults` - Default values for the Rack env. Entries are specified in the + # same format as `env`. `env` will be merged on top of these values. + # `defaults` will be retained when calling #new on a renderer instance. + # + # + # If no `http_host` is specified, the env HTTP host will be derived from the + # routes' `default_url_options`. In this case, the `https` boolean and the + # `script_name` will also be derived from `default_url_options` if they were not + # specified. Additionally, the `https` boolean will fall back to + # `Rails.application.config.force_ssl` if `default_url_options` does not specify + # a `protocol`. + # + # @return [Renderer] a new instance of Renderer + # + # source://actionpack//lib/action_controller/renderer.rb#110 + def initialize(controller, env, defaults); end + + # Returns the value of attribute controller. + # + # source://actionpack//lib/action_controller/renderer.rb#28 + def controller; end + + # source://actionpack//lib/action_controller/renderer.rb#121 + def defaults; end + + # Creates a new renderer using the same controller, but with a new Rack env. + # + # ApplicationController.renderer.new(method: "post") + # + # source://actionpack//lib/action_controller/renderer.rb#72 + def new(env = T.unsafe(nil)); end + + # source://actionpack//lib/action_controller/renderer.rb#150 + def normalize_env(env, &_arg1); end + + # Renders a template to a string, just like + # ActionController::Rendering#render_to_string. + # + # source://actionpack//lib/action_controller/renderer.rb#128 + def render(*args); end + + # Renders a template to a string, just like + # ActionController::Rendering#render_to_string. + # + # source://actionpack//lib/action_controller/renderer.rb#137 + def render_to_string(*args); end + + # Creates a new renderer using the same controller, but with the given defaults + # merged on top of the previous defaults. + # + # source://actionpack//lib/action_controller/renderer.rb#78 + def with_defaults(defaults); end + + private + + # source://actionpack//lib/action_controller/renderer.rb#152 + def env_for_request; end + + class << self + # Creates a new renderer using the given controller class. See ::new. + # + # source://actionpack//lib/action_controller/renderer.rb#64 + def for(controller, env = T.unsafe(nil), defaults = T.unsafe(nil)); end + + # source://actionpack//lib/action_controller/renderer.rb#35 + def normalize_env(env); end + end +end + +# source://actionpack//lib/action_controller/renderer.rb#30 +ActionController::Renderer::DEFAULTS = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_controller/renderer.rb#148 +ActionController::Renderer::DEFAULT_ENV = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_controller/renderer.rb#140 +ActionController::Renderer::RACK_KEY_TRANSLATION = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_controller/metal/renderers.rb#23 +module ActionController::Renderers + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionController::Renderers::ClassMethods + mixes_in_class_methods ::ActionController::Renderers::DeprecatedEscapeJsonResponses + + # source://actionpack//lib/action_controller/metal/renderers.rb#158 + def _render_to_body_with_renderer(options); end + + # source://actionpack//lib/action_controller/metal/renderers.rb#89 + def _render_with_renderer_js(js, options); end + + # source://actionpack//lib/action_controller/metal/renderers.rb#89 + def _render_with_renderer_json(json, options); end + + # source://actionpack//lib/action_controller/metal/renderers.rb#89 + def _render_with_renderer_markdown(md, options); end + + # source://actionpack//lib/action_controller/metal/renderers.rb#89 + def _render_with_renderer_xml(xml, options); end + + # Called by `render` in AbstractController::Rendering which sets the return + # value as the `response_body`. + # + # If no renderer is found, `super` returns control to + # `ActionView::Rendering.render_to_body`, if present. + # + # source://actionpack//lib/action_controller/metal/renderers.rb#154 + def render_to_body(options); end + + class << self + # source://actionpack//lib/action_controller/metal/renderers.rb#104 + def _render_with_renderer_method_name(key); end + + # Adds a new renderer to call within controller actions. A renderer is invoked + # by passing its name as an option to AbstractController::Rendering#render. To + # create a renderer pass it a name and a block. The block takes two arguments, + # the first is the value paired with its key and the second is the remaining + # hash of options passed to `render`. + # + # Create a csv renderer: + # + # ActionController::Renderers.add :csv do |obj, options| + # filename = options[:filename] || 'data' + # str = obj.respond_to?(:to_csv) ? obj.to_csv : obj.to_s + # send_data str, type: Mime[:csv], + # disposition: "attachment; filename=#{filename}.csv" + # end + # + # Note that we used [Mime](:csv) for the csv mime type as it comes with Rails. + # For a custom renderer, you'll need to register a mime type with + # `Mime::Type.register`. + # + # To use the csv renderer in a controller action: + # + # def show + # @csvable = Csvable.find(params[:id]) + # respond_to do |format| + # format.html + # format.csv { render csv: @csvable, filename: @csvable.name } + # end + # end + # + # source://actionpack//lib/action_controller/metal/renderers.rb#88 + def add(key, &block); end + + # This method is the opposite of add method. + # + # To remove a csv renderer: + # + # ActionController::Renderers.remove(:csv) + # + # source://actionpack//lib/action_controller/metal/renderers.rb#98 + def remove(key); end + end + + module GeneratedClassMethods + def _renderers; end + def _renderers=(value); end + def _renderers?; end + def escape_json_responses; end + def escape_json_responses=(value); end + def escape_json_responses?; end + end + + module GeneratedInstanceMethods + def _renderers; end + def _renderers=(value); end + def _renderers?; end + end +end + +# Used in ActionController::Base and ActionController::API to include all +# renderers by default. +# +# source://actionpack//lib/action_controller/metal/renderers.rb#51 +module ActionController::Renderers::All + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActionController::Renderers + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionController::Renderers::ClassMethods + mixes_in_class_methods ::ActionController::Renderers::DeprecatedEscapeJsonResponses + + module GeneratedClassMethods + def _renderers; end + def _renderers=(value); end + def _renderers?; end + def escape_json_responses; end + def escape_json_responses=(value); end + def escape_json_responses?; end + end + + module GeneratedInstanceMethods + def _renderers; end + def _renderers=(value); end + def _renderers?; end + end +end + +# source://actionpack//lib/action_controller/metal/renderers.rb#108 +module ActionController::Renderers::ClassMethods + # Adds, by name, a renderer or renderers to the `_renderers` available to call + # within controller actions. + # + # It is useful when rendering from an ActionController::Metal controller or + # otherwise to add an available renderer proc to a specific controller. + # + # Both ActionController::Base and ActionController::API include + # ActionController::Renderers::All, making all renderers available in the + # controller. See Renderers::RENDERERS and Renderers.add. + # + # Since ActionController::Metal controllers cannot render, the controller must + # include AbstractController::Rendering, ActionController::Rendering, and + # ActionController::Renderers, and have at least one renderer. + # + # Rather than including ActionController::Renderers::All and including all + # renderers, you may specify which renderers to include by passing the renderer + # name or names to `use_renderers`. For example, a controller that includes only + # the `:json` renderer (`_render_with_renderer_json`) might look like: + # + # class MetalRenderingController < ActionController::Metal + # include AbstractController::Rendering + # include ActionController::Rendering + # include ActionController::Renderers + # + # use_renderers :json + # + # def show + # render json: record + # end + # end + # + # You must specify a `use_renderer`, else the `controller.renderer` and + # `controller._renderers` will be `nil`, and the action will fail. + # + # source://actionpack//lib/action_controller/metal/renderers.rb#146 + def use_renderer(*args); end + + # Adds, by name, a renderer or renderers to the `_renderers` available to call + # within controller actions. + # + # It is useful when rendering from an ActionController::Metal controller or + # otherwise to add an available renderer proc to a specific controller. + # + # Both ActionController::Base and ActionController::API include + # ActionController::Renderers::All, making all renderers available in the + # controller. See Renderers::RENDERERS and Renderers.add. + # + # Since ActionController::Metal controllers cannot render, the controller must + # include AbstractController::Rendering, ActionController::Rendering, and + # ActionController::Renderers, and have at least one renderer. + # + # Rather than including ActionController::Renderers::All and including all + # renderers, you may specify which renderers to include by passing the renderer + # name or names to `use_renderers`. For example, a controller that includes only + # the `:json` renderer (`_render_with_renderer_json`) might look like: + # + # class MetalRenderingController < ActionController::Metal + # include AbstractController::Rendering + # include ActionController::Rendering + # include ActionController::Renderers + # + # use_renderers :json + # + # def show + # render json: record + # end + # end + # + # You must specify a `use_renderer`, else the `controller.renderer` and + # `controller._renderers` will be `nil`, and the action will fail. + # + # source://actionpack//lib/action_controller/metal/renderers.rb#142 + def use_renderers(*args); end +end + +# source://actionpack//lib/action_controller/metal/renderers.rb#30 +module ActionController::Renderers::DeprecatedEscapeJsonResponses + # source://actionpack//lib/action_controller/metal/renderers.rb#31 + def escape_json_responses=(value); end +end + +# A Set containing renderer names that correspond to available renderer procs. +# Default values are `:json`, `:js`, `:xml`. +# +# source://actionpack//lib/action_controller/metal/renderers.rb#28 +ActionController::Renderers::RENDERERS = T.let(T.unsafe(nil), Set) + +# source://actionpack//lib/action_controller/metal/rendering.rb#6 +module ActionController::Rendering + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionController::Rendering::ClassMethods + + # Renders a template and assigns the result to `self.response_body`. + # + # If no rendering mode option is specified, the template will be derived from + # the first argument. + # + # render "posts/show" + # # => renders app/views/posts/show.html.erb + # + # # In a PostsController action... + # render :show + # # => renders app/views/posts/show.html.erb + # + # If the first argument responds to `render_in`, the template will be rendered + # by calling `render_in` with the current view context. + # + # class Greeting + # def render_in(view_context) + # view_context.render html: "

Hello, World

" + # end + # + # def format + # :html + # end + # end + # + # render(Greeting.new) + # # => "

Hello, World

" + # + # render(renderable: Greeting.new) + # # => "

Hello, World

" + # + # #### Rendering Mode + # + # `:partial` + # + # render partial: "posts/form", locals: { post: Post.new } + # # => renders app/views/posts/_form.html.erb + # + # `:file` + # unsanitized user input. + # + # render file: "/path/to/some/file" + # # => renders /path/to/some/file + # + # `:inline` + # + # @name = "World" + # render inline: "

Hello, <%= @name %>!

" + # # => renders "

Hello, World!

" + # + # `:body` + # + # render body: "Hello, World!" + # # => renders "Hello, World!" + # + # `:plain` + # + # render plain: "Hello, World!" + # # => renders "Hello, World!" + # + # `:html` + # `text/html`. If the string is not `html_safe?`, performs HTML escaping on + # the string before rendering. + # + # render html: "

Hello, World!

".html_safe + # # => renders "

Hello, World!

" + # + # render html: "

Hello, World!

" + # # => renders "<h1>Hello, World!</h1>" + # + # `:json` + # `application/json`. If the object is not a string, it will be converted to + # JSON by calling `to_json`. + # + # render json: { hello: "world" } + # # => renders "{\"hello\":\"world\"}" + # + # `:renderable` + # context. The response format is determined by calling `format` on the + # renderable if it responds to `format`, falling back to `text/html` by + # default. + # + # render renderable: Greeting.new + # # => renders "

Hello, World

" + # + # + # By default, when a rendering mode is specified, no layout template is + # rendered. + # + # #### Options + # + # `:assigns` + # + # render inline: "

Hello, <%= @name %>!

", assigns: { name: "World" } + # # => renders "

Hello, World!

" + # + # `:locals` + # + # render inline: "

Hello, <%= name %>!

", locals: { name: "World" } + # # => renders "

Hello, World!

" + # + # `:layout` + # (re)enable the default layout template. + # + # render "posts/show", layout: "holiday" + # # => renders app/views/posts/show.html.erb with the app/views/layouts/holiday.html.erb layout + # + # render "posts/show", layout: false + # # => renders app/views/posts/show.html.erb with no layout + # + # render inline: "

Hello, World!

", layout: true + # # => renders "

Hello, World!

" with the default layout + # + # `:status` + # number or as the status name in Symbol form. Defaults to 200. + # + # render "posts/new", status: 422 + # # => renders app/views/posts/new.html.erb with HTTP status code 422 + # + # render "posts/new", status: :unprocessable_entity + # # => renders app/views/posts/new.html.erb with HTTP status code 422 + # + # `:variants` + # + # render "posts/index", variants: [:mobile] + # # => renders app/views/posts/index.html+mobile.erb + # + # -- + # Check for double render errors and set the content_type after rendering. + # + # @raise [::AbstractController::DoubleRenderError] + # + # source://actionpack//lib/action_controller/metal/rendering.rb#171 + def render(*args); end + + # source://actionpack//lib/action_controller/metal/rendering.rb#191 + def render_to_body(options = T.unsafe(nil)); end + + # Similar to #render, but only returns the rendered template as a string, + # instead of setting `self.response_body`. + # -- + # Override render_to_string because body can now be set to a Rack body. + # + # source://actionpack//lib/action_controller/metal/rendering.rb#180 + def render_to_string(*_arg0); end + + private + + # Normalize both text and status options. + # + # source://actionpack//lib/action_controller/metal/rendering.rb#233 + def _normalize_options(options); end + + # source://actionpack//lib/action_controller/metal/rendering.rb#247 + def _normalize_text(options); end + + # Process controller specific options, as status, content-type and location. + # + # source://actionpack//lib/action_controller/metal/rendering.rb#256 + def _process_options(options); end + + # source://actionpack//lib/action_controller/metal/rendering.rb#202 + def _process_variant(options); end + + # source://actionpack//lib/action_controller/metal/rendering.rb#208 + def _render_in_priorities(options); end + + # source://actionpack//lib/action_controller/metal/rendering.rb#216 + def _set_html_content_type; end + + # source://actionpack//lib/action_controller/metal/rendering.rb#220 + def _set_rendered_content_type(format); end + + # source://actionpack//lib/action_controller/metal/rendering.rb#226 + def _set_vary_header; end + + # Before processing, set the request formats in current controller formats. + # + # source://actionpack//lib/action_controller/metal/rendering.rb#197 + def process_action(*_arg0); end +end + +# source://actionpack//lib/action_controller/metal/rendering.rb#11 +module ActionController::Rendering::ClassMethods + # source://actionpack//lib/action_controller/metal/rendering.rb#23 + def inherited(klass); end + + # source://actionpack//lib/action_controller/metal/rendering.rb#13 + def render(*_arg0, **_arg1, &_arg2); end + + # Returns a renderer instance (inherited from ActionController::Renderer) for + # the controller. + # + # source://actionpack//lib/action_controller/metal/rendering.rb#17 + def renderer; end + + # source://actionpack//lib/action_controller/metal/rendering.rb#19 + def setup_renderer!; end +end + +# source://actionpack//lib/action_controller/metal/rendering.rb#9 +ActionController::Rendering::RENDER_FORMATS_IN_PRIORITY = T.let(T.unsafe(nil), Array) + +# # Action Controller Request Forgery Protection +# +# Controller actions are protected from Cross-Site Request Forgery (CSRF) +# attacks by including a token in the rendered HTML for your application. This +# token is stored as a random string in the session, to which an attacker does +# not have access. When a request reaches your application, Rails verifies the +# received token with the token in the session. All requests are checked except +# GET requests as these should be idempotent. Keep in mind that all +# session-oriented requests are CSRF protected by default, including JavaScript +# and HTML requests. +# +# Since HTML and JavaScript requests are typically made from the browser, we +# need to ensure to verify request authenticity for the web browser. We can use +# session-oriented authentication for these types of requests, by using the +# `protect_from_forgery` method in our controllers. +# +# GET requests are not protected since they don't have side effects like writing +# to the database and don't leak sensitive information. JavaScript requests are +# an exception: a third-party site can use a +# +# The first two characters (`">`) are required in case the exception happens +# while rendering attributes for a given tag. You can check the real cause for +# the exception in your logger. +# +# ## Web server support +# +# Rack 3+ compatible servers all support streaming. +# +# source://actionpack//lib/action_controller/metal/streaming.rb#169 +module ActionController::Streaming + private + + # Call render_body if we are streaming instead of usual `render`. + # + # source://actionpack//lib/action_controller/metal/streaming.rb#172 + def _render_template(options); end +end + +# # Strong Parameters +# +# It provides an interface for protecting attributes from end-user assignment. +# This makes Action Controller parameters forbidden to be used in Active Model +# mass assignment until they have been explicitly enumerated. +# +# In addition, parameters can be marked as required and flow through a +# predefined raise/rescue flow to end up as a `400 Bad Request` with no effort. +# +# class PeopleController < ActionController::Base +# # Using "Person.create(params[:person])" would raise an +# # ActiveModel::ForbiddenAttributesError exception because it'd +# # be using mass assignment without an explicit permit step. +# # This is the recommended form: +# def create +# Person.create(person_params) +# end +# +# # This will pass with flying colors as long as there's a person key in the +# # parameters, otherwise it'll raise an ActionController::ParameterMissing +# # exception, which will get caught by ActionController::Base and turned +# # into a 400 Bad Request reply. +# def update +# redirect_to current_account.people.find(params[:id]).tap { |person| +# person.update!(person_params) +# } +# end +# +# private +# # Using a private method to encapsulate the permissible parameters is +# # a good pattern since you'll be able to reuse the same permit +# # list between create and update. Also, you can specialize this method +# # with per-user checking of permissible attributes. +# def person_params +# params.expect(person: [:name, :age]) +# end +# end +# +# In order to use `accepts_nested_attributes_for` with Strong Parameters, you +# will need to specify which nested attributes should be permitted. You might +# want to allow `:id` and `:_destroy`, see ActiveRecord::NestedAttributes for +# more information. +# +# class Person +# has_many :pets +# accepts_nested_attributes_for :pets +# end +# +# class PeopleController < ActionController::Base +# def create +# Person.create(person_params) +# end +# +# ... +# +# private +# +# def person_params +# # It's mandatory to specify the nested attributes that should be permitted. +# # If you use `permit` with just the key that points to the nested attributes hash, +# # it will return an empty hash. +# params.expect(person: [ :name, :age, pets_attributes: [ :id, :name, :category ] ]) +# end +# end +# +# See ActionController::Parameters.expect, +# See ActionController::Parameters.require, and +# ActionController::Parameters.permit for more information. +# +# source://actionpack//lib/action_controller/metal/strong_parameters.rb#1508 +module ActionController::StrongParameters + # Returns a new ActionController::Parameters object that has been instantiated + # with the `request.parameters`. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1511 + def params; end + + # Assigns the given `value` to the `params` hash. If `value` is a Hash, this + # will create an ActionController::Parameters object that has been instantiated + # with the given `value` hash. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1526 + def params=(value); end +end + +# source://actionpack//lib/action_controller/structured_event_subscriber.rb#4 +class ActionController::StructuredEventSubscriber < ::ActiveSupport::StructuredEventSubscriber + # @return [Boolean] + # + # source://actionpack//lib/action_controller/structured_event_subscriber.rb#87 + def exist_fragment?(event); end + + # source://actionpack//lib/action_controller/structured_event_subscriber.rb#91 + def expire_fragment(event); end + + # source://actionpack//lib/action_controller/structured_event_subscriber.rb#43 + def halted_callback(event); end + + # source://actionpack//lib/action_controller/structured_event_subscriber.rb#25 + def process_action(event); end + + # source://actionpack//lib/action_controller/structured_event_subscriber.rb#83 + def read_fragment(event); end + + # source://actionpack//lib/action_controller/structured_event_subscriber.rb#60 + def redirect_to(event); end + + # source://actionpack//lib/action_controller/structured_event_subscriber.rb#47 + def rescue_from_callback(event); end + + # source://actionpack//lib/action_controller/structured_event_subscriber.rb#64 + def send_data(event); end + + # source://actionpack//lib/action_controller/structured_event_subscriber.rb#56 + def send_file(event); end + + # source://actionpack//lib/action_controller/structured_event_subscriber.rb#7 + def start_processing(event); end + + # source://actionpack//lib/action_controller/structured_event_subscriber.rb#68 + def unpermitted_parameters(event); end + + # source://actionpack//lib/action_controller/structured_event_subscriber.rb#79 + def write_fragment(event); end + + private + + # source://actionpack//lib/action_controller/structured_event_subscriber.rb#106 + def additions_for(payload); end + + # source://actionpack//lib/action_controller/structured_event_subscriber.rb#96 + def fragment_cache(method_name, event); end +end + +# source://actionpack//lib/action_controller/structured_event_subscriber.rb#5 +ActionController::StructuredEventSubscriber::INTERNAL_PARAMS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_controller/template_assertions.rb#6 +module ActionController::TemplateAssertions + # @raise [NoMethodError] + # + # source://actionpack//lib/action_controller/template_assertions.rb#7 + def assert_template(options = T.unsafe(nil), message = T.unsafe(nil)); end +end + +# # Action Controller Test Case +# +# Superclass for ActionController functional tests. Functional tests allow you +# to test a single controller action per test method. +# +# ## Use integration style controller tests over functional style controller tests. +# +# Rails discourages the use of functional tests in favor of integration tests +# (use ActionDispatch::IntegrationTest). +# +# New Rails applications no longer generate functional style controller tests +# and they should only be used for backward compatibility. Integration style +# controller tests perform actual requests, whereas functional style controller +# tests merely simulate a request. Besides, integration tests are as fast as +# functional tests and provide lot of helpers such as `as`, `parsed_body` for +# effective testing of controller actions including even API endpoints. +# +# ## Basic example +# +# Functional tests are written as follows: +# 1. First, one uses the `get`, `post`, `patch`, `put`, `delete`, or `head` +# method to simulate an HTTP request. +# 2. Then, one asserts whether the current state is as expected. "State" can be +# anything: the controller's HTTP response, the database contents, etc. +# +# +# For example: +# +# class BooksControllerTest < ActionController::TestCase +# def test_create +# # Simulate a POST response with the given HTTP parameters. +# post(:create, params: { book: { title: "Love Hina" }}) +# +# # Asserts that the controller tried to redirect us to +# # the created book's URI. +# assert_response :found +# +# # Asserts that the controller really put the book in the database. +# assert_not_nil Book.find_by(title: "Love Hina") +# end +# end +# +# You can also send a real document in the simulated HTTP request. +# +# def test_create +# json = {book: { title: "Love Hina" }}.to_json +# post :create, body: json +# end +# +# ## Special instance variables +# +# ActionController::TestCase will also automatically provide the following +# instance variables for use in the tests: +# +# +# You can modify this object before sending the HTTP request. For example, +# you might want to set some session properties before sending a GET +# request. +# +# last HTTP response. In the above example, `@response` becomes valid after +# calling `post`. If the various assert methods are not sufficient, then you +# may use this object to inspect the HTTP response in detail. +# +# +# ## Controller is automatically inferred +# +# ActionController::TestCase will automatically infer the controller under test +# from the test class name. If the controller cannot be inferred from the test +# class name, you can explicitly set it with `tests`. +# +# class SpecialEdgeCaseWidgetsControllerTest < ActionController::TestCase +# tests WidgetController +# end +# +# ## Testing controller internals +# +# In addition to these specific assertions, you also have easy access to various +# collections that the regular test/unit assertions can be used against. These +# collections are: +# +# * session: Objects being saved in the session. +# * flash: The flash objects currently in the session. +# * cookies: Cookies being sent to the user on this request. +# +# +# These collections can be used just like any other hash: +# +# assert_equal "Dave", cookies[:name] # makes sure that a cookie called :name was set as "Dave" +# assert flash.empty? # makes sure that there's nothing in the flash +# +# On top of the collections, you have the complete URL that a given action +# redirected to available in `redirect_to_url`. +# +# For redirects within the same controller, you can even call follow_redirect +# and the redirect will be followed, triggering another action call which can +# then be asserted against. +# +# ## Manipulating session and cookie variables +# +# Sometimes you need to set up the session and cookie variables for a test. To +# do this just assign a value to the session or cookie collection: +# +# session[:key] = "value" +# cookies[:key] = "value" +# +# To clear the cookies for a test just clear the cookie collection: +# +# cookies.clear +# +# ## Testing named routes +# +# If you're using named routes, they can be easily tested using the original +# named routes' methods straight in the test case. +# +# assert_redirected_to page_url(title: 'foo') +# +# source://actionpack//lib/action_controller/test_case.rb#368 +class ActionController::TestCase < ::ActiveSupport::TestCase + include ::ActiveSupport::Testing::ConstantLookup + include ::ActionDispatch::TestProcess::FixtureFile + include ::ActionDispatch::TestProcess + include ::ActionDispatch::Assertions::ResponseAssertions + include ::Rails::Dom::Testing::Assertions::DomAssertions + include ::Rails::Dom::Testing::Assertions::SelectorAssertions + include ::Rails::Dom::Testing::Assertions + include ::ActionController::TestCase::Behavior + include ::ActionController::TemplateAssertions + include ::ActionDispatch::Assertions::RoutingAssertions + include ::ActionDispatch::Assertions + extend ::ActiveSupport::Testing::ConstantLookup::ClassMethods + extend ::ActionController::TestCase::Behavior::ClassMethods + extend ::ActionDispatch::Assertions::RoutingAssertions::ClassMethods + + # source://actionpack//lib/action_controller/test_case.rb#599 + def _controller_class; end + + # source://actionpack//lib/action_controller/test_case.rb#599 + def _controller_class=(_arg0); end + + # source://actionpack//lib/action_controller/test_case.rb#599 + def _controller_class?; end + + # source://actionpack//lib/action_controller/test_case.rb#600 + def _run_setup_callbacks(&block); end + + class << self + # source://actionpack//lib/action_controller/test_case.rb#599 + def _controller_class; end + + # source://actionpack//lib/action_controller/test_case.rb#599 + def _controller_class=(value); end + + # source://actionpack//lib/action_controller/test_case.rb#599 + def _controller_class?; end + + # source://actionpack//lib/action_controller/test_case.rb#369 + def executor_around_each_request; end + + # source://actionpack//lib/action_controller/test_case.rb#369 + def executor_around_each_request=(_arg0); end + + private + + # source://actionpack//lib/action_controller/test_case.rb#600 + def __class_attr___callbacks; end + + # source://actionpack//lib/action_controller/test_case.rb#600 + def __class_attr___callbacks=(new_value); end + + # source://actionpack//lib/action_controller/test_case.rb#599 + def __class_attr__controller_class; end + + # source://actionpack//lib/action_controller/test_case.rb#599 + def __class_attr__controller_class=(new_value); end + end +end + +# source://actionpack//lib/action_controller/test_case.rb#371 +module ActionController::TestCase::Behavior + include ::ActionDispatch::TestProcess::FixtureFile + include ::ActionDispatch::TestProcess + include ::Rails::Dom::Testing::Assertions::DomAssertions + include ::Rails::Dom::Testing::Assertions::SelectorAssertions + include ::Rails::Dom::Testing::Assertions + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActiveSupport::Testing::ConstantLookup + include ::ActionController::TemplateAssertions + include ::ActionDispatch::Assertions::RoutingAssertions + include ::ActionDispatch::Assertions + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveSupport::Testing::ConstantLookup::ClassMethods + mixes_in_class_methods ::ActionController::TestCase::Behavior::ClassMethods + mixes_in_class_methods ::ActionDispatch::Assertions::RoutingAssertions::ClassMethods + + # source://actionpack//lib/action_controller/test_case.rb#592 + def build_response(klass); end + + # source://actionpack//lib/action_controller/test_case.rb#552 + def controller_class_name; end + + # Simulate a DELETE request with the given parameters and set/volley the + # response. See `get` for more details. + # + # source://actionpack//lib/action_controller/test_case.rb#463 + def delete(action, **args); end + + # source://actionpack//lib/action_controller/test_case.rb#556 + def generated_path(generated_extras); end + + # Simulate a GET request with the given parameters. + # + # * `action`: The controller action to call. + # * `params`: The hash with HTTP parameters that you want to pass. This may be + # `nil`. + # * `body`: The request body with a string that is appropriately encoded + # (`application/x-www-form-urlencoded` or `multipart/form-data`). + # * `session`: A hash of parameters to store in the session. This may be + # `nil`. + # * `flash`: A hash of parameters to store in the flash. This may be `nil`. + # + # + # You can also simulate POST, PATCH, PUT, DELETE, and HEAD requests with `post`, + # `patch`, `put`, `delete`, and `head`. Example sending parameters, session, and + # setting a flash message: + # + # get :show, + # params: { id: 7 }, + # session: { user_id: 1 }, + # flash: { notice: 'This is flash message' } + # + # Note that the request method is not verified. The different methods are + # available to make the tests more expressive. + # + # source://actionpack//lib/action_controller/test_case.rb#439 + def get(action, **args); end + + # Simulate a HEAD request with the given parameters and set/volley the response. + # See `get` for more details. + # + # source://actionpack//lib/action_controller/test_case.rb#469 + def head(action, **args); end + + # Simulate a PATCH request with the given parameters and set/volley the + # response. See `get` for more details. + # + # source://actionpack//lib/action_controller/test_case.rb#451 + def patch(action, **args); end + + # Simulate a POST request with the given parameters and set/volley the response. + # See `get` for more details. + # + # source://actionpack//lib/action_controller/test_case.rb#445 + def post(action, **args); end + + # Simulate an HTTP request to `action` by specifying request method, parameters + # and set/volley the response. + # + # * `action`: The controller action to call. + # * `method`: Request method used to send the HTTP request. Possible values + # are `GET`, `POST`, `PATCH`, `PUT`, `DELETE`, `HEAD`. Defaults to `GET`. + # Can be a symbol. + # * `params`: The hash with HTTP parameters that you want to pass. This may be + # `nil`. + # * `body`: The request body with a string that is appropriately encoded + # (`application/x-www-form-urlencoded` or `multipart/form-data`). + # * `session`: A hash of parameters to store in the session. This may be + # `nil`. + # * `flash`: A hash of parameters to store in the flash. This may be `nil`. + # * `format`: Request format. Defaults to `nil`. Can be string or symbol. + # * `as`: Content type. Defaults to `nil`. Must be a symbol that corresponds + # to a mime type. + # + # + # Example calling `create` action and sending two params: + # + # process :create, + # method: 'POST', + # params: { + # user: { name: 'Gaurish Sharma', email: 'user@example.com' } + # }, + # session: { user_id: 1 }, + # flash: { notice: 'This is flash message' } + # + # To simulate `GET`, `POST`, `PATCH`, `PUT`, `DELETE`, and `HEAD` requests + # prefer using #get, #post, #patch, #put, #delete and #head methods respectively + # which will make tests more expressive. + # + # It's not recommended to make more than one request in the same test. Instance + # variables that are set in one request will not persist to the next request, + # but it's not guaranteed that all Rails internal state will be reset. Prefer + # ActionDispatch::IntegrationTest for making multiple requests in the same test. + # + # Note that the request method is not verified. + # + # source://actionpack//lib/action_controller/test_case.rb#512 + def process(action, method: T.unsafe(nil), params: T.unsafe(nil), session: T.unsafe(nil), body: T.unsafe(nil), flash: T.unsafe(nil), format: T.unsafe(nil), xhr: T.unsafe(nil), as: T.unsafe(nil)); end + + # Simulate a PUT request with the given parameters and set/volley the response. + # See `get` for more details. + # + # source://actionpack//lib/action_controller/test_case.rb#457 + def put(action, **args); end + + # source://actionpack//lib/action_controller/test_case.rb#560 + def query_parameter_names(generated_extras); end + + # Returns the value of attribute request. + # + # source://actionpack//lib/action_controller/test_case.rb#377 + def request; end + + # Returns the value of attribute response. + # + # source://actionpack//lib/action_controller/test_case.rb#377 + def response; end + + # source://actionpack//lib/action_controller/test_case.rb#564 + def setup_controller_request_and_response; end + + private + + # source://actionpack//lib/action_controller/test_case.rb#685 + def check_required_ivars; end + + # source://actionpack//lib/action_controller/test_case.rb#681 + def document_root_element; end + + # source://actionpack//lib/action_controller/test_case.rb#635 + def process_controller_response(action, cookies, xhr); end + + # source://actionpack//lib/action_controller/test_case.rb#671 + def scrub_env!(env); end + + # source://actionpack//lib/action_controller/test_case.rb#605 + def setup_request(controller_class_name, action, parameters, session, flash, xhr); end + + # source://actionpack//lib/action_controller/test_case.rb#627 + def wrap_execution(&block); end + + module GeneratedClassMethods + def _controller_class; end + def _controller_class=(value); end + def _controller_class?; end + end + + module GeneratedInstanceMethods + def _controller_class; end + def _controller_class=(value); end + def _controller_class?; end + end +end + +# source://actionpack//lib/action_controller/test_case.rb#379 +module ActionController::TestCase::Behavior::ClassMethods + # source://actionpack//lib/action_controller/test_case.rb#401 + def controller_class; end + + # source://actionpack//lib/action_controller/test_case.rb#397 + def controller_class=(new_class); end + + # source://actionpack//lib/action_controller/test_case.rb#409 + def determine_default_controller_class(name); end + + # Sets the controller class name. Useful if the name can't be inferred from test + # class. Normalizes `controller_class` before using. + # + # tests WidgetController + # tests :widget + # tests 'widget' + # + # source://actionpack//lib/action_controller/test_case.rb#386 + def tests(controller_class); end +end + +# ActionController::TestCase will be deprecated and moved to a gem in the +# future. Please use ActionDispatch::IntegrationTest going forward. +# +# source://actionpack//lib/action_controller/test_case.rb#46 +class ActionController::TestRequest < ::ActionDispatch::TestRequest + # @return [TestRequest] a new instance of TestRequest + # + # source://actionpack//lib/action_controller/test_case.rb#69 + def initialize(env, session, controller_class); end + + # source://actionpack//lib/action_controller/test_case.rb#88 + def assign_parameters(routes, controller_path, action, parameters, generated_path, query_string_keys); end + + # source://actionpack//lib/action_controller/test_case.rb#84 + def content_type=(type); end + + # Returns the value of attribute controller_class. + # + # source://actionpack//lib/action_controller/test_case.rb#54 + def controller_class; end + + # source://actionpack//lib/action_controller/test_case.rb#80 + def query_string=(string); end + + private + + # source://actionpack//lib/action_controller/test_case.rb#179 + def params_parsers; end + + class << self + # Create a new test request with default `env` values. + # + # source://actionpack//lib/action_controller/test_case.rb#57 + def create(controller_class); end + + # source://actionpack//lib/action_controller/test_case.rb#50 + def new_session; end + + private + + # source://actionpack//lib/action_controller/test_case.rb#64 + def default_env; end + end +end + +# source://actionpack//lib/action_controller/test_case.rb#47 +ActionController::TestRequest::DEFAULT_ENV = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_controller/test_case.rb#151 +ActionController::TestRequest::ENCODER = T.let(T.unsafe(nil), T.untyped) + +# Methods #destroy and #load! are overridden to avoid calling methods on the +# +# source://actionpack//lib/action_controller/test_case.rb#197 +class ActionController::TestSession < ::Rack::Session::Abstract::PersistedSecure::SecureSessionHash + # @return [TestSession] a new instance of TestSession + # + # source://actionpack//lib/action_controller/test_case.rb#200 + def initialize(session = T.unsafe(nil), id = T.unsafe(nil)); end + + # source://actionpack//lib/action_controller/test_case.rb#220 + def destroy; end + + # source://actionpack//lib/action_controller/test_case.rb#224 + def dig(*keys); end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/test_case.rb#233 + def enabled?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/test_case.rb#208 + def exists?; end + + # source://actionpack//lib/action_controller/test_case.rb#229 + def fetch(key, *args, &block); end + + # source://actionpack//lib/action_controller/test_case.rb#237 + def id_was; end + + # source://actionpack//lib/action_controller/test_case.rb#212 + def keys; end + + # source://actionpack//lib/action_controller/test_case.rb#216 + def values; end + + private + + # source://actionpack//lib/action_controller/test_case.rb#242 + def load!; end +end + +# source://actionpack//lib/action_controller/test_case.rb#198 +ActionController::TestSession::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_controller/metal/testing.rb#6 +module ActionController::Testing; end + +# Behavior specific to functional tests +# +# source://actionpack//lib/action_controller/metal/testing.rb#8 +module ActionController::Testing::Functional + # source://actionpack//lib/action_controller/metal/testing.rb#9 + def clear_instance_variables_between_requests; end + + # source://actionpack//lib/action_controller/metal/testing.rb#18 + def recycle!; end +end + +# Raised when a Rate Limit is exceeded by too many requests within a period of +# time. +# +# source://actionpack//lib/action_controller/metal/exceptions.rb#109 +class ActionController::TooManyRequests < ::ActionController::ActionControllerError; end + +# Raised when a Parameters instance is not marked as permitted and an operation +# to transform it to hash is called. +# +# params = ActionController::Parameters.new(a: "123", b: "456") +# params.to_h +# # => ActionController::UnfilteredParameters: unable to convert unpermitted parameters to hash +# +# source://actionpack//lib/action_controller/metal/strong_parameters.rb#74 +class ActionController::UnfilteredParameters < ::ArgumentError + # @return [UnfilteredParameters] a new instance of UnfilteredParameters + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#75 + def initialize; end +end + +# source://actionpack//lib/action_controller/metal/exceptions.rb#75 +class ActionController::UnknownFormat < ::ActionController::ActionControllerError; end + +# source://actionpack//lib/action_controller/metal/exceptions.rb#72 +class ActionController::UnknownHttpMethod < ::ActionController::ActionControllerError; end + +# Raised when a supplied parameter is not expected and +# ActionController::Parameters.action_on_unpermitted_parameters is set to +# `:raise`. +# +# params = ActionController::Parameters.new(a: "123", b: "456") +# params.permit(:c) +# # => ActionController::UnpermittedParameters: found unpermitted parameters: :a, :b +# +# source://actionpack//lib/action_controller/metal/strong_parameters.rb#59 +class ActionController::UnpermittedParameters < ::IndexError + # @return [UnpermittedParameters] a new instance of UnpermittedParameters + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#62 + def initialize(params); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#60 + def params; end +end + +# # Action Controller UrlFor +# +# Includes `url_for` into the host class. The class has to provide a `RouteSet` +# by implementing the `_routes` method. Otherwise, an exception will be raised. +# +# In addition to AbstractController::UrlFor, this module accesses the HTTP layer +# to define URL options like the `host`. In order to do so, this module requires +# the host class to implement `env` which needs to be Rack-compatible, and +# `request` which returns an ActionDispatch::Request instance. +# +# class RootUrl +# include ActionController::UrlFor +# include Rails.application.routes.url_helpers +# +# delegate :env, :request, to: :controller +# +# def initialize(controller) +# @controller = controller +# @url = root_path # named route from the application. +# end +# end +# +# source://actionpack//lib/action_controller/metal/url_for.rb#27 +module ActionController::UrlFor + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActionDispatch::Routing::UrlFor + include ::AbstractController::UrlFor + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::AbstractController::UrlFor::ClassMethods + + # source://actionpack//lib/action_controller/metal/url_for.rb#32 + def initialize(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/metal/url_for.rb#37 + def url_options; end + + module GeneratedClassMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end + + module GeneratedInstanceMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end +end + +# source://actionpack//lib/action_controller/metal/exceptions.rb#27 +class ActionController::UrlGenerationError < ::ActionController::ActionControllerError + include ::DidYouMean::Correctable + + # @return [UrlGenerationError] a new instance of UrlGenerationError + # + # source://actionpack//lib/action_controller/metal/exceptions.rb#30 + def initialize(message, routes = T.unsafe(nil), route_name = T.unsafe(nil), method_name = T.unsafe(nil)); end + + # source://actionpack//lib/action_controller/metal/exceptions.rb#41 + def corrections; end + + # Returns the value of attribute method_name. + # + # source://actionpack//lib/action_controller/metal/exceptions.rb#28 + def method_name; end + + # Returns the value of attribute route_name. + # + # source://actionpack//lib/action_controller/metal/exceptions.rb#28 + def route_name; end + + # Returns the value of attribute routes. + # + # source://actionpack//lib/action_controller/metal/exceptions.rb#28 + def routes; end +end + +# # Action Dispatch +# +# Action Dispatch is a module of Action Pack. +# +# Action Dispatch parses information about the web request, handles routing as +# defined by the user, and does advanced processing related to HTTP such as +# MIME-type negotiation, decoding parameters in POST, PATCH, or PUT bodies, +# handling HTTP caching logic, cookies and sessions. +# +# source://actionpack//lib/action_dispatch/deprecator.rb#5 +module ActionDispatch + extend ::ActiveSupport::Autoload + + # source://actionpack//lib/action_dispatch.rb#149 + def eager_load!; end + + # source://actionpack//lib/action_dispatch.rb#127 + def test_app; end + + # source://actionpack//lib/action_dispatch.rb#127 + def test_app=(val); end + + class << self + # source://actionpack//lib/action_dispatch/deprecator.rb#6 + def deprecator; end + + # source://actionpack//lib/action_dispatch.rb#127 + def test_app; end + + # source://actionpack//lib/action_dispatch.rb#127 + def test_app=(val); end + + # source://actionpack//lib/action_dispatch.rb#146 + def verbose_redirect_logs; end + + # source://actionpack//lib/action_dispatch.rb#146 + def verbose_redirect_logs=(_arg0); end + end +end + +# source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#9 +class ActionDispatch::ActionableExceptions + # @return [ActionableExceptions] a new instance of ActionableExceptions + # + # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#12 + def initialize(app); end + + # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#16 + def call(env); end + + # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#10 + def endpoint; end + + # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#10 + def endpoint=(val); end + + private + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#26 + def actionable_request?(request); end + + # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#30 + def redirect_to(location); end + + class << self + # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#10 + def endpoint; end + + # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#10 + def endpoint=(val); end + end +end + +# This is a class that abstracts away an asserted response. It purposely does +# not inherit from Response because it doesn't need it. That means it does not +# have headers or a body. +# +# source://actionpack//lib/action_dispatch/testing/assertion_response.rb#9 +class ActionDispatch::AssertionResponse + # Accepts a specific response status code as an Integer (404) or String ('404') + # or a response status range as a Symbol pseudo-code (:success, indicating any + # 200-299 status code). + # + # @raise [ArgumentError] + # @return [AssertionResponse] a new instance of AssertionResponse + # + # source://actionpack//lib/action_dispatch/testing/assertion_response.rb#22 + def initialize(code_or_name); end + + # Returns the value of attribute code. + # + # source://actionpack//lib/action_dispatch/testing/assertion_response.rb#10 + def code; end + + # source://actionpack//lib/action_dispatch/testing/assertion_response.rb#35 + def code_and_name; end + + # Returns the value of attribute name. + # + # source://actionpack//lib/action_dispatch/testing/assertion_response.rb#10 + def name; end + + private + + # source://actionpack//lib/action_dispatch/testing/assertion_response.rb#40 + def code_from_name(name); end + + # source://actionpack//lib/action_dispatch/testing/assertion_response.rb#44 + def name_from_code(code); end +end + +# source://actionpack//lib/action_dispatch/testing/assertion_response.rb#12 +ActionDispatch::AssertionResponse::GENERIC_RESPONSE_CODES = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_dispatch/testing/assertions/response.rb#6 +module ActionDispatch::Assertions + include ::ActionDispatch::Assertions::ResponseAssertions + include ::Rails::Dom::Testing::Assertions::DomAssertions + include ::Rails::Dom::Testing::Assertions::SelectorAssertions + include ::Rails::Dom::Testing::Assertions + extend ::ActiveSupport::Concern + include ::ActionDispatch::Assertions::RoutingAssertions + + mixes_in_class_methods ::ActionDispatch::Assertions::RoutingAssertions::ClassMethods + + # source://actionpack//lib/action_dispatch/testing/assertions.rb#17 + def html_document; end +end + +# A small suite of assertions that test responses from Rails applications. +# +# source://actionpack//lib/action_dispatch/testing/assertions/response.rb#8 +module ActionDispatch::Assertions::ResponseAssertions + # Asserts that the given +text+ is present somewhere in the response body. + # + # assert_in_body fixture(:name).description + # + # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#77 + def assert_in_body(text); end + + # Asserts that the given +text+ is not present anywhere in the response body. + # + # assert_not_in_body fixture(:name).description + # + # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#84 + def assert_not_in_body(text); end + + # Asserts that the response is a redirect to a URL matching the given options. + # + # # Asserts that the redirection was to the "index" action on the WeblogController + # assert_redirected_to controller: "weblog", action: "index" + # + # # Asserts that the redirection was to the named route login_url + # assert_redirected_to login_url + # + # # Asserts that the redirection was to the URL for @customer + # assert_redirected_to @customer + # + # # Asserts that the redirection matches the regular expression + # assert_redirected_to %r(\Ahttp://example.org) + # + # # Asserts that the redirection has the HTTP status code 301 (Moved + # # Permanently). + # assert_redirected_to "/some/path", status: :moved_permanently + # + # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#60 + def assert_redirected_to(url_options = T.unsafe(nil), options = T.unsafe(nil), message = T.unsafe(nil)); end + + # Asserts that the response is one of the following types: + # + # * `:success` - Status code was in the 200-299 range + # * `:redirect` - Status code was in the 300-399 range + # * `:missing` - Status code was 404 + # * `:error` - Status code was in the 500-599 range + # + # + # You can also pass an explicit status number like `assert_response(501)` or its + # symbolic equivalent `assert_response(:not_implemented)`. See + # `Rack::Utils::SYMBOL_TO_STATUS_CODE` for a full list. + # + # # Asserts that the response was a redirection + # assert_response :redirect + # + # # Asserts that the response code was status code 401 (unauthorized) + # assert_response 401 + # + # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#33 + def assert_response(type, message = T.unsafe(nil)); end + + private + + # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#129 + def code_with_name(code_or_name); end + + # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#118 + def exception_if_present; end + + # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#103 + def generate_response_message(expected, actual = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#123 + def location_if_redirected; end + + # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#94 + def normalize_argument_to_redirection(fragment); end + + # Proxy to to_param if the object will respond to it. + # + # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#90 + def parameterize(value); end + + # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#113 + def response_body_if_short; end +end + +# source://actionpack//lib/action_dispatch/testing/assertions/response.rb#9 +ActionDispatch::Assertions::ResponseAssertions::RESPONSE_PREDICATES = T.let(T.unsafe(nil), Hash) + +# Suite of assertions to test routes generated by Rails and the handling of +# requests made to them. +# +# source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#15 +module ActionDispatch::Assertions::RoutingAssertions + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionDispatch::Assertions::RoutingAssertions::ClassMethods + + # Asserts that the provided options can be used to generate the provided path. + # This is the inverse of `assert_recognizes`. The `extras` parameter is used to + # tell the request the names and values of additional request parameters that + # would be in a query string. The `message` parameter allows you to specify a + # custom error message for assertion failures. + # + # The `defaults` parameter is unused. + # + # # Asserts that the default action is generated for a route with no action + # assert_generates "/items", controller: "items", action: "index" + # + # # Tests that the list action is properly routed + # assert_generates "/items/list", controller: "items", action: "list" + # + # # Tests the generation of a route with a parameter + # assert_generates "/items/list/1", { controller: "items", action: "list", id: "1" } + # + # # Asserts that the generated route gives us our custom route + # assert_generates "changesets/12", { controller: 'scm', action: 'show_diff', revision: "12" } + # + # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#216 + def assert_generates(expected_path, options, defaults = T.unsafe(nil), extras = T.unsafe(nil), message = T.unsafe(nil)); end + + # Asserts that the routing of the given `path` was handled correctly and that + # the parsed options (given in the `expected_options` hash) match `path`. + # Basically, it asserts that Rails recognizes the route given by + # `expected_options`. + # + # Pass a hash in the second argument (`path`) to specify the request method. + # This is useful for routes requiring a specific HTTP method. The hash should + # contain a `:path` with the incoming request path and a `:method` containing + # the required HTTP verb. + # + # # Asserts that POSTing to /items will call the create action on ItemsController + # assert_recognizes({controller: 'items', action: 'create'}, {path: 'items', method: :post}) + # + # You can also pass in `extras` with a hash containing URL parameters that would + # normally be in the query string. This can be used to assert that values in the + # query string will end up in the params hash correctly. To test query strings + # you must use the extras argument because appending the query string on the + # path directly will not work. For example: + # + # # Asserts that a path of '/items/list/1?view=print' returns the correct options + # assert_recognizes({controller: 'items', action: 'list', id: '1', view: 'print'}, 'items/list/1', { view: "print" }) + # + # The `message` parameter allows you to pass in an error message that is + # displayed upon failure. + # + # # Check the default route (i.e., the index action) + # assert_recognizes({controller: 'items', action: 'index'}, 'items') + # + # # Test a specific action + # assert_recognizes({controller: 'items', action: 'list'}, 'items/list') + # + # # Test an action with a parameter + # assert_recognizes({controller: 'items', action: 'destroy', id: '1'}, 'items/destroy/1') + # + # # Test a custom route + # assert_recognizes({controller: 'items', action: 'show', id: '1'}, 'view/item1') + # + # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#176 + def assert_recognizes(expected_options, path, extras = T.unsafe(nil), msg = T.unsafe(nil)); end + + # Asserts that path and options match both ways; in other words, it verifies + # that `path` generates `options` and then that `options` generates `path`. This + # essentially combines `assert_recognizes` and `assert_generates` into one step. + # + # The `extras` hash allows you to specify options that would normally be + # provided as a query string to the action. The `message` parameter allows you + # to specify a custom error message to display upon failure. + # + # # Asserts a basic route: a controller with the default action (index) + # assert_routing '/home', controller: 'home', action: 'index' + # + # # Test a route generated with a specific controller, action, and parameter (id) + # assert_routing '/entries/show/23', controller: 'entries', action: 'show', id: 23 + # + # # Asserts a basic route (controller + default action), with an error message if it fails + # assert_routing '/store', { controller: 'store', action: 'index' }, {}, {}, 'Route for store index not generated properly' + # + # # Tests a route, providing a defaults hash + # assert_routing 'controller/action/9', {id: "9", item: "square"}, {controller: "controller", action: "action"}, {}, {item: "square"} + # + # # Tests a route with an HTTP method + # assert_routing({ method: 'put', path: '/product/321' }, { controller: "product", action: "update", id: "321" }) + # + # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#260 + def assert_routing(path, options, defaults = T.unsafe(nil), extras = T.unsafe(nil), message = T.unsafe(nil)); end + + # ROUTES TODO: These assertions should really work in an integration context + # + # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#273 + def method_missing(selector, *_arg1, **_arg2, &_arg3); end + + # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#115 + def setup; end + + # A helper to make it easier to test different route configurations. This method + # temporarily replaces @routes with a new RouteSet instance. + # + # The new instance is yielded to the passed block. Typically the block will + # create some routes using `set.draw { match ... }`: + # + # with_routing do |set| + # set.draw do + # resources :users + # end + # assert_equal "/users", users_path + # end + # + # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#133 + def with_routing(config = T.unsafe(nil), &block); end + + private + + # @yield [@routes] + # + # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#282 + def create_routes(config = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#348 + def fail_on(exception_class, message); end + + # Recognizes the route for a given path. + # + # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#314 + def recognized_request_for(path, extras = T.unsafe(nil), msg); end + + # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#306 + def reset_routes(old_routes, old_controller); end +end + +# source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#88 +module ActionDispatch::Assertions::RoutingAssertions::ClassMethods + # A helper to make it easier to test different route configurations. This method + # temporarily replaces @routes with a new RouteSet instance before each test. + # + # The new instance is yielded to the passed block. Typically the block will + # create some routes using `set.draw { match ... }`: + # + # with_routing do |set| + # set.draw do + # resources :users + # end + # end + # + # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#101 + def with_routing(&block); end +end + +# source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#18 +module ActionDispatch::Assertions::RoutingAssertions::WithIntegrationRouting + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionDispatch::Assertions::RoutingAssertions::WithIntegrationRouting::ClassMethods + + # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#40 + def with_routing(&block); end + + private + + # @yield [routes] + # + # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#58 + def create_routes; end + + # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#50 + def initialize_lazy_routes(routes); end + + # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#80 + def reset_routes(old_routes, old_routes_call_method, old_integration_session); end +end + +# source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#21 +module ActionDispatch::Assertions::RoutingAssertions::WithIntegrationRouting::ClassMethods + # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#22 + def with_routing(&block); end +end + +# # Action Dispatch AssumeSSL +# +# When proxying through a load balancer that terminates SSL, the forwarded +# request will appear as though it's HTTP instead of HTTPS to the application. +# This makes redirects and cookie security target HTTP instead of HTTPS. This +# middleware makes the server assume that the proxy already terminated SSL, and +# that the request really is HTTPS. +# +# source://actionpack//lib/action_dispatch/middleware/assume_ssl.rb#13 +class ActionDispatch::AssumeSSL + # @return [AssumeSSL] a new instance of AssumeSSL + # + # source://actionpack//lib/action_dispatch/middleware/assume_ssl.rb#14 + def initialize(app); end + + # source://actionpack//lib/action_dispatch/middleware/assume_ssl.rb#18 + def call(env); end +end + +# # Action Dispatch Callbacks +# +# Provides callbacks to be executed before and after dispatching the request. +# +# source://actionpack//lib/action_dispatch/middleware/callbacks.rb#9 +class ActionDispatch::Callbacks + include ::ActiveSupport::Callbacks + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::ActiveSupport::DescendantsTracker + + # @return [Callbacks] a new instance of Callbacks + # + # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#24 + def initialize(app); end + + # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#10 + def __callbacks; end + + # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#12 + def _call_callbacks; end + + # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#12 + def _run_call_callbacks; end + + # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#12 + def _run_call_callbacks!(&block); end + + # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#28 + def call(env); end + + class << self + # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#10 + def __callbacks; end + + # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#10 + def __callbacks=(value); end + + # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#12 + def _call_callbacks; end + + # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#12 + def _call_callbacks=(value); end + + # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#19 + def after(*args, &block); end + + # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#15 + def before(*args, &block); end + + private + + # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#10 + def __class_attr___callbacks; end + + # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#10 + def __class_attr___callbacks=(new_value); end + end +end + +# source://actionpack//lib/action_dispatch/constants.rb#8 +module ActionDispatch::Constants; end + +# source://actionpack//lib/action_dispatch/constants.rb#23 +ActionDispatch::Constants::CONTENT_ENCODING = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/constants.rb#24 +ActionDispatch::Constants::CONTENT_SECURITY_POLICY = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/constants.rb#25 +ActionDispatch::Constants::CONTENT_SECURITY_POLICY_REPORT_ONLY = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/constants.rb#27 +ActionDispatch::Constants::FEATURE_POLICY = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/constants.rb#26 +ActionDispatch::Constants::LOCATION = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/constants.rb#30 +ActionDispatch::Constants::SERVER_TIMING = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/constants.rb#31 +ActionDispatch::Constants::STRICT_TRANSPORT_SECURITY = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/constants.rb#37 +ActionDispatch::Constants::UNPROCESSABLE_CONTENT = T.let(T.unsafe(nil), Symbol) + +# source://actionpack//lib/action_dispatch/constants.rb#22 +ActionDispatch::Constants::VARY = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/constants.rb#29 +ActionDispatch::Constants::X_CASCADE = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/constants.rb#28 +ActionDispatch::Constants::X_REQUEST_ID = T.let(T.unsafe(nil), String) + +# # Action Dispatch Content Security Policy +# +# Configures the HTTP [Content-Security-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy) +# response header to help protect against XSS and +# injection attacks. +# +# Example global policy: +# +# Rails.application.config.content_security_policy do |policy| +# policy.default_src :self, :https +# policy.font_src :self, :https, :data +# policy.img_src :self, :https, :data +# policy.object_src :none +# policy.script_src :self, :https +# policy.style_src :self, :https +# +# # Specify URI for violation reports +# policy.report_uri "/csp-violation-report-endpoint" +# end +# +# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#28 +class ActionDispatch::ContentSecurityPolicy + # @return [ContentSecurityPolicy] a new instance of ContentSecurityPolicy + # @yield [_self] + # @yieldparam _self [ActionDispatch::ContentSecurityPolicy] the object that the method was called on + # + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#182 + def initialize; end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def base_uri(*sources); end + + # Specify whether to prevent the user agent from loading any assets over HTTP + # when the page uses HTTPS: + # + # policy.block_all_mixed_content + # + # Pass `false` to allow it again: + # + # policy.block_all_mixed_content false + # + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#210 + def block_all_mixed_content(enabled = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#299 + def build(context = T.unsafe(nil), nonce = T.unsafe(nil), nonce_directives = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def child_src(*sources); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def connect_src(*sources); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def default_src(*sources); end + + # Returns the value of attribute directives. + # + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#180 + def directives; end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def font_src(*sources); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def form_action(*sources); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def frame_ancestors(*sources); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def frame_src(*sources); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def img_src(*sources); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def manifest_src(*sources); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def media_src(*sources); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def object_src(*sources); end + + # Restricts the set of plugins that can be embedded: + # + # policy.plugin_types "application/x-shockwave-flash" + # + # Leave empty to allow all plugins: + # + # policy.plugin_types + # + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#226 + def plugin_types(*types); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def prefetch_src(*sources); end + + # Enable the [report-uri](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/report-uri) + # directive. Violation reports will be sent to the + # specified URI: + # + # policy.report_uri "/csp-violation-report-endpoint" + # + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#240 + def report_uri(uri); end + + # Specify asset types for which [Subresource Integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) is required: + # + # policy.require_sri_for :script, :style + # + # Leave empty to not require Subresource Integrity: + # + # policy.require_sri_for + # + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#252 + def require_sri_for(*types); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def require_trusted_types_for(*sources); end + + # Specify whether a [sandbox](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/sandbox) + # should be enabled for the requested resource: + # + # policy.sandbox + # + # Values can be passed as arguments: + # + # policy.sandbox "allow-scripts", "allow-modals" + # + # Pass `false` to disable the sandbox: + # + # policy.sandbox false + # + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#273 + def sandbox(*values); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def script_src(*sources); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def script_src_attr(*sources); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def script_src_elem(*sources); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def style_src(*sources); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def style_src_attr(*sources); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def style_src_elem(*sources); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def trusted_types(*sources); end + + # Specify whether user agents should treat any assets over HTTP as HTTPS: + # + # policy.upgrade_insecure_requests + # + # Pass `false` to disable it: + # + # policy.upgrade_insecure_requests false + # + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#291 + def upgrade_insecure_requests(enabled = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def worker_src(*sources); end + + private + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#324 + def apply_mapping(source); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#305 + def apply_mappings(sources); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#358 + def build_directive(directive, sources, context); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#330 + def build_directives(context, nonce, nonce_directives); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#386 + def hash_source?(source); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#187 + def initialize_copy(other); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#382 + def nonce_directive?(directive, nonce_directives); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#364 + def resolve_source(source, context); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#346 + def validate(directive, sources); end +end + +# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#176 +ActionDispatch::ContentSecurityPolicy::DEFAULT_NONCE_DIRECTIVES = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#149 +ActionDispatch::ContentSecurityPolicy::DIRECTIVES = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#174 +ActionDispatch::ContentSecurityPolicy::HASH_SOURCE_ALGORITHM_PREFIXES = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#29 +class ActionDispatch::ContentSecurityPolicy::InvalidDirectiveError < ::StandardError; end + +# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#128 +ActionDispatch::ContentSecurityPolicy::MAPPINGS = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#32 +class ActionDispatch::ContentSecurityPolicy::Middleware + # @return [Middleware] a new instance of Middleware + # + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#33 + def initialize(app); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#37 + def call(env); end + + private + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#59 + def header_name(request); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#67 + def policy_present?(headers); end +end + +# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#73 +module ActionDispatch::ContentSecurityPolicy::Request + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#80 + def content_security_policy; end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#84 + def content_security_policy=(policy); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#112 + def content_security_policy_nonce; end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#104 + def content_security_policy_nonce_directives; end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#108 + def content_security_policy_nonce_directives=(generator); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#96 + def content_security_policy_nonce_generator; end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#100 + def content_security_policy_nonce_generator=(generator); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#88 + def content_security_policy_report_only; end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#92 + def content_security_policy_report_only=(value); end + + private + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#123 + def generate_content_security_policy_nonce; end +end + +# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#77 +ActionDispatch::ContentSecurityPolicy::Request::NONCE = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#78 +ActionDispatch::ContentSecurityPolicy::Request::NONCE_DIRECTIVES = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#76 +ActionDispatch::ContentSecurityPolicy::Request::NONCE_GENERATOR = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#74 +ActionDispatch::ContentSecurityPolicy::Request::POLICY = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#75 +ActionDispatch::ContentSecurityPolicy::Request::POLICY_REPORT_ONLY = T.let(T.unsafe(nil), String) + +# Read and write data to cookies through ActionController::Cookies#cookies. +# +# When reading cookie data, the data is read from the HTTP request header, +# Cookie. When writing cookie data, the data is sent out in the HTTP response +# header, `Set-Cookie`. +# +# Examples of writing: +# +# # Sets a simple session cookie. +# # This cookie will be deleted when the user's browser is closed. +# cookies[:user_name] = "david" +# +# # Cookie values are String-based. Other data types need to be serialized. +# cookies[:lat_lon] = JSON.generate([47.68, -122.37]) +# +# # Sets a cookie that expires in 1 hour. +# cookies[:login] = { value: "XJ-122", expires: 1.hour } +# +# # Sets a cookie that expires at a specific time. +# cookies[:login] = { value: "XJ-122", expires: Time.utc(2020, 10, 15, 5) } +# +# # Sets a signed cookie, which prevents users from tampering with its value. +# cookies.signed[:user_id] = current_user.id +# # It can be read using the signed method. +# cookies.signed[:user_id] # => 123 +# +# # Sets an encrypted cookie value before sending it to the client which +# # prevent users from reading and tampering with its value. +# cookies.encrypted[:discount] = 45 +# # It can be read using the encrypted method. +# cookies.encrypted[:discount] # => 45 +# +# # Sets a "permanent" cookie (which expires in 20 years from now). +# cookies.permanent[:login] = "XJ-122" +# +# # You can also chain these methods: +# cookies.signed.permanent[:login] = "XJ-122" +# +# Examples of reading: +# +# cookies[:user_name] # => "david" +# cookies.size # => 2 +# JSON.parse(cookies[:lat_lon]) # => [47.68, -122.37] +# cookies.signed[:login] # => "XJ-122" +# cookies.encrypted[:discount] # => 45 +# +# Example for deleting: +# +# cookies.delete :user_name +# +# Please note that if you specify a `:domain` when setting a cookie, you must +# also specify the domain when deleting the cookie: +# +# cookies[:name] = { +# value: 'a yummy cookie', +# expires: 1.year, +# domain: 'domain.com' +# } +# +# cookies.delete(:name, domain: 'domain.com') +# +# The option symbols for setting cookies are: +# +# * `:value` - The cookie's value. +# * `:path` - The path for which this cookie applies. Defaults to the root of +# the application. +# * `:domain` - The domain for which this cookie applies so you can restrict +# to the domain level. If you use a schema like www.example.com and want to +# share session with user.example.com set `:domain` to `:all`. To support +# multiple domains, provide an array, and the first domain matching +# `request.host` will be used. Make sure to specify the `:domain` option +# with `:all` or `Array` again when deleting cookies. For more flexibility +# you can set the domain on a per-request basis by specifying `:domain` with +# a proc. +# +# domain: nil # Does not set cookie domain. (default) +# domain: :all # Allow the cookie for the top most level +# # domain and subdomains. +# domain: %w(.example.com .example.org) # Allow the cookie +# # for concrete domain names. +# domain: proc { Tenant.current.cookie_domain } # Set cookie domain dynamically +# domain: proc { |req| ".sub.#{req.host}" } # Set cookie domain dynamically based on request +# +# * `:tld_length` - When using `:domain => :all`, this option can be used to +# explicitly set the TLD length when using a short (<= 3 character) domain +# that is being interpreted as part of a TLD. For example, to share cookies +# between user1.lvh.me and user2.lvh.me, set `:tld_length` to 2. +# * `:expires` - The time at which this cookie expires, as a Time or +# ActiveSupport::Duration object. +# * `:secure` - Whether this cookie is only transmitted to HTTPS servers. +# Default is `false`. +# * `:httponly` - Whether this cookie is accessible via scripting or only +# HTTP. Defaults to `false`. +# * `:same_site` - The value of the `SameSite` cookie attribute, which +# determines how this cookie should be restricted in cross-site contexts. +# Possible values are `nil`, `:none`, `:lax`, and `:strict`. Defaults to +# `:lax`. +# +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#195 +class ActionDispatch::Cookies + # @return [Cookies] a new instance of Cookies + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#702 + def initialize(app); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#706 + def call(env); end +end + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#201 +ActionDispatch::Cookies::AUTHENTICATED_ENCRYPTED_COOKIE_SALT = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#506 +class ActionDispatch::Cookies::AbstractCookieJar + include ::ActionDispatch::Cookies::ChainedCookieJars + + # @return [AbstractCookieJar] a new instance of AbstractCookieJar + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#509 + def initialize(parent_jar); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#513 + def [](name); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#525 + def []=(name, options); end + + protected + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#537 + def request; end + + private + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#555 + def commit(name, options); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#548 + def cookie_metadata(name, options); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#540 + def expiry_options(options); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#554 + def parse(name, data, purpose: T.unsafe(nil)); end +end + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#207 +ActionDispatch::Cookies::COOKIES_DIGEST = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#208 +ActionDispatch::Cookies::COOKIES_ROTATIONS = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#209 +ActionDispatch::Cookies::COOKIES_SAME_SITE_PROTECTION = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#206 +ActionDispatch::Cookies::COOKIES_SERIALIZER = T.let(T.unsafe(nil), String) + +# Include in a cookie jar to allow chaining, e.g. `cookies.permanent.signed`. +# +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#219 +module ActionDispatch::Cookies::ChainedCookieJars + # Returns a jar that'll automatically encrypt cookie values before sending them + # to the client and will decrypt them for read. If the cookie was tampered with + # by the user (or a 3rd party), `nil` will be returned. + # + # If `config.action_dispatch.encrypted_cookie_salt` and + # `config.action_dispatch.encrypted_signed_cookie_salt` are both set, legacy + # cookies encrypted with HMAC AES-256-CBC will be transparently upgraded. + # + # This jar requires that you set a suitable secret for the verification on your + # app's `secret_key_base`. + # + # Example: + # + # cookies.encrypted[:discount] = 45 + # # => Set-Cookie: discount=DIQ7fw==--K3n//8vvnSbGq9dA--7Xh91HfLpwzbj1czhBiwOg==; path=/ + # + # cookies.encrypted[:discount] # => 45 + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#274 + def encrypted; end + + # Returns a jar that'll automatically set the assigned cookies to have an + # expiration date 20 years from now. Example: + # + # cookies.permanent[:prefers_open_id] = true + # # => Set-Cookie: prefers_open_id=true; path=/; expires=Sun, 16-Dec-2029 03:24:16 GMT + # + # This jar is only meant for writing. You'll read permanent cookies through the + # regular accessor. + # + # This jar allows chaining with the signed jar as well, so you can set + # permanent, signed cookies. Examples: + # + # cookies.permanent.signed[:remember_me] = current_user.id + # # => Set-Cookie: remember_me=BAhU--848956038e692d7046deab32b7131856ab20e14e; path=/; expires=Sun, 16-Dec-2029 03:24:16 GMT + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#234 + def permanent; end + + # Returns a jar that'll automatically generate a signed representation of cookie + # value and verify it when reading from the cookie again. This is useful for + # creating cookies with values that the user is not supposed to change. If a + # signed cookie was tampered with by the user (or a 3rd party), `nil` will be + # returned. + # + # This jar requires that you set a suitable secret for the verification on your + # app's `secret_key_base`. + # + # Example: + # + # cookies.signed[:discount] = 45 + # # => Set-Cookie: discount=BAhpMg==--2c1c6906c90a3bc4fd54a51ffb41dffa4bf6b5f7; path=/ + # + # cookies.signed[:discount] # => 45 + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#253 + def signed; end + + # Returns the `signed` or `encrypted` jar, preferring `encrypted` if + # `secret_key_base` is set. Used by ActionDispatch::Session::CookieStore to + # avoid the need to introduce new cookie stores. + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#281 + def signed_or_encrypted; end + + private + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#304 + def encrypted_cookie_cipher; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#298 + def prepare_upgrade_legacy_hmac_aes_cbc_cookies?; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#308 + def signed_cookie_digest; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#291 + def upgrade_legacy_hmac_aes_cbc_cookies?; end +end + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#313 +class ActionDispatch::Cookies::CookieJar + include ::ActionDispatch::Cookies::ChainedCookieJars + include ::Enumerable + + # @return [CookieJar] a new instance of CookieJar + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#324 + def initialize(request); end + + # Returns the value of the cookie by `name`, or `nil` if no such cookie exists. + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#345 + def [](name); end + + # Sets the cookie named `name`. The second argument may be the cookie's value or + # a hash of options as documented above. + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#379 + def []=(name, options); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#441 + def always_write_cookie; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#441 + def always_write_cookie=(val); end + + # Removes all cookies on the client machine by calling `delete` for each cookie. + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#425 + def clear(options = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#334 + def commit!; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#332 + def committed?; end + + # Removes the cookie on the client machine by setting the value to an empty + # string and the expiration date in the past. Like `[]=`, you can pass in an + # options hash to delete cookies with extra data such as a `:path`. + # + # Returns the value of the cookie, or `nil` if the cookie does not exist. + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#404 + def delete(name, options = T.unsafe(nil)); end + + # Whether the given cookie is to be deleted by this CookieJar. Like `[]=`, you + # can pass in an options hash to test if a deletion applies to a specific + # `:path`, `:domain` etc. + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#418 + def deleted?(name, options = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#340 + def each(&block); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#349 + def fetch(name, *args, &block); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#356 + def has_key?(name); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#353 + def key?(name); end + + # Returns the value of attribute request. + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#322 + def request; end + + # Returns the cookies as Hash. + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#359 + def to_hash(*_arg0); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#373 + def to_header; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#361 + def update(other_hash); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#366 + def update_cookies_from_jar; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#429 + def write(response); end + + private + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#444 + def escape(string); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#452 + def handle_options(options); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#448 + def write_cookie?(cookie); end + + class << self + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#441 + def always_write_cookie; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#441 + def always_write_cookie=(val); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#316 + def build(req, cookies); end + end +end + +# Raised when storing more than 4K of session data. +# +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#216 +class ActionDispatch::Cookies::CookieOverflow < ::StandardError; end + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#203 +ActionDispatch::Cookies::ENCRYPTED_COOKIE_CIPHER = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#199 +ActionDispatch::Cookies::ENCRYPTED_COOKIE_SALT = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#200 +ActionDispatch::Cookies::ENCRYPTED_SIGNED_COOKIE_SALT = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#650 +class ActionDispatch::Cookies::EncryptedKeyRotatingCookieJar < ::ActionDispatch::Cookies::AbstractCookieJar + include ::ActionDispatch::Cookies::SerializedCookieJars + + # @return [EncryptedKeyRotatingCookieJar] a new instance of EncryptedKeyRotatingCookieJar + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#653 + def initialize(parent_jar); end + + private + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#695 + def commit(name, options); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#687 + def parse(name, encrypted_message, purpose: T.unsafe(nil)); end +end + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#197 +ActionDispatch::Cookies::GENERATOR_KEY = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#196 +ActionDispatch::Cookies::HTTP_HEADER = T.let(T.unsafe(nil), String) + +# Cookies can typically store 4096 bytes. +# +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#213 +ActionDispatch::Cookies::MAX_COOKIE_SIZE = T.let(T.unsafe(nil), Integer) + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#558 +class ActionDispatch::Cookies::PermanentCookieJar < ::ActionDispatch::Cookies::AbstractCookieJar + private + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#560 + def commit(name, options); end +end + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#205 +ActionDispatch::Cookies::SECRET_KEY_BASE = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#204 +ActionDispatch::Cookies::SIGNED_COOKIE_DIGEST = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#198 +ActionDispatch::Cookies::SIGNED_COOKIE_SALT = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#565 +module ActionDispatch::Cookies::SerializedCookieJars + protected + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#569 + def digest; end + + private + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#612 + def check_for_overflow!(name, options); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#608 + def commit(name, options); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#594 + def parse(name, dumped, force_reserialize: T.unsafe(nil), **_arg3); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#588 + def reserialize?(dumped); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#574 + def serializer; end +end + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#566 +ActionDispatch::Cookies::SerializedCookieJars::SERIALIZER = ActiveSupport::MessageEncryptor::NullSerializer + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#621 +class ActionDispatch::Cookies::SignedKeyRotatingCookieJar < ::ActionDispatch::Cookies::AbstractCookieJar + include ::ActionDispatch::Cookies::SerializedCookieJars + + # @return [SignedKeyRotatingCookieJar] a new instance of SignedKeyRotatingCookieJar + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#624 + def initialize(parent_jar); end + + private + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#643 + def commit(name, options); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#637 + def parse(name, signed_message, purpose: T.unsafe(nil)); end +end + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#202 +ActionDispatch::Cookies::USE_AUTHENTICATED_COOKIE_ENCRYPTION = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#210 +ActionDispatch::Cookies::USE_COOKIES_WITH_METADATA = T.let(T.unsafe(nil), String) + +# # Action Dispatch DebugExceptions +# +# This middleware is responsible for logging exceptions and showing a debugging +# page in case the request is local. +# +# source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#15 +class ActionDispatch::DebugExceptions + # @return [DebugExceptions] a new instance of DebugExceptions + # + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#23 + def initialize(app, routes_app = T.unsafe(nil), response_format = T.unsafe(nil), interceptors = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#30 + def call(env); end + + private + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#206 + def api_request?(content_type); end + + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#148 + def compose_exception_message(wrapper); end + + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#118 + def create_template(request, wrapper); end + + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#50 + def invoke_interceptors(request, exception, wrapper); end + + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#180 + def log_array(logger, lines, request); end + + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#138 + def log_error(request, wrapper); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#210 + def log_rescued_responses?(request); end + + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#192 + def logger(request); end + + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#134 + def render(status, body, format); end + + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#58 + def render_exception(request, exception, wrapper); end + + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#94 + def render_for_api_request(content_type, wrapper); end + + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#80 + def render_for_browser_request(request, wrapper); end + + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#200 + def routes_inspector(exception); end + + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#196 + def stderr_logger; end + + class << self + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#16 + def interceptors; end + + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#18 + def register_interceptor(object = T.unsafe(nil), &block); end + end +end + +# # Action Dispatch DebugLocks +# +# This middleware can be used to diagnose deadlocks in the autoload interlock. +# +# To use it, insert it near the top of the middleware stack, using +# `config/application.rb`: +# +# config.middleware.insert_before Rack::Sendfile, ActionDispatch::DebugLocks +# +# After restarting the application and re-triggering the deadlock condition, the +# route `/rails/locks` will show a summary of all threads currently known to the +# interlock, which lock level they are holding or awaiting, and their current +# backtrace. +# +# Generally a deadlock will be caused by the interlock conflicting with some +# other external lock or blocking I/O call. These cannot be automatically +# identified, but should be visible in the displayed backtraces. +# +# NOTE: The formatting and content of this middleware's output is intended for +# human consumption, and should be expected to change between releases. +# +# This middleware exposes operational details of the server, with no access +# control. It should only be enabled when in use, and removed thereafter. +# +# source://actionpack//lib/action_dispatch/middleware/debug_locks.rb#29 +class ActionDispatch::DebugLocks + # @return [DebugLocks] a new instance of DebugLocks + # + # source://actionpack//lib/action_dispatch/middleware/debug_locks.rb#30 + def initialize(app, path = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/middleware/debug_locks.rb#35 + def call(env); end + + private + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/debug_locks.rb#108 + def blocked_by?(victim, blocker, all_threads); end + + # source://actionpack//lib/action_dispatch/middleware/debug_locks.rb#49 + def render_details(req); end +end + +# source://actionpack//lib/action_dispatch/middleware/debug_view.rb#11 +class ActionDispatch::DebugView < ::ActionView::Base + # @return [DebugView] a new instance of DebugView + # + # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#14 + def initialize(assigns); end + + # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#20 + def compiled_method_container; end + + # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#44 + def debug_hash(object); end + + # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#36 + def debug_headers(headers); end + + # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#24 + def debug_params(params); end + + # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#58 + def editor_url(location, line: T.unsafe(nil)); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#73 + def params_valid?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#69 + def protect_against_forgery?; end + + # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#48 + def render(*_arg0); end +end + +# source://actionpack//lib/action_dispatch/middleware/debug_view.rb#12 +ActionDispatch::DebugView::RESCUES_TEMPLATE_PATHS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#11 +class ActionDispatch::ExceptionWrapper + # @return [ExceptionWrapper] a new instance of ExceptionWrapper + # + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#51 + def initialize(backtrace_cleaner, exception); end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#102 + def actions; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#114 + def annotated_source_code; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#136 + def application_trace; end + + # Returns the value of attribute backtrace_cleaner. + # + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#49 + def backtrace_cleaner; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#90 + def corrections; end + + # Returns the value of attribute exception. + # + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#49 + def exception; end + + # Returns the value of attribute exception_class_name. + # + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#49 + def exception_class_name; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#234 + def exception_id; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#230 + def exception_inspect; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#222 + def exception_name; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#130 + def exception_trace; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#78 + def failures; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#94 + def file_name; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#140 + def framework_trace; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#144 + def full_trace; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#74 + def has_cause?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#82 + def has_corrections?; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#98 + def line_number; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#226 + def message; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#86 + def original_message; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#200 + def rescue_response?; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#12 + def rescue_responses; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#12 + def rescue_responses=(val); end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#122 + def rescue_template; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#31 + def rescue_templates; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#31 + def rescue_templates=(val); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#62 + def routing_error?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#185 + def show?(request); end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#44 + def silent_exceptions; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#44 + def silent_exceptions=(val); end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#204 + def source_extracts; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#218 + def source_to_show_id; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#126 + def status_code; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#70 + def sub_template_message; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#66 + def template_error?; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#210 + def trace_to_show; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#148 + def traces; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#106 + def unwrapped_exception; end + + # Returns the value of attribute wrapped_causes. + # + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#49 + def wrapped_causes; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#40 + def wrapper_exceptions; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#40 + def wrapper_exceptions=(val); end + + private + + # Returns the value of attribute backtrace. + # + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#258 + def backtrace; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#260 + def build_backtrace; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#283 + def causes_for(exception); end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#293 + def clean_backtrace(*args); end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#346 + def extract_file_and_line_number(trace); end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#301 + def extract_source(trace); end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#330 + def extract_source_fragment_lines(source_lines, line); end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#336 + def source_fragment(path, line); end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#289 + def wrapped_causes_for(exception, backtrace_cleaner); end + + class << self + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#12 + def rescue_responses; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#12 + def rescue_responses=(val); end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#31 + def rescue_templates; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#31 + def rescue_templates=(val); end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#44 + def silent_exceptions; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#44 + def silent_exceptions=(val); end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#181 + def status_code_for_exception(class_name); end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#40 + def wrapper_exceptions; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#40 + def wrapper_exceptions=(val); end + end +end + +# source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#239 +class ActionDispatch::ExceptionWrapper::SourceMapLocation + # @return [SourceMapLocation] a new instance of SourceMapLocation + # + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#240 + def initialize(location, template); end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#245 + def spot(exc); end +end + +# source://actionpack//lib/action_dispatch/middleware/executor.rb#8 +class ActionDispatch::Executor + # @return [Executor] a new instance of Executor + # + # source://actionpack//lib/action_dispatch/middleware/executor.rb#9 + def initialize(app, executor); end + + # source://actionpack//lib/action_dispatch/middleware/executor.rb#13 + def call(env); end +end + +# # Action Dispatch FileHandler +# +# This endpoint serves static files from disk using `Rack::Files`. +# +# URL paths are matched with static files according to expected conventions: +# `path`, `path`.html, `path`/index.html. +# +# Precompressed versions of these files are checked first. Brotli (.br) and gzip +# (.gz) files are supported. If `path`.br exists, this endpoint returns that +# +# If no matching file is found, this endpoint responds `404 Not Found`. +# +# Pass the `root` directory to search for matching files, an optional `index: +# "index"` to change the default `path`/index.html, and optional additional +# response headers. +# +# source://actionpack//lib/action_dispatch/middleware/static.rb#47 +class ActionDispatch::FileHandler + # @return [FileHandler] a new instance of FileHandler + # + # source://actionpack//lib/action_dispatch/middleware/static.rb#55 + def initialize(root, index: T.unsafe(nil), headers: T.unsafe(nil), precompressed: T.unsafe(nil), compressible_content_types: T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/middleware/static.rb#69 + def attempt(env); end + + # source://actionpack//lib/action_dispatch/middleware/static.rb#65 + def call(env); end + + private + + # source://actionpack//lib/action_dispatch/middleware/static.rb#185 + def clean_path(path_info); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/static.rb#149 + def compressible?(content_type); end + + # @yield [path, content_type || "text/plain"] + # + # source://actionpack//lib/action_dispatch/middleware/static.rb#162 + def each_candidate_filepath(path_info); end + + # source://actionpack//lib/action_dispatch/middleware/static.rb#153 + def each_precompressed_filepath(filepath); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/static.rb#144 + def file_readable?(path); end + + # Match a URI path to a static file to be served. + # + # Used by the `Static` class to negotiate a servable file in the `public/` + # directory (see Static#call). + # + # Checks for `path`, `path`.html, and `path`/index.html files, in that order, + # including .br and .gzip compressed extensions. + # + # If a matching file is found, the path and necessary response headers + # (Content-Type, Content-Encoding) are returned. + # + # source://actionpack//lib/action_dispatch/middleware/static.rb#104 + def find_file(path_info, accept_encoding:); end + + # source://actionpack//lib/action_dispatch/middleware/static.rb#80 + def serve(request, filepath, content_headers); end + + # source://actionpack//lib/action_dispatch/middleware/static.rb#112 + def try_files(filepath, content_type, accept_encoding:); end + + # source://actionpack//lib/action_dispatch/middleware/static.rb#122 + def try_precompressed_files(filepath, headers, accept_encoding:); end +end + +# `Accept-Encoding` value -> file extension +# +# source://actionpack//lib/action_dispatch/middleware/static.rb#49 +ActionDispatch::FileHandler::PRECOMPRESSED = T.let(T.unsafe(nil), Hash) + +# # Action Dispatch Flash +# +# The flash provides a way to pass temporary primitive-types (String, Array, +# Hash) between actions. Anything you place in the flash will be exposed to the +# very next action and then cleared out. This is a great way of doing notices +# and alerts, such as a create action that sets `flash[:notice] = "Post +# successfully created"` before redirecting to a display action that can then +# expose the flash to its template. Actually, that exposure is automatically +# done. +# +# class PostsController < ActionController::Base +# def create +# # save post +# flash[:notice] = "Post successfully created" +# redirect_to @post +# end +# +# def show +# # doesn't need to assign the flash notice to the template, that's done automatically +# end +# end +# +# Then in `show.html.erb`: +# +# <% if flash[:notice] %> +#
<%= flash[:notice] %>
+# <% end %> +# +# Since the `notice` and `alert` keys are a common idiom, convenience accessors +# are available: +# +# flash.alert = "You must be logged in" +# flash.notice = "Post successfully created" +# +# This example places a string in the flash. And of course, you can put as many +# as you like at a time too. If you want to pass non-primitive types, you will +# have to handle that in your application. Example: To show messages with links, +# you will have to use sanitize helper. +# +# Just remember: They'll be gone by the time the next action has been performed. +# +# See docs on the FlashHash class for more details about the flash. +# +# source://actionpack//lib/action_dispatch/middleware/flash.rb#50 +class ActionDispatch::Flash + class << self + # source://actionpack//lib/action_dispatch/middleware/flash.rb#312 + def new(app); end + end +end + +# source://actionpack//lib/action_dispatch/middleware/flash.rb#119 +class ActionDispatch::Flash::FlashHash + include ::Enumerable + + # @return [FlashHash] a new instance of FlashHash + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#149 + def initialize(flashes = T.unsafe(nil), discard = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/middleware/flash.rb#169 + def [](k); end + + # source://actionpack//lib/action_dispatch/middleware/flash.rb#163 + def []=(k, v); end + + # Convenience accessor for `flash[:alert]`. + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#280 + def alert; end + + # Convenience accessor for `flash[:alert]=`. + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#285 + def alert=(message); end + + # source://actionpack//lib/action_dispatch/middleware/flash.rb#204 + def clear; end + + # Immediately deletes the single flash entry. Use this method when you want + # remove the message within the current action. See also #discard. + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#189 + def delete(key); end + + # Marks the entire flash or a single flash entry to be discarded by the end of + # the current action: + # + # flash.discard # discard the entire flash at the end of the current action + # flash.discard(:warning) # discard only the "warning" entry at the end of the current action + # + # Use this method when you want to display the message in the current action but + # not in the next one. See also #delete. + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#264 + def discard(k = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/middleware/flash.rb#209 + def each(&block); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#200 + def empty?; end + + # Keeps either the entire current flash or a specific flash entry available for + # the next action: + # + # flash.keep # keeps the entire flash + # flash.keep(:notice) # keeps only the "notice" entry, the rest of the flash is discarded + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#250 + def keep(k = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#183 + def key?(name); end + + # source://actionpack//lib/action_dispatch/middleware/flash.rb#179 + def keys; end + + # source://actionpack//lib/action_dispatch/middleware/flash.rb#213 + def merge!(h); end + + # Convenience accessor for `flash[:notice]`. + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#290 + def notice; end + + # Convenience accessor for `flash[:notice]=`. + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#295 + def notice=(message); end + + # Sets a flash that will not be available to the next action, only to the + # current. + # + # flash.now[:message] = "Hello current action" + # + # This method enables you to use the flash as a central messaging system in your + # app. When you need to pass an object to the next action, you use the standard + # flash assign (`[]=`). When you need to pass an object to the current action, + # you use `now`, and your object will vanish when the current action is done. + # + # Entries set via `now` are accessed the same way as standard entries: + # `flash['my-key']`. + # + # Also, brings two convenience accessors: + # + # flash.now.alert = "Beware now!" + # # Equivalent to flash.now[:alert] = "Beware now!" + # + # flash.now.notice = "Good luck now!" + # # Equivalent to flash.now[:notice] = "Good luck now!" + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#241 + def now; end + + # source://actionpack//lib/action_dispatch/middleware/flash.rb#215 + def replace(h); end + + # Mark for removal entries that were kept, and delete unkept ones. + # + # This method is called automatically by filters, so you generally don't need to + # care about it. + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#274 + def sweep; end + + # source://actionpack//lib/action_dispatch/middleware/flash.rb#196 + def to_hash; end + + # Builds a hash containing the flashes to keep for the next request. If there + # are none to keep, returns `nil`. + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#143 + def to_session_value; end + + # source://actionpack//lib/action_dispatch/middleware/flash.rb#173 + def update(h); end + + protected + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#300 + def now_is_loaded?; end + + private + + # source://actionpack//lib/action_dispatch/middleware/flash.rb#155 + def initialize_copy(other); end + + # source://actionpack//lib/action_dispatch/middleware/flash.rb#305 + def stringify_array(array); end + + class << self + # source://actionpack//lib/action_dispatch/middleware/flash.rb#122 + def from_session_value(value); end + end +end + +# source://actionpack//lib/action_dispatch/middleware/flash.rb#90 +class ActionDispatch::Flash::FlashNow + # @return [FlashNow] a new instance of FlashNow + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#93 + def initialize(flash); end + + # source://actionpack//lib/action_dispatch/middleware/flash.rb#104 + def [](k); end + + # source://actionpack//lib/action_dispatch/middleware/flash.rb#97 + def []=(k, v); end + + # Convenience accessor for `flash.now[:alert]=`. + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#109 + def alert=(message); end + + # Returns the value of attribute flash. + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#91 + def flash; end + + # Sets the attribute flash + # + # @param value the value to set the attribute flash to. + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#91 + def flash=(_arg0); end + + # Convenience accessor for `flash.now[:notice]=`. + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#114 + def notice=(message); end +end + +# source://actionpack//lib/action_dispatch/middleware/flash.rb#51 +ActionDispatch::Flash::KEY = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/middleware/flash.rb#53 +module ActionDispatch::Flash::RequestMethods + # source://actionpack//lib/action_dispatch/middleware/flash.rb#71 + def commit_flash; end + + # Access the contents of the flash. Returns a ActionDispatch::Flash::FlashHash. + # + # See ActionDispatch::Flash for example usage. + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#57 + def flash; end + + # source://actionpack//lib/action_dispatch/middleware/flash.rb#63 + def flash=(flash); end + + # source://actionpack//lib/action_dispatch/middleware/flash.rb#67 + def flash_hash; end + + # source://actionpack//lib/action_dispatch/middleware/flash.rb#84 + def reset_session; end +end + +# # Action Dispatch HostAuthorization +# +# This middleware guards from DNS rebinding attacks by explicitly permitting the +# hosts a request can be sent to, and is passed the options set in +# `config.host_authorization`. +# +# Requests can opt-out of Host Authorization with `exclude`: +# +# config.host_authorization = { exclude: ->(request) { request.path =~ /healthcheck/ } } +# +# When a request comes to an unauthorized host, the `response_app` application +# will be executed and rendered. If no `response_app` is given, a default one +# will run. The default response app logs blocked host info with level 'error' +# and responds with `403 Forbidden`. The body of the response contains debug +# info if `config.consider_all_requests_local` is set to true, otherwise the +# body is empty. +# +# source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#22 +class ActionDispatch::HostAuthorization + # @return [HostAuthorization] a new instance of HostAuthorization + # + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#127 + def initialize(app, hosts, exclude: T.unsafe(nil), response_app: T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#135 + def call(env); end + + private + + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#151 + def blocked_hosts(request); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#163 + def excluded?(request); end + + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#167 + def mark_as_authorized(request); end +end + +# source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#23 +ActionDispatch::HostAuthorization::ALLOWED_HOSTS_IN_DEVELOPMENT = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#88 +class ActionDispatch::HostAuthorization::DefaultResponseApp + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#91 + def call(env); end + + private + + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#122 + def available_logger(request); end + + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#114 + def log_error(request); end + + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#107 + def response(format, body); end + + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#100 + def response_body(request); end +end + +# source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#89 +ActionDispatch::HostAuthorization::DefaultResponseApp::RESPONSE_STATUS = T.let(T.unsafe(nil), Integer) + +# source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#26 +ActionDispatch::HostAuthorization::IPV4_HOSTNAME = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#27 +ActionDispatch::HostAuthorization::IPV6_HOSTNAME = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#28 +ActionDispatch::HostAuthorization::IPV6_HOSTNAME_WITH_PORT = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#24 +ActionDispatch::HostAuthorization::PORT_REGEX = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#35 +class ActionDispatch::HostAuthorization::Permissions + # @return [Permissions] a new instance of Permissions + # + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#36 + def initialize(hosts); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#44 + def allows?(host); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#40 + def empty?; end + + private + + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#83 + def extract_hostname(host); end + + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#61 + def sanitize_hosts(hosts); end + + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#71 + def sanitize_regexp(host); end + + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#75 + def sanitize_string(host); end +end + +# source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#25 +ActionDispatch::HostAuthorization::SUBDOMAIN_REGEX = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#29 +ActionDispatch::HostAuthorization::VALID_IP_HOSTNAME = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch.rb#95 +module ActionDispatch::Http + extend ::ActiveSupport::Autoload +end + +# source://actionpack//lib/action_dispatch/http/cache.rb#7 +module ActionDispatch::Http::Cache; end + +# source://actionpack//lib/action_dispatch/http/cache.rb#8 +module ActionDispatch::Http::Cache::Request + # source://actionpack//lib/action_dispatch/http/cache.rb#67 + def cache_control_directives; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/cache.rb#32 + def etag_matches?(etag); end + + # Check response freshness (`Last-Modified` and `ETag`) against request + # `If-Modified-Since` and `If-None-Match` conditions. + # If both headers are supplied, based on configuration, either `ETag` is preferred over `Last-Modified` + # or both are considered equally. You can adjust the preference with + # `config.action_dispatch.strict_freshness`. + # Reference: http://tools.ietf.org/html/rfc7232#section-6 + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/cache.rb#45 + def fresh?(response); end + + # source://actionpack//lib/action_dispatch/http/cache.rb#14 + def if_modified_since; end + + # source://actionpack//lib/action_dispatch/http/cache.rb#20 + def if_none_match; end + + # source://actionpack//lib/action_dispatch/http/cache.rb#24 + def if_none_match_etags; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/cache.rb#28 + def not_modified?(modified_at); end + + # source://actionpack//lib/action_dispatch/http/cache.rb#12 + def strict_freshness; end + + # source://actionpack//lib/action_dispatch/http/cache.rb#12 + def strict_freshness=(val); end + + class << self + # source://actionpack//lib/action_dispatch/http/cache.rb#12 + def strict_freshness; end + + # source://actionpack//lib/action_dispatch/http/cache.rb#12 + def strict_freshness=(val); end + end +end + +# Represents the HTTP Cache-Control header for requests, +# providing methods to access various cache control directives +# Reference: https://www.rfc-editor.org/rfc/rfc9111.html#name-request-directives +# +# source://actionpack//lib/action_dispatch/http/cache.rb#74 +class ActionDispatch::Http::Cache::Request::CacheControlDirectives + # @return [CacheControlDirectives] a new instance of CacheControlDirectives + # + # source://actionpack//lib/action_dispatch/http/cache.rb#75 + def initialize(cache_control_header); end + + # Returns the value of the max-age directive. + # This directive indicates that the client is willing to accept a response + # whose age is no greater than the specified number of seconds. + # + # source://actionpack//lib/action_dispatch/http/cache.rb#118 + def max_age; end + + # Returns the value of the max-stale directive. + # When max-stale is present with a value, returns that integer value. + # When max-stale is present without a value, returns true (unlimited staleness). + # When max-stale is not present, returns nil. + # + # source://actionpack//lib/action_dispatch/http/cache.rb#124 + def max_stale; end + + # Returns true if max-stale directive is present (with or without a value) + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/cache.rb#127 + def max_stale?; end + + # Returns true if max-stale directive is present without a value (unlimited staleness) + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/cache.rb#132 + def max_stale_unlimited?; end + + # Returns the value of the min-fresh directive. + # This directive indicates that the client is willing to accept a response + # whose freshness lifetime is no less than its current age plus the specified time in seconds. + # + # source://actionpack//lib/action_dispatch/http/cache.rb#139 + def min_fresh; end + + # Returns true if the no-cache directive is present. + # This directive indicates that a cache must not use the response + # to satisfy subsequent requests without successful validation on the origin server. + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/cache.rb#98 + def no_cache?; end + + # Returns true if the no-store directive is present. + # This directive indicates that a cache must not store any part of the + # request or response. + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/cache.rb#105 + def no_store?; end + + # Returns true if the no-transform directive is present. + # This directive indicates that a cache or proxy must not transform the payload. + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/cache.rb#111 + def no_transform?; end + + # Returns true if the only-if-cached directive is present. + # This directive indicates that the client only wishes to obtain a + # stored response. If a valid stored response is not available, + # the server should respond with a 504 (Gateway Timeout) status. + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/cache.rb#91 + def only_if_cached?; end + + # Returns the value of the stale-if-error directive. + # This directive indicates that the client is willing to accept a stale response + # if the check for a fresh one fails with an error for the specified number of seconds. + # + # source://actionpack//lib/action_dispatch/http/cache.rb#144 + def stale_if_error; end + + private + + # source://actionpack//lib/action_dispatch/http/cache.rb#147 + def parse_directives(header_value); end +end + +# source://actionpack//lib/action_dispatch/http/cache.rb#9 +ActionDispatch::Http::Cache::Request::HTTP_IF_MODIFIED_SINCE = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/cache.rb#10 +ActionDispatch::Http::Cache::Request::HTTP_IF_NONE_MATCH = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/cache.rb#176 +module ActionDispatch::Http::Cache::Response + # Returns the value of attribute cache_control. + # + # source://actionpack//lib/action_dispatch/http/cache.rb#177 + def cache_control; end + + # source://actionpack//lib/action_dispatch/http/cache.rb#193 + def date; end + + # source://actionpack//lib/action_dispatch/http/cache.rb#203 + def date=(utc_time); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/cache.rb#199 + def date?; end + + # This method sets a weak ETag validator on the response so browsers and proxies + # may cache the response, keyed on the ETag. On subsequent requests, the + # `If-None-Match` header is set to the cached ETag. If it matches the current + # ETag, we can return a `304 Not Modified` response with no body, letting the + # browser or proxy know that their cache is current. Big savings in request time + # and network bandwidth. + # + # Weak ETags are considered to be semantically equivalent but not byte-for-byte + # identical. This is perfect for browser caching of HTML pages where we don't + # care about exact equality, just what the user is viewing. + # + # Strong ETags are considered byte-for-byte identical. They allow a browser or + # proxy cache to support `Range` requests, useful for paging through a PDF file + # or scrubbing through a video. Some CDNs only support strong ETags and will + # ignore weak ETags entirely. + # + # Weak ETags are what we almost always need, so they're the default. Check out + # #strong_etag= to provide a strong ETag validator. + # + # source://actionpack//lib/action_dispatch/http/cache.rb#225 + def etag=(weak_validators); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/cache.rb#237 + def etag?; end + + # source://actionpack//lib/action_dispatch/http/cache.rb#179 + def last_modified; end + + # source://actionpack//lib/action_dispatch/http/cache.rb#189 + def last_modified=(utc_time); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/cache.rb#185 + def last_modified?; end + + # source://actionpack//lib/action_dispatch/http/cache.rb#233 + def strong_etag=(strong_validators); end + + # True if an ETag is set, and it isn't a weak validator (not preceded with + # `W/`). + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/cache.rb#246 + def strong_etag?; end + + # source://actionpack//lib/action_dispatch/http/cache.rb#229 + def weak_etag=(weak_validators); end + + # True if an ETag is set, and it's a weak validator (preceded with `W/`). + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/cache.rb#240 + def weak_etag?; end + + private + + # source://actionpack//lib/action_dispatch/http/cache.rb#269 + def cache_control_headers; end + + # source://actionpack//lib/action_dispatch/http/cache.rb#263 + def cache_control_segments; end + + # source://actionpack//lib/action_dispatch/http/cache.rb#259 + def generate_strong_etag(validators); end + + # source://actionpack//lib/action_dispatch/http/cache.rb#255 + def generate_weak_etag(validators); end + + # source://actionpack//lib/action_dispatch/http/cache.rb#300 + def handle_conditional_get!; end + + # source://actionpack//lib/action_dispatch/http/cache.rb#309 + def merge_and_normalize_cache_control!(cache_control); end + + # source://actionpack//lib/action_dispatch/http/cache.rb#287 + def prepare_cache_control!; end +end + +# source://actionpack//lib/action_dispatch/http/cache.rb#251 +ActionDispatch::Http::Cache::Response::DATE = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/cache.rb#291 +ActionDispatch::Http::Cache::Response::DEFAULT_CACHE_CONTROL = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/cache.rb#297 +ActionDispatch::Http::Cache::Response::IMMUTABLE = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/cache.rb#252 +ActionDispatch::Http::Cache::Response::LAST_MODIFIED = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/cache.rb#296 +ActionDispatch::Http::Cache::Response::MUST_REVALIDATE = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/cache.rb#298 +ActionDispatch::Http::Cache::Response::MUST_UNDERSTAND = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/cache.rb#293 +ActionDispatch::Http::Cache::Response::NO_CACHE = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/cache.rb#292 +ActionDispatch::Http::Cache::Response::NO_STORE = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/cache.rb#295 +ActionDispatch::Http::Cache::Response::PRIVATE = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/cache.rb#294 +ActionDispatch::Http::Cache::Response::PUBLIC = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/cache.rb#253 +ActionDispatch::Http::Cache::Response::SPECIAL_KEYS = T.let(T.unsafe(nil), Set) + +# source://actionpack//lib/action_dispatch/http/content_disposition.rb#7 +class ActionDispatch::Http::ContentDisposition + # @return [ContentDisposition] a new instance of ContentDisposition + # + # source://actionpack//lib/action_dispatch/http/content_disposition.rb#14 + def initialize(disposition:, filename:); end + + # source://actionpack//lib/action_dispatch/http/content_disposition.rb#21 + def ascii_filename; end + + # Returns the value of attribute disposition. + # + # source://actionpack//lib/action_dispatch/http/content_disposition.rb#12 + def disposition; end + + # Returns the value of attribute filename. + # + # source://actionpack//lib/action_dispatch/http/content_disposition.rb#12 + def filename; end + + # source://actionpack//lib/action_dispatch/http/content_disposition.rb#31 + def to_s; end + + # source://actionpack//lib/action_dispatch/http/content_disposition.rb#27 + def utf8_filename; end + + private + + # source://actionpack//lib/action_dispatch/http/content_disposition.rb#40 + def percent_escape(string, pattern); end + + class << self + # source://actionpack//lib/action_dispatch/http/content_disposition.rb#8 + def format(disposition:, filename:); end + end +end + +# source://actionpack//lib/action_dispatch/http/content_disposition.rb#25 +ActionDispatch::Http::ContentDisposition::RFC_5987_ESCAPED_CHAR = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/http/content_disposition.rb#19 +ActionDispatch::Http::ContentDisposition::TRADITIONAL_ESCAPED_CHAR = T.let(T.unsafe(nil), Regexp) + +# # Action Dispatch HTTP Filter Parameters +# +# Allows you to specify sensitive query string and POST parameters to filter +# from the request log. +# +# # Replaces values with "[FILTERED]" for keys that match /foo|bar/i. +# env["action_dispatch.parameter_filter"] = [:foo, "bar"] +# +# For more information about filter behavior, see +# ActiveSupport::ParameterFilter. +# +# source://actionpack//lib/action_dispatch/http/filter_parameters.rb#19 +module ActionDispatch::Http::FilterParameters + # :startdoc: + # + # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#26 + def initialize; end + + # Returns a hash of request.env with all sensitive data replaced. + # + # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#42 + def filtered_env; end + + # Returns a hash of parameters with all sensitive data replaced. + # + # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#35 + def filtered_parameters; end + + # Reconstructs a path with all sensitive GET parameters replaced. + # + # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#47 + def filtered_path; end + + # Returns the `ActiveSupport::ParameterFilter` object used to filter in this + # request. + # + # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#53 + def parameter_filter; end + + private + + # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#62 + def env_filter; end + + # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#73 + def filtered_query_string; end + + # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#69 + def parameter_filter_for(filters); end +end + +# :stopdoc: +# +# source://actionpack//lib/action_dispatch/http/filter_parameters.rb#21 +ActionDispatch::Http::FilterParameters::ENV_MATCH = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/http/filter_parameters.rb#23 +ActionDispatch::Http::FilterParameters::NULL_ENV_FILTER = T.let(T.unsafe(nil), ActiveSupport::ParameterFilter) + +# source://actionpack//lib/action_dispatch/http/filter_parameters.rb#22 +ActionDispatch::Http::FilterParameters::NULL_PARAM_FILTER = T.let(T.unsafe(nil), ActiveSupport::ParameterFilter) + +# source://actionpack//lib/action_dispatch/http/filter_redirect.rb#7 +module ActionDispatch::Http::FilterRedirect + # source://actionpack//lib/action_dispatch/http/filter_redirect.rb#10 + def filtered_location; end + + private + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/filter_redirect.rb#27 + def location_filter_match?; end + + # source://actionpack//lib/action_dispatch/http/filter_redirect.rb#19 + def location_filters; end + + # source://actionpack//lib/action_dispatch/http/filter_redirect.rb#37 + def parameter_filtered_location; end +end + +# source://actionpack//lib/action_dispatch/http/filter_redirect.rb#8 +ActionDispatch::Http::FilterRedirect::FILTERED = T.let(T.unsafe(nil), String) + +# # Action Dispatch HTTP Headers +# +# Provides access to the request's HTTP headers from the environment. +# +# env = { "CONTENT_TYPE" => "text/plain", "HTTP_USER_AGENT" => "curl/7.43.0" } +# headers = ActionDispatch::Http::Headers.from_hash(env) +# headers["Content-Type"] # => "text/plain" +# headers["User-Agent"] # => "curl/7.43.0" +# +# Also note that when headers are mapped to CGI-like variables by the Rack +# server, both dashes and underscores are converted to underscores. This +# ambiguity cannot be resolved at this stage anymore. Both underscores and +# dashes have to be interpreted as if they were originally sent as dashes. +# +# # GET / HTTP/1.1 +# # ... +# # User-Agent: curl/7.43.0 +# # X_Custom_Header: token +# +# headers["X_Custom_Header"] # => nil +# headers["X-Custom-Header"] # => "token" +# +# source://actionpack//lib/action_dispatch/http/headers.rb#28 +class ActionDispatch::Http::Headers + include ::Enumerable + + # @return [Headers] a new instance of Headers + # + # source://actionpack//lib/action_dispatch/http/headers.rb#58 + def initialize(request); end + + # Returns the value for the given key mapped to @env. + # + # source://actionpack//lib/action_dispatch/http/headers.rb#63 + def [](key); end + + # Sets the given value for the key mapped to @env. + # + # source://actionpack//lib/action_dispatch/http/headers.rb#68 + def []=(key, value); end + + # Add a value to a multivalued header like `Vary` or `Accept-Encoding`. + # + # source://actionpack//lib/action_dispatch/http/headers.rb#73 + def add(key, value); end + + # source://actionpack//lib/action_dispatch/http/headers.rb#98 + def each(&block); end + + # source://actionpack//lib/action_dispatch/http/headers.rb#118 + def env; end + + # Returns the value for the given key mapped to @env. + # + # If the key is not found and an optional code block is not provided, raises a + # `KeyError` exception. + # + # If the code block is provided, then it will be run and its result returned. + # + # source://actionpack//lib/action_dispatch/http/headers.rb#90 + def fetch(key, default = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/headers.rb#80 + def include?(key); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/headers.rb#77 + def key?(key); end + + # Returns a new Http::Headers instance containing the contents of + # `headers_or_env` and the original instance. + # + # source://actionpack//lib/action_dispatch/http/headers.rb#104 + def merge(headers_or_env); end + + # Adds the contents of `headers_or_env` to original instance entries; duplicate + # keys are overwritten with the values from `headers_or_env`. + # + # source://actionpack//lib/action_dispatch/http/headers.rb#112 + def merge!(headers_or_env); end + + private + + # Converts an HTTP header name to an environment variable name if it is not + # contained within the headers hash. + # + # source://actionpack//lib/action_dispatch/http/headers.rb#123 + def env_name(key); end + + class << self + # source://actionpack//lib/action_dispatch/http/headers.rb#54 + def from_hash(hash); end + end +end + +# source://actionpack//lib/action_dispatch/http/headers.rb#29 +ActionDispatch::Http::Headers::CGI_VARIABLES = T.let(T.unsafe(nil), Set) + +# source://actionpack//lib/action_dispatch/http/headers.rb#82 +ActionDispatch::Http::Headers::DEFAULT = T.let(T.unsafe(nil), Object) + +# source://actionpack//lib/action_dispatch/http/headers.rb#50 +ActionDispatch::Http::Headers::HTTP_HEADER = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#9 +module ActionDispatch::Http::MimeNegotiation + extend ::ActiveSupport::Concern + + # Returns the accepted MIME type for the request. + # + # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#42 + def accepts; end + + # The MIME type of the HTTP request, such as [Mime](:xml). + # + # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#24 + def content_mime_type; end + + # Returns the MIME type for the format used in the request. + # + # # GET /posts/5.xml + # request.format # => Mime[:xml] + # + # # GET /posts/5.xhtml + # request.format # => Mime[:html] + # + # # GET /posts/5 + # request.format # => Mime[:html] or Mime[:js], or request.accepts.first + # + # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#68 + def format(_view_path = T.unsafe(nil)); end + + # Sets the format by string extension, which can be used to force custom formats + # that are not controlled by the extension. + # + # class ApplicationController < ActionController::Base + # before_action :adjust_format_for_iphone + # + # private + # def adjust_format_for_iphone + # request.format = :iphone if request.env["HTTP_USER_AGENT"][/iPhone/] + # end + # end + # + # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#174 + def format=(extension); end + + # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#72 + def formats; end + + # Sets the formats by string extensions. This differs from #format= by allowing + # you to set multiple, ordered formats, which is useful when you want to have a + # fallback. + # + # In this example, the `:iphone` format will be used if it's available, + # otherwise it'll fall back to the `:html` format. + # + # class ApplicationController < ActionController::Base + # before_action :adjust_format_for_iphone_with_html_fallback + # + # private + # def adjust_format_for_iphone_with_html_fallback + # request.formats = [ :iphone, :html ] if request.env["HTTP_USER_AGENT"][/iPhone/] + # end + # end + # + # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#194 + def formats=(extensions); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#37 + def has_content_type?; end + + # Returns the first MIME type that matches the provided array of MIME types. + # + # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#202 + def negotiate_mime(order); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#214 + def should_apply_vary_header?; end + + # Returns the \variant for the response template as an instance of + # ActiveSupport::ArrayInquirer. + # + # request.variant = :phone + # request.variant.phone? # => true + # request.variant.tablet? # => false + # + # request.variant = [:phone, :tablet] + # request.variant.phone? # => true + # request.variant.desktop? # => false + # request.variant.any?(:phone, :desktop) # => true + # request.variant.any?(:desktop, :watch) # => false + # + # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#159 + def variant; end + + # Sets the \variant for the response template. + # + # When determining which template to render, Action View will incorporate + # all variants from the request. For example, if an + # `ArticlesController#index` action needs to respond to + # `request.variant = [:ios, :turbo_native]`, it will render the + # first template file it can find in the following list: + # + # - `app/views/articles/index.html+ios.erb` + # - `app/views/articles/index.html+turbo_native.erb` + # - `app/views/articles/index.html.erb` + # + # Variants add context to the requests that views render appropriately. + # Variant names are arbitrary, and can communicate anything from the + # request's platform (`:android`, `:ios`, `:linux`, `:macos`, `:windows`) + # to its browser (`:chrome`, `:edge`, `:firefox`, `:safari`), to the type + # of user (`:admin`, `:guest`, `:user`). + # + # Note: Adding many new variant templates with similarities to existing + # template files can make maintaining your view code more difficult. + # + # #### Parameters + # + # * `variant` - a symbol name or an array of symbol names for variants + # used to render the response template + # + # #### Examples + # + # class ApplicationController < ActionController::Base + # before_action :determine_variants + # + # private + # def determine_variants + # variants = [] + # + # # some code to determine the variant(s) to use + # + # variants << :ios if request.user_agent.include?("iOS") + # variants << :turbo_native if request.user_agent.include?("Turbo Native") + # + # request.variant = variants + # end + # end + # + # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#137 + def variant=(variant); end + + private + + # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#238 + def format_from_path_extension; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#223 + def params_readable?; end + + # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#234 + def use_accept_header; end + + # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#229 + def valid_accept_header; end +end + +# We use normal content negotiation unless you include **/** in your list, in +# which case we assume you're a browser and send HTML. +# +# source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#221 +ActionDispatch::Http::MimeNegotiation::BROWSER_LIKE_ACCEPTS = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#12 +class ActionDispatch::Http::MimeNegotiation::InvalidType < ::Mime::Type::InvalidMimeType; end + +# source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#14 +ActionDispatch::Http::MimeNegotiation::RESCUABLE_MIME_FORMAT_ERRORS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/http/parameters.rb#7 +module ActionDispatch::Http::Parameters + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionDispatch::Http::Parameters::ClassMethods + + # Returns both GET and POST parameters in a single hash. + # + # source://actionpack//lib/action_dispatch/http/parameters.rb#52 + def parameters; end + + # Returns both GET and POST parameters in a single hash. + # + # source://actionpack//lib/action_dispatch/http/parameters.rb#65 + def params; end + + # Returns a hash with the parameters used to form the path of the request. + # Returned hash keys are symbols: + # + # { action: "my_action", controller: "my_controller" } + # + # source://actionpack//lib/action_dispatch/http/parameters.rb#84 + def path_parameters; end + + # source://actionpack//lib/action_dispatch/http/parameters.rb#67 + def path_parameters=(parameters); end + + private + + # source://actionpack//lib/action_dispatch/http/parameters.rb#102 + def log_parse_error_once; end + + # source://actionpack//lib/action_dispatch/http/parameters.rb#114 + def params_parsers; end + + # source://actionpack//lib/action_dispatch/http/parameters.rb#89 + def parse_formatted_parameters(parsers); end +end + +# source://actionpack//lib/action_dispatch/http/parameters.rb#36 +module ActionDispatch::Http::Parameters::ClassMethods + # Configure the parameter parser for a given MIME type. + # + # It accepts a hash where the key is the symbol of the MIME type and the value + # is a proc. + # + # original_parsers = ActionDispatch::Request.parameter_parsers + # xml_parser = -> (raw_post) { Hash.from_xml(raw_post) || {} } + # new_parsers = original_parsers.merge(xml: xml_parser) + # ActionDispatch::Request.parameter_parsers = new_parsers + # + # source://actionpack//lib/action_dispatch/http/parameters.rb#46 + def parameter_parsers=(parsers); end +end + +# source://actionpack//lib/action_dispatch/http/parameters.rb#12 +ActionDispatch::Http::Parameters::DEFAULT_PARSERS = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_dispatch/http/parameters.rb#10 +ActionDispatch::Http::Parameters::PARAMETERS_KEY = T.let(T.unsafe(nil), String) + +# Raised when raw data from the request cannot be parsed by the parser defined +# for request's content MIME type. +# +# source://actionpack//lib/action_dispatch/http/parameters.rb#21 +class ActionDispatch::Http::Parameters::ParseError < ::StandardError + # @return [ParseError] a new instance of ParseError + # + # source://actionpack//lib/action_dispatch/http/parameters.rb#22 + def initialize(message = T.unsafe(nil)); end +end + +# source://actionpack//lib/action_dispatch/http/url.rb#9 +module ActionDispatch::Http::URL + # source://actionpack//lib/action_dispatch/http/url.rb#277 + def initialize; end + + # Returns the domain part of a host, such as "rubyonrails.org" in + # "www.rubyonrails.org". You can specify a different `tld_length`, such as 2 to + # catch rubyonrails.co.uk in "www.rubyonrails.co.uk". + # + # source://actionpack//lib/action_dispatch/http/url.rb#420 + def domain(tld_length = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/http/url.rb#112 + def domain_extractor; end + + # source://actionpack//lib/action_dispatch/http/url.rb#112 + def domain_extractor=(val); end + + # Returns the host for this request, such as "example.com". + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' + # req.host # => "example.com" + # + # source://actionpack//lib/action_dispatch/http/url.rb#324 + def host; end + + # Returns a host:port string for this request, such as "example.com" or + # "example.com:8080". Port is only included if it is not a default port (80 or + # 443) + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com' + # req.host_with_port # => "example.com" + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:80' + # req.host_with_port # => "example.com" + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' + # req.host_with_port # => "example.com:8080" + # + # source://actionpack//lib/action_dispatch/http/url.rb#340 + def host_with_port; end + + # Returns a number port suffix like 8080 if the port number of this request is + # not the default HTTP port 80 or HTTPS port 443. + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:80' + # req.optional_port # => nil + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' + # req.optional_port # => 8080 + # + # source://actionpack//lib/action_dispatch/http/url.rb#390 + def optional_port; end + + # Returns the port number of this request as an integer. + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com' + # req.port # => 80 + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' + # req.port # => 8080 + # + # source://actionpack//lib/action_dispatch/http/url.rb#351 + def port; end + + # Returns a string port suffix, including colon, like ":8080" if the port number + # of this request is not the default HTTP port 80 or HTTPS port 443. + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:80' + # req.port_string # => "" + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' + # req.port_string # => ":8080" + # + # source://actionpack//lib/action_dispatch/http/url.rb#402 + def port_string; end + + # Returns 'https://' if this is an SSL request and 'http://' otherwise. + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com' + # req.protocol # => "http://" + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com', 'HTTPS' => 'on' + # req.protocol # => "https://" + # + # source://actionpack//lib/action_dispatch/http/url.rb#298 + def protocol; end + + # Returns the host and port for this request, such as "example.com:8080". + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com' + # req.raw_host_with_port # => "example.com" + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:80' + # req.raw_host_with_port # => "example.com:80" + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' + # req.raw_host_with_port # => "example.com:8080" + # + # source://actionpack//lib/action_dispatch/http/url.rb#312 + def raw_host_with_port; end + + # source://actionpack//lib/action_dispatch/http/url.rb#110 + def secure_protocol; end + + # source://actionpack//lib/action_dispatch/http/url.rb#110 + def secure_protocol=(val); end + + # Returns the requested port, such as 8080, based on SERVER_PORT. + # + # req = ActionDispatch::Request.new 'SERVER_PORT' => '80' + # req.server_port # => 80 + # + # req = ActionDispatch::Request.new 'SERVER_PORT' => '8080' + # req.server_port # => 8080 + # + # source://actionpack//lib/action_dispatch/http/url.rb#413 + def server_port; end + + # Returns the standard port number for this request's protocol. + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' + # req.standard_port # => 80 + # + # source://actionpack//lib/action_dispatch/http/url.rb#363 + def standard_port; end + + # Returns whether this request is using the standard port. + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:80' + # req.standard_port? # => true + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' + # req.standard_port? # => false + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/url.rb#378 + def standard_port?; end + + # Returns all the subdomains as a string, so `"dev.www"` would be returned for + # "dev.www.rubyonrails.org". You can specify a different `tld_length`, such as 2 + # to catch `"www"` instead of `"www.rubyonrails"` in "www.rubyonrails.co.uk". + # + # source://actionpack//lib/action_dispatch/http/url.rb#435 + def subdomain(tld_length = T.unsafe(nil)); end + + # Returns all the subdomains as an array, so `["dev", "www"]` would be returned + # for "dev.www.rubyonrails.org". You can specify a different `tld_length`, such + # as 2 to catch `["www"]` instead of `["www", "rubyonrails"]` in + # "www.rubyonrails.co.uk". + # + # source://actionpack//lib/action_dispatch/http/url.rb#428 + def subdomains(tld_length = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/http/url.rb#111 + def tld_length; end + + # source://actionpack//lib/action_dispatch/http/url.rb#111 + def tld_length=(val); end + + # Returns the complete URL used for this request. + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com' + # req.url # => "http://example.com" + # + # source://actionpack//lib/action_dispatch/http/url.rb#287 + def url; end + + class << self + # source://actionpack//lib/action_dispatch/http/url.rb#112 + def domain_extractor; end + + # source://actionpack//lib/action_dispatch/http/url.rb#112 + def domain_extractor=(val); end + + # Returns the domain part of a host given the domain level. + # + # # Top-level domain example + # extract_domain('www.example.com', 1) # => "example.com" + # # Second-level domain example + # extract_domain('dev.www.example.co.uk', 2) # => "example.co.uk" + # + # source://actionpack//lib/action_dispatch/http/url.rb#121 + def extract_domain(host, tld_length); end + + # Returns the subdomains of a host as a String given the domain level. + # + # # Top-level domain example + # extract_subdomain('www.example.com', 1) # => "www" + # # Second-level domain example + # extract_subdomain('dev.www.example.co.uk', 2) # => "dev.www" + # + # source://actionpack//lib/action_dispatch/http/url.rb#145 + def extract_subdomain(host, tld_length); end + + # Returns the subdomains of a host as an Array given the domain level. + # + # # Top-level domain example + # extract_subdomains('www.example.com', 1) # => ["www"] + # # Second-level domain example + # extract_subdomains('dev.www.example.co.uk', 2) # => ["dev", "www"] + # + # source://actionpack//lib/action_dispatch/http/url.rb#131 + def extract_subdomains(host, tld_length); end + + # source://actionpack//lib/action_dispatch/http/url.rb#157 + def full_url_for(options); end + + # source://actionpack//lib/action_dispatch/http/url.rb#169 + def path_for(options); end + + # source://actionpack//lib/action_dispatch/http/url.rb#110 + def secure_protocol; end + + # source://actionpack//lib/action_dispatch/http/url.rb#110 + def secure_protocol=(val); end + + # source://actionpack//lib/action_dispatch/http/url.rb#111 + def tld_length; end + + # source://actionpack//lib/action_dispatch/http/url.rb#111 + def tld_length=(val); end + + # source://actionpack//lib/action_dispatch/http/url.rb#149 + def url_for(options); end + + private + + # source://actionpack//lib/action_dispatch/http/url.rb#189 + def add_anchor(path, anchor); end + + # source://actionpack//lib/action_dispatch/http/url.rb#182 + def add_params(path, params); end + + # source://actionpack//lib/action_dispatch/http/url.rb#203 + def build_host_url(host, port, protocol, options, path); end + + # source://actionpack//lib/action_dispatch/http/url.rb#195 + def extract_domain_from(host, tld_length); end + + # source://actionpack//lib/action_dispatch/http/url.rb#199 + def extract_subdomains_from(host, tld_length); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/url.rb#227 + def named_host?(host); end + + # source://actionpack//lib/action_dispatch/http/url.rb#244 + def normalize_host(_host, options); end + + # source://actionpack//lib/action_dispatch/http/url.rb#264 + def normalize_port(port, protocol); end + + # source://actionpack//lib/action_dispatch/http/url.rb#231 + def normalize_protocol(protocol); end + end +end + +# DomainExtractor provides utility methods for extracting domain and subdomain +# information from host strings. This module is used internally by Action Dispatch +# to parse host names and separate the domain from subdomains based on the +# top-level domain (TLD) length. +# +# The module assumes a standard domain structure where domains consist of: +# - Subdomains (optional, can be multiple levels) +# - Domain name +# - Top-level domain (TLD, can be multiple levels like .co.uk) +# +# For example, in "api.staging.example.co.uk": +# - Subdomains: ["api", "staging"] +# - Domain: "example.co.uk" (with tld_length=2) +# - TLD: "co.uk" +# +# source://actionpack//lib/action_dispatch/http/url.rb#28 +module ActionDispatch::Http::URL::DomainExtractor + extend ::ActionDispatch::Http::URL::DomainExtractor + + # Extracts the domain part from a host string, including the specified + # number of top-level domain components. + # + # The domain includes the main domain name plus the TLD components. + # The +tld_length+ parameter specifies how many components from the right + # should be considered part of the TLD. + # + # ==== Parameters + # + # [+host+] + # The host string to extract the domain from. + # + # [+tld_length+] + # The number of domain components that make up the TLD. For example, + # use 1 for ".com" or 2 for ".co.uk". + # + # ==== Examples + # + # # Standard TLD (tld_length = 1) + # DomainExtractor.domain_from("www.example.com", 1) + # # => "example.com" + # + # # Country-code TLD (tld_length = 2) + # DomainExtractor.domain_from("www.example.co.uk", 2) + # # => "example.co.uk" + # + # # Multiple subdomains + # DomainExtractor.domain_from("api.staging.myapp.herokuapp.com", 1) + # # => "herokuapp.com" + # + # # Single component (returns the host itself) + # DomainExtractor.domain_from("localhost", 1) + # # => "localhost" + # + # source://actionpack//lib/action_dispatch/http/url.rb#64 + def domain_from(host, tld_length); end + + # Extracts the subdomain components from a host string as an Array. + # + # Returns all the components that come before the domain and TLD parts. + # The +tld_length+ parameter is used to determine where the domain begins + # so that everything before it is considered a subdomain. + # + # ==== Parameters + # + # [+host+] + # The host string to extract subdomains from. + # + # [+tld_length+] + # The number of domain components that make up the TLD. This affects + # where the domain boundary is calculated. + # + # ==== Examples + # + # # Standard TLD (tld_length = 1) + # DomainExtractor.subdomains_from("www.example.com", 1) + # # => ["www"] + # + # # Country-code TLD (tld_length = 2) + # DomainExtractor.subdomains_from("api.staging.example.co.uk", 2) + # # => ["api", "staging"] + # + # # No subdomains + # DomainExtractor.subdomains_from("example.com", 1) + # # => [] + # + # # Single subdomain with complex TLD + # DomainExtractor.subdomains_from("www.mysite.co.uk", 2) + # # => ["www"] + # + # # Multiple levels of subdomains + # DomainExtractor.subdomains_from("dev.api.staging.example.com", 1) + # # => ["dev", "api", "staging"] + # + # source://actionpack//lib/action_dispatch/http/url.rb#104 + def subdomains_from(host, tld_length); end +end + +# source://actionpack//lib/action_dispatch/http/url.rb#11 +ActionDispatch::Http::URL::HOST_REGEXP = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/http/url.rb#10 +ActionDispatch::Http::URL::IP_HOST_REGEXP = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/http/url.rb#12 +ActionDispatch::Http::URL::PROTOCOL_REGEXP = T.let(T.unsafe(nil), Regexp) + +# # Action Dispatch HTTP UploadedFile +# +# Models uploaded files. +# +# The actual file is accessible via the `tempfile` accessor, though some of its +# interface is available directly for convenience. +# +# Uploaded files are temporary files whose lifespan is one request. When the +# object is finalized Ruby unlinks the file, so there is no need to clean them +# with a separate maintenance task. +# +# source://actionpack//lib/action_dispatch/http/upload.rb#17 +class ActionDispatch::Http::UploadedFile + # @raise [ArgumentError] + # @return [UploadedFile] a new instance of UploadedFile + # + # source://actionpack//lib/action_dispatch/http/upload.rb#31 + def initialize(hash); end + + # Shortcut for `tempfile.close`. + # + # source://actionpack//lib/action_dispatch/http/upload.rb#73 + def close(unlink_now = T.unsafe(nil)); end + + # A string with the MIME type of the file. + # + # source://actionpack//lib/action_dispatch/http/upload.rb#22 + def content_type; end + + # A string with the MIME type of the file. + # + # source://actionpack//lib/action_dispatch/http/upload.rb#22 + def content_type=(_arg0); end + + # Shortcut for `tempfile.eof?`. + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/upload.rb#98 + def eof?; end + + # A string with the headers of the multipart request. + # + # source://actionpack//lib/action_dispatch/http/upload.rb#29 + def headers; end + + # A string with the headers of the multipart request. + # + # source://actionpack//lib/action_dispatch/http/upload.rb#29 + def headers=(_arg0); end + + # Shortcut for `tempfile.open`. + # + # source://actionpack//lib/action_dispatch/http/upload.rb#68 + def open; end + + # The basename of the file in the client. + # + # source://actionpack//lib/action_dispatch/http/upload.rb#19 + def original_filename; end + + # The basename of the file in the client. + # + # source://actionpack//lib/action_dispatch/http/upload.rb#19 + def original_filename=(_arg0); end + + # Shortcut for `tempfile.path`. + # + # source://actionpack//lib/action_dispatch/http/upload.rb#78 + def path; end + + # Shortcut for `tempfile.read`. + # + # source://actionpack//lib/action_dispatch/http/upload.rb#63 + def read(length = T.unsafe(nil), buffer = T.unsafe(nil)); end + + # Shortcut for `tempfile.rewind`. + # + # source://actionpack//lib/action_dispatch/http/upload.rb#88 + def rewind; end + + # Shortcut for `tempfile.size`. + # + # source://actionpack//lib/action_dispatch/http/upload.rb#93 + def size; end + + # A `Tempfile` object with the actual uploaded file. Note that some of its + # interface is available directly. + # + # source://actionpack//lib/action_dispatch/http/upload.rb#26 + def tempfile; end + + # A `Tempfile` object with the actual uploaded file. Note that some of its + # interface is available directly. + # + # source://actionpack//lib/action_dispatch/http/upload.rb#26 + def tempfile=(_arg0); end + + # source://actionpack//lib/action_dispatch/http/upload.rb#102 + def to_io; end + + # Shortcut for `tempfile.to_path`. + # + # source://actionpack//lib/action_dispatch/http/upload.rb#83 + def to_path; end +end + +# source://actionpack//lib/action_dispatch/testing/integration.rb#14 +module ActionDispatch::Integration; end + +# source://actionpack//lib/action_dispatch/testing/integration.rb#15 +module ActionDispatch::Integration::RequestHelpers + # Performs a DELETE request with the given parameters. See + # ActionDispatch::Integration::Session#process for more details. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#42 + def delete(path, **args); end + + # Follow a single redirect response. If the last response was not a redirect, an + # exception will be raised. Otherwise, the redirect is performed on the location + # header. If the redirection is a 307 or 308 redirect, the same HTTP verb will + # be used when redirecting, otherwise a GET request will be performed. Any + # arguments are passed to the underlying request. + # + # The HTTP_REFERER header will be set to the previous url. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#65 + def follow_redirect!(headers: T.unsafe(nil), **args); end + + # Performs a GET request with the given parameters. See + # ActionDispatch::Integration::Session#process for more details. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#18 + def get(path, **args); end + + # Performs a HEAD request with the given parameters. See + # ActionDispatch::Integration::Session#process for more details. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#48 + def head(path, **args); end + + # Performs an OPTIONS request with the given parameters. See + # ActionDispatch::Integration::Session#process for more details. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#54 + def options(path, **args); end + + # Performs a PATCH request with the given parameters. See + # ActionDispatch::Integration::Session#process for more details. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#30 + def patch(path, **args); end + + # Performs a POST request with the given parameters. See + # ActionDispatch::Integration::Session#process for more details. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#24 + def post(path, **args); end + + # Performs a PUT request with the given parameters. See + # ActionDispatch::Integration::Session#process for more details. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#36 + def put(path, **args); end +end + +# source://actionpack//lib/action_dispatch/testing/integration.rb#334 +module ActionDispatch::Integration::Runner + include ::ActionDispatch::Assertions::RoutingAssertions + include ::ActionDispatch::Assertions::ResponseAssertions + include ::Rails::Dom::Testing::Assertions::DomAssertions + include ::Rails::Dom::Testing::Assertions::SelectorAssertions + include ::Rails::Dom::Testing::Assertions + include ::ActionDispatch::Assertions + extend ::ActionDispatch::Assertions::RoutingAssertions::ClassMethods + + # source://actionpack//lib/action_dispatch/testing/integration.rb#342 + def initialize(*args, &blk); end + + # Returns the value of attribute app. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#339 + def app; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#412 + def assertions; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#416 + def assertions=(assertions); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#384 + def assigns(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#347 + def before_setup; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#384 + def cookies(*_arg0, **_arg1, &_arg2); end + + # Copy the instance variables from the current session instance into the test + # instance. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#422 + def copy_session_variables!; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#362 + def create_session(app); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#428 + def default_url_options; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#432 + def default_url_options=(options); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#384 + def delete(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#384 + def follow_redirect!(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#384 + def get(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#384 + def head(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#352 + def integration_session; end + + # Open a new session instance. If a block is given, the new session is yielded + # to the block before being returned. + # + # session = open_session do |sess| + # sess.extend(CustomAssertions) + # end + # + # By default, a single session is automatically created for you, but you can use + # this method to open multiple sessions that ought to be tested simultaneously. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#404 + def open_session; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#384 + def patch(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#384 + def post(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#384 + def put(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#374 + def remove!; end + + # Reset the current session. This is useful for testing multiple sessions in a + # single test case. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#358 + def reset!; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#340 + def root_session; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#340 + def root_session=(_arg0); end + + private + + # Delegate unhandled messages to the current session instance. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#442 + def method_missing(method, *_arg1, **_arg2, &_arg3); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#437 + def respond_to_missing?(method, _); end +end + +# source://actionpack//lib/action_dispatch/testing/integration.rb#337 +ActionDispatch::Integration::Runner::APP_SESSIONS = T.let(T.unsafe(nil), Hash) + +# An instance of this class represents a set of requests and responses performed +# sequentially by a test process. Because you can instantiate multiple sessions +# and run them side-by-side, you can also mimic (to some limited extent) +# multiple simultaneous users interacting with your system. +# +# Typically, you will instantiate a new session using Runner#open_session, +# rather than instantiating a Session directly. +# +# source://actionpack//lib/action_dispatch/testing/integration.rb#91 +class ActionDispatch::Integration::Session + include ::Minitest::Assertions + include ::ActionDispatch::Assertions::RoutingAssertions + include ::ActionDispatch::Assertions::ResponseAssertions + include ::Rails::Dom::Testing::Assertions::DomAssertions + include ::Rails::Dom::Testing::Assertions::SelectorAssertions + include ::Rails::Dom::Testing::Assertions + include ::ActionDispatch::Assertions + include ::ActionDispatch::Integration::RequestHelpers + include ::ActionDispatch::TestProcess::FixtureFile + include ::ActionDispatch::TestProcess + include ::ActionDispatch::Routing::PolymorphicRoutes + include ::ActionDispatch::Routing::UrlFor + extend ::ActionDispatch::Assertions::RoutingAssertions::ClassMethods + + # Create and initialize a new Session instance. + # + # @return [Session] a new instance of Session + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#133 + def initialize(app); end + + # The Accept header to send. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#110 + def accept; end + + # The Accept header to send. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#110 + def accept=(_arg0); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#97 + def body(*_arg0, **_arg1, &_arg2); end + + # A reference to the controller instance used by the last request. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#119 + def controller; end + + # A map of the cookies returned by the last response, and which will be sent + # with the next request. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#114 + def cookies; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#130 + def default_url_options; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#130 + def default_url_options=(_arg0); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#130 + def default_url_options?; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#97 + def headers(*_arg0, **_arg1, &_arg2); end + + # The hostname used in the last request. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#101 + def host; end + + # Sets the attribute host + # Set the host name to use in the next request. + # + # session.host! "www.example.com" + # + # @param value the value to set the attribute host to. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#315 + def host!(_arg0); end + + # Sets the attribute host + # + # @param value the value to set the attribute host to. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#104 + def host=(_arg0); end + + # Specify whether or not the session should mimic a secure HTTPS request. + # + # session.https! + # session.https!(false) + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#180 + def https!(flag = T.unsafe(nil)); end + + # Returns `true` if the session is mimicking a secure HTTPS request. + # + # if session.https? + # ... + # end + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#189 + def https?; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#98 + def path(*_arg0, **_arg1, &_arg2); end + + # Performs the actual request. + # + # * `method`: The HTTP method (GET, POST, PATCH, PUT, DELETE, HEAD, OPTIONS) + # as a symbol. + # * `path`: The URI (as a String) on which you want to perform the request. + # * `params`: The HTTP parameters that you want to pass. This may be `nil`, a + # Hash, or a String that is appropriately encoded + # (`application/x-www-form-urlencoded` or `multipart/form-data`). + # * `headers`: Additional headers to pass, as a Hash. The headers will be + # merged into the Rack env hash. + # * `env`: Additional env to pass, as a Hash. The headers will be merged into + # the Rack env hash. + # * `xhr`: Set to `true` if you want to make an Ajax request. Adds request + # headers characteristic of XMLHttpRequest e.g. HTTP_X_REQUESTED_WITH. The + # headers will be merged into the Rack env hash. + # * `as`: Used for encoding the request with different content type. Supports + # `:json` by default and will set the appropriate request headers. The + # headers will be merged into the Rack env hash. + # + # + # This method is rarely used directly. Use RequestHelpers#get, + # RequestHelpers#post, or other standard HTTP methods in integration tests. + # `#process` is only required when using a request method that doesn't have a + # method defined in the integration tests. + # + # This method returns the response status, after performing the request. + # Furthermore, if this method was called from an ActionDispatch::IntegrationTest + # object, then that object's `@response` instance variable will point to a + # Response object which one can use to inspect the details of the response. + # + # Example: + # process :get, '/author', params: { since: 201501011400 } + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#225 + def process(method, path, params: T.unsafe(nil), headers: T.unsafe(nil), env: T.unsafe(nil), xhr: T.unsafe(nil), as: T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#97 + def redirect?(*_arg0, **_arg1, &_arg2); end + + # The remote_addr used in the last request. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#107 + def remote_addr; end + + # The remote_addr used in the last request. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#107 + def remote_addr=(_arg0); end + + # A reference to the request instance used by the last request. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#122 + def request; end + + # A running counter of the number of requests processed. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#128 + def request_count; end + + # A running counter of the number of requests processed. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#128 + def request_count=(_arg0); end + + # Resets the instance. This can be used to reset the state information in an + # existing session instance, so it can be used from a clean-slate condition. + # + # session.reset! + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#156 + def reset!; end + + # A reference to the response instance used by the last request. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#125 + def response; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#97 + def status(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#97 + def status_message(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#140 + def url_options; end + + private + + # source://actionpack//lib/action_dispatch/testing/integration.rb#318 + def _mock_session; end + + # @yield [location] + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#326 + def build_expanded_path(path); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#322 + def build_full_uri(path, env); end + + class << self + # source://actionpack//lib/action_dispatch/testing/integration.rb#130 + def default_url_options; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#130 + def default_url_options=(value); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#130 + def default_url_options?; end + + private + + # source://actionpack//lib/action_dispatch/testing/integration.rb#130 + def __class_attr_default_url_options; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#130 + def __class_attr_default_url_options=(new_value); end + end +end + +# source://actionpack//lib/action_dispatch/testing/integration.rb#92 +ActionDispatch::Integration::Session::DEFAULT_HOST = T.let(T.unsafe(nil), String) + +# An integration test spans multiple controllers and actions, tying them all +# together to ensure they work together as expected. It tests more completely +# than either unit or functional tests do, exercising the entire stack, from the +# dispatcher to the database. +# +# At its simplest, you simply extend `IntegrationTest` and write your tests +# using the Integration::RequestHelpers#get and/or +# Integration::RequestHelpers#post methods: +# +# require "test_helper" +# +# class ExampleTest < ActionDispatch::IntegrationTest +# fixtures :people +# +# def test_login +# # get the login page +# get "/login" +# assert_equal 200, status +# +# # post the login and follow through to the home page +# post "/login", params: { username: people(:jamis).username, +# password: people(:jamis).password } +# follow_redirect! +# assert_equal 200, status +# assert_equal "/home", path +# end +# end +# +# However, you can also have multiple session instances open per test, and even +# extend those instances with assertions and methods to create a very powerful +# testing DSL that is specific for your application. You can even reference any +# named routes you happen to have defined. +# +# require "test_helper" +# +# class AdvancedTest < ActionDispatch::IntegrationTest +# fixtures :people, :rooms +# +# def test_login_and_speak +# jamis, david = login(:jamis), login(:david) +# room = rooms(:office) +# +# jamis.enter(room) +# jamis.speak(room, "anybody home?") +# +# david.enter(room) +# david.speak(room, "hello!") +# end +# +# private +# +# module CustomAssertions +# def enter(room) +# # reference a named route, for maximum internal consistency! +# get(room_url(id: room.id)) +# assert(...) +# ... +# end +# +# def speak(room, message) +# post "/say/#{room.id}", xhr: true, params: { message: message } +# assert(...) +# ... +# end +# end +# +# def login(who) +# open_session do |sess| +# sess.extend(CustomAssertions) +# who = people(who) +# sess.post "/login", params: { username: who.username, +# password: who.password } +# assert(...) +# end +# end +# end +# +# Another longer example would be: +# +# A simple integration test that exercises multiple controllers: +# +# require "test_helper" +# +# class UserFlowsTest < ActionDispatch::IntegrationTest +# test "login and browse site" do +# # login via https +# https! +# get "/login" +# assert_response :success +# +# post "/login", params: { username: users(:david).username, password: users(:david).password } +# follow_redirect! +# assert_equal '/welcome', path +# assert_equal 'Welcome david!', flash[:notice] +# +# https!(false) +# get "/articles/all" +# assert_response :success +# assert_dom 'h1', 'Articles' +# end +# end +# +# As you can see the integration test involves multiple controllers and +# exercises the entire stack from database to dispatcher. In addition you can +# have multiple session instances open simultaneously in a test and extend those +# instances with assertion methods to create a very powerful testing DSL +# (domain-specific language) just for your application. +# +# Here's an example of multiple sessions and custom DSL in an integration test +# +# require "test_helper" +# +# class UserFlowsTest < ActionDispatch::IntegrationTest +# test "login and browse site" do +# # User david logs in +# david = login(:david) +# # User guest logs in +# guest = login(:guest) +# +# # Both are now available in different sessions +# assert_equal 'Welcome david!', david.flash[:notice] +# assert_equal 'Welcome guest!', guest.flash[:notice] +# +# # User david can browse site +# david.browses_site +# # User guest can browse site as well +# guest.browses_site +# +# # Continue with other assertions +# end +# +# private +# +# module CustomDsl +# def browses_site +# get "/products/all" +# assert_response :success +# assert_dom 'h1', 'Products' +# end +# end +# +# def login(user) +# open_session do |sess| +# sess.extend(CustomDsl) +# u = users(user) +# sess.https! +# sess.post "/login", params: { username: u.username, password: u.password } +# assert_equal '/welcome', sess.path +# sess.https!(false) +# end +# end +# end +# +# See the [request helpers documentation](rdoc-ref:ActionDispatch::Integration::RequestHelpers) +# for help on how to use `get`, etc. +# +# ### Changing the request encoding +# +# You can also test your JSON API easily by setting what the request should be +# encoded as: +# +# require "test_helper" +# +# class ApiTest < ActionDispatch::IntegrationTest +# test "creates articles" do +# assert_difference -> { Article.count } do +# post articles_path, params: { article: { title: "Ahoy!" } }, as: :json +# end +# +# assert_response :success +# assert_equal({ "id" => Article.last.id, "title" => "Ahoy!" }, response.parsed_body) +# end +# end +# +# The `as` option passes an "application/json" Accept header (thereby setting +# the request format to JSON unless overridden), sets the content type to +# "application/json" and encodes the parameters as JSON. +# +# Calling TestResponse#parsed_body on the response parses the response body +# based on the last response MIME type. +# +# Out of the box, only `:json` is supported. But for any custom MIME types +# you've registered, you can add your own encoders with: +# +# ActionDispatch::IntegrationTest.register_encoder :wibble, +# param_encoder: -> params { params.to_wibble }, +# response_parser: -> body { body } +# +# Where `param_encoder` defines how the params should be encoded and +# `response_parser` defines how the response body should be parsed through +# TestResponse#parsed_body. +# +# Consult the [Rails Testing Guide](https://guides.rubyonrails.org/testing.html) +# for more. +# +# source://actionpack//lib/action_dispatch/testing/integration.rb#649 +class ActionDispatch::IntegrationTest < ::ActiveSupport::TestCase + include ::ActionDispatch::TestProcess::FixtureFile + include ::ActionDispatch::Assertions::RoutingAssertions + include ::ActionDispatch::Assertions::ResponseAssertions + include ::Rails::Dom::Testing::Assertions::DomAssertions + include ::Rails::Dom::Testing::Assertions::SelectorAssertions + include ::Rails::Dom::Testing::Assertions + include ::ActionDispatch::Assertions + include ::ActionDispatch::Integration::Runner + include ::ActionController::TemplateAssertions + include ::ActionDispatch::TestHelpers::PageDumpHelper + include ::ActionDispatch::IntegrationTest::Behavior + include ::ActionDispatch::Routing::PolymorphicRoutes + include ::ActionDispatch::Routing::UrlFor + include ::ActionDispatch::IntegrationTest::UrlOptions + include ::ActionDispatch::Assertions::RoutingAssertions::WithIntegrationRouting + include ::Turbo::TestAssertions::IntegrationTestAssertions + extend ::ActionDispatch::IntegrationTest::Behavior::ClassMethods + extend ::ActionDispatch::Assertions::RoutingAssertions::WithIntegrationRouting::ClassMethods +end + +# source://actionpack//lib/action_dispatch/testing/integration.rb#659 +module ActionDispatch::IntegrationTest::Behavior + include ::ActionDispatch::Assertions::RoutingAssertions + include ::ActionDispatch::Assertions::ResponseAssertions + include ::Rails::Dom::Testing::Assertions::DomAssertions + include ::Rails::Dom::Testing::Assertions::SelectorAssertions + include ::Rails::Dom::Testing::Assertions + include ::ActionDispatch::Assertions + include ::ActionDispatch::Integration::Runner + include ::ActionController::TemplateAssertions + include ::ActionDispatch::TestHelpers::PageDumpHelper + extend ::ActiveSupport::Concern + include ::ActionDispatch::Routing::UrlFor + include ::ActionDispatch::IntegrationTest::UrlOptions + include ::ActionDispatch::Assertions::RoutingAssertions::WithIntegrationRouting + include ::Turbo::TestAssertions::IntegrationTestAssertions + + mixes_in_class_methods ::ActionDispatch::IntegrationTest::Behavior::ClassMethods + mixes_in_class_methods ::ActionDispatch::Assertions::RoutingAssertions::WithIntegrationRouting::ClassMethods + + # source://actionpack//lib/action_dispatch/testing/integration.rb#692 + def app; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#696 + def document_root_element; end +end + +# source://actionpack//lib/action_dispatch/testing/integration.rb#674 +module ActionDispatch::IntegrationTest::Behavior::ClassMethods + # source://actionpack//lib/action_dispatch/testing/integration.rb#675 + def app; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#683 + def app=(app); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#687 + def register_encoder(*args, **options); end +end + +# source://actionpack//lib/action_dispatch/testing/integration.rb#652 +module ActionDispatch::IntegrationTest::UrlOptions + extend ::ActiveSupport::Concern + + # source://actionpack//lib/action_dispatch/testing/integration.rb#654 + def url_options; end +end + +# source://actionpack//lib/action_dispatch/http/param_error.rb#21 +class ActionDispatch::InvalidParameterError < ::ActionDispatch::ParamError; end + +# :stopdoc: +# +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#6 +module ActionDispatch::Journey; end + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#9 +class ActionDispatch::Journey::Ast + # @return [Ast] a new instance of Ast + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#13 + def initialize(tree, formatted); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#38 + def glob?; end + + # Returns the value of attribute names. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#10 + def names; end + + # Returns the value of attribute path_params. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#10 + def path_params; end + + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#25 + def requirements=(requirements); end + + # Returns the value of attribute tree. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#11 + def root; end + + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#34 + def route=(route); end + + # Returns the value of attribute terminals. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#10 + def terminals; end + + # Returns the value of attribute tree. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#10 + def tree; end + + # Returns the value of attribute wildcard_options. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#10 + def wildcard_options; end + + private + + # Returns the value of attribute stars. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#43 + def stars; end + + # Returns the value of attribute symbols. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#43 + def symbols; end + + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#45 + def visit_tree(formatted); end +end + +# source://actionpack//lib/action_dispatch/journey/visitors.rb#8 +class ActionDispatch::Journey::Format + # @return [Format] a new instance of Format + # + # source://actionpack//lib/action_dispatch/journey/visitors.rb#24 + def initialize(parts); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#39 + def evaluate(hash); end + + class << self + # source://actionpack//lib/action_dispatch/journey/visitors.rb#16 + def required_path(symbol); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#20 + def required_segment(symbol); end + end +end + +# source://actionpack//lib/action_dispatch/journey/visitors.rb#9 +ActionDispatch::Journey::Format::ESCAPE_PATH = T.let(T.unsafe(nil), Proc) + +# source://actionpack//lib/action_dispatch/journey/visitors.rb#10 +ActionDispatch::Journey::Format::ESCAPE_SEGMENT = T.let(T.unsafe(nil), Proc) + +# source://actionpack//lib/action_dispatch/journey/visitors.rb#12 +class ActionDispatch::Journey::Format::Parameter < ::Struct + # source://actionpack//lib/action_dispatch/journey/visitors.rb#13 + def escape(value); end + + # Returns the value of attribute escaper + # + # @return [Object] the current value of escaper + # + # source://actionpack//lib/action_dispatch/journey/visitors.rb#12 + def escaper; end + + # Sets the attribute escaper + # + # @param value [Object] the value to set the attribute escaper to. + # @return [Object] the newly set value + # + # source://actionpack//lib/action_dispatch/journey/visitors.rb#12 + def escaper=(_); end + + # Returns the value of attribute name + # + # @return [Object] the current value of name + # + # source://actionpack//lib/action_dispatch/journey/visitors.rb#12 + def name; end + + # Sets the attribute name + # + # @param value [Object] the value to set the attribute name to. + # @return [Object] the newly set value + # + # source://actionpack//lib/action_dispatch/journey/visitors.rb#12 + def name=(_); end + + class << self + # source://actionpack//lib/action_dispatch/journey/visitors.rb#12 + def [](*_arg0); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#12 + def inspect; end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#12 + def keyword_init?; end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#12 + def members; end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#12 + def new(*_arg0); end + end +end + +# The Formatter class is used for formatting URLs. For example, parameters +# passed to `url_for` in Rails will eventually call Formatter#generate. +# +# source://actionpack//lib/action_dispatch/journey/formatter.rb#12 +class ActionDispatch::Journey::Formatter + # @return [Formatter] a new instance of Formatter + # + # source://actionpack//lib/action_dispatch/journey/formatter.rb#15 + def initialize(routes); end + + # source://actionpack//lib/action_dispatch/journey/formatter.rb#110 + def clear; end + + # source://actionpack//lib/action_dispatch/journey/formatter.rb#114 + def eager_load!; end + + # source://actionpack//lib/action_dispatch/journey/formatter.rb#61 + def generate(name, options, path_parameters); end + + # Returns the value of attribute routes. + # + # source://actionpack//lib/action_dispatch/journey/formatter.rb#13 + def routes; end + + private + + # source://actionpack//lib/action_dispatch/journey/formatter.rb#214 + def build_cache; end + + # source://actionpack//lib/action_dispatch/journey/formatter.rb#225 + def cache; end + + # source://actionpack//lib/action_dispatch/journey/formatter.rb#120 + def extract_parameterized_parts(route, options, recall); end + + # source://actionpack//lib/action_dispatch/journey/formatter.rb#147 + def match_route(name, options); end + + # Returns an array populated with missing keys if any are present. + # + # source://actionpack//lib/action_dispatch/journey/formatter.rb#186 + def missing_keys(route, parts); end + + # source://actionpack//lib/action_dispatch/journey/formatter.rb#143 + def named_routes; end + + # source://actionpack//lib/action_dispatch/journey/formatter.rb#169 + def non_recursive(cache, options); end + + # source://actionpack//lib/action_dispatch/journey/formatter.rb#206 + def possibles(cache, options, depth = T.unsafe(nil)); end +end + +# source://actionpack//lib/action_dispatch/journey/formatter.rb#34 +class ActionDispatch::Journey::Formatter::MissingRoute + # @return [MissingRoute] a new instance of MissingRoute + # + # source://actionpack//lib/action_dispatch/journey/formatter.rb#37 + def initialize(constraints, missing_keys, unmatched_keys, routes, name); end + + # Returns the value of attribute constraints. + # + # source://actionpack//lib/action_dispatch/journey/formatter.rb#35 + def constraints; end + + # source://actionpack//lib/action_dispatch/journey/formatter.rb#53 + def message; end + + # Returns the value of attribute missing_keys. + # + # source://actionpack//lib/action_dispatch/journey/formatter.rb#35 + def missing_keys; end + + # Returns the value of attribute name. + # + # source://actionpack//lib/action_dispatch/journey/formatter.rb#35 + def name; end + + # source://actionpack//lib/action_dispatch/journey/formatter.rb#49 + def params; end + + # @raise [ActionController::UrlGenerationError] + # + # source://actionpack//lib/action_dispatch/journey/formatter.rb#45 + def path(method_name); end + + # Returns the value of attribute routes. + # + # source://actionpack//lib/action_dispatch/journey/formatter.rb#35 + def routes; end + + # Returns the value of attribute unmatched_keys. + # + # source://actionpack//lib/action_dispatch/journey/formatter.rb#35 + def unmatched_keys; end +end + +# source://actionpack//lib/action_dispatch/journey/formatter.rb#20 +class ActionDispatch::Journey::Formatter::RouteWithParams + # @return [RouteWithParams] a new instance of RouteWithParams + # + # source://actionpack//lib/action_dispatch/journey/formatter.rb#23 + def initialize(route, parameterized_parts, params); end + + # Returns the value of attribute params. + # + # source://actionpack//lib/action_dispatch/journey/formatter.rb#21 + def params; end + + # source://actionpack//lib/action_dispatch/journey/formatter.rb#29 + def path(_); end +end + +# source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#9 +module ActionDispatch::Journey::GTG; end + +# source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#10 +class ActionDispatch::Journey::GTG::Builder + # @return [Builder] a new instance of Builder + # + # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#15 + def initialize(root); end + + # Returns the value of attribute ast. + # + # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#13 + def ast; end + + # Returns the value of attribute endpoints. + # + # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#13 + def endpoints; end + + # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#87 + def firstpos(node); end + + # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#108 + def lastpos(node); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#66 + def nullable?(node); end + + # Returns the value of attribute root. + # + # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#13 + def root; end + + # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#21 + def transition_table; end + + private + + # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#130 + def build_followpos; end + + # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#143 + def symbol(edge); end +end + +# source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#11 +ActionDispatch::Journey::GTG::Builder::DUMMY_END_NODE = T.let(T.unsafe(nil), ActionDispatch::Journey::Nodes::Dummy) + +# source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#8 +class ActionDispatch::Journey::GTG::MatchData + # @return [MatchData] a new instance of MatchData + # + # source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#11 + def initialize(memos); end + + # Returns the value of attribute memos. + # + # source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#9 + def memos; end +end + +# source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#16 +class ActionDispatch::Journey::GTG::Simulator + # @return [Simulator] a new instance of Simulator + # + # source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#27 + def initialize(transition_table); end + + # source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#31 + def memos(string); end + + # Returns the value of attribute tt. + # + # source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#25 + def tt; end +end + +# source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#23 +ActionDispatch::Journey::GTG::Simulator::INITIAL_STATE = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#17 +ActionDispatch::Journey::GTG::Simulator::STATIC_TOKENS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#10 +class ActionDispatch::Journey::GTG::TransitionTable + include ::ActionDispatch::Journey::NFA::Dot + + # @return [TransitionTable] a new instance of TransitionTable + # + # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#17 + def initialize; end + + # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#168 + def []=(from, to, sym); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#33 + def accepting?(state); end + + # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#29 + def accepting_states; end + + # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#25 + def add_accepting(state); end + + # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#37 + def add_memo(idx, memo); end + + # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#103 + def as_json(options = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#45 + def eclosure(t); end + + # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#41 + def memo(idx); end + + # Returns the value of attribute memos. + # + # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#13 + def memos; end + + # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#49 + def move(t, full_string, token, start_index, token_matches_default); end + + # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#187 + def states; end + + # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#120 + def to_svg; end + + # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#194 + def transitions; end + + # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#130 + def visualizer(paths, title = T.unsafe(nil)); end +end + +# source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#15 +ActionDispatch::Journey::GTG::TransitionTable::DEFAULT_EXP = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/journey/nfa/dot.rb#7 +module ActionDispatch::Journey::NFA; end + +# source://actionpack//lib/action_dispatch/journey/nfa/dot.rb#8 +module ActionDispatch::Journey::NFA::Dot + # source://actionpack//lib/action_dispatch/journey/nfa/dot.rb#9 + def to_dot; end +end + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#68 +module ActionDispatch::Journey::Nodes; end + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#182 +class ActionDispatch::Journey::Nodes::Binary < ::ActionDispatch::Journey::Nodes::Node + # @return [Binary] a new instance of Binary + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#185 + def initialize(left, right); end + + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#190 + def children; end + + # Returns the value of attribute right. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#183 + def right; end + + # Sets the attribute right + # + # @param value the value to set the attribute right to. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#183 + def right=(_arg0); end +end + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#193 +class ActionDispatch::Journey::Nodes::Cat < ::ActionDispatch::Journey::Nodes::Binary + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#194 + def cat?; end + + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#195 + def type; end +end + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#134 +class ActionDispatch::Journey::Nodes::Dot < ::ActionDispatch::Journey::Nodes::Terminal + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#135 + def type; end +end + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#122 +class ActionDispatch::Journey::Nodes::Dummy < ::ActionDispatch::Journey::Nodes::Literal + # @return [Dummy] a new instance of Dummy + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#123 + def initialize(x = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#127 + def literal?; end +end + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#159 +class ActionDispatch::Journey::Nodes::Group < ::ActionDispatch::Journey::Nodes::Unary + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#161 + def group?; end + + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#160 + def type; end +end + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#117 +class ActionDispatch::Journey::Nodes::Literal < ::ActionDispatch::Journey::Nodes::Terminal + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#118 + def literal?; end + + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#119 + def type; end +end + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#69 +class ActionDispatch::Journey::Nodes::Node + include ::Enumerable + + # @return [Node] a new instance of Node + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#74 + def initialize(left); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#108 + def cat?; end + + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#80 + def each(&block); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#109 + def group?; end + + # Returns the value of attribute left. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#72 + def left; end + + # Sets the attribute left + # + # @param value the value to set the attribute left to. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#72 + def left=(_arg0); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#105 + def literal?; end + + # Returns the value of attribute memo. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#72 + def memo; end + + # Sets the attribute memo + # + # @param value the value to set the attribute memo to. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#72 + def memo=(_arg0); end + + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#96 + def name; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#107 + def star?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#104 + def symbol?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#106 + def terminal?; end + + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#88 + def to_dot; end + + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#84 + def to_s; end + + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#92 + def to_sym; end + + # @raise [NotImplementedError] + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#100 + def type; end +end + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#198 +class ActionDispatch::Journey::Nodes::Or < ::ActionDispatch::Journey::Nodes::Node + # @return [Or] a new instance of Or + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#201 + def initialize(children); end + + # Returns the value of attribute children. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#199 + def children; end + + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#205 + def type; end +end + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#130 +class ActionDispatch::Journey::Nodes::Slash < ::ActionDispatch::Journey::Nodes::Terminal + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#131 + def type; end +end + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#164 +class ActionDispatch::Journey::Nodes::Star < ::ActionDispatch::Journey::Nodes::Unary + # @return [Star] a new instance of Star + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#167 + def initialize(left); end + + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#177 + def name; end + + # Returns the value of attribute regexp. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#165 + def regexp; end + + # Sets the attribute regexp + # + # @param value the value to set the attribute regexp to. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#165 + def regexp=(_arg0); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#174 + def star?; end + + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#175 + def type; end +end + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#138 +class ActionDispatch::Journey::Nodes::Symbol < ::ActionDispatch::Journey::Nodes::Terminal + # @return [Symbol] a new instance of Symbol + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#145 + def initialize(left, regexp = T.unsafe(nil)); end + + # Returns the value of attribute name. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#141 + def name; end + + # Returns the value of attribute regexp. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#139 + def regexp; end + + # Sets the attribute regexp + # + # @param value the value to set the attribute regexp to. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#139 + def regexp=(_arg0); end + + # Returns the value of attribute regexp. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#140 + def symbol; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#152 + def symbol?; end + + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#151 + def type; end +end + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#143 +ActionDispatch::Journey::Nodes::Symbol::DEFAULT_EXP = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#144 +ActionDispatch::Journey::Nodes::Symbol::GREEDY_EXP = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#112 +class ActionDispatch::Journey::Nodes::Terminal < ::ActionDispatch::Journey::Nodes::Node + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#113 + def symbol; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#114 + def terminal?; end +end + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#155 +class ActionDispatch::Journey::Nodes::Unary < ::ActionDispatch::Journey::Nodes::Node + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#156 + def children; end +end + +# source://actionpack//lib/action_dispatch/journey/parser.rb#8 +class ActionDispatch::Journey::Parser + include ::ActionDispatch::Journey::Nodes + + # @return [Parser] a new instance of Parser + # + # source://actionpack//lib/action_dispatch/journey/parser.rb#15 + def initialize; end + + # source://actionpack//lib/action_dispatch/journey/parser.rb#20 + def parse(string); end + + private + + # source://actionpack//lib/action_dispatch/journey/parser.rb#27 + def advance_token; end + + # source://actionpack//lib/action_dispatch/journey/parser.rb#31 + def do_parse; end + + # source://actionpack//lib/action_dispatch/journey/parser.rb#58 + def parse_expression; end + + # source://actionpack//lib/action_dispatch/journey/parser.rb#35 + def parse_expressions; end + + # source://actionpack//lib/action_dispatch/journey/parser.rb#74 + def parse_group; end + + # source://actionpack//lib/action_dispatch/journey/parser.rb#52 + def parse_or(lhs); end + + # source://actionpack//lib/action_dispatch/journey/parser.rb#68 + def parse_star; end + + # source://actionpack//lib/action_dispatch/journey/parser.rb#86 + def parse_terminal; end + + class << self + # source://actionpack//lib/action_dispatch/journey/parser.rb#11 + def parse(string); end + end +end + +# source://actionpack//lib/action_dispatch/journey/path/pattern.rb#7 +module ActionDispatch::Journey::Path; end + +# source://actionpack//lib/action_dispatch/journey/path/pattern.rb#8 +class ActionDispatch::Journey::Path::Pattern + # @return [Pattern] a new instance of Pattern + # + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#11 + def initialize(ast, requirements, separators, anchored); end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#163 + def =~(other); end + + # Returns the value of attribute anchored. + # + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#9 + def anchored; end + + # Returns the value of attribute ast. + # + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#9 + def ast; end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#25 + def build_formatter; end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#29 + def eager_load!; end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#159 + def match(other); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#165 + def match?(other); end + + # Returns the value of attribute names. + # + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#9 + def names; end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#62 + def optional_names; end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#58 + def required_names; end + + # Returns the value of attribute requirements. + # + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#9 + def requirements; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#36 + def requirements_anchored?; end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#177 + def requirements_for_missing_keys_check; end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#169 + def source; end + + # Returns the value of attribute spec. + # + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#9 + def spec; end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#173 + def to_regexp; end + + private + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#188 + def offsets; end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#184 + def regexp_visitor; end +end + +# source://actionpack//lib/action_dispatch/journey/path/pattern.rb#68 +class ActionDispatch::Journey::Path::Pattern::AnchoredRegexp < ::ActionDispatch::Journey::Visitors::Visitor + # @return [AnchoredRegexp] a new instance of AnchoredRegexp + # + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#69 + def initialize(separator, matchers); end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#76 + def accept(node); end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#80 + def visit_CAT(node); end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#100 + def visit_DOT(node); end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#93 + def visit_GROUP(node); end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#97 + def visit_LITERAL(node); end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#111 + def visit_OR(node); end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#102 + def visit_SLASH(node); end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#106 + def visit_STAR(node); end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#84 + def visit_SYMBOL(node); end +end + +# source://actionpack//lib/action_dispatch/journey/path/pattern.rb#124 +class ActionDispatch::Journey::Path::Pattern::MatchData + # @return [MatchData] a new instance of MatchData + # + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#127 + def initialize(names, offsets, match); end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#141 + def [](x); end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#133 + def captures; end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#146 + def length; end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#137 + def named_captures; end + + # Returns the value of attribute names. + # + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#125 + def names; end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#150 + def post_match; end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#154 + def to_s; end +end + +# source://actionpack//lib/action_dispatch/journey/path/pattern.rb#117 +class ActionDispatch::Journey::Path::Pattern::UnanchoredRegexp < ::ActionDispatch::Journey::Path::Pattern::AnchoredRegexp + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#118 + def accept(node); end +end + +# source://actionpack//lib/action_dispatch/journey/route.rb#8 +class ActionDispatch::Journey::Route + # +path+ is a path constraint. + # `constraints` is a hash of constraints to be applied to this route. + # + # @return [Route] a new instance of Route + # + # source://actionpack//lib/action_dispatch/journey/route.rb#79 + def initialize(name:, path:, app: T.unsafe(nil), constraints: T.unsafe(nil), required_defaults: T.unsafe(nil), defaults: T.unsafe(nil), via: T.unsafe(nil), precedence: T.unsafe(nil), scope_options: T.unsafe(nil), internal: T.unsafe(nil), source_location: T.unsafe(nil)); end + + # Returns the value of attribute app. + # + # source://actionpack//lib/action_dispatch/journey/route.rb#9 + def app; end + + # Returns the value of attribute ast. + # + # source://actionpack//lib/action_dispatch/journey/route.rb#9 + def ast; end + + # Returns the value of attribute constraints. + # + # source://actionpack//lib/action_dispatch/journey/route.rb#12 + def conditions; end + + # Returns the value of attribute constraints. + # + # source://actionpack//lib/action_dispatch/journey/route.rb#9 + def constraints; end + + # Returns the value of attribute defaults. + # + # source://actionpack//lib/action_dispatch/journey/route.rb#9 + def defaults; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/route.rb#165 + def dispatcher?; end + + # source://actionpack//lib/action_dispatch/journey/route.rb#101 + def eager_load!; end + + # source://actionpack//lib/action_dispatch/journey/route.rb#143 + def format(path_options); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/route.rb#161 + def glob?; end + + # Returns the value of attribute internal. + # + # source://actionpack//lib/action_dispatch/journey/route.rb#9 + def internal; end + + # source://actionpack//lib/action_dispatch/journey/route.rb#189 + def ip; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/route.rb#169 + def matches?(request); end + + # Returns the value of attribute name. + # + # source://actionpack//lib/action_dispatch/journey/route.rb#9 + def name; end + + # source://actionpack//lib/action_dispatch/journey/route.rb#138 + def parts; end + + # Returns the value of attribute path. + # + # source://actionpack//lib/action_dispatch/journey/route.rb#9 + def path; end + + # Returns the value of attribute precedence. + # + # source://actionpack//lib/action_dispatch/journey/route.rb#9 + def precedence; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/route.rb#151 + def required_default?(key); end + + # source://actionpack//lib/action_dispatch/journey/route.rb#155 + def required_defaults; end + + # source://actionpack//lib/action_dispatch/journey/route.rb#126 + def required_keys; end + + # source://actionpack//lib/action_dispatch/journey/route.rb#147 + def required_parts; end + + # Needed for `bin/rails routes`. Picks up succinctly defined requirements for a + # route, for example route + # + # get 'photo/:id', :controller => 'photos', :action => 'show', + # :id => /[A-Z]\d{5}/ + # + # will have {:controller=>"photos", :action=>"show", :[id=>/](A-Z){5}/} as + # requirements. + # + # source://actionpack//lib/action_dispatch/journey/route.rb#116 + def requirements; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/route.rb#193 + def requires_matching_verb?; end + + # Returns the value of attribute scope_options. + # + # source://actionpack//lib/action_dispatch/journey/route.rb#9 + def scope_options; end + + # source://actionpack//lib/action_dispatch/journey/route.rb#130 + def score(supplied_keys); end + + # source://actionpack//lib/action_dispatch/journey/route.rb#141 + def segment_keys; end + + # source://actionpack//lib/action_dispatch/journey/route.rb#122 + def segments; end + + # Returns the value of attribute source_location. + # + # source://actionpack//lib/action_dispatch/journey/route.rb#9 + def source_location; end + + # source://actionpack//lib/action_dispatch/journey/route.rb#197 + def verb; end +end + +# source://actionpack//lib/action_dispatch/journey/route.rb#14 +module ActionDispatch::Journey::Route::VerbMatchers + class << self + # source://actionpack//lib/action_dispatch/journey/route.rb#65 + def for(verbs); end + end +end + +# source://actionpack//lib/action_dispatch/journey/route.rb#36 +class ActionDispatch::Journey::Route::VerbMatchers::All + class << self + # source://actionpack//lib/action_dispatch/journey/route.rb#37 + def call(_); end + + # source://actionpack//lib/action_dispatch/journey/route.rb#38 + def verb; end + end +end + +# source://actionpack//lib/action_dispatch/journey/route.rb#19 +class ActionDispatch::Journey::Route::VerbMatchers::DELETE + class << self + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def call(req); end + + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def verb; end + end +end + +# source://actionpack//lib/action_dispatch/journey/route.rb#19 +class ActionDispatch::Journey::Route::VerbMatchers::GET + class << self + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def call(req); end + + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def verb; end + end +end + +# source://actionpack//lib/action_dispatch/journey/route.rb#19 +class ActionDispatch::Journey::Route::VerbMatchers::HEAD + class << self + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def call(req); end + + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def verb; end + end +end + +# source://actionpack//lib/action_dispatch/journey/route.rb#19 +class ActionDispatch::Journey::Route::VerbMatchers::LINK + class << self + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def call(req); end + + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def verb; end + end +end + +# source://actionpack//lib/action_dispatch/journey/route.rb#19 +class ActionDispatch::Journey::Route::VerbMatchers::OPTIONS + class << self + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def call(req); end + + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def verb; end + end +end + +# source://actionpack//lib/action_dispatch/journey/route.rb#41 +class ActionDispatch::Journey::Route::VerbMatchers::Or + # @return [Or] a new instance of Or + # + # source://actionpack//lib/action_dispatch/journey/route.rb#44 + def initialize(verbs); end + + # source://actionpack//lib/action_dispatch/journey/route.rb#49 + def call(req); end + + # Returns the value of attribute verb. + # + # source://actionpack//lib/action_dispatch/journey/route.rb#42 + def verb; end +end + +# source://actionpack//lib/action_dispatch/journey/route.rb#19 +class ActionDispatch::Journey::Route::VerbMatchers::PATCH + class << self + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def call(req); end + + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def verb; end + end +end + +# source://actionpack//lib/action_dispatch/journey/route.rb#19 +class ActionDispatch::Journey::Route::VerbMatchers::POST + class << self + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def call(req); end + + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def verb; end + end +end + +# source://actionpack//lib/action_dispatch/journey/route.rb#19 +class ActionDispatch::Journey::Route::VerbMatchers::PUT + class << self + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def call(req); end + + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def verb; end + end +end + +# source://actionpack//lib/action_dispatch/journey/route.rb#19 +class ActionDispatch::Journey::Route::VerbMatchers::TRACE + class << self + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def call(req); end + + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def verb; end + end +end + +# source://actionpack//lib/action_dispatch/journey/route.rb#19 +class ActionDispatch::Journey::Route::VerbMatchers::UNLINK + class << self + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def call(req); end + + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def verb; end + end +end + +# source://actionpack//lib/action_dispatch/journey/route.rb#26 +class ActionDispatch::Journey::Route::VerbMatchers::Unknown + # @return [Unknown] a new instance of Unknown + # + # source://actionpack//lib/action_dispatch/journey/route.rb#29 + def initialize(verb); end + + # source://actionpack//lib/action_dispatch/journey/route.rb#33 + def call(request); end + + # Returns the value of attribute verb. + # + # source://actionpack//lib/action_dispatch/journey/route.rb#27 + def verb; end +end + +# source://actionpack//lib/action_dispatch/journey/route.rb#15 +ActionDispatch::Journey::Route::VerbMatchers::VERBS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/journey/route.rb#54 +ActionDispatch::Journey::Route::VerbMatchers::VERB_TO_CLASS = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#7 +class ActionDispatch::Journey::Router + # @return [Router] a new instance of Router + # + # source://actionpack//lib/action_dispatch/journey/router.rb#19 + def initialize(routes); end + + # source://actionpack//lib/action_dispatch/journey/router.rb#23 + def eager_load!; end + + # source://actionpack//lib/action_dispatch/journey/router.rb#43 + def recognize(req, &block); end + + # Returns the value of attribute routes. + # + # source://actionpack//lib/action_dispatch/journey/router.rb#17 + def routes; end + + # Sets the attribute routes + # + # @param value the value to set the attribute routes to. + # + # source://actionpack//lib/action_dispatch/journey/router.rb#17 + def routes=(_arg0); end + + # source://actionpack//lib/action_dispatch/journey/router.rb#30 + def serve(req); end + + private + + # source://actionpack//lib/action_dispatch/journey/router.rb#107 + def custom_routes; end + + # source://actionpack//lib/action_dispatch/journey/router.rb#111 + def filter_routes(path); end + + # source://actionpack//lib/action_dispatch/journey/router.rb#115 + def match_head_routes(routes, req); end + + # source://actionpack//lib/action_dispatch/journey/router.rb#103 + def simulator; end +end + +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#8 +class ActionDispatch::Journey::Router::Utils + class << self + # source://actionpack//lib/action_dispatch/journey/router/utils.rb#93 + def escape_fragment(fragment); end + + # source://actionpack//lib/action_dispatch/journey/router/utils.rb#85 + def escape_path(path); end + + # source://actionpack//lib/action_dispatch/journey/router/utils.rb#89 + def escape_segment(segment); end + + # Normalizes URI path. + # + # Strips off trailing slash and ensures there is a leading slash. Also converts + # downcase URL encoded string to uppercase. + # + # normalize_path("/foo") # => "/foo" + # normalize_path("/foo/") # => "/foo" + # normalize_path("foo") # => "/foo" + # normalize_path("") # => "/" + # normalize_path("/%ab") # => "/%AB" + # + # source://actionpack//lib/action_dispatch/journey/router/utils.rb#19 + def normalize_path(path); end + end +end + +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#83 +ActionDispatch::Journey::Router::Utils::ENCODER = T.let(T.unsafe(nil), ActionDispatch::Journey::Router::Utils::UriEncoder) + +# URI path and fragment escaping https://tools.ietf.org/html/rfc3986 +# +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#41 +class ActionDispatch::Journey::Router::Utils::UriEncoder + # source://actionpack//lib/action_dispatch/journey/router/utils.rb#59 + def escape_fragment(fragment); end + + # source://actionpack//lib/action_dispatch/journey/router/utils.rb#63 + def escape_path(path); end + + # source://actionpack//lib/action_dispatch/journey/router/utils.rb#67 + def escape_segment(segment); end + + private + + # source://actionpack//lib/action_dispatch/journey/router/utils.rb#72 + def escape(component, pattern); end + + # source://actionpack//lib/action_dispatch/journey/router/utils.rb#76 + def percent_encode(unsafe); end +end + +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#48 +ActionDispatch::Journey::Router::Utils::UriEncoder::ALPHA = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#46 +ActionDispatch::Journey::Router::Utils::UriEncoder::DEC2HEX = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#49 +ActionDispatch::Journey::Router::Utils::UriEncoder::DIGIT = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#45 +ActionDispatch::Journey::Router::Utils::UriEncoder::EMPTY = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#42 +ActionDispatch::Journey::Router::Utils::UriEncoder::ENCODE = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#53 +ActionDispatch::Journey::Router::Utils::UriEncoder::ESCAPED = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#55 +ActionDispatch::Journey::Router::Utils::UriEncoder::FRAGMENT = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#57 +ActionDispatch::Journey::Router::Utils::UriEncoder::PATH = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#56 +ActionDispatch::Journey::Router::Utils::UriEncoder::SEGMENT = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#51 +ActionDispatch::Journey::Router::Utils::UriEncoder::SUB_DELIMS = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#50 +ActionDispatch::Journey::Router::Utils::UriEncoder::UNRESERVED = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#43 +ActionDispatch::Journey::Router::Utils::UriEncoder::US_ASCII = T.let(T.unsafe(nil), Encoding) + +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#44 +ActionDispatch::Journey::Router::Utils::UriEncoder::UTF_8 = T.let(T.unsafe(nil), Encoding) + +# The Routing table. Contains all routes for a system. Routes can be added to +# the table by calling Routes#add_route. +# +# source://actionpack//lib/action_dispatch/journey/routes.rb#9 +class ActionDispatch::Journey::Routes + include ::Enumerable + + # @return [Routes] a new instance of Routes + # + # source://actionpack//lib/action_dispatch/journey/routes.rb#14 + def initialize(routes = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/journey/routes.rb#67 + def add_route(name, mapping); end + + # Returns the value of attribute anchored_routes. + # + # source://actionpack//lib/action_dispatch/journey/routes.rb#12 + def anchored_routes; end + + # source://actionpack//lib/action_dispatch/journey/routes.rb#53 + def ast; end + + # source://actionpack//lib/action_dispatch/journey/routes.rb#39 + def clear; end + + # Returns the value of attribute custom_routes. + # + # source://actionpack//lib/action_dispatch/journey/routes.rb#12 + def custom_routes; end + + # source://actionpack//lib/action_dispatch/journey/routes.rb#35 + def each(&block); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/routes.rb#22 + def empty?; end + + # source://actionpack//lib/action_dispatch/journey/routes.rb#31 + def last; end + + # source://actionpack//lib/action_dispatch/journey/routes.rb#26 + def length; end + + # source://actionpack//lib/action_dispatch/journey/routes.rb#45 + def partition_route(route); end + + # Returns the value of attribute routes. + # + # source://actionpack//lib/action_dispatch/journey/routes.rb#12 + def routes; end + + # source://actionpack//lib/action_dispatch/journey/routes.rb#60 + def simulator; end + + # source://actionpack//lib/action_dispatch/journey/routes.rb#29 + def size; end + + # source://actionpack//lib/action_dispatch/journey/routes.rb#75 + def visualizer; end + + private + + # source://actionpack//lib/action_dispatch/journey/routes.rb#83 + def clear_cache!; end +end + +# source://actionpack//lib/action_dispatch/journey/scanner.rb#9 +class ActionDispatch::Journey::Scanner + # @return [Scanner] a new instance of Scanner + # + # source://actionpack//lib/action_dispatch/journey/scanner.rb#28 + def initialize; end + + # source://actionpack//lib/action_dispatch/journey/scanner.rb#48 + def last_literal; end + + # source://actionpack//lib/action_dispatch/journey/scanner.rb#44 + def last_string; end + + # source://actionpack//lib/action_dispatch/journey/scanner.rb#37 + def next_token; end + + # source://actionpack//lib/action_dispatch/journey/scanner.rb#33 + def scan_setup(str); end + + private + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/scanner.rb#69 + def next_byte_is_not_a_token?; end + + # source://actionpack//lib/action_dispatch/journey/scanner.rb#55 + def scan; end +end + +# source://actionpack//lib/action_dispatch/journey/scanner.rb#10 +ActionDispatch::Journey::Scanner::STATIC_TOKENS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/journey/scanner.rb#20 +class ActionDispatch::Journey::Scanner::Scanner < ::StringScanner; end + +# source://actionpack//lib/action_dispatch/journey/visitors.rb#55 +module ActionDispatch::Journey::Visitors; end + +# private +# def binary(node, seed) +# visit(node.right, visit(node.left, seed)) +# end +# +# def nary(node, seed) +# last_child = node.children.last +# node.children.inject(seed) { |s, c| +# string = visit(c, s) +# string << "|" unless last_child == c +# string +# } +# end +# +# def terminal(node, seed) +# seed + node.left +# end +# +# def visit_GROUP(node, seed) +# visit(node.left, seed.dup << "(") << ")" +# end +# +# INSTANCE = new +# end +# +# source://actionpack//lib/action_dispatch/journey/visitors.rb#228 +class ActionDispatch::Journey::Visitors::Dot < ::ActionDispatch::Journey::Visitors::FunctionalVisitor + # @return [Dot] a new instance of Dot + # + # source://actionpack//lib/action_dispatch/journey/visitors.rb#229 + def initialize; end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#234 + def accept(node, seed = T.unsafe(nil)); end + + private + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#249 + def binary(node, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#256 + def nary(node, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#288 + def terminal(node, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#263 + def unary(node, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#273 + def visit_CAT(node, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#268 + def visit_GROUP(node, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#283 + def visit_OR(node, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#278 + def visit_STAR(node, seed); end +end + +# source://actionpack//lib/action_dispatch/journey/visitors.rb#294 +ActionDispatch::Journey::Visitors::Dot::INSTANCE = T.let(T.unsafe(nil), ActionDispatch::Journey::Visitors::Dot) + +# Loop through the requirements AST. +# +# source://actionpack//lib/action_dispatch/journey/visitors.rb#161 +class ActionDispatch::Journey::Visitors::Each < ::ActionDispatch::Journey::Visitors::FunctionalVisitor + # source://actionpack//lib/action_dispatch/journey/visitors.rb#162 + def visit(node, block); end +end + +# source://actionpack//lib/action_dispatch/journey/visitors.rb#167 +ActionDispatch::Journey::Visitors::Each::INSTANCE = T.let(T.unsafe(nil), ActionDispatch::Journey::Visitors::Each) + +# source://actionpack//lib/action_dispatch/journey/visitors.rb#136 +class ActionDispatch::Journey::Visitors::FormatBuilder < ::ActionDispatch::Journey::Visitors::Visitor + # source://actionpack//lib/action_dispatch/journey/visitors.rb#137 + def accept(node); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#140 + def binary(node); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#138 + def terminal(node); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#144 + def visit_GROUP(n); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#146 + def visit_STAR(n); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#150 + def visit_SYMBOL(n); end +end + +# source://actionpack//lib/action_dispatch/journey/visitors.rb#97 +class ActionDispatch::Journey::Visitors::FunctionalVisitor + # source://actionpack//lib/action_dispatch/journey/visitors.rb#100 + def accept(node, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#108 + def binary(node, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#113 + def nary(node, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#124 + def terminal(node, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#118 + def unary(node, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#104 + def visit(node, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#111 + def visit_CAT(n, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#128 + def visit_DOT(n, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#121 + def visit_GROUP(n, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#125 + def visit_LITERAL(n, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#116 + def visit_OR(n, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#127 + def visit_SLASH(n, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#122 + def visit_STAR(n, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#126 + def visit_SYMBOL(n, seed); end +end + +# source://actionpack//lib/action_dispatch/journey/visitors.rb#98 +ActionDispatch::Journey::Visitors::FunctionalVisitor::DISPATCH_CACHE = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_dispatch/journey/visitors.rb#170 +class ActionDispatch::Journey::Visitors::String + # source://actionpack//lib/action_dispatch/journey/visitors.rb#171 + def accept(node, seed); end +end + +# source://actionpack//lib/action_dispatch/journey/visitors.rb#199 +ActionDispatch::Journey::Visitors::String::INSTANCE = T.let(T.unsafe(nil), ActionDispatch::Journey::Visitors::String) + +# source://actionpack//lib/action_dispatch/journey/visitors.rb#56 +class ActionDispatch::Journey::Visitors::Visitor + # source://actionpack//lib/action_dispatch/journey/visitors.rb#59 + def accept(node); end + + private + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#68 + def binary(node); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#74 + def nary(node); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#85 + def terminal(node); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#79 + def unary(node); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#64 + def visit(node); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#72 + def visit_CAT(n); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#89 + def visit_DOT(n); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#82 + def visit_GROUP(n); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#86 + def visit_LITERAL(n); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#77 + def visit_OR(n); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#88 + def visit_SLASH(n); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#83 + def visit_STAR(n); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#87 + def visit_SYMBOL(n); end +end + +# source://actionpack//lib/action_dispatch/journey/visitors.rb#57 +ActionDispatch::Journey::Visitors::Visitor::DISPATCH_CACHE = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_dispatch/log_subscriber.rb#4 +class ActionDispatch::LogSubscriber < ::ActiveSupport::LogSubscriber + # source://actionpack//lib/action_dispatch/log_subscriber.rb#5 + def backtrace_cleaner; end + + # source://actionpack//lib/action_dispatch/log_subscriber.rb#5 + def backtrace_cleaner=(_arg0); end + + # source://actionpack//lib/action_dispatch/log_subscriber.rb#5 + def backtrace_cleaner?; end + + # source://actionpack//lib/action_dispatch/log_subscriber.rb#7 + def redirect(event); end + + class << self + # source://actionpack//lib/action_dispatch/log_subscriber.rb#5 + def backtrace_cleaner; end + + # source://actionpack//lib/action_dispatch/log_subscriber.rb#5 + def backtrace_cleaner=(value); end + + # source://actionpack//lib/action_dispatch/log_subscriber.rb#5 + def backtrace_cleaner?; end + + private + + # source://actionpack//lib/action_dispatch/log_subscriber.rb#5 + def __class_attr_backtrace_cleaner; end + + # source://actionpack//lib/action_dispatch/log_subscriber.rb#5 + def __class_attr_backtrace_cleaner=(new_value); end + + # source://actionpack//lib/action_dispatch/log_subscriber.rb#25 + def __class_attr_log_levels; end + + # source://actionpack//lib/action_dispatch/log_subscriber.rb#25 + def __class_attr_log_levels=(new_value); end + end +end + +# # Action Dispatch MiddlewareStack +# +# Read more about [Rails middleware +# stack](https://guides.rubyonrails.org/rails_on_rack.html#action-dispatcher-middleware-stack) +# in the guides. +# +# source://actionpack//lib/action_dispatch/middleware/stack.rb#14 +class ActionDispatch::MiddlewareStack + include ::Enumerable + + # @return [MiddlewareStack] a new instance of MiddlewareStack + # @yield [_self] + # @yieldparam _self [ActionDispatch::MiddlewareStack] the object that the method was called on + # + # source://actionpack//lib/action_dispatch/middleware/stack.rb#76 + def initialize(*args); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#93 + def [](i); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#166 + def build(app = T.unsafe(nil), &block); end + + # Deletes a middleware from the middleware stack. + # + # Returns the array of middlewares not including the deleted item, or returns + # nil if the target is not found. + # + # source://actionpack//lib/action_dispatch/middleware/stack.rb#131 + def delete(target); end + + # Deletes a middleware from the middleware stack. + # + # Returns the array of middlewares not including the deleted item, or raises + # `RuntimeError` if the target is not found. + # + # source://actionpack//lib/action_dispatch/middleware/stack.rb#139 + def delete!(target); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#81 + def each(&block); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#106 + def insert(index, klass, *args, **_arg3, &block); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#114 + def insert_after(index, *args, **_arg2, &block); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#112 + def insert_before(index, klass, *args, **_arg3, &block); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#89 + def last; end + + # Returns the value of attribute middlewares. + # + # source://actionpack//lib/action_dispatch/middleware/stack.rb#74 + def middlewares; end + + # Sets the attribute middlewares + # + # @param value the value to set the attribute middlewares to. + # + # source://actionpack//lib/action_dispatch/middleware/stack.rb#74 + def middlewares=(_arg0); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#143 + def move(target, source); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#153 + def move_after(target, source); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#151 + def move_before(target, source); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#85 + def size; end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#120 + def swap(target, *args, **_arg2, &block); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#97 + def unshift(klass, *args, **_arg2, &block); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#161 + def use(klass, *args, **_arg2, &block); end + + private + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#178 + def assert_index(index, where); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#184 + def build_middleware(klass, args, block); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#188 + def index_of(klass); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#102 + def initialize_copy(other); end +end + +# This class is used to instrument the execution of a single middleware. It +# proxies the `call` method transparently and instruments the method call. +# +# source://actionpack//lib/action_dispatch/middleware/stack.rb#54 +class ActionDispatch::MiddlewareStack::InstrumentationProxy + # @return [InstrumentationProxy] a new instance of InstrumentationProxy + # + # source://actionpack//lib/action_dispatch/middleware/stack.rb#57 + def initialize(middleware, class_name); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#65 + def call(env); end +end + +# source://actionpack//lib/action_dispatch/middleware/stack.rb#55 +ActionDispatch::MiddlewareStack::InstrumentationProxy::EVENT_NAME = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/middleware/stack.rb#15 +class ActionDispatch::MiddlewareStack::Middleware + # @return [Middleware] a new instance of Middleware + # + # source://actionpack//lib/action_dispatch/middleware/stack.rb#18 + def initialize(klass, args, block); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#26 + def ==(middleware); end + + # Returns the value of attribute args. + # + # source://actionpack//lib/action_dispatch/middleware/stack.rb#16 + def args; end + + # Returns the value of attribute block. + # + # source://actionpack//lib/action_dispatch/middleware/stack.rb#16 + def block; end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#43 + def build(app); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#47 + def build_instrumented(app); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#35 + def inspect; end + + # Returns the value of attribute klass. + # + # source://actionpack//lib/action_dispatch/middleware/stack.rb#16 + def klass; end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#24 + def name; end +end + +# source://actionpack//lib/action_dispatch.rb#50 +class ActionDispatch::MissingController < ::NameError; end + +# source://actionpack//lib/action_dispatch/http/param_builder.rb#4 +class ActionDispatch::ParamBuilder + # @return [ParamBuilder] a new instance of ParamBuilder + # + # source://actionpack//lib/action_dispatch/http/param_builder.rb#15 + def initialize(param_depth_limit); end + + # source://actionpack//lib/action_dispatch/http/param_builder.rb#19 + def default; end + + # source://actionpack//lib/action_dispatch/http/param_builder.rb#19 + def default=(val); end + + # source://actionpack//lib/action_dispatch/http/param_builder.rb#62 + def from_hash(hash, encoding_template: T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/http/param_builder.rb#46 + def from_pairs(pairs, encoding_template: T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/http/param_builder.rb#42 + def from_query_string(qs, separator: T.unsafe(nil), encoding_template: T.unsafe(nil)); end + + # Returns the value of attribute param_depth_limit. + # + # source://actionpack//lib/action_dispatch/http/param_builder.rb#13 + def param_depth_limit; end + + private + + # source://actionpack//lib/action_dispatch/http/param_builder.rb#163 + def make_params; end + + # source://actionpack//lib/action_dispatch/http/param_builder.rb#167 + def new_depth_limit(param_depth_limit); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/param_builder.rb#175 + def params_hash_has_key?(hash, key); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/param_builder.rb#171 + def params_hash_type?(obj); end + + # @raise [ParamsTooDeepError] + # + # source://actionpack//lib/action_dispatch/http/param_builder.rb#77 + def store_nested_param(params, name, v, depth, encoding_template = T.unsafe(nil)); end + + class << self + # source://actionpack//lib/action_dispatch/http/param_builder.rb#19 + def default; end + + # source://actionpack//lib/action_dispatch/http/param_builder.rb#19 + def default=(val); end + + # source://actionpack//lib/action_dispatch/http/param_builder.rb#23 + def from_hash(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_dispatch/http/param_builder.rb#23 + def from_pairs(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_dispatch/http/param_builder.rb#23 + def from_query_string(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_dispatch/http/param_builder.rb#25 + def ignore_leading_brackets; end + + # source://actionpack//lib/action_dispatch/http/param_builder.rb#33 + def ignore_leading_brackets=(value); end + + # source://actionpack//lib/action_dispatch/http/param_builder.rb#9 + def make_default(param_depth_limit); end + end +end + +# source://actionpack//lib/action_dispatch/http/param_error.rb#4 +class ActionDispatch::ParamError < ::ActionDispatch::Http::Parameters::ParseError + # @return [ParamError] a new instance of ParamError + # + # source://actionpack//lib/action_dispatch/http/param_error.rb#5 + def initialize(message = T.unsafe(nil)); end + + class << self + # source://actionpack//lib/action_dispatch/http/param_error.rb#9 + def ===(other); end + end +end + +# source://actionpack//lib/action_dispatch/http/param_error.rb#18 +class ActionDispatch::ParameterTypeError < ::ActionDispatch::ParamError; end + +# source://actionpack//lib/action_dispatch/http/param_error.rb#24 +class ActionDispatch::ParamsTooDeepError < ::ActionDispatch::ParamError; end + +# # Action Dispatch PermissionsPolicy +# +# Configures the HTTP +# [Feature-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy) +# response header to specify which browser features the current +# document and its iframes can use. +# +# Example global policy: +# +# Rails.application.config.permissions_policy do |policy| +# policy.camera :none +# policy.gyroscope :none +# policy.microphone :none +# policy.usb :none +# policy.fullscreen :self +# policy.payment :self, "https://secure.example.com" +# end +# +# The Feature-Policy header has been renamed to Permissions-Policy. The +# Permissions-Policy requires a different implementation and isn't yet supported +# by all browsers. To avoid having to rename this middleware in the future we +# use the new name for the middleware but keep the old header name and +# implementation for now. +# +# source://actionpack//lib/action_dispatch/http/permissions_policy.rb#31 +class ActionDispatch::PermissionsPolicy + # @return [PermissionsPolicy] a new instance of PermissionsPolicy + # @yield [_self] + # @yieldparam _self [ActionDispatch::PermissionsPolicy] the object that the method was called on + # + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#113 + def initialize; end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def accelerometer(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def ambient_light_sensor(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def autoplay(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#132 + def build(context = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def camera(*sources); end + + # Returns the value of attribute directives. + # + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#111 + def directives; end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def display_capture(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def encrypted_media(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def fullscreen(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def geolocation(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def gyroscope(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def hid(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def idle_detection(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def keyboard_map(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def magnetometer(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def microphone(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def midi(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def payment(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def picture_in_picture(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def screen_wake_lock(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def serial(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def sync_xhr(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def usb(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def web_share(*sources); end + + private + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#150 + def apply_mapping(source); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#137 + def apply_mappings(sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#168 + def build_directive(sources, context); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#156 + def build_directives(context); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#118 + def initialize_copy(other); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#172 + def resolve_source(source, context); end +end + +# List of available permissions can be found at +# https://github.com/w3c/webappsec-permissions-policy/blob/main/features.md#policy-controlled-features +# +# source://actionpack//lib/action_dispatch/http/permissions_policy.rb#84 +ActionDispatch::PermissionsPolicy::DIRECTIVES = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_dispatch/http/permissions_policy.rb#77 +ActionDispatch::PermissionsPolicy::MAPPINGS = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_dispatch/http/permissions_policy.rb#32 +class ActionDispatch::PermissionsPolicy::Middleware + # @return [Middleware] a new instance of Middleware + # + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#33 + def initialize(app); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#37 + def call(env); end + + private + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#60 + def policy_empty?(policy); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#56 + def policy_present?(headers); end +end + +# source://actionpack//lib/action_dispatch/http/permissions_policy.rb#65 +module ActionDispatch::PermissionsPolicy::Request + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#68 + def permissions_policy; end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#72 + def permissions_policy=(policy); end +end + +# source://actionpack//lib/action_dispatch/http/permissions_policy.rb#66 +ActionDispatch::PermissionsPolicy::Request::POLICY = T.let(T.unsafe(nil), String) + +# # Action Dispatch PublicExceptions +# +# When called, this middleware renders an error page. By default if an HTML +# response is expected it will render static error pages from the `/public` +# directory. For example when this middleware receives a 500 response it will +# render the template found in `/public/500.html`. If an internationalized +# locale is set, this middleware will attempt to render the template in +# `/public/500..html`. If an internationalized template is not found it +# will fall back on `/public/500.html`. +# +# When a request with a content type other than HTML is made, this middleware +# will attempt to convert error information into the appropriate response type. +# +# source://actionpack//lib/action_dispatch/middleware/public_exceptions.rb#18 +class ActionDispatch::PublicExceptions + # @return [PublicExceptions] a new instance of PublicExceptions + # + # source://actionpack//lib/action_dispatch/middleware/public_exceptions.rb#21 + def initialize(public_path); end + + # source://actionpack//lib/action_dispatch/middleware/public_exceptions.rb#25 + def call(env); end + + # Returns the value of attribute public_path. + # + # source://actionpack//lib/action_dispatch/middleware/public_exceptions.rb#19 + def public_path; end + + # Sets the attribute public_path + # + # @param value the value to set the attribute public_path to. + # + # source://actionpack//lib/action_dispatch/middleware/public_exceptions.rb#19 + def public_path=(_arg0); end + + private + + # source://actionpack//lib/action_dispatch/middleware/public_exceptions.rb#39 + def render(status, content_type, body); end + + # source://actionpack//lib/action_dispatch/middleware/public_exceptions.rb#48 + def render_format(status, content_type, body); end + + # source://actionpack//lib/action_dispatch/middleware/public_exceptions.rb#53 + def render_html(status); end +end + +# source://actionpack//lib/action_dispatch/http/query_parser.rb#7 +class ActionDispatch::QueryParser + class << self + # -- + # Note this departs from WHATWG's specified parsing algorithm by + # giving a nil value for keys that do not use '='. Callers that need + # the standard's interpretation can use `v.to_s`. + # + # source://actionpack//lib/action_dispatch/http/query_parser.rb#29 + def each_pair(s, separator = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/http/query_parser.rb#11 + def strict_query_string_separator; end + + # source://actionpack//lib/action_dispatch/http/query_parser.rb#18 + def strict_query_string_separator=(value); end + end +end + +# source://actionpack//lib/action_dispatch/http/query_parser.rb#9 +ActionDispatch::QueryParser::COMMON_SEP = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_dispatch/http/query_parser.rb#8 +ActionDispatch::QueryParser::DEFAULT_SEP = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/railtie.rb#12 +class ActionDispatch::Railtie < ::Rails::Railtie; end + +# # Action Dispatch Reloader +# +# ActionDispatch::Reloader wraps the request with callbacks provided by +# ActiveSupport::Reloader, intended to assist with code reloading during +# development. +# +# ActionDispatch::Reloader is included in the middleware stack only if reloading +# is enabled, which it is by the default in `development` mode. +# +# source://actionpack//lib/action_dispatch/middleware/reloader.rb#14 +class ActionDispatch::Reloader < ::ActionDispatch::Executor; end + +# # Action Dispatch RemoteIp +# +# This middleware calculates the IP address of the remote client that is making +# the request. It does this by checking various headers that could contain the +# address, and then picking the last-set address that is not on the list of +# trusted IPs. This follows the precedent set by e.g. [the Tomcat +# server](https://issues.apache.org/bugzilla/show_bug.cgi?id=50453). A more +# detailed explanation of the algorithm is given at GetIp#calculate_ip. +# +# Some Rack servers concatenate repeated headers, like [HTTP RFC +# 2616](https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2) requires. +# Some Rack servers simply drop preceding headers, and only report the value +# that was [given in the last +# header](https://andre.arko.net/2011/12/26/repeated-headers-and-ruby-web-servers). +# If you are behind multiple proxy servers (like NGINX to HAProxy to +# Unicorn) then you should test your Rack server to make sure your data is good. +# +# IF YOU DON'T USE A PROXY, THIS MAKES YOU VULNERABLE TO IP SPOOFING. This +# middleware assumes that there is at least one proxy sitting around and setting +# headers with the client's remote IP address. If you don't use a proxy, because +# you are hosted on e.g. Heroku without SSL, any client can claim to have any IP +# address by setting the `X-Forwarded-For` header. If you care about that, then +# you need to explicitly drop or ignore those headers sometime before this +# middleware runs. Alternatively, remove this middleware to avoid inadvertently +# relying on it. +# +# source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#33 +class ActionDispatch::RemoteIp + # Create a new `RemoteIp` middleware instance. + # + # The `ip_spoofing_check` option is on by default. When on, an exception is + # raised if it looks like the client is trying to lie about its own IP address. + # It makes sense to turn off this check on sites aimed at non-IP clients (like + # WAP devices), or behind proxies that set headers in an incorrect or confusing + # way (like AWS ELB). + # + # The `custom_proxies` argument can take an enumerable which will be used + # instead of `TRUSTED_PROXIES`. Any proxy setup will put the value you want in + # the middle (or at the beginning) of the `X-Forwarded-For` list, with your + # proxy servers after it. If your proxies aren't removed, pass them in via the + # `custom_proxies` parameter. That way, the middleware will ignore those IP + # addresses, and return the one that you want. + # + # @return [RemoteIp] a new instance of RemoteIp + # + # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#67 + def initialize(app, ip_spoofing_check = T.unsafe(nil), custom_proxies = T.unsafe(nil)); end + + # Since the IP address may not be needed, we store the object here without + # calculating the IP to keep from slowing down the majority of requests. For + # those requests that do need to know the IP, the GetIp#calculate_ip method will + # calculate the memoized client IP address. + # + # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#95 + def call(env); end + + # Returns the value of attribute check_ip. + # + # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#51 + def check_ip; end + + # Returns the value of attribute proxies. + # + # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#51 + def proxies; end +end + +# The GetIp class exists as a way to defer processing of the request data into +# an actual IP address. If the ActionDispatch::Request#remote_ip method is +# called, this class will calculate the value and then memoize it. +# +# source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#104 +class ActionDispatch::RemoteIp::GetIp + # @return [GetIp] a new instance of GetIp + # + # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#105 + def initialize(req, check_ip, proxies); end + + # Sort through the various IP address headers, looking for the IP most likely to + # be the address of the actual remote client making this request. + # + # REMOTE_ADDR will be correct if the request is made directly against the Ruby + # process, on e.g. Heroku. When the request is proxied by another server like + # HAProxy or NGINX, the IP address that made the original request will be put in + # an `X-Forwarded-For` header. If there are multiple proxies, that header may + # contain a list of IPs. Other proxy services set the `Client-Ip` header + # instead, so we check that too. + # + # As discussed in [this post about Rails IP + # Spoofing](https://web.archive.org/web/20170626095448/https://blog.gingerlime.com/2012/rails-ip-spoofing-vulnerabilities-and-protection/), + # while the first IP in the list is likely to be the "originating" IP, it + # could also have been set by the client maliciously. + # + # In order to find the first address that is (probably) accurate, we take the + # list of IPs, remove known and trusted proxies, and then take the last address + # left, which was presumably set by one of those proxies. + # + # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#129 + def calculate_ip; end + + # Memoizes the value returned by #calculate_ip and returns it for + # ActionDispatch::Request to use. + # + # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#173 + def to_s; end + + private + + # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#196 + def filter_proxies(ips); end + + # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#178 + def ips_from(header); end + + # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#184 + def sanitize_ips(ips); end +end + +# source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#34 +class ActionDispatch::RemoteIp::IpSpoofAttackError < ::StandardError; end + +# The default trusted IPs list simply includes IP addresses that are guaranteed +# by the IP specification to be private addresses. Those will not be the +# ultimate client IP in production, and so are discarded. See +# https://en.wikipedia.org/wiki/Private_network for details. +# +# source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#40 +ActionDispatch::RemoteIp::TRUSTED_PROXIES = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/http/request.rb#20 +class ActionDispatch::Request + include ::ActionDispatch::Flash::RequestMethods + include ::Rack::Request::Helpers + include ::ActionDispatch::Http::Cache::Request + include ::ActionDispatch::Http::MimeNegotiation + include ::ActionDispatch::Http::Parameters + include ::ActionDispatch::Http::FilterParameters + include ::ActionDispatch::Http::URL + include ::ActionDispatch::ContentSecurityPolicy::Request + include ::Rack::Request::Env + include ::ActionDispatch::PermissionsPolicy::Request + include ::ActionDispatch::RequestCookieMethods + extend ::ActionDispatch::Http::Parameters::ClassMethods + + # @return [Request] a new instance of Request + # + # source://actionpack//lib/action_dispatch/http/request.rb#63 + def initialize(env); end + + # Override Rack's GET method to support indifferent access. + # + # source://actionpack//lib/action_dispatch/http/request.rb#400 + def GET; end + + # Override Rack's POST method to support indifferent access. + # + # source://actionpack//lib/action_dispatch/http/request.rb#413 + def POST; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def accept; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def accept_charset; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def accept_encoding; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def accept_language; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def auth_type; end + + # Returns the authorization header regardless of whether it was specified + # directly or through one of the proxy alternatives. + # + # source://actionpack//lib/action_dispatch/http/request.rb#465 + def authorization; end + + # The request body is an IO input stream. If the RAW_POST_DATA environment + # variable is already set, wrap it in a StringIO. + # + # source://actionpack//lib/action_dispatch/http/request.rb#362 + def body; end + + # source://actionpack//lib/action_dispatch/http/request.rb#382 + def body_stream; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def cache_control; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def client_ip; end + + # source://actionpack//lib/action_dispatch/http/request.rb#78 + def commit_cookie_jar!; end + + # source://actionpack//lib/action_dispatch/http/request.rb#497 + def commit_csrf_token; end + + # source://actionpack//lib/action_dispatch/http/request.rb#486 + def commit_flash; end + + # Returns the content length of the request as an integer. + # + # source://actionpack//lib/action_dispatch/http/request.rb#297 + def content_length; end + + # source://actionpack//lib/action_dispatch/http/request.rb#87 + def controller_class; end + + # source://actionpack//lib/action_dispatch/http/request.rb#93 + def controller_class_for(name); end + + # source://actionpack//lib/action_dispatch/http/request.rb#195 + def controller_instance; end + + # source://actionpack//lib/action_dispatch/http/request.rb#199 + def controller_instance=(controller); end + + # source://actionpack//lib/action_dispatch/http/request.rb#181 + def engine_script_name(_routes); end + + # source://actionpack//lib/action_dispatch/http/request.rb#185 + def engine_script_name=(name); end + + # Determine whether the request body contains form-data by checking the request + # `Content-Type` for one of the media-types: `application/x-www-form-urlencoded` + # or `multipart/form-data`. The list of form-data media types can be modified + # through the `FORM_DATA_MEDIA_TYPES` array. + # + # A request body is not assumed to contain form-data when no `Content-Type` + # header is provided and the request_method is POST. + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/request.rb#378 + def form_data?; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def from; end + + # Returns the `String` full path including params of the last URL requested. + # + # # get "/articles" + # request.fullpath # => "/articles" + # + # # get "/articles?page=2" + # request.fullpath # => "/articles?page=2" + # + # source://actionpack//lib/action_dispatch/http/request.rb#276 + def fullpath; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def gateway_interface; end + + # Provides access to the request's HTTP headers, for example: + # + # request.headers["Content-Type"] # => "text/plain" + # + # source://actionpack//lib/action_dispatch/http/request.rb#237 + def headers; end + + # source://actionpack//lib/action_dispatch/http/request.rb#203 + def http_auth_salt; end + + # source://actionpack//lib/action_dispatch/http/request.rb#23 + def ignore_accept_header; end + + # source://actionpack//lib/action_dispatch/http/request.rb#23 + def ignore_accept_header=(val); end + + # source://actionpack//lib/action_dispatch/http/request.rb#489 + def inspect; end + + # Returns the IP address of client as a `String`. + # + # source://actionpack//lib/action_dispatch/http/request.rb#311 + def ip; end + + # Returns true if the request has a header matching the given key parameter. + # + # request.key? :ip_spoofing_check # => true + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/request.rb#114 + def key?(key); end + + # True if the request came from localhost, 127.0.0.1, or ::1. + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/request.rb#473 + def local?; end + + # source://actionpack//lib/action_dispatch/http/request.rb#482 + def logger; end + + # The `String` MIME type of the request. + # + # # get "/articles" + # request.media_type # => "application/x-www-form-urlencoded" + # + # source://actionpack//lib/action_dispatch/http/request.rb#292 + def media_type; end + + # Returns the original value of the environment's REQUEST_METHOD, even if it was + # overridden by middleware. See #request_method for more information. + # + # For debugging purposes, when called with arguments this method will fall back + # to Object#method + # + # source://actionpack//lib/action_dispatch/http/request.rb#217 + def method(*args, **_arg1); end + + # Returns a symbol form of the #method. + # + # source://actionpack//lib/action_dispatch/http/request.rb#230 + def method_symbol; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def negotiate; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def origin; end + + # Returns a `String` with the last requested path including their params. + # + # # get '/foo' + # request.original_fullpath # => '/foo' + # + # # get '/foo?bar' + # request.original_fullpath # => '/foo?bar' + # + # source://actionpack//lib/action_dispatch/http/request.rb#265 + def original_fullpath; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def original_script_name; end + + # Returns the original request URL as a `String`. + # + # # get "/articles?page=2" + # request.original_url # => "http://www.example.com/articles?page=2" + # + # source://actionpack//lib/action_dispatch/http/request.rb#284 + def original_url; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def path_translated; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def pragma; end + + # Override Rack's GET method to support indifferent access. + # + # source://actionpack//lib/action_dispatch/http/request.rb#410 + def query_parameters; end + + # Returns the value of attribute rack_request. + # + # source://actionpack//lib/action_dispatch/http/request.rb#76 + def rack_request; end + + # Read the request body. This is useful for web services that need to work with + # raw requests directly. + # + # source://actionpack//lib/action_dispatch/http/request.rb#353 + def raw_post; end + + # source://actionpack//lib/action_dispatch/http/request.rb#144 + def raw_request_method; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def remote_addr; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def remote_host; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def remote_ident; end + + # Returns the IP address of client as a `String`, usually set by the RemoteIp + # middleware. + # + # source://actionpack//lib/action_dispatch/http/request.rb#317 + def remote_ip; end + + # source://actionpack//lib/action_dispatch/http/request.rb#321 + def remote_ip=(remote_ip); end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def remote_user; end + + # Returns the unique request id, which is based on either the `X-Request-Id` + # header that can be generated by a firewall, load balancer, or web server, or + # by the RequestId middleware (which sets the `action_dispatch.request_id` + # environment variable). + # + # This unique ID is useful for tracing a request from end-to-end as part of + # logging or debugging. This relies on the Rack variable set by the + # ActionDispatch::RequestId middleware. + # + # source://actionpack//lib/action_dispatch/http/request.rb#336 + def request_id; end + + # source://actionpack//lib/action_dispatch/http/request.rb#340 + def request_id=(id); end + + # Returns the HTTP method that the application should see. In the case where the + # method was overridden by a middleware (for instance, if a HEAD request was + # converted to a GET, or if a _method parameter was used to determine the method + # the application should use), this method returns the overridden value, not the + # original. + # + # source://actionpack//lib/action_dispatch/http/request.rb#151 + def request_method; end + + # source://actionpack//lib/action_dispatch/http/request.rb#189 + def request_method=(request_method); end + + # Returns a symbol form of the #request_method. + # + # source://actionpack//lib/action_dispatch/http/request.rb#208 + def request_method_symbol; end + + # Override Rack's POST method to support indifferent access. + # + # source://actionpack//lib/action_dispatch/http/request.rb#440 + def request_parameters; end + + # source://actionpack//lib/action_dispatch/http/request.rb#477 + def request_parameters=(params); end + + # source://actionpack//lib/action_dispatch/http/request.rb#442 + def request_parameters_list; end + + # source://actionpack//lib/action_dispatch/http/request.rb#493 + def reset_csrf_token; end + + # source://actionpack//lib/action_dispatch/http/request.rb#386 + def reset_session; end + + # source://actionpack//lib/action_dispatch/http/request.rb#169 + def route=(route); end + + # Returns the URI pattern of the matched route for the request, using the same + # format as `bin/rails routes`: + # + # request.route_uri_pattern # => "/:controller(/:action(/:id))(.:format)" + # + # source://actionpack//lib/action_dispatch/http/request.rb#159 + def route_uri_pattern; end + + # source://actionpack//lib/action_dispatch/http/request.rb#173 + def routes; end + + # source://actionpack//lib/action_dispatch/http/request.rb#177 + def routes=(routes); end + + # Early Hints is an HTTP/2 status code that indicates hints to help a client + # start making preparations for processing the final response. + # + # If the env contains `rack.early_hints` then the server accepts HTTP2 push for + # link headers. + # + # The `send_early_hints` method accepts a hash of links as follows: + # + # send_early_hints("link" => "; rel=preload; as=style,; rel=preload") + # + # If you are using {javascript_include_tag}[rdoc-ref:ActionView::Helpers::AssetTagHelper#javascript_include_tag] + # or {stylesheet_link_tag}[rdoc-ref:ActionView::Helpers::AssetTagHelper#stylesheet_link_tag] + # the Early Hints headers are included by default if supported. + # + # source://actionpack//lib/action_dispatch/http/request.rb#254 + def send_early_hints(links); end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def server_name; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def server_protocol; end + + # Returns the lowercase name of the HTTP server software. + # + # source://actionpack//lib/action_dispatch/http/request.rb#347 + def server_software; end + + # source://actionpack//lib/action_dispatch/http/request.rb#391 + def session=(session); end + + # source://actionpack//lib/action_dispatch/http/request.rb#395 + def session_options=(options); end + + # Returns the unique request id, which is based on either the `X-Request-Id` + # header that can be generated by a firewall, load balancer, or web server, or + # by the RequestId middleware (which sets the `action_dispatch.request_id` + # environment variable). + # + # This unique ID is useful for tracing a request from end-to-end as part of + # logging or debugging. This relies on the Rack variable set by the + # ActionDispatch::RequestId middleware. + # + # source://actionpack//lib/action_dispatch/http/request.rb#344 + def uuid; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def version; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def x_csrf_token; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def x_forwarded_for; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def x_forwarded_host; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def x_request_id; end + + # Returns true if the `X-Requested-With` header contains "XMLHttpRequest" + # (case-insensitive), which may need to be manually added depending on the + # choice of JavaScript libraries and frameworks. + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/request.rb#308 + def xhr?; end + + # Returns true if the `X-Requested-With` header contains "XMLHttpRequest" + # (case-insensitive), which may need to be manually added depending on the + # choice of JavaScript libraries and frameworks. + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/request.rb#305 + def xml_http_request?; end + + private + + # source://actionpack//lib/action_dispatch/http/request.rb#502 + def check_method(name); end + + # source://actionpack//lib/action_dispatch/http/request.rb#510 + def default_session; end + + # source://actionpack//lib/action_dispatch/http/request.rb#540 + def fallback_request_parameters; end + + # source://actionpack//lib/action_dispatch/http/request.rb#514 + def read_body_stream; end + + # source://actionpack//lib/action_dispatch/http/request.rb#526 + def reset_stream(body_stream); end + + class << self + # source://actionpack//lib/action_dispatch/http/request.rb#59 + def empty; end + + # source://actionpack//lib/action_dispatch/http/request.rb#23 + def ignore_accept_header; end + + # source://actionpack//lib/action_dispatch/http/request.rb#23 + def ignore_accept_header=(val); end + + # source://actionpack//lib/action_dispatch/http/request.rb#24 + def parameter_parsers; end + end +end + +# source://actionpack//lib/action_dispatch/http/request.rb#326 +ActionDispatch::Request::ACTION_DISPATCH_REQUEST_ID = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/request.rb#35 +ActionDispatch::Request::ENV_METHODS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/http/request.rb#135 +ActionDispatch::Request::HTTP_METHODS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/http/request.rb#137 +ActionDispatch::Request::HTTP_METHOD_LOOKUP = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_dispatch/http/request.rb#33 +ActionDispatch::Request::LOCALHOST = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/http/request.rb#81 +class ActionDispatch::Request::PASS_NOT_FOUND + class << self + # source://actionpack//lib/action_dispatch/http/request.rb#82 + def action(_); end + + # source://actionpack//lib/action_dispatch/http/request.rb#84 + def action_encoding_template(action); end + + # source://actionpack//lib/action_dispatch/http/request.rb#83 + def call(_); end + end +end + +# HTTP methods from [RFC 2518: HTTP Extensions for Distributed Authoring -- WEBDAV](https://www.ietf.org/rfc/rfc2518.txt) +# +# source://actionpack//lib/action_dispatch/http/request.rb#121 +ActionDispatch::Request::RFC2518 = T.let(T.unsafe(nil), Array) + +# HTTP methods from [RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1](https://www.ietf.org/rfc/rfc2616.txt) +# +# source://actionpack//lib/action_dispatch/http/request.rb#119 +ActionDispatch::Request::RFC2616 = T.let(T.unsafe(nil), Array) + +# HTTP methods from [RFC 3253: Versioning Extensions to WebDAV](https://www.ietf.org/rfc/rfc3253.txt) +# +# source://actionpack//lib/action_dispatch/http/request.rb#123 +ActionDispatch::Request::RFC3253 = T.let(T.unsafe(nil), Array) + +# HTTP methods from [RFC 3648: WebDAV Ordered Collections Protocol](https://www.ietf.org/rfc/rfc3648.txt) +# +# source://actionpack//lib/action_dispatch/http/request.rb#125 +ActionDispatch::Request::RFC3648 = T.let(T.unsafe(nil), Array) + +# HTTP methods from [RFC 3744: WebDAV Access Control Protocol](https://www.ietf.org/rfc/rfc3744.txt) +# +# source://actionpack//lib/action_dispatch/http/request.rb#127 +ActionDispatch::Request::RFC3744 = T.let(T.unsafe(nil), Array) + +# HTTP methods from [RFC 4791: Calendaring Extensions to WebDAV](https://www.ietf.org/rfc/rfc4791.txt) +# +# source://actionpack//lib/action_dispatch/http/request.rb#131 +ActionDispatch::Request::RFC4791 = T.let(T.unsafe(nil), Array) + +# HTTP methods from [RFC 5323: WebDAV SEARCH](https://www.ietf.org/rfc/rfc5323.txt) +# +# source://actionpack//lib/action_dispatch/http/request.rb#129 +ActionDispatch::Request::RFC5323 = T.let(T.unsafe(nil), Array) + +# HTTP methods from [RFC 5789: PATCH Method for HTTP](https://www.ietf.org/rfc/rfc5789.txt) +# +# source://actionpack//lib/action_dispatch/http/request.rb#133 +ActionDispatch::Request::RFC5789 = T.let(T.unsafe(nil), Array) + +# Session is responsible for lazily loading the session from store. +# +# source://actionpack//lib/action_dispatch/request/session.rb#10 +class ActionDispatch::Request::Session + # @return [Session] a new instance of Session + # + # source://actionpack//lib/action_dispatch/request/session.rb#76 + def initialize(by, req, enabled: T.unsafe(nil)); end + + # Returns value of the key stored in the session or `nil` if the given key is + # not found in the session. + # + # source://actionpack//lib/action_dispatch/request/session.rb#114 + def [](key); end + + # Writes given value to given key of the session. + # + # source://actionpack//lib/action_dispatch/request/session.rb#154 + def []=(key, value); end + + # Clears the session. + # + # source://actionpack//lib/action_dispatch/request/session.rb#161 + def clear; end + + # Deletes given key from the session. + # + # source://actionpack//lib/action_dispatch/request/session.rb#194 + def delete(key); end + + # source://actionpack//lib/action_dispatch/request/session.rb#99 + def destroy; end + + # Returns the nested value specified by the sequence of keys, returning `nil` if + # any intermediate step is `nil`. + # + # source://actionpack//lib/action_dispatch/request/session.rb#127 + def dig(*keys); end + + # source://actionpack//lib/action_dispatch/request/session.rb#245 + def each(&block); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/request/session.rb#240 + def empty?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/request/session.rb#91 + def enabled?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/request/session.rb#230 + def exists?; end + + # Returns value of the given key from the session, or raises `KeyError` if can't + # find the given key and no default value is set. Returns default value if + # specified. + # + # session.fetch(:foo) + # # => KeyError: key not found: "foo" + # + # session.fetch(:foo, :bar) + # # => :bar + # + # session.fetch(:foo) do + # :bar + # end + # # => :bar + # + # source://actionpack//lib/action_dispatch/request/session.rb#213 + def fetch(key, default = T.unsafe(nil), &block); end + + # Returns true if the session has the given key or false. + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/request/session.rb#134 + def has_key?(key); end + + # source://actionpack//lib/action_dispatch/request/session.rb#87 + def id; end + + # source://actionpack//lib/action_dispatch/request/session.rb#249 + def id_was; end + + # Returns true if the session has the given key or false. + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/request/session.rb#139 + def include?(key); end + + # source://actionpack//lib/action_dispatch/request/session.rb#222 + def inspect; end + + # Returns true if the session has the given key or false. + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/request/session.rb#138 + def key?(key); end + + # Returns keys of the session as Array. + # + # source://actionpack//lib/action_dispatch/request/session.rb#142 + def keys; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/request/session.rb#236 + def loaded?; end + + # Updates the session with given Hash. + # + # session.to_hash + # # => {"session_id"=>"e29b9ea315edf98aad94cc78c34cc9b2"} + # + # session.update({ "foo" => "bar" }) + # # => {"session_id"=>"e29b9ea315edf98aad94cc78c34cc9b2", "foo" => "bar"} + # + # session.to_hash + # # => {"session_id"=>"e29b9ea315edf98aad94cc78c34cc9b2", "foo" => "bar"} + # + # source://actionpack//lib/action_dispatch/request/session.rb#191 + def merge!(hash); end + + # source://actionpack//lib/action_dispatch/request/session.rb#95 + def options; end + + # Writes given value to given key of the session. + # + # source://actionpack//lib/action_dispatch/request/session.rb#158 + def store(key, value); end + + # Returns the session as Hash. + # + # source://actionpack//lib/action_dispatch/request/session.rb#171 + def to_h; end + + # Returns the session as Hash. + # + # source://actionpack//lib/action_dispatch/request/session.rb#167 + def to_hash; end + + # Updates the session with given Hash. + # + # session.to_hash + # # => {"session_id"=>"e29b9ea315edf98aad94cc78c34cc9b2"} + # + # session.update({ "foo" => "bar" }) + # # => {"session_id"=>"e29b9ea315edf98aad94cc78c34cc9b2", "foo" => "bar"} + # + # session.to_hash + # # => {"session_id"=>"e29b9ea315edf98aad94cc78c34cc9b2", "foo" => "bar"} + # + # source://actionpack//lib/action_dispatch/request/session.rb#183 + def update(hash); end + + # Returns values of the session as Array. + # + # source://actionpack//lib/action_dispatch/request/session.rb#148 + def values; end + + private + + # source://actionpack//lib/action_dispatch/request/session.rb#271 + def load!; end + + # source://actionpack//lib/action_dispatch/request/session.rb#267 + def load_for_delete!; end + + # source://actionpack//lib/action_dispatch/request/session.rb#255 + def load_for_read!; end + + # source://actionpack//lib/action_dispatch/request/session.rb#259 + def load_for_write!; end + + class << self + # Creates a session hash, merging the properties of the previous session if any. + # + # source://actionpack//lib/action_dispatch/request/session.rb#19 + def create(store, req, default_options); end + + # source://actionpack//lib/action_dispatch/request/session.rb#43 + def delete(req); end + + # source://actionpack//lib/action_dispatch/request/session.rb#29 + def disabled(req); end + + # source://actionpack//lib/action_dispatch/request/session.rb#35 + def find(req); end + + # source://actionpack//lib/action_dispatch/request/session.rb#39 + def set(req, session); end + end +end + +# source://actionpack//lib/action_dispatch/request/session.rb#11 +class ActionDispatch::Request::Session::DisabledSessionError < ::StandardError; end + +# source://actionpack//lib/action_dispatch/request/session.rb#12 +ActionDispatch::Request::Session::ENV_SESSION_KEY = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/request/session.rb#13 +ActionDispatch::Request::Session::ENV_SESSION_OPTIONS_KEY = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/request/session.rb#47 +class ActionDispatch::Request::Session::Options + # @return [Options] a new instance of Options + # + # source://actionpack//lib/action_dispatch/request/session.rb#56 + def initialize(by, default_options); end + + # source://actionpack//lib/action_dispatch/request/session.rb#61 + def [](key); end + + # source://actionpack//lib/action_dispatch/request/session.rb#71 + def []=(k, v); end + + # source://actionpack//lib/action_dispatch/request/session.rb#65 + def id(req); end + + # source://actionpack//lib/action_dispatch/request/session.rb#72 + def to_hash; end + + # source://actionpack//lib/action_dispatch/request/session.rb#73 + def values_at(*args); end + + class << self + # source://actionpack//lib/action_dispatch/request/session.rb#52 + def find(req); end + + # source://actionpack//lib/action_dispatch/request/session.rb#48 + def set(req, options); end + end +end + +# Singleton object used to determine if an optional param wasn't specified. +# +# source://actionpack//lib/action_dispatch/request/session.rb#16 +ActionDispatch::Request::Session::Unspecified = T.let(T.unsafe(nil), Object) + +# source://actionpack//lib/action_dispatch/http/request.rb#57 +ActionDispatch::Request::TRANSFER_ENCODING = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/request/utils.rb#9 +class ActionDispatch::Request::Utils + # source://actionpack//lib/action_dispatch/request/utils.rb#10 + def perform_deep_munge; end + + # source://actionpack//lib/action_dispatch/request/utils.rb#10 + def perform_deep_munge=(val); end + + class << self + # source://actionpack//lib/action_dispatch/request/utils.rb#31 + def check_param_encoding(params); end + + # source://actionpack//lib/action_dispatch/request/utils.rb#12 + def each_param_value(params, &block); end + + # source://actionpack//lib/action_dispatch/request/utils.rb#23 + def normalize_encode_params(params); end + + # source://actionpack//lib/action_dispatch/request/utils.rb#10 + def perform_deep_munge; end + + # source://actionpack//lib/action_dispatch/request/utils.rb#10 + def perform_deep_munge=(val); end + + # source://actionpack//lib/action_dispatch/request/utils.rb#46 + def set_binary_encoding(request, params, controller, action); end + end +end + +# source://actionpack//lib/action_dispatch/request/utils.rb#85 +class ActionDispatch::Request::Utils::CustomParamEncoder + class << self + # source://actionpack//lib/action_dispatch/request/utils.rb#106 + def action_encoding_template(request, controller, action); end + + # source://actionpack//lib/action_dispatch/request/utils.rb#101 + def encode(request, params, controller, action); end + + # source://actionpack//lib/action_dispatch/request/utils.rb#86 + def encode_for_template(params, encoding_template); end + end +end + +# Remove nils from the params hash. +# +# source://actionpack//lib/action_dispatch/request/utils.rb#77 +class ActionDispatch::Request::Utils::NoNilParamEncoder < ::ActionDispatch::Request::Utils::ParamEncoder + class << self + # source://actionpack//lib/action_dispatch/request/utils.rb#78 + def handle_array(params); end + end +end + +# source://actionpack//lib/action_dispatch/request/utils.rb#50 +class ActionDispatch::Request::Utils::ParamEncoder + class << self + # source://actionpack//lib/action_dispatch/request/utils.rb#71 + def handle_array(params); end + + # Convert nested Hash to HashWithIndifferentAccess. + # + # source://actionpack//lib/action_dispatch/request/utils.rb#52 + def normalize_encode_params(params); end + end +end + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#12 +module ActionDispatch::RequestCookieMethods + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#50 + def authenticated_encrypted_cookie_salt; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#13 + def cookie_jar; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#30 + def cookie_jar=(jar); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#78 + def cookies_digest; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#82 + def cookies_rotations; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#74 + def cookies_same_site_protection; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#70 + def cookies_serializer; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#58 + def encrypted_cookie_cipher; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#42 + def encrypted_cookie_salt; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#46 + def encrypted_signed_cookie_salt; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#26 + def have_cookie_jar?; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#34 + def key_generator; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#66 + def secret_key_base; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#62 + def signed_cookie_digest; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#38 + def signed_cookie_salt; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#54 + def use_authenticated_cookie_encryption; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#86 + def use_cookies_with_metadata; end +end + +# source://actionpack//lib/action_dispatch/testing/request_encoder.rb#9 +class ActionDispatch::RequestEncoder + # @return [RequestEncoder] a new instance of RequestEncoder + # + # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#21 + def initialize(mime_name, param_encoder, response_parser, content_type); end + + # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#34 + def accept_header; end + + # Returns the value of attribute content_type. + # + # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#19 + def content_type; end + + # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#38 + def encode_params(params); end + + # Returns the value of attribute response_parser. + # + # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#19 + def response_parser; end + + class << self + # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#47 + def encoder(name); end + + # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#42 + def parser(content_type); end + + # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#51 + def register_encoder(mime_name, param_encoder: T.unsafe(nil), response_parser: T.unsafe(nil), content_type: T.unsafe(nil)); end + end +end + +# source://actionpack//lib/action_dispatch/testing/request_encoder.rb#10 +class ActionDispatch::RequestEncoder::IdentityEncoder + # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#12 + def accept_header; end + + # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#11 + def content_type; end + + # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#13 + def encode_params(params); end + + # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#14 + def response_parser; end +end + +# source://actionpack//lib/action_dispatch/testing/integration.rb#670 +class ActionDispatch::RequestEncoder::TurboStreamEncoder < ::ActionDispatch::RequestEncoder::IdentityEncoder + # source://actionpack//lib/action_dispatch/testing/integration.rb#670 + def accept_header; end +end + +# # Action Dispatch RequestId +# +# Makes a unique request id available to the `action_dispatch.request_id` env +# variable (which is then accessible through ActionDispatch::Request#request_id +# or the alias ActionDispatch::Request#uuid) and sends the same id to the client +# via the `X-Request-Id` header. +# +# The unique request id is either based on the `X-Request-Id` header in the +# request, which would typically be generated by a firewall, load balancer, or +# the web server, or, if this header is not available, a random uuid. If the +# header is accepted from the outside world, we sanitize it to a max of 255 +# chars and alphanumeric and dashes only. +# +# The unique request id can be used to trace a request end-to-end and would +# typically end up being part of log files from multiple pieces of the stack. +# +# source://actionpack//lib/action_dispatch/middleware/request_id.rb#24 +class ActionDispatch::RequestId + # @return [RequestId] a new instance of RequestId + # + # source://actionpack//lib/action_dispatch/middleware/request_id.rb#25 + def initialize(app, header:); end + + # source://actionpack//lib/action_dispatch/middleware/request_id.rb#31 + def call(env); end + + private + + # source://actionpack//lib/action_dispatch/middleware/request_id.rb#46 + def internal_request_id; end + + # source://actionpack//lib/action_dispatch/middleware/request_id.rb#38 + def make_request_id(request_id); end +end + +# # Action Dispatch Response +# +# Represents an HTTP response generated by a controller action. Use it to +# retrieve the current state of the response, or customize the response. It can +# either represent a real HTTP response (i.e. one that is meant to be sent back +# to the web browser) or a TestResponse (i.e. one that is generated from +# integration tests). +# +# The Response object for the current request is exposed on controllers as +# ActionController::Metal#response. ActionController::Metal also provides a few +# additional methods that delegate to attributes of the Response such as +# ActionController::Metal#headers. +# +# Integration tests will likely also want to inspect responses in more detail. +# Methods such as Integration::RequestHelpers#get and +# Integration::RequestHelpers#post return instances of TestResponse (which +# inherits from Response) for this purpose. +# +# For example, the following demo integration test prints the body of the +# controller response to the console: +# +# class DemoControllerTest < ActionDispatch::IntegrationTest +# def test_print_root_path_to_console +# get('/') +# puts response.body +# end +# end +# +# source://actionpack//lib/action_dispatch/http/response.rb#38 +class ActionDispatch::Response + include ::Rack::Response::Helpers + include ::ActionDispatch::Http::FilterRedirect + include ::ActionDispatch::Http::Cache::Response + include ::MonitorMixin + + # @return [Response] a new instance of Response + # @yield [_self] + # @yieldparam _self [ActionDispatch::Response] the object that the method was called on + # + # source://actionpack//lib/action_dispatch/http/response.rb#197 + def initialize(status = T.unsafe(nil), headers = T.unsafe(nil), body = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/http/response.rb#89 + def [](*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_dispatch/http/response.rb#89 + def []=(*_arg0, **_arg1, &_arg2); end + + # Aliasing these off because AD::Http::Cache::Response defines them. + # + # source://actionpack//lib/action_dispatch/http/response.rb#107 + def _cache_control; end + + # source://actionpack//lib/action_dispatch/http/response.rb#108 + def _cache_control=(value); end + + # source://actionpack//lib/action_dispatch/http/response.rb#446 + def abort; end + + # source://actionpack//lib/action_dispatch/http/response.rb#223 + def await_commit; end + + # source://actionpack//lib/action_dispatch/http/response.rb#229 + def await_sent; end + + # Returns the content of the response as a string. This contains the contents of + # any calls to `render`. + # + # source://actionpack//lib/action_dispatch/http/response.rb#369 + def body; end + + # Allows you to manually set or override the response body. + # + # source://actionpack//lib/action_dispatch/http/response.rb#384 + def body=(body); end + + # source://actionpack//lib/action_dispatch/http/response.rb#433 + def body_parts; end + + # The charset of the response. HTML wants to know the encoding of the content + # you're giving them, so we need to send that along. + # + # source://actionpack//lib/action_dispatch/http/response.rb#339 + def charset; end + + # Sets the HTTP character set. In case of `nil` parameter it sets the charset to + # `default_charset`. + # + # response.charset = 'utf-16' # => 'utf-16' + # response.charset = nil # => 'utf-8' + # + # source://actionpack//lib/action_dispatch/http/response.rb#328 + def charset=(charset); end + + # source://actionpack//lib/action_dispatch/http/response.rb#442 + def close; end + + # Returns a string to ensure compatibility with `Net::HTTPResponse`. + # + # source://actionpack//lib/action_dispatch/http/response.rb#350 + def code; end + + # source://actionpack//lib/action_dispatch/http/response.rb#233 + def commit!; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/response.rb#257 + def committed?; end + + # Content type of response. + # + # source://actionpack//lib/action_dispatch/http/response.rb#308 + def content_type; end + + # Sets the HTTP response's content MIME type. For example, in the controller you + # could write this: + # + # response.content_type = "text/html" + # + # This method also accepts a symbol with the extension of the MIME type: + # + # response.content_type = :html + # + # If a character set has been defined for this response (see #charset=) then the + # character set information will also be included in the content type + # information. + # + # source://actionpack//lib/action_dispatch/http/response.rb#289 + def content_type=(content_type); end + + # Returns the response cookies, converted to a Hash of (name => value) pairs + # + # assert_equal 'AuthorOfNewPage', r.cookies['author'] + # + # source://actionpack//lib/action_dispatch/http/response.rb#469 + def cookies; end + + # source://actionpack//lib/action_dispatch/http/response.rb#102 + def default_charset; end + + # source://actionpack//lib/action_dispatch/http/response.rb#102 + def default_charset=(val); end + + # source://actionpack//lib/action_dispatch/http/response.rb#103 + def default_headers; end + + # source://actionpack//lib/action_dispatch/http/response.rb#103 + def default_headers=(val); end + + # source://actionpack//lib/action_dispatch/http/response.rb#221 + def delete_header(key); end + + # source://actionpack//lib/action_dispatch/http/response.rb#91 + def each(&block); end + + # source://actionpack//lib/action_dispatch/http/response.rb#219 + def get_header(key); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/response.rb#218 + def has_header?(key); end + + # The headers for the response. + # + # header["Content-Type"] # => "text/plain" + # header["Content-Type"] = "application/json" + # header["Content-Type"] # => "application/json" + # + # Also aliased as `headers`. + # + # headers["Content-Type"] # => "text/plain" + # headers["Content-Type"] = "application/json" + # headers["Content-Type"] # => "application/json" + # + # Also aliased as `header` for compatibility. + # + # source://actionpack//lib/action_dispatch/http/response.rb#87 + def header; end + + # The headers for the response. + # + # header["Content-Type"] # => "text/plain" + # header["Content-Type"] = "application/json" + # header["Content-Type"] # => "application/json" + # + # Also aliased as `headers`. + # + # headers["Content-Type"] # => "text/plain" + # headers["Content-Type"] = "application/json" + # headers["Content-Type"] # => "application/json" + # + # Also aliased as `header` for compatibility. + # + # source://actionpack//lib/action_dispatch/http/response.rb#85 + def headers; end + + # Media type of response. + # + # source://actionpack//lib/action_dispatch/http/response.rb#313 + def media_type; end + + # Returns the corresponding message for the current HTTP status code: + # + # response.status = 200 + # response.message # => "OK" + # + # response.status = 404 + # response.message # => "Not Found" + # + # source://actionpack//lib/action_dispatch/http/response.rb#362 + def message; end + + # Turns the Response into a Rack-compatible array of the status, headers, and + # body. Allows explicit splatting: + # + # status, headers, body = *response + # + # source://actionpack//lib/action_dispatch/http/response.rb#464 + def prepare!; end + + # The location header we'll be responding with. + # + # source://actionpack//lib/action_dispatch/http/response.rb#440 + def redirect_url; end + + # The request that the response is responding to. + # + # source://actionpack//lib/action_dispatch/http/response.rb#67 + def request; end + + # The request that the response is responding to. + # + # source://actionpack//lib/action_dispatch/http/response.rb#67 + def request=(_arg0); end + + # source://actionpack//lib/action_dispatch/http/response.rb#429 + def reset_body!; end + + # The response code of the request. + # + # source://actionpack//lib/action_dispatch/http/response.rb#345 + def response_code; end + + # Send the file stored at `path` as the response body. + # + # source://actionpack//lib/action_dispatch/http/response.rb#424 + def send_file(path); end + + # source://actionpack//lib/action_dispatch/http/response.rb#241 + def sending!; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/response.rb#256 + def sending?; end + + # source://actionpack//lib/action_dispatch/http/response.rb#317 + def sending_file=(v); end + + # source://actionpack//lib/action_dispatch/http/response.rb#249 + def sent!; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/response.rb#258 + def sent?; end + + # source://actionpack//lib/action_dispatch/http/response.rb#220 + def set_header(key, v); end + + # The HTTP status code. + # + # source://actionpack//lib/action_dispatch/http/response.rb#70 + def status; end + + # Sets the HTTP status code. + # + # source://actionpack//lib/action_dispatch/http/response.rb#273 + def status=(status); end + + # Returns the corresponding message for the current HTTP status code: + # + # response.status = 200 + # response.message # => "OK" + # + # response.status = 404 + # response.message # => "Not Found" + # + # source://actionpack//lib/action_dispatch/http/response.rb#365 + def status_message; end + + # The underlying body, as a streamable object. + # + # source://actionpack//lib/action_dispatch/http/response.rb#195 + def stream; end + + # Turns the Response into a Rack-compatible array of the status, headers, and + # body. Allows explicit splatting: + # + # status, headers, body = *response + # + # source://actionpack//lib/action_dispatch/http/response.rb#460 + def to_a; end + + # source://actionpack//lib/action_dispatch/http/response.rb#379 + def write(string); end + + private + + # source://actionpack//lib/action_dispatch/http/response.rb#535 + def assign_default_content_type_and_charset!; end + + # source://actionpack//lib/action_dispatch/http/response.rb#513 + def before_committed; end + + # source://actionpack//lib/action_dispatch/http/response.rb#521 + def before_sending; end + + # source://actionpack//lib/action_dispatch/http/response.rb#531 + def build_buffer(response, body); end + + # source://actionpack//lib/action_dispatch/http/response.rb#587 + def handle_no_content!; end + + # source://actionpack//lib/action_dispatch/http/response.rb#493 + def parse_content_type(content_type); end + + # Small internal convenience method to get the parsed version of the current + # content type header. + # + # source://actionpack//lib/action_dispatch/http/response.rb#503 + def parsed_content_type_header; end + + # source://actionpack//lib/action_dispatch/http/response.rb#594 + def rack_response(status, headers); end + + # source://actionpack//lib/action_dispatch/http/response.rb#507 + def set_content_type(content_type, charset); end + + class << self + # source://actionpack//lib/action_dispatch/http/response.rb#185 + def create(status = T.unsafe(nil), headers = T.unsafe(nil), body = T.unsafe(nil), default_headers: T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/http/response.rb#102 + def default_charset; end + + # source://actionpack//lib/action_dispatch/http/response.rb#102 + def default_charset=(val); end + + # source://actionpack//lib/action_dispatch/http/response.rb#103 + def default_headers; end + + # source://actionpack//lib/action_dispatch/http/response.rb#103 + def default_headers=(val); end + + # source://actionpack//lib/action_dispatch/http/response.rb#190 + def merge_default_headers(original, default); end + + # source://actionpack//lib/action_dispatch/http/response.rb#51 + def rack_status_code(status); end + end +end + +# source://actionpack//lib/action_dispatch/http/response.rb#114 +class ActionDispatch::Response::Buffer + # @return [Buffer] a new instance of Buffer + # + # source://actionpack//lib/action_dispatch/http/response.rb#115 + def initialize(response, buf); end + + # @raise [IOError] + # + # source://actionpack//lib/action_dispatch/http/response.rb#155 + def <<(string); end + + # source://actionpack//lib/action_dispatch/http/response.rb#167 + def abort; end + + # source://actionpack//lib/action_dispatch/http/response.rb#140 + def body; end + + # source://actionpack//lib/action_dispatch/http/response.rb#170 + def close; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/response.rb#175 + def closed?; end + + # source://actionpack//lib/action_dispatch/http/response.rb#157 + def each(&block); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/response.rb#124 + def respond_to?(method, include_private = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/http/response.rb#132 + def to_ary; end + + # @raise [IOError] + # + # source://actionpack//lib/action_dispatch/http/response.rb#148 + def write(string); end + + private + + # source://actionpack//lib/action_dispatch/http/response.rb#180 + def each_chunk(&block); end +end + +# source://actionpack//lib/action_dispatch/http/response.rb#122 +ActionDispatch::Response::Buffer::BODY_METHODS = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_dispatch/http/response.rb#98 +ActionDispatch::Response::CONTENT_TYPE = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/response.rb#487 +ActionDispatch::Response::CONTENT_TYPE_PARSER = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/http/response.rb#484 +class ActionDispatch::Response::ContentTypeHeader < ::Struct + # Returns the value of attribute charset + # + # @return [Object] the current value of charset + # + # source://actionpack//lib/action_dispatch/http/response.rb#484 + def charset; end + + # Sets the attribute charset + # + # @param value [Object] the value to set the attribute charset to. + # @return [Object] the newly set value + # + # source://actionpack//lib/action_dispatch/http/response.rb#484 + def charset=(_); end + + # Returns the value of attribute mime_type + # + # @return [Object] the current value of mime_type + # + # source://actionpack//lib/action_dispatch/http/response.rb#484 + def mime_type; end + + # Sets the attribute mime_type + # + # @param value [Object] the value to set the attribute mime_type to. + # @return [Object] the newly set value + # + # source://actionpack//lib/action_dispatch/http/response.rb#484 + def mime_type=(_); end + + class << self + # source://actionpack//lib/action_dispatch/http/response.rb#484 + def [](*_arg0); end + + # source://actionpack//lib/action_dispatch/http/response.rb#484 + def inspect; end + + # source://actionpack//lib/action_dispatch/http/response.rb#484 + def keyword_init?; end + + # source://actionpack//lib/action_dispatch/http/response.rb#484 + def members; end + + # source://actionpack//lib/action_dispatch/http/response.rb#484 + def new(*_arg0); end + end +end + +# Avoid having to pass an open file handle as the response body. Rack::Sendfile +# will usually intercept the response and uses the path directly, so there is no +# reason to open the file. +# +# source://actionpack//lib/action_dispatch/http/response.rb#402 +class ActionDispatch::Response::FileBody + # @return [FileBody] a new instance of FileBody + # + # source://actionpack//lib/action_dispatch/http/response.rb#405 + def initialize(path); end + + # source://actionpack//lib/action_dispatch/http/response.rb#409 + def body; end + + # Stream the file's contents if Rack::Sendfile isn't present. + # + # source://actionpack//lib/action_dispatch/http/response.rb#414 + def each; end + + # source://actionpack//lib/action_dispatch/http/response.rb#403 + def to_path; end +end + +# To be deprecated: +# +# source://actionpack//lib/action_dispatch/http/response.rb#64 +ActionDispatch::Response::Header = Rack::Headers + +# source://actionpack//lib/action_dispatch/http/response.rb#42 +ActionDispatch::Response::Headers = Rack::Headers + +# source://actionpack//lib/action_dispatch/http/response.rb#100 +ActionDispatch::Response::NO_CONTENT_CODES = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/http/response.rb#485 +ActionDispatch::Response::NullContentTypeHeader = T.let(T.unsafe(nil), ActionDispatch::Response::ContentTypeHeader) + +# source://actionpack//lib/action_dispatch/http/response.rb#543 +class ActionDispatch::Response::RackBody + # @return [RackBody] a new instance of RackBody + # + # source://actionpack//lib/action_dispatch/http/response.rb#544 + def initialize(response); end + + # source://actionpack//lib/action_dispatch/http/response.rb#556 + def body; end + + # source://actionpack//lib/action_dispatch/http/response.rb#578 + def call(*arguments, &block); end + + # source://actionpack//lib/action_dispatch/http/response.rb#550 + def close; end + + # source://actionpack//lib/action_dispatch/http/response.rb#574 + def each(*args, &block); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/response.rb#562 + def respond_to?(method, include_private = T.unsafe(nil)); end + + # Returns the value of attribute response. + # + # source://actionpack//lib/action_dispatch/http/response.rb#548 + def response; end + + # source://actionpack//lib/action_dispatch/http/response.rb#570 + def to_ary; end + + # source://actionpack//lib/action_dispatch/http/response.rb#582 + def to_path; end +end + +# source://actionpack//lib/action_dispatch/http/response.rb#560 +ActionDispatch::Response::RackBody::BODY_METHODS = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_dispatch/http/response.rb#99 +ActionDispatch::Response::SET_COOKIE = T.let(T.unsafe(nil), String) + +# The routing module provides URL rewriting in native Ruby. It's a way to +# redirect incoming requests to controllers and actions. This replaces +# mod_rewrite rules. Best of all, Rails' Routing works with any web server. +# Routes are defined in `config/routes.rb`. +# +# Think of creating routes as drawing a map for your requests. The map tells +# them where to go based on some predefined pattern: +# +# Rails.application.routes.draw do +# Pattern 1 tells some request to go to one place +# Pattern 2 tell them to go to another +# ... +# end +# +# The following symbols are special: +# +# :controller maps to your controller name +# :action maps to an action with your controllers +# +# Other names simply map to a parameter as in the case of `:id`. +# +# ## Resources +# +# Resource routing allows you to quickly declare all of the common routes for a +# given resourceful controller. Instead of declaring separate routes for your +# `index`, `show`, `new`, `edit`, `create`, `update`, and `destroy` actions, a +# resourceful route declares them in a single line of code: +# +# resources :photos +# +# Sometimes, you have a resource that clients always look up without referencing +# an ID. A common example, /profile always shows the profile of the currently +# logged in user. In this case, you can use a singular resource to map /profile +# (rather than /profile/:id) to the show action. +# +# resource :profile +# +# It's common to have resources that are logically children of other resources: +# +# resources :magazines do +# resources :ads +# end +# +# You may wish to organize groups of controllers under a namespace. Most +# commonly, you might group a number of administrative controllers under an +# `admin` namespace. You would place these controllers under the +# `app/controllers/admin` directory, and you can group them together in your +# router: +# +# namespace "admin" do +# resources :posts, :comments +# end +# +# Alternatively, you can add prefixes to your path without using a separate +# directory by using `scope`. `scope` takes additional options which apply to +# all enclosed routes. +# +# scope path: "/cpanel", as: 'admin' do +# resources :posts, :comments +# end +# +# For more, see Routing::Mapper::Resources#resources, +# Routing::Mapper::Scoping#namespace, and Routing::Mapper::Scoping#scope. +# +# ## Non-resourceful routes +# +# For routes that don't fit the `resources` mold, you can use the HTTP helper +# methods `get`, `post`, `patch`, `put` and `delete`. +# +# get 'post/:id', to: 'posts#show' +# post 'post/:id', to: 'posts#create_comment' +# +# Now, if you POST to `/posts/:id`, it will route to the `create_comment` +# action. A GET on the same URL will route to the `show` action. +# +# If your route needs to respond to more than one HTTP method (or all methods) +# then using the `:via` option on `match` is preferable. +# +# match 'post/:id', to: 'posts#show', via: [:get, :post] +# +# ## Named routes +# +# Routes can be named by passing an `:as` option, allowing for easy reference +# within your source as `name_of_route_url` for the full URL and +# `name_of_route_path` for the URI path. +# +# Example: +# +# # In config/routes.rb +# get '/login', to: 'accounts#login', as: 'login' +# +# # With render, redirect_to, tests, etc. +# redirect_to login_url +# +# Arguments can be passed as well. +# +# redirect_to show_item_path(id: 25) +# +# Use `root` as a shorthand to name a route for the root path "/". +# +# # In config/routes.rb +# root to: 'blogs#index' +# +# # would recognize http://www.example.com/ as +# params = { controller: 'blogs', action: 'index' } +# +# # and provide these named routes +# root_url # => 'http://www.example.com/' +# root_path # => '/' +# +# Note: when using `controller`, the route is simply named after the method you +# call on the block parameter rather than map. +# +# # In config/routes.rb +# controller :blog do +# get 'blog/show' => :list +# get 'blog/delete' => :delete +# get 'blog/edit' => :edit +# end +# +# # provides named routes for show, delete, and edit +# link_to @article.title, blog_show_path(id: @article.id) +# +# ## Pretty URLs +# +# Routes can generate pretty URLs. For example: +# +# get '/articles/:year/:month/:day', to: 'articles#find_by_id', constraints: { +# year: /\d{4}/, +# month: /\d{1,2}/, +# day: /\d{1,2}/ +# } +# +# Using the route above, the URL "http://localhost:3000/articles/2005/11/06" +# maps to +# +# params = {year: '2005', month: '11', day: '06'} +# +# ## Regular Expressions and parameters +# You can specify a regular expression to define a format for a parameter. +# +# controller 'geocode' do +# get 'geocode/:postalcode', to: :show, constraints: { +# postalcode: /\d{5}(-\d{4})?/ +# } +# end +# +# Constraints can include the 'ignorecase' and 'extended syntax' regular +# expression modifiers: +# +# controller 'geocode' do +# get 'geocode/:postalcode', to: :show, constraints: { +# postalcode: /hx\d\d\s\d[a-z]{2}/i +# } +# end +# +# controller 'geocode' do +# get 'geocode/:postalcode', to: :show, constraints: { +# postalcode: /# Postalcode format +# \d{5} #Prefix +# (-\d{4})? #Suffix +# /x +# } +# end +# +# Using the multiline modifier will raise an `ArgumentError`. Encoding regular +# expression modifiers are silently ignored. The match will always use the +# default encoding or ASCII. +# +# ## External redirects +# +# You can redirect any path to another path using the redirect helper in your +# router: +# +# get "/stories", to: redirect("/posts") +# +# ## Unicode character routes +# +# You can specify unicode character routes in your router: +# +# get "こんにちは", to: "welcome#index" +# +# ## Routing to Rack Applications +# +# Instead of a String, like `posts#index`, which corresponds to the index action +# in the PostsController, you can specify any Rack application as the endpoint +# for a matcher: +# +# get "/application.js", to: Sprockets +# +# ## Reloading routes +# +# You can reload routes if you feel you must: +# +# Rails.application.reload_routes! +# +# This will clear all named routes and reload config/routes.rb if the file has +# been modified from last load. To absolutely force reloading, use `reload!`. +# +# ## Testing Routes +# +# The two main methods for testing your routes: +# +# ### `assert_routing` +# +# def test_movie_route_properly_splits +# opts = {controller: "plugin", action: "checkout", id: "2"} +# assert_routing "plugin/checkout/2", opts +# end +# +# `assert_routing` lets you test whether or not the route properly resolves into +# options. +# +# ### `assert_recognizes` +# +# def test_route_has_options +# opts = {controller: "plugin", action: "show", id: "12"} +# assert_recognizes opts, "/plugins/show/12" +# end +# +# Note the subtle difference between the two: `assert_routing` tests that a URL +# fits options while `assert_recognizes` tests that a URL breaks into parameters +# properly. +# +# In tests you can simply pass the URL or named route to `get` or `post`. +# +# def send_to_jail +# get '/jail' +# assert_response :success +# end +# +# def goes_to_login +# get login_url +# #... +# end +# +# ## View a list of all your routes +# +# $ bin/rails routes +# +# Target a specific controller with `-c`, or grep routes using `-g`. Useful in +# conjunction with `--expanded` which displays routes vertically. +# +# source://actionpack//lib/action_dispatch/routing.rb#248 +module ActionDispatch::Routing + extend ::ActiveSupport::Autoload +end + +# source://actionpack//lib/action_dispatch/routing/inspector.rb#158 +module ActionDispatch::Routing::ConsoleFormatter; end + +# source://actionpack//lib/action_dispatch/routing/inspector.rb#159 +class ActionDispatch::Routing::ConsoleFormatter::Base + # @return [Base] a new instance of Base + # + # source://actionpack//lib/action_dispatch/routing/inspector.rb#160 + def initialize; end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#177 + def footer(routes); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#174 + def header(routes); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#180 + def no_routes(engine, routes, filter); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#164 + def result; end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#171 + def section(routes); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#168 + def section_title(title); end +end + +# source://actionpack//lib/action_dispatch/routing/inspector.rb#244 +class ActionDispatch::Routing::ConsoleFormatter::Expanded < ::ActionDispatch::Routing::ConsoleFormatter::Base + # @return [Expanded] a new instance of Expanded + # + # source://actionpack//lib/action_dispatch/routing/inspector.rb#245 + def initialize(width: T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#258 + def footer(routes); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#254 + def section(routes); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#250 + def section_title(title); end + + private + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#263 + def draw_expanded_section(routes); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#278 + def route_header(index:); end +end + +# source://actionpack//lib/action_dispatch/routing/inspector.rb#204 +class ActionDispatch::Routing::ConsoleFormatter::Sheet < ::ActionDispatch::Routing::ConsoleFormatter::Base + # source://actionpack//lib/action_dispatch/routing/inspector.rb#217 + def footer(routes); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#213 + def header(routes); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#209 + def section(routes); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#205 + def section_title(title); end + + private + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#231 + def draw_header(routes); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#222 + def draw_section(routes); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#237 + def widths(routes); end +end + +# source://actionpack//lib/action_dispatch/routing/inspector.rb#283 +class ActionDispatch::Routing::ConsoleFormatter::Unused < ::ActionDispatch::Routing::ConsoleFormatter::Sheet + # source://actionpack//lib/action_dispatch/routing/inspector.rb#284 + def header(routes); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#292 + def no_routes(engine, routes, filter); end +end + +# source://actionpack//lib/action_dispatch/routing/endpoint.rb#7 +class ActionDispatch::Routing::Endpoint + # source://actionpack//lib/action_dispatch/routing/endpoint.rb#11 + def app; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/endpoint.rb#8 + def dispatcher?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/endpoint.rb#14 + def engine?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/endpoint.rb#10 + def matches?(req); end + + # source://actionpack//lib/action_dispatch/routing/endpoint.rb#12 + def rack_app; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/endpoint.rb#9 + def redirect?; end +end + +# source://actionpack//lib/action_dispatch/routing.rb#260 +ActionDispatch::Routing::HTTP_METHODS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/routing/inspector.rb#305 +class ActionDispatch::Routing::HtmlTableFormatter + # @return [HtmlTableFormatter] a new instance of HtmlTableFormatter + # + # source://actionpack//lib/action_dispatch/routing/inspector.rb#306 + def initialize(view); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#323 + def footer(routes); end + + # The header is part of the HTML page, so we don't construct it here. + # + # source://actionpack//lib/action_dispatch/routing/inspector.rb#320 + def header(routes); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#326 + def no_routes(*_arg0); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#339 + def result; end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#315 + def section(routes); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#311 + def section_title(title); end +end + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#14 +class ActionDispatch::Routing::Mapper + include ::ActionDispatch::Routing::Mapper::Base + include ::ActionDispatch::Routing::Mapper::HttpHelpers + include ::ActionDispatch::Routing::Redirection + include ::ActionDispatch::Routing::Mapper::Scoping + include ::ActionDispatch::Routing::Mapper::Concerns + include ::ActionDispatch::Routing::Mapper::Resources + include ::ActionDispatch::Routing::Mapper::CustomUrls + + # @return [Mapper] a new instance of Mapper + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2530 + def initialize(set); end + + class << self + # source://actionpack//lib/action_dispatch/routing/mapper.rb#27 + def backtrace_cleaner; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#27 + def backtrace_cleaner=(val); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#407 + def normalize_name(name); end + + # Invokes Journey::Router::Utils.normalize_path, then ensures that /(:locale) + # becomes (/:locale). Except for root cases, where the former is the correct + # one. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#392 + def normalize_path(path); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#26 + def route_source_locations; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#26 + def route_source_locations=(val); end + end +end + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#15 +class ActionDispatch::Routing::Mapper::BacktraceCleaner < ::ActiveSupport::BacktraceCleaner + # @return [BacktraceCleaner] a new instance of BacktraceCleaner + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#16 + def initialize; end +end + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#411 +module ActionDispatch::Routing::Mapper::Base + # source://actionpack//lib/action_dispatch/routing/mapper.rb#653 + def default_url_options(options); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#650 + def default_url_options=(options); end + + # Query if the following named route was already defined. + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#662 + def has_named_route?(name); end + + # Matches a URL pattern to one or more routes. + # + # You should not use the `match` method in your router without specifying an + # HTTP method. + # + # If you want to expose your action to both GET and POST, use: + # + # # sets :controller, :action, and :id in params + # match ':controller/:action/:id', via: [:get, :post] + # + # Note that `:controller`, `:action`, and `:id` are interpreted as URL query + # parameters and thus available through `params` in an action. + # + # If you want to expose your action to GET, use `get` in the router: + # + # Instead of: + # + # match ":controller/:action/:id" + # + # Do: + # + # get ":controller/:action/:id" + # + # Two of these symbols are special, `:controller` maps to the controller and + # `:action` to the controller's action. A pattern can also map wildcard segments + # (globs) to params: + # + # get 'songs/*category/:title', to: 'songs#show' + # + # # 'songs/rock/classic/stairway-to-heaven' sets + # # params[:category] = 'rock/classic' + # # params[:title] = 'stairway-to-heaven' + # + # To match a wildcard parameter, it must have a name assigned to it. Without a + # variable name to attach the glob parameter to, the route can't be parsed. + # + # When a pattern points to an internal route, the route's `:action` and + # `:controller` should be set in options or hash shorthand. Examples: + # + # match 'photos/:id', to: 'photos#show', via: :get + # match 'photos/:id', controller: 'photos', action: 'show', via: :get + # + # A pattern can also point to a `Rack` endpoint i.e. anything that responds to + # `call`: + # + # match 'photos/:id', to: -> (hash) { [200, {}, ["Coming soon"]] }, via: :get + # match 'photos/:id', to: PhotoRackApp, via: :get + # # Yes, controller actions are just rack endpoints + # match 'photos/:id', to: PhotosController.action(:show), via: :get + # + # Because requesting various HTTP verbs with a single action has security + # implications, you must either specify the actions in the via options or use + # one of the [HttpHelpers](rdoc-ref:HttpHelpers) instead `match` + # + # ### Options + # + # Any options not seen here are passed on as params with the URL. + # + # :controller + # + # :action + # + # :param + # segment used to generate the routes). You can access that segment from + # your controller using `params[<:param>]`. In your router: + # + # resources :users, param: :name + # + # The `users` resource here will have the following routes generated for it: + # + # GET /users(.:format) + # POST /users(.:format) + # GET /users/new(.:format) + # GET /users/:name/edit(.:format) + # GET /users/:name(.:format) + # PATCH/PUT /users/:name(.:format) + # DELETE /users/:name(.:format) + # + # You can override `ActiveRecord::Base#to_param` of a related model to + # construct a URL: + # + # class User < ActiveRecord::Base + # def to_param + # name + # end + # end + # + # user = User.find_by(name: 'Phusion') + # user_path(user) # => "/users/Phusion" + # + # :path + # + # :module + # + # match 'path', to: 'c#a', module: 'sekret', controller: 'posts', via: :get + # # => Sekret::PostsController + # + # See `Scoping#namespace` for its scope equivalent. + # + # :as + # + # :via + # + # match 'path', to: 'c#a', via: :get + # match 'path', to: 'c#a', via: [:get, :post] + # match 'path', to: 'c#a', via: :all + # + # :to + # string representing a controller's action. + # + # match 'path', to: 'controller#action', via: :get + # match 'path', to: -> (env) { [200, {}, ["Success!"]] }, via: :get + # match 'path', to: RackApp, via: :get + # + # :on + # are `:member`, `:collection`, and `:new`. Only use within `resource(s)` + # block. For example: + # + # resource :bar do + # match 'foo', to: 'c#a', on: :member, via: [:get, :post] + # end + # + # Is equivalent to: + # + # resource :bar do + # member do + # match 'foo', to: 'c#a', via: [:get, :post] + # end + # end + # + # :constraints + # responds to `matches?`. In addition, constraints other than path can also + # be specified with any object that responds to `===` (e.g. String, Array, + # Range, etc.). + # + # match 'path/:id', constraints: { id: /[A-Z]\d{5}/ }, via: :get + # + # match 'json_only', constraints: { format: 'json' }, via: :get + # + # class PermitList + # def matches?(request) request.remote_ip == '1.2.3.4' end + # end + # match 'path', to: 'c#a', constraints: PermitList.new, via: :get + # + # See `Scoping#constraints` for more examples with its scope equivalent. + # + # :defaults + # + # # Sets params[:format] to 'jpg' by default + # match 'path', to: 'c#a', defaults: { format: 'jpg' }, via: :get + # + # See `Scoping#defaults` for its scope equivalent. + # + # :anchor + # the pattern matches any request prefixed with the given path. + # + # # Matches any request starting with 'path' + # match 'path', to: 'c#a', anchor: false, via: :get + # + # :format + # disable it by supplying `false`. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#587 + def match(path, options = T.unsafe(nil)); end + + # Mount a Rack-based application to be used within the application. + # + # mount SomeRackApp, at: "some_route" + # + # For options, see `match`, as `mount` uses it internally. + # + # All mounted applications come with routing helpers to access them. These are + # named after the class specified, so for the above example the helper is either + # `some_rack_app_path` or `some_rack_app_url`. To customize this helper's name, + # use the `:as` option: + # + # mount(SomeRackApp, at: "some_route", as: "exciting") + # + # This will generate the `exciting_path` and `exciting_url` helpers which can be + # used to navigate to this mounted app. + # + # @raise [ArgumentError] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#605 + def mount(app = T.unsafe(nil), deprecated_options = T.unsafe(nil), as: T.unsafe(nil), via: T.unsafe(nil), at: T.unsafe(nil), defaults: T.unsafe(nil), constraints: T.unsafe(nil), anchor: T.unsafe(nil), format: T.unsafe(nil), path: T.unsafe(nil), internal: T.unsafe(nil), **mapping, &block); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#655 + def with_default_scope(scope, &block); end + + private + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#689 + def app_name(app, rails_app); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#667 + def assign_deprecated_option(deprecated_options, key, method_name); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#676 + def assign_deprecated_options(deprecated_options, options, method_name); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#698 + def define_generate_prefix(app, name); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#685 + def rails_app?(app); end +end + +# Routing Concerns allow you to declare common routes that can be reused inside +# others resources and routes. +# +# concern :commentable do +# resources :comments +# end +# +# concern :image_attachable do +# resources :images, only: :index +# end +# +# These concerns are used in Resources routing: +# +# resources :messages, concerns: [:commentable, :image_attachable] +# +# or in a scope or namespace: +# +# namespace :posts do +# concerns :commentable +# end +# +# source://actionpack//lib/action_dispatch/routing/mapper.rb#2242 +module ActionDispatch::Routing::Mapper::Concerns + # Define a routing concern using a name. + # + # Concerns may be defined inline, using a block, or handled by another object, + # by passing that object as the second parameter. + # + # The concern object, if supplied, should respond to `call`, which will receive + # two parameters: + # + # * The current mapper + # * A hash of options which the concern object may use + # + # Options may also be used by concerns defined in a block by accepting a block + # parameter. So, using a block, you might do something as simple as limit the + # actions available on certain resources, passing standard resource options + # through the concern: + # + # concern :commentable do |options| + # resources :comments, options + # end + # + # resources :posts, concerns: :commentable + # resources :archived_posts do + # # Don't allow comments on archived posts + # concerns :commentable, only: [:index, :show] + # end + # + # Or, using a callable object, you might implement something more specific to + # your application, which would be out of place in your routes file. + # + # # purchasable.rb + # class Purchasable + # def initialize(defaults = {}) + # @defaults = defaults + # end + # + # def call(mapper, options = {}) + # options = @defaults.merge(options) + # mapper.resources :purchases + # mapper.resources :receipts + # mapper.resources :returns if options[:returnable] + # end + # end + # + # # routes.rb + # concern :purchasable, Purchasable.new(returnable: true) + # + # resources :toys, concerns: :purchasable + # resources :electronics, concerns: :purchasable + # resources :pets do + # concerns :purchasable, returnable: false + # end + # + # Any routing helpers can be used inside a concern. If using a callable, they're + # accessible from the Mapper that's passed to `call`. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2297 + def concern(name, callable = T.unsafe(nil), &block); end + + # Use the named concerns + # + # resources :posts do + # concerns :commentable + # end + # + # Concerns also work in any routes helper that you want to use: + # + # namespace :posts do + # concerns :commentable + # end + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2313 + def concerns(*args, **options); end +end + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#29 +class ActionDispatch::Routing::Mapper::Constraints < ::ActionDispatch::Routing::Endpoint + # @return [Constraints] a new instance of Constraints + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#35 + def initialize(app, constraints, strategy); end + + # Returns the value of attribute app. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#30 + def app; end + + # Returns the value of attribute constraints. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#30 + def constraints; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#50 + def dispatcher?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#52 + def matches?(req); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#59 + def serve(req); end + + private + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#66 + def constraint_args(constraint, request); end +end + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#33 +ActionDispatch::Routing::Mapper::Constraints::CALL = T.let(T.unsafe(nil), Proc) + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#32 +ActionDispatch::Routing::Mapper::Constraints::SERVE = T.let(T.unsafe(nil), Proc) + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#2324 +module ActionDispatch::Routing::Mapper::CustomUrls + # Define custom URL helpers that will be added to the application's routes. This + # allows you to override and/or replace the default behavior of routing helpers, + # e.g: + # + # direct :homepage do + # "https://rubyonrails.org" + # end + # + # direct :commentable do |model| + # [ model, anchor: model.dom_id ] + # end + # + # direct :main do + # { controller: "pages", action: "index", subdomain: "www" } + # end + # + # The return value from the block passed to `direct` must be a valid set of + # arguments for `url_for` which will actually build the URL string. This can be + # one of the following: + # + # * A string, which is treated as a generated URL + # * A hash, e.g. `{ controller: "pages", action: "index" }` + # * An array, which is passed to `polymorphic_url` + # * An Active Model instance + # * An Active Model class + # + # + # NOTE: Other URL helpers can be called in the block but be careful not to + # invoke your custom URL helper again otherwise it will result in a stack + # overflow error. + # + # You can also specify default options that will be passed through to your URL + # helper definition, e.g: + # + # direct :browse, page: 1, size: 10 do |options| + # [ :products, options.merge(params.permit(:page, :size).to_h.symbolize_keys) ] + # end + # + # In this instance the `params` object comes from the context in which the block + # is executed, e.g. generating a URL inside a controller action or a view. If + # the block is executed where there isn't a `params` object such as this: + # + # Rails.application.routes.url_helpers.browse_path + # + # then it will raise a `NameError`. Because of this you need to be aware of the + # context in which you will use your custom URL helper when defining it. + # + # NOTE: The `direct` method can't be used inside of a scope block such as + # `namespace` or `scope` and will raise an error if it detects that it is. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2374 + def direct(name, options = T.unsafe(nil), &block); end + + # Define custom polymorphic mappings of models to URLs. This alters the behavior + # of `polymorphic_url` and consequently the behavior of `link_to`, `form_with` + # and `form_for` when passed a model instance, e.g: + # + # resource :basket + # + # resolve "Basket" do + # [:basket] + # end + # + # This will now generate "/basket" when a `Basket` instance is passed to + # `link_to`, `form_with` or `form_for` instead of the standard "/baskets/:id". + # + # NOTE: This custom behavior only applies to simple polymorphic URLs where a + # single model instance is passed and not more complicated forms, e.g: + # + # # config/routes.rb + # resource :profile + # namespace :admin do + # resources :users + # end + # + # resolve("User") { [:profile] } + # + # # app/views/application/_menu.html.erb + # link_to "Profile", @current_user + # link_to "Profile", [:admin, @current_user] + # + # The first `link_to` will generate "/profile" but the second will generate the + # standard polymorphic URL of "/admin/users/1". + # + # You can pass options to a polymorphic mapping - the arity for the block needs + # to be two as the instance is passed as the first argument, e.g: + # + # resolve "Basket", anchor: "items" do |basket, options| + # [:basket, options] + # end + # + # This generates the URL "/basket#items" because when the last item in an array + # passed to `polymorphic_url` is a hash then it's treated as options to the URL + # helper that gets called. + # + # NOTE: The `resolve` method can't be used inside of a scope block such as + # `namespace` or `scope` and will raise an error if it detects that it is. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2426 + def resolve(*args, &block); end +end + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#2528 +ActionDispatch::Routing::Mapper::DEFAULT = T.let(T.unsafe(nil), Object) + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#733 +module ActionDispatch::Routing::Mapper::HttpHelpers + # Define a route that recognizes HTTP CONNECT (and GET) requests. More + # specifically this recognizes HTTP/1 protocol upgrade requests and HTTP/2 + # CONNECT requests with the protocol pseudo header. For supported arguments, + # see [match](rdoc-ref:Base#match) + # + # connect 'live', to: 'live#index' + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#884 + def connect(*path_or_actions, as: T.unsafe(nil), to: T.unsafe(nil), controller: T.unsafe(nil), action: T.unsafe(nil), on: T.unsafe(nil), defaults: T.unsafe(nil), constraints: T.unsafe(nil), anchor: T.unsafe(nil), format: T.unsafe(nil), path: T.unsafe(nil), internal: T.unsafe(nil), **mapping, &block); end + + # Define a route that only recognizes HTTP DELETE. For supported arguments, see + # [match](rdoc-ref:Base#match) + # + # delete 'broccoli', to: 'food#broccoli' + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#834 + def delete(*path_or_actions, as: T.unsafe(nil), to: T.unsafe(nil), controller: T.unsafe(nil), action: T.unsafe(nil), on: T.unsafe(nil), defaults: T.unsafe(nil), constraints: T.unsafe(nil), anchor: T.unsafe(nil), format: T.unsafe(nil), path: T.unsafe(nil), internal: T.unsafe(nil), **mapping, &block); end + + # Define a route that only recognizes HTTP GET. For supported arguments, see + # [match](rdoc-ref:Base#match) + # + # get 'bacon', to: 'food#bacon' + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#738 + def get(*path_or_actions, as: T.unsafe(nil), to: T.unsafe(nil), controller: T.unsafe(nil), action: T.unsafe(nil), on: T.unsafe(nil), defaults: T.unsafe(nil), constraints: T.unsafe(nil), anchor: T.unsafe(nil), format: T.unsafe(nil), path: T.unsafe(nil), internal: T.unsafe(nil), **mapping, &block); end + + # Define a route that only recognizes HTTP OPTIONS. For supported arguments, see + # [match](rdoc-ref:Base#match) + # + # options 'carrots', to: 'food#carrots' + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#858 + def options(*path_or_actions, as: T.unsafe(nil), to: T.unsafe(nil), controller: T.unsafe(nil), action: T.unsafe(nil), on: T.unsafe(nil), defaults: T.unsafe(nil), constraints: T.unsafe(nil), anchor: T.unsafe(nil), format: T.unsafe(nil), path: T.unsafe(nil), internal: T.unsafe(nil), **mapping, &block); end + + # Define a route that only recognizes HTTP PATCH. For supported arguments, see + # [match](rdoc-ref:Base#match) + # + # patch 'bacon', to: 'food#bacon' + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#786 + def patch(*path_or_actions, as: T.unsafe(nil), to: T.unsafe(nil), controller: T.unsafe(nil), action: T.unsafe(nil), on: T.unsafe(nil), defaults: T.unsafe(nil), constraints: T.unsafe(nil), anchor: T.unsafe(nil), format: T.unsafe(nil), path: T.unsafe(nil), internal: T.unsafe(nil), **mapping, &block); end + + # Define a route that only recognizes HTTP POST. For supported arguments, see + # [match](rdoc-ref:Base#match) + # + # post 'bacon', to: 'food#bacon' + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#762 + def post(*path_or_actions, as: T.unsafe(nil), to: T.unsafe(nil), controller: T.unsafe(nil), action: T.unsafe(nil), on: T.unsafe(nil), defaults: T.unsafe(nil), constraints: T.unsafe(nil), anchor: T.unsafe(nil), format: T.unsafe(nil), path: T.unsafe(nil), internal: T.unsafe(nil), **mapping, &block); end + + # Define a route that only recognizes HTTP PUT. For supported arguments, see + # [match](rdoc-ref:Base#match) + # + # put 'bacon', to: 'food#bacon' + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#810 + def put(*path_or_actions, as: T.unsafe(nil), to: T.unsafe(nil), controller: T.unsafe(nil), action: T.unsafe(nil), on: T.unsafe(nil), defaults: T.unsafe(nil), constraints: T.unsafe(nil), anchor: T.unsafe(nil), format: T.unsafe(nil), path: T.unsafe(nil), internal: T.unsafe(nil), **mapping, &block); end +end + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#83 +class ActionDispatch::Routing::Mapper::Mapping + # @return [Mapping] a new instance of Mapping + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#132 + def initialize(set:, ast:, controller:, default_action:, to:, formatted:, via:, options_constraints:, anchor:, scope_params:, internal:, options:); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#190 + def application; end + + # Returns the value of attribute ast. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#87 + def ast; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#194 + def conditions; end + + # Returns the value of attribute default_action. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#87 + def default_action; end + + # Returns the value of attribute default_controller. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#87 + def default_controller; end + + # Returns the value of attribute defaults. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#87 + def defaults; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#183 + def make_route(name, precedence); end + + # Returns the value of attribute path. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#87 + def path; end + + # Returns the value of attribute required_defaults. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#87 + def required_defaults; end + + # Returns the value of attribute requirements. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#87 + def requirements; end + + # Returns the value of attribute scope_options. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#87 + def scope_options; end + + # Returns the value of attribute to. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#87 + def to; end + + private + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#329 + def add_controller_module(controller, modyoule); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#290 + def app(blocks); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#348 + def blocks(callable_constraint); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#198 + def build_conditions(current_conditions, request_class); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#302 + def check_controller_and_action(path_params, controller, action); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#317 + def check_part(name, part, path_params, hash); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#355 + def constraints(options, path_params); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#369 + def dispatcher(raise_on_name_error); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#208 + def intern(object); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#286 + def normalize_defaults(options); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#254 + def normalize_format(formatted); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#212 + def normalize_options!(options, path_params, modyoule); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#373 + def route_source_location; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#248 + def split_constraints(path_params, constraints); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#341 + def translate_controller(controller); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#270 + def verify_regexp_requirements(requirements, wildcard_options); end + + class << self + # source://actionpack//lib/action_dispatch/routing/mapper.rb#90 + def build(scope, set, ast, controller, default_action, to, via, formatted, options_constraints, anchor, internal, options); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#104 + def check_via(via); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#116 + def normalize_path(path, format); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#128 + def optional_format?(path, format); end + end +end + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#84 +ActionDispatch::Routing::Mapper::Mapping::ANCHOR_CHARACTERS_REGEX = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#181 +ActionDispatch::Routing::Mapper::Mapping::JOINED_SEPARATORS = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#85 +ActionDispatch::Routing::Mapper::Mapping::OPTIONAL_FORMAT_REGEX = T.let(T.unsafe(nil), Regexp) + +# Resource routing allows you to quickly declare all of the common routes for a +# given resourceful controller. Instead of declaring separate routes for your +# `index`, `show`, `new`, `edit`, `create`, `update`, and `destroy` actions, a +# resourceful route declares them in a single line of code: +# +# resources :photos +# +# Sometimes, you have a resource that clients always look up without referencing +# an ID. A common example, /profile always shows the profile of the currently +# logged in user. In this case, you can use a singular resource to map /profile +# (rather than /profile/:id) to the show action. +# +# resource :profile +# +# It's common to have resources that are logically children of other resources: +# +# resources :magazines do +# resources :ads +# end +# +# You may wish to organize groups of controllers under a namespace. Most +# commonly, you might group a number of administrative controllers under an +# `admin` namespace. You would place these controllers under the +# `app/controllers/admin` directory, and you can group them together in your +# router: +# +# namespace "admin" do +# resources :posts, :comments +# end +# +# By default the `:id` parameter doesn't accept dots. If you need to use dots as +# part of the `:id` parameter add a constraint which overrides this restriction, +# e.g: +# +# resources :articles, id: /[^\/]+/ +# +# This allows any character other than a slash as part of your `:id`. +# +# source://actionpack//lib/action_dispatch/routing/mapper.rb#1299 +module ActionDispatch::Routing::Mapper::Resources + # To add a route to the collection: + # + # resources :photos do + # collection do + # get 'search' + # end + # end + # + # This will enable Rails to recognize paths such as `/photos/search` with GET, + # and route to the search action of `PhotosController`. It will also create the + # `search_photos_url` and `search_photos_path` route helpers. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1707 + def collection(&block); end + + # Loads another routes file with the given `name` located inside the + # `config/routes` directory. In that file, you can use the normal routing DSL, + # but *do not* surround it with a `Rails.application.routes.draw` block. + # + # # config/routes.rb + # Rails.application.routes.draw do + # draw :admin # Loads `config/routes/admin.rb` + # draw "third_party/some_gem" # Loads `config/routes/third_party/some_gem.rb` + # end + # + # # config/routes/admin.rb + # namespace :admin do + # resources :accounts + # end + # + # # config/routes/third_party/some_gem.rb + # mount SomeGem::Engine, at: "/some_gem" + # + # **CAUTION:** Use this feature with care. Having multiple routes files can + # negatively impact discoverability and readability. For most applications — + # even those with a few hundred routes — it's easier for developers to have a + # single routes file. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1816 + def draw(name); end + + # Matches a URL pattern to one or more routes. For more information, see + # [match](rdoc-ref:Base#match). + # + # match 'path', to: 'controller#action', via: :post + # match 'otherpath', on: :member, via: :get + # + # @raise [ArgumentError] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1837 + def match(*path_or_actions, as: T.unsafe(nil), via: T.unsafe(nil), to: T.unsafe(nil), controller: T.unsafe(nil), action: T.unsafe(nil), on: T.unsafe(nil), defaults: T.unsafe(nil), constraints: T.unsafe(nil), anchor: T.unsafe(nil), format: T.unsafe(nil), path: T.unsafe(nil), internal: T.unsafe(nil), **mapping, &block); end + + # To add a member route, add a member block into the resource block: + # + # resources :photos do + # member do + # get 'preview' + # end + # end + # + # This will recognize `/photos/1/preview` with GET, and route to the preview + # action of `PhotosController`. It will also create the `preview_photo_url` and + # `preview_photo_path` helpers. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1728 + def member(&block); end + + # See ActionDispatch::Routing::Mapper::Scoping#namespace. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1775 + def namespace(name, deprecated_options = T.unsafe(nil), as: T.unsafe(nil), path: T.unsafe(nil), shallow_path: T.unsafe(nil), shallow_prefix: T.unsafe(nil), **options, &block); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1754 + def nested(&block); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1744 + def new(&block); end + + # Sometimes, you have a resource that clients always look up without referencing + # an ID. A common example, /profile always shows the profile of the currently + # logged in user. In this case, you can use a singular resource to map /profile + # (rather than /profile/:id) to the show action: + # + # resource :profile + # + # This creates six different routes in your application, all mapping to the + # `Profiles` controller (note that the controller is named after the plural): + # + # GET /profile/new + # GET /profile + # GET /profile/edit + # PATCH/PUT /profile + # DELETE /profile + # POST /profile + # + # If you want instances of a model to work with this resource via record + # identification (e.g. in `form_with` or `redirect_to`), you will need to call + # [resolve](rdoc-ref:CustomUrls#resolve): + # + # resource :profile + # resolve('Profile') { [:profile] } + # + # # Enables this to work with singular routes: + # form_with(model: @profile) {} + # + # ### Options + # Takes same options as [resources](rdoc-ref:#resources) + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1490 + def resource(*resources, concerns: T.unsafe(nil), **options, &block); end + + # In Rails, a resourceful route provides a mapping between HTTP verbs and URLs + # and controller actions. By convention, each action also maps to particular + # CRUD operations in a database. A single entry in the routing file, such as + # + # resources :photos + # + # creates seven different routes in your application, all mapping to the + # `Photos` controller: + # + # GET /photos + # GET /photos/new + # POST /photos + # GET /photos/:id + # GET /photos/:id/edit + # PATCH/PUT /photos/:id + # DELETE /photos/:id + # + # Resources can also be nested infinitely by using this block syntax: + # + # resources :photos do + # resources :comments + # end + # + # This generates the following comments routes: + # + # GET /photos/:photo_id/comments + # GET /photos/:photo_id/comments/new + # POST /photos/:photo_id/comments + # GET /photos/:photo_id/comments/:id + # GET /photos/:photo_id/comments/:id/edit + # PATCH/PUT /photos/:photo_id/comments/:id + # DELETE /photos/:photo_id/comments/:id + # + # ### Options + # Takes same options as [match](rdoc-ref:Base#match) as well as: + # + # :path_names + # actions. Actions not specified are not changed. + # + # resources :posts, path_names: { new: "brand_new" } + # + # The above example will now change /posts/new to /posts/brand_new. + # + # :path + # + # resources :posts, path: 'postings' + # + # The resource and all segments will now route to /postings instead of + # /posts. + # + # :only + # + # resources :cows, only: :show + # resources :cows, only: [:show, :index] + # + # :except + # + # resources :cows, except: :show + # resources :cows, except: [:show, :index] + # + # :shallow + # resource, generates shallow routes for all nested resources. + # + # resources :posts, shallow: true do + # resources :comments + # end + # + # Is the same as: + # + # resources :posts do + # resources :comments, except: [:show, :edit, :update, :destroy] + # end + # resources :comments, only: [:show, :edit, :update, :destroy] + # + # This allows URLs for resources that otherwise would be deeply nested such + # as a comment on a blog post like `/posts/a-long-permalink/comments/1234` + # to be shortened to just `/comments/1234`. + # + # Set `shallow: false` on a child resource to ignore a parent's shallow + # parameter. + # + # :shallow_path + # + # scope shallow_path: "sekret" do + # resources :posts do + # resources :comments, shallow: true + # end + # end + # + # The `comments` resource here will have the following routes generated for + # it: + # + # post_comments GET /posts/:post_id/comments(.:format) + # post_comments POST /posts/:post_id/comments(.:format) + # new_post_comment GET /posts/:post_id/comments/new(.:format) + # edit_comment GET /sekret/comments/:id/edit(.:format) + # comment GET /sekret/comments/:id(.:format) + # comment PATCH/PUT /sekret/comments/:id(.:format) + # comment DELETE /sekret/comments/:id(.:format) + # + # :shallow_prefix + # + # scope shallow_prefix: "sekret" do + # resources :posts do + # resources :comments, shallow: true + # end + # end + # + # The `comments` resource here will have the following routes generated for + # it: + # + # post_comments GET /posts/:post_id/comments(.:format) + # post_comments POST /posts/:post_id/comments(.:format) + # new_post_comment GET /posts/:post_id/comments/new(.:format) + # edit_sekret_comment GET /comments/:id/edit(.:format) + # sekret_comment GET /comments/:id(.:format) + # sekret_comment PATCH/PUT /comments/:id(.:format) + # sekret_comment DELETE /comments/:id(.:format) + # + # :format + # disable it by supplying `false`. + # + # :param + # + # + # ### Examples + # + # # routes call Admin::PostsController + # resources :posts, module: "admin" + # + # # resource actions are at /admin/posts. + # resources :posts, path: "admin/posts" + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1663 + def resources(*resources, concerns: T.unsafe(nil), **options, &block); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1457 + def resources_path_names(options); end + + # You can specify what Rails should route "/" to with the root method: + # + # root to: 'pages#main' + # + # For options, see `match`, as `root` uses it internally. + # + # You can also pass a string which will expand + # + # root 'pages#main' + # + # You should put the root route at the top of `config/routes.rb`, because this + # means it will be matched first. As this is the most popular route of most + # Rails applications, this is beneficial. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1903 + def root(path, options = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1783 + def shallow; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1790 + def shallow?; end + + private + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1968 + def action_options?(options); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2066 + def action_path(name); end + + # @raise [ArgumentError] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2195 + def add_route(action, controller, as, options_action, _path, to, via, formatted, anchor, options_constraints, internal, options_mapping); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2120 + def api_only?; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1982 + def applicable_actions_for(method); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1963 + def apply_action_options(method, options); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1928 + def apply_common_behavior_for(method, resources, shallow: T.unsafe(nil), **options, &block); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2041 + def canonical_action?(action); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2180 + def decomposed_match(path, controller, as, action, _path, to, via, formatted, anchor, options_constraints, internal, options_mapping, on = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2165 + def get_to_from_path(path, to, action); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2131 + def map_match(path_or_action, constraints: T.unsafe(nil), anchor: T.unsafe(nil), format: T.unsafe(nil), path: T.unsafe(nil), as: T.unsafe(nil), via: T.unsafe(nil), to: T.unsafe(nil), controller: T.unsafe(nil), action: T.unsafe(nil), on: T.unsafe(nil), internal: T.unsafe(nil), mapping: T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2217 + def match_root_route(options); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2082 + def name_for_action(as, action); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2018 + def nested_options; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1999 + def nested_scope?; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2037 + def param_constraint; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2033 + def param_constraint?; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1924 + def parent_resource; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2056 + def path_for_action(action, path); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2124 + def path_scope(path); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2070 + def prefix_name_for_action(as, action); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1995 + def resource_method_scope?; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2010 + def resource_scope(resource, &block); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1991 + def resource_scope?; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1972 + def scope_action_options(method); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2108 + def set_member_mappings_for_resource; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2027 + def shallow_nesting_depth; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2045 + def shallow_scope; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2176 + def using_match_shorthand?(path); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2003 + def with_scope_level(kind); end +end + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#1304 +ActionDispatch::Routing::Mapper::Resources::CANONICAL_ACTIONS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#1303 +ActionDispatch::Routing::Mapper::Resources::RESOURCE_OPTIONS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#1306 +class ActionDispatch::Routing::Mapper::Resources::Resource + # @return [Resource] a new instance of Resource + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1319 + def initialize(entities, api_only, shallow, only: T.unsafe(nil), except: T.unsafe(nil), **options); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1346 + def actions; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1354 + def available_actions; end + + # Checks for uncountable plurals, and appends "_index" if the plural and + # singular form are the same. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1378 + def collection_name; end + + # Returns the value of attribute path. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1386 + def collection_scope; end + + # Returns the value of attribute controller. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1317 + def controller; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1342 + def default_actions; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1374 + def member_name; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1388 + def member_scope; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1362 + def name; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1398 + def nested_param; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1402 + def nested_scope; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1394 + def new_scope(new_path); end + + # Returns the value of attribute param. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1317 + def param; end + + # Returns the value of attribute path. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1317 + def path; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1366 + def plural; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1382 + def resource_scope; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1406 + def shallow?; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1392 + def shallow_scope; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1410 + def singleton?; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1370 + def singular; end + + private + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1413 + def invalid_only_except_options(valid_actions, only:, except:); end + + class << self + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1308 + def default_actions(api_only); end + end +end + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#1418 +class ActionDispatch::Routing::Mapper::Resources::SingletonResource < ::ActionDispatch::Routing::Mapper::Resources::Resource + # @return [SingletonResource] a new instance of SingletonResource + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1429 + def initialize(entities, api_only, shallow, **options); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1449 + def collection_name; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1436 + def default_actions; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1448 + def member_name; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1451 + def member_scope; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1452 + def nested_scope; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1440 + def plural; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1454 + def singleton?; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1444 + def singular; end + + class << self + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1420 + def default_actions(api_only); end + end +end + +# CANONICAL_ACTIONS holds all actions that does not need a prefix or a path +# appended since they fit properly in their scope level. +# +# source://actionpack//lib/action_dispatch/routing/mapper.rb#1302 +ActionDispatch::Routing::Mapper::Resources::VALID_ON_OPTIONS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#2440 +class ActionDispatch::Routing::Mapper::Scope + include ::Enumerable + + # @return [Scope] a new instance of Scope + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2450 + def initialize(hash, parent = T.unsafe(nil), scope_level = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2509 + def [](key); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2476 + def action_name(name_prefix, prefix, collection_name, member_name); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2517 + def each; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2513 + def frame; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2456 + def nested?; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2501 + def new(hash); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2505 + def new_level(level); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2460 + def null?; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2497 + def options; end + + # Returns the value of attribute parent. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2448 + def parent; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2472 + def resource_method_scope?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2493 + def resource_scope?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2468 + def resources?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2464 + def root?; end + + # Returns the value of attribute scope_level. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2448 + def scope_level; end +end + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#2441 +ActionDispatch::Routing::Mapper::Scope::OPTIONS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#2446 +ActionDispatch::Routing::Mapper::Scope::RESOURCE_METHOD_SCOPES = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#2445 +ActionDispatch::Routing::Mapper::Scope::RESOURCE_SCOPES = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#2525 +ActionDispatch::Routing::Mapper::Scope::ROOT = T.let(T.unsafe(nil), ActionDispatch::Routing::Mapper::Scope) + +# You may wish to organize groups of controllers under a namespace. Most +# commonly, you might group a number of administrative controllers under an +# `admin` namespace. You would place these controllers under the +# `app/controllers/admin` directory, and you can group them together in your +# router: +# +# namespace "admin" do +# resources :posts, :comments +# end +# +# This will create a number of routes for each of the posts and comments +# controller. For `Admin::PostsController`, Rails will create: +# +# GET /admin/posts +# GET /admin/posts/new +# POST /admin/posts +# GET /admin/posts/1 +# GET /admin/posts/1/edit +# PATCH/PUT /admin/posts/1 +# DELETE /admin/posts/1 +# +# If you want to route /posts (without the prefix /admin) to +# `Admin::PostsController`, you could use +# +# scope module: "admin" do +# resources :posts +# end +# +# or, for a single case +# +# resources :posts, module: "admin" +# +# If you want to route /admin/posts to `PostsController` (without the `Admin::` +# module prefix), you could use +# +# scope "/admin" do +# resources :posts +# end +# +# or, for a single case +# +# resources :posts, path: "/admin/posts" +# +# In each of these cases, the named routes remain the same as if you did not use +# scope. In the last case, the following paths map to `PostsController`: +# +# GET /admin/posts +# GET /admin/posts/new +# POST /admin/posts +# GET /admin/posts/1 +# GET /admin/posts/1/edit +# PATCH/PUT /admin/posts/1 +# DELETE /admin/posts/1 +# +# source://actionpack//lib/action_dispatch/routing/mapper.rb#958 +module ActionDispatch::Routing::Mapper::Scoping + # ### Parameter Restriction + # Allows you to constrain the nested routes based on a set of rules. For + # instance, in order to change the routes to allow for a dot character in the + # `id` parameter: + # + # constraints(id: /\d+\.\d+/) do + # resources :posts + # end + # + # Now routes such as `/posts/1` will no longer be valid, but `/posts/1.1` will + # be. The `id` parameter must match the constraint passed in for this example. + # + # You may use this to also restrict other parameters: + # + # resources :posts do + # constraints(post_id: /\d+\.\d+/) do + # resources :comments + # end + # end + # + # ### Restricting based on IP + # + # Routes can also be constrained to an IP or a certain range of IP addresses: + # + # constraints(ip: /192\.168\.\d+\.\d+/) do + # resources :posts + # end + # + # Any user connecting from the 192.168.* range will be able to see this + # resource, where as any user connecting outside of this range will be told + # there is no such route. + # + # ### Dynamic request matching + # + # Requests to routes can be constrained based on specific criteria: + # + # constraints(-> (req) { /iPhone/.match?(req.env["HTTP_USER_AGENT"]) }) do + # resources :iphones + # end + # + # You are able to move this logic out into a class if it is too complex for + # routes. This class must have a `matches?` method defined on it which either + # returns `true` if the user should be given access to that route, or `false` if + # the user should not. + # + # class Iphone + # def self.matches?(request) + # /iPhone/.match?(request.env["HTTP_USER_AGENT"]) + # end + # end + # + # An expected place for this code would be `lib/constraints`. + # + # This class is then used like this: + # + # constraints(Iphone) do + # resources :iphones + # end + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1176 + def constraints(constraints = T.unsafe(nil), &block); end + + # Scopes routes to a specific controller + # + # controller "food" do + # match "bacon", action: :bacon, via: :get + # end + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1052 + def controller(controller); end + + # Allows you to set default parameters for a route, such as this: + # + # defaults id: 'home' do + # match 'scoped_pages/(:id)', to: 'pages#show' + # end + # + # Using this, the `:id` parameter here will default to 'home'. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1187 + def defaults(defaults = T.unsafe(nil)); end + + # Scopes routes to a specific namespace. For example: + # + # namespace :admin do + # resources :posts + # end + # + # This generates the following routes: + # + # admin_posts GET /admin/posts(.:format) admin/posts#index + # admin_posts POST /admin/posts(.:format) admin/posts#create + # new_admin_post GET /admin/posts/new(.:format) admin/posts#new + # edit_admin_post GET /admin/posts/:id/edit(.:format) admin/posts#edit + # admin_post GET /admin/posts/:id(.:format) admin/posts#show + # admin_post PATCH/PUT /admin/posts/:id(.:format) admin/posts#update + # admin_post DELETE /admin/posts/:id(.:format) admin/posts#destroy + # + # ### Options + # + # The `:path`, `:as`, `:module`, `:shallow_path`, and `:shallow_prefix` options + # all default to the name of the namespace. + # + # For options, see `Base#match`. For `:shallow_path` option, see + # `Resources#resources`. + # + # # accessible through /sekret/posts rather than /admin/posts + # namespace :admin, path: "sekret" do + # resources :posts + # end + # + # # maps to Sekret::PostsController rather than Admin::PostsController + # namespace :admin, module: "sekret" do + # resources :posts + # end + # + # # generates sekret_posts_path rather than admin_posts_path + # namespace :admin, as: "sekret" do + # resources :posts + # end + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1097 + def namespace(name, deprecated_options = T.unsafe(nil), as: T.unsafe(nil), path: T.unsafe(nil), shallow_path: T.unsafe(nil), shallow_prefix: T.unsafe(nil), **options, &block); end + + # Scopes a set of routes to the given default options. + # + # Take the following route definition as an example: + # + # scope path: ":account_id", as: "account" do + # resources :projects + # end + # + # This generates helpers such as `account_projects_path`, just like `resources` + # does. The difference here being that the routes generated are like + # /:account_id/projects, rather than /accounts/:account_id/projects. + # + # ### Options + # + # Takes same options as `Base#match` and `Resources#resources`. + # + # # route /posts (without the prefix /admin) to Admin::PostsController + # scope module: "admin" do + # resources :posts + # end + # + # # prefix the posts resource's requests with '/admin' + # scope path: "/admin" do + # resources :posts + # end + # + # # prefix the routing helper name: sekret_posts_path instead of posts_path + # scope as: "sekret" do + # resources :posts + # end + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#989 + def scope(*args, only: T.unsafe(nil), except: T.unsafe(nil), **options); end + + private + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1219 + def merge_action_scope(parent, child); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1203 + def merge_as_scope(parent, child); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1243 + def merge_blocks_scope(parent, child); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1235 + def merge_constraints_scope(parent, child); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1215 + def merge_controller_scope(parent, child); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1239 + def merge_defaults_scope(parent, child); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1227 + def merge_format_scope(parent, child); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1211 + def merge_module_scope(parent, child); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1249 + def merge_options_scope(parent, child); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1231 + def merge_path_names_scope(parent, child); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1195 + def merge_path_scope(parent, child); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1199 + def merge_shallow_path_scope(parent, child); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1207 + def merge_shallow_prefix_scope(parent, child); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1253 + def merge_shallow_scope(parent, child); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1257 + def merge_to_scope(parent, child); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1223 + def merge_via_scope(parent, child); end +end + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#1045 +ActionDispatch::Routing::Mapper::Scoping::POISON = T.let(T.unsafe(nil), Object) + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#24 +ActionDispatch::Routing::Mapper::URL_OPTIONS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/routing/redirection.rb#116 +class ActionDispatch::Routing::OptionRedirect < ::ActionDispatch::Routing::Redirect + # source://actionpack//lib/action_dispatch/routing/redirection.rb#145 + def inspect; end + + # source://actionpack//lib/action_dispatch/routing/redirection.rb#117 + def options; end + + # source://actionpack//lib/action_dispatch/routing/redirection.rb#119 + def path(params, request); end +end + +# source://actionpack//lib/action_dispatch/routing/redirection.rb#91 +class ActionDispatch::Routing::PathRedirect < ::ActionDispatch::Routing::Redirect + # source://actionpack//lib/action_dispatch/routing/redirection.rb#106 + def inspect; end + + # source://actionpack//lib/action_dispatch/routing/redirection.rb#94 + def path(params, request); end + + private + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/redirection.rb#111 + def interpolation_required?(string, params); end +end + +# source://actionpack//lib/action_dispatch/routing/redirection.rb#92 +ActionDispatch::Routing::PathRedirect::URL_PARTS = T.let(T.unsafe(nil), Regexp) + +# # Action Dispatch Routing PolymorphicRoutes +# +# Polymorphic URL helpers are methods for smart resolution to a named route call +# when given an Active Record model instance. They are to be used in combination +# with ActionController::Resources. +# +# These methods are useful when you want to generate the correct URL or path to +# a RESTful resource without having to know the exact type of the record in +# question. +# +# Nested resources and/or namespaces are also supported, as illustrated in the +# example: +# +# polymorphic_url([:admin, @article, @comment]) +# +# results in: +# +# admin_article_comment_url(@article, @comment) +# +# ## Usage within the framework +# +# Polymorphic URL helpers are used in a number of places throughout the Rails +# framework: +# +# * `url_for`, so you can use it with a record as the argument, e.g. +# `url_for(@article)`; +# * ActionView::Helpers::FormHelper uses `polymorphic_path`, so you can write +# `form_with(model: @article)` without having to specify `:url` parameter for the +# form action; +# * `redirect_to` (which, in fact, uses `url_for`) so you can write +# `redirect_to(post)` in your controllers; +# * ActionView::Helpers::AtomFeedHelper, so you don't have to explicitly +# specify URLs for feed entries. +# +# +# ## Prefixed polymorphic helpers +# +# In addition to `polymorphic_url` and `polymorphic_path` methods, a number of +# prefixed helpers are available as a shorthand to `action: "..."` in options. +# Those are: +# +# * `edit_polymorphic_url`, `edit_polymorphic_path` +# * `new_polymorphic_url`, `new_polymorphic_path` +# +# +# Example usage: +# +# edit_polymorphic_path(@post) # => "/posts/1/edit" +# polymorphic_path(@post, format: :pdf) # => "/posts/1.pdf" +# +# ## Usage with mounted engines +# +# If you are using a mounted engine and you need to use a polymorphic_url +# pointing at the engine's routes, pass in the engine's route proxy as the first +# argument to the method. For example: +# +# polymorphic_url([blog, @post]) # calls blog.post_path(@post) +# form_with(model: [blog, @post]) # => "/blog/posts/1" +# +# source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#66 +module ActionDispatch::Routing::PolymorphicRoutes + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#156 + def edit_polymorphic_path(record_or_hash, options = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#156 + def edit_polymorphic_url(record_or_hash, options = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#156 + def new_polymorphic_path(record_or_hash, options = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#156 + def new_polymorphic_url(record_or_hash, options = T.unsafe(nil)); end + + # Returns the path component of a URL for the given record. + # + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#133 + def polymorphic_path(record_or_hash_or_array, options = T.unsafe(nil)); end + + # Constructs a call to a named RESTful route for the given record and returns + # the resulting URL string. For example: + # + # # calls post_url(post) + # polymorphic_url(post) # => "http://example.com/posts/1" + # polymorphic_url([blog, post]) # => "http://example.com/blogs/1/posts/1" + # polymorphic_url([:admin, blog, post]) # => "http://example.com/admin/blogs/1/posts/1" + # polymorphic_url([user, :blog, post]) # => "http://example.com/users/1/blog/posts/1" + # polymorphic_url(Comment) # => "http://example.com/comments" + # + # #### Options + # + # * `:action` - Specifies the action prefix for the named route: `:new` or + # `:edit`. Default is no prefix. + # * `:routing_type` - Allowed values are `:path` or `:url`. Default is `:url`. + # + # + # Also includes all the options from `url_for`. These include such things as + # `:anchor` or `:trailing_slash`. Example usage is given below: + # + # polymorphic_url([blog, post], anchor: 'my_anchor') + # # => "http://example.com/blogs/1/posts/1#my_anchor" + # polymorphic_url([blog, post], anchor: 'my_anchor', script_name: "/my_app") + # # => "http://example.com/my_app/blogs/1/posts/1#my_anchor" + # + # For all of these options, see the documentation for + # [url_for](rdoc-ref:ActionDispatch::Routing::UrlFor). + # + # #### Functionality + # + # # an Article record + # polymorphic_url(record) # same as article_url(record) + # + # # a Comment record + # polymorphic_url(record) # same as comment_url(record) + # + # # it recognizes new records and maps to the collection + # record = Comment.new + # polymorphic_url(record) # same as comments_url() + # + # # the class of a record will also map to the collection + # polymorphic_url(Comment) # same as comments_url() + # + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#110 + def polymorphic_url(record_or_hash_or_array, options = T.unsafe(nil)); end + + private + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#177 + def polymorphic_mapping(record); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#173 + def polymorphic_path_for_action(action, record_or_hash, options); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#169 + def polymorphic_url_for_action(action, record_or_hash, options); end +end + +# source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#185 +class ActionDispatch::Routing::PolymorphicRoutes::HelperMethodBuilder + # @return [HelperMethodBuilder] a new instance of HelperMethodBuilder + # + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#248 + def initialize(key_strategy, prefix, suffix); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#262 + def handle_class(klass); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#266 + def handle_class_call(target, klass); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#293 + def handle_list(list); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#270 + def handle_model(record); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#284 + def handle_model_call(target, record); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#254 + def handle_string(record); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#258 + def handle_string_call(target, str); end + + # Returns the value of attribute prefix. + # + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#246 + def prefix; end + + # Returns the value of attribute suffix. + # + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#246 + def suffix; end + + private + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#347 + def get_method_for_class(klass); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#352 + def get_method_for_string(str); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#339 + def polymorphic_mapping(target, record); end + + class << self + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#196 + def build(action, type); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#188 + def get(action, type); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#194 + def path; end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#210 + def plural(prefix, suffix); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#214 + def polymorphic_method(recipient, record_or_hash_or_array, action, type, options); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#206 + def singular(prefix, suffix); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#193 + def url; end + end +end + +# source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#186 +ActionDispatch::Routing::PolymorphicRoutes::HelperMethodBuilder::CACHE = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_dispatch/routing/redirection.rb#12 +class ActionDispatch::Routing::Redirect < ::ActionDispatch::Routing::Endpoint + # @return [Redirect] a new instance of Redirect + # + # source://actionpack//lib/action_dispatch/routing/redirection.rb#15 + def initialize(status, block, source_location); end + + # Returns the value of attribute block. + # + # source://actionpack//lib/action_dispatch/routing/redirection.rb#13 + def block; end + + # source://actionpack//lib/action_dispatch/routing/redirection.rb#37 + def build_response(req); end + + # source://actionpack//lib/action_dispatch/routing/redirection.rb#23 + def call(env); end + + # source://actionpack//lib/action_dispatch/routing/redirection.rb#69 + def inspect; end + + # source://actionpack//lib/action_dispatch/routing/redirection.rb#65 + def path(params, request); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/redirection.rb#21 + def redirect?; end + + # Returns the value of attribute status. + # + # source://actionpack//lib/action_dispatch/routing/redirection.rb#13 + def status; end + + private + + # source://actionpack//lib/action_dispatch/routing/redirection.rb#78 + def escape(params); end + + # source://actionpack//lib/action_dispatch/routing/redirection.rb#82 + def escape_fragment(params); end + + # source://actionpack//lib/action_dispatch/routing/redirection.rb#86 + def escape_path(params); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/redirection.rb#74 + def relative_path?(path); end +end + +# source://actionpack//lib/action_dispatch/routing/redirection.rb#150 +module ActionDispatch::Routing::Redirection + # Redirect any path to another path: + # + # get "/stories" => redirect("/posts") + # + # This will redirect the user, while ignoring certain parts of the request, + # including query string, etc. `/stories`, `/stories?foo=bar`, etc all redirect + # to `/posts`. + # + # The redirect will use a `301 Moved Permanently` status code by default. This + # can be overridden with the `:status` option: + # + # get "/stories" => redirect("/posts", status: 307) + # + # You can also use interpolation in the supplied redirect argument: + # + # get 'docs/:article', to: redirect('/wiki/%{article}') + # + # Note that if you return a path without a leading slash then the URL is + # prefixed with the current SCRIPT_NAME environment variable. This is typically + # '/' but may be different in a mounted engine or where the application is + # deployed to a subdirectory of a website. + # + # Alternatively you can use one of the other syntaxes: + # + # The block version of redirect allows for the easy encapsulation of any logic + # associated with the redirect in question. Either the params and request are + # supplied as arguments, or just params, depending of how many arguments your + # block accepts. A string is required as a return value. + # + # get 'jokes/:number', to: redirect { |params, request| + # path = (params[:number].to_i.even? ? "wheres-the-beef" : "i-love-lamp") + # "http://#{request.host_with_port}/#{path}" + # } + # + # Note that the `do end` syntax for the redirect block wouldn't work, as Ruby + # would pass the block to `get` instead of `redirect`. Use `{ ... }` instead. + # + # The options version of redirect allows you to supply only the parts of the URL + # which need to change, it also supports interpolation of the path similar to + # the first example. + # + # get 'stores/:name', to: redirect(subdomain: 'stores', path: '/%{name}') + # get 'stores/:name(*all)', to: redirect(subdomain: 'stores', path: '/%{name}%{all}') + # get '/stories', to: redirect(path: '/posts') + # + # This will redirect the user, while changing only the specified parts of the + # request, for example the `path` option in the last example. `/stories`, + # `/stories?foo=bar`, redirect to `/posts` and `/posts?foo=bar` respectively. + # + # Finally, an object which responds to call can be supplied to redirect, + # allowing you to reuse common redirect routes. The call method must accept two + # arguments, params and request, and return a string. + # + # get 'accounts/:name' => redirect(SubdomainRedirector.new('api')) + # + # @raise [ArgumentError] + # + # source://actionpack//lib/action_dispatch/routing/redirection.rb#206 + def redirect(*args, &block); end +end + +# The RouteSet contains a collection of Route instances, representing the routes +# typically defined in `config/routes.rb`. +# +# source://actionpack//lib/action_dispatch/routing/route_set.rb#17 +class ActionDispatch::Routing::RouteSet + # @return [RouteSet] a new instance of RouteSet + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#386 + def initialize(config = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#674 + def add_polymorphic_mapping(klass, options, &block); end + + # @raise [ArgumentError] + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#643 + def add_route(mapping, name); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#678 + def add_url_helper(name, options, &block); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#417 + def api_only?; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#464 + def append(&block); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#903 + def call(env); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#488 + def clear!; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#438 + def default_env; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#421 + def default_scope; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#425 + def default_scope=(new_default_scope); end + + # Returns the value of attribute default_url_options. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#354 + def default_url_options; end + + # Sets the attribute default_url_options + # + # @param value the value to set the attribute default_url_options to. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#354 + def default_url_options=(_arg0); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#509 + def define_mounted_helper(name, script_namer = T.unsafe(nil)); end + + # Returns the value of attribute disable_clear_and_finalize. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#353 + def disable_clear_and_finalize; end + + # Sets the attribute disable_clear_and_finalize + # + # @param value the value to set the attribute disable_clear_and_finalize to. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#353 + def disable_clear_and_finalize=(_arg0); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#457 + def draw(&block); end + + # Returns the value of attribute draw_paths. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#354 + def draw_paths; end + + # Sets the attribute draw_paths + # + # @param value the value to set the attribute draw_paths to. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#354 + def draw_paths=(_arg0); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#406 + def eager_load!; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#639 + def empty?; end + + # Returns the value of attribute env_key. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#355 + def env_key; end + + # Generate the path indicated by the arguments, and return an array of the keys + # that were not used to generate it. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#818 + def extra_keys(options, recall = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#482 + def finalize!; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#846 + def find_script_name(options); end + + # Returns the value of attribute formatter. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#352 + def formatter; end + + # Sets the attribute formatter + # + # @param value the value to set the attribute formatter to. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#352 + def formatter=(_arg0); end + + # Returns a Route matching the given requirements, or `nil` if none are found. + # + # This is intended for use by tools such as Language Servers. + # + # Given the routes are defined as: + # + # resources :posts + # + # Then the following will return the Route for the `show` action: + # + # Rails.application.routes.from_requirements(controller: "posts", action: "show") + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#29 + def from_requirements(requirements); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#822 + def generate_extras(options, recall = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#536 + def generate_url_helpers(supports_path); end + + # Since the router holds references to many parts of the system like engines, + # controllers and the application itself, inspecting the route set can actually + # be really slow, therefore we default alias inspect to to_s. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#37 + def inspect; end + + # Contains all the mounted helpers across different engines and the `main_app` + # helper for the application. You can include this in your classes if you want + # to access routes for other engines. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#505 + def mounted_helpers; end + + # Returns the value of attribute named_routes. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#352 + def named_routes; end + + # Sets the attribute named_routes + # + # @param value the value to set the attribute named_routes to. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#352 + def named_routes=(_arg0); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#842 + def optimize_routes_generation?; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#850 + def path_for(options, route_name = T.unsafe(nil), reserved = T.unsafe(nil)); end + + # Returns the value of attribute polymorphic_mappings. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#355 + def polymorphic_mappings; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#468 + def prepend(&block); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#909 + def recognize_path(path, environment = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#924 + def recognize_path_with_request(req, path, extras, raise_on_missing: T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#413 + def relative_url_root; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#429 + def request_class; end + + # Returns the value of attribute resources_path_names. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#353 + def resources_path_names; end + + # Sets the attribute resources_path_names + # + # @param value the value to set the attribute resources_path_names to. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#353 + def resources_path_names=(_arg0); end + + # Returns the value of attribute router. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#352 + def router; end + + # Sets the attribute router + # + # @param value the value to set the attribute router to. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#352 + def router=(_arg0); end + + # Returns the value of attribute set. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#357 + def routes; end + + # Returns the value of attribute set. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#352 + def set; end + + # Sets the attribute set + # + # @param value the value to set the attribute set to. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#352 + def set=(_arg0); end + + # The `options` argument must be a hash whose keys are **symbols**. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#855 + def url_for(options, route_name = T.unsafe(nil), url_strategy = T.unsafe(nil), method_name = T.unsafe(nil), reserved = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#528 + def url_helpers(supports_path = T.unsafe(nil)); end + + private + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#472 + def eval_block(block); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#833 + def generate(route_name, options, recall = T.unsafe(nil), method_name = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#433 + def make_request(env); end + + class << self + # source://actionpack//lib/action_dispatch/routing/route_set.rb#359 + def default_resources_path_names; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#363 + def new_with_config(config); end + end +end + +# source://actionpack//lib/action_dispatch/routing/route_set.rb#382 +class ActionDispatch::Routing::RouteSet::Config < ::Struct + # Returns the value of attribute api_only + # + # @return [Object] the current value of api_only + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#382 + def api_only; end + + # Sets the attribute api_only + # + # @param value [Object] the value to set the attribute api_only to. + # @return [Object] the newly set value + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#382 + def api_only=(_); end + + # Returns the value of attribute default_scope + # + # @return [Object] the current value of default_scope + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#382 + def default_scope; end + + # Sets the attribute default_scope + # + # @param value [Object] the value to set the attribute default_scope to. + # @return [Object] the newly set value + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#382 + def default_scope=(_); end + + # Returns the value of attribute relative_url_root + # + # @return [Object] the current value of relative_url_root + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#382 + def relative_url_root; end + + # Sets the attribute relative_url_root + # + # @param value [Object] the value to set the attribute relative_url_root to. + # @return [Object] the newly set value + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#382 + def relative_url_root=(_); end + + class << self + # source://actionpack//lib/action_dispatch/routing/route_set.rb#382 + def [](*_arg0); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#382 + def inspect; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#382 + def keyword_init?; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#382 + def members; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#382 + def new(*_arg0); end + end +end + +# source://actionpack//lib/action_dispatch/routing/route_set.rb#682 +class ActionDispatch::Routing::RouteSet::CustomUrlHelper + # @return [CustomUrlHelper] a new instance of CustomUrlHelper + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#685 + def initialize(name, defaults, &block); end + + # Returns the value of attribute block. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#683 + def block; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#691 + def call(t, args, only_path = T.unsafe(nil)); end + + # Returns the value of attribute defaults. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#683 + def defaults; end + + # Returns the value of attribute name. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#683 + def name; end + + private + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#703 + def eval_block(t, args, options); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#707 + def merge_defaults(options); end +end + +# source://actionpack//lib/action_dispatch/routing/route_set.rb#384 +ActionDispatch::Routing::RouteSet::DEFAULT_CONFIG = T.let(T.unsafe(nil), ActionDispatch::Routing::RouteSet::Config) + +# source://actionpack//lib/action_dispatch/routing/route_set.rb#39 +class ActionDispatch::Routing::RouteSet::Dispatcher < ::ActionDispatch::Routing::Endpoint + # @return [Dispatcher] a new instance of Dispatcher + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#40 + def initialize(raise_on_name_error); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#44 + def dispatcher?; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#46 + def serve(req); end + + private + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#60 + def controller(req); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#64 + def dispatch(controller, action, req, res); end +end + +# source://actionpack//lib/action_dispatch/routing/route_set.rb#712 +class ActionDispatch::Routing::RouteSet::Generator + # @return [Generator] a new instance of Generator + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#715 + def initialize(named_route, options, recall, set); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#727 + def controller; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#731 + def current_controller; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#801 + def different_controller?; end + + # Generates a path from routes, returns a RouteWithParams or MissingRoute. + # MissingRoute will raise ActionController::UrlGenerationError. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#797 + def generate; end + + # Returns the value of attribute named_route. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#713 + def named_route; end + + # Remove leading slashes from controllers + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#785 + def normalize_controller!; end + + # This pulls :controller, :action, and :id out of the recall. The recall key is + # only used if there is no key in the options or if the key in the options is + # identical. If any of :controller, :action or :id is not found, don't pull any + # more keys from the recall. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#767 + def normalize_controller_action_id!; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#743 + def normalize_options!; end + + # Returns the value of attribute options. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#713 + def options; end + + # Returns the value of attribute recall. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#713 + def recall; end + + # Returns the value of attribute set. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#713 + def set; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#735 + def use_recall_for(key); end + + # if the current controller is "foo/bar/baz" and controller: "baz/bat" is + # specified, the controller becomes "foo/baz/bat" + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#775 + def use_relative_controller!; end + + private + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#807 + def named_route_exists?; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#811 + def segment_keys; end +end + +# source://actionpack//lib/action_dispatch/routing/route_set.rb#497 +module ActionDispatch::Routing::RouteSet::MountedHelpers + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActionDispatch::Routing::UrlFor + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end + + module GeneratedInstanceMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end +end + +# A NamedRouteCollection instance is a collection of named routes, and also +# maintains an anonymous module that can be used to install helpers for the +# named routes. +# +# source://actionpack//lib/action_dispatch/routing/route_set.rb#82 +class ActionDispatch::Routing::RouteSet::NamedRouteCollection + include ::Enumerable + + # @return [NamedRouteCollection] a new instance of NamedRouteCollection + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#87 + def initialize; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#147 + def [](name); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#146 + def []=(name, route); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#118 + def add(name, route); end + + # Given a `name`, defines name_path and name_url helpers. Used by 'direct', + # 'resolve', and 'polymorphic' route helpers. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#165 + def add_url_helper(name, defaults, &block); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#148 + def clear; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#104 + def clear!; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#150 + def each(&block); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#137 + def get(name); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#100 + def helper_names; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#141 + def key?(name); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#159 + def length; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#155 + def names; end + + # Returns the value of attribute path_helpers_module. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#84 + def path_helpers_module; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#95 + def route_defined?(name); end + + # Returns the value of attribute url_helpers_module. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#84 + def url_helpers_module; end + + private + + # Create a URL helper allowing ordered parameters to be associated with + # corresponding dynamic segments, so you can do: + # + # foo_url(bar, baz, bang) + # + # Instead of: + # + # foo_url(bar: bar, baz: baz, bang: bang) + # + # Also allow options hash, so you can do: + # + # foo_url(bar, baz, bang, sort_by: 'baz') + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#333 + def define_url_helper(mod, name, helper, url_strategy); end + + # Returns the value of attribute routes. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#84 + def routes; end +end + +# source://actionpack//lib/action_dispatch/routing/route_set.rb#188 +class ActionDispatch::Routing::RouteSet::NamedRouteCollection::UrlHelper + # @return [UrlHelper] a new instance of UrlHelper + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#271 + def initialize(route, options, route_name); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#278 + def call(t, method_name, args, inner_options, url_strategy); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#290 + def handle_positional_args(controller_options, inner_options, args, result, path_params); end + + # Returns the value of attribute route_name. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#201 + def route_name; end + + class << self + # source://actionpack//lib/action_dispatch/routing/route_set.rb#189 + def create(route, options, route_name); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#197 + def optimize_helper?(route); end + end +end + +# source://actionpack//lib/action_dispatch/routing/route_set.rb#203 +class ActionDispatch::Routing::RouteSet::NamedRouteCollection::UrlHelper::OptimizedUrlHelper < ::ActionDispatch::Routing::RouteSet::NamedRouteCollection::UrlHelper + # @return [OptimizedUrlHelper] a new instance of OptimizedUrlHelper + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#206 + def initialize(route, options, route_name); end + + # Returns the value of attribute arg_size. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#204 + def arg_size; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#212 + def call(t, method_name, args, inner_options, url_strategy); end + + private + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#243 + def optimize_routes_generation?(t); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#235 + def optimized_helper(args); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#247 + def parameterize_args(args); end + + # @raise [ActionController::UrlGenerationError] + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#258 + def raise_generation_error(args); end +end + +# strategy for building URLs to send to the client +# +# source://actionpack//lib/action_dispatch/routing/route_set.rb#349 +ActionDispatch::Routing::RouteSet::PATH = T.let(T.unsafe(nil), Proc) + +# source://actionpack//lib/action_dispatch/routing/route_set.rb#838 +ActionDispatch::Routing::RouteSet::RESERVED_OPTIONS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/routing/route_set.rb#69 +class ActionDispatch::Routing::RouteSet::StaticDispatcher < ::ActionDispatch::Routing::RouteSet::Dispatcher + # @return [StaticDispatcher] a new instance of StaticDispatcher + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#70 + def initialize(controller_class); end + + private + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#76 + def controller(_); end +end + +# source://actionpack//lib/action_dispatch/routing/route_set.rb#350 +ActionDispatch::Routing::RouteSet::UNKNOWN = T.let(T.unsafe(nil), Proc) + +# source://actionpack//lib/action_dispatch/routing/inspector.rb#10 +class ActionDispatch::Routing::RouteWrapper < ::SimpleDelegator + # source://actionpack//lib/action_dispatch/routing/inspector.rb#56 + def action; end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#28 + def constraints; end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#52 + def controller; end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#17 + def endpoint; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/inspector.rb#64 + def engine?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/inspector.rb#60 + def internal?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/inspector.rb#11 + def matches_filter?(filter, value); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#40 + def name; end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#36 + def path; end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#32 + def rack_app; end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#44 + def reqs; end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#68 + def to_h; end +end + +# This class is just used for displaying route information when someone +# executes `bin/rails routes` or looks at the RoutingError page. People should +# not use this class. +# +# source://actionpack//lib/action_dispatch/routing/inspector.rb#81 +class ActionDispatch::Routing::RoutesInspector + # @return [RoutesInspector] a new instance of RoutesInspector + # + # source://actionpack//lib/action_dispatch/routing/inspector.rb#82 + def initialize(routes); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#87 + def format(formatter, filter = T.unsafe(nil)); end + + private + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#147 + def filter_routes(routes, filter); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#98 + def format_routes(formatter, filter, engine_name, routes); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#115 + def load_engines_routes; end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#128 + def normalize_filter(filter); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#111 + def wrap_routes(routes); end +end + +# source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#9 +class ActionDispatch::Routing::RoutesProxy + include ::ActionDispatch::Routing::PolymorphicRoutes + include ::ActionDispatch::Routing::UrlFor + + # @return [RoutesProxy] a new instance of RoutesProxy + # + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#15 + def initialize(routes, scope, helpers, script_namer = T.unsafe(nil)); end + + # Returns the value of attribute routes. + # + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#13 + def _routes; end + + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#10 + def default_url_options; end + + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#10 + def default_url_options=(_arg0); end + + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#10 + def default_url_options?; end + + # Returns the value of attribute routes. + # + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#12 + def routes; end + + # Sets the attribute routes + # + # @param value the value to set the attribute routes to. + # + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#12 + def routes=(_arg0); end + + # Returns the value of attribute scope. + # + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#12 + def scope; end + + # Sets the attribute scope + # + # @param value the value to set the attribute scope to. + # + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#12 + def scope=(_arg0); end + + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#21 + def url_options; end + + private + + # Keeps the part of the script name provided by the global context via + # [ENV]("SCRIPT_NAME"), which `mount` doesn't know about since it depends on the + # specific request, but use our script name resolver for the mount point + # dependent part. + # + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#55 + def merge_script_names(previous_script_name, new_script_name); end + + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#32 + def method_missing(method, *args); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#28 + def respond_to_missing?(method, _); end + + class << self + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#10 + def default_url_options; end + + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#10 + def default_url_options=(value); end + + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#10 + def default_url_options?; end + + private + + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#10 + def __class_attr_default_url_options; end + + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#10 + def __class_attr_default_url_options=(new_value); end + end +end + +# source://actionpack//lib/action_dispatch/routing.rb#259 +ActionDispatch::Routing::SEPARATORS = T.let(T.unsafe(nil), Array) + +# # Action Dispatch Routing UrlFor +# +# In `config/routes.rb` you define URL-to-controller mappings, but the reverse +# is also possible: a URL can be generated from one of your routing definitions. +# URL generation functionality is centralized in this module. +# +# See ActionDispatch::Routing for general information about routing and +# `config/routes.rb`. +# +# **Tip:** If you need to generate URLs from your models or some other place, +# then ActionDispatch::Routing::UrlFor is what you're looking for. Read on for +# an introduction. In general, this module should not be included on its own, as +# it is usually included by `url_helpers` (as in +# `Rails.application.routes.url_helpers`). +# +# ## URL generation from parameters +# +# As you may know, some functions, such as `ActionController::Base#url_for` and +# ActionView::Helpers::UrlHelper#link_to, can generate URLs given a set of +# parameters. For example, you've probably had the chance to write code like +# this in one of your views: +# +# <%= link_to('Click here', controller: 'users', +# action: 'new', message: 'Welcome!') %> +# # => Click here +# +# `link_to`, and all other functions that require URL generation functionality, +# actually use ActionDispatch::Routing::UrlFor under the hood. And in +# particular, they use the ActionDispatch::Routing::UrlFor#url_for method. One +# can generate the same path as the above example by using the following code: +# +# include ActionDispatch::Routing::UrlFor +# url_for(controller: 'users', +# action: 'new', +# message: 'Welcome!', +# only_path: true) +# # => "/users/new?message=Welcome%21" +# +# Notice the `only_path: true` part. This is because UrlFor has no information +# about the website hostname that your Rails app is serving. So if you want to +# include the hostname as well, then you must also pass the `:host` argument: +# +# include UrlFor +# url_for(controller: 'users', +# action: 'new', +# message: 'Welcome!', +# host: 'www.example.com') +# # => "http://www.example.com/users/new?message=Welcome%21" +# +# By default, all controllers and views have access to a special version of +# `url_for`, that already knows what the current hostname is. So if you use +# `url_for` in your controllers or your views, then you don't need to explicitly +# pass the `:host` argument. +# +# For convenience, mailers also include ActionDispatch::Routing::UrlFor. So +# within mailers, you can use url_for. However, mailers cannot access incoming +# web requests in order to derive hostname information, so you have to provide +# the `:host` option or set the default host using `default_url_options`. For +# more information on url_for in mailers see the ActionMailer::Base +# documentation. +# +# ## URL generation for named routes +# +# UrlFor also allows one to access methods that have been auto-generated from +# named routes. For example, suppose that you have a 'users' resource in your +# `config/routes.rb`: +# +# resources :users +# +# This generates, among other things, the method `users_path`. By default, this +# method is accessible from your controllers, views, and mailers. If you need to +# access this auto-generated method from other places (such as a model), then +# you can do that by including `Rails.application.routes.url_helpers` in your +# class: +# +# class User < ActiveRecord::Base +# include Rails.application.routes.url_helpers +# +# def base_uri +# user_path(self) +# end +# end +# +# User.find(1).base_uri # => "/users/1" +# +# source://actionpack//lib/action_dispatch/routing/url_for.rb#92 +module ActionDispatch::Routing::UrlFor + include ::ActionDispatch::Routing::PolymorphicRoutes + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + # source://actionpack//lib/action_dispatch/routing/url_for.rb#111 + def initialize(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_dispatch/routing/url_for.rb#182 + def full_url_for(options = T.unsafe(nil)); end + + # Allows calling direct or regular named route. + # + # resources :buckets + # + # direct :recordable do |recording| + # route_for(:bucket, recording.bucket) + # end + # + # direct :threadable do |threadable| + # route_for(:recordable, threadable.parent) + # end + # + # This maintains the context of the original caller on whether to return a path + # or full URL, e.g: + # + # threadable_path(threadable) # => "/buckets/1" + # threadable_url(threadable) # => "http://example.com/buckets/1" + # + # source://actionpack//lib/action_dispatch/routing/url_for.rb#222 + def route_for(name, *args); end + + # Generate a URL based on the options provided, `default_url_options`, and the + # routes defined in `config/routes.rb`. The following options are supported: + # + # * `:only_path` - If true, the relative URL is returned. Defaults to `false`. + # * `:protocol` - The protocol to connect to. Defaults to `"http"`. + # * `:host` - Specifies the host the link should be targeted at. If + # `:only_path` is false, this option must be provided either explicitly, or + # via `default_url_options`. + # * `:subdomain` - Specifies the subdomain of the link, using the `tld_length` + # to split the subdomain from the host. If false, removes all subdomains + # from the host part of the link. + # * `:domain` - Specifies the domain of the link, using the `tld_length` to + # split the domain from the host. + # * `:tld_length` - Number of labels the TLD id composed of, only used if + # `:subdomain` or `:domain` are supplied. Defaults to + # `ActionDispatch::Http::URL.tld_length`, which in turn defaults to 1. + # * `:port` - Optionally specify the port to connect to. + # * `:anchor` - An anchor name to be appended to the path. + # * `:params` - The query parameters to be appended to the path. + # * `:path_params` - The query parameters that will only be used for the named + # dynamic segments of path. If unused, they will be discarded. + # * `:trailing_slash` - If true, adds a trailing slash, as in + # `"/archive/2009/"`. + # * `:script_name` - Specifies application path relative to domain root. If + # provided, prepends application path. + # + # + # Any other key (`:controller`, `:action`, etc.) given to `url_for` is forwarded + # to the Routes module. + # + # url_for controller: 'tasks', action: 'testing', host: 'somehost.org', port: '8080' + # # => 'http://somehost.org:8080/tasks/testing' + # url_for controller: 'tasks', action: 'testing', host: 'somehost.org', anchor: 'ok', only_path: true + # # => '/tasks/testing#ok' + # url_for controller: 'tasks', action: 'testing', trailing_slash: true + # # => 'http://somehost.org/tasks/testing/' + # url_for controller: 'tasks', action: 'testing', host: 'somehost.org', number: '33' + # # => 'http://somehost.org/tasks/testing?number=33' + # url_for controller: 'tasks', action: 'testing', host: 'somehost.org', script_name: "/myapp" + # # => 'http://somehost.org/myapp/tasks/testing' + # url_for controller: 'tasks', action: 'testing', host: 'somehost.org', script_name: "/myapp", only_path: true + # # => '/myapp/tasks/testing' + # + # Missing routes keys may be filled in from the current request's parameters + # (e.g. `:controller`, `:action`, `:id`, and any other parameters that are + # placed in the path). Given that the current action has been reached through + # `GET /users/1`: + # + # url_for(only_path: true) # => '/users/1' + # url_for(only_path: true, action: 'edit') # => '/users/1/edit' + # url_for(only_path: true, action: 'edit', id: 2) # => '/users/2/edit' + # + # Notice that no `:id` parameter was provided to the first `url_for` call and + # the helper used the one from the route's path. Any path parameter implicitly + # used by `url_for` can always be overwritten like shown on the last `url_for` + # calls. + # + # source://actionpack//lib/action_dispatch/routing/url_for.rb#178 + def url_for(options = T.unsafe(nil)); end + + # Hook overridden in controller to add request information with + # `default_url_options`. Application logic should not go into url_options. + # + # source://actionpack//lib/action_dispatch/routing/url_for.rb#118 + def url_options; end + + protected + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/url_for.rb#227 + def optimize_routes_generation?; end + + private + + # source://actionpack//lib/action_dispatch/routing/url_for.rb#239 + def _routes_context; end + + # source://actionpack//lib/action_dispatch/routing/url_for.rb#232 + def _with_routes(routes); end + + module GeneratedClassMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end + + module GeneratedInstanceMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end +end + +# # Action Dispatch SSL +# +# This middleware is added to the stack when `config.force_ssl = true`, and is +# passed the options set in `config.ssl_options`. It does three jobs to enforce +# secure HTTP requests: +# +# 1. **TLS redirect**: Permanently redirects `http://` requests to `https://` +# with the same URL host, path, etc. Enabled by default. Set +# `config.ssl_options` to modify the destination URL: +# +# config.ssl_options = { redirect: { host: "secure.widgets.com", port: 8080 }` +# +# Or set `redirect: false` to disable redirection. +# +# Requests can opt-out of redirection with `exclude`: +# +# config.ssl_options = { redirect: { exclude: -> request { request.path == "/up" } } } +# +# Cookies will not be flagged as secure for excluded requests. +# +# When proxying through a load balancer that terminates SSL, the forwarded +# request will appear as though it's HTTP instead of HTTPS to the application. +# This makes redirects and cookie security target HTTP instead of HTTPS. +# To make the server assume that the proxy already terminated SSL, and +# that the request really is HTTPS, set `config.assume_ssl` to `true`: +# +# config.assume_ssl = true +# +# 2. **Secure cookies**: Sets the `secure` flag on cookies to tell browsers +# they must not be sent along with `http://` requests. Enabled by default. +# Set `config.ssl_options` with `secure_cookies: false` to disable this +# feature. +# +# 3. **HTTP Strict Transport Security (HSTS)**: Tells the browser to remember +# this site as TLS-only and automatically redirect non-TLS requests. Enabled +# by default. Configure `config.ssl_options` with `hsts: false` to disable. +# +# Set `config.ssl_options` with `hsts: { ... }` to configure HSTS: +# +# * `expires`: How long, in seconds, these settings will stick. The +# minimum required to qualify for browser preload lists is 1 year. +# Defaults to 2 years (recommended). +# +# * `subdomains`: Set to `true` to tell the browser to apply these +# settings to all subdomains. This protects your cookies from +# interception by a vulnerable site on a subdomain. Defaults to `true`. +# +# * `preload`: Advertise that this site may be included in browsers' +# preloaded HSTS lists. HSTS protects your site on every visit *except +# the first visit* since it hasn't seen your HSTS header yet. To close +# this gap, browser vendors include a baked-in list of HSTS-enabled +# sites. Go to https://hstspreload.org to submit your site for +# inclusion. Defaults to `false`. +# +# +# To turn off HSTS, omitting the header is not enough. Browsers will +# remember the original HSTS directive until it expires. Instead, use the +# header to tell browsers to expire HSTS immediately. Setting `hsts: false` +# is a shortcut for `hsts: { expires: 0 }`. +# +# source://actionpack//lib/action_dispatch/middleware/ssl.rb#66 +class ActionDispatch::SSL + # @return [SSL] a new instance of SSL + # + # source://actionpack//lib/action_dispatch/middleware/ssl.rb#76 + def initialize(app, redirect: T.unsafe(nil), hsts: T.unsafe(nil), secure_cookies: T.unsafe(nil), ssl_default_redirect_status: T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/middleware/ssl.rb#88 + def call(env); end + + private + + # https://tools.ietf.org/html/rfc6797#section-6.1 + # + # source://actionpack//lib/action_dispatch/middleware/ssl.rb#122 + def build_hsts_header(hsts); end + + # source://actionpack//lib/action_dispatch/middleware/ssl.rb#129 + def flag_cookies_as_secure!(headers); end + + # source://actionpack//lib/action_dispatch/middleware/ssl.rb#170 + def https_location_for(request); end + + # source://actionpack//lib/action_dispatch/middleware/ssl.rb#107 + def normalize_hsts_options(options); end + + # source://actionpack//lib/action_dispatch/middleware/ssl.rb#153 + def redirect_to_https(request); end + + # source://actionpack//lib/action_dispatch/middleware/ssl.rb#160 + def redirection_status(request); end + + # source://actionpack//lib/action_dispatch/middleware/ssl.rb#103 + def set_hsts_header!(headers); end + + class << self + # source://actionpack//lib/action_dispatch/middleware/ssl.rb#72 + def default_hsts_options; end + end +end + +# :stopdoc: Default to 2 years as recommended on hstspreload.org. +# +# source://actionpack//lib/action_dispatch/middleware/ssl.rb#68 +ActionDispatch::SSL::HSTS_EXPIRES_IN = T.let(T.unsafe(nil), Integer) + +# source://actionpack//lib/action_dispatch/middleware/ssl.rb#70 +ActionDispatch::SSL::PERMANENT_REDIRECT_REQUEST_METHODS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/middleware/server_timing.rb#8 +class ActionDispatch::ServerTiming + # @return [ServerTiming] a new instance of ServerTiming + # + # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#52 + def initialize(app); end + + # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#58 + def call(env); end + + class << self + # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#48 + def unsubscribe; end + end +end + +# source://actionpack//lib/action_dispatch/middleware/server_timing.rb#9 +class ActionDispatch::ServerTiming::Subscriber + include ::Singleton::SingletonInstanceMethods + include ::Singleton + extend ::Singleton::SingletonClassMethods + + # @return [Subscriber] a new instance of Subscriber + # + # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#13 + def initialize; end + + # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#17 + def call(event); end + + # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#23 + def collect_events; end + + # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#32 + def ensure_subscribed; end + + # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#40 + def unsubscribe; end + + class << self + private + + # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#10 + def allocate; end + + # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#10 + def new(*_arg0); end + end +end + +# source://actionpack//lib/action_dispatch/middleware/server_timing.rb#11 +ActionDispatch::ServerTiming::Subscriber::KEY = T.let(T.unsafe(nil), Symbol) + +# source://actionpack//lib/action_dispatch.rb#106 +module ActionDispatch::Session + class << self + # source://actionpack//lib/action_dispatch.rb#113 + def resolve_store(session_store); end + end +end + +# source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#97 +class ActionDispatch::Session::AbstractSecureStore < ::Rack::Session::Abstract::PersistedSecure + include ::ActionDispatch::Session::Compatibility + include ::ActionDispatch::Session::StaleSessionCheck + include ::ActionDispatch::Session::SessionObject + + # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#102 + def generate_sid; end + + private + + # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#107 + def set_cookie(request, response, cookie); end +end + +# source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#86 +class ActionDispatch::Session::AbstractStore < ::Rack::Session::Abstract::Persisted + include ::ActionDispatch::Session::Compatibility + include ::ActionDispatch::Session::StaleSessionCheck + include ::ActionDispatch::Session::SessionObject + + private + + # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#92 + def set_cookie(request, response, cookie); end +end + +# # Action Dispatch Session CacheStore +# +# A session store that uses an ActiveSupport::Cache::Store to store the +# sessions. This store is most useful if you don't store critical data in your +# sessions and you don't need them to live for extended periods of time. +# +# #### Options +# * `cache` - The cache to use. If it is not specified, `Rails.cache` +# will be used. +# * `expire_after` - The length of time a session will be stored before +# automatically expiring. By default, the `:expires_in` option of the cache +# is used. +# * `check_collisions` - Check if newly generated session ids aren't already in use. +# If for some reason 128 bits of randomness aren't considered secure enough to avoid +# collisions, this option can be enabled to ensure newly generated ids aren't in use. +# By default, it is set to `false` to avoid additional cache write operations. +# +# source://actionpack//lib/action_dispatch/middleware/session/cache_store.rb#26 +class ActionDispatch::Session::CacheStore < ::ActionDispatch::Session::AbstractSecureStore + # @return [CacheStore] a new instance of CacheStore + # + # source://actionpack//lib/action_dispatch/middleware/session/cache_store.rb#27 + def initialize(app, options = T.unsafe(nil)); end + + # Remove a session from the cache. + # + # source://actionpack//lib/action_dispatch/middleware/session/cache_store.rb#54 + def delete_session(env, sid, options); end + + # Get a session from the cache. + # + # source://actionpack//lib/action_dispatch/middleware/session/cache_store.rb#35 + def find_session(env, sid); end + + # Set a session in the cache. + # + # source://actionpack//lib/action_dispatch/middleware/session/cache_store.rb#43 + def write_session(env, sid, session, options); end + + private + + # Turn the session id into a cache key. + # + # source://actionpack//lib/action_dispatch/middleware/session/cache_store.rb#62 + def cache_key(id); end + + # source://actionpack//lib/action_dispatch/middleware/session/cache_store.rb#70 + def generate_sid; end + + # source://actionpack//lib/action_dispatch/middleware/session/cache_store.rb#66 + def get_session_with_fallback(sid); end +end + +# source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#22 +module ActionDispatch::Session::Compatibility + # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#23 + def initialize(app, options = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#28 + def generate_sid; end + + private + + # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#35 + def initialize_sid; end + + # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#40 + def make_request(env); end +end + +# # Action Dispatch Session CookieStore +# +# This cookie-based session store is the Rails default. It is dramatically +# faster than the alternatives. +# +# Sessions typically contain at most a user ID and flash message; both fit +# within the 4096 bytes cookie size limit. A `CookieOverflow` exception is +# raised if you attempt to store more than 4096 bytes of data. +# +# The cookie jar used for storage is automatically configured to be the best +# possible option given your application's configuration. +# +# Your cookies will be encrypted using your application's `secret_key_base`. +# This goes a step further than signed cookies in that encrypted cookies cannot +# be altered or read by users. This is the default starting in Rails 4. +# +# Configure your session store in an initializer: +# +# Rails.application.config.session_store :cookie_store, key: '_your_app_session' +# +# In the development and test environments your application's `secret_key_base` +# is generated by Rails and stored in a temporary file in +# `tmp/local_secret.txt`. In all other environments, it is stored encrypted in +# the `config/credentials.yml.enc` file. +# +# If your application was not updated to Rails 5.2 defaults, the +# `secret_key_base` will be found in the old `config/secrets.yml` file. +# +# Note that changing your `secret_key_base` will invalidate all existing +# session. Additionally, you should take care to make sure you are not relying +# on the ability to decode signed cookies generated by your app in external +# applications or JavaScript before changing it. +# +# Because CookieStore extends `Rack::Session::Abstract::Persisted`, many of the +# options described there can be used to customize the session cookie that is +# generated. For example: +# +# Rails.application.config.session_store :cookie_store, expire_after: 14.days +# +# would set the session cookie to expire automatically 14 days after creation. +# Other useful options include `:key`, `:secure`, `:httponly`, and `:same_site`. +# +# source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#52 +class ActionDispatch::Session::CookieStore < ::ActionDispatch::Session::AbstractSecureStore + # @return [CookieStore] a new instance of CookieStore + # + # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#64 + def initialize(app, options = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#70 + def delete_session(req, session_id, options); end + + # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#77 + def load_session(req); end + + private + + # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#124 + def cookie_jar(request); end + + # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#86 + def extract_session_id(req); end + + # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#120 + def get_cookie(req); end + + # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#105 + def persistent_session_id!(data, sid = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#116 + def set_cookie(request, session_id, cookie); end + + # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#93 + def unpacked_cookie_data(req); end + + # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#111 + def write_session(req, sid, session_data, options); end +end + +# source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#62 +ActionDispatch::Session::CookieStore::DEFAULT_SAME_SITE = T.let(T.unsafe(nil), Proc) + +# source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#53 +class ActionDispatch::Session::CookieStore::SessionId + # @return [SessionId] a new instance of SessionId + # + # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#56 + def initialize(session_id, cookie_value = T.unsafe(nil)); end + + # Returns the value of attribute cookie_value. + # + # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#54 + def cookie_value; end +end + +# source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#71 +module ActionDispatch::Session::SessionObject + # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#72 + def commit_session(req, res); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#81 + def loaded_session?(session); end + + # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#77 + def prepare_session(req); end +end + +# source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#13 +class ActionDispatch::Session::SessionRestoreError < ::StandardError + # @return [SessionRestoreError] a new instance of SessionRestoreError + # + # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#14 + def initialize; end +end + +# source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#45 +module ActionDispatch::Session::StaleSessionCheck + # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#50 + def extract_session_id(env); end + + # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#46 + def load_session(env); end + + # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#54 + def stale_session_check!; end +end + +# # Action Dispatch ShowExceptions +# +# This middleware rescues any exception returned by the application and calls an +# exceptions app that will wrap it in a format for the end user. +# +# The exceptions app should be passed as a parameter on initialization of +# `ShowExceptions`. Every time there is an exception, `ShowExceptions` will +# store the exception in `env["action_dispatch.exception"]`, rewrite the +# `PATH_INFO` to the exception status code, and call the Rack app. +# +# In Rails applications, the exceptions app can be configured with +# `config.exceptions_app`, which defaults to ActionDispatch::PublicExceptions. +# +# If the application returns a response with the `X-Cascade` header set to +# `"pass"`, this middleware will send an empty response as a result with the +# correct status code. If any exception happens inside the exceptions app, this +# middleware catches the exceptions and returns a failsafe response. +# +# source://actionpack//lib/action_dispatch/middleware/show_exceptions.rb#25 +class ActionDispatch::ShowExceptions + # @return [ShowExceptions] a new instance of ShowExceptions + # + # source://actionpack//lib/action_dispatch/middleware/show_exceptions.rb#26 + def initialize(app, exceptions_app); end + + # source://actionpack//lib/action_dispatch/middleware/show_exceptions.rb#31 + def call(env); end + + private + + # source://actionpack//lib/action_dispatch/middleware/show_exceptions.rb#67 + def fallback_to_html_format_if_invalid_mime_type(request); end + + # source://actionpack//lib/action_dispatch/middleware/show_exceptions.rb#83 + def pass_response(status); end + + # source://actionpack//lib/action_dispatch/middleware/show_exceptions.rb#48 + def render_exception(request, wrapper); end +end + +# # Action Dispatch Static +# +# This middleware serves static files from disk, if available. If no file is +# found, it hands off to the main app. +# +# In Rails apps, this middleware is configured to serve assets from the +# `public/` directory. +# +# Only GET and HEAD requests are served. POST and other HTTP methods are handed +# off to the main app. +# +# Only files in the root directory are served; path traversal is denied. +# +# source://actionpack//lib/action_dispatch/middleware/static.rb#20 +class ActionDispatch::Static + # @return [Static] a new instance of Static + # + # source://actionpack//lib/action_dispatch/middleware/static.rb#21 + def initialize(app, path, index: T.unsafe(nil), headers: T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/middleware/static.rb#26 + def call(env); end +end + +# source://actionpack//lib/action_dispatch/structured_event_subscriber.rb#4 +class ActionDispatch::StructuredEventSubscriber < ::ActiveSupport::StructuredEventSubscriber + # source://actionpack//lib/action_dispatch/structured_event_subscriber.rb#5 + def redirect(event); end +end + +# # System Testing +# +# System tests let you test applications in the browser. Because system tests +# use a real browser experience, you can test all of your JavaScript easily from +# your test suite. +# +# To create a system test in your application, extend your test class from +# `ApplicationSystemTestCase`. System tests use Capybara as a base and allow you +# to configure the settings through your `application_system_test_case.rb` file +# that is generated with a new application or scaffold. +# +# Here is an example system test: +# +# require "application_system_test_case" +# +# class Users::CreateTest < ApplicationSystemTestCase +# test "adding a new user" do +# visit users_path +# click_on 'New User' +# +# fill_in 'Name', with: 'Arya' +# click_on 'Create User' +# +# assert_text 'Arya' +# end +# end +# +# When generating an application or scaffold, an +# `application_system_test_case.rb` file will also be generated containing the +# base class for system testing. This is where you can change the driver, add +# Capybara settings, and other configuration for your system tests. +# +# require "test_helper" +# +# class ApplicationSystemTestCase < ActionDispatch::SystemTestCase +# driven_by :selenium, using: :chrome, screen_size: [1400, 1400] +# end +# +# By default, `ActionDispatch::SystemTestCase` is driven by the Selenium driver, +# with the Chrome browser, and a browser size of 1400x1400. +# +# Changing the driver configuration options is easy. Let's say you want to use +# the Firefox browser instead of Chrome. In your +# `application_system_test_case.rb` file add the following: +# +# require "test_helper" +# +# class ApplicationSystemTestCase < ActionDispatch::SystemTestCase +# driven_by :selenium, using: :firefox +# end +# +# `driven_by` has a required argument for the driver name. The keyword arguments +# are `:using` for the browser and `:screen_size` to change the size of the +# browser screen. These two options are not applicable for headless drivers and +# will be silently ignored if passed. +# +# Headless browsers such as headless Chrome and headless Firefox are also +# supported. You can use these browsers by setting the `:using` argument to +# `:headless_chrome` or `:headless_firefox`. +# +# To use a headless driver, like Cuprite, update your Gemfile to use Cuprite +# instead of Selenium and then declare the driver name in the +# `application_system_test_case.rb` file. In this case, you would leave out the +# `:using` option because the driver is headless, but you can still use +# `:screen_size` to change the size of the browser screen, also you can use +# `:options` to pass options supported by the driver. Please refer to your +# driver documentation to learn about supported options. +# +# require "test_helper" +# require "capybara/cuprite" +# +# class ApplicationSystemTestCase < ActionDispatch::SystemTestCase +# driven_by :cuprite, screen_size: [1400, 1400], options: +# { js_errors: true } +# end +# +# Some drivers require browser capabilities to be passed as a block instead of +# through the `options` hash. +# +# As an example, if you want to add mobile emulation on chrome, you'll have to +# create an instance of selenium's `Chrome::Options` object and add capabilities +# with a block. +# +# The block will be passed an instance of `::Options` where you can +# define the capabilities you want. Please refer to your driver documentation to +# learn about supported options. +# +# class ApplicationSystemTestCase < ActionDispatch::SystemTestCase +# driven_by :selenium, using: :chrome, screen_size: [1024, 768] do |driver_option| +# driver_option.add_emulation(device_name: 'iPhone 6') +# driver_option.add_extension('path/to/chrome_extension.crx') +# end +# end +# +# Because `ActionDispatch::SystemTestCase` is a shim between Capybara and Rails, +# any driver that is supported by Capybara is supported by system tests as long +# as you include the required gems and files. +# +# source://actionpack//lib/action_dispatch/system_test_case.rb#114 +class ActionDispatch::SystemTestCase < ::ActiveSupport::TestCase + include ::Capybara::DSL + include ::Capybara::Minitest::Assertions + include ::ActionDispatch::SystemTesting::TestHelpers::SetupAndTeardown + include ::ActionDispatch::SystemTesting::TestHelpers::ScreenshotHelper + include ::ActionText::SystemTestHelper + include ::Turbo::SystemTestHelper + + # @return [SystemTestCase] a new instance of SystemTestCase + # + # source://actionpack//lib/action_dispatch/system_test_case.rb#122 + def initialize(*_arg0); end + + private + + # source://actionpack//lib/action_dispatch/system_test_case.rb#191 + def method_missing(name, *_arg1, **_arg2, &_arg3); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/system_test_case.rb#199 + def respond_to_missing?(name, include_private = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/system_test_case.rb#173 + def url_helpers; end + + class << self + # System Test configuration options + # + # The default settings are Selenium, using Chrome, with a screen size of + # 1400x1400. + # + # Examples: + # + # driven_by :cuprite + # + # driven_by :selenium, screen_size: [800, 800] + # + # driven_by :selenium, using: :chrome + # + # driven_by :selenium, using: :headless_chrome + # + # driven_by :selenium, using: :firefox + # + # driven_by :selenium, using: :headless_firefox + # + # source://actionpack//lib/action_dispatch/system_test_case.rb#158 + def driven_by(driver, using: T.unsafe(nil), screen_size: T.unsafe(nil), options: T.unsafe(nil), &capabilities); end + + # source://actionpack//lib/action_dispatch/system_test_case.rb#138 + def driver; end + + # source://actionpack//lib/action_dispatch/system_test_case.rb#138 + def driver=(value); end + + # source://actionpack//lib/action_dispatch/system_test_case.rb#138 + def driver?; end + + # Configuration for the System Test application server. + # + # By default this is localhost. This method allows the host and port to be specified manually. + # + # source://actionpack//lib/action_dispatch/system_test_case.rb#167 + def served_by(host:, port:); end + + # source://actionpack//lib/action_dispatch/system_test_case.rb#128 + def start_application; end + + private + + # source://actionpack//lib/action_dispatch/system_test_case.rb#138 + def __class_attr_driver; end + + # source://actionpack//lib/action_dispatch/system_test_case.rb#138 + def __class_attr_driver=(new_value); end + end +end + +# source://actionpack//lib/action_dispatch/system_test_case.rb#120 +ActionDispatch::SystemTestCase::DEFAULT_HOST = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/system_testing/driver.rb#6 +module ActionDispatch::SystemTesting; end + +# source://actionpack//lib/action_dispatch/system_testing/browser.rb#7 +class ActionDispatch::SystemTesting::Browser + # @return [Browser] a new instance of Browser + # + # source://actionpack//lib/action_dispatch/system_testing/browser.rb#10 + def initialize(name); end + + # @yield [options] + # + # source://actionpack//lib/action_dispatch/system_testing/browser.rb#35 + def configure; end + + # Returns the value of attribute name. + # + # source://actionpack//lib/action_dispatch/system_testing/browser.rb#8 + def name; end + + # source://actionpack//lib/action_dispatch/system_testing/browser.rb#25 + def options; end + + # driver_path is lazily initialized by default. Eagerly set it to avoid race + # conditions when using parallel tests. + # + # source://actionpack//lib/action_dispatch/system_testing/browser.rb#41 + def preload; end + + # source://actionpack//lib/action_dispatch/system_testing/browser.rb#14 + def type; end + + private + + # source://actionpack//lib/action_dispatch/system_testing/browser.rb#51 + def default_chrome_options; end + + # source://actionpack//lib/action_dispatch/system_testing/browser.rb#59 + def default_firefox_options; end + + # source://actionpack//lib/action_dispatch/system_testing/browser.rb#65 + def resolve_driver_path(namespace); end +end + +# source://actionpack//lib/action_dispatch/system_testing/driver.rb#7 +class ActionDispatch::SystemTesting::Driver + # @return [Driver] a new instance of Driver + # + # source://actionpack//lib/action_dispatch/system_testing/driver.rb#10 + def initialize(driver_type, **options, &capabilities); end + + # Returns the value of attribute name. + # + # source://actionpack//lib/action_dispatch/system_testing/driver.rb#8 + def name; end + + # source://actionpack//lib/action_dispatch/system_testing/driver.rb#27 + def use; end + + private + + # source://actionpack//lib/action_dispatch/system_testing/driver.rb#51 + def browser_options; end + + # source://actionpack//lib/action_dispatch/system_testing/driver.rb#38 + def register; end + + # source://actionpack//lib/action_dispatch/system_testing/driver.rb#61 + def register_cuprite(app); end + + # source://actionpack//lib/action_dispatch/system_testing/driver.rb#69 + def register_playwright(app); end + + # source://actionpack//lib/action_dispatch/system_testing/driver.rb#65 + def register_rack_test(app); end + + # source://actionpack//lib/action_dispatch/system_testing/driver.rb#55 + def register_selenium(app); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/system_testing/driver.rb#34 + def registerable?; end + + # source://actionpack//lib/action_dispatch/system_testing/driver.rb#80 + def setup; end +end + +# source://actionpack//lib/action_dispatch/system_testing/server.rb#7 +class ActionDispatch::SystemTesting::Server + # source://actionpack//lib/action_dispatch/system_testing/server.rb#14 + def run; end + + private + + # source://actionpack//lib/action_dispatch/system_testing/server.rb#28 + def set_port; end + + # source://actionpack//lib/action_dispatch/system_testing/server.rb#24 + def set_server; end + + # source://actionpack//lib/action_dispatch/system_testing/server.rb#19 + def setup; end + + class << self + # Returns the value of attribute silence_puma. + # + # source://actionpack//lib/action_dispatch/system_testing/server.rb#9 + def silence_puma; end + + # Sets the attribute silence_puma + # + # @param value the value to set the attribute silence_puma to. + # + # source://actionpack//lib/action_dispatch/system_testing/server.rb#9 + def silence_puma=(_arg0); end + end +end + +# source://actionpack//lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#7 +module ActionDispatch::SystemTesting::TestHelpers; end + +# Screenshot helper for system testing. +# +# source://actionpack//lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#9 +module ActionDispatch::SystemTesting::TestHelpers::ScreenshotHelper + # Takes a screenshot of the current page in the browser if the test failed. + # + # `take_failed_screenshot` is called during system test teardown. + # + # source://actionpack//lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#53 + def take_failed_screenshot; end + + # Takes a screenshot of the current page in the browser. + # + # `take_screenshot` can be used at any point in your system tests to take a + # screenshot of the current state. This can be useful for debugging or + # automating visual testing. You can take multiple screenshots per test to + # investigate changes at different points during your test. These will be named + # with a sequential prefix (or 'failed' for failing tests) + # + # The default screenshots directory is `tmp/screenshots` but you can set a + # different one with `Capybara.save_path` + # + # You can use the `html` argument or set the + # `RAILS_SYSTEM_TESTING_SCREENSHOT_HTML` environment variable to save the HTML + # from the page that is being screenshotted so you can investigate the elements + # on the page at the time of the screenshot + # + # You can use the `screenshot` argument or set the + # `RAILS_SYSTEM_TESTING_SCREENSHOT` environment variable to control the output. + # Possible values are: + # `simple` (default) + # + # `inline` + # (https://iterm2.com/documentation-images.html). + # + # `artifact` + # format (https://buildkite.github.io/terminal-to-html/inline-images/). + # + # source://actionpack//lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#41 + def take_screenshot(html: T.unsafe(nil), screenshot: T.unsafe(nil)); end + + private + + # Returns the value of attribute _screenshot_counter. + # + # source://actionpack//lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#61 + def _screenshot_counter; end + + # Sets the attribute _screenshot_counter + # + # @param value the value to set the attribute _screenshot_counter to. + # + # source://actionpack//lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#61 + def _screenshot_counter=(_arg0); end + + # source://actionpack//lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#106 + def absolute_html_path; end + + # source://actionpack//lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#98 + def absolute_image_path; end + + # source://actionpack//lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#90 + def absolute_path; end + + # source://actionpack//lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#134 + def display_image(html:, screenshot_output:); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#154 + def failed?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#63 + def html_from_env?; end + + # source://actionpack//lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#86 + def html_path; end + + # source://actionpack//lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#76 + def image_name; end + + # source://actionpack//lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#82 + def image_path; end + + # source://actionpack//lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#67 + def increment_unique; end + + # source://actionpack//lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#150 + def inline_base64(path); end + + # source://actionpack//lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#120 + def output_type; end + + # source://actionpack//lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#102 + def relative_image_path; end + + # source://actionpack//lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#111 + def save_html; end + + # source://actionpack//lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#115 + def save_image; end + + # source://actionpack//lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#94 + def screenshots_dir; end + + # source://actionpack//lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#130 + def show(img); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#158 + def supports_screenshot?; end + + # source://actionpack//lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#72 + def unique; end +end + +# source://actionpack//lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb#8 +module ActionDispatch::SystemTesting::TestHelpers::SetupAndTeardown + # source://actionpack//lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb#15 + def after_teardown; end + + # source://actionpack//lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb#9 + def before_teardown; end +end + +# source://actionpack//lib/action_dispatch/testing/test_helpers/page_dump_helper.rb#4 +module ActionDispatch::TestHelpers; end + +# source://actionpack//lib/action_dispatch/testing/test_helpers/page_dump_helper.rb#5 +module ActionDispatch::TestHelpers::PageDumpHelper + # Saves the content of response body to a file and tries to open it in your browser. + # Launchy must be present in your Gemfile for the page to open automatically. + # + # source://actionpack//lib/action_dispatch/testing/test_helpers/page_dump_helper.rb#10 + def save_and_open_page(path = T.unsafe(nil)); end + + private + + # source://actionpack//lib/action_dispatch/testing/test_helpers/page_dump_helper.rb#30 + def html_dump_default_path; end + + # source://actionpack//lib/action_dispatch/testing/test_helpers/page_dump_helper.rb#23 + def open_file(path); end + + # @raise [InvalidResponse] + # + # source://actionpack//lib/action_dispatch/testing/test_helpers/page_dump_helper.rb#15 + def save_page(path = T.unsafe(nil)); end +end + +# source://actionpack//lib/action_dispatch/testing/test_helpers/page_dump_helper.rb#6 +class ActionDispatch::TestHelpers::PageDumpHelper::InvalidResponse < ::StandardError; end + +# source://actionpack//lib/action_dispatch/testing/test_process.rb#9 +module ActionDispatch::TestProcess + include ::ActionDispatch::TestProcess::FixtureFile + + # @raise [NoMethodError] + # + # source://actionpack//lib/action_dispatch/testing/test_process.rb#34 + def assigns(key = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/testing/test_process.rb#48 + def cookies; end + + # source://actionpack//lib/action_dispatch/testing/test_process.rb#44 + def flash; end + + # source://actionpack//lib/action_dispatch/testing/test_process.rb#52 + def redirect_to_url; end + + # source://actionpack//lib/action_dispatch/testing/test_process.rb#40 + def session; end +end + +# source://actionpack//lib/action_dispatch/testing/test_process.rb#10 +module ActionDispatch::TestProcess::FixtureFile + # Shortcut for + # `Rack::Test::UploadedFile.new(File.join(ActionDispatch::IntegrationTest.file_fixture_path, path), type)`: + # + # post :change_avatar, params: { avatar: file_fixture_upload('david.png', 'image/png') } + # + # Default fixture files location is `test/fixtures/files`. + # + # To upload binary files on Windows, pass `:binary` as the last parameter. This + # will not affect other platforms: + # + # post :change_avatar, params: { avatar: file_fixture_upload('david.png', 'image/png', :binary) } + # + # source://actionpack//lib/action_dispatch/testing/test_process.rb#22 + def file_fixture_upload(path, mime_type = T.unsafe(nil), binary = T.unsafe(nil)); end + + # Shortcut for + # `Rack::Test::UploadedFile.new(File.join(ActionDispatch::IntegrationTest.file_fixture_path, path), type)`: + # + # post :change_avatar, params: { avatar: file_fixture_upload('david.png', 'image/png') } + # + # Default fixture files location is `test/fixtures/files`. + # + # To upload binary files on Windows, pass `:binary` as the last parameter. This + # will not affect other platforms: + # + # post :change_avatar, params: { avatar: file_fixture_upload('david.png', 'image/png', :binary) } + # + # source://actionpack//lib/action_dispatch/testing/test_process.rb#29 + def fixture_file_upload(path, mime_type = T.unsafe(nil), binary = T.unsafe(nil)); end +end + +# source://actionpack//lib/action_dispatch/testing/test_request.rb#9 +class ActionDispatch::TestRequest < ::ActionDispatch::Request + # source://actionpack//lib/action_dispatch/testing/test_request.rb#68 + def accept=(mime_types); end + + # source://actionpack//lib/action_dispatch/testing/test_request.rb#48 + def action=(action_name); end + + # source://actionpack//lib/action_dispatch/testing/test_request.rb#32 + def host=(host); end + + # source://actionpack//lib/action_dispatch/testing/test_request.rb#52 + def if_modified_since=(last_modified); end + + # source://actionpack//lib/action_dispatch/testing/test_request.rb#56 + def if_none_match=(etag); end + + # source://actionpack//lib/action_dispatch/testing/test_request.rb#44 + def path=(path); end + + # source://actionpack//lib/action_dispatch/testing/test_request.rb#36 + def port=(number); end + + # source://actionpack//lib/action_dispatch/testing/test_request.rb#60 + def remote_addr=(addr); end + + # source://actionpack//lib/action_dispatch/testing/test_request.rb#28 + def request_method=(method); end + + # source://actionpack//lib/action_dispatch/testing/test_request.rb#40 + def request_uri=(uri); end + + # source://actionpack//lib/action_dispatch/testing/test_request.rb#64 + def user_agent=(user_agent); end + + class << self + # Create a new test request with default `env` values. + # + # source://actionpack//lib/action_dispatch/testing/test_request.rb#17 + def create(env = T.unsafe(nil)); end + + private + + # source://actionpack//lib/action_dispatch/testing/test_request.rb#23 + def default_env; end + end +end + +# source://actionpack//lib/action_dispatch/testing/test_request.rb#10 +ActionDispatch::TestRequest::DEFAULT_ENV = T.let(T.unsafe(nil), Hash) + +# Integration test methods such as Integration::RequestHelpers#get and +# Integration::RequestHelpers#post return objects of class TestResponse, which +# represent the HTTP response results of the requested controller actions. +# +# See Response for more information on controller response objects. +# +# source://actionpack//lib/action_dispatch/testing/test_response.rb#13 +class ActionDispatch::TestResponse < ::ActionDispatch::Response + # Returns a parsed body depending on the response MIME type. When a parser + # corresponding to the MIME type is not found, it returns the raw body. + # + # #### Examples + # get "/posts" + # response.content_type # => "text/html; charset=utf-8" + # response.parsed_body.class # => Nokogiri::HTML5::Document + # response.parsed_body.to_html # => "\n\n..." + # + # assert_pattern { response.parsed_body.at("main") => { content: "Hello, world" } } + # + # response.parsed_body.at("main") => {name:, content:} + # assert_equal "main", name + # assert_equal "Some main content", content + # + # get "/posts.json" + # response.content_type # => "application/json; charset=utf-8" + # response.parsed_body.class # => Array + # response.parsed_body # => [{"id"=>42, "title"=>"Title"},... + # + # assert_pattern { response.parsed_body => [{ id: 42 }] } + # + # get "/posts/42.json" + # response.content_type # => "application/json; charset=utf-8" + # response.parsed_body.class # => ActiveSupport::HashWithIndifferentAccess + # response.parsed_body # => {"id"=>42, "title"=>"Title"} + # + # assert_pattern { response.parsed_body => [{ title: /title/i }] } + # + # response.parsed_body => {id:, title:} + # assert_equal 42, id + # assert_equal "Title", title + # + # source://actionpack//lib/action_dispatch/testing/test_response.rb#50 + def parsed_body; end + + # source://actionpack//lib/action_dispatch/testing/test_response.rb#54 + def response_parser; end + + class << self + # source://actionpack//lib/action_dispatch/testing/test_response.rb#14 + def from_response(response); end + end +end + +# :markup: markdown +# +# source://actionpack//lib/action_pack/gem_version.rb#5 +module ActionPack + class << self + # Returns the currently loaded version of Action Pack as a `Gem::Version`. + # + # source://actionpack//lib/action_pack/gem_version.rb#7 + def gem_version; end + + # Returns the currently loaded version of Action Pack as a `Gem::Version`. + # + # source://actionpack//lib/action_pack/version.rb#9 + def version; end + end +end + +# source://actionpack//lib/action_pack/gem_version.rb#11 +module ActionPack::VERSION; end + +# source://actionpack//lib/action_pack/gem_version.rb#12 +ActionPack::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# source://actionpack//lib/action_pack/gem_version.rb#13 +ActionPack::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# source://actionpack//lib/action_pack/gem_version.rb#15 +ActionPack::VERSION::PRE = T.let(T.unsafe(nil), T.untyped) + +# source://actionpack//lib/action_pack/gem_version.rb#17 +ActionPack::VERSION::STRING = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_pack/gem_version.rb#14 +ActionPack::VERSION::TINY = T.let(T.unsafe(nil), Integer) + +module ActionView::RoutingUrlFor + include ::ActionDispatch::Routing::PolymorphicRoutes + include ::ActionDispatch::Routing::UrlFor +end + +# source://actionpack//lib/action_dispatch/http/mime_type.rb#7 +module Mime + class << self + # source://actionpack//lib/action_dispatch/http/mime_type.rb#51 + def [](type); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#64 + def fetch(type, &block); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#56 + def symbols; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#60 + def valid_symbols?(symbols); end + end +end + +# ALL isn't a real MIME type, so we don't register it for lookup with the other +# concrete types. It's a wildcard match that we use for `respond_to` negotiation +# internals. +# +# source://actionpack//lib/action_dispatch/http/mime_type.rb#363 +Mime::ALL = T.let(T.unsafe(nil), Mime::AllType) + +# source://actionpack//lib/action_dispatch/http/mime_type.rb#349 +class Mime::AllType < ::Mime::Type + include ::Singleton::SingletonInstanceMethods + include ::Singleton + extend ::Singleton::SingletonClassMethods + + # @return [AllType] a new instance of AllType + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#352 + def initialize; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#356 + def all?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#357 + def html?; end + + class << self + private + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#350 + def allocate; end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#350 + def new(*_arg0); end + end +end + +# source://actionpack//lib/action_dispatch/http/mime_type.rb#47 +Mime::EXTENSION_LOOKUP = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_dispatch/http/mime_type.rb#48 +Mime::LOOKUP = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_dispatch/http/mime_type.rb#8 +class Mime::Mimes + include ::Enumerable + + # @return [Mimes] a new instance of Mimes + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#13 + def initialize; end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#23 + def <<(type); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#30 + def delete_if; end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#19 + def each(&block); end + + # Returns the value of attribute symbols. + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#9 + def symbols; end + + # :nodoc + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#41 + def valid_symbols?(symbols); end +end + +# source://actionpack//lib/action_dispatch/http/mime_type.rb#365 +class Mime::NullType + include ::Singleton::SingletonInstanceMethods + include ::Singleton + extend ::Singleton::SingletonClassMethods + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#368 + def nil?; end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#376 + def ref; end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#372 + def to_s; end + + private + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#383 + def method_missing(method, *_arg1, **_arg2, &_arg3); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#379 + def respond_to_missing?(method, _); end + + class << self + private + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#366 + def allocate; end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#366 + def new(*_arg0); end + end +end + +# source://actionpack//lib/action_dispatch/http/mime_type.rb#46 +Mime::SET = T.let(T.unsafe(nil), Mime::Mimes) + +# Encapsulates the notion of a MIME type. Can be used at render time, for +# example, with: +# +# class PostsController < ActionController::Base +# def show +# @post = Post.find(params[:id]) +# +# respond_to do |format| +# format.html +# format.ics { render body: @post.to_ics, mime_type: Mime::Type.lookup("text/calendar") } +# format.xml { render xml: @post } +# end +# end +# end +# +# source://actionpack//lib/action_dispatch/http/mime_type.rb#84 +class Mime::Type + # @return [Type] a new instance of Type + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#264 + def initialize(string, symbol = T.unsafe(nil), synonyms = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#297 + def ==(mime_type); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#289 + def ===(list); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#311 + def =~(mime_type); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#327 + def all?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#304 + def eql?(other); end + + # Returns the value of attribute hash. + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#255 + def hash; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#323 + def html?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#317 + def match?(mime_type); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#285 + def ref; end + + # Returns the value of attribute symbol. + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#85 + def symbol; end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#273 + def to_s; end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#277 + def to_str; end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#281 + def to_sym; end + + protected + + # Returns the value of attribute string. + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#330 + def string; end + + # Returns the value of attribute synonyms. + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#330 + def synonyms; end + + private + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#336 + def method_missing(method, *_arg1, **_arg2, &_arg3); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#344 + def respond_to_missing?(method, include_private = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#334 + def to_a; end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#333 + def to_ary; end + + class << self + # source://actionpack//lib/action_dispatch/http/mime_type.rb#167 + def lookup(string); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#175 + def lookup_by_extension(extension); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#200 + def parse(accept_header); end + + # For an input of `'text'`, returns `[Mime[:json], Mime[:xml], Mime[:ics], + # Mime[:html], Mime[:css], Mime[:csv], Mime[:js], Mime[:yaml], Mime[:text]]`. + # + # For an input of `'application'`, returns `[Mime[:html], Mime[:js], Mime[:xml], + # Mime[:yaml], Mime[:atom], Mime[:json], Mime[:rss], Mime[:url_encoded_form]]`. + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#236 + def parse_data_with_trailing_star(type); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#227 + def parse_trailing_star(accept_header); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#186 + def register(string, symbol, mime_type_synonyms = T.unsafe(nil), extension_synonyms = T.unsafe(nil), skip_lookup = T.unsafe(nil)); end + + # Registers an alias that's not used on MIME type lookup, but can be referenced + # directly. Especially useful for rendering different HTML versions depending on + # the user agent, like an iPhone. + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#182 + def register_alias(string, symbol, extension_synonyms = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#163 + def register_callback(&block); end + + # This method is opposite of register method. + # + # To unregister a MIME type: + # + # Mime::Type.unregister(:mobile) + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#245 + def unregister(symbol); end + end +end + +# A simple helper class used in parsing the accept header. +# +# source://actionpack//lib/action_dispatch/http/mime_type.rb#90 +class Mime::Type::AcceptItem + # @return [AcceptItem] a new instance of AcceptItem + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#94 + def initialize(index, name, q = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#101 + def <=>(item); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#91 + def index; end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#91 + def index=(_arg0); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#91 + def name; end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#91 + def name=(_arg0); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#91 + def q; end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#91 + def q=(_arg0); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#92 + def to_s; end +end + +# source://actionpack//lib/action_dispatch/http/mime_type.rb#108 +class Mime::Type::AcceptList + class << self + # source://actionpack//lib/action_dispatch/http/mime_type.rb#151 + def find_item_by_name(array, name); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#109 + def sort!(list); end + end +end + +# source://actionpack//lib/action_dispatch/http/mime_type.rb#262 +class Mime::Type::InvalidMimeType < ::StandardError; end + +# source://actionpack//lib/action_dispatch/http/mime_type.rb#257 +Mime::Type::MIME_NAME = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/mime_type.rb#259 +Mime::Type::MIME_PARAMETER = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/mime_type.rb#258 +Mime::Type::MIME_PARAMETER_VALUE = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/mime_type.rb#260 +Mime::Type::MIME_REGEXP = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch.rb#35 +module Rack; end diff --git a/sorbet/rbi/gems/actiontext@8.1.1.rbi b/sorbet/rbi/gems/actiontext@8.1.1.rbi new file mode 100644 index 0000000..137f0b8 --- /dev/null +++ b/sorbet/rbi/gems/actiontext@8.1.1.rbi @@ -0,0 +1,1548 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `actiontext` gem. +# Please instead update this file by running `bin/tapioca gem actiontext`. + + +# :markup: markdown +# :include: ../README.md +# +# source://actiontext//lib/action_text/gem_version.rb#5 +module ActionText + extend ::ActiveSupport::Autoload + + class << self + # source://actiontext//lib/action_text/deprecator.rb#6 + def deprecator; end + + # Returns the currently loaded version of Action Text as a `Gem::Version`. + # + # source://actiontext//lib/action_text/gem_version.rb#7 + def gem_version; end + + # source://actiontext//lib/action_text.rb#47 + def html_document_class; end + + # source://actiontext//lib/action_text.rb#53 + def html_document_fragment_class; end + + # source://actiontext//lib/action_text/engine.rb#15 + def railtie_helpers_paths; end + + # source://actiontext//lib/action_text/engine.rb#15 + def railtie_namespace; end + + # source://actiontext//lib/action_text/engine.rb#15 + def railtie_routes_url_helpers(include_path_helpers = T.unsafe(nil)); end + + # source://actiontext//lib/action_text/engine.rb#15 + def table_name_prefix; end + + # source://actiontext//lib/action_text/engine.rb#15 + def use_relative_model_naming?; end + + # Returns the currently loaded version of Action Text as a `Gem::Version`. + # + # source://actiontext//lib/action_text/version.rb#9 + def version; end + end +end + +# # Action Text Attachable +# +# Include this module to make a record attachable to an ActionText::Content. +# +# class Person < ApplicationRecord +# include ActionText::Attachable +# end +# +# person = Person.create! name: "Javan" +# html = %Q() +# content = ActionText::Content.new(html) +# content.attachables # => [person] +# +# source://actiontext//lib/action_text/attachable.rb#18 +module ActionText::Attachable + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionText::Attachable::ClassMethods + + # source://actiontext//lib/action_text/attachable.rb#83 + def attachable_content_type; end + + # source://actiontext//lib/action_text/attachable.rb#87 + def attachable_filename; end + + # source://actiontext//lib/action_text/attachable.rb#91 + def attachable_filesize; end + + # source://actiontext//lib/action_text/attachable.rb#95 + def attachable_metadata; end + + # Returns the Signed Global ID for the attachable. The purpose of the ID is set + # to 'attachable' so it can't be reused for other purposes. + # + # source://actiontext//lib/action_text/attachable.rb#79 + def attachable_sgid; end + + # @return [Boolean] + # + # source://actiontext//lib/action_text/attachable.rb#99 + def previewable_attachable?; end + + # Returns the path to the partial that is used for rendering the attachable. + # Defaults to `to_partial_path`. + # + # Override to render a different partial: + # + # class User < ApplicationRecord + # def to_attachable_partial_path + # "users/attachable" + # end + # end + # + # source://actiontext//lib/action_text/attachable.rb#127 + def to_attachable_partial_path; end + + # source://actiontext//lib/action_text/attachable.rb#131 + def to_rich_text_attributes(attributes = T.unsafe(nil)); end + + # Returns the path to the partial that is used for rendering the attachable in + # Trix. Defaults to `to_partial_path`. + # + # Override to render a different partial: + # + # class User < ApplicationRecord + # def to_trix_content_attachment_partial_path + # "users/trix_content_attachment" + # end + # end + # + # source://actiontext//lib/action_text/attachable.rb#113 + def to_trix_content_attachment_partial_path; end + + private + + # source://actiontext//lib/action_text/attachable.rb#144 + def attribute_names_for_serialization; end + + # source://actiontext//lib/action_text/attachable.rb#148 + def read_attribute_for_serialization(key); end + + class << self + # source://actiontext//lib/action_text/attachable.rb#43 + def from_attachable_sgid(sgid, options = T.unsafe(nil)); end + + # Extracts the `ActionText::Attachable` from the attachment HTML node: + # + # person = Person.create! name: "Javan" + # html = %Q() + # fragment = ActionText::Fragment.wrap(html) + # attachment_node = fragment.find_all(ActionText::Attachment.tag_name).first + # ActionText::Attachable.from_node(attachment_node) # => person + # + # source://actiontext//lib/action_text/attachable.rb#31 + def from_node(node); end + + private + + # source://actiontext//lib/action_text/attachable.rb#50 + def attachable_from_sgid(sgid); end + end +end + +# source://actiontext//lib/action_text/attachable.rb#57 +module ActionText::Attachable::ClassMethods + # source://actiontext//lib/action_text/attachable.rb#58 + def from_attachable_sgid(sgid); end + + # source://actiontext//lib/action_text/attachable.rb#72 + def to_missing_attachable_partial_path; end +end + +# source://actiontext//lib/action_text/attachable.rb#21 +ActionText::Attachable::LOCATOR_NAME = T.let(T.unsafe(nil), String) + +# source://actiontext//lib/action_text.rb#30 +module ActionText::Attachables + extend ::ActiveSupport::Autoload +end + +# source://actiontext//lib/action_text/attachables/content_attachment.rb#7 +class ActionText::Attachables::ContentAttachment + include ::ActiveModel::Validations + include ::ActiveSupport::Callbacks + include ::ActiveModel::Validations::HelperMethods + include ::ActiveModel::Conversion + include ::ActiveModel::ForbiddenAttributesProtection + include ::ActiveModel::AttributeAssignment + include ::ActiveModel::API + include ::ActiveModel::Access + include ::ActiveModel::Model + extend ::ActiveModel::Validations::ClassMethods + extend ::ActiveModel::Naming + extend ::ActiveModel::Callbacks + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::ActiveSupport::DescendantsTracker + extend ::ActiveModel::Translation + extend ::ActiveModel::Validations::HelperMethods + extend ::ActiveModel::Conversion::ClassMethods + + # source://actiontext//lib/action_text/attachables/content_attachment.rb#8 + def __callbacks; end + + # source://actiontext//lib/action_text/attachables/content_attachment.rb#8 + def _run_validate_callbacks(&block); end + + # source://actiontext//lib/action_text/attachables/content_attachment.rb#8 + def _run_validate_callbacks!(&block); end + + # source://actiontext//lib/action_text/attachables/content_attachment.rb#8 + def _validate_callbacks; end + + # source://actiontext//lib/action_text/attachables/content_attachment.rb#8 + def _validators; end + + # source://actiontext//lib/action_text/attachables/content_attachment.rb#8 + def _validators?; end + + # source://actiontext//lib/action_text/attachables/content_attachment.rb#20 + def attachable_plain_text_representation(caption); end + + # Returns the value of attribute content. + # + # source://actiontext//lib/action_text/attachables/content_attachment.rb#15 + def content; end + + # Sets the attribute content + # + # @param value the value to set the attribute content to. + # + # source://actiontext//lib/action_text/attachables/content_attachment.rb#15 + def content=(_arg0); end + + # Returns the value of attribute content_type. + # + # source://actiontext//lib/action_text/attachables/content_attachment.rb#15 + def content_type; end + + # Sets the attribute content_type + # + # @param value the value to set the attribute content_type to. + # + # source://actiontext//lib/action_text/attachables/content_attachment.rb#15 + def content_type=(_arg0); end + + # source://actiontext//lib/action_text/attachables/content_attachment.rb#8 + def model_name(&_arg0); end + + # source://actiontext//lib/action_text/attachables/content_attachment.rb#8 + def param_delimiter=(_arg0); end + + # source://actiontext//lib/action_text/attachables/content_attachment.rb#24 + def to_html; end + + # source://actiontext//lib/action_text/attachables/content_attachment.rb#32 + def to_partial_path; end + + # source://actiontext//lib/action_text/attachables/content_attachment.rb#28 + def to_s; end + + private + + # source://actiontext//lib/action_text/attachables/content_attachment.rb#37 + def content_instance; end + + class << self + # source://actiontext//lib/action_text/attachables/content_attachment.rb#8 + def __callbacks; end + + # source://actiontext//lib/action_text/attachables/content_attachment.rb#8 + def __callbacks=(value); end + + # source://actiontext//lib/action_text/attachables/content_attachment.rb#8 + def _validate_callbacks; end + + # source://actiontext//lib/action_text/attachables/content_attachment.rb#8 + def _validate_callbacks=(value); end + + # source://actiontext//lib/action_text/attachables/content_attachment.rb#8 + def _validators; end + + # source://actiontext//lib/action_text/attachables/content_attachment.rb#8 + def _validators=(value); end + + # source://actiontext//lib/action_text/attachables/content_attachment.rb#8 + def _validators?; end + + # source://actiontext//lib/action_text/attachables/content_attachment.rb#10 + def from_node(node); end + + # source://actiontext//lib/action_text/attachables/content_attachment.rb#8 + def param_delimiter; end + + # source://actiontext//lib/action_text/attachables/content_attachment.rb#8 + def param_delimiter=(value); end + + # source://actiontext//lib/action_text/attachables/content_attachment.rb#8 + def param_delimiter?; end + + private + + # source://actiontext//lib/action_text/attachables/content_attachment.rb#8 + def __class_attr___callbacks; end + + # source://actiontext//lib/action_text/attachables/content_attachment.rb#8 + def __class_attr___callbacks=(new_value); end + + # source://actiontext//lib/action_text/attachables/content_attachment.rb#8 + def __class_attr__validators; end + + # source://actiontext//lib/action_text/attachables/content_attachment.rb#8 + def __class_attr__validators=(new_value); end + + # source://actiontext//lib/action_text/attachables/content_attachment.rb#8 + def __class_attr_param_delimiter; end + + # source://actiontext//lib/action_text/attachables/content_attachment.rb#8 + def __class_attr_param_delimiter=(new_value); end + end +end + +# source://actiontext//lib/action_text/attachables/missing_attachable.rb#7 +class ActionText::Attachables::MissingAttachable + extend ::ActiveModel::Naming + + # @return [MissingAttachable] a new instance of MissingAttachable + # + # source://actiontext//lib/action_text/attachables/missing_attachable.rb#12 + def initialize(sgid); end + + # source://actiontext//lib/action_text/attachables/missing_attachable.rb#24 + def model; end + + # source://actiontext//lib/action_text/attachables/missing_attachable.rb#8 + def model_name(&_arg0); end + + # source://actiontext//lib/action_text/attachables/missing_attachable.rb#16 + def to_partial_path; end +end + +# source://actiontext//lib/action_text/attachables/missing_attachable.rb#10 +ActionText::Attachables::MissingAttachable::DEFAULT_PARTIAL_PATH = T.let(T.unsafe(nil), String) + +# source://actiontext//lib/action_text/attachables/remote_image.rb#7 +class ActionText::Attachables::RemoteImage + extend ::ActiveModel::Naming + + # @return [RemoteImage] a new instance of RemoteImage + # + # source://actiontext//lib/action_text/attachables/remote_image.rb#32 + def initialize(attributes = T.unsafe(nil)); end + + # source://actiontext//lib/action_text/attachables/remote_image.rb#39 + def attachable_plain_text_representation(caption); end + + # Returns the value of attribute content_type. + # + # source://actiontext//lib/action_text/attachables/remote_image.rb#30 + def content_type; end + + # Returns the value of attribute height. + # + # source://actiontext//lib/action_text/attachables/remote_image.rb#30 + def height; end + + # source://actiontext//lib/action_text/attachables/remote_image.rb#8 + def model_name(&_arg0); end + + # source://actiontext//lib/action_text/attachables/remote_image.rb#43 + def to_partial_path; end + + # Returns the value of attribute url. + # + # source://actiontext//lib/action_text/attachables/remote_image.rb#30 + def url; end + + # Returns the value of attribute width. + # + # source://actiontext//lib/action_text/attachables/remote_image.rb#30 + def width; end + + class << self + # source://actiontext//lib/action_text/attachables/remote_image.rb#11 + def from_node(node); end + + private + + # source://actiontext//lib/action_text/attachables/remote_image.rb#22 + def attributes_from_node(node); end + + # @return [Boolean] + # + # source://actiontext//lib/action_text/attachables/remote_image.rb#18 + def content_type_is_image?(content_type); end + end +end + +# # Action Text Attachment +# +# Attachments serialize attachables to HTML or plain text. +# +# class Person < ApplicationRecord +# include ActionText::Attachable +# end +# +# attachable = Person.create! name: "Javan" +# attachment = ActionText::Attachment.from_attachable(attachable) +# attachment.to_html # => " " "[racecar.jpg]" + # + # Use the `caption` when set: + # + # attachment = ActionText::Attachment.from_attachable(attachable, caption: "Vroom vroom") + # attachment.to_plain_text # => "[Vroom vroom]" + # + # The presentation can be overridden by implementing the + # `attachable_plain_text_representation` method: + # + # class Person < ApplicationRecord + # include ActionText::Attachable + # + # def attachable_plain_text_representation + # "[#{name}]" + # end + # end + # + # attachable = Person.create! name: "Javan" + # attachment = ActionText::Attachment.from_attachable(attachable) + # attachment.to_plain_text # => "[Javan]" + # + # source://actiontext//lib/action_text/attachment.rb#110 + def to_plain_text; end + + # source://actiontext//lib/action_text/attachment.rb#127 + def to_s; end + + # source://actiontext//lib/action_text/attachment.rb#81 + def with_full_attributes; end + + private + + # source://actiontext//lib/action_text/attachment.rb#140 + def attachable_attributes; end + + # source://actiontext//lib/action_text/attachment.rb#136 + def node_attributes; end + + # source://actiontext//lib/action_text/attachment.rb#66 + def respond_to_missing?(name, include_private = T.unsafe(nil)); end + + # source://actiontext//lib/action_text/attachment.rb#144 + def sgid_attributes; end + + class << self + # source://actiontext//lib/action_text/attachment.rb#27 + def fragment_by_canonicalizing_attachments(content); end + + # source://actiontext//lib/action_text/attachment.rb#39 + def from_attachable(attachable, attributes = T.unsafe(nil)); end + + # source://actiontext//lib/action_text/attachment.rb#35 + def from_attachables(attachables); end + + # source://actiontext//lib/action_text/attachment.rb#45 + def from_attributes(attributes, attachable = T.unsafe(nil)); end + + # source://actiontext//lib/action_text/attachment.rb#31 + def from_node(node, attachable = T.unsafe(nil)); end + + # source://actiontext//lib/action_text/attachment.rb#22 + def tag_name; end + + # source://actiontext//lib/action_text/attachment.rb#22 + def tag_name=(val); end + + private + + # source://actiontext//lib/action_text/attachment.rb#52 + def node_from_attributes(attributes); end + + # source://actiontext//lib/action_text/attachment.rb#58 + def process_attributes(attributes); end + end +end + +# source://actiontext//lib/action_text/attachment.rb#24 +ActionText::Attachment::ATTRIBUTES = T.let(T.unsafe(nil), Array) + +# source://actiontext//lib/action_text/attachment_gallery.rb#6 +class ActionText::AttachmentGallery + include ::ActiveModel::Validations + include ::ActiveSupport::Callbacks + include ::ActiveModel::Validations::HelperMethods + include ::ActiveModel::Conversion + include ::ActiveModel::ForbiddenAttributesProtection + include ::ActiveModel::AttributeAssignment + include ::ActiveModel::API + include ::ActiveModel::Access + include ::ActiveModel::Model + extend ::ActiveModel::Validations::ClassMethods + extend ::ActiveModel::Naming + extend ::ActiveModel::Callbacks + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::ActiveSupport::DescendantsTracker + extend ::ActiveModel::Translation + extend ::ActiveModel::Validations::HelperMethods + extend ::ActiveModel::Conversion::ClassMethods + + # @return [AttachmentGallery] a new instance of AttachmentGallery + # + # source://actiontext//lib/action_text/attachment_gallery.rb#54 + def initialize(node); end + + # source://actiontext//lib/action_text/attachment_gallery.rb#7 + def __callbacks; end + + # source://actiontext//lib/action_text/attachment_gallery.rb#7 + def _run_validate_callbacks; end + + # source://actiontext//lib/action_text/attachment_gallery.rb#7 + def _run_validate_callbacks!(&block); end + + # source://actiontext//lib/action_text/attachment_gallery.rb#7 + def _validate_callbacks; end + + # source://actiontext//lib/action_text/attachment_gallery.rb#7 + def _validators; end + + # source://actiontext//lib/action_text/attachment_gallery.rb#7 + def _validators?; end + + # source://actiontext//lib/action_text/attachment_gallery.rb#58 + def attachments; end + + # source://actiontext//lib/action_text/attachment_gallery.rb#68 + def inspect; end + + # source://actiontext//lib/action_text/attachment_gallery.rb#7 + def model_name(&_arg0); end + + # Returns the value of attribute node. + # + # source://actiontext//lib/action_text/attachment_gallery.rb#52 + def node; end + + # source://actiontext//lib/action_text/attachment_gallery.rb#7 + def param_delimiter=(_arg0); end + + # source://actiontext//lib/action_text/attachment_gallery.rb#64 + def size; end + + class << self + # source://actiontext//lib/action_text/attachment_gallery.rb#7 + def __callbacks; end + + # source://actiontext//lib/action_text/attachment_gallery.rb#7 + def __callbacks=(value); end + + # source://actiontext//lib/action_text/attachment_gallery.rb#7 + def _validate_callbacks; end + + # source://actiontext//lib/action_text/attachment_gallery.rb#7 + def _validate_callbacks=(value); end + + # source://actiontext//lib/action_text/attachment_gallery.rb#7 + def _validators; end + + # source://actiontext//lib/action_text/attachment_gallery.rb#7 + def _validators=(value); end + + # source://actiontext//lib/action_text/attachment_gallery.rb#7 + def _validators?; end + + # source://actiontext//lib/action_text/attachment_gallery.rb#43 + def attachment_selector; end + + # source://actiontext//lib/action_text/attachment_gallery.rb#27 + def find_attachment_gallery_nodes(content); end + + # source://actiontext//lib/action_text/attachment_gallery.rb#13 + def fragment_by_canonicalizing_attachment_galleries(content); end + + # source://actiontext//lib/action_text/attachment_gallery.rb#19 + def fragment_by_replacing_attachment_gallery_nodes(content); end + + # source://actiontext//lib/action_text/attachment_gallery.rb#39 + def from_node(node); end + + # source://actiontext//lib/action_text/attachment_gallery.rb#7 + def param_delimiter; end + + # source://actiontext//lib/action_text/attachment_gallery.rb#7 + def param_delimiter=(value); end + + # source://actiontext//lib/action_text/attachment_gallery.rb#7 + def param_delimiter?; end + + # source://actiontext//lib/action_text/attachment_gallery.rb#47 + def selector; end + + private + + # source://actiontext//lib/action_text/attachment_gallery.rb#7 + def __class_attr___callbacks; end + + # source://actiontext//lib/action_text/attachment_gallery.rb#7 + def __class_attr___callbacks=(new_value); end + + # source://actiontext//lib/action_text/attachment_gallery.rb#7 + def __class_attr__validators; end + + # source://actiontext//lib/action_text/attachment_gallery.rb#7 + def __class_attr__validators=(new_value); end + + # source://actiontext//lib/action_text/attachment_gallery.rb#7 + def __class_attr_param_delimiter; end + + # source://actiontext//lib/action_text/attachment_gallery.rb#7 + def __class_attr_param_delimiter=(new_value); end + end +end + +# source://actiontext//lib/action_text/attachment_gallery.rb#9 +ActionText::AttachmentGallery::TAG_NAME = T.let(T.unsafe(nil), String) + +# source://actiontext//lib/action_text.rb#38 +module ActionText::Attachments + extend ::ActiveSupport::Autoload +end + +# source://actiontext//lib/action_text/attachments/caching.rb#7 +module ActionText::Attachments::Caching + # source://actiontext//lib/action_text/attachments/caching.rb#8 + def cache_key(*args); end + + private + + # source://actiontext//lib/action_text/attachments/caching.rb#13 + def cache_digest; end +end + +# source://actiontext//lib/action_text/attachments/minification.rb#7 +module ActionText::Attachments::Minification + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionText::Attachments::Minification::ClassMethods +end + +# source://actiontext//lib/action_text/attachments/minification.rb#10 +module ActionText::Attachments::Minification::ClassMethods + # source://actiontext//lib/action_text/attachments/minification.rb#11 + def fragment_by_minifying_attachments(content); end +end + +# source://actiontext//lib/action_text/attachments/trix_conversion.rb#9 +module ActionText::Attachments::TrixConversion + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionText::Attachments::TrixConversion::ClassMethods + + # source://actiontext//lib/action_text/attachments/trix_conversion.rb#24 + def to_trix_attachment(content = T.unsafe(nil)); end + + private + + # source://actiontext//lib/action_text/attachments/trix_conversion.rb#31 + def trix_attachment_content; end +end + +# source://actiontext//lib/action_text/attachments/trix_conversion.rb#12 +module ActionText::Attachments::TrixConversion::ClassMethods + # source://actiontext//lib/action_text/attachments/trix_conversion.rb#13 + def fragment_by_converting_trix_attachments(content); end + + # source://actiontext//lib/action_text/attachments/trix_conversion.rb#19 + def from_trix_attachment(trix_attachment); end +end + +# source://actiontext//lib/action_text/attribute.rb#6 +module ActionText::Attribute + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionText::Attribute::ClassMethods +end + +# source://actiontext//lib/action_text/attribute.rb#9 +module ActionText::Attribute::ClassMethods + # source://actiontext//lib/action_text/attribute.rb#53 + def has_rich_text(name, encrypted: T.unsafe(nil), strict_loading: T.unsafe(nil), store_if_blank: T.unsafe(nil)); end + + # source://actiontext//lib/action_text/attribute.rb#100 + def rich_text_association_names; end + + # source://actiontext//lib/action_text/attribute.rb#95 + def with_all_rich_text; end +end + +# # Action Text Content +# +# The `ActionText::Content` class wraps an HTML fragment to add support for +# parsing, rendering and serialization. It can be used to extract links and +# attachments, convert the fragment to plain text, or serialize the fragment to +# the database. +# +# The ActionText::RichText record serializes the `body` attribute as +# `ActionText::Content`. +# +# class Message < ActiveRecord::Base +# has_rich_text :content +# end +# +# message = Message.create!(content: "

Funny times!

") +# body = message.content.body # => # +# body.to_s # => "

Funny times!

" +# body.to_plain_text # => "Funny times!" +# +# source://actiontext//lib/action_text/content.rb#24 +class ActionText::Content + include ::ActionText::ContentHelper + include ::ActionText::Serialization + include ::ActionText::Rendering + extend ::ActionText::Serialization::ClassMethods + extend ::ActionText::Rendering::ClassMethods + + # @return [Content] a new instance of Content + # + # source://actiontext//lib/action_text/content.rb#40 + def initialize(content = T.unsafe(nil), options = T.unsafe(nil)); end + + # source://actiontext//lib/action_text/content.rb#170 + def ==(other); end + + # source://actiontext//lib/action_text/content.rb#93 + def append_attachables(attachables); end + + # source://actiontext//lib/action_text/content.rb#162 + def as_json(*_arg0); end + + # Extracts ActionText::Attachable objects from the HTML fragment: + # + # attachable = ActiveStorage::Blob.first + # html = %Q() + # content = ActionText::Content.new(html) + # content.attachables # => [attachable] + # + # source://actiontext//lib/action_text/content.rb#87 + def attachables; end + + # source://actiontext//lib/action_text/content.rb#71 + def attachment_galleries; end + + # Extracts ActionText::Attachment objects from the HTML fragment: + # + # attachable = ActiveStorage::Blob.first + # html = %Q() + # content = ActionText::Content.new(html) + # content.attachments # => [# ["http://example.com/"] + # + # source://actiontext//lib/action_text/content.rb#55 + def links; end + + # source://actiontext//lib/action_text/content.rb#30 + def present?(*_arg0, **_arg1, &_arg2); end + + # source://actiontext//lib/action_text/content.rb#25 + def render(*_arg0, **_arg1, &_arg2); end + + # source://actiontext//lib/action_text/content.rb#109 + def render_attachment_galleries(&block); end + + # source://actiontext//lib/action_text/content.rb#98 + def render_attachments(**options, &block); end + + # source://actiontext//lib/action_text/content.rb#139 + def to_html; end + + # source://actiontext//lib/action_text/content.rb#147 + def to_partial_path; end + + # Returns a plain-text version of the markup contained by the content, with tags + # removed but HTML entities encoded. + # + # content = ActionText::Content.new("

Funny times!

") + # content.to_plain_text # => "Funny times!" + # + # content = ActionText::Content.new("
safe
") + # content.to_plain_text # => "safeunsafe" + # + # NOTE: that the returned string is not HTML safe and should not be rendered in + # browsers without additional sanitization. + # + # content = ActionText::Content.new("<script>alert()</script>") + # content.to_plain_text # => "" + # ActionText::ContentHelper.sanitizer.sanitize(content.to_plain_text) # => "" + # + # source://actiontext//lib/action_text/content.rb#131 + def to_plain_text; end + + # source://actiontext//lib/action_text/content.rb#143 + def to_rendered_html_with_layout; end + + # Safely transforms Content into an HTML String. + # + # content = ActionText::Content.new(content: "

Funny times!

") + # content.to_s # => "

Funny times!

" + # + # content = ActionText::Content.new("
safe
") + # content.to_s # => "
safeunsafe
" + # + # source://actiontext//lib/action_text/content.rb#158 + def to_s; end + + # source://actiontext//lib/action_text/content.rb#135 + def to_trix_html; end + + private + + # source://actiontext//lib/action_text/content.rb#187 + def attachment_for_node(node, with_full_attributes: T.unsafe(nil)); end + + # source://actiontext//lib/action_text/content.rb#192 + def attachment_gallery_for_node(node); end + + # source://actiontext//lib/action_text/content.rb#183 + def attachment_gallery_nodes; end + + # source://actiontext//lib/action_text/content.rb#179 + def attachment_nodes; end + + class << self + # source://actiontext//lib/action_text/content.rb#33 + def fragment_by_canonicalizing_content(content); end + + # source://actiontext//lib/action_text/content.rb#25 + def renderer; end + + # source://actiontext//lib/action_text/content.rb#25 + def renderer=(obj); end + end +end + +module ActionText::ContentHelper + def allowed_attributes; end + def allowed_attributes=(val); end + def allowed_tags; end + def allowed_tags=(val); end + def render_action_text_attachment(attachment, locals: T.unsafe(nil)); end + def render_action_text_attachments(content); end + def render_action_text_content(content); end + def sanitize_action_text_content(content); end + def sanitize_content_attachment(content_attachment); end + def sanitizer; end + def sanitizer=(val); end + def sanitizer_allowed_attributes; end + def sanitizer_allowed_tags; end + def scrubber; end + def scrubber=(val); end + + class << self + def allowed_attributes; end + def allowed_attributes=(val); end + def allowed_tags; end + def allowed_tags=(val); end + def sanitizer; end + def sanitizer=(val); end + def scrubber; end + def scrubber=(val); end + end +end + +class ActionText::EncryptedRichText < ::ActionText::RichText + include ::ActionText::EncryptedRichText::GeneratedAttributeMethods + include ::ActionText::EncryptedRichText::GeneratedAssociationMethods + + class << self + private + + def __class_attr__validators; end + def __class_attr__validators=(new_value); end + def __class_attr_defined_enums; end + def __class_attr_defined_enums=(new_value); end + def __class_attr_encrypted_attributes; end + def __class_attr_encrypted_attributes=(new_value); end + end +end + +module ActionText::EncryptedRichText::GeneratedAssociationMethods; end +module ActionText::EncryptedRichText::GeneratedAttributeMethods; end + +# source://actiontext//lib/action_text/encryption.rb#6 +module ActionText::Encryption + # source://actiontext//lib/action_text/encryption.rb#14 + def decrypt; end + + # source://actiontext//lib/action_text/encryption.rb#7 + def encrypt; end + + private + + # source://actiontext//lib/action_text/encryption.rb#26 + def decrypt_rich_texts; end + + # source://actiontext//lib/action_text/encryption.rb#22 + def encrypt_rich_texts; end + + # source://actiontext//lib/action_text/encryption.rb#34 + def encryptable_rich_texts; end + + # @return [Boolean] + # + # source://actiontext//lib/action_text/encryption.rb#30 + def has_encrypted_rich_texts?; end +end + +# source://actiontext//lib/action_text/engine.rb#14 +class ActionText::Engine < ::Rails::Engine; end + +# # Action Text FixtureSet +# +# Fixtures are a way of organizing data that you want to test against; in short, +# sample data. +# +# To learn more about fixtures, read the ActiveRecord::FixtureSet documentation. +# +# ### YAML +# +# Like other Active Record-backed models, ActionText::RichText records inherit +# from ActiveRecord::Base instances and can therefore be populated by fixtures. +# +# Consider an `Article` class: +# +# class Article < ApplicationRecord +# has_rich_text :content +# end +# +# To declare fixture data for the related `content`, first declare fixture data +# for `Article` instances in `test/fixtures/articles.yml`: +# +# first: +# title: An Article +# +# Then declare the ActionText::RichText fixture data in +# `test/fixtures/action_text/rich_texts.yml`, making sure to declare each +# entry's `record:` key as a polymorphic relationship: +# +# first: +# record: first (Article) +# name: content +# body:
Hello, world.
+# +# When processed, Active Record will insert database records for each fixture +# entry and will ensure the Action Text relationship is intact. +# +# source://actiontext//lib/action_text/fixture_set.rb#41 +class ActionText::FixtureSet + class << self + # Fixtures support Action Text attachments as part of their `body` HTML. + # + # ### Examples + # + # For example, consider a second `Article` fixture declared in + # `test/fixtures/articles.yml`: + # + # second: + # title: Another Article + # + # You can attach a mention of `articles(:first)` to `second`'s `content` by + # embedding a call to `ActionText::FixtureSet.attachment` in the `body:` value + # in `test/fixtures/action_text/rich_texts.yml`: + # + # second: + # record: second (Article) + # name: content + # body:
Hello, <%= ActionText::FixtureSet.attachment("articles", :first) %>
+ # + # source://actiontext//lib/action_text/fixture_set.rb#61 + def attachment(fixture_set_name, label, column_type: T.unsafe(nil)); end + end +end + +# source://actiontext//lib/action_text/fragment.rb#6 +class ActionText::Fragment + # @return [Fragment] a new instance of Fragment + # + # source://actiontext//lib/action_text/fragment.rb#28 + def initialize(source); end + + # source://actiontext//lib/action_text/fragment.rb#26 + def deconstruct(*_arg0, **_arg1, &_arg2); end + + # source://actiontext//lib/action_text/fragment.rb#32 + def find_all(selector); end + + # source://actiontext//lib/action_text/fragment.rb#41 + def replace(selector); end + + # Returns the value of attribute source. + # + # source://actiontext//lib/action_text/fragment.rb#24 + def source; end + + # source://actiontext//lib/action_text/fragment.rb#54 + def to_html; end + + # source://actiontext//lib/action_text/fragment.rb#50 + def to_plain_text; end + + # source://actiontext//lib/action_text/fragment.rb#58 + def to_s; end + + # @yield [source = self.source.dup] + # + # source://actiontext//lib/action_text/fragment.rb#36 + def update; end + + class << self + # source://actiontext//lib/action_text/fragment.rb#19 + def from_html(html); end + + # source://actiontext//lib/action_text/fragment.rb#8 + def wrap(fragment_or_html); end + end +end + +# source://actiontext//lib/action_text/html_conversion.rb#6 +module ActionText::HtmlConversion + extend ::ActionText::HtmlConversion + + # source://actiontext//lib/action_text/html_conversion.rb#17 + def create_element(tag_name, attributes = T.unsafe(nil)); end + + # source://actiontext//lib/action_text/html_conversion.rb#13 + def fragment_for_html(html); end + + # source://actiontext//lib/action_text/html_conversion.rb#9 + def node_to_html(node); end + + private + + # source://actiontext//lib/action_text/html_conversion.rb#22 + def document; end +end + +# source://actiontext//lib/action_text/plain_text_conversion.rb#6 +module ActionText::PlainTextConversion + extend ::ActionText::PlainTextConversion + + # source://actiontext//lib/action_text/plain_text_conversion.rb#9 + def node_to_plain_text(node); end + + private + + # source://actiontext//lib/action_text/plain_text_conversion.rb#118 + def break_if_nested_list(node, text); end + + # source://actiontext//lib/action_text/plain_text_conversion.rb#94 + def bullet_for_li_node(node); end + + # source://actiontext//lib/action_text/plain_text_conversion.rb#107 + def indentation_for_li_node(node); end + + # source://actiontext//lib/action_text/plain_text_conversion.rb#114 + def list_node_depth_for_node(node); end + + # source://actiontext//lib/action_text/plain_text_conversion.rb#103 + def list_node_name_for_li_node(node); end + + # source://actiontext//lib/action_text/plain_text_conversion.rb#40 + def plain_text_for_block(node, child_values); end + + # source://actiontext//lib/action_text/plain_text_conversion.rb#72 + def plain_text_for_blockquote_node(node, child_values); end + + # source://actiontext//lib/action_text/plain_text_conversion.rb#56 + def plain_text_for_br_node(node, _child_values); end + + # source://actiontext//lib/action_text/plain_text_conversion.rb#28 + def plain_text_for_child_values(child_values); end + + # source://actiontext//lib/action_text/plain_text_conversion.rb#64 + def plain_text_for_div_node(node, child_values); end + + # source://actiontext//lib/action_text/plain_text_conversion.rb#68 + def plain_text_for_figcaption_node(node, child_values); end + + # source://actiontext//lib/action_text/plain_text_conversion.rb#45 + def plain_text_for_h1_node(node, child_values); end + + # source://actiontext//lib/action_text/plain_text_conversion.rb#82 + def plain_text_for_li_node(node, child_values); end + + # source://actiontext//lib/action_text/plain_text_conversion.rb#48 + def plain_text_for_list(node, child_values); end + + # source://actiontext//lib/action_text/plain_text_conversion.rb#16 + def plain_text_for_node(node, child_values); end + + # source://actiontext//lib/action_text/plain_text_conversion.rb#53 + def plain_text_for_ol_node(node, child_values); end + + # source://actiontext//lib/action_text/plain_text_conversion.rb#45 + def plain_text_for_p_node(node, child_values); end + + # source://actiontext//lib/action_text/plain_text_conversion.rb#37 + def plain_text_for_script_node(node, _child_values); end + + # source://actiontext//lib/action_text/plain_text_conversion.rb#37 + def plain_text_for_style_node(node, _child_values); end + + # source://actiontext//lib/action_text/plain_text_conversion.rb#60 + def plain_text_for_text_node(node, _child_values); end + + # source://actiontext//lib/action_text/plain_text_conversion.rb#53 + def plain_text_for_ul_node(node, child_values); end + + # source://actiontext//lib/action_text/plain_text_conversion.rb#32 + def plain_text_for_unsupported_node(node, _child_values); end + + # source://actiontext//lib/action_text/plain_text_conversion.rb#24 + def plain_text_method_for_node(node); end + + # source://actiontext//lib/action_text/plain_text_conversion.rb#90 + def remove_trailing_newlines(text); end +end + +# source://actiontext//lib/action_text/plain_text_conversion.rb#126 +class ActionText::PlainTextConversion::BottomUpReducer + # @return [BottomUpReducer] a new instance of BottomUpReducer + # + # source://actiontext//lib/action_text/plain_text_conversion.rb#127 + def initialize(node); end + + # source://actiontext//lib/action_text/plain_text_conversion.rb#132 + def reduce(&block); end + + private + + # source://actiontext//lib/action_text/plain_text_conversion.rb#141 + def traverse_bottom_up(node, &block); end +end + +class ActionText::Record < ::ActiveRecord::Base + include ::ActionText::Record::GeneratedAttributeMethods + include ::ActionText::Record::GeneratedAssociationMethods + + class << self + private + + def __class_attr__validators; end + def __class_attr__validators=(new_value); end + def __class_attr_defined_enums; end + def __class_attr_defined_enums=(new_value); end + end +end + +module ActionText::Record::GeneratedAssociationMethods; end +module ActionText::Record::GeneratedAttributeMethods; end + +# source://actiontext//lib/action_text/rendering.rb#8 +module ActionText::Rendering + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionText::Rendering::ClassMethods +end + +# source://actiontext//lib/action_text/rendering.rb#16 +module ActionText::Rendering::ClassMethods + # source://actiontext//lib/action_text/rendering.rb#17 + def action_controller_renderer; end + + # source://actiontext//lib/action_text/rendering.rb#29 + def render(*args, &block); end + + # source://actiontext//lib/action_text/rendering.rb#21 + def with_renderer(renderer); end +end + +class ActionText::RichText < ::ActionText::Record + include ::ActionText::RichText::GeneratedAttributeMethods + include ::ActionText::RichText::GeneratedAssociationMethods + + def _run_commit_callbacks(&block); end + def _run_create_callbacks(&block); end + def _run_destroy_callbacks(&block); end + def _run_save_callbacks(&block); end + def _run_touch_callbacks(&block); end + def _run_update_callbacks(&block); end + def autosave_associated_records_for_embeds_attachments(*args); end + def autosave_associated_records_for_embeds_blobs(*args); end + def autosave_associated_records_for_record(*args); end + def blank?(*_arg0, **_arg1, &_arg2); end + def empty?(*_arg0, **_arg1, &_arg2); end + def nil?(*_arg0, **_arg1, &_arg2); end + def present?(*_arg0, **_arg1, &_arg2); end + def to_plain_text; end + def to_s(*_arg0, **_arg1, &_arg2); end + def to_trix_html; end + def validate_associated_records_for_embeds_attachments(*args); end + def validate_associated_records_for_embeds_blobs(*args); end + + class << self + def with_attached_embeds(*args, **_arg1); end + + private + + def __class_attr___callbacks; end + def __class_attr___callbacks=(new_value); end + def __class_attr__reflections; end + def __class_attr__reflections=(new_value); end + def __class_attr__validators; end + def __class_attr__validators=(new_value); end + def __class_attr_attachment_reflections; end + def __class_attr_attachment_reflections=(new_value); end + def __class_attr_defined_enums; end + def __class_attr_defined_enums=(new_value); end + end +end + +module ActionText::RichText::GeneratedAssociationMethods + def embeds; end + def embeds=(attachables); end + def embeds_attachment_ids; end + def embeds_attachment_ids=(ids); end + def embeds_attachments; end + def embeds_attachments=(value); end + def embeds_blob_ids; end + def embeds_blob_ids=(ids); end + def embeds_blobs; end + def embeds_blobs=(value); end + def record; end + def record=(value); end + def record_changed?; end + def record_previously_changed?; end + def reload_record; end + def reset_record; end +end + +module ActionText::RichText::GeneratedAttributeMethods; end + +# source://actiontext//lib/action_text/serialization.rb#6 +module ActionText::Serialization + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionText::Serialization::ClassMethods + + # source://actiontext//lib/action_text/serialization.rb#34 + def _dump(*_arg0); end +end + +# source://actiontext//lib/action_text/serialization.rb#9 +module ActionText::Serialization::ClassMethods + # source://actiontext//lib/action_text/serialization.rb#31 + def _load(content); end + + # source://actiontext//lib/action_text/serialization.rb#14 + def dump(content); end + + # source://actiontext//lib/action_text/serialization.rb#10 + def load(content); end +end + +# source://actiontext//lib/action_text/system_test_helper.rb#6 +module ActionText::SystemTestHelper + # Locates a Trix editor and fills it in with the given HTML. + # + # The editor can be found by: + # + # * its `id` + # * its `placeholder` + # * the text from its `label` element + # * its `aria-label` + # * the `name` of its input + # + # Additional options are forwarded to Capybara as filters + # + # Examples: + # + # # + # fill_in_rich_textarea "message_content", with: "Hello world!" + # + # # + # fill_in_rich_textarea "Your message here", with: "Hello world!" + # + # # + # # + # fill_in_rich_textarea "Message content", with: "Hello world!" + # + # # + # fill_in_rich_textarea "Message content", with: "Hello world!" + # + # # + # # + # fill_in_rich_textarea "message[content]", with: "Hello world!" + # + # source://actiontext//lib/action_text/system_test_helper.rb#46 + def fill_in_rich_text_area(locator = T.unsafe(nil), with:, **_arg2); end + + # Locates a Trix editor and fills it in with the given HTML. + # + # The editor can be found by: + # + # * its `id` + # * its `placeholder` + # * the text from its `label` element + # * its `aria-label` + # * the `name` of its input + # + # Additional options are forwarded to Capybara as filters + # + # Examples: + # + # # + # fill_in_rich_textarea "message_content", with: "Hello world!" + # + # # + # fill_in_rich_textarea "Your message here", with: "Hello world!" + # + # # + # # + # fill_in_rich_textarea "Message content", with: "Hello world!" + # + # # + # fill_in_rich_textarea "Message content", with: "Hello world!" + # + # # + # # + # fill_in_rich_textarea "message[content]", with: "Hello world!" + # + # source://actiontext//lib/action_text/system_test_helper.rb#37 + def fill_in_rich_textarea(locator = T.unsafe(nil), with:, **_arg2); end +end + +module ActionText::TagHelper + def rich_text_area_tag(name, value = T.unsafe(nil), options = T.unsafe(nil), &block); end + def rich_textarea_tag(name, value = T.unsafe(nil), options = T.unsafe(nil), &block); end + + class << self + def id; end + def id=(val); end + end +end + +# source://actiontext//lib/action_text/trix_attachment.rb#6 +class ActionText::TrixAttachment + # @return [TrixAttachment] a new instance of TrixAttachment + # + # source://actiontext//lib/action_text/trix_attachment.rb#53 + def initialize(node); end + + # source://actiontext//lib/action_text/trix_attachment.rb#57 + def attributes; end + + # Returns the value of attribute node. + # + # source://actiontext//lib/action_text/trix_attachment.rb#51 + def node; end + + # source://actiontext//lib/action_text/trix_attachment.rb#61 + def to_html; end + + # source://actiontext//lib/action_text/trix_attachment.rb#65 + def to_s; end + + private + + # source://actiontext//lib/action_text/trix_attachment.rb#70 + def attachment_attributes; end + + # source://actiontext//lib/action_text/trix_attachment.rb#74 + def composed_attributes; end + + # source://actiontext//lib/action_text/trix_attachment.rb#82 + def read_json_attribute(name); end + + # source://actiontext//lib/action_text/trix_attachment.rb#78 + def read_json_object_attribute(name); end + + class << self + # source://actiontext//lib/action_text/trix_attachment.rb#21 + def from_attributes(attributes); end + + private + + # source://actiontext//lib/action_text/trix_attachment.rb#35 + def process_attributes(attributes); end + + # source://actiontext//lib/action_text/trix_attachment.rb#39 + def transform_attribute_keys(attributes); end + + # source://actiontext//lib/action_text/trix_attachment.rb#43 + def typecast_attribute_values(attributes); end + end +end + +# source://actiontext//lib/action_text/trix_attachment.rb#11 +ActionText::TrixAttachment::ATTRIBUTES = T.let(T.unsafe(nil), Array) + +# source://actiontext//lib/action_text/trix_attachment.rb#12 +ActionText::TrixAttachment::ATTRIBUTE_TYPES = T.let(T.unsafe(nil), Hash) + +# source://actiontext//lib/action_text/trix_attachment.rb#10 +ActionText::TrixAttachment::COMPOSED_ATTRIBUTES = T.let(T.unsafe(nil), Array) + +# source://actiontext//lib/action_text/trix_attachment.rb#8 +ActionText::TrixAttachment::SELECTOR = T.let(T.unsafe(nil), String) + +# source://actiontext//lib/action_text/trix_attachment.rb#7 +ActionText::TrixAttachment::TAG_NAME = T.let(T.unsafe(nil), String) + +# source://actiontext//lib/action_text/gem_version.rb#11 +module ActionText::VERSION; end + +# source://actiontext//lib/action_text/gem_version.rb#12 +ActionText::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# source://actiontext//lib/action_text/gem_version.rb#13 +ActionText::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# source://actiontext//lib/action_text/gem_version.rb#15 +ActionText::VERSION::PRE = T.let(T.unsafe(nil), T.untyped) + +# source://actiontext//lib/action_text/gem_version.rb#17 +ActionText::VERSION::STRING = T.let(T.unsafe(nil), String) + +# source://actiontext//lib/action_text/gem_version.rb#14 +ActionText::VERSION::TINY = T.let(T.unsafe(nil), Integer) + +module ActionView::Helpers + include ::ActionView::Helpers::SanitizeHelper + include ::ActionView::Helpers::TextHelper + include ::ActionView::Helpers::UrlHelper + include ::ActionView::Helpers::SanitizeHelper + include ::ActionView::Helpers::TextHelper + include ::ActionView::Helpers::FormTagHelper + include ::ActionView::Helpers::FormHelper + include ::ActionView::Helpers::TranslationHelper + + mixes_in_class_methods ::ActionView::Helpers::UrlHelper::ClassMethods + mixes_in_class_methods ::ActionView::Helpers::SanitizeHelper::ClassMethods +end + +class ActionView::Helpers::FormBuilder + def rich_text_area(method, options = T.unsafe(nil), &block); end + def rich_textarea(method, options = T.unsafe(nil), &block); end +end + +module ActionView::Helpers::FormHelper + include ::ActionView::Helpers::UrlHelper + include ::ActionView::Helpers::SanitizeHelper + include ::ActionView::Helpers::TextHelper + include ::ActionView::Helpers::FormTagHelper + + mixes_in_class_methods ::ActionView::Helpers::UrlHelper::ClassMethods + mixes_in_class_methods ::ActionView::Helpers::SanitizeHelper::ClassMethods + + def rich_text_area(object_name, method, options = T.unsafe(nil), &block); end + def rich_textarea(object_name, method, options = T.unsafe(nil), &block); end +end + +module ActionView::Helpers::Tags; end + +class ActionView::Helpers::Tags::ActionText < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::Placeholderable + + def dom_id(*_arg0, **_arg1, &_arg2); end + def render(&block); end +end diff --git a/sorbet/rbi/gems/actionview@8.1.1.rbi b/sorbet/rbi/gems/actionview@8.1.1.rbi new file mode 100644 index 0000000..13ee947 --- /dev/null +++ b/sorbet/rbi/gems/actionview@8.1.1.rbi @@ -0,0 +1,16038 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `actionview` gem. +# Please instead update this file by running `bin/tapioca gem actionview`. + + +class ActionController::Base < ::ActionController::Metal + include ::ActionDispatch::Routing::PolymorphicRoutes + include ::ActionController::Head + include ::AbstractController::Caching::ConfigMethods + include ::ActionController::BasicImplicitRender + extend ::AbstractController::Helpers::Resolution + extend ::ActionController::Renderers::DeprecatedEscapeJsonResponses +end + +# :include: ../README.rdoc +# +# source://actionview//lib/action_view/gem_version.rb#3 +module ActionView + extend ::ActiveSupport::Autoload + + class << self + # source://actionview//lib/action_view/deprecator.rb#4 + def deprecator; end + + # source://actionview//lib/action_view.rb#97 + def eager_load!; end + + # Returns the currently loaded version of Action View as a +Gem::Version+. + # + # source://actionview//lib/action_view/gem_version.rb#5 + def gem_version; end + + # source://actionview//lib/action_view.rb#94 + def render_tracker; end + + # source://actionview//lib/action_view.rb#94 + def render_tracker=(_arg0); end + + # Returns the currently loaded version of Action View as a +Gem::Version+. + # + # source://actionview//lib/action_view/version.rb#7 + def version; end + end +end + +# This class defines the interface for a renderer. Each class that +# subclasses +AbstractRenderer+ is used by the base +Renderer+ class to +# render a specific type of object. +# +# The base +Renderer+ class uses its +render+ method to delegate to the +# renderers. These currently consist of +# +# PartialRenderer - Used for rendering partials +# TemplateRenderer - Used for rendering other types of templates +# StreamingTemplateRenderer - Used for streaming +# +# Whenever the +render+ method is called on the base +Renderer+ class, a new +# renderer object of the correct type is created, and the +render+ method on +# that new object is called in turn. This abstracts the set up and rendering +# into a separate classes for partials and templates. +# +# source://actionview//lib/action_view/renderer/abstract_renderer.rb#21 +class ActionView::AbstractRenderer + # @return [AbstractRenderer] a new instance of AbstractRenderer + # + # source://actionview//lib/action_view/renderer/abstract_renderer.rb#24 + def initialize(lookup_context); end + + # source://actionview//lib/action_view/renderer/abstract_renderer.rb#22 + def any_templates?(*_arg0, **_arg1, &_arg2); end + + # source://actionview//lib/action_view/renderer/abstract_renderer.rb#22 + def formats(*_arg0, **_arg1, &_arg2); end + + # @raise [NotImplementedError] + # + # source://actionview//lib/action_view/renderer/abstract_renderer.rb#28 + def render; end + + # source://actionview//lib/action_view/renderer/abstract_renderer.rb#22 + def template_exists?(*_arg0, **_arg1, &_arg2); end + + private + + # source://actionview//lib/action_view/renderer/abstract_renderer.rb#182 + def build_rendered_collection(templates, spacer); end + + # source://actionview//lib/action_view/renderer/abstract_renderer.rb#178 + def build_rendered_template(content, template); end + + # source://actionview//lib/action_view/renderer/abstract_renderer.rb#159 + def extract_details(options); end + + # source://actionview//lib/action_view/renderer/abstract_renderer.rb#171 + def prepend_formats(formats); end +end + +# source://actionview//lib/action_view/renderer/abstract_renderer.rb#157 +ActionView::AbstractRenderer::NO_DETAILS = T.let(T.unsafe(nil), Hash) + +# source://actionview//lib/action_view/renderer/abstract_renderer.rb#32 +module ActionView::AbstractRenderer::ObjectRendering + # source://actionview//lib/action_view/renderer/abstract_renderer.rb#37 + def initialize(lookup_context, options); end + + private + + # source://actionview//lib/action_view/renderer/abstract_renderer.rb#43 + def local_variable(path); end + + # source://actionview//lib/action_view/renderer/abstract_renderer.rb#92 + def merge_prefix_into_object_path(prefix, object_path); end + + # Obtains the path to where the object's partial is located. If the object + # responds to +to_partial_path+, then +to_partial_path+ will be called and + # will provide the path. If the object does not respond to +to_partial_path+, + # then an +ArgumentError+ is raised. + # + # If +prefix_partial_path_with_controller_namespace+ is true, then this + # method will prefix the partial paths with a namespace. + # + # source://actionview//lib/action_view/renderer/abstract_renderer.rb#76 + def partial_path(object, view); end + + # @raise [ArgumentError] + # + # source://actionview//lib/action_view/renderer/abstract_renderer.rb#61 + def raise_invalid_identifier(path); end + + # @raise [ArgumentError] + # + # source://actionview//lib/action_view/renderer/abstract_renderer.rb#65 + def raise_invalid_option_as(as); end +end + +# source://actionview//lib/action_view/renderer/abstract_renderer.rb#54 +ActionView::AbstractRenderer::ObjectRendering::IDENTIFIER_ERROR_MESSAGE = T.let(T.unsafe(nil), String) + +# source://actionview//lib/action_view/renderer/abstract_renderer.rb#57 +ActionView::AbstractRenderer::ObjectRendering::OPTION_AS_ERROR_MESSAGE = T.let(T.unsafe(nil), String) + +# source://actionview//lib/action_view/renderer/abstract_renderer.rb#33 +ActionView::AbstractRenderer::ObjectRendering::PREFIXED_PARTIAL_NAMES = T.let(T.unsafe(nil), Concurrent::Map) + +# source://actionview//lib/action_view/renderer/abstract_renderer.rb#110 +class ActionView::AbstractRenderer::RenderedCollection + # @return [RenderedCollection] a new instance of RenderedCollection + # + # source://actionview//lib/action_view/renderer/abstract_renderer.rb#117 + def initialize(rendered_templates, spacer); end + + # source://actionview//lib/action_view/renderer/abstract_renderer.rb#122 + def body; end + + # source://actionview//lib/action_view/renderer/abstract_renderer.rb#126 + def format; end + + # Returns the value of attribute rendered_templates. + # + # source://actionview//lib/action_view/renderer/abstract_renderer.rb#115 + def rendered_templates; end + + class << self + # source://actionview//lib/action_view/renderer/abstract_renderer.rb#111 + def empty(format); end + end +end + +# source://actionview//lib/action_view/renderer/abstract_renderer.rb#130 +class ActionView::AbstractRenderer::RenderedCollection::EmptyCollection + # @return [EmptyCollection] a new instance of EmptyCollection + # + # source://actionview//lib/action_view/renderer/abstract_renderer.rb#133 + def initialize(format); end + + # source://actionview//lib/action_view/renderer/abstract_renderer.rb#137 + def body; end + + # Returns the value of attribute format. + # + # source://actionview//lib/action_view/renderer/abstract_renderer.rb#131 + def format; end +end + +# source://actionview//lib/action_view/renderer/abstract_renderer.rb#141 +class ActionView::AbstractRenderer::RenderedTemplate + # @return [RenderedTemplate] a new instance of RenderedTemplate + # + # source://actionview//lib/action_view/renderer/abstract_renderer.rb#144 + def initialize(body, template); end + + # Returns the value of attribute body. + # + # source://actionview//lib/action_view/renderer/abstract_renderer.rb#142 + def body; end + + # source://actionview//lib/action_view/renderer/abstract_renderer.rb#149 + def format; end + + # Returns the value of attribute template. + # + # source://actionview//lib/action_view/renderer/abstract_renderer.rb#142 + def template; end +end + +# source://actionview//lib/action_view/renderer/abstract_renderer.rb#153 +ActionView::AbstractRenderer::RenderedTemplate::EMPTY_SPACER = T.let(T.unsafe(nil), T.untyped) + +# = Action View Errors +# +# source://actionview//lib/action_view/template/error.rb#8 +class ActionView::ActionViewError < ::StandardError; end + +# = Action View \Base +# +# Action View templates can be written in several ways. +# If the template file has a .erb extension, then it uses the erubi[https://rubygems.org/gems/erubi] +# template system which can embed Ruby into an HTML document. +# If the template file has a .builder extension, then Jim Weirich's Builder::XmlMarkup library is used. +# +# == ERB +# +# You trigger ERB by using embeddings such as <% %>, <% -%>, and <%= %>. The <%= %> tag set is used when you want output. Consider the +# following loop for names: +# +# Names of all the people +# <% @people.each do |person| %> +# Name: <%= person.name %>
+# <% end %> +# +# The loop is set up in regular embedding tags <% %>, and the name is written using the output embedding tag <%= %>. Note that this +# is not just a usage suggestion. Regular output functions like print or puts won't work with ERB templates. So this would be wrong: +# +# <%# WRONG %> +# Hi, Mr. <% puts "Frodo" %> +# +# If you absolutely must write from within a function use +concat+. +# +# When on a line that only contains whitespaces except for the tag, <% %> suppresses leading and trailing whitespace, +# including the trailing newline. <% %> and <%- -%> are the same. +# Note however that <%= %> and <%= -%> are different: only the latter removes trailing whitespaces. +# +# === Using sub templates +# +# Using sub templates allows you to sidestep tedious replication and extract common display structures in shared templates. The +# classic example is the use of a header and footer (even though the Action Pack-way would be to use Layouts): +# +# <%= render "application/header" %> +# Something really specific and terrific +# <%= render "application/footer" %> +# +# As you see, we use the output embeddings for the render methods. The render call itself will just return a string holding the +# result of the rendering. The output embedding writes it to the current template. +# +# But you don't have to restrict yourself to static includes. Templates can share variables amongst themselves by using instance +# variables defined using the regular embedding tags. Like this: +# +# <% @page_title = "A Wonderful Hello" %> +# <%= render "application/header" %> +# +# Now the header can pick up on the @page_title variable and use it for outputting a title tag: +# +# <%= @page_title %> +# +# === Passing local variables to sub templates +# +# You can pass local variables to sub templates by using a hash with the variable names as keys and the objects as values: +# +# <%= render "application/header", { headline: "Welcome", person: person } %> +# +# These can now be accessed in application/header with: +# +# Headline: <%= headline %> +# First name: <%= person.first_name %> +# +# The local variables passed to sub templates can be accessed as a hash using the local_assigns hash. This lets you access the +# variables as: +# +# Headline: <%= local_assigns[:headline] %> +# +# This is useful in cases where you aren't sure if the local variable has been assigned. Alternatively, you could also use +# defined? headline to first check if the variable has been assigned before using it. +# +# By default, templates will accept any locals as keyword arguments. To restrict what locals a template accepts, add a locals: magic comment: +# +# <%# locals: (headline:) %> +# +# Headline: <%= headline %> +# +# In cases where the local variables are optional, declare the keyword argument with a default value: +# +# <%# locals: (headline: nil) %> +# +# <% unless headline.nil? %> +# Headline: <%= headline %> +# <% end %> +# +# Read more about strict locals in {Action View Overview}[https://guides.rubyonrails.org/action_view_overview.html#strict-locals] +# in the guides. +# +# === Template caching +# +# By default, \Rails will compile each template to a method in order to render it. When you alter a template, +# \Rails will check the file's modification time and recompile it in development mode. +# +# == Builder +# +# Builder templates are a more programmatic alternative to ERB. They are especially useful for generating XML content. An XmlMarkup object +# named +xml+ is automatically made available to templates with a .builder extension. +# +# Here are some basic examples: +# +# xml.em("emphasized") # => emphasized +# xml.em { xml.b("emph & bold") } # => emph & bold +# xml.a("A Link", "href" => "http://onestepback.org") # => A Link +# xml.target("name" => "compile", "option" => "fast") # => +# # NOTE: order of attributes is not specified. +# +# Any method with a block will be treated as an XML markup tag with nested markup in the block. For example, the following: +# +# xml.div do +# xml.h1(@person.name) +# xml.p(@person.bio) +# end +# +# would produce something like: +# +#
+#

David Heinemeier Hansson

+#

A product of Danish Design during the Winter of '79...

+#
+# +# Here is a full-length RSS example actually used on Basecamp: +# +# xml.rss("version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/") do +# xml.channel do +# xml.title(@feed_title) +# xml.link(@url) +# xml.description "Basecamp: Recent items" +# xml.language "en-us" +# xml.ttl "40" +# +# @recent_items.each do |item| +# xml.item do +# xml.title(item_title(item)) +# xml.description(item_description(item)) if item_description(item) +# xml.pubDate(item_pubDate(item)) +# xml.guid(@person.firm.account.url + @recent_items.url(item)) +# xml.link(@person.firm.account.url + @recent_items.url(item)) +# +# xml.tag!("dc:creator", item.author_name) if item_has_creator?(item) +# end +# end +# end +# end +# +# For more information on Builder please consult the {source code}[https://github.com/rails/builder]. +# +# source://actionview//lib/action_view/base.rb#158 +class ActionView::Base + include ::ActionView::Context + include ::ERB::Escape + include ::ERB::Util + include ::ActiveSupport::CoreExt::ERBUtil + include ::ActiveSupport::CoreExt::ERBUtilPrivate + include ::ActiveSupport::Benchmarkable + include ::ActionView::Helpers::ActiveModelHelper + include ::ActionView::Helpers::AssetUrlHelper + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + include ::ActionView::Helpers::TagHelper + include ::ActionView::Helpers::AssetTagHelper + include ::ActionView::Helpers::AtomFeedHelper + include ::ActionView::Helpers::CacheHelper + include ::ActionView::Helpers::ContentExfiltrationPreventionHelper + include ::ActionView::Helpers::UrlHelper + include ::ActionView::Helpers::SanitizeHelper + include ::ActionView::Helpers::ControllerHelper + include ::ActionView::Helpers::CspHelper + include ::ActionView::Helpers::CsrfHelper + include ::ActionView::Helpers::DateHelper + include ::ActionView::Helpers::DebugHelper + include ::ActionView::Helpers::TextHelper + include ::ActionView::Helpers::FormTagHelper + include ::ActionView::ModelNaming + include ::ActionView::RecordIdentifier + include ::ActionView::Helpers::FormHelper + include ::ActionView::Helpers::TranslationHelper + include ::ActionView::Helpers::FormOptionsHelper + include ::ActionView::Helpers::JavaScriptHelper + include ::ActionView::Helpers::NumberHelper + include ::ActionView::Helpers::RenderingHelper + include ::ActionView::Helpers + include ::ActionCable::Helpers::ActionCableHelper + extend ::ActionView::Helpers::UrlHelper::ClassMethods + extend ::ActionView::Helpers::SanitizeHelper::ClassMethods + + # :startdoc: + # + # @return [Base] a new instance of Base + # + # source://actionview//lib/action_view/base.rb#249 + def initialize(lookup_context, assigns, controller); end + + # source://actionview//lib/action_view/base.rb#182 + def _routes; end + + # source://actionview//lib/action_view/base.rb#182 + def _routes=(_arg0); end + + # source://actionview//lib/action_view/base.rb#182 + def _routes?; end + + # source://actionview//lib/action_view/base.rb#264 + def _run(method, template, locals, buffer, add_to_stack: T.unsafe(nil), has_strict_locals: T.unsafe(nil), &block); end + + # source://actionview//lib/action_view/base.rb#180 + def annotate_rendered_view_with_filenames; end + + # source://actionview//lib/action_view/base.rb#180 + def annotate_rendered_view_with_filenames=(val); end + + # source://actionview//lib/action_view/base.rb#228 + def assign(new_assigns); end + + # source://actionview//lib/action_view/base.rb#224 + def assigns; end + + # source://actionview//lib/action_view/base.rb#224 + def assigns=(_arg0); end + + # source://actionview//lib/action_view/base.rb#177 + def automatically_disable_submit_tag; end + + # source://actionview//lib/action_view/base.rb#177 + def automatically_disable_submit_tag=(val); end + + # @raise [NotImplementedError] + # + # source://actionview//lib/action_view/base.rb#287 + def compiled_method_container; end + + # source://actionview//lib/action_view/base.rb#224 + def config; end + + # source://actionview//lib/action_view/base.rb#224 + def config=(_arg0); end + + # source://actionview//lib/action_view/base.rb#159 + def debug_missing_translation; end + + # source://actionview//lib/action_view/base.rb#159 + def debug_missing_translation=(val); end + + # source://actionview//lib/action_view/base.rb#174 + def default_formats; end + + # source://actionview//lib/action_view/base.rb#174 + def default_formats=(val); end + + # source://actionview//lib/action_view/base.rb#162 + def field_error_proc; end + + # source://actionview//lib/action_view/base.rb#162 + def field_error_proc=(val); end + + # source://actionview//lib/action_view/base.rb#226 + def formats(*_arg0, **_arg1, &_arg2); end + + # source://actionview//lib/action_view/base.rb#226 + def formats=(arg); end + + # source://actionview//lib/action_view/base.rb#295 + def in_rendering_context(options); end + + # source://actionview//lib/action_view/base.rb#226 + def locale(*_arg0, **_arg1, &_arg2); end + + # source://actionview//lib/action_view/base.rb#226 + def locale=(arg); end + + # source://actionview//lib/action_view/base.rb#183 + def logger; end + + # source://actionview//lib/action_view/base.rb#183 + def logger=(_arg0); end + + # source://actionview//lib/action_view/base.rb#183 + def logger?; end + + # Returns the value of attribute lookup_context. + # + # source://actionview//lib/action_view/base.rb#223 + def lookup_context; end + + # source://actionview//lib/action_view/base.rb#171 + def prefix_partial_path_with_controller_namespace; end + + # source://actionview//lib/action_view/base.rb#171 + def prefix_partial_path_with_controller_namespace=(_arg0); end + + # source://actionview//lib/action_view/base.rb#171 + def prefix_partial_path_with_controller_namespace?; end + + # source://actionview//lib/action_view/base.rb#187 + def remove_hidden_field_autocomplete; end + + # source://actionview//lib/action_view/base.rb#187 + def remove_hidden_field_autocomplete=(val); end + + # source://actionview//lib/action_view/base.rb#166 + def streaming_completion_on_exception; end + + # source://actionview//lib/action_view/base.rb#166 + def streaming_completion_on_exception=(val); end + + # source://actionview//lib/action_view/base.rb#226 + def view_paths(*_arg0, **_arg1, &_arg2); end + + # source://actionview//lib/action_view/base.rb#226 + def view_paths=(arg); end + + # Returns the value of attribute view_renderer. + # + # source://actionview//lib/action_view/base.rb#223 + def view_renderer; end + + class << self + # source://actionview//lib/action_view/base.rb#182 + def _routes; end + + # source://actionview//lib/action_view/base.rb#182 + def _routes=(value); end + + # source://actionview//lib/action_view/base.rb#182 + def _routes?; end + + # source://actionview//lib/action_view/base.rb#180 + def annotate_rendered_view_with_filenames; end + + # source://actionview//lib/action_view/base.rb#180 + def annotate_rendered_view_with_filenames=(val); end + + # source://actionview//lib/action_view/base.rb#177 + def automatically_disable_submit_tag; end + + # source://actionview//lib/action_view/base.rb#177 + def automatically_disable_submit_tag=(val); end + + # source://actionview//lib/action_view/base.rb#192 + def cache_template_loading; end + + # source://actionview//lib/action_view/base.rb#196 + def cache_template_loading=(value); end + + # @return [Boolean] + # + # source://actionview//lib/action_view/base.rb#218 + def changed?(other); end + + # source://actionview//lib/action_view/base.rb#159 + def debug_missing_translation; end + + # source://actionview//lib/action_view/base.rb#159 + def debug_missing_translation=(val); end + + # source://actionview//lib/action_view/base.rb#314 + def default_form_builder; end + + # source://actionview//lib/action_view/base.rb#314 + def default_form_builder=(val); end + + # source://actionview//lib/action_view/base.rb#174 + def default_formats; end + + # source://actionview//lib/action_view/base.rb#174 + def default_formats=(val); end + + # :stopdoc: + # + # source://actionview//lib/action_view/base.rb#235 + def empty; end + + # source://actionview//lib/action_view/base.rb#190 + def erb_trim_mode=(arg); end + + # source://actionview//lib/action_view/base.rb#162 + def field_error_proc; end + + # source://actionview//lib/action_view/base.rb#162 + def field_error_proc=(val); end + + # source://actionview//lib/action_view/base.rb#183 + def logger; end + + # source://actionview//lib/action_view/base.rb#183 + def logger=(value); end + + # source://actionview//lib/action_view/base.rb#183 + def logger?; end + + # source://actionview//lib/action_view/base.rb#171 + def prefix_partial_path_with_controller_namespace; end + + # source://actionview//lib/action_view/base.rb#171 + def prefix_partial_path_with_controller_namespace=(value); end + + # source://actionview//lib/action_view/base.rb#171 + def prefix_partial_path_with_controller_namespace?; end + + # source://actionview//lib/action_view/base.rb#187 + def remove_hidden_field_autocomplete; end + + # source://actionview//lib/action_view/base.rb#187 + def remove_hidden_field_autocomplete=(val); end + + # source://actionview//lib/action_view/base.rb#166 + def streaming_completion_on_exception; end + + # source://actionview//lib/action_view/base.rb#166 + def streaming_completion_on_exception=(val); end + + # source://actionview//lib/action_view/base.rb#243 + def with_context(context, assigns = T.unsafe(nil), controller = T.unsafe(nil)); end + + # source://actionview//lib/action_view/base.rb#204 + def with_empty_template_cache; end + + # source://actionview//lib/action_view/base.rb#239 + def with_view_paths(view_paths, assigns = T.unsafe(nil), controller = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://actionview//lib/action_view/base.rb#200 + def xss_safe?; end + + private + + # source://actionview//lib/action_view/base.rb#182 + def __class_attr__routes; end + + # source://actionview//lib/action_view/base.rb#182 + def __class_attr__routes=(new_value); end + + # source://actionview//lib/action_view/base.rb#183 + def __class_attr_logger; end + + # source://actionview//lib/action_view/base.rb#183 + def __class_attr_logger=(new_value); end + + # source://actionview//lib/action_view/base.rb#171 + def __class_attr_prefix_partial_path_with_controller_namespace; end + + # source://actionview//lib/action_view/base.rb#171 + def __class_attr_prefix_partial_path_with_controller_namespace=(new_value); end + end +end + +# source://actionview//lib/action_view/cache_expiry.rb#4 +module ActionView::CacheExpiry; end + +# source://actionview//lib/action_view/cache_expiry.rb#5 +class ActionView::CacheExpiry::ViewReloader + # @return [ViewReloader] a new instance of ViewReloader + # + # source://actionview//lib/action_view/cache_expiry.rb#6 + def initialize(watcher:, &block); end + + # source://actionview//lib/action_view/cache_expiry.rb#21 + def execute; end + + # @return [Boolean] + # + # source://actionview//lib/action_view/cache_expiry.rb#16 + def updated?; end + + private + + # source://actionview//lib/action_view/cache_expiry.rb#64 + def all_view_paths; end + + # source://actionview//lib/action_view/cache_expiry.rb#37 + def build_watcher; end + + # source://actionview//lib/action_view/cache_expiry.rb#60 + def dirs_to_watch; end + + # source://actionview//lib/action_view/cache_expiry.rb#55 + def rebuild_watcher; end + + # source://actionview//lib/action_view/cache_expiry.rb#33 + def reload!; end +end + +# source://actionview//lib/action_view/renderer/partial_renderer/collection_caching.rb#6 +module ActionView::CollectionCaching + extend ::ActiveSupport::Concern + + private + + # source://actionview//lib/action_view/renderer/partial_renderer/collection_caching.rb#20 + def cache_collection_render(instrumentation_payload, view, template, collection); end + + # @return [Boolean] + # + # source://actionview//lib/action_view/renderer/partial_renderer/collection_caching.rb#54 + def callable_cache_key?; end + + # source://actionview//lib/action_view/renderer/partial_renderer/collection_caching.rb#58 + def collection_by_cache_keys(view, template, collection); end + + # source://actionview//lib/action_view/renderer/partial_renderer/collection_caching.rb#71 + def expanded_cache_key(key, view, template, digest_path); end + + # `order_by` is an enumerable object containing keys of the cache, + # all keys are passed in whether found already or not. + # + # `cached_partials` is a hash. If the value exists + # it represents the rendered partial from the cache + # otherwise `Hash#fetch` will take the value of its block. + # + # This method expects a block that will return the rendered + # partial. An example is to render all results + # for each element that was not found in the cache and store it as an array. + # Order it so that the first empty cache element in `cached_partials` + # corresponds to the first element in `rendered_partials`. + # + # If the partial is not already cached it will also be + # written back to the underlying cache store. + # + # source://actionview//lib/action_view/renderer/partial_renderer/collection_caching.rb#91 + def fetch_or_cache_partial(cached_partials, template, order_by:); end + + # @return [Boolean] + # + # source://actionview//lib/action_view/renderer/partial_renderer/collection_caching.rb#16 + def will_cache?(options, view); end +end + +# source://actionview//lib/action_view/renderer/collection_renderer.rb#33 +class ActionView::CollectionRenderer < ::ActionView::PartialRenderer + include ::ActionView::AbstractRenderer::ObjectRendering + + # source://actionview//lib/action_view/renderer/collection_renderer.rb#130 + def render_collection_derive_partial(collection, context, block); end + + # source://actionview//lib/action_view/renderer/collection_renderer.rb#112 + def render_collection_with_partial(collection, partial, context, block); end + + private + + # source://actionview//lib/action_view/renderer/collection_renderer.rb#182 + def collection_with_template(view, template, layout, collection); end + + # source://actionview//lib/action_view/renderer/collection_renderer.rb#153 + def render_collection(collection, view, path, template, layout, block); end + + # source://actionview//lib/action_view/renderer/collection_renderer.rb#148 + def retrieve_variable(path); end +end + +# source://actionview//lib/action_view/renderer/collection_renderer.rb#36 +class ActionView::CollectionRenderer::CollectionIterator + include ::Enumerable + + # @return [CollectionIterator] a new instance of CollectionIterator + # + # source://actionview//lib/action_view/renderer/collection_renderer.rb#39 + def initialize(collection); end + + # source://actionview//lib/action_view/renderer/collection_renderer.rb#43 + def each(&blk); end + + # source://actionview//lib/action_view/renderer/collection_renderer.rb#51 + def length; end + + # source://actionview//lib/action_view/renderer/collection_renderer.rb#55 + def preload!; end + + # source://actionview//lib/action_view/renderer/collection_renderer.rb#47 + def size; end +end + +# source://actionview//lib/action_view/renderer/collection_renderer.rb#100 +class ActionView::CollectionRenderer::MixedCollectionIterator < ::ActionView::CollectionRenderer::CollectionIterator + # @return [MixedCollectionIterator] a new instance of MixedCollectionIterator + # + # source://actionview//lib/action_view/renderer/collection_renderer.rb#101 + def initialize(collection, paths); end + + # source://actionview//lib/action_view/renderer/collection_renderer.rb#106 + def each_with_info; end +end + +# source://actionview//lib/action_view/renderer/collection_renderer.rb#78 +class ActionView::CollectionRenderer::PreloadCollectionIterator < ::ActionView::CollectionRenderer::SameCollectionIterator + # @return [PreloadCollectionIterator] a new instance of PreloadCollectionIterator + # + # source://actionview//lib/action_view/renderer/collection_renderer.rb#79 + def initialize(collection, path, variables, relation); end + + # source://actionview//lib/action_view/renderer/collection_renderer.rb#89 + def each_with_info; end + + # source://actionview//lib/action_view/renderer/collection_renderer.rb#85 + def from_collection(collection); end + + # source://actionview//lib/action_view/renderer/collection_renderer.rb#95 + def preload!; end +end + +# source://actionview//lib/action_view/renderer/collection_renderer.rb#60 +class ActionView::CollectionRenderer::SameCollectionIterator < ::ActionView::CollectionRenderer::CollectionIterator + # @return [SameCollectionIterator] a new instance of SameCollectionIterator + # + # source://actionview//lib/action_view/renderer/collection_renderer.rb#61 + def initialize(collection, path, variables); end + + # source://actionview//lib/action_view/renderer/collection_renderer.rb#71 + def each_with_info; end + + # source://actionview//lib/action_view/renderer/collection_renderer.rb#67 + def from_collection(collection); end +end + +# = Action View Context +# +# Action View contexts are supplied to Action Controller to render a template. +# The default Action View context is ActionView::Base. +# +# In order to work with Action Controller, a Context must just include this +# module. The initialization of the variables used by the context +# (@output_buffer, @view_flow, and @virtual_path) is responsibility of the +# object that includes this module (although you can call _prepare_context +# defined below). +# +# source://actionview//lib/action_view/context.rb#14 +module ActionView::Context + # Encapsulates the interaction with the view flow so it + # returns the correct buffer on +yield+. This is usually + # overwritten by helpers to add more behavior. + # + # source://actionview//lib/action_view/context.rb#27 + def _layout_for(name = T.unsafe(nil)); end + + # Prepares the context by setting the appropriate instance variables. + # + # source://actionview//lib/action_view/context.rb#18 + def _prepare_context; end + + # Returns the value of attribute output_buffer. + # + # source://actionview//lib/action_view/context.rb#15 + def output_buffer; end + + # Sets the attribute output_buffer + # + # @param value the value to set the attribute output_buffer to. + # + # source://actionview//lib/action_view/context.rb#15 + def output_buffer=(_arg0); end + + # Returns the value of attribute view_flow. + # + # source://actionview//lib/action_view/context.rb#15 + def view_flow; end + + # Sets the attribute view_flow + # + # @param value the value to set the attribute view_flow to. + # + # source://actionview//lib/action_view/context.rb#15 + def view_flow=(_arg0); end +end + +# source://actionview//lib/action_view/dependency_tracker.rb#8 +class ActionView::DependencyTracker + extend ::ActiveSupport::Autoload + + class << self + # source://actionview//lib/action_view/dependency_tracker.rb#17 + def find_dependencies(name, template, view_paths = T.unsafe(nil)); end + + # source://actionview//lib/action_view/dependency_tracker.rb#24 + def register_tracker(extension, tracker); end + + # source://actionview//lib/action_view/dependency_tracker.rb#35 + def remove_tracker(handler); end + end +end + +# source://actionview//lib/action_view/dependency_tracker/erb_tracker.rb#5 +class ActionView::DependencyTracker::ERBTracker + # @return [ERBTracker] a new instance of ERBTracker + # + # source://actionview//lib/action_view/dependency_tracker/erb_tracker.rb#72 + def initialize(name, template, view_paths = T.unsafe(nil)); end + + # source://actionview//lib/action_view/dependency_tracker/erb_tracker.rb#76 + def dependencies; end + + private + + # source://actionview//lib/action_view/dependency_tracker/erb_tracker.rb#104 + def add_dependencies(render_dependencies, arguments, pattern); end + + # source://actionview//lib/action_view/dependency_tracker/erb_tracker.rb#112 + def add_dynamic_dependency(dependencies, dependency); end + + # source://actionview//lib/action_view/dependency_tracker/erb_tracker.rb#118 + def add_static_dependency(dependencies, dependency, quote_type); end + + # source://actionview//lib/action_view/dependency_tracker/erb_tracker.rb#88 + def directory; end + + # source://actionview//lib/action_view/dependency_tracker/erb_tracker.rb#158 + def explicit_dependencies; end + + # Returns the value of attribute name. + # + # source://actionview//lib/action_view/dependency_tracker/erb_tracker.rb#80 + def name; end + + # source://actionview//lib/action_view/dependency_tracker/erb_tracker.rb#92 + def render_dependencies; end + + # source://actionview//lib/action_view/dependency_tracker/erb_tracker.rb#84 + def source; end + + # Returns the value of attribute template. + # + # source://actionview//lib/action_view/dependency_tracker/erb_tracker.rb#80 + def template; end + + class << self + # source://actionview//lib/action_view/dependency_tracker/erb_tracker.rb#68 + def call(name, template, view_paths = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://actionview//lib/action_view/dependency_tracker/erb_tracker.rb#64 + def supports_view_paths?; end + end +end + +# source://actionview//lib/action_view/dependency_tracker/erb_tracker.rb#6 +ActionView::DependencyTracker::ERBTracker::EXPLICIT_DEPENDENCY = T.let(T.unsafe(nil), Regexp) + +# A valid ruby identifier - suitable for class, method and specially variable names +# +# source://actionview//lib/action_view/dependency_tracker/erb_tracker.rb#9 +ActionView::DependencyTracker::ERBTracker::IDENTIFIER = T.let(T.unsafe(nil), Regexp) + +# source://actionview//lib/action_view/dependency_tracker/erb_tracker.rb#58 +ActionView::DependencyTracker::ERBTracker::LAYOUT_DEPENDENCY = T.let(T.unsafe(nil), Regexp) + +# Part of any hash containing the :layout key +# +# source://actionview//lib/action_view/dependency_tracker/erb_tracker.rb#36 +ActionView::DependencyTracker::ERBTracker::LAYOUT_HASH_KEY = T.let(T.unsafe(nil), Regexp) + +# Part of any hash containing the :partial key +# +# source://actionview//lib/action_view/dependency_tracker/erb_tracker.rb#30 +ActionView::DependencyTracker::ERBTracker::PARTIAL_HASH_KEY = T.let(T.unsafe(nil), Regexp) + +# Matches: +# partial: "comments/comment", collection: @all_comments => "comments/comment" +# (object: @single_comment, partial: "comments/comment") => "comments/comment" +# +# "comments/comments" +# 'comments/comments' +# ('comments/comments') +# +# (@topic) => "topics/topic" +# topics => "topics/topic" +# (message.topics) => "topics/topic" +# +# source://actionview//lib/action_view/dependency_tracker/erb_tracker.rb#52 +ActionView::DependencyTracker::ERBTracker::RENDER_ARGUMENTS = T.let(T.unsafe(nil), Regexp) + +# A simple string literal. e.g. "School's out!" +# +# source://actionview//lib/action_view/dependency_tracker/erb_tracker.rb#23 +ActionView::DependencyTracker::ERBTracker::STRING = T.let(T.unsafe(nil), Regexp) + +# Any kind of variable name. e.g. @instance, @@class, $global or local. +# Possibly following a method call chain +# +# source://actionview//lib/action_view/dependency_tracker/erb_tracker.rb#16 +ActionView::DependencyTracker::ERBTracker::VARIABLE_OR_METHOD_CHAIN = T.let(T.unsafe(nil), Regexp) + +# source://actionview//lib/action_view/dependency_tracker/ruby_tracker.rb#5 +class ActionView::DependencyTracker::RubyTracker + # @return [RubyTracker] a new instance of RubyTracker + # + # source://actionview//lib/action_view/dependency_tracker/ruby_tracker.rb#20 + def initialize(name, template, view_paths = T.unsafe(nil), parser_class: T.unsafe(nil)); end + + # source://actionview//lib/action_view/dependency_tracker/ruby_tracker.rb#12 + def dependencies; end + + private + + # source://actionview//lib/action_view/dependency_tracker/ruby_tracker.rb#38 + def explicit_dependencies; end + + # Returns the value of attribute name. + # + # source://actionview//lib/action_view/dependency_tracker/ruby_tracker.rb#26 + def name; end + + # source://actionview//lib/action_view/dependency_tracker/ruby_tracker.rb#28 + def render_dependencies; end + + # Returns the value of attribute template. + # + # source://actionview//lib/action_view/dependency_tracker/ruby_tracker.rb#26 + def template; end + + # Returns the value of attribute view_paths. + # + # source://actionview//lib/action_view/dependency_tracker/ruby_tracker.rb#26 + def view_paths; end + + class << self + # source://actionview//lib/action_view/dependency_tracker/ruby_tracker.rb#8 + def call(name, template, view_paths = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://actionview//lib/action_view/dependency_tracker/ruby_tracker.rb#16 + def supports_view_paths?; end + end +end + +# source://actionview//lib/action_view/dependency_tracker/ruby_tracker.rb#6 +ActionView::DependencyTracker::RubyTracker::EXPLICIT_DEPENDENCY = T.let(T.unsafe(nil), Regexp) + +# source://actionview//lib/action_view/dependency_tracker/wildcard_resolver.rb#5 +class ActionView::DependencyTracker::WildcardResolver + # @return [WildcardResolver] a new instance of WildcardResolver + # + # source://actionview//lib/action_view/dependency_tracker/wildcard_resolver.rb#6 + def initialize(view_paths, dependencies); end + + # source://actionview//lib/action_view/dependency_tracker/wildcard_resolver.rb#13 + def resolve; end + + private + + # Returns the value of attribute explicit_dependencies. + # + # source://actionview//lib/action_view/dependency_tracker/wildcard_resolver.rb#20 + def explicit_dependencies; end + + # source://actionview//lib/action_view/dependency_tracker/wildcard_resolver.rb#22 + def resolved_wildcard_dependencies; end + + # Returns the value of attribute view_paths. + # + # source://actionview//lib/action_view/dependency_tracker/wildcard_resolver.rb#20 + def view_paths; end + + # Returns the value of attribute wildcard_dependencies. + # + # source://actionview//lib/action_view/dependency_tracker/wildcard_resolver.rb#20 + def wildcard_dependencies; end +end + +# source://actionview//lib/action_view/digestor.rb#6 +class ActionView::Digestor + class << self + # Supported options: + # + # * name - Template name + # * format - Template format + # * +finder+ - An instance of ActionView::LookupContext + # * dependencies - An array of dependent views + # + # source://actionview//lib/action_view/digestor.rb#16 + def digest(name:, finder:, format: T.unsafe(nil), dependencies: T.unsafe(nil)); end + + # source://actionview//lib/action_view/digestor.rb#38 + def logger; end + + # Create a dependency tree for template named +name+. + # + # source://actionview//lib/action_view/digestor.rb#43 + def tree(name, finder, partial = T.unsafe(nil), seen = T.unsafe(nil)); end + + private + + # source://actionview//lib/action_view/digestor.rb#71 + def find_template(finder, name, prefixes, partial, keys); end + end +end + +# source://actionview//lib/action_view/digestor.rb#125 +class ActionView::Digestor::Injected < ::ActionView::Digestor::Node + # source://actionview//lib/action_view/digestor.rb#126 + def digest(finder, _ = T.unsafe(nil)); end +end + +# source://actionview//lib/action_view/digestor.rb#121 +class ActionView::Digestor::Missing < ::ActionView::Digestor::Node + # source://actionview//lib/action_view/digestor.rb#122 + def digest(finder, _ = T.unsafe(nil)); end +end + +# source://actionview//lib/action_view/digestor.rb#78 +class ActionView::Digestor::Node + # @return [Node] a new instance of Node + # + # source://actionview//lib/action_view/digestor.rb#86 + def initialize(name, logical_name, template, children = T.unsafe(nil)); end + + # Returns the value of attribute children. + # + # source://actionview//lib/action_view/digestor.rb#79 + def children; end + + # source://actionview//lib/action_view/digestor.rb#97 + def dependency_digest(finder, stack); end + + # source://actionview//lib/action_view/digestor.rb#93 + def digest(finder, stack = T.unsafe(nil)); end + + # Returns the value of attribute logical_name. + # + # source://actionview//lib/action_view/digestor.rb#79 + def logical_name; end + + # Returns the value of attribute name. + # + # source://actionview//lib/action_view/digestor.rb#79 + def name; end + + # Returns the value of attribute template. + # + # source://actionview//lib/action_view/digestor.rb#79 + def template; end + + # source://actionview//lib/action_view/digestor.rb#110 + def to_dep_map(seen = T.unsafe(nil)); end + + class << self + # source://actionview//lib/action_view/digestor.rb#81 + def create(name, logical_name, template, partial); end + end +end + +# source://actionview//lib/action_view/digestor.rb#129 +class ActionView::Digestor::NullLogger + class << self + # source://actionview//lib/action_view/digestor.rb#130 + def debug(_); end + + # source://actionview//lib/action_view/digestor.rb#131 + def error(_); end + end +end + +# source://actionview//lib/action_view/digestor.rb#119 +class ActionView::Digestor::Partial < ::ActionView::Digestor::Node; end + +# source://actionview//lib/action_view.rb#35 +ActionView::ENCODING_FLAG = T.let(T.unsafe(nil), String) + +# source://actionview//lib/action_view/template/error.rb#11 +class ActionView::EncodingError < ::StandardError; end + +# A resolver that loads files from the filesystem. +# +# source://actionview//lib/action_view/template/resolver.rb#90 +class ActionView::FileSystemResolver < ::ActionView::Resolver + # @raise [ArgumentError] + # @return [FileSystemResolver] a new instance of FileSystemResolver + # + # source://actionview//lib/action_view/template/resolver.rb#93 + def initialize(path); end + + # @return [Boolean] + # + # source://actionview//lib/action_view/template/resolver.rb#115 + def ==(resolver); end + + # source://actionview//lib/action_view/template/resolver.rb#117 + def all_template_paths; end + + # source://actionview//lib/action_view/template/resolver.rb#126 + def built_templates; end + + # source://actionview//lib/action_view/template/resolver.rb#101 + def clear_cache; end + + # @return [Boolean] + # + # source://actionview//lib/action_view/template/resolver.rb#112 + def eql?(resolver); end + + # Returns the value of attribute path. + # + # source://actionview//lib/action_view/template/resolver.rb#91 + def path; end + + # source://actionview//lib/action_view/template/resolver.rb#110 + def to_path; end + + # source://actionview//lib/action_view/template/resolver.rb#107 + def to_s; end + + private + + # source://actionview//lib/action_view/template/resolver.rb#131 + def _find_all(name, prefix, partial, details, key, locals); end + + # source://actionview//lib/action_view/template/resolver.rb#150 + def build_unbound_template(template); end + + # source://actionview//lib/action_view/template/resolver.rb#208 + def escape_entry(entry); end + + # source://actionview//lib/action_view/template/resolver.rb#180 + def filter_and_sort_by_details(templates, requested_details); end + + # source://actionview//lib/action_view/template/resolver.rb#146 + def source_for_template(template); end + + # Safe glob within @path + # + # source://actionview//lib/action_view/template/resolver.rb#195 + def template_glob(glob); end + + # source://actionview//lib/action_view/template/resolver.rb#163 + def unbound_templates_from_path(path); end +end + +# source://actionview//lib/action_view/helpers/capture_helper.rb#6 +module ActionView::Helpers + include ::ActiveSupport::Benchmarkable + include ::ActionView::Helpers::ActiveModelHelper + include ::ActionView::Helpers::AssetUrlHelper + include ::ActionView::Helpers::SanitizeHelper + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + include ::ActionView::Helpers::TagHelper + include ::ActionView::Helpers::AssetTagHelper + include ::ActionView::Helpers::AtomFeedHelper + include ::ActionView::Helpers::CacheHelper + include ::ActionView::Helpers::ContentExfiltrationPreventionHelper + include ::ActionView::Helpers::ControllerHelper + include ::ActionView::Helpers::CspHelper + include ::ActionView::Helpers::CsrfHelper + include ::ActionView::Helpers::DateHelper + include ::ActionView::Helpers::DebugHelper + include ::ActionView::Helpers::TextHelper + include ::ActionView::Helpers::FormOptionsHelper + include ::ActionView::Helpers::JavaScriptHelper + include ::ActionView::Helpers::NumberHelper + include ::ActionView::Helpers::RenderingHelper + extend ::ActiveSupport::Autoload + extend ::ActiveSupport::Concern + include ::ActionView::Helpers::UrlHelper + include ::ActionView::Helpers::SanitizeHelper + include ::ActionView::Helpers::TextHelper + include ::ActionView::Helpers::FormTagHelper + include ::ActionView::Helpers::FormHelper + include ::ActionView::Helpers::TranslationHelper + + mixes_in_class_methods ::ActionView::Helpers::UrlHelper::ClassMethods + mixes_in_class_methods ::ActionView::Helpers::SanitizeHelper::ClassMethods + + class << self + # source://actionview//lib/action_view/helpers.rb#35 + def eager_load!; end + end +end + +# source://actionview//lib/action_view/helpers/active_model_helper.rb#8 +module ActionView::Helpers::ActiveModelHelper; end + +# = Active \Model Instance Tag \Helpers +# +# source://actionview//lib/action_view/helpers/active_model_helper.rb#12 +module ActionView::Helpers::ActiveModelInstanceTag + # source://actionview//lib/action_view/helpers/active_model_helper.rb#20 + def content_tag(type, options, *_arg2); end + + # source://actionview//lib/action_view/helpers/active_model_helper.rb#36 + def error_message; end + + # source://actionview//lib/action_view/helpers/active_model_helper.rb#28 + def error_wrapping(html_tag); end + + # source://actionview//lib/action_view/helpers/active_model_helper.rb#13 + def object; end + + # source://actionview//lib/action_view/helpers/active_model_helper.rb#24 + def tag(type, options, *_arg2); end + + private + + # @return [Boolean] + # + # source://actionview//lib/action_view/helpers/active_model_helper.rb#41 + def object_has_errors?; end + + # @return [Boolean] + # + # source://actionview//lib/action_view/helpers/active_model_helper.rb#45 + def select_markup_helper?(type); end + + # @return [Boolean] + # + # source://actionview//lib/action_view/helpers/active_model_helper.rb#49 + def tag_generate_errors?(options); end +end + +# = Action View Asset Tag \Helpers +# +# This module provides methods for generating HTML that links views to assets such +# as images, JavaScripts, stylesheets, and feeds. These methods do not verify +# the assets exist before linking to them: +# +# image_tag("rails.png") +# # => +# stylesheet_link_tag("application") +# # => +# +# source://actionview//lib/action_view/helpers/asset_tag_helper.rb#21 +module ActionView::Helpers::AssetTagHelper + include ::ActionView::Helpers::AssetUrlHelper + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + include ::ActionView::Helpers::TagHelper + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#28 + def apply_stylesheet_media_default; end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#28 + def apply_stylesheet_media_default=(val); end + + # Returns an HTML audio tag for the +sources+. If +sources+ is a string, + # a single audio tag will be returned. If +sources+ is an array, an audio + # tag with nested source tags for each source will be returned. The + # +sources+ can be full paths, files that exist in your public audios + # directory, or Active Storage attachments. + # + # When the last parameter is a hash you can add HTML attributes using that + # parameter. + # + # audio_tag("sound") + # # => + # audio_tag("sound.wav") + # # => + # audio_tag("sound.wav", autoplay: true, controls: true) + # # => + # audio_tag("sound.wav", "sound.mid") + # # => + # + # Active Storage blobs (audios that are uploaded by the users of your app): + # + # audio_tag(user.name_pronunciation_audio) + # # => + # + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#612 + def audio_tag(*sources); end + + # Returns a link tag that browsers and feed readers can use to auto-detect + # an RSS, Atom, or JSON feed. The +type+ can be :rss (default), + # :atom, or :json. Control the link options in url_for format + # using the +url_options+. You can modify the LINK tag itself in +tag_options+. + # + # ==== Options + # + # * :rel - Specify the relation of this link, defaults to "alternate" + # * :type - Override the auto-generated mime type + # * :title - Specify the title of the link, defaults to the +type+ + # + # ==== Examples + # + # auto_discovery_link_tag + # # => + # auto_discovery_link_tag(:atom) + # # => + # auto_discovery_link_tag(:json) + # # => + # auto_discovery_link_tag(:rss, {action: "feed"}) + # # => + # auto_discovery_link_tag(:rss, {action: "feed"}, {title: "My RSS"}) + # # => + # auto_discovery_link_tag(:rss, {controller: "news", action: "feed"}) + # # => + # auto_discovery_link_tag(:rss, "http://www.example.com/feed.rss", {title: "Example RSS"}) + # # => + # + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#279 + def auto_discovery_link_tag(type = T.unsafe(nil), url_options = T.unsafe(nil), tag_options = T.unsafe(nil)); end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#29 + def auto_include_nonce_for_scripts; end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#29 + def auto_include_nonce_for_scripts=(val); end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#30 + def auto_include_nonce_for_styles; end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#30 + def auto_include_nonce_for_styles=(val); end + + # Returns a link tag for a favicon managed by the asset pipeline. + # + # If a page has no link like the one generated by this helper, browsers + # ask for /favicon.ico automatically, and cache the file if the + # request succeeds. If the favicon changes it is hard to get it updated. + # + # To have better control applications may let the asset pipeline manage + # their favicon storing the file under app/assets/images, and + # using this helper to generate its corresponding link tag. + # + # The helper gets the name of the favicon file as first argument, which + # defaults to "favicon.ico", and also supports +:rel+ and +:type+ options + # to override their defaults, "icon" and "image/x-icon" + # respectively: + # + # favicon_link_tag + # # => + # + # favicon_link_tag 'myicon.ico' + # # => + # + # Mobile Safari looks for a different link tag, pointing to an image that + # will be used if you add the page to the home screen of an iOS device. + # The following call would generate such a tag: + # + # favicon_link_tag 'mb-icon.png', rel: 'apple-touch-icon', type: 'image/png' + # # => + # + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#320 + def favicon_link_tag(source = T.unsafe(nil), options = T.unsafe(nil)); end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#26 + def image_decoding; end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#26 + def image_decoding=(val); end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#25 + def image_loading; end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#25 + def image_loading=(val); end + + # Returns an HTML image tag for the +source+. The +source+ can be a full + # path, a file, or an Active Storage attachment. + # + # ==== Options + # + # You can add HTML attributes using the +options+. The +options+ supports + # additional keys for convenience and conformance: + # + # * :size - Supplied as "#{width}x#{height}" or "#{number}", so "30x45" becomes + # width="30" height="45", and "50" becomes width="50" height="50". + # :size will be ignored if the value is not in the correct format. + # * :srcset - If supplied as a hash or array of [source, descriptor] + # pairs, each image path will be expanded before the list is formatted as a string. + # + # ==== Examples + # + # Assets (images that are part of your app): + # + # image_tag("icon") + # # => + # image_tag("icon.png") + # # => + # image_tag("icon.png", size: "16x10", alt: "Edit Entry") + # # => Edit Entry + # image_tag("/icons/icon.gif", size: "16") + # # => + # image_tag("/icons/icon.gif", height: '32', width: '32') + # # => + # image_tag("/icons/icon.gif", class: "menu_icon") + # # => + # image_tag("/icons/icon.gif", data: { title: 'Rails Application' }) + # # => + # image_tag("icon.png", srcset: { "icon_2x.png" => "2x", "icon_4x.png" => "4x" }) + # # => + # image_tag("pic.jpg", srcset: [["pic_1024.jpg", "1024w"], ["pic_1980.jpg", "1980w"]], sizes: "100vw") + # # => + # + # Active Storage blobs (images that are uploaded by the users of your app): + # + # image_tag(user.avatar) + # # => + # image_tag(user.avatar.variant(resize_to_limit: [100, 100])) + # # => + # image_tag(user.avatar.variant(resize_to_limit: [100, 100]), size: '100') + # # => + # + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#449 + def image_tag(source, options = T.unsafe(nil)); end + + # Returns an HTML script tag for each of the +sources+ provided. + # + # Sources may be paths to JavaScript files. Relative paths are assumed to be relative + # to assets/javascripts, full paths are assumed to be relative to the document + # root. Relative paths are idiomatic, use absolute paths only when needed. + # + # When passing paths, the ".js" extension is optional. If you do not want ".js" + # appended to the path extname: false can be set on the options. + # + # You can modify the HTML attributes of the script tag by passing a hash as the + # last argument. + # + # When the Asset Pipeline is enabled, you can pass the name of your manifest as + # source, and include other JavaScript or CoffeeScript files inside the manifest. + # + # If the server supports HTTP Early Hints, and the +defer+ option is not + # enabled, \Rails will push a 103 Early Hints response that links + # to the assets. + # + # ==== Options + # + # When the last parameter is a hash you can add HTML attributes using that + # parameter. This includes but is not limited to the following options: + # + # * :extname - Append an extension to the generated URL unless the extension + # already exists. This only applies for relative URLs. + # * :protocol - Sets the protocol of the generated URL. This option only + # applies when a relative URL and +host+ options are provided. + # * :host - When a relative URL is provided the host is added to the + # that path. + # * :skip_pipeline - This option is used to bypass the asset pipeline + # when it is set to true. + # * :nonce - When set to true, adds an automatic nonce value if + # you have Content Security Policy enabled. + # * :async - When set to +true+, adds the +async+ HTML + # attribute, allowing the script to be fetched in parallel to be parsed + # and evaluated as soon as possible. + # * :defer - When set to +true+, adds the +defer+ HTML + # attribute, which indicates to the browser that the script is meant to + # be executed after the document has been parsed. Additionally, prevents + # sending the Preload Links header. + # * :nopush - Specify if the use of server push is not desired + # for the script. Defaults to +true+. + # + # Any other specified options will be treated as HTML attributes for the + # +script+ tag. + # + # For more information regarding how the :async and :defer + # options affect the + # + # javascript_include_tag "xmlhr", host: "localhost", protocol: "https" + # # => + # + # javascript_include_tag "template.jst", extname: false + # # => + # + # javascript_include_tag "xmlhr.js" + # # => + # + # javascript_include_tag "common.javascript", "/elsewhere/cools" + # # => + # # + # + # javascript_include_tag "http://www.example.com/xmlhr" + # # => + # + # javascript_include_tag "http://www.example.com/xmlhr.js" + # # => + # + # javascript_include_tag "http://www.example.com/xmlhr.js", nonce: true + # # => + # + # javascript_include_tag "http://www.example.com/xmlhr.js", async: true + # # => + # + # javascript_include_tag "http://www.example.com/xmlhr.js", defer: true + # # => + # + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#115 + def javascript_include_tag(*sources); end + + # Returns an HTML picture tag for the +sources+. If +sources+ is a string, + # a single picture tag will be returned. If +sources+ is an array, a picture + # tag with nested source tags for each source will be returned. The + # +sources+ can be full paths, files that exist in your public images + # directory, or Active Storage attachments. Since the picture tag requires + # an img tag, the last element you provide will be used for the img tag. + # For complete control over the picture tag, a block can be passed, which + # will populate the contents of the tag accordingly. + # + # ==== Options + # + # When the last parameter is a hash you can add HTML attributes using that + # parameter. Apart from all the HTML supported options, the following are supported: + # + # * :image - Hash of options that are passed directly to the +image_tag+ helper. + # + # ==== Examples + # + # picture_tag("picture.webp") + # # => + # picture_tag("gold.png", :image => { :size => "20" }) + # # => + # picture_tag("gold.png", :image => { :size => "45x70" }) + # # => + # picture_tag("picture.webp", "picture.png") + # # => + # picture_tag("picture.webp", "picture.png", :image => { alt: "Image" }) + # # => Image + # picture_tag(["picture.webp", "picture.png"], :image => { alt: "Image" }) + # # => Image + # picture_tag(:class => "my-class") { tag(:source, :srcset => image_path("picture.webp")) + image_tag("picture.png", :alt => "Image") } + # # => Image + # picture_tag { tag(:source, :srcset => image_path("picture-small.webp"), :media => "(min-width: 600px)") + tag(:source, :srcset => image_path("picture-big.webp")) + image_tag("picture.png", :alt => "Image") } + # # => Image + # + # Active Storage blobs (images that are uploaded by the users of your app): + # + # picture_tag(user.profile_picture) + # # => + # + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#510 + def picture_tag(*sources, &block); end + + # Returns a link tag that browsers can use to preload the +source+. + # The +source+ can be the path of a resource managed by asset pipeline, + # a full path, or an URI. + # + # ==== Options + # + # * :type - Override the auto-generated mime type, defaults to the mime type for +source+ extension. + # * :as - Override the auto-generated value for as attribute, calculated using +source+ extension and mime type. + # * :crossorigin - Specify the crossorigin attribute, required to load cross-origin resources. + # * :nopush - Specify if the use of server push is not desired for the resource. Defaults to +false+. + # * :integrity - Specify the integrity attribute. + # + # ==== Examples + # + # preload_link_tag("custom_theme.css") + # # => + # + # preload_link_tag("/videos/video.webm") + # # => + # + # preload_link_tag(post_path(format: :json), as: "fetch") + # # => + # + # preload_link_tag("worker.js", as: "worker") + # # => + # + # preload_link_tag("//example.com/font.woff2") + # # => + # + # preload_link_tag("//example.com/font.woff2", crossorigin: "use-credentials") + # # => + # + # preload_link_tag("/media/audio.ogg", nopush: true) + # # => + # + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#363 + def preload_link_tag(source, options = T.unsafe(nil)); end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#27 + def preload_links_header; end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#27 + def preload_links_header=(val); end + + # Returns a stylesheet link tag for the sources specified as arguments. + # + # When passing paths, the .css extension is optional. + # If you don't specify an extension, .css will be appended automatically. + # If you do not want .css appended to the path, + # set extname: false in the options. + # You can modify the link attributes by passing a hash as the last argument. + # + # If the server supports HTTP Early Hints, \Rails will push a 103 Early + # Hints response that links to the assets. + # + # ==== Options + # + # * :extname - Append an extension to the generated URL unless the extension + # already exists. This only applies for relative URLs. + # * :protocol - Sets the protocol of the generated URL. This option only + # applies when a relative URL and +host+ options are provided. + # * :host - When a relative URL is provided the host is added to the + # that path. + # * :skip_pipeline - This option is used to bypass the asset pipeline + # when it is set to true. + # * :nonce - When set to true, adds an automatic nonce value if + # you have Content Security Policy enabled. + # * :nopush - Specify if the use of server push is not desired + # for the stylesheet. Defaults to +true+. + # + # ==== Examples + # + # stylesheet_link_tag "style" + # # => + # + # stylesheet_link_tag "style.css" + # # => + # + # stylesheet_link_tag "http://www.example.com/style.css" + # # => + # + # stylesheet_link_tag "style.less", extname: false, skip_pipeline: true, rel: "stylesheet/less" + # # => + # + # stylesheet_link_tag "style", media: "all" + # # => + # + # stylesheet_link_tag "style", media: "print" + # # => + # + # stylesheet_link_tag "random.styles", "/css/stylish" + # # => + # # + # + # stylesheet_link_tag "style", nonce: true + # # => + # + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#207 + def stylesheet_link_tag(*sources); end + + # Returns an HTML video tag for the +sources+. If +sources+ is a string, + # a single video tag will be returned. If +sources+ is an array, a video + # tag with nested source tags for each source will be returned. The + # +sources+ can be full paths, files that exist in your public videos + # directory, or Active Storage attachments. + # + # ==== Options + # + # When the last parameter is a hash you can add HTML attributes using that + # parameter. The following options are supported: + # + # * :poster - Set an image (like a screenshot) to be shown + # before the video loads. The path is calculated like the +src+ of +image_tag+. + # * :size - Supplied as "#{width}x#{height}" or "#{number}", so "30x45" becomes + # width="30" height="45", and "50" becomes width="50" height="50". + # :size will be ignored if the value is not in the correct format. + # * :poster_skip_pipeline will bypass the asset pipeline when using + # the :poster option instead using an asset in the public folder. + # + # ==== Examples + # + # video_tag("trailer") + # # => + # video_tag("trailer.ogg") + # # => + # video_tag("trailer.ogg", controls: true, preload: 'none') + # # => + # video_tag("trailer.m4v", size: "16x10", poster: "screenshot.png") + # # => + # video_tag("trailer.m4v", size: "16x10", poster: "screenshot.png", poster_skip_pipeline: true) + # # => + # video_tag("/trailers/hd.avi", size: "16x16") + # # => + # video_tag("/trailers/hd.avi", size: "16") + # # => + # video_tag("/trailers/hd.avi", height: '32', width: '32') + # # => + # video_tag("trailer.ogg", "trailer.flv") + # # => + # video_tag(["trailer.ogg", "trailer.flv"]) + # # => + # video_tag(["trailer.ogg", "trailer.flv"], size: "160x120") + # # => + # + # Active Storage blobs (videos that are uploaded by the users of your app): + # + # video_tag(user.intro_video) + # # => + # + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#580 + def video_tag(*sources); end + + private + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#653 + def check_for_image_tag_errors(options); end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#644 + def extract_dimensions(size); end + + # @yield [options] + # + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#617 + def multiple_sources_tag_builder(type, sources); end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#634 + def resolve_asset_source(asset_type, source, skip_pipeline); end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#659 + def resolve_link_as(extname, mime_type); end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#673 + def send_preload_links_header(preload_links, max_header_size: T.unsafe(nil)); end + + class << self + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#28 + def apply_stylesheet_media_default; end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#28 + def apply_stylesheet_media_default=(val); end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#29 + def auto_include_nonce_for_scripts; end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#29 + def auto_include_nonce_for_scripts=(val); end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#30 + def auto_include_nonce_for_styles; end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#30 + def auto_include_nonce_for_styles=(val); end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#26 + def image_decoding; end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#26 + def image_decoding=(val); end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#25 + def image_loading; end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#25 + def image_loading=(val); end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#27 + def preload_links_header; end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#27 + def preload_links_header=(val); end + end +end + +# Some HTTP client and proxies have a 4kiB header limit, but more importantly +# including preload links has diminishing returns so it's best to not go overboard +# +# source://actionview//lib/action_view/helpers/asset_tag_helper.rb#671 +ActionView::Helpers::AssetTagHelper::MAX_HEADER_SIZE = T.let(T.unsafe(nil), Integer) + +# = Action View Asset URL \Helpers +# +# This module provides methods for generating asset paths and +# URLs. +# +# image_path("rails.png") +# # => "/assets/rails.png" +# +# image_url("rails.png") +# # => "http://www.example.com/assets/rails.png" +# +# === Using asset hosts +# +# By default, \Rails links to these assets on the current host in the public +# folder, but you can direct \Rails to link to assets from a dedicated asset +# server by setting ActionController::Base.asset_host in the application +# configuration, typically in config/environments/production.rb. +# For example, you'd define assets.example.com to be your asset +# host this way, inside the configure block of your environment-specific +# configuration files or config/application.rb: +# +# config.action_controller.asset_host = "assets.example.com" +# +# Helpers take that into account: +# +# image_tag("rails.png") +# # => +# stylesheet_link_tag("application") +# # => +# +# Browsers open a limited number of simultaneous connections to a single +# host. The exact number varies by browser and version. This limit may cause +# some asset downloads to wait for previous assets to finish before they can +# begin. You can use the %d wildcard in the +asset_host+ to +# distribute the requests over four hosts. For example, +# assets%d.example.com will spread the asset requests over +# "assets0.example.com", ..., "assets3.example.com". +# +# image_tag("rails.png") +# # => +# stylesheet_link_tag("application") +# # => +# +# This may improve the asset loading performance of your application. +# It is also possible the combination of additional connection overhead +# (DNS, SSL) and the overall browser connection limits may result in this +# solution being slower. You should be sure to measure your actual +# performance across targeted browsers both before and after this change. +# +# To implement the corresponding hosts you can either set up four actual +# hosts or use wildcard DNS to CNAME the wildcard to a single asset host. +# You can read more about setting up your DNS CNAME records from your ISP. +# +# Note: This is purely a browser performance optimization and is not meant +# for server load balancing. See https://www.die.net/musings/page_load_time/ +# for background and https://www.browserscope.org/?category=network for +# connection limit data. +# +# Alternatively, you can exert more control over the asset host by setting +# +asset_host+ to a proc like this: +# +# ActionController::Base.asset_host = Proc.new { |source| +# "http://assets#{OpenSSL::Digest::SHA256.hexdigest(source).to_i(16) % 2 + 1}.example.com" +# } +# image_tag("rails.png") +# # => +# stylesheet_link_tag("application") +# # => +# +# The example above generates "http://assets1.example.com" and +# "http://assets2.example.com". This option is useful for example if +# you need fewer/more than four hosts, custom host names, etc. +# +# As you see the proc takes a +source+ parameter. That's a string with the +# absolute path of the asset, for example "/assets/rails.png". +# +# ActionController::Base.asset_host = Proc.new { |source| +# if source.end_with?('.css') +# "http://stylesheets.example.com" +# else +# "http://assets.example.com" +# end +# } +# image_tag("rails.png") +# # => +# stylesheet_link_tag("application") +# # => +# +# Alternatively you may ask for a second parameter +request+. That one is +# particularly useful for serving assets from an SSL-protected page. The +# example proc below disables asset hosting for HTTPS connections, while +# still sending assets for plain HTTP requests from asset hosts. If you don't +# have SSL certificates for each of the asset hosts this technique allows you +# to avoid warnings in the client about mixed media. +# Note that the +request+ parameter might not be supplied, e.g. when the assets +# are precompiled with the command bin/rails assets:precompile. Make sure to use a +# +Proc+ instead of a lambda, since a +Proc+ allows missing parameters and sets them +# to +nil+. +# +# config.action_controller.asset_host = Proc.new { |source, request| +# if request && request.ssl? +# "#{request.protocol}#{request.host_with_port}" +# else +# "#{request.protocol}assets.example.com" +# end +# } +# +# You can also implement a custom asset host object that responds to +call+ +# and takes either one or two parameters just like the proc. +# +# config.action_controller.asset_host = AssetHostingWithMinimumSsl.new( +# "http://asset%d.example.com", "https://asset1.example.com" +# ) +# +# source://actionview//lib/action_view/helpers/asset_url_helper.rb#121 +module ActionView::Helpers::AssetUrlHelper + # This is the entry point for all assets. + # When using an asset pipeline gem (e.g. propshaft or sprockets-rails), the + # behavior is "enhanced". You can bypass the asset pipeline by passing in + # skip_pipeline: true to the options. + # + # All other asset *_path helpers delegate through this method. + # + # === With the asset pipeline + # + # All options passed to +asset_path+ will be passed to +compute_asset_path+ + # which is implemented by asset pipeline gems. + # + # asset_path("application.js") # => "/assets/application-60aa4fdc5cea14baf5400fba1abf4f2a46a5166bad4772b1effe341570f07de9.js" + # asset_path('application.js', host: 'example.com') # => "//example.com/assets/application.js" + # asset_path("application.js", host: 'example.com', protocol: 'https') # => "https://example.com/assets/application.js" + # + # === Without the asset pipeline (skip_pipeline: true) + # + # Accepts a type option that can specify the asset's extension. No error + # checking is done to verify the source passed into +asset_path+ is valid + # and that the file exists on disk. + # + # asset_path("application.js", skip_pipeline: true) # => "application.js" + # asset_path("filedoesnotexist.png", skip_pipeline: true) # => "filedoesnotexist.png" + # asset_path("application", type: :javascript, skip_pipeline: true) # => "/javascripts/application.js" + # asset_path("application", type: :stylesheet, skip_pipeline: true) # => "/stylesheets/application.css" + # + # === Options applying to all assets + # + # Below lists scenarios that apply to +asset_path+ whether or not you're + # using the asset pipeline. + # + # - All fully qualified URLs are returned immediately. This bypasses the + # asset pipeline and all other behavior described. + # + # asset_path("http://www.example.com/js/xmlhr.js") # => "http://www.example.com/js/xmlhr.js" + # + # - All assets that begin with a forward slash are assumed to be full + # URLs and will not be expanded. This will bypass the asset pipeline. + # + # asset_path("/foo.png") # => "/foo.png" + # + # - All blank strings will be returned immediately. This bypasses the + # asset pipeline and all other behavior described. + # + # asset_path("") # => "" + # + # - If config.relative_url_root is specified, all assets will have that + # root prepended. + # + # Rails.application.config.relative_url_root = "bar" + # asset_path("foo.js", skip_pipeline: true) # => "bar/foo.js" + # + # - A different asset host can be specified via config.action_controller.asset_host + # this is commonly used in conjunction with a CDN. + # + # Rails.application.config.action_controller.asset_host = "assets.example.com" + # asset_path("foo.js", skip_pipeline: true) # => "http://assets.example.com/foo.js" + # + # - An extension name can be specified manually with extname. + # + # asset_path("foo", skip_pipeline: true, extname: ".js") # => "/foo.js" + # asset_path("foo.css", skip_pipeline: true, extname: ".js") # => "/foo.css.js" + # + # @raise [ArgumentError] + # + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#187 + def asset_path(source, options = T.unsafe(nil)); end + + # Computes the full URL to an asset in the public directory. This + # will use +asset_path+ internally, so most of their behaviors + # will be the same. If +:host+ options is set, it overwrites global + # +config.action_controller.asset_host+ setting. + # + # All other options provided are forwarded to +asset_path+ call. + # + # asset_url "application.js" # => http://example.com/assets/application.js + # asset_url "application.js", host: "http://cdn.example.com" # => http://cdn.example.com/assets/application.js + # + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#231 + def asset_url(source, options = T.unsafe(nil)); end + + # Computes the path to an audio asset in the public audios directory. + # Full paths from the document root will be passed through. + # Used internally by +audio_tag+ to build the audio path. + # + # audio_path("horse") # => /audios/horse + # audio_path("horse.wav") # => /audios/horse.wav + # audio_path("sounds/horse.wav") # => /audios/sounds/horse.wav + # audio_path("/sounds/horse.wav") # => /sounds/horse.wav + # audio_path("http://www.example.com/sounds/horse.wav") # => http://www.example.com/sounds/horse.wav + # + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#430 + def audio_path(source, options = T.unsafe(nil)); end + + # Computes the full URL to an audio asset in the public audios directory. + # This will use +audio_path+ internally, so most of their behaviors will be the same. + # Since +audio_url+ is based on +asset_url+ method you can set +:host+ options. If +:host+ + # options is set, it overwrites global +config.action_controller.asset_host+ setting. + # + # audio_url "horse.wav", host: "http://stage.example.com" # => http://stage.example.com/audios/horse.wav + # + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#442 + def audio_url(source, options = T.unsafe(nil)); end + + # Compute extname to append to asset path. Returns +nil+ if + # nothing should be added. + # + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#243 + def compute_asset_extname(source, options = T.unsafe(nil)); end + + # Pick an asset host for this source. Returns +nil+ if no host is set, + # the host if no wildcard is set, the host interpolated with the + # numbers 0-3 if it contains %d (the number is the source hash mod 4), + # or the value returned from invoking call on an object responding to call + # (proc or otherwise). + # + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#277 + def compute_asset_host(source = T.unsafe(nil), options = T.unsafe(nil)); end + + # Computes asset path to public directory. Plugins and + # extensions can override this method to point to custom assets + # or generate digested paths or query strings. + # + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#266 + def compute_asset_path(source, options = T.unsafe(nil)); end + + # Computes the path to a font asset. + # Full paths from the document root will be passed through. + # + # font_path("font") # => /fonts/font + # font_path("font.ttf") # => /fonts/font.ttf + # font_path("dir/font.ttf") # => /fonts/dir/font.ttf + # font_path("/dir/font.ttf") # => /dir/font.ttf + # font_path("http://www.example.com/dir/font.ttf") # => http://www.example.com/dir/font.ttf + # + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#455 + def font_path(source, options = T.unsafe(nil)); end + + # Computes the full URL to a font asset. + # This will use +font_path+ internally, so most of their behaviors will be the same. + # Since +font_url+ is based on +asset_url+ method you can set +:host+ options. If +:host+ + # options is set, it overwrites global +config.action_controller.asset_host+ setting. + # + # font_url "font.ttf", host: "http://stage.example.com" # => http://stage.example.com/fonts/font.ttf + # + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#467 + def font_url(source, options = T.unsafe(nil)); end + + # Computes the path to an image asset. + # Full paths from the document root will be passed through. + # Used internally by +image_tag+ to build the image path: + # + # image_path("edit") # => "/assets/edit" + # image_path("edit.png") # => "/assets/edit.png" + # image_path("icons/edit.png") # => "/assets/icons/edit.png" + # image_path("/icons/edit.png") # => "/icons/edit.png" + # image_path("http://www.example.com/img/edit.png") # => "http://www.example.com/img/edit.png" + # + # If you have images as application resources this method may conflict with their named routes. + # The alias +path_to_image+ is provided to avoid that. \Rails uses the alias internally, and + # plugin authors are encouraged to do so. + # + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#378 + def image_path(source, options = T.unsafe(nil)); end + + # Computes the full URL to an image asset. + # This will use +image_path+ internally, so most of their behaviors will be the same. + # Since +image_url+ is based on +asset_url+ method you can set +:host+ options. If +:host+ + # options is set, it overwrites global +config.action_controller.asset_host+ setting. + # + # image_url "edit.png", host: "http://stage.example.com" # => http://stage.example.com/assets/edit.png + # + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#390 + def image_url(source, options = T.unsafe(nil)); end + + # Computes the path to a JavaScript asset in the public javascripts directory. + # If the +source+ filename has no extension, .js will be appended (except for explicit URIs) + # Full paths from the document root will be passed through. + # Used internally by +javascript_include_tag+ to build the script path. + # + # javascript_path "xmlhr" # => /assets/xmlhr.js + # javascript_path "dir/xmlhr.js" # => /assets/dir/xmlhr.js + # javascript_path "/dir/xmlhr" # => /dir/xmlhr.js + # javascript_path "http://www.example.com/js/xmlhr" # => http://www.example.com/js/xmlhr + # javascript_path "http://www.example.com/js/xmlhr.js" # => http://www.example.com/js/xmlhr.js + # + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#321 + def javascript_path(source, options = T.unsafe(nil)); end + + # Computes the full URL to a JavaScript asset in the public javascripts directory. + # This will use +javascript_path+ internally, so most of their behaviors will be the same. + # Since +javascript_url+ is based on +asset_url+ method you can set +:host+ options. If +:host+ + # options is set, it overwrites global +config.action_controller.asset_host+ setting. + # + # javascript_url "js/xmlhr.js", host: "http://stage.example.com" # => http://stage.example.com/assets/js/xmlhr.js + # + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#333 + def javascript_url(source, options = T.unsafe(nil)); end + + # This is the entry point for all assets. + # When using an asset pipeline gem (e.g. propshaft or sprockets-rails), the + # behavior is "enhanced". You can bypass the asset pipeline by passing in + # skip_pipeline: true to the options. + # + # All other asset *_path helpers delegate through this method. + # + # === With the asset pipeline + # + # All options passed to +asset_path+ will be passed to +compute_asset_path+ + # which is implemented by asset pipeline gems. + # + # asset_path("application.js") # => "/assets/application-60aa4fdc5cea14baf5400fba1abf4f2a46a5166bad4772b1effe341570f07de9.js" + # asset_path('application.js', host: 'example.com') # => "//example.com/assets/application.js" + # asset_path("application.js", host: 'example.com', protocol: 'https') # => "https://example.com/assets/application.js" + # + # === Without the asset pipeline (skip_pipeline: true) + # + # Accepts a type option that can specify the asset's extension. No error + # checking is done to verify the source passed into +asset_path+ is valid + # and that the file exists on disk. + # + # asset_path("application.js", skip_pipeline: true) # => "application.js" + # asset_path("filedoesnotexist.png", skip_pipeline: true) # => "filedoesnotexist.png" + # asset_path("application", type: :javascript, skip_pipeline: true) # => "/javascripts/application.js" + # asset_path("application", type: :stylesheet, skip_pipeline: true) # => "/stylesheets/application.css" + # + # === Options applying to all assets + # + # Below lists scenarios that apply to +asset_path+ whether or not you're + # using the asset pipeline. + # + # - All fully qualified URLs are returned immediately. This bypasses the + # asset pipeline and all other behavior described. + # + # asset_path("http://www.example.com/js/xmlhr.js") # => "http://www.example.com/js/xmlhr.js" + # + # - All assets that begin with a forward slash are assumed to be full + # URLs and will not be expanded. This will bypass the asset pipeline. + # + # asset_path("/foo.png") # => "/foo.png" + # + # - All blank strings will be returned immediately. This bypasses the + # asset pipeline and all other behavior described. + # + # asset_path("") # => "" + # + # - If config.relative_url_root is specified, all assets will have that + # root prepended. + # + # Rails.application.config.relative_url_root = "bar" + # asset_path("foo.js", skip_pipeline: true) # => "bar/foo.js" + # + # - A different asset host can be specified via config.action_controller.asset_host + # this is commonly used in conjunction with a CDN. + # + # Rails.application.config.action_controller.asset_host = "assets.example.com" + # asset_path("foo.js", skip_pipeline: true) # => "http://assets.example.com/foo.js" + # + # - An extension name can be specified manually with extname. + # + # asset_path("foo", skip_pipeline: true, extname: ".js") # => "/foo.js" + # asset_path("foo.css", skip_pipeline: true, extname: ".js") # => "/foo.css.js" + # aliased to avoid conflicts with an asset_path named route + # + # @raise [ArgumentError] + # + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#219 + def path_to_asset(source, options = T.unsafe(nil)); end + + # Computes the path to an audio asset in the public audios directory. + # Full paths from the document root will be passed through. + # Used internally by +audio_tag+ to build the audio path. + # + # audio_path("horse") # => /audios/horse + # audio_path("horse.wav") # => /audios/horse.wav + # audio_path("sounds/horse.wav") # => /audios/sounds/horse.wav + # audio_path("/sounds/horse.wav") # => /sounds/horse.wav + # audio_path("http://www.example.com/sounds/horse.wav") # => http://www.example.com/sounds/horse.wav + # aliased to avoid conflicts with an audio_path named route + # + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#433 + def path_to_audio(source, options = T.unsafe(nil)); end + + # Computes the path to a font asset. + # Full paths from the document root will be passed through. + # + # font_path("font") # => /fonts/font + # font_path("font.ttf") # => /fonts/font.ttf + # font_path("dir/font.ttf") # => /fonts/dir/font.ttf + # font_path("/dir/font.ttf") # => /dir/font.ttf + # font_path("http://www.example.com/dir/font.ttf") # => http://www.example.com/dir/font.ttf + # aliased to avoid conflicts with a font_path named route + # + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#458 + def path_to_font(source, options = T.unsafe(nil)); end + + # Computes the path to an image asset. + # Full paths from the document root will be passed through. + # Used internally by +image_tag+ to build the image path: + # + # image_path("edit") # => "/assets/edit" + # image_path("edit.png") # => "/assets/edit.png" + # image_path("icons/edit.png") # => "/assets/icons/edit.png" + # image_path("/icons/edit.png") # => "/icons/edit.png" + # image_path("http://www.example.com/img/edit.png") # => "http://www.example.com/img/edit.png" + # + # If you have images as application resources this method may conflict with their named routes. + # The alias +path_to_image+ is provided to avoid that. \Rails uses the alias internally, and + # plugin authors are encouraged to do so. + # aliased to avoid conflicts with an image_path named route + # + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#381 + def path_to_image(source, options = T.unsafe(nil)); end + + # Computes the path to a JavaScript asset in the public javascripts directory. + # If the +source+ filename has no extension, .js will be appended (except for explicit URIs) + # Full paths from the document root will be passed through. + # Used internally by +javascript_include_tag+ to build the script path. + # + # javascript_path "xmlhr" # => /assets/xmlhr.js + # javascript_path "dir/xmlhr.js" # => /assets/dir/xmlhr.js + # javascript_path "/dir/xmlhr" # => /dir/xmlhr.js + # javascript_path "http://www.example.com/js/xmlhr" # => http://www.example.com/js/xmlhr + # javascript_path "http://www.example.com/js/xmlhr.js" # => http://www.example.com/js/xmlhr.js + # aliased to avoid conflicts with a javascript_path named route + # + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#324 + def path_to_javascript(source, options = T.unsafe(nil)); end + + # Computes the path to a stylesheet asset in the public stylesheets directory. + # If the +source+ filename has no extension, .css will be appended (except for explicit URIs). + # Full paths from the document root will be passed through. + # Used internally by +stylesheet_link_tag+ to build the stylesheet path. + # + # stylesheet_path "style" # => /assets/style.css + # stylesheet_path "dir/style.css" # => /assets/dir/style.css + # stylesheet_path "/dir/style.css" # => /dir/style.css + # stylesheet_path "http://www.example.com/css/style" # => http://www.example.com/css/style + # stylesheet_path "http://www.example.com/css/style.css" # => http://www.example.com/css/style.css + # aliased to avoid conflicts with a stylesheet_path named route + # + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#351 + def path_to_stylesheet(source, options = T.unsafe(nil)); end + + # Computes the path to a video asset in the public videos directory. + # Full paths from the document root will be passed through. + # Used internally by +video_tag+ to build the video path. + # + # video_path("hd") # => /videos/hd + # video_path("hd.avi") # => /videos/hd.avi + # video_path("trailers/hd.avi") # => /videos/trailers/hd.avi + # video_path("/trailers/hd.avi") # => /trailers/hd.avi + # video_path("http://www.example.com/vid/hd.avi") # => http://www.example.com/vid/hd.avi + # aliased to avoid conflicts with a video_path named route + # + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#407 + def path_to_video(source, options = T.unsafe(nil)); end + + # Computes asset path to public directory. Plugins and + # extensions can override this method to point to custom assets + # or generate digested paths or query strings. + # + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#270 + def public_compute_asset_path(source, options = T.unsafe(nil)); end + + # Computes the path to a stylesheet asset in the public stylesheets directory. + # If the +source+ filename has no extension, .css will be appended (except for explicit URIs). + # Full paths from the document root will be passed through. + # Used internally by +stylesheet_link_tag+ to build the stylesheet path. + # + # stylesheet_path "style" # => /assets/style.css + # stylesheet_path "dir/style.css" # => /assets/dir/style.css + # stylesheet_path "/dir/style.css" # => /dir/style.css + # stylesheet_path "http://www.example.com/css/style" # => http://www.example.com/css/style + # stylesheet_path "http://www.example.com/css/style.css" # => http://www.example.com/css/style.css + # + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#348 + def stylesheet_path(source, options = T.unsafe(nil)); end + + # Computes the full URL to a stylesheet asset in the public stylesheets directory. + # This will use +stylesheet_path+ internally, so most of their behaviors will be the same. + # Since +stylesheet_url+ is based on +asset_url+ method you can set +:host+ options. If +:host+ + # options is set, it overwrites global +config.action_controller.asset_host+ setting. + # + # stylesheet_url "css/style.css", host: "http://stage.example.com" # => http://stage.example.com/assets/css/style.css + # + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#360 + def stylesheet_url(source, options = T.unsafe(nil)); end + + # Computes the full URL to an asset in the public directory. This + # will use +asset_path+ internally, so most of their behaviors + # will be the same. If +:host+ options is set, it overwrites global + # +config.action_controller.asset_host+ setting. + # + # All other options provided are forwarded to +asset_path+ call. + # + # asset_url "application.js" # => http://example.com/assets/application.js + # asset_url "application.js", host: "http://cdn.example.com" # => http://cdn.example.com/assets/application.js + # aliased to avoid conflicts with an asset_url named route + # + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#234 + def url_to_asset(source, options = T.unsafe(nil)); end + + # Computes the full URL to an audio asset in the public audios directory. + # This will use +audio_path+ internally, so most of their behaviors will be the same. + # Since +audio_url+ is based on +asset_url+ method you can set +:host+ options. If +:host+ + # options is set, it overwrites global +config.action_controller.asset_host+ setting. + # + # audio_url "horse.wav", host: "http://stage.example.com" # => http://stage.example.com/audios/horse.wav + # aliased to avoid conflicts with an audio_url named route + # + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#445 + def url_to_audio(source, options = T.unsafe(nil)); end + + # Computes the full URL to a font asset. + # This will use +font_path+ internally, so most of their behaviors will be the same. + # Since +font_url+ is based on +asset_url+ method you can set +:host+ options. If +:host+ + # options is set, it overwrites global +config.action_controller.asset_host+ setting. + # + # font_url "font.ttf", host: "http://stage.example.com" # => http://stage.example.com/fonts/font.ttf + # aliased to avoid conflicts with a font_url named route + # + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#470 + def url_to_font(source, options = T.unsafe(nil)); end + + # Computes the full URL to an image asset. + # This will use +image_path+ internally, so most of their behaviors will be the same. + # Since +image_url+ is based on +asset_url+ method you can set +:host+ options. If +:host+ + # options is set, it overwrites global +config.action_controller.asset_host+ setting. + # + # image_url "edit.png", host: "http://stage.example.com" # => http://stage.example.com/assets/edit.png + # aliased to avoid conflicts with an image_url named route + # + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#393 + def url_to_image(source, options = T.unsafe(nil)); end + + # Computes the full URL to a JavaScript asset in the public javascripts directory. + # This will use +javascript_path+ internally, so most of their behaviors will be the same. + # Since +javascript_url+ is based on +asset_url+ method you can set +:host+ options. If +:host+ + # options is set, it overwrites global +config.action_controller.asset_host+ setting. + # + # javascript_url "js/xmlhr.js", host: "http://stage.example.com" # => http://stage.example.com/assets/js/xmlhr.js + # aliased to avoid conflicts with a javascript_url named route + # + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#336 + def url_to_javascript(source, options = T.unsafe(nil)); end + + # Computes the full URL to a stylesheet asset in the public stylesheets directory. + # This will use +stylesheet_path+ internally, so most of their behaviors will be the same. + # Since +stylesheet_url+ is based on +asset_url+ method you can set +:host+ options. If +:host+ + # options is set, it overwrites global +config.action_controller.asset_host+ setting. + # + # stylesheet_url "css/style.css", host: "http://stage.example.com" # => http://stage.example.com/assets/css/style.css + # aliased to avoid conflicts with a stylesheet_url named route + # + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#363 + def url_to_stylesheet(source, options = T.unsafe(nil)); end + + # Computes the full URL to a video asset in the public videos directory. + # This will use +video_path+ internally, so most of their behaviors will be the same. + # Since +video_url+ is based on +asset_url+ method you can set +:host+ options. If +:host+ + # options is set, it overwrites global +config.action_controller.asset_host+ setting. + # + # video_url "hd.avi", host: "http://stage.example.com" # => http://stage.example.com/videos/hd.avi + # aliased to avoid conflicts with a video_url named route + # + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#419 + def url_to_video(source, options = T.unsafe(nil)); end + + # Computes the path to a video asset in the public videos directory. + # Full paths from the document root will be passed through. + # Used internally by +video_tag+ to build the video path. + # + # video_path("hd") # => /videos/hd + # video_path("hd.avi") # => /videos/hd.avi + # video_path("trailers/hd.avi") # => /videos/trailers/hd.avi + # video_path("/trailers/hd.avi") # => /trailers/hd.avi + # video_path("http://www.example.com/vid/hd.avi") # => http://www.example.com/vid/hd.avi + # + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#404 + def video_path(source, options = T.unsafe(nil)); end + + # Computes the full URL to a video asset in the public videos directory. + # This will use +video_path+ internally, so most of their behaviors will be the same. + # Since +video_url+ is based on +asset_url+ method you can set +:host+ options. If +:host+ + # options is set, it overwrites global +config.action_controller.asset_host+ setting. + # + # video_url "hd.avi", host: "http://stage.example.com" # => http://stage.example.com/videos/hd.avi + # + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#416 + def video_url(source, options = T.unsafe(nil)); end +end + +# source://actionview//lib/action_view/helpers/asset_url_helper.rb#236 +ActionView::Helpers::AssetUrlHelper::ASSET_EXTENSIONS = T.let(T.unsafe(nil), Hash) + +# Maps asset types to public directory. +# +# source://actionview//lib/action_view/helpers/asset_url_helper.rb#254 +ActionView::Helpers::AssetUrlHelper::ASSET_PUBLIC_DIRECTORIES = T.let(T.unsafe(nil), Hash) + +# source://actionview//lib/action_view/helpers/asset_url_helper.rb#122 +ActionView::Helpers::AssetUrlHelper::URI_REGEXP = T.let(T.unsafe(nil), Regexp) + +# = Action View Atom Feed \Helpers +# +# source://actionview//lib/action_view/helpers/atom_feed_helper.rb#6 +module ActionView::Helpers::AtomFeedHelper + # Adds easy defaults to writing Atom feeds with the Builder template engine (this does not work on ERB or any other + # template languages). + # + # Full usage example: + # + # config/routes.rb: + # Rails.application.routes.draw do + # resources :posts + # root to: "posts#index" + # end + # + # app/controllers/posts_controller.rb: + # class PostsController < ApplicationController + # # GET /posts.html + # # GET /posts.atom + # def index + # @posts = Post.all + # + # respond_to do |format| + # format.html + # format.atom + # end + # end + # end + # + # app/views/posts/index.atom.builder: + # atom_feed do |feed| + # feed.title("My great blog!") + # feed.updated(@posts[0].created_at) if @posts.length > 0 + # + # @posts.each do |post| + # feed.entry(post) do |entry| + # entry.title(post.title) + # entry.content(post.body, type: 'html') + # + # entry.author do |author| + # author.name("DHH") + # end + # end + # end + # end + # + # The options for atom_feed are: + # + # * :language: Defaults to "en-US". + # * :root_url: The HTML alternative that this feed is doubling for. Defaults to / on the current host. + # * :url: The URL for this feed. Defaults to the current URL. + # * :id: The id for this feed. Defaults to "tag:localhost,2005:/posts", in this case. + # * :schema_date: The date at which the tag scheme for the feed was first used. A good default is the year you + # created the feed. See http://feedvalidator.org/docs/error/InvalidTAG.html for more information. If not specified, + # 2005 is used (as an "I don't care" value). + # * :instruct: Hash of XML processing instructions in the form {target => {attribute => value, }} or {target => [{attribute => value, }, ]} + # + # Other namespaces can be added to the root element: + # + # app/views/posts/index.atom.builder: + # atom_feed({'xmlns:app' => 'http://www.w3.org/2007/app', + # 'xmlns:openSearch' => 'http://a9.com/-/spec/opensearch/1.1/'}) do |feed| + # feed.title("My great blog!") + # feed.updated((@posts.first.created_at)) + # feed.tag!('openSearch:totalResults', 10) + # + # @posts.each do |post| + # feed.entry(post) do |entry| + # entry.title(post.title) + # entry.content(post.body, type: 'html') + # entry.tag!('app:edited', Time.now) + # + # entry.author do |author| + # author.name("DHH") + # end + # end + # end + # end + # + # The Atom spec defines five elements (content rights title subtitle + # summary) which may directly contain XHTML content if type: 'xhtml' + # is specified as an attribute. If so, this helper will take care of + # the enclosing div and XHTML namespace declaration. Example usage: + # + # entry.summary type: 'xhtml' do |xhtml| + # xhtml.p pluralize(order.line_items.count, "line item") + # xhtml.p "Shipped to #{order.address}" + # xhtml.p "Paid by #{order.pay_type}" + # end + # + # + # atom_feed yields an +AtomFeedBuilder+ instance. Nested elements yield + # an +AtomBuilder+ instance. + # + # source://actionview//lib/action_view/helpers/atom_feed_helper.rb#96 + def atom_feed(options = T.unsafe(nil), &block); end +end + +# source://actionview//lib/action_view/helpers/atom_feed_helper.rb#127 +class ActionView::Helpers::AtomFeedHelper::AtomBuilder + # @return [AtomBuilder] a new instance of AtomBuilder + # + # source://actionview//lib/action_view/helpers/atom_feed_helper.rb#130 + def initialize(xml); end + + private + + # Delegate to XML Builder, first wrapping the element in an XHTML + # namespaced div element if the method and arguments indicate + # that an xhtml_block? is desired. + # + # source://actionview//lib/action_view/helpers/atom_feed_helper.rb#138 + def method_missing(method, *arguments, &block); end + + # True if the method name matches one of the five elements defined + # in the Atom spec as potentially containing XHTML content and + # if type: 'xhtml' is, in fact, specified. + # + # @return [Boolean] + # + # source://actionview//lib/action_view/helpers/atom_feed_helper.rb#153 + def xhtml_block?(method, arguments); end +end + +# source://actionview//lib/action_view/helpers/atom_feed_helper.rb#128 +ActionView::Helpers::AtomFeedHelper::AtomBuilder::XHTML_TAG_NAMES = T.let(T.unsafe(nil), Set) + +# source://actionview//lib/action_view/helpers/atom_feed_helper.rb#161 +class ActionView::Helpers::AtomFeedHelper::AtomFeedBuilder < ::ActionView::Helpers::AtomFeedHelper::AtomBuilder + # @return [AtomFeedBuilder] a new instance of AtomFeedBuilder + # + # source://actionview//lib/action_view/helpers/atom_feed_helper.rb#162 + def initialize(xml, view, feed_options = T.unsafe(nil)); end + + # Creates an entry tag for a specific record and prefills the id using class and id. + # + # ==== Options + # + # * :published: Time first published. Defaults to the created_at attribute on the record if one such exists. + # * :updated: Time of update. Defaults to the updated_at attribute on the record if one such exists. + # * :url: The URL for this entry or +false+ or +nil+ for not having a link tag. Defaults to the +polymorphic_url+ for the record. + # * :id: The ID for this entry. Defaults to "tag:#{@view.request.host},#{@feed_options[:schema_date]}:#{record.class}/#{record.id}" + # * :type: The TYPE for this entry. Defaults to "text/html". + # + # source://actionview//lib/action_view/helpers/atom_feed_helper.rb#180 + def entry(record, options = T.unsafe(nil)); end + + # Accepts a Date or Time object and inserts it in the proper format. If +nil+ is passed, current time in UTC is used. + # + # source://actionview//lib/action_view/helpers/atom_feed_helper.rb#167 + def updated(date_or_time = T.unsafe(nil)); end +end + +# = Action View Cache \Helpers +# +# source://actionview//lib/action_view/helpers/cache_helper.rb#6 +module ActionView::Helpers::CacheHelper + # This helper exposes a method for caching fragments of a view + # rather than an entire action or page. This technique is useful + # caching pieces like menus, lists of new topics, static HTML + # fragments, and so on. This method takes a block that contains + # the content you wish to cache. + # + # The best way to use this is by doing recyclable key-based cache expiration + # on top of a cache store like Memcached or Redis that'll automatically + # kick out old entries. + # + # When using this method, you list the cache dependency as the name of the cache, like so: + # + # <% cache project do %> + # All the topics on this project + # <%= render project.topics %> + # <% end %> + # + # This approach will assume that when a new topic is added, you'll touch + # the project. The cache key generated from this call will be something like: + # + # views/template/action:7a1156131a6928cb0026877f8b749ac9/projects/123 + # ^template path ^template tree digest ^class ^id + # + # This cache key is stable, but it's combined with a cache version derived from the project + # record. When the project updated_at is touched, the #cache_version changes, even + # if the key stays stable. This means that unlike a traditional key-based cache expiration + # approach, you won't be generating cache trash, unused keys, simply because the dependent + # record is updated. + # + # If your template cache depends on multiple sources (try to avoid this to keep things simple), + # you can name all these dependencies as part of an array: + # + # <% cache [ project, current_user ] do %> + # All the topics on this project + # <%= render project.topics %> + # <% end %> + # + # This will include both records as part of the cache key and updating either of them will + # expire the cache. + # + # ==== \Template digest + # + # The template digest that's added to the cache key is computed by taking an MD5 of the + # contents of the entire template file. This ensures that your caches will automatically + # expire when you change the template file. + # + # Note that the MD5 is taken of the entire template file, not just what's within the + # cache do/end call. So it's possible that changing something outside of that call will + # still expire the cache. + # + # Additionally, the digestor will automatically look through your template file for + # explicit and implicit dependencies, and include those as part of the digest. + # + # The digestor can be bypassed by passing skip_digest: true as an option to the cache call: + # + # <% cache project, skip_digest: true do %> + # All the topics on this project + # <%= render project.topics %> + # <% end %> + # + # ==== Implicit dependencies + # + # Most template dependencies can be derived from calls to render in the template itself. + # Here are some examples of render calls that Cache Digests knows how to decode: + # + # render partial: "comments/comment", collection: commentable.comments + # render "comments/comments" + # render 'comments/comments' + # render('comments/comments') + # + # render "header" # translates to render("comments/header") + # + # render(@topic) # translates to render("topics/topic") + # render(topics) # translates to render("topics/topic") + # render(message.topics) # translates to render("topics/topic") + # + # It's not possible to derive all render calls like that, though. + # Here are a few examples of things that can't be derived: + # + # render group_of_attachments + # render @project.documents.where(published: true).order('created_at') + # + # You will have to rewrite those to the explicit form: + # + # render partial: 'attachments/attachment', collection: group_of_attachments + # render partial: 'documents/document', collection: @project.documents.where(published: true).order('created_at') + # + # One last type of dependency can be determined implicitly: + # + # render "maintenance_tasks/runs/info/#{run.status}" + # + # Because the value passed to render ends in interpolation, Action View + # will mark all partials within the "maintenance_tasks/runs/info" folder as + # dependencies. + # + # === Explicit dependencies + # + # Sometimes you'll have template dependencies that can't be derived at all. This is typically + # the case when you have template rendering that happens in helpers. Here's an example: + # + # <%= render_sortable_todolists @project.todolists %> + # + # You'll need to use a special comment format to call those out: + # + # <%# Template Dependency: todolists/todolist %> + # <%= render_sortable_todolists @project.todolists %> + # + # In some cases, like a single table inheritance setup, you might have + # a bunch of explicit dependencies. Instead of writing every template out, + # you can use a wildcard to match any template in a directory: + # + # <%# Template Dependency: events/* %> + # <%= render_categorizable_events @person.events %> + # + # This marks every template in the directory as a dependency. To find those + # templates, the wildcard path must be absolutely defined from app/views or paths + # otherwise added with +prepend_view_path+ or +append_view_path+. + # This way the wildcard for app/views/recordings/events would be recordings/events/* etc. + # + # The pattern used to match explicit dependencies is /# Template Dependency: (\S+)/, + # so it's important that you type it out just so. + # You can only declare one template dependency per line. + # + # === External dependencies + # + # If you use a helper method, for example, inside a cached block and + # you then update that helper, you'll have to bump the cache as well. + # It doesn't really matter how you do it, but the MD5 of the template file + # must change. One recommendation is to simply be explicit in a comment, like: + # + # <%# Helper Dependency Updated: May 6, 2012 at 6pm %> + # <%= some_helper_method(person) %> + # + # Now all you have to do is change that timestamp when the helper method changes. + # + # === Collection Caching + # + # When rendering a collection of objects that each use the same partial, a :cached + # option can be passed. + # + # For collections rendered such: + # + # <%= render partial: 'projects/project', collection: @projects, cached: true %> + # + # The cached: true will make Action View's rendering read several templates + # from cache at once instead of one call per template. + # + # Templates in the collection not already cached are written to cache. + # + # Works great alongside individual template fragment caching. + # For instance if the template the collection renders is cached like: + # + # # projects/_project.html.erb + # <% cache project do %> + # <%# ... %> + # <% end %> + # + # Any collection renders will find those cached templates when attempting + # to read multiple templates at once. + # + # If your collection cache depends on multiple sources (try to avoid this to keep things simple), + # you can name all these dependencies as part of a block that returns an array: + # + # <%= render partial: 'projects/project', collection: @projects, cached: -> project { [ project, current_user ] } %> + # + # This will include both records as part of the cache key and updating either of them will + # expire the cache. + # + # source://actionview//lib/action_view/helpers/cache_helper.rb#176 + def cache(name = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # This helper returns the name of a cache key for a given fragment cache + # call. By supplying skip_digest: true to cache, the digestion of cache + # fragments can be manually bypassed. This is useful when cache fragments + # cannot be manually expired unless you know the exact key which is the + # case when using memcached. + # + # source://actionview//lib/action_view/helpers/cache_helper.rb#248 + def cache_fragment_name(name = T.unsafe(nil), skip_digest: T.unsafe(nil), digest_path: T.unsafe(nil)); end + + # Cache fragments of a view if +condition+ is true + # + # <% cache_if admin?, project do %> + # All the topics on this project + # <%= render project.topics %> + # <% end %> + # + # source://actionview//lib/action_view/helpers/cache_helper.rb#223 + def cache_if(condition, name = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # Cache fragments of a view unless +condition+ is true + # + # <% cache_unless admin?, project do %> + # All the topics on this project + # <%= render project.topics %> + # <% end %> + # + # source://actionview//lib/action_view/helpers/cache_helper.rb#239 + def cache_unless(condition, name = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # Returns whether the current view fragment is within a +cache+ block. + # + # Useful when certain fragments aren't cacheable: + # + # <% cache project do %> + # <% raise StandardError, "Caching private data!" if caching? %> + # <% end %> + # + # @return [Boolean] + # + # source://actionview//lib/action_view/helpers/cache_helper.rb#196 + def caching?; end + + # source://actionview//lib/action_view/helpers/cache_helper.rb#256 + def digest_path_from_template(template); end + + # Raises UncacheableFragmentError when called from within a +cache+ block. + # + # Useful to denote helper methods that can't participate in fragment caching: + # + # def project_name_with_time(project) + # uncacheable! + # "#{project.name} - #{Time.now}" + # end + # + # # Which will then raise if used within a `cache` block: + # <% cache project do %> + # <%= project_name_with_time(project) %> + # <% end %> + # + # @raise [UncacheableFragmentError] + # + # source://actionview//lib/action_view/helpers/cache_helper.rb#213 + def uncacheable!; end + + private + + # source://actionview//lib/action_view/helpers/cache_helper.rb#278 + def fragment_for(name = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # source://actionview//lib/action_view/helpers/cache_helper.rb#267 + def fragment_name_with_digest(name, digest_path); end + + # source://actionview//lib/action_view/helpers/cache_helper.rb#288 + def read_fragment_for(name, options); end + + # source://actionview//lib/action_view/helpers/cache_helper.rb#292 + def write_fragment_for(name, options, &block); end +end + +# source://actionview//lib/action_view/helpers/cache_helper.rb#297 +module ActionView::Helpers::CacheHelper::CachingRegistry + extend ::ActionView::Helpers::CacheHelper::CachingRegistry + + # @return [Boolean] + # + # source://actionview//lib/action_view/helpers/cache_helper.rb#300 + def caching?; end + + # source://actionview//lib/action_view/helpers/cache_helper.rb#304 + def track_caching; end +end + +# source://actionview//lib/action_view/helpers/cache_helper.rb#7 +class ActionView::Helpers::CacheHelper::UncacheableFragmentError < ::StandardError; end + +# = Action View Capture \Helpers +# +# \CaptureHelper exposes methods to let you extract generated markup which +# can be used in other parts of a template or layout file. +# +# It provides a method to capture blocks into variables through #capture and +# a way to capture a block of markup for use in a layout through #content_for. +# +# As well as provides a method when using streaming responses through #provide. +# See ActionController::Streaming for more information. +# +# source://actionview//lib/action_view/helpers/capture_helper.rb#17 +module ActionView::Helpers::CaptureHelper + # The capture method extracts part of a template as a string object. + # You can then use this object anywhere in your templates, layout, or helpers. + # + # The capture method can be used in \ERB templates... + # + # <% @greeting = capture do %> + # Welcome to my shiny new web page! The date and time is + # <%= Time.now %> + # <% end %> + # + # ...and Builder (RXML) templates. + # + # @timestamp = capture do + # "The current timestamp is #{Time.now}." + # end + # + # You can then use that variable anywhere else. For example: + # + # + # <%= @greeting %> + # + # <%= @greeting %> + # + # + # + # The return of capture is the string generated by the block. For Example: + # + # @greeting # => "Welcome to my shiny new web page! The date and time is 2018-09-06 11:09:16 -0500" + # + # source://actionview//lib/action_view/helpers/capture_helper.rb#47 + def capture(*_arg0, **_arg1, &block); end + + # Calling content_for stores a block of markup in an identifier for later use. + # In order to access this stored content in other templates, helper modules + # or the layout, you would pass the identifier as an argument to content_for. + # + # Note: yield can still be used to retrieve the stored content, but calling + # yield doesn't work in helper modules, while content_for does. + # + # <% content_for :not_authorized do %> + # alert('You are not authorized to do that!') + # <% end %> + # + # You can then use content_for :not_authorized anywhere in your templates. + # + # <%= content_for :not_authorized if current_user.nil? %> + # + # This is equivalent to: + # + # <%= yield :not_authorized if current_user.nil? %> + # + # content_for, however, can also be used in helper modules. + # + # module StorageHelper + # def stored_content + # content_for(:storage) || "Your storage is empty" + # end + # end + # + # This helper works just like normal helpers. + # + # <%= stored_content %> + # + # You can also use the yield syntax alongside an existing call to + # yield in a layout. For example: + # + # <%# This is the layout %> + # + # + # My Website + # <%= yield :script %> + # + # + # <%= yield %> + # + # + # + # And now, we'll create a view that has a content_for call that + # creates the script identifier. + # + # <%# This is our view %> + # Please login! + # + # <% content_for :script do %> + # + # <% end %> + # + # Then, in another view, you could to do something like this: + # + # <%= link_to 'Logout', action: 'logout', remote: true %> + # + # <% content_for :script do %> + # <%= javascript_include_tag :defaults %> + # <% end %> + # + # That will place +script+ tags for your default set of JavaScript files on the page; + # this technique is useful if you'll only be using these scripts in a few views. + # + # Note that content_for concatenates (default) the blocks it is given for a particular + # identifier in order. For example: + # + # <% content_for :navigation do %> + #
  • <%= link_to 'Home', action: 'index' %>
  • + # <% end %> + # + # And in another place: + # + # <% content_for :navigation do %> + #
  • <%= link_to 'Login', action: 'login' %>
  • + # <% end %> + # + # Then, in another template or layout, this code would render both links in order: + # + #
      <%= content_for :navigation %>
    + # + # If the flush parameter is +true+ content_for replaces the blocks it is given. For example: + # + # <% content_for :navigation do %> + #
  • <%= link_to 'Home', action: 'index' %>
  • + # <% end %> + # + # <%# Add some other content, or use a different template: %> + # + # <% content_for :navigation, flush: true do %> + #
  • <%= link_to 'Login', action: 'login' %>
  • + # <% end %> + # + # Then, in another template or layout, this code would render only the last link: + # + #
      <%= content_for :navigation %>
    + # + # Lastly, simple content can be passed as a parameter: + # + # <% content_for :script, javascript_include_tag(:defaults) %> + # + # WARNING: content_for is ignored in caches. So you shouldn't use it for elements that will be fragment cached. + # + # source://actionview//lib/action_view/helpers/capture_helper.rb#172 + def content_for(name, content = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # content_for? checks whether any content has been captured yet using content_for. + # + # Useful to render parts of your layout differently based on what is in your views. + # + # <%# This is the layout %> + # + # + # My Website + # <%= yield :script %> + # + # + # <%= yield %> + # <%= yield :right_col %> + # + # + # + # @return [Boolean] + # + # source://actionview//lib/action_view/helpers/capture_helper.rb#215 + def content_for?(name); end + + # The same as +content_for+ but when used with streaming flushes + # straight back to the layout. In other words, if you want to + # concatenate several times to the same buffer when rendering a given + # template, you should use +content_for+, if not, use +provide+ to tell + # the layout to stop looking for more contents. + # + # See ActionController::Streaming for more information. + # + # source://actionview//lib/action_view/helpers/capture_helper.rb#194 + def provide(name, content = T.unsafe(nil), &block); end + + # Use an alternate output buffer for the duration of the block. + # Defaults to a new empty string. + # + # source://actionview//lib/action_view/helpers/capture_helper.rb#221 + def with_output_buffer(buf = T.unsafe(nil)); end +end + +# source://actionview//lib/action_view/helpers/content_exfiltration_prevention_helper.rb#5 +module ActionView::Helpers::ContentExfiltrationPreventionHelper + # source://actionview//lib/action_view/helpers/content_exfiltration_prevention_helper.rb#6 + def prepend_content_exfiltration_prevention; end + + # source://actionview//lib/action_view/helpers/content_exfiltration_prevention_helper.rb#6 + def prepend_content_exfiltration_prevention=(val); end + + # source://actionview//lib/action_view/helpers/content_exfiltration_prevention_helper.rb#61 + def prevent_content_exfiltration(html); end + + class << self + # source://actionview//lib/action_view/helpers/content_exfiltration_prevention_helper.rb#6 + def prepend_content_exfiltration_prevention; end + + # source://actionview//lib/action_view/helpers/content_exfiltration_prevention_helper.rb#6 + def prepend_content_exfiltration_prevention=(val); end + end +end + +# Close any open tags that support CDATA (textarea, xmp) before each form tag. +# This prevents attackers from injecting unclosed tags that could capture +# form contents. +# +# For example, an attacker might inject: +# +#
    or +# the end of the document would be captured by the attacker's +# + # + # textarea(:comment, :text, size: "20x30") + # # => + # + # textarea(:application, :notes, cols: 40, rows: 15, class: 'app_input') + # # => + # + # textarea(:entry, :body, size: "20x20", disabled: 'disabled') + # # => + # + # source://actionview//lib/action_view/helpers/form_helper.rb#1280 + def text_area(object_name, method, options = T.unsafe(nil)); end + + # Returns an input tag of the "text" type tailored for accessing a specified attribute (identified by +method+) on an object + # assigned to the template (identified by +object+). Additional options on the input tag can be passed as a + # hash with +options+. These options will be tagged onto the HTML as an HTML element attribute as in the example + # shown. + # + # ==== Examples + # text_field(:article, :title, size: 20) + # # => + # + # text_field(:article, :title, class: "create_input") + # # => + # + # text_field(:article, :title, maxlength: 30, class: "title_input") + # # => + # + # text_field(:session, :user, onchange: "if ($('#session_user').val() === 'admin') { alert('Your login cannot be admin!'); }") + # # => + # + # text_field(:snippet, :code, size: 20, class: 'code_input') + # # => + # + # source://actionview//lib/action_view/helpers/form_helper.rb#1175 + def text_field(object_name, method, options = T.unsafe(nil)); end + + # Returns a textarea opening and closing tag set tailored for accessing a specified attribute (identified by +method+) + # on an object assigned to the template (identified by +object+). Additional options on the input tag can be passed as a + # hash with +options+. + # + # ==== Examples + # textarea(:article, :body, cols: 20, rows: 40) + # # => + # + # textarea(:comment, :text, size: "20x30") + # # => + # + # textarea(:application, :notes, cols: 40, rows: 15, class: 'app_input') + # # => + # + # textarea(:entry, :body, size: "20x20", disabled: 'disabled') + # # => + # + # source://actionview//lib/action_view/helpers/form_helper.rb#1277 + def textarea(object_name, method, options = T.unsafe(nil)); end + + # Returns a text_field of type "time". + # + # The default value is generated by trying to call +strftime+ with "%T.%L" + # on the object's value. If you pass include_seconds: false, it will be + # formatted by trying to call +strftime+ with "%H:%M" on the object's value. + # It is also possible to override this by passing the "value" option. + # + # ==== Options + # + # Supports the same options as FormTagHelper#time_field_tag. + # + # ==== Examples + # + # time_field("task", "started_at") + # # => + # + # You can create values for the "min" and "max" attributes by passing + # instances of Date or Time to the options hash. + # + # time_field("task", "started_at", min: Time.now) + # # => + # + # Alternatively, you can pass a String formatted as an ISO8601 time as the + # values for "min" and "max." + # + # time_field("task", "started_at", min: "01:00:00") + # # => + # + # By default, provided times will be formatted including seconds. You can render just the hour + # and minute by passing include_seconds: false. Some browsers will render a simpler UI + # if you exclude seconds in the timestamp format. + # + # time_field("task", "started_at", value: Time.now, include_seconds: false) + # # => + # + # source://actionview//lib/action_view/helpers/form_helper.rb#1479 + def time_field(object_name, method, options = T.unsafe(nil)); end + + # Returns a text_field of type "url". + # + # url_field("user", "homepage") + # # => + # + # source://actionview//lib/action_view/helpers/form_helper.rb#1559 + def url_field(object_name, method, options = T.unsafe(nil)); end + + # Returns a text_field of type "week". + # + # week_field("user", "born_on") + # # => + # + # The default value is generated by trying to call +strftime+ with "%Y-W%W" + # on the object's value, which makes it behave as expected for instances + # of DateTime and ActiveSupport::TimeWithZone. + # + # @user.born_on = Date.new(1984, 5, 12) + # week_field("user", "born_on") + # # => + # + # source://actionview//lib/action_view/helpers/form_helper.rb#1550 + def week_field(object_name, method, options = T.unsafe(nil)); end + + private + + # source://actionview//lib/action_view/helpers/form_helper.rb#465 + def apply_form_for_options!(object, options); end + + # source://actionview//lib/action_view/helpers/form_helper.rb#1624 + def default_form_builder_class; end + + # source://actionview//lib/action_view/helpers/form_helper.rb#1595 + def html_options_for_form_with(url_for_options = T.unsafe(nil), model = T.unsafe(nil), html: T.unsafe(nil), local: T.unsafe(nil), skip_enforcing_utf8: T.unsafe(nil), **options); end + + # source://actionview//lib/action_view/helpers/form_helper.rb#1610 + def instantiate_builder(record_name, record_object, options); end + + class << self + # source://actionview//lib/action_view/helpers/form_helper.rb#481 + def form_with_generates_ids; end + + # source://actionview//lib/action_view/helpers/form_helper.rb#481 + def form_with_generates_ids=(val); end + + # source://actionview//lib/action_view/helpers/form_helper.rb#479 + def form_with_generates_remote_forms; end + + # source://actionview//lib/action_view/helpers/form_helper.rb#479 + def form_with_generates_remote_forms=(val); end + + # source://actionview//lib/action_view/helpers/form_helper.rb#483 + def multiple_file_field_include_hidden; end + + # source://actionview//lib/action_view/helpers/form_helper.rb#483 + def multiple_file_field_include_hidden=(val); end + end +end + +# = Action View Form Option \Helpers +# +# Provides a number of methods for turning different kinds of containers into a set of option tags. +# +# The #collection_select, #select and #time_zone_select methods take an options parameter, a hash: +# +# * :include_blank - set to true or a prompt string if the first option element of the select element is a blank. Useful if there is not a default value required for the select element. +# +# select(:post, :category, Post::CATEGORIES, { include_blank: true }) +# +# could become: +# +# +# +# Another common case is a select tag for a belongs_to-associated object. +# +# Example with @post.person_id => 2: +# +# select(:post, :person_id, Person.all.collect { |p| [ p.name, p.id ] }, { include_blank: "None" }) +# +# could become: +# +# +# +# * :prompt - set to true or a prompt string. When the select element doesn't have a value yet, this prepends an option with a generic prompt -- "Please select" -- or the given prompt string. +# +# select(:post, :person_id, Person.all.collect { |p| [ p.name, p.id ] }, { prompt: "Select Person" }) +# +# could become: +# +# +# +# * :index - like the other form helpers, #select can accept an :index option to manually set the ID used in the resulting output. Unlike other helpers, #select expects this +# option to be in the +html_options+ parameter. +# +# select("album[]", :genre, %w[ rap rock country ], {}, { index: nil }) +# +# becomes: +# +# +# +# * :disabled - can be a single value or an array of values that will be disabled options in the final output. +# +# select(:post, :category, Post::CATEGORIES, { disabled: "restricted" }) +# +# could become: +# +# +# +# When used with the #collection_select helper, :disabled can also be a Proc that identifies those options that should be disabled. +# +# collection_select(:post, :category_id, Category.all, :id, :name, { disabled: -> (category) { category.archived? } }) +# +# If the categories "2008 stuff" and "Christmas" return true when the method archived? is called, this would return: +# +# +# source://actionview//lib/action_view/helpers/form_options_helper.rb#93 +module ActionView::Helpers::FormOptionsHelper + include ::ActionView::Helpers::SanitizeHelper + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + include ::ActionView::Helpers::TagHelper + include ::ActionView::Helpers::TextHelper + extend ::ActionView::Helpers::SanitizeHelper::ClassMethods + + # Returns check box tags for the collection of existing return values of + # +method+ for +object+'s class. The value returned from calling +method+ + # on the instance +object+ will be selected. If calling +method+ returns + # +nil+, no selection is made. + # + # The :value_method and :text_method parameters are + # methods to be called on each member of +collection+. The return values + # are used as the +value+ attribute and contents of each check box tag, + # respectively. They can also be any object that responds to +call+, such + # as a +proc+, that will be called for each member of the +collection+ to + # retrieve the value/text. + # + # Example object structure for use with this method: + # class Post < ActiveRecord::Base + # has_and_belongs_to_many :authors + # end + # class Author < ActiveRecord::Base + # has_and_belongs_to_many :posts + # def name_with_initial + # "#{first_name.first}. #{last_name}" + # end + # end + # + # Sample usage (selecting the associated Author for an instance of Post, @post): + # collection_checkboxes(:post, :author_ids, Author.all, :id, :name_with_initial) + # + # If @post.author_ids is already [1], this would return: + # + # + # + # + # + # + # + # + # It is also possible to customize the way the elements will be shown by + # giving a block to the method: + # collection_checkboxes(:post, :author_ids, Author.all, :id, :name_with_initial) do |b| + # b.label { b.checkbox } + # end + # + # The argument passed to the block is a special kind of builder for this + # collection, which has the ability to generate the label and check box + # for the current item in the collection, with proper text and value. + # Using it, you can change the label and check box display order or even + # use the label as wrapper, as in the example above. + # + # The builder methods label and checkbox also accept + # extra HTML options: + # collection_checkboxes(:post, :author_ids, Author.all, :id, :name_with_initial) do |b| + # b.label(class: "checkbox") { b.checkbox(class: "checkbox") } + # end + # + # There are also three special methods available: object, text and + # value, which are the current item being rendered, its text and value methods, + # respectively. You can use them like this: + # collection_checkboxes(:post, :author_ids, Author.all, :id, :name_with_initial) do |b| + # b.label(:"data-value" => b.value) { b.checkbox + b.text } + # end + # + # ==== Gotcha + # + # When no selection is made for a collection of checkboxes most + # web browsers will not send any value. + # + # For example, if we have a +User+ model with +category_ids+ field and we + # have the following code in our update action: + # + # @user.update(params[:user]) + # + # If no +category_ids+ are selected then we can safely assume this field + # will not be updated. + # + # This is possible thanks to a hidden field generated by the helper method + # for every collection of checkboxes. + # This hidden field is given the same field name as the checkboxes with a + # blank value. + # + # In the rare case you don't want this hidden field, you can pass the + # include_hidden: false option to the helper method. + # + # source://actionview//lib/action_view/helpers/form_options_helper.rb#787 + def collection_check_boxes(object, method, collection, value_method, text_method, options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # Returns check box tags for the collection of existing return values of + # +method+ for +object+'s class. The value returned from calling +method+ + # on the instance +object+ will be selected. If calling +method+ returns + # +nil+, no selection is made. + # + # The :value_method and :text_method parameters are + # methods to be called on each member of +collection+. The return values + # are used as the +value+ attribute and contents of each check box tag, + # respectively. They can also be any object that responds to +call+, such + # as a +proc+, that will be called for each member of the +collection+ to + # retrieve the value/text. + # + # Example object structure for use with this method: + # class Post < ActiveRecord::Base + # has_and_belongs_to_many :authors + # end + # class Author < ActiveRecord::Base + # has_and_belongs_to_many :posts + # def name_with_initial + # "#{first_name.first}. #{last_name}" + # end + # end + # + # Sample usage (selecting the associated Author for an instance of Post, @post): + # collection_checkboxes(:post, :author_ids, Author.all, :id, :name_with_initial) + # + # If @post.author_ids is already [1], this would return: + # + # + # + # + # + # + # + # + # It is also possible to customize the way the elements will be shown by + # giving a block to the method: + # collection_checkboxes(:post, :author_ids, Author.all, :id, :name_with_initial) do |b| + # b.label { b.checkbox } + # end + # + # The argument passed to the block is a special kind of builder for this + # collection, which has the ability to generate the label and check box + # for the current item in the collection, with proper text and value. + # Using it, you can change the label and check box display order or even + # use the label as wrapper, as in the example above. + # + # The builder methods label and checkbox also accept + # extra HTML options: + # collection_checkboxes(:post, :author_ids, Author.all, :id, :name_with_initial) do |b| + # b.label(class: "checkbox") { b.checkbox(class: "checkbox") } + # end + # + # There are also three special methods available: object, text and + # value, which are the current item being rendered, its text and value methods, + # respectively. You can use them like this: + # collection_checkboxes(:post, :author_ids, Author.all, :id, :name_with_initial) do |b| + # b.label(:"data-value" => b.value) { b.checkbox + b.text } + # end + # + # ==== Gotcha + # + # When no selection is made for a collection of checkboxes most + # web browsers will not send any value. + # + # For example, if we have a +User+ model with +category_ids+ field and we + # have the following code in our update action: + # + # @user.update(params[:user]) + # + # If no +category_ids+ are selected then we can safely assume this field + # will not be updated. + # + # This is possible thanks to a hidden field generated by the helper method + # for every collection of checkboxes. + # This hidden field is given the same field name as the checkboxes with a + # blank value. + # + # In the rare case you don't want this hidden field, you can pass the + # include_hidden: false option to the helper method. + # + # source://actionview//lib/action_view/helpers/form_options_helper.rb#784 + def collection_checkboxes(object, method, collection, value_method, text_method, options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # Returns radio button tags for the collection of existing return values + # of +method+ for +object+'s class. The value returned from calling + # +method+ on the instance +object+ will be selected. If calling +method+ + # returns +nil+, no selection is made. + # + # The :value_method and :text_method parameters are + # methods to be called on each member of +collection+. The return values + # are used as the +value+ attribute and contents of each radio button tag, + # respectively. They can also be any object that responds to +call+, such + # as a +proc+, that will be called for each member of the +collection+ to + # retrieve the value/text. + # + # Example object structure for use with this method: + # + # class Post < ActiveRecord::Base + # belongs_to :author + # end + # + # class Author < ActiveRecord::Base + # has_many :posts + # + # def name_with_initial + # "#{first_name.first}. #{last_name}" + # end + # end + # + # Sample usage (selecting the associated Author for an instance of Post, @post): + # collection_radio_buttons(:post, :author_id, Author.all, :id, :name_with_initial) + # + # If @post.author_id is already 1, this would return: + # + # + # + # + # + # + # + # It is also possible to customize the way the elements will be shown by + # giving a block to the method: + # collection_radio_buttons(:post, :author_id, Author.all, :id, :name_with_initial) do |b| + # b.label { b.radio_button } + # end + # + # The argument passed to the block is a special kind of builder for this + # collection, which has the ability to generate the label and radio button + # for the current item in the collection, with proper text and value. + # Using it, you can change the label and radio button display order or + # even use the label as wrapper, as in the example above. + # + # The builder methods label and radio_button also accept + # extra HTML options: + # collection_radio_buttons(:post, :author_id, Author.all, :id, :name_with_initial) do |b| + # b.label(class: "radio_button") { b.radio_button(class: "radio_button") } + # end + # + # There are also three special methods available: object, text and + # value, which are the current item being rendered, its text and value methods, + # respectively. You can use them like this: + # collection_radio_buttons(:post, :author_id, Author.all, :id, :name_with_initial) do |b| + # b.label(:"data-value" => b.value) { b.radio_button + b.text } + # end + # + # ==== Gotcha + # + # The HTML specification says when nothing is selected on a collection of radio buttons + # web browsers do not send any value to server. + # Unfortunately this introduces a gotcha: + # if a +User+ model has a +category_id+ field and in the form no category is selected, no +category_id+ parameter is sent. So, + # any strong parameters idiom like: + # + # params.expect(user: [...]) + # + # will raise an error since no {user: ...} will be present. + # + # To prevent this the helper generates an auxiliary hidden field before + # every collection of radio buttons. The hidden field has the same name as collection radio button and blank value. + # + # In case if you don't want the helper to generate this hidden field you can specify + # include_hidden: false option. + # + # source://actionview//lib/action_view/helpers/form_options_helper.rb#700 + def collection_radio_buttons(object, method, collection, value_method, text_method, options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # Returns + # + # + # + # + # + # + # source://actionview//lib/action_view/helpers/form_options_helper.rb#198 + def collection_select(object, method, collection, value_method, text_method, options = T.unsafe(nil), html_options = T.unsafe(nil)); end + + # Returns + # + # + # + # + # + # + # + # + # + # + # source://actionview//lib/action_view/helpers/form_options_helper.rb#257 + def grouped_collection_select(object, method, collection, group_method, group_label_method, option_key_method, option_value_method, options = T.unsafe(nil), html_options = T.unsafe(nil)); end + + # Returns a string of tags, like #options_for_select, but + # wraps them with tags: + # + # grouped_options = [ + # ['North America', + # [['United States','US'],'Canada']], + # ['Europe', + # ['Denmark','Germany','France']] + # ] + # grouped_options_for_select(grouped_options) + # + # grouped_options = { + # 'North America' => [['United States','US'], 'Canada'], + # 'Europe' => ['Denmark','Germany','France'] + # } + # grouped_options_for_select(grouped_options) + # + # Possible output: + # + # + # + # + # + # + # + # + # + # + # ==== Parameters + # + # * +grouped_options+ - Accepts a nested array or hash of strings. The first value serves as the + # label while the second value must be an array of options. The second value can be a + # nested array of text-value pairs. See options_for_select for more info. + # Ex. ["North America",[["United States","US"],["Canada","CA"]]] + # An optional third value can be provided as HTML attributes for the optgroup. + # Ex. ["North America",[["United States","US"],["Canada","CA"]], { disabled: "disabled" }] + # * +selected_key+ - A value equal to the +value+ attribute for one of the tags, + # which will have the +selected+ attribute set. Note: It is possible for this value to match multiple options + # as you might have the same option in multiple groups. Each will then get selected="selected". + # + # ==== Options + # + # * :prompt - set to true or a prompt string. When the select element doesn't have a value yet, this + # prepends an option with a generic prompt - "Please select" - or the given prompt string. + # * :divider - the divider for the options groups. + # + # grouped_options = [ + # [['United States','US'], 'Canada'], + # ['Denmark','Germany','France'] + # ] + # grouped_options_for_select(grouped_options, nil, divider: '---------') + # + # Possible output: + # + # + # + # + # + # + # + # + # + # + # Note: Only the and tags are returned, so you still have to + # wrap the output in an appropriate tag. + # + # source://actionview//lib/action_view/helpers/form_options_helper.rb#461 + def option_groups_from_collection_for_select(collection, group_method, group_label_method, option_key_method, option_value_method, selected_key = T.unsafe(nil)); end + + # Accepts a container (hash, array, enumerable, your type) and returns a string of option tags. Given a container + # where the elements respond to first and last (such as a two-element array), the "lasts" serve as option values and + # the "firsts" as option text. Hashes are turned into this form automatically, so the keys become "firsts" and values + # become lasts. If +selected+ is specified, the matching "last" or element will get the selected option-tag. +selected+ + # may also be an array of values to be selected when using a multiple select. + # + # options_for_select([["Dollar", "$"], ["Kroner", "DKK"]]) + # # => + # # => + # + # options_for_select([ "VISA", "MasterCard" ], "MasterCard") + # # => + # # => + # + # options_for_select({ "Basic" => "$20", "Plus" => "$40" }, "$40") + # # => + # # => + # + # options_for_select([ "VISA", "MasterCard", "Discover" ], ["VISA", "Discover"]) + # # => + # # => + # # => + # + # You can optionally provide HTML attributes as the last element of the array. + # + # options_for_select([ "Denmark", ["USA", { class: 'bold' }], "Sweden" ], ["USA", "Sweden"]) + # # => + # # => + # # => + # + # options_for_select([["Dollar", "$", { class: "bold" }], ["Kroner", "DKK", { onclick: "alert('HI');" }]]) + # # => + # # => + # + # If you wish to specify disabled option tags, set +selected+ to be a hash, with :disabled being either a value + # or array of values to be disabled. In this case, you can use :selected to specify selected option tags. + # + # options_for_select(["Free", "Basic", "Advanced", "Super Platinum"], disabled: "Super Platinum") + # # => + # # => + # # => + # # => + # + # options_for_select(["Free", "Basic", "Advanced", "Super Platinum"], disabled: ["Advanced", "Super Platinum"]) + # # => + # # => + # # => + # # => + # + # options_for_select(["Free", "Basic", "Advanced", "Super Platinum"], selected: "Free", disabled: "Super Platinum") + # # => + # # => + # # => + # # => + # + # NOTE: Only the option tags are returned, you have to wrap this call in a regular HTML select tag. + # + # source://actionview//lib/action_view/helpers/form_options_helper.rb#357 + def options_for_select(container, selected = T.unsafe(nil)); end + + # Returns a string of option tags that have been compiled by iterating over the +collection+ and assigning + # the result of a call to the +value_method+ as the option value and the +text_method+ as the option text. + # + # options_from_collection_for_select(@people, 'id', 'name') + # # => + # + # This is more often than not used inside a #select_tag like this example: + # + # select_tag 'person', options_from_collection_for_select(@people, 'id', 'name') + # + # If +selected+ is specified as a value or array of values, the element(s) returning a match on +value_method+ + # will be selected option tag(s). + # + # If +selected+ is specified as a Proc, those members of the collection that return true for the anonymous + # function are the selected values. + # + # +selected+ can also be a hash, specifying both :selected and/or :disabled values as required. + # + # Be sure to specify the same class as the +value_method+ when specifying selected or disabled options. + # Failure to do this will produce undesired results. Example: + # options_from_collection_for_select(@people, 'id', 'name', '1') + # Will not select a person with the id of 1 because 1 (an Integer) is not the same as '1' (a string) + # options_from_collection_for_select(@people, 'id', 'name', 1) + # should produce the desired results. + # + # source://actionview//lib/action_view/helpers/form_options_helper.rb#400 + def options_from_collection_for_select(collection, value_method, text_method, selected = T.unsafe(nil)); end + + # Create a select tag and a series of contained option tags for the provided object and method. + # The option currently held by the object will be selected, provided that the object is available. + # + # There are two possible formats for the +choices+ parameter, corresponding to other helpers' output: + # + # * A flat collection (see options_for_select). + # * A nested collection (see grouped_options_for_select). + # + # Example with @post.person_id => 2: + # + # select :post, :person_id, Person.all.collect { |p| [ p.name, p.id ] }, { include_blank: true } + # + # would become: + # + # + # + # This can be used to provide a default set of options in the standard way: before rendering the create form, a + # new model instance is assigned the default options and bound to @model_name. Usually this model is not saved + # to the database. Instead, a second model object is created when the create request is received. + # This allows the user to submit a form page more than once with the expected results of creating multiple records. + # In addition, this allows a single partial to be used to generate form inputs for both edit and create forms. + # + # By default, post.person_id is the selected option. Specify selected: value to use a different selection + # or selected: nil to leave all options unselected. Similarly, you can specify values to be disabled in the option + # tags by specifying the :disabled option. This can either be a single value or an array of values to be disabled. + # + # A block can be passed to #select to customize how the options tags will be rendered. This + # is useful when the options tag has complex attributes. + # + # select(report, :campaign_ids) do + # available_campaigns.each do |c| + # tag.option(c.name, value: c.id, data: { tags: c.tags.to_json }) + # end + # end + # + # ==== Gotcha + # + # The HTML specification says when +multiple+ parameter passed to select and all options got deselected + # web browsers do not send any value to server. Unfortunately this introduces a gotcha: + # if a +User+ model has many +roles+ and have +role_ids+ accessor, and in the form that edits roles of the user + # the user deselects all roles from +role_ids+ multiple select box, no +role_ids+ parameter is sent. So, + # any mass-assignment idiom like + # + # @user.update(params[:user]) + # + # wouldn't update roles. + # + # To prevent this the helper generates an auxiliary hidden field before + # every multiple select. The hidden field has the same name as multiple select and blank value. + # + # Note: The client either sends only the hidden field (representing + # the deselected multiple select box), or both fields. This means that the resulting array + # always contains a blank string. + # + # In case if you don't want the helper to generate this hidden field you can specify + # include_hidden: false option. + # + # source://actionview//lib/action_view/helpers/form_options_helper.rb#158 + def select(object, method, choices = T.unsafe(nil), options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # Returns a string of option tags for pretty much any time zone in the + # world. Supply an ActiveSupport::TimeZone name as +selected+ to have it + # marked as the selected option tag. You can also supply an array of + # ActiveSupport::TimeZone objects as +priority_zones+, so that they will + # be listed above the rest of the (long) list. (You can use + # ActiveSupport::TimeZone.us_zones as a convenience for obtaining a list + # of the US time zones, or a Regexp to select the zones of your choice) + # + # The +selected+ parameter must be either +nil+, or a string that names + # an ActiveSupport::TimeZone. + # + # By default, +model+ is the ActiveSupport::TimeZone constant (which can + # be obtained in Active Record as a value object). The +model+ parameter + # must respond to +all+ and return an array of objects that represent time + # zones; each object must respond to +name+. If a Regexp is given it will + # attempt to match the zones using match? method. + # + # NOTE: Only the option tags are returned, you have to wrap this call in + # a regular HTML select tag. + # + # source://actionview//lib/action_view/helpers/form_options_helper.rb#580 + def time_zone_options_for_select(selected = T.unsafe(nil), priority_zones = T.unsafe(nil), model = T.unsafe(nil)); end + + # Returns select and option tags for the given object and method, using + # #time_zone_options_for_select to generate the list of option tags. + # + # In addition to the :include_blank option documented above, + # this method also supports a :model option, which defaults + # to ActiveSupport::TimeZone. This may be used by users to specify a + # different time zone model object. (See #time_zone_options_for_select + # for more information.) + # + # You can also supply an array of ActiveSupport::TimeZone objects + # as +priority_zones+ so that they will be listed above the rest of the + # (long) list. You can use ActiveSupport::TimeZone.us_zones for a list + # of US time zones, ActiveSupport::TimeZone.country_zones(country_code) + # for another country's time zones, or a Regexp to select the zones of + # your choice. + # + # Finally, this method supports a :default option, which selects + # a default ActiveSupport::TimeZone if the object's time zone is +nil+. + # + # time_zone_select(:user, :time_zone, nil, include_blank: true) + # + # time_zone_select(:user, :time_zone, nil, default: "Pacific Time (US & Canada)") + # + # time_zone_select(:user, :time_zone, ActiveSupport::TimeZone.us_zones, default: "Pacific Time (US & Canada)") + # + # time_zone_select(:user, :time_zone, [ ActiveSupport::TimeZone["Alaska"], ActiveSupport::TimeZone["Hawaii"] ]) + # + # time_zone_select(:user, :time_zone, /Australia/) + # + # time_zone_select(:user, :time_zone, ActiveSupport::TimeZone.all.sort, model: ActiveSupport::TimeZone) + # + # source://actionview//lib/action_view/helpers/form_options_helper.rb#291 + def time_zone_select(object, method, priority_zones = T.unsafe(nil), options = T.unsafe(nil), html_options = T.unsafe(nil)); end + + # Returns a string of option tags for the days of the week. + # + # ====Options + # + # * :index_as_value - Defaults to false, set to true to use the indexes from + # I18n.translate("date.day_names") as the values. By default, Sunday is always 0. + # * :day_format - The I18n key of the array to use for the weekday options. + # Defaults to +:day_names+, set to +:abbr_day_names+ for abbreviations. + # * :beginning_of_week - Defaults to Date.beginning_of_week. + # + # NOTE: Only the option tags are returned, you have to wrap this call in + # a regular HTML select tag. + # + # source://actionview//lib/action_view/helpers/form_options_helper.rb#613 + def weekday_options_for_select(selected = T.unsafe(nil), index_as_value: T.unsafe(nil), day_format: T.unsafe(nil), beginning_of_week: T.unsafe(nil)); end + + # Returns select and option tags for the given object and method, using + # #weekday_options_for_select to generate the list of option tags. + # + # source://actionview//lib/action_view/helpers/form_options_helper.rb#297 + def weekday_select(object, method, options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + private + + # source://actionview//lib/action_view/helpers/form_options_helper.rb#812 + def extract_selected_and_disabled(selected); end + + # source://actionview//lib/action_view/helpers/form_options_helper.rb#823 + def extract_values_from_collection(collection, value_method, selected); end + + # source://actionview//lib/action_view/helpers/form_options_helper.rb#790 + def option_html_attributes(element); end + + # source://actionview//lib/action_view/helpers/form_options_helper.rb#798 + def option_text_and_value(option); end + + # @return [Boolean] + # + # source://actionview//lib/action_view/helpers/form_options_helper.rb#808 + def option_value_selected?(value, selected); end + + # source://actionview//lib/action_view/helpers/form_options_helper.rb#837 + def prompt_text(prompt); end + + # source://actionview//lib/action_view/helpers/form_options_helper.rb#833 + def value_for_collection(item, value); end +end + +# = Action View Form Tag \Helpers +# +# Provides a number of methods for creating form tags that don't rely on an Active Record object assigned to the template like +# FormHelper does. Instead, you provide the names and values manually. +# +# NOTE: The HTML options disabled, readonly, and multiple can all be treated as booleans. So specifying +# disabled: true will give disabled="disabled". +# +# source://actionview//lib/action_view/helpers/form_tag_helper.rb#18 +module ActionView::Helpers::FormTagHelper + include ::ActionView::Helpers::ContentExfiltrationPreventionHelper + extend ::ActiveSupport::Concern + include ::ActionView::Helpers::UrlHelper + include ::ActionView::Helpers::SanitizeHelper + include ::ActionView::Helpers::TextHelper + + mixes_in_class_methods ::ActionView::Helpers::UrlHelper::ClassMethods + mixes_in_class_methods ::ActionView::Helpers::SanitizeHelper::ClassMethods + + # Creates a button element that defines a submit button, + # reset button or a generic button which can be used in + # JavaScript, for example. You can use the button tag as a regular + # submit tag but it isn't supported in legacy browsers. However, + # the button tag does allow for richer labels such as images and emphasis, + # so this helper will also accept a block. By default, it will create + # a button tag with type submit, if type is not given. + # + # ==== Options + # * :data - This option can be used to add custom data attributes. + # * :disabled - If true, the user will not be able to + # use this input. + # * Any other key creates standard HTML options for the tag. + # + # ==== Examples + # button_tag + # # => + # + # button_tag 'Reset', type: 'reset' + # # => + # + # button_tag 'Button', type: 'button' + # # => + # + # button_tag 'Reset', type: 'reset', disabled: true + # # => + # + # button_tag(type: 'button') do + # content_tag(:strong, 'Ask me!') + # end + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#571 + def button_tag(content_or_options = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # :call-seq: + # checkbox_tag(name, options = {}) + # checkbox_tag(name, value, options = {}) + # checkbox_tag(name, value, checked, options = {}) + # + # Creates a check box form input tag. + # + # ==== Options + # * :value - The value of the input. Defaults to "1". + # * :checked - If set to true, the checkbox will be checked by default. + # * :disabled - If set to true, the user will not be able to use this input. + # * Any other key creates standard HTML options for the tag. + # + # ==== Examples + # checkbox_tag 'accept' + # # => + # + # checkbox_tag 'rock', 'rock music' + # # => + # + # checkbox_tag 'receive_email', 'yes', true + # # => + # + # checkbox_tag 'tos', 'yes', false, class: 'accept_tos' + # # => + # + # checkbox_tag 'eula', 'accepted', false, disabled: true + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#469 + def check_box_tag(name, *args); end + + # :call-seq: + # checkbox_tag(name, options = {}) + # checkbox_tag(name, value, options = {}) + # checkbox_tag(name, value, checked, options = {}) + # + # Creates a check box form input tag. + # + # ==== Options + # * :value - The value of the input. Defaults to "1". + # * :checked - If set to true, the checkbox will be checked by default. + # * :disabled - If set to true, the user will not be able to use this input. + # * Any other key creates standard HTML options for the tag. + # + # ==== Examples + # checkbox_tag 'accept' + # # => + # + # checkbox_tag 'rock', 'rock music' + # # => + # + # checkbox_tag 'receive_email', 'yes', true + # # => + # + # checkbox_tag 'tos', 'yes', false, class: 'accept_tos' + # # => + # + # checkbox_tag 'eula', 'accepted', false, disabled: true + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#459 + def checkbox_tag(name, *args); end + + # Creates a text field of type "color". + # + # ==== Options + # + # Supports the same options as #text_field_tag. + # + # ==== Examples + # + # color_field_tag 'name' + # # => + # + # color_field_tag 'color', '#DEF726' + # # => + # + # color_field_tag 'color', nil, class: 'special_input' + # # => + # + # color_field_tag 'color', '#DEF726', class: 'special_input', disabled: true + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#671 + def color_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a text field of type "date". + # + # ==== Options + # + # Supports the same options as #text_field_tag. + # + # ==== Examples + # + # date_field_tag 'name' + # # => + # + # date_field_tag 'date', '2014-12-31' + # # => + # + # date_field_tag 'date', nil, class: 'special_input' + # # => + # + # date_field_tag 'date', '2014-12-31', class: 'special_input', disabled: true + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#741 + def date_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a text field of type "datetime-local". + # + # ==== Options + # + # Supports the same options as #text_field_tag. Additionally, supports: + # + # * :min - The minimum acceptable value. + # * :max - The maximum acceptable value. + # * :step - The acceptable value granularity. + # * :include_seconds - Include seconds in the output timestamp format (true by default). + # + # ==== Examples + # + # datetime_field_tag 'name' + # # => + # + # datetime_field_tag 'datetime', '2014-01-01T01:01' + # # => + # + # datetime_field_tag 'datetime', nil, class: 'special_input' + # # => + # + # datetime_field_tag 'datetime', '2014-01-01T01:01', class: 'special_input', disabled: true + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#800 + def datetime_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a text field of type "datetime-local". + # + # ==== Options + # + # Supports the same options as #text_field_tag. Additionally, supports: + # + # * :min - The minimum acceptable value. + # * :max - The maximum acceptable value. + # * :step - The acceptable value granularity. + # * :include_seconds - Include seconds in the output timestamp format (true by default). + # + # ==== Examples + # + # datetime_field_tag 'name' + # # => + # + # datetime_field_tag 'datetime', '2014-01-01T01:01' + # # => + # + # datetime_field_tag 'datetime', nil, class: 'special_input' + # # => + # + # datetime_field_tag 'datetime', '2014-01-01T01:01', class: 'special_input', disabled: true + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#804 + def datetime_local_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#28 + def default_enforce_utf8; end + + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#28 + def default_enforce_utf8=(val); end + + # Creates a text field of type "email". + # + # ==== Options + # + # Supports the same options as #text_field_tag. + # + # ==== Examples + # + # email_field_tag 'name' + # # => + # + # email_field_tag 'email', 'email@example.com' + # # => + # + # email_field_tag 'email', nil, class: 'special_input' + # # => + # + # email_field_tag 'email', 'email@example.com', class: 'special_input', disabled: true + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#902 + def email_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#25 + def embed_authenticity_token_in_remote_forms; end + + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#25 + def embed_authenticity_token_in_remote_forms=(val); end + + # Generate an HTML id attribute value for the given name and + # field combination + # + # Return the value generated by the FormBuilder for the given + # attribute name. + # + # <%= label_tag :post, :title %> + # <%= text_field :post, :title, aria: { describedby: field_id(:post, :title, :error) } %> + # <%= tag.span("is blank", id: field_id(:post, :title, :error) %> + # + # In the example above, the element built by + # the call to text_field declares an + # aria-describedby attribute referencing the + # element, sharing a common id root (post_title, in this + # case). + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#101 + def field_id(object_name, method_name, *suffixes, index: T.unsafe(nil), namespace: T.unsafe(nil)); end + + # Generate an HTML name attribute value for the given name and + # field combination + # + # Return the value generated by the FormBuilder for the given + # attribute name. + # + # <%= text_field :post, :title, name: field_name(:post, :title, :subtitle) %> + # <%# => %> + # + # <%= text_field :post, :tag, name: field_name(:post, :tag, multiple: true) %> + # <%# => %> + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#131 + def field_name(object_name, method_name, *method_names, multiple: T.unsafe(nil), index: T.unsafe(nil)); end + + # Creates a field set for grouping HTML form elements. + # + # legend will become the fieldset's title (optional as per W3C). + # options accept the same values as tag. + # + # ==== Examples + # <%= field_set_tag do %> + #

    <%= text_field_tag 'name' %>

    + # <% end %> + # # =>

    + # + # <%= field_set_tag 'Your details' do %> + #

    <%= text_field_tag 'name' %>

    + # <% end %> + # # =>
    Your details

    + # + # <%= field_set_tag nil, class: 'format' do %> + #

    <%= text_field_tag 'name' %>

    + # <% end %> + # # =>

    + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#643 + def field_set_tag(legend = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # Creates a field set for grouping HTML form elements. + # + # legend will become the fieldset's title (optional as per W3C). + # options accept the same values as tag. + # + # ==== Examples + # <%= field_set_tag do %> + #

    <%= text_field_tag 'name' %>

    + # <% end %> + # # =>

    + # + # <%= field_set_tag 'Your details' do %> + #

    <%= text_field_tag 'name' %>

    + # <% end %> + # # =>
    Your details

    + # + # <%= field_set_tag nil, class: 'format' do %> + #

    <%= text_field_tag 'name' %>

    + # <% end %> + # # =>

    + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#650 + def fieldset_tag(legend = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # Creates a file upload field. If you are using file uploads then you will also need + # to set the multipart option for the form tag: + # + # <%= form_tag '/upload', multipart: true do %> + # <%= file_field_tag "file" %> + # <%= submit_tag %> + # <% end %> + # + # The specified URL will then be passed a File object containing the selected file, or if the field + # was left blank, a StringIO object. + # + # ==== Options + # * Creates standard HTML attributes for the tag. + # * :disabled - If set to true, the user will not be able to use this input. + # * :multiple - If set to true, *in most updated browsers* the user will be allowed to select multiple files. + # * :accept - If set to one or multiple mime-types, the user will be suggested a filter when choosing a file. You still need to set up model validations. + # + # ==== Examples + # file_field_tag 'attachment' + # # => + # + # file_field_tag 'avatar', class: 'profile_input' + # # => + # + # file_field_tag 'picture', disabled: true + # # => + # + # file_field_tag 'resume', value: '~/resume.doc' + # # => + # + # file_field_tag 'user_pic', accept: 'image/png,image/gif,image/jpeg' + # # => + # + # file_field_tag 'file', accept: 'text/html', class: 'upload', value: 'index.html' + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#350 + def file_field_tag(name, options = T.unsafe(nil)); end + + # Starts a form tag that points the action to a URL configured with url_for_options just like + # ActionController::Base#url_for. The method for the form defaults to POST. + # + # ==== Options + # * :multipart - If set to true, the enctype is set to "multipart/form-data". + # * :method - The method to use when submitting the form, usually either "get" or "post". + # If "patch", "put", "delete", or another verb is used, a hidden input with name _method + # is added to simulate the verb over post. + # * :authenticity_token - Authenticity token to use in the form. Use only if you need to + # pass custom authenticity token string, or to not add authenticity_token field at all + # (by passing false). Remote forms may omit the embedded authenticity token + # by setting config.action_view.embed_authenticity_token_in_remote_forms = false. + # This is helpful when you're fragment-caching the form. Remote forms get the + # authenticity token from the meta tag, so embedding is unnecessary unless you + # support browsers without JavaScript. + # * :remote - If set to true, will allow the Unobtrusive JavaScript drivers to control the + # submit behavior. By default this behavior is an ajax submit. + # * :enforce_utf8 - If set to false, a hidden input with name utf8 is not output. + # * Any other key creates standard HTML attributes for the tag. + # + # ==== Examples + # form_tag('/posts') + # # => + # + # form_tag('/posts/1', method: :put) + # # => ... ... + # + # form_tag('/upload', multipart: true) + # # => + # + # <%= form_tag('/posts') do -%> + #
    <%= submit_tag 'Save' %>
    + # <% end -%> + # # =>
    + # + # <%= form_tag('/posts', remote: true) %> + # # =>
    + # + # form_tag(false, method: :get) + # # => + # + # form_tag('http://far.away.com/form', authenticity_token: false) + # # form without authenticity token + # + # form_tag('http://far.away.com/form', authenticity_token: "cf50faa3fe97702ca1ae") + # # form with custom authenticity token + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#77 + def form_tag(url_for_options = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # Creates a hidden form input field used to transmit data that would be lost due to HTTP's statelessness or + # data that should be hidden from the user. + # + # ==== Options + # * Creates standard HTML attributes for the tag. + # + # ==== Examples + # hidden_field_tag 'tags_list' + # # => + # + # hidden_field_tag 'token', 'VUBJKB23UIVI1UU1VOBVI@' + # # => + # + # hidden_field_tag 'collected_input', '', onchange: "alert('Input collected!')" + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#307 + def hidden_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Displays an image which when clicked will submit the form. + # + # source is passed to AssetTagHelper#path_to_image + # + # ==== Options + # * :data - This option can be used to add custom data attributes. + # * :disabled - If set to true, the user will not be able to use this input. + # * Any other key creates standard HTML options for the tag. + # + # ==== Data attributes + # + # * confirm: 'question?' - This will add a JavaScript confirm + # prompt with the question specified. If the user accepts, the form is + # processed normally, otherwise no action is taken. + # + # ==== Examples + # image_submit_tag("login.png") + # # => + # + # image_submit_tag("purchase.png", disabled: true) + # # => + # + # image_submit_tag("search.png", class: 'search_button', alt: 'Find') + # # => + # + # image_submit_tag("agree.png", disabled: true, class: "agree_disagree_button") + # # => + # + # image_submit_tag("save.png", data: { confirm: "Are you sure?" }) + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#617 + def image_submit_tag(source, options = T.unsafe(nil)); end + + # Creates a label element. Accepts a block. + # + # ==== Options + # * Creates standard HTML attributes for the tag. + # + # ==== Examples + # label_tag 'name' + # # => + # + # label_tag 'name', 'Your name' + # # => + # + # label_tag 'name', nil, class: 'small_label' + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#280 + def label_tag(name = T.unsafe(nil), content_or_options = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # Creates a text field of type "month". + # + # ==== Options + # + # Supports the same options as #text_field_tag. Additionally, supports: + # + # * :min - The minimum acceptable value. + # * :max - The maximum acceptable value. + # * :step - The acceptable value granularity. + # + # ==== Examples + # + # month_field_tag 'name' + # # => + # + # month_field_tag 'month', '2014-01' + # # => + # + # month_field_tag 'month', nil, class: 'special_input' + # # => + # + # month_field_tag 'month', '2014-01', class: 'special_input', disabled: true + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#829 + def month_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a number field. + # + # ==== Options + # + # Supports the same options as #text_field_tag. Additionally, supports: + # + # * :min - The minimum acceptable value. + # * :max - The maximum acceptable value. + # * :in - A range specifying the :min and + # :max values. + # * :within - Same as :in. + # * :step - The acceptable value granularity. + # + # ==== Examples + # + # number_field_tag 'quantity' + # # => + # + # number_field_tag 'quantity', '1' + # # => + # + # number_field_tag 'quantity', nil, class: 'special_input' + # # => + # + # number_field_tag 'quantity', nil, min: 1 + # # => + # + # number_field_tag 'quantity', nil, max: 9 + # # => + # + # number_field_tag 'quantity', nil, in: 1...10 + # # => + # + # number_field_tag 'quantity', nil, within: 1...10 + # # => + # + # number_field_tag 'quantity', nil, min: 1, max: 10 + # # => + # + # number_field_tag 'quantity', nil, min: 1, max: 10, step: 2 + # # => + # + # number_field_tag 'quantity', '1', class: 'special_input', disabled: true + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#950 + def number_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a password field, a masked text field that will hide the users input behind a mask character. + # + # ==== Options + # * :disabled - If set to true, the user will not be able to use this input. + # * :size - The number of visible characters that will fit in the input. + # * :maxlength - The maximum number of characters that the browser will allow the user to enter. + # * Any other key creates standard HTML attributes for the tag. + # + # ==== Examples + # password_field_tag 'pass' + # # => + # + # password_field_tag 'secret', 'Your secret here' + # # => + # + # password_field_tag 'masked', nil, class: 'masked_input_field' + # # => + # + # password_field_tag 'token', '', size: 15 + # # => + # + # password_field_tag 'key', nil, maxlength: 16 + # # => + # + # password_field_tag 'confirm_pass', nil, disabled: true + # # => + # + # password_field_tag 'pin', '1234', maxlength: 4, size: 6, class: "pin_input" + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#383 + def password_field_tag(name = T.unsafe(nil), value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a text field of type "tel". + # + # ==== Options + # + # Supports the same options as #text_field_tag. + # + # ==== Examples + # + # telephone_field_tag 'name' + # # => + # + # telephone_field_tag 'tel', '0123456789' + # # => + # + # telephone_field_tag 'tel', nil, class: 'special_input' + # # => + # + # telephone_field_tag 'tel', '0123456789', class: 'special_input', disabled: true + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#720 + def phone_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # :call-seq: + # radio_button_tag(name, value, options = {}) + # radio_button_tag(name, value, checked, options = {}) + # + # Creates a radio button; use groups of radio buttons named the same to allow users to + # select from a group of options. + # + # ==== Options + # * :checked - If set to true, the radio button will be selected by default. + # * :disabled - If set to true, the user will not be able to use this input. + # * Any other key creates standard HTML options for the tag. + # + # ==== Examples + # radio_button_tag 'favorite_color', 'maroon' + # # => + # + # radio_button_tag 'receive_updates', 'no', true + # # => + # + # radio_button_tag 'time_slot', "3:00 p.m.", false, disabled: true + # # => + # + # radio_button_tag 'color', "green", true, class: "color_input" + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#496 + def radio_button_tag(name, value, *args); end + + # Creates a range form element. + # + # ==== Options + # + # Supports the same options as #number_field_tag. + # + # ==== Examples + # + # range_field_tag 'quantity', '1' + # # => + # + # range_field_tag 'quantity', in: 1...10 + # # => + # + # range_field_tag 'quantity', min: 1, max: 10, step: 2 + # # => + # + # search_field_tag 'search', 'Enter your search query here' + # # => + # + # search_field_tag 'search', nil, class: 'special_input' + # # => + # + # search_field_tag 'search', 'Enter your search query here', class: 'special_input', disabled: true + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#694 + def search_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a dropdown selection box, or if the :multiple option is set to true, a multiple + # choice selection box. + # + # Helpers::FormOptions can be used to create common select boxes such as countries, time zones, or + # associated records. option_tags is a string containing the option tags for the select box. + # + # ==== Options + # * :multiple - If set to true, the selection will allow multiple choices. + # * :disabled - If set to true, the user will not be able to use this input. + # * :include_blank - If set to true, an empty option will be created. If set to a string, the string will be used as the option's content and the value will be empty. + # * :prompt - Create a prompt option with blank value and the text asking user to select something. + # * Any other key creates standard HTML attributes for the tag. + # + # ==== Examples + # select_tag "people", options_from_collection_for_select(@people, "id", "name") + # # + # + # select_tag "people", options_from_collection_for_select(@people, "id", "name", "1") + # # + # + # select_tag "people", raw("") + # # => + # + # select_tag "count", raw("") + # # => + # + # select_tag "colors", raw(""), multiple: true + # # => + # + # select_tag "locations", raw("") + # # => + # + # select_tag "access", raw(""), multiple: true, class: 'form_input', id: 'unique_id' + # # => + # + # select_tag "people", options_from_collection_for_select(@people, "id", "name"), include_blank: true + # # => + # + # select_tag "people", options_from_collection_for_select(@people, "id", "name"), include_blank: "All" + # # => + # + # select_tag "people", options_from_collection_for_select(@people, "id", "name"), prompt: "Select something" + # # => + # + # select_tag "destination", raw(""), disabled: true + # # => + # + # select_tag "credit_card", options_for_select([ "VISA", "MasterCard" ], "MasterCard") + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#200 + def select_tag(name, option_tags = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a submit button with the text value as the caption. + # + # ==== Options + # * :data - This option can be used to add custom data attributes. + # * :disabled - If true, the user will not be able to use this input. + # * Any other key creates standard HTML options for the tag. + # + # ==== Examples + # submit_tag + # # => + # + # submit_tag "Edit this article" + # # => + # + # submit_tag "Save edits", disabled: true + # # => + # + # submit_tag nil, class: "form_submit" + # # => + # + # submit_tag "Edit", class: "edit_button" + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#530 + def submit_tag(value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a text field of type "tel". + # + # ==== Options + # + # Supports the same options as #text_field_tag. + # + # ==== Examples + # + # telephone_field_tag 'name' + # # => + # + # telephone_field_tag 'tel', '0123456789' + # # => + # + # telephone_field_tag 'tel', nil, class: 'special_input' + # # => + # + # telephone_field_tag 'tel', '0123456789', class: 'special_input', disabled: true + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#717 + def telephone_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a text input area; use a textarea for longer text inputs such as blog posts or descriptions. + # + # ==== Options + # * :size - A string specifying the dimensions (columns by rows) of the textarea (e.g., "25x10"). + # * :rows - Specify the number of rows in the textarea + # * :cols - Specify the number of columns in the textarea + # * :disabled - If set to true, the user will not be able to use this input. + # * :escape - By default, the contents of the text input are HTML escaped. + # If you need unescaped contents, set this to false. + # * Any other key creates standard HTML attributes for the tag. + # + # ==== Examples + # textarea_tag 'post' + # # => + # + # textarea_tag 'bio', @user.bio + # # => + # + # textarea_tag 'body', nil, rows: 10, cols: 25 + # # => + # + # textarea_tag 'body', nil, size: "25x10" + # # => + # + # textarea_tag 'description', "Description goes here.", disabled: true + # # => + # + # textarea_tag 'comment', nil, class: 'comment_input' + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#428 + def text_area_tag(name, content = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a standard text field; use these text fields to input smaller chunks of text like a username + # or a search query. + # + # ==== Options + # * :disabled - If set to true, the user will not be able to use this input. + # * :size - The number of visible characters that will fit in the input. + # * :maxlength - The maximum number of characters that the browser will allow the user to enter. + # * :placeholder - The text contained in the field by default which is removed when the field receives focus. + # If set to true, use the translation found in the current I18n locale + # (through helpers.placeholder..). + # * Any other key creates standard HTML attributes for the tag. + # + # ==== Examples + # text_field_tag 'name' + # # => + # + # text_field_tag 'query', 'Enter your search query here' + # # => + # + # text_field_tag 'search', nil, placeholder: 'Enter search term...' + # # => + # + # text_field_tag 'request', nil, class: 'special_input' + # # => + # + # text_field_tag 'address', '', size: 75 + # # => + # + # text_field_tag 'zip', nil, maxlength: 5 + # # => + # + # text_field_tag 'payment_amount', '$0.00', disabled: true + # # => + # + # text_field_tag 'ip', '0.0.0.0', maxlength: 15, size: 20, class: "ip-input" + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#262 + def text_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a text input area; use a textarea for longer text inputs such as blog posts or descriptions. + # + # ==== Options + # * :size - A string specifying the dimensions (columns by rows) of the textarea (e.g., "25x10"). + # * :rows - Specify the number of rows in the textarea + # * :cols - Specify the number of columns in the textarea + # * :disabled - If set to true, the user will not be able to use this input. + # * :escape - By default, the contents of the text input are HTML escaped. + # If you need unescaped contents, set this to false. + # * Any other key creates standard HTML attributes for the tag. + # + # ==== Examples + # textarea_tag 'post' + # # => + # + # textarea_tag 'bio', @user.bio + # # => + # + # textarea_tag 'body', nil, rows: 10, cols: 25 + # # => + # + # textarea_tag 'body', nil, size: "25x10" + # # => + # + # textarea_tag 'description', "Description goes here.", disabled: true + # # => + # + # textarea_tag 'comment', nil, class: 'comment_input' + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#416 + def textarea_tag(name, content = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a text field of type "time". + # + # ==== Options + # + # Supports the same options as #text_field_tag. Additionally, supports: + # + # * :min - The minimum acceptable value. + # * :max - The maximum acceptable value. + # * :step - The acceptable value granularity. + # * :include_seconds - Include seconds and ms in the output timestamp format (true by default). + # + # ==== Examples + # + # time_field_tag 'name' + # # => + # + # time_field_tag 'time', '01:01' + # # => + # + # time_field_tag 'time', nil, class: 'special_input' + # # => + # + # time_field_tag 'time', '01:01', include_seconds: true + # # => + # + # time_field_tag 'time', '01:01', min: '00:00', max: '23:59', step: 1 + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#772 + def time_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a text field of type "url". + # + # ==== Options + # + # Supports the same options as #text_field_tag. + # + # ==== Examples + # + # url_field_tag 'name' + # # => + # + # url_field_tag 'url', 'http://rubyonrails.org' + # # => + # + # url_field_tag 'url', nil, class: 'special_input' + # # => + # + # url_field_tag 'url', 'http://rubyonrails.org', class: 'special_input', disabled: true + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#879 + def url_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates the hidden UTF-8 enforcer tag. Override this method in a helper + # to customize the tag. + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#981 + def utf8_enforcer_tag; end + + # Creates a text field of type "week". + # + # ==== Options + # + # Supports the same options as #text_field_tag. Additionally, supports: + # + # * :min - The minimum acceptable value. + # * :max - The maximum acceptable value. + # * :step - The acceptable value granularity. + # + # ==== Examples + # + # week_field_tag 'name' + # # => + # + # week_field_tag 'week', '2014-W01' + # # => + # + # week_field_tag 'week', nil, class: 'special_input' + # # => + # + # week_field_tag 'week', '2014-W01', class: 'special_input', disabled: true + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#856 + def week_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + private + + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#1083 + def convert_direct_upload_option_to_url(options); end + + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#1021 + def extra_tags_for_form(html_options); end + + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#1051 + def form_tag_html(html_options); end + + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#1057 + def form_tag_with_body(html_options, content); end + + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#994 + def html_options_for_form(url_for_options, options); end + + # see http://www.w3.org/TR/html4/types.html#type-name + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#1064 + def sanitize_to_id(name); end + + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#1068 + def set_default_disable_with(value, tag_options); end + + class << self + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#28 + def default_enforce_utf8; end + + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#28 + def default_enforce_utf8=(val); end + + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#25 + def embed_authenticity_token_in_remote_forms; end + + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#25 + def embed_authenticity_token_in_remote_forms=(val); end + end +end + +# = Action View JavaScript \Helpers +# +# source://actionview//lib/action_view/helpers/javascript_helper.rb#6 +module ActionView::Helpers::JavaScriptHelper + # source://actionview//lib/action_view/helpers/javascript_helper.rb#7 + def auto_include_nonce; end + + # source://actionview//lib/action_view/helpers/javascript_helper.rb#7 + def auto_include_nonce=(val); end + + # Escapes carriage returns and single and double quotes for JavaScript segments. + # + # Also available through the alias j(). This is particularly helpful in JavaScript + # responses, like: + # + # $('some_element').replaceWith('<%= j render 'some/element_template' %>'); + # + # source://actionview//lib/action_view/helpers/javascript_helper.rb#30 + def escape_javascript(javascript); end + + # Escapes carriage returns and single and double quotes for JavaScript segments. + # + # Also available through the alias j(). This is particularly helpful in JavaScript + # responses, like: + # + # $('some_element').replaceWith('<%= j render 'some/element_template' %>'); + # + # source://actionview//lib/action_view/helpers/javascript_helper.rb#40 + def j(javascript); end + + # source://actionview//lib/action_view/helpers/javascript_helper.rb#95 + def javascript_cdata_section(content); end + + # Returns a JavaScript tag with the +content+ inside. Example: + # javascript_tag "alert('All is good')" + # + # Returns: + # + # + # +html_options+ may be a hash of attributes for the \ + # + # Instead of passing the content as an argument, you can also use a block + # in which case, you pass your +html_options+ as the first parameter. + # + # <%= javascript_tag type: 'application/javascript' do -%> + # alert('All is good') + # <% end -%> + # + # If you have a content security policy enabled then you can add an automatic + # nonce value by passing nonce: true as part of +html_options+. Example: + # + # <%= javascript_tag nonce: true do -%> + # alert('All is good') + # <% end -%> + # + # source://actionview//lib/action_view/helpers/javascript_helper.rb#77 + def javascript_tag(content_or_options_with_block = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + class << self + # source://actionview//lib/action_view/helpers/javascript_helper.rb#7 + def auto_include_nonce; end + + # source://actionview//lib/action_view/helpers/javascript_helper.rb#7 + def auto_include_nonce=(val); end + end +end + +# source://actionview//lib/action_view/helpers/javascript_helper.rb#9 +ActionView::Helpers::JavaScriptHelper::JS_ESCAPE_MAP = T.let(T.unsafe(nil), Hash) + +# = Action View Number \Helpers +# +# Provides methods for converting numbers into formatted strings. +# Methods are provided for phone numbers, currency, percentage, +# precision, positional notation, file size, and pretty printing. +# +# Most methods expect a +number+ argument, and will return it +# unchanged if can't be converted into a valid number. +# +# source://actionview//lib/action_view/helpers/number_helper.rb#17 +module ActionView::Helpers::NumberHelper + # Delegates to ActiveSupport::NumberHelper#number_to_currency. + # + # number_to_currency("1234") # => "$1234.00" + # + # Additionally, supports a +:raise+ option that will cause + # InvalidNumberError to be raised if +number+ is not a valid number: + # + # number_to_currency("12x34") # => "$12x34" + # number_to_currency("12x34", raise: true) # => InvalidNumberError + # + # source://actionview//lib/action_view/helpers/number_helper.rb#55 + def number_to_currency(number, options = T.unsafe(nil)); end + + # Delegates to ActiveSupport::NumberHelper#number_to_human. + # + # number_to_human("1234") # => "1.23 Thousand" + # + # Additionally, supports a +:raise+ option that will cause + # InvalidNumberError to be raised if +number+ is not a valid number: + # + # number_to_human("12x34") # => "12x34" + # number_to_human("12x34", raise: true) # => InvalidNumberError + # + # source://actionview//lib/action_view/helpers/number_helper.rb#125 + def number_to_human(number, options = T.unsafe(nil)); end + + # Delegates to ActiveSupport::NumberHelper#number_to_human_size. + # + # number_to_human_size("1234") # => "1.21 KB" + # + # Additionally, supports a +:raise+ option that will cause + # InvalidNumberError to be raised if +number+ is not a valid number: + # + # number_to_human_size("12x34") # => "12x34" + # number_to_human_size("12x34", raise: true) # => InvalidNumberError + # + # source://actionview//lib/action_view/helpers/number_helper.rb#111 + def number_to_human_size(number, options = T.unsafe(nil)); end + + # Delegates to ActiveSupport::NumberHelper#number_to_percentage. + # + # number_to_percentage("99") # => "99.000%" + # + # Additionally, supports a +:raise+ option that will cause + # InvalidNumberError to be raised if +number+ is not a valid number: + # + # number_to_percentage("99x") # => "99x%" + # number_to_percentage("99x", raise: true) # => InvalidNumberError + # + # source://actionview//lib/action_view/helpers/number_helper.rb#69 + def number_to_percentage(number, options = T.unsafe(nil)); end + + # Delegates to ActiveSupport::NumberHelper#number_to_phone. + # + # number_to_phone("1234567890") # => "123-456-7890" + # + # Additionally, supports a +:raise+ option that will cause + # InvalidNumberError to be raised if +number+ is not a valid number: + # + # number_to_phone("12x34") # => "12x34" + # number_to_phone("12x34", raise: true) # => InvalidNumberError + # + # source://actionview//lib/action_view/helpers/number_helper.rb#37 + def number_to_phone(number, options = T.unsafe(nil)); end + + # Delegates to ActiveSupport::NumberHelper#number_to_delimited. + # + # number_with_delimiter("1234") # => "1,234" + # + # Additionally, supports a +:raise+ option that will cause + # InvalidNumberError to be raised if +number+ is not a valid number: + # + # number_with_delimiter("12x34") # => "12x34" + # number_with_delimiter("12x34", raise: true) # => InvalidNumberError + # + # source://actionview//lib/action_view/helpers/number_helper.rb#83 + def number_with_delimiter(number, options = T.unsafe(nil)); end + + # Delegates to ActiveSupport::NumberHelper#number_to_rounded. + # + # number_with_precision("1234") # => "1234.000" + # + # Additionally, supports a +:raise+ option that will cause + # InvalidNumberError to be raised if +number+ is not a valid number: + # + # number_with_precision("12x34") # => "12x34" + # number_with_precision("12x34", raise: true) # => InvalidNumberError + # + # source://actionview//lib/action_view/helpers/number_helper.rb#97 + def number_with_precision(number, options = T.unsafe(nil)); end + + private + + # source://actionview//lib/action_view/helpers/number_helper.rb#130 + def delegate_number_helper_method(method, number, options); end + + # source://actionview//lib/action_view/helpers/number_helper.rb#149 + def escape_units(units); end + + # source://actionview//lib/action_view/helpers/number_helper.rb#139 + def escape_unsafe_options(options); end + + # @raise [InvalidNumberError] + # + # source://actionview//lib/action_view/helpers/number_helper.rb#172 + def parse_float(number, raise_error); end + + # @return [Boolean] + # + # source://actionview//lib/action_view/helpers/number_helper.rb#168 + def valid_float?(number); end + + # @raise [InvalidNumberError] + # + # source://actionview//lib/action_view/helpers/number_helper.rb#155 + def wrap_with_output_safety_handling(number, raise_on_invalid, &block); end +end + +# Raised when argument +number+ param given to the helpers is invalid and +# the option +:raise+ is set to +true+. +# +# source://actionview//lib/action_view/helpers/number_helper.rb#20 +class ActionView::Helpers::NumberHelper::InvalidNumberError < ::StandardError + # @return [InvalidNumberError] a new instance of InvalidNumberError + # + # source://actionview//lib/action_view/helpers/number_helper.rb#22 + def initialize(number); end + + # Returns the value of attribute number. + # + # source://actionview//lib/action_view/helpers/number_helper.rb#21 + def number; end + + # Sets the attribute number + # + # @param value the value to set the attribute number to. + # + # source://actionview//lib/action_view/helpers/number_helper.rb#21 + def number=(_arg0); end +end + +# = Action View Raw Output \Helpers +# +# source://actionview//lib/action_view/helpers/output_safety_helper.rb#8 +module ActionView::Helpers::OutputSafetyHelper + # This method outputs without escaping a string. Since escaping tags is + # now default, this can be used when you don't want \Rails to automatically + # escape tags. This is not recommended if the data is coming from the user's + # input. + # + # For example: + # + # raw @user.name + # # => 'Jimmy Tables' + # + # source://actionview//lib/action_view/helpers/output_safety_helper.rb#18 + def raw(stringish); end + + # This method returns an HTML safe string similar to what Array#join + # would return. The array is flattened, and all items, including + # the supplied separator, are HTML escaped unless they are HTML + # safe, and the returned string is marked as HTML safe. + # + # safe_join([tag.p("foo"), "

    bar

    "], "
    ") + # # => "

    foo

    <br><p>bar</p>" + # + # safe_join([tag.p("foo"), tag.p("bar")], tag.br) + # # => "

    foo


    bar

    " + # + # source://actionview//lib/action_view/helpers/output_safety_helper.rb#33 + def safe_join(array, sep = T.unsafe(nil)); end + + # Converts the array to a comma-separated sentence where the last element is + # joined by the connector word. This is the html_safe-aware version of + # ActiveSupport's Array#to_sentence. + # + # source://actionview//lib/action_view/helpers/output_safety_helper.rb#42 + def to_sentence(array, options = T.unsafe(nil)); end +end + +# # Action View Rendering Helpers +# +# Implements methods that allow rendering from a view context. In order to use +# this module, all you need is to implement view_renderer that returns an +# ActionView::Renderer object. +# +# source://actionview//lib/action_view/helpers/rendering_helper.rb#12 +module ActionView::Helpers::RenderingHelper + # Overrides _layout_for in the context object so it supports the case a block is + # passed to a partial. Returns the contents that are yielded to a layout, given + # a name or a block. + # + # You can think of a layout as a method that is called with a block. If the user + # calls `yield :some_name`, the block, by default, returns + # `content_for(:some_name)`. If the user calls simply `yield`, the default block + # returns `content_for(:layout)`. + # + # The user can override this default by passing a block to the layout: + # + # # The template + # <%= render layout: "my_layout" do %> + # Content + # <% end %> + # + # # The layout + # + # <%= yield %> + # + # + # In this case, instead of the default block, which would return `content_for(:layout)`, + # this method returns the block that was passed in to `render :layout`, and the response + # would be + # + # + # Content + # + # + # Finally, the block can take block arguments, which can be passed in by + # `yield`: + # + # # The template + # <%= render layout: "my_layout" do |customer| %> + # Hello <%= customer.name %> + # <% end %> + # + # # The layout + # + # <%= yield Struct.new(:name).new("David") %> + # + # + # In this case, the layout would receive the block passed into `render :layout`, + # and the struct specified would be passed into the block as an argument. The result + # would be + # + # + # Hello David + # + # + # source://actionview//lib/action_view/helpers/rendering_helper.rb#207 + def _layout_for(*args, &block); end + + # Renders a template and returns the result. + # + # Pass the template to render as the first argument. This is shorthand + # syntax for partial rendering, so the template filename should be + # prefixed with an underscore. The partial renderer looks for the partial + # template in the directory of the calling template first. + # + # <% # app/views/posts/new.html.erb %> + # <%= render "form" %> + # # => renders app/views/posts/_form.html.erb + # + # Use the complete view path to render a partial from another directory. + # + # <% # app/views/posts/show.html.erb %> + # <%= render "comments/form" %> + # # => renders app/views/comments/_form.html.erb + # + # Without the rendering mode, the second argument can be a Hash of local + # variable assignments for the template. + # + # <% # app/views/posts/new.html.erb %> + # <%= render "form", post: Post.new %> + # # => renders app/views/posts/_form.html.erb + # + # If the first argument responds to `render_in`, the template will be rendered + # by calling `render_in` with the current view context. + # + # class Greeting + # def render_in(view_context) + # view_context.render html: "

    Hello, World

    " + # end + # + # def format + # :html + # end + # end + # + # <%= render Greeting.new %> + # # => "

    Hello, World

    " + # + # #### Rendering Mode + # + # Pass the rendering mode as first argument to override it. + # + # `:partial` + # + # <%= render partial: "form", locals: { post: Post.new } %> + # # => renders app/views/posts/_form.html.erb + # + # `:file` + # unsanitized user input. + # + # <%= render file: "/path/to/some/file" %> + # # => renders /path/to/some/file + # + # `:inline` + # + # <% name = "World" %> + # <%= render inline: "

    Hello, <%= name %>!

    " %> + # # => renders "

    Hello, World!

    " + # + # `:body` + # + # <%= render body: "Hello, World!" %> + # # => renders "Hello, World!" + # + # `:plain` + # + # <%= render plain: "Hello, World!" %> + # # => renders "Hello, World!" + # + # `:html` + # `:html`. If the string is not `html_safe?`, performs HTML escaping on + # the string before rendering. + # + # <%= render html: "

    Hello, World!

    ".html_safe %> + # # => renders "

    Hello, World!

    " + # + # <%= render html: "

    Hello, World!

    " %> + # # => renders "<h1>Hello, World!</h1>" + # + # `:renderable` + # context. The format is determined by calling `format` on the + # renderable if it responds to `format`, falling back to `:html` by + # default. + # + # <%= render renderable: Greeting.new %> + # # => renders "

    Hello, World

    " + # + # + # #### Options + # + # `:locals` + # + # <%= render inline: "

    Hello, <%= name %>!

    ", locals: { name: "World" } %> + # # => renders "

    Hello, World!

    " + # + # `:formats` + # + # <% # app/views/posts/show.html.erb %> + # <%= render template: "posts/content", formats: [:text] %> + # # => renders app/views/posts/content.text.erb + # + # `:variants` + # + # <% # app/views/posts/show.html.erb %> + # <%= render template: "posts/content", variants: [:tablet] %> + # # => renders app/views/posts/content.html+tablet.erb + # + # `:handlers` + # + # <% # app/views/posts/show.html.erb %> + # <%= render template: "posts/content", handlers: [:builder] %> + # # => renders app/views/posts/content.html.builder + # + # source://actionview//lib/action_view/helpers/rendering_helper.rb#138 + def render(options = T.unsafe(nil), locals = T.unsafe(nil), &block); end +end + +# = Action View Sanitize \Helpers +# +# The SanitizeHelper module provides a set of methods for scrubbing text of undesired HTML elements. +# These helper methods extend Action View making them callable within your template files. +# +# source://actionview//lib/action_view/helpers/sanitize_helper.rb#11 +module ActionView::Helpers::SanitizeHelper + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionView::Helpers::SanitizeHelper::ClassMethods + + # Sanitizes HTML input, stripping all but known-safe tags and attributes. + # + # It also strips +href+ / +src+ attributes with unsafe protocols like +javascript:+, while + # also protecting against attempts to use Unicode, ASCII, and hex character references to work + # around these protocol filters. + # + # The default sanitizer is +Rails::HTML5::SafeListSanitizer+. See {Rails HTML + # Sanitizers}[https://github.com/rails/rails-html-sanitizer] for more information. + # + # Custom sanitization rules can also be provided. + # + # Warning: Adding disallowed tags or attributes to the allowlists may introduce + # vulnerabilities into your application. Please rely on the default allowlists whenever + # possible, because they are curated to maintain security and safety. If you think that the + # default allowlists should be expanded, please {open an issue on the rails-html-sanitizer + # project}[https://github.com/rails/rails-html-sanitizer/issues]. + # + # Please note that sanitizing user-provided text does not guarantee that the + # resulting markup is valid or even well-formed. + # + # ==== Options + # + # [+:tags+] + # An array of allowed tags. + # + # [+:attributes+] + # An array of allowed attributes. + # + # [+:scrubber+] + # A {Rails::HTML scrubber}[https://github.com/rails/rails-html-sanitizer] + # or {Loofah::Scrubber}[https://github.com/flavorjones/loofah] object that + # defines custom sanitization rules. A custom scrubber takes precedence over + # custom tags and attributes. + # + # ==== Examples + # + # ===== Normal use + # + # <%= sanitize @comment.body %> + # + # ===== Providing custom lists of permitted tags and attributes + # + # <%= sanitize @comment.body, tags: %w(strong em a), attributes: %w(href) %> + # + # ===== Providing a custom +Rails::HTML+ scrubber + # + # class CommentScrubber < Rails::HTML::PermitScrubber + # def initialize + # super + # self.tags = %w( form script comment blockquote ) + # self.attributes = %w( style ) + # end + # + # def skip_node?(node) + # node.text? + # end + # end + # + # + # + # <%= sanitize @comment.body, scrubber: CommentScrubber.new %> + # + # See {Rails HTML Sanitizer}[https://github.com/rails/rails-html-sanitizer] for + # documentation about +Rails::HTML+ scrubbers. + # + # ===== Providing a custom +Loofah::Scrubber+ + # + # scrubber = Loofah::Scrubber.new do |node| + # node.remove if node.name == 'script' + # end + # + # + # + # <%= sanitize @comment.body, scrubber: scrubber %> + # + # See {Loofah's documentation}[https://github.com/flavorjones/loofah] for more + # information about defining custom +Loofah::Scrubber+ objects. + # + # ==== Global Configuration + # + # To set the default allowed tags or attributes across your application: + # + # # In config/application.rb + # config.action_view.sanitized_allowed_tags = ['strong', 'em', 'a'] + # config.action_view.sanitized_allowed_attributes = ['href', 'title'] + # + # The default, starting in \Rails 7.1, is to use an HTML5 parser for sanitization (if it is + # available, see NOTE below). If you wish to revert back to the previous HTML4 behavior, you + # can do so by setting the following in your application configuration: + # + # # In config/application.rb + # config.action_view.sanitizer_vendor = Rails::HTML4::Sanitizer + # + # Or, if you're upgrading from a previous version of \Rails and wish to opt into the HTML5 + # behavior: + # + # # In config/application.rb + # config.action_view.sanitizer_vendor = Rails::HTML5::Sanitizer + # + # NOTE: +Rails::HTML5::Sanitizer+ is not supported on JRuby, so on JRuby platforms \Rails will + # fall back to using +Rails::HTML4::Sanitizer+. + # + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#117 + def sanitize(html, options = T.unsafe(nil)); end + + # Sanitizes a block of CSS code. Used by #sanitize when it comes across a style attribute. + # + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#122 + def sanitize_css(style); end + + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#12 + def sanitizer_vendor; end + + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#12 + def sanitizer_vendor=(val); end + + # Strips all link tags from +html+ leaving just the link text. + # + # strip_links('Ruby on Rails') + # # => Ruby on Rails + # + # strip_links('Please e-mail me at me@email.com.') + # # => Please e-mail me at me@email.com. + # + # strip_links('Blog: Visit.') + # # => Blog: Visit. + # + # strip_links('<malformed & link') + # # => <malformed & link + # + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#156 + def strip_links(html); end + + # Strips all HTML tags from +html+, including comments and special characters. + # + # strip_tags("Strip these tags!") + # # => Strip these tags! + # + # strip_tags("Bold no more! See more here...") + # # => Bold no more! See more here... + # + # strip_tags("
    Welcome to my website!
    ") + # # => Welcome to my website! + # + # strip_tags("> A quote from Smith & Wesson") + # # => > A quote from Smith & Wesson + # + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#139 + def strip_tags(html); end + + class << self + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#12 + def sanitizer_vendor; end + + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#12 + def sanitizer_vendor=(val); end + end +end + +# source://actionview//lib/action_view/helpers/sanitize_helper.rb#160 +module ActionView::Helpers::SanitizeHelper::ClassMethods + # Gets the Rails::HTML::FullSanitizer instance used by +strip_tags+. Replace with + # any object that responds to +sanitize+. + # + # class Application < Rails::Application + # config.action_view.full_sanitizer = MySpecialSanitizer.new + # end + # + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#181 + def full_sanitizer; end + + # Sets the attribute full_sanitizer + # + # @param value the value to set the attribute full_sanitizer to. + # + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#161 + def full_sanitizer=(_arg0); end + + # Gets the Rails::HTML::LinkSanitizer instance used by +strip_links+. + # Replace with any object that responds to +sanitize+. + # + # class Application < Rails::Application + # config.action_view.link_sanitizer = MySpecialSanitizer.new + # end + # + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#191 + def link_sanitizer; end + + # Sets the attribute link_sanitizer + # + # @param value the value to set the attribute link_sanitizer to. + # + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#161 + def link_sanitizer=(_arg0); end + + # Gets the Rails::HTML::SafeListSanitizer instance used by sanitize and +sanitize_css+. + # Replace with any object that responds to +sanitize+. + # + # class Application < Rails::Application + # config.action_view.safe_list_sanitizer = MySpecialSanitizer.new + # end + # + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#201 + def safe_list_sanitizer; end + + # Sets the attribute safe_list_sanitizer + # + # @param value the value to set the attribute safe_list_sanitizer to. + # + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#161 + def safe_list_sanitizer=(_arg0); end + + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#171 + def sanitized_allowed_attributes; end + + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#167 + def sanitized_allowed_tags; end + + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#163 + def sanitizer_vendor; end +end + +# = Action View Tag \Helpers +# +# Provides methods to generate HTML tags programmatically both as a modern +# HTML5 compliant builder style and legacy XHTML compliant tags. +# +# source://actionview//lib/action_view/helpers/tag_helper.rb#16 +module ActionView::Helpers::TagHelper + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + + # Returns a CDATA section with the given +content+. CDATA sections + # are used to escape blocks of text containing characters which would + # otherwise be recognized as markup. CDATA sections begin with the string + # and end with (and may not contain) the string ]]>. + # + # cdata_section("") + # # => ]]> + # + # cdata_section(File.read("hello_world.txt")) + # # => + # + # cdata_section("hello]]>world") + # # => world]]> + # + # source://actionview//lib/action_view/helpers/tag_helper.rb#555 + def cdata_section(content); end + + # Returns a string of tokens built from +args+. + # + # ==== Examples + # token_list("foo", "bar") + # # => "foo bar" + # token_list("foo", "foo bar") + # # => "foo bar" + # token_list({ foo: true, bar: false }) + # # => "foo" + # token_list(nil, false, 123, "", "foo", { bar: true }) + # # => "123 foo bar" + # + # source://actionview//lib/action_view/helpers/tag_helper.rb#540 + def class_names(*args); end + + # Returns an HTML block tag of type +name+ surrounding the +content+. Add + # HTML attributes by passing an attributes hash to +options+. + # Instead of passing the content as an argument, you can also use a block + # in which case, you pass your +options+ as the second parameter. + # Set escape to false to disable escaping. + # Note: this is legacy syntax, see +tag+ method description for details. + # + # ==== Options + # The +options+ hash can be used with attributes with no value like (disabled and + # readonly), which you can give a value of true in the +options+ hash. You can use + # symbols or strings for the attribute names. + # + # ==== Examples + # content_tag(:p, "Hello world!") + # # =>

    Hello world!

    + # content_tag(:div, content_tag(:p, "Hello world!"), class: "strong") + # # =>

    Hello world!

    + # content_tag(:div, "Hello world!", class: ["strong", "highlight"]) + # # =>
    Hello world!
    + # content_tag(:div, "Hello world!", class: ["strong", { highlight: current_user.admin? }]) + # # =>
    Hello world!
    + # content_tag("select", options, multiple: true) + # # => + # + # <%= content_tag :div, class: "strong" do -%> + # Hello world! + # <% end -%> + # # =>
    Hello world!
    + # + # source://actionview//lib/action_view/helpers/tag_helper.rb#513 + def content_tag(name, content_or_options_with_block = T.unsafe(nil), options = T.unsafe(nil), escape = T.unsafe(nil), &block); end + + # Returns an escaped version of +html+ without affecting existing escaped entities. + # + # escape_once("1 < 2 & 3") + # # => "1 < 2 & 3" + # + # escape_once("<< Accept & Checkout") + # # => "<< Accept & Checkout" + # + # source://actionview//lib/action_view/helpers/tag_helper.rb#567 + def escape_once(html); end + + # Returns an HTML tag. + # + # === Building HTML tags + # + # Builds HTML5 compliant tags with a tag proxy. Every tag can be built with: + # + # tag.(optional content, options) + # + # where tag name can be e.g. br, div, section, article, or any tag really. + # + # ==== Passing content + # + # Tags can pass content to embed within it: + # + # tag.h1 'All titles fit to print' # =>

    All titles fit to print

    + # + # tag.div tag.p('Hello world!') # =>

    Hello world!

    + # + # Content can also be captured with a block, which is useful in templates: + # + # <%= tag.p do %> + # The next great American novel starts here. + # <% end %> + # # =>

    The next great American novel starts here.

    + # + # ==== Options + # + # Use symbol keyed options to add attributes to the generated tag. + # + # tag.section class: %w( kitties puppies ) + # # =>
    + # + # tag.section id: dom_id(@post) + # # =>
    + # + # Pass +true+ for any attributes that can render with no values, like +disabled+ and +readonly+. + # + # tag.input type: 'text', disabled: true + # # => + # + # HTML5 data-* and aria-* attributes can be set with a + # single +data+ or +aria+ key pointing to a hash of sub-attributes. + # + # To play nicely with JavaScript conventions, sub-attributes are dasherized. + # + # tag.article data: { user_id: 123 } + # # =>
    + # + # Thus data-user-id can be accessed as dataset.userId. + # + # Data attribute values are encoded to JSON, with the exception of strings, symbols, and + # BigDecimals. + # This may come in handy when using jQuery's HTML5-aware .data() + # from 1.4.3. + # + # tag.div data: { city_state: %w( Chicago IL ) } + # # =>
    + # + # The generated tag names and attributes are escaped by default. This can be disabled using + # +escape+. + # + # tag.img src: 'open & shut.png' + # # => + # + # tag.img src: 'open & shut.png', escape: false + # # => + # + # The tag builder respects + # {HTML5 void elements}[https://www.w3.org/TR/html5/syntax.html#void-elements] + # if no content is passed, and omits closing tags for those elements. + # + # # A standard element: + # tag.div # =>
    + # + # # A void element: + # tag.br # =>
    + # + # Note that when using the block form options should be wrapped in + # parenthesis. + # + # <%= tag.a(href: "/about", class: "font-bold") do %> + # About the author + # <% end %> + # # => About the author + # + # === Building HTML attributes + # + # Transforms a Hash into HTML attributes, ready to be interpolated into + # ERB. Includes or omits boolean attributes based on their truthiness. + # Transforms keys nested within + # aria: or data: objects into aria- and data- + # prefixed attributes: + # + # > + # # => + # + # + # # => + # + # === Legacy syntax + # + # The following format is for legacy syntax support. It will be deprecated in future versions of \Rails. + # + # tag(name, options = nil, open = false, escape = true) + # + # It returns an empty HTML tag of type +name+ which by default is XHTML + # compliant. Set +open+ to true to create an open tag compatible + # with HTML 4.0 and below. Add HTML attributes by passing an attributes + # hash to +options+. Set +escape+ to false to disable attribute value + # escaping. + # + # ==== Options + # + # You can use symbols or strings for the attribute names. + # + # Use +true+ with boolean attributes that can render with no value, like + # +disabled+ and +readonly+. + # + # HTML5 data-* attributes can be set with a single +data+ key + # pointing to a hash of sub-attributes. + # + # ==== Examples + # + # tag("br") + # # =>
    + # + # tag("br", nil, true) + # # =>
    + # + # tag("input", type: 'text', disabled: true) + # # => + # + # tag("input", type: 'text', class: ["strong", "highlight"]) + # # => + # + # tag("img", src: "open & shut.png") + # # => + # + # tag("img", { src: "open & shut.png" }, false, false) + # # => + # + # tag("div", data: { name: 'Stephen', city_state: %w(Chicago IL) }) + # # =>
    + # + # tag("div", class: { highlight: current_user.admin? }) + # # =>
    + # + # source://actionview//lib/action_view/helpers/tag_helper.rb#476 + def tag(name = T.unsafe(nil), options = T.unsafe(nil), open = T.unsafe(nil), escape = T.unsafe(nil)); end + + # Returns a string of tokens built from +args+. + # + # ==== Examples + # token_list("foo", "bar") + # # => "foo bar" + # token_list("foo", "foo bar") + # # => "foo bar" + # token_list({ foo: true, bar: false }) + # # => "foo" + # token_list(nil, false, 123, "", "foo", { bar: true }) + # # => "123 foo bar" + # + # source://actionview//lib/action_view/helpers/tag_helper.rb#535 + def token_list(*args); end + + private + + # source://actionview//lib/action_view/helpers/tag_helper.rb#577 + def build_tag_values(*args); end + + # @raise [ArgumentError] + # + # source://actionview//lib/action_view/helpers/tag_helper.rb#572 + def ensure_valid_html5_tag_name(name); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#597 + def tag_builder; end + + class << self + # source://actionview//lib/action_view/helpers/tag_helper.rb#595 + def build_tag_values(*args); end + + # @raise [ArgumentError] + # + # source://actionview//lib/action_view/helpers/tag_helper.rb#575 + def ensure_valid_html5_tag_name(name); end + end +end + +# source://actionview//lib/action_view/helpers/tag_helper.rb#33 +ActionView::Helpers::TagHelper::ARIA_PREFIXES = T.let(T.unsafe(nil), Set) + +# source://actionview//lib/action_view/helpers/tag_helper.rb#20 +ActionView::Helpers::TagHelper::BOOLEAN_ATTRIBUTES = T.let(T.unsafe(nil), Set) + +# source://actionview//lib/action_view/helpers/tag_helper.rb#34 +ActionView::Helpers::TagHelper::DATA_PREFIXES = T.let(T.unsafe(nil), Set) + +# source://actionview//lib/action_view/helpers/tag_helper.rb#42 +ActionView::Helpers::TagHelper::PRE_CONTENT_STRINGS = T.let(T.unsafe(nil), Hash) + +# source://actionview//lib/action_view/helpers/tag_helper.rb#36 +ActionView::Helpers::TagHelper::TAG_TYPES = T.let(T.unsafe(nil), Hash) + +# source://actionview//lib/action_view/helpers/tag_helper.rb#46 +class ActionView::Helpers::TagHelper::TagBuilder + # @return [TagBuilder] a new instance of TagBuilder + # + # source://actionview//lib/action_view/helpers/tag_helper.rb#213 + def initialize(view_context); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def a(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def abbr(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def address(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def animate(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def animate_motion(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def animate_transform(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def area(escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def article(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def aside(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # Transforms a Hash into HTML Attributes, ready to be interpolated into + # ERB. + # + # > + # # => + # + # source://actionview//lib/action_view/helpers/tag_helper.rb#222 + def attributes(attributes); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def audio(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def b(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def base(escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def bdi(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def bdo(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def blockquote(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def body(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def br(escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def button(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def canvas(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def caption(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def circle(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def cite(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def code(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def col(escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def colgroup(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#226 + def content_tag_string(name, content, options, escape = T.unsafe(nil)); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def data(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def datalist(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def dd(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def del(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def details(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def dfn(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def dialog(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def div(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def dl(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def dt(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def ellipse(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def em(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def embed(escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def fieldset(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def figcaption(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def figure(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def footer(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def form(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def h1(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def h2(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def h3(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def h4(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def h5(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def h6(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def head(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def header(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def hgroup(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def hr(escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def html(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def i(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def iframe(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def img(escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def input(escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def ins(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def kbd(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def keygen(escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def label(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def legend(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def li(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def line(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def link(escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def main(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def map(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def mark(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def menu(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def meta(escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def meter(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def nav(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def noscript(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def object(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def ol(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def optgroup(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def option(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def output(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def p(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def path(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def picture(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def polygon(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def polyline(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def portal(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def pre(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def progress(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def q(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def rect(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def rp(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def rt(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def ruby(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def s(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def samp(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def script(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def search(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def section(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def select(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def set(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def slot(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def small(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def source(escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def span(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def stop(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def strong(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def style(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def sub(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def summary(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def sup(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def table(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#235 + def tag_options(options, escape = T.unsafe(nil)); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def tbody(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def td(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def template(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def textarea(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def tfoot(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def th(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def thead(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def time(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def title(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def tr(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def track(escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def u(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def ul(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def use(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def var(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def video(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def view(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def wbr(escape: T.unsafe(nil), **options, &block); end + + private + + # source://actionview//lib/action_view/helpers/tag_helper.rb#288 + def boolean_tag_option(key); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#321 + def method_missing(called, *args, escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#309 + def prefix_tag_option(prefix, key, value, escape); end + + # @return [Boolean] + # + # source://actionview//lib/action_view/helpers/tag_helper.rb#317 + def respond_to_missing?(*args); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#284 + def self_closing_tag_string(name, options, escape = T.unsafe(nil), tag_suffix = T.unsafe(nil)); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#292 + def tag_option(key, value, escape); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#278 + def tag_string(name, content = T.unsafe(nil), options, escape: T.unsafe(nil), &block); end + + class << self + # source://actionview//lib/action_view/helpers/tag_helper.rb#47 + def define_element(name, code_generator:, method_name: T.unsafe(nil)); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#67 + def define_self_closing_element(name, code_generator:, method_name: T.unsafe(nil)); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#58 + def define_void_element(name, code_generator:, method_name: T.unsafe(nil)); end + end +end + +# source://actionview//lib/action_view/helpers/tags.rb#5 +module ActionView::Helpers::Tags + extend ::ActiveSupport::Autoload +end + +# source://actionview//lib/action_view/helpers/tags/base.rb#6 +class ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + include ::ActionView::Helpers::TagHelper + include ::ActionView::Helpers::ContentExfiltrationPreventionHelper + include ::ActionView::Helpers::UrlHelper + include ::ActionView::Helpers::SanitizeHelper + include ::ActionView::Helpers::TextHelper + include ::ActionView::Helpers::FormTagHelper + include ::ActionView::Helpers::ActiveModelInstanceTag + extend ::ActionView::Helpers::UrlHelper::ClassMethods + extend ::ActionView::Helpers::SanitizeHelper::ClassMethods + + # @return [Base] a new instance of Base + # + # source://actionview//lib/action_view/helpers/tags/base.rb#11 + def initialize(object_name, method_name, template_object, options = T.unsafe(nil)); end + + # Returns the value of attribute object. + # + # source://actionview//lib/action_view/helpers/tags/base.rb#9 + def object; end + + # This is what child classes implement. + # + # @raise [NotImplementedError] + # + # source://actionview//lib/action_view/helpers/tags/base.rb#31 + def render; end + + private + + # source://actionview//lib/action_view/helpers/tags/base.rb#97 + def add_default_name_and_field(options, field = T.unsafe(nil)); end + + # source://actionview//lib/action_view/helpers/tags/base.rb#83 + def add_default_name_and_field_for_value(tag_value, options, field = T.unsafe(nil)); end + + # source://actionview//lib/action_view/helpers/tags/base.rb#108 + def add_default_name_and_id(options, field = T.unsafe(nil)); end + + # source://actionview//lib/action_view/helpers/tags/base.rb#95 + def add_default_name_and_id_for_value(tag_value, options, field = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://actionview//lib/action_view/helpers/tags/base.rb#134 + def generate_ids?; end + + # source://actionview//lib/action_view/helpers/tags/base.rb#126 + def name_and_id_index(options); end + + # source://actionview//lib/action_view/helpers/tags/base.rb#74 + def retrieve_autoindex(pre_match); end + + # source://actionview//lib/action_view/helpers/tags/base.rb#63 + def retrieve_object(object); end + + # source://actionview//lib/action_view/helpers/tags/base.rb#118 + def sanitized_method_name; end + + # source://actionview//lib/action_view/helpers/tags/base.rb#122 + def sanitized_value(value); end + + # source://actionview//lib/action_view/helpers/tags/base.rb#114 + def tag_id(index = T.unsafe(nil), namespace = T.unsafe(nil)); end + + # source://actionview//lib/action_view/helpers/tags/base.rb#110 + def tag_name(multiple = T.unsafe(nil), index = T.unsafe(nil)); end + + # source://actionview//lib/action_view/helpers/tags/base.rb#36 + def value; end + + # source://actionview//lib/action_view/helpers/tags/base.rb#46 + def value_before_type_cast; end + + # @return [Boolean] + # + # source://actionview//lib/action_view/helpers/tags/base.rb#58 + def value_came_from_user?; end +end + +# source://actionview//lib/action_view/helpers/tags/check_box.rb#8 +class ActionView::Helpers::Tags::CheckBox < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::Checkable + + # @return [CheckBox] a new instance of CheckBox + # + # source://actionview//lib/action_view/helpers/tags/check_box.rb#11 + def initialize(object_name, method_name, template_object, checked_value, unchecked_value, options); end + + # source://actionview//lib/action_view/helpers/tags/check_box.rb#17 + def render; end + + private + + # @return [Boolean] + # + # source://actionview//lib/action_view/helpers/tags/check_box.rb#42 + def checked?(value); end + + # source://actionview//lib/action_view/helpers/tags/check_box.rb#59 + def hidden_field_for_checkbox(options); end +end + +# source://actionview//lib/action_view/helpers/tags/checkable.rb#6 +module ActionView::Helpers::Tags::Checkable + # @return [Boolean] + # + # source://actionview//lib/action_view/helpers/tags/checkable.rb#7 + def input_checked?(options); end +end + +# source://actionview//lib/action_view/helpers/tags/collection_check_boxes.rb#8 +class ActionView::Helpers::Tags::CollectionCheckBoxes < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::CollectionHelpers + include ::ActionView::Helpers::FormOptionsHelper + + # source://actionview//lib/action_view/helpers/tags/collection_check_boxes.rb#22 + def render(&block); end + + private + + # source://actionview//lib/action_view/helpers/tags/collection_check_boxes.rb#31 + def hidden_field_name; end + + # source://actionview//lib/action_view/helpers/tags/collection_check_boxes.rb#27 + def render_component(builder); end +end + +# source://actionview//lib/action_view/helpers/tags/collection_check_boxes.rb#12 +class ActionView::Helpers::Tags::CollectionCheckBoxes::CheckBoxBuilder < ::ActionView::Helpers::Tags::CollectionHelpers::Builder + # source://actionview//lib/action_view/helpers/tags/collection_check_boxes.rb#19 + def check_box(extra_html_options = T.unsafe(nil)); end + + # source://actionview//lib/action_view/helpers/tags/collection_check_boxes.rb#13 + def checkbox(extra_html_options = T.unsafe(nil)); end +end + +# source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#6 +module ActionView::Helpers::Tags::CollectionHelpers + # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#30 + def initialize(object_name, method_name, template_object, collection, value_method, text_method, options, html_options); end + + private + + # Generate default options for collection helpers, such as :checked and + # :disabled. + # + # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#47 + def default_html_options_for_collection(item, value); end + + # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#107 + def hidden_field; end + + # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#113 + def hidden_field_name; end + + # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#40 + def instantiate_builder(builder_class, item, value, text, html_options); end + + # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#75 + def render_collection; end + + # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#86 + def render_collection_for(builder_class, &block); end + + # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#71 + def sanitize_attribute_name(value); end +end + +# source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#7 +class ActionView::Helpers::Tags::CollectionHelpers::Builder + # @return [Builder] a new instance of Builder + # + # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#10 + def initialize(template_object, object_name, method_name, object, sanitized_attribute_name, text, value, input_html_options); end + + # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#22 + def label(label_html_options = T.unsafe(nil), &block); end + + # Returns the value of attribute object. + # + # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#8 + def object; end + + # Returns the value of attribute text. + # + # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#8 + def text; end + + # Returns the value of attribute value. + # + # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#8 + def value; end +end + +# source://actionview//lib/action_view/helpers/tags/collection_radio_buttons.rb#8 +class ActionView::Helpers::Tags::CollectionRadioButtons < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::CollectionHelpers + include ::ActionView::Helpers::FormOptionsHelper + + # source://actionview//lib/action_view/helpers/tags/collection_radio_buttons.rb#20 + def render(&block); end + + private + + # source://actionview//lib/action_view/helpers/tags/collection_radio_buttons.rb#25 + def render_component(builder); end +end + +# source://actionview//lib/action_view/helpers/tags/collection_radio_buttons.rb#12 +class ActionView::Helpers::Tags::CollectionRadioButtons::RadioButtonBuilder < ::ActionView::Helpers::Tags::CollectionHelpers::Builder + # source://actionview//lib/action_view/helpers/tags/collection_radio_buttons.rb#13 + def radio_button(extra_html_options = T.unsafe(nil)); end +end + +# source://actionview//lib/action_view/helpers/tags/collection_select.rb#6 +class ActionView::Helpers::Tags::CollectionSelect < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::SelectRenderer + include ::ActionView::Helpers::FormOptionsHelper + + # @return [CollectionSelect] a new instance of CollectionSelect + # + # source://actionview//lib/action_view/helpers/tags/collection_select.rb#10 + def initialize(object_name, method_name, template_object, collection, value_method, text_method, options, html_options); end + + # source://actionview//lib/action_view/helpers/tags/collection_select.rb#19 + def render; end +end + +# source://actionview//lib/action_view/helpers/tags/color_field.rb#6 +class ActionView::Helpers::Tags::ColorField < ::ActionView::Helpers::Tags::TextField + # source://actionview//lib/action_view/helpers/tags/color_field.rb#7 + def render; end + + private + + # source://actionview//lib/action_view/helpers/tags/color_field.rb#15 + def validate_color_string(string); end +end + +# source://actionview//lib/action_view/helpers/tags/date_field.rb#6 +class ActionView::Helpers::Tags::DateField < ::ActionView::Helpers::Tags::DatetimeField + private + + # source://actionview//lib/action_view/helpers/tags/date_field.rb#8 + def format_datetime(value); end +end + +# source://actionview//lib/action_view/helpers/tags/date_select.rb#8 +class ActionView::Helpers::Tags::DateSelect < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::SelectRenderer + + # @return [DateSelect] a new instance of DateSelect + # + # source://actionview//lib/action_view/helpers/tags/date_select.rb#11 + def initialize(object_name, method_name, template_object, options, html_options); end + + # source://actionview//lib/action_view/helpers/tags/date_select.rb#17 + def render; end + + private + + # source://actionview//lib/action_view/helpers/tags/date_select.rb#32 + def datetime_selector(options, html_options); end + + # source://actionview//lib/action_view/helpers/tags/date_select.rb#45 + def default_datetime(options); end + + # source://actionview//lib/action_view/helpers/tags/date_select.rb#28 + def select_type; end + + class << self + # source://actionview//lib/action_view/helpers/tags/date_select.rb#22 + def select_type; end + end +end + +# source://actionview//lib/action_view/helpers/tags/datetime_field.rb#6 +class ActionView::Helpers::Tags::DatetimeField < ::ActionView::Helpers::Tags::TextField + # source://actionview//lib/action_view/helpers/tags/datetime_field.rb#7 + def render; end + + private + + # source://actionview//lib/action_view/helpers/tags/datetime_field.rb#17 + def datetime_value(value); end + + # @raise [NotImplementedError] + # + # source://actionview//lib/action_view/helpers/tags/datetime_field.rb#25 + def format_datetime(value); end + + # source://actionview//lib/action_view/helpers/tags/datetime_field.rb#29 + def parse_datetime(value); end +end + +# source://actionview//lib/action_view/helpers/tags/datetime_local_field.rb#6 +class ActionView::Helpers::Tags::DatetimeLocalField < ::ActionView::Helpers::Tags::DatetimeField + # @return [DatetimeLocalField] a new instance of DatetimeLocalField + # + # source://actionview//lib/action_view/helpers/tags/datetime_local_field.rb#7 + def initialize(object_name, method_name, template_object, options = T.unsafe(nil)); end + + private + + # source://actionview//lib/action_view/helpers/tags/datetime_local_field.rb#19 + def format_datetime(value); end + + class << self + # source://actionview//lib/action_view/helpers/tags/datetime_local_field.rb#13 + def field_type; end + end +end + +# source://actionview//lib/action_view/helpers/tags/datetime_select.rb#6 +class ActionView::Helpers::Tags::DatetimeSelect < ::ActionView::Helpers::Tags::DateSelect; end + +# source://actionview//lib/action_view/helpers/tags/email_field.rb#6 +class ActionView::Helpers::Tags::EmailField < ::ActionView::Helpers::Tags::TextField; end + +# source://actionview//lib/action_view/helpers/tags/file_field.rb#6 +class ActionView::Helpers::Tags::FileField < ::ActionView::Helpers::Tags::TextField + # source://actionview//lib/action_view/helpers/tags/file_field.rb#7 + def render; end + + private + + # source://actionview//lib/action_view/helpers/tags/file_field.rb#20 + def hidden_field_for_multiple_file(options); end +end + +# source://actionview//lib/action_view/helpers/tags/grouped_collection_select.rb#6 +class ActionView::Helpers::Tags::GroupedCollectionSelect < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::SelectRenderer + include ::ActionView::Helpers::FormOptionsHelper + + # @return [GroupedCollectionSelect] a new instance of GroupedCollectionSelect + # + # source://actionview//lib/action_view/helpers/tags/grouped_collection_select.rb#10 + def initialize(object_name, method_name, template_object, collection, group_method, group_label_method, option_key_method, option_value_method, options, html_options); end + + # source://actionview//lib/action_view/helpers/tags/grouped_collection_select.rb#21 + def render; end +end + +# source://actionview//lib/action_view/helpers/tags/hidden_field.rb#6 +class ActionView::Helpers::Tags::HiddenField < ::ActionView::Helpers::Tags::TextField + # source://actionview//lib/action_view/helpers/tags/hidden_field.rb#7 + def render; end +end + +# source://actionview//lib/action_view/helpers/tags/label.rb#6 +class ActionView::Helpers::Tags::Label < ::ActionView::Helpers::Tags::Base + # @return [Label] a new instance of Label + # + # source://actionview//lib/action_view/helpers/tags/label.rb#34 + def initialize(object_name, method_name, template_object, content_or_options = T.unsafe(nil), options = T.unsafe(nil)); end + + # source://actionview//lib/action_view/helpers/tags/label.rb#48 + def render(&block); end + + private + + # source://actionview//lib/action_view/helpers/tags/label.rb#71 + def render_component(builder); end +end + +# source://actionview//lib/action_view/helpers/tags/label.rb#7 +class ActionView::Helpers::Tags::Label::LabelBuilder + # @return [LabelBuilder] a new instance of LabelBuilder + # + # source://actionview//lib/action_view/helpers/tags/label.rb#10 + def initialize(template_object, object_name, method_name, object, tag_value); end + + # Returns the value of attribute object. + # + # source://actionview//lib/action_view/helpers/tags/label.rb#8 + def object; end + + # source://actionview//lib/action_view/helpers/tags/label.rb#29 + def to_s; end + + # source://actionview//lib/action_view/helpers/tags/label.rb#18 + def translation; end +end + +# source://actionview//lib/action_view/helpers/tags/month_field.rb#6 +class ActionView::Helpers::Tags::MonthField < ::ActionView::Helpers::Tags::DatetimeField + private + + # source://actionview//lib/action_view/helpers/tags/month_field.rb#8 + def format_datetime(value); end +end + +# source://actionview//lib/action_view/helpers/tags/number_field.rb#6 +class ActionView::Helpers::Tags::NumberField < ::ActionView::Helpers::Tags::TextField + # source://actionview//lib/action_view/helpers/tags/number_field.rb#7 + def render; end +end + +# source://actionview//lib/action_view/helpers/tags/password_field.rb#6 +class ActionView::Helpers::Tags::PasswordField < ::ActionView::Helpers::Tags::TextField + # source://actionview//lib/action_view/helpers/tags/password_field.rb#7 + def render; end +end + +# source://actionview//lib/action_view/helpers/tags/placeholderable.rb#6 +module ActionView::Helpers::Tags::Placeholderable + # source://actionview//lib/action_view/helpers/tags/placeholderable.rb#7 + def initialize(*_arg0); end +end + +# source://actionview//lib/action_view/helpers/tags/radio_button.rb#8 +class ActionView::Helpers::Tags::RadioButton < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::Checkable + + # @return [RadioButton] a new instance of RadioButton + # + # source://actionview//lib/action_view/helpers/tags/radio_button.rb#11 + def initialize(object_name, method_name, template_object, tag_value, options); end + + # source://actionview//lib/action_view/helpers/tags/radio_button.rb#16 + def render; end + + private + + # @return [Boolean] + # + # source://actionview//lib/action_view/helpers/tags/radio_button.rb#26 + def checked?(value); end +end + +# source://actionview//lib/action_view/helpers/tags/range_field.rb#6 +class ActionView::Helpers::Tags::RangeField < ::ActionView::Helpers::Tags::NumberField; end + +# source://actionview//lib/action_view/helpers/tags/search_field.rb#6 +class ActionView::Helpers::Tags::SearchField < ::ActionView::Helpers::Tags::TextField + # source://actionview//lib/action_view/helpers/tags/search_field.rb#7 + def render; end +end + +# source://actionview//lib/action_view/helpers/tags/select.rb#6 +class ActionView::Helpers::Tags::Select < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::SelectRenderer + include ::ActionView::Helpers::FormOptionsHelper + + # @return [Select] a new instance of Select + # + # source://actionview//lib/action_view/helpers/tags/select.rb#10 + def initialize(object_name, method_name, template_object, choices, options, html_options); end + + # source://actionview//lib/action_view/helpers/tags/select.rb#19 + def render; end + + private + + # Grouped choices look like this: + # + # [nil, []] + # { nil => [] } + # + # @return [Boolean] + # + # source://actionview//lib/action_view/helpers/tags/select.rb#39 + def grouped_choices?; end +end + +# source://actionview//lib/action_view/helpers/tags/select_renderer.rb#6 +module ActionView::Helpers::Tags::SelectRenderer + private + + # source://actionview//lib/action_view/helpers/tags/select_renderer.rb#38 + def add_options(option_tags, options, value = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://actionview//lib/action_view/helpers/tags/select_renderer.rb#33 + def placeholder_required?(html_options); end + + # source://actionview//lib/action_view/helpers/tags/select_renderer.rb#8 + def select_content_tag(option_tags, options, html_options); end +end + +# source://actionview//lib/action_view/helpers/tags/tel_field.rb#6 +class ActionView::Helpers::Tags::TelField < ::ActionView::Helpers::Tags::TextField; end + +# source://actionview//lib/action_view/helpers/tags/text_area.rb#8 +class ActionView::Helpers::Tags::TextArea < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::Placeholderable + + # source://actionview//lib/action_view/helpers/tags/text_area.rb#11 + def render; end +end + +# source://actionview//lib/action_view/helpers/tags/text_field.rb#8 +class ActionView::Helpers::Tags::TextField < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::Placeholderable + + # source://actionview//lib/action_view/helpers/tags/text_field.rb#11 + def render; end + + private + + # source://actionview//lib/action_view/helpers/tags/text_field.rb#27 + def field_type; end + + class << self + # source://actionview//lib/action_view/helpers/tags/text_field.rb#21 + def field_type; end + end +end + +# source://actionview//lib/action_view/helpers/tags/time_field.rb#6 +class ActionView::Helpers::Tags::TimeField < ::ActionView::Helpers::Tags::DatetimeField + # @return [TimeField] a new instance of TimeField + # + # source://actionview//lib/action_view/helpers/tags/time_field.rb#7 + def initialize(object_name, method_name, template_object, options = T.unsafe(nil)); end + + private + + # source://actionview//lib/action_view/helpers/tags/time_field.rb#13 + def format_datetime(value); end +end + +# source://actionview//lib/action_view/helpers/tags/time_select.rb#6 +class ActionView::Helpers::Tags::TimeSelect < ::ActionView::Helpers::Tags::DateSelect; end + +# source://actionview//lib/action_view/helpers/tags/time_zone_select.rb#6 +class ActionView::Helpers::Tags::TimeZoneSelect < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::SelectRenderer + include ::ActionView::Helpers::FormOptionsHelper + + # @return [TimeZoneSelect] a new instance of TimeZoneSelect + # + # source://actionview//lib/action_view/helpers/tags/time_zone_select.rb#10 + def initialize(object_name, method_name, template_object, priority_zones, options, html_options); end + + # source://actionview//lib/action_view/helpers/tags/time_zone_select.rb#17 + def render; end +end + +# source://actionview//lib/action_view/helpers/tags/translator.rb#6 +class ActionView::Helpers::Tags::Translator + # @return [Translator] a new instance of Translator + # + # source://actionview//lib/action_view/helpers/tags/translator.rb#7 + def initialize(object, object_name, method_and_value, scope:); end + + # source://actionview//lib/action_view/helpers/tags/translator.rb#14 + def translate; end + + private + + # source://actionview//lib/action_view/helpers/tags/translator.rb#31 + def human_attribute_name; end + + # source://actionview//lib/action_view/helpers/tags/translator.rb#22 + def i18n_default; end + + # Returns the value of attribute method_and_value. + # + # source://actionview//lib/action_view/helpers/tags/translator.rb#20 + def method_and_value; end + + # Returns the value of attribute model. + # + # source://actionview//lib/action_view/helpers/tags/translator.rb#20 + def model; end + + # Returns the value of attribute object_name. + # + # source://actionview//lib/action_view/helpers/tags/translator.rb#20 + def object_name; end + + # Returns the value of attribute scope. + # + # source://actionview//lib/action_view/helpers/tags/translator.rb#20 + def scope; end +end + +# source://actionview//lib/action_view/helpers/tags/url_field.rb#6 +class ActionView::Helpers::Tags::UrlField < ::ActionView::Helpers::Tags::TextField; end + +# source://actionview//lib/action_view/helpers/tags/week_field.rb#6 +class ActionView::Helpers::Tags::WeekField < ::ActionView::Helpers::Tags::DatetimeField + private + + # source://actionview//lib/action_view/helpers/tags/week_field.rb#8 + def format_datetime(value); end +end + +# source://actionview//lib/action_view/helpers/tags/weekday_select.rb#6 +class ActionView::Helpers::Tags::WeekdaySelect < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::SelectRenderer + include ::ActionView::Helpers::FormOptionsHelper + + # @return [WeekdaySelect] a new instance of WeekdaySelect + # + # source://actionview//lib/action_view/helpers/tags/weekday_select.rb#10 + def initialize(object_name, method_name, template_object, options, html_options); end + + # source://actionview//lib/action_view/helpers/tags/weekday_select.rb#16 + def render; end +end + +# = Action View Text \Helpers +# +# The TextHelper module provides a set of methods for filtering, formatting +# and transforming strings, which can reduce the amount of inline Ruby code in +# your views. These helper methods extend Action View making them callable +# within your template files. +# +# ==== Sanitization +# +# Most text helpers that generate HTML output sanitize the given input by default, +# but do not escape it. This means HTML tags will appear in the page but all malicious +# code will be removed. Let's look at some examples using the +simple_format+ method: +# +# simple_format('Example') +# # => "

    Example

    " +# +# simple_format('Example') +# # => "

    Example

    " +# +# If you want to escape all content, you should invoke the +h+ method before +# calling the text helper. +# +# simple_format h('Example') +# # => "

    <a href=\"http://example.com/\">Example</a>

    " +# +# source://actionview//lib/action_view/helpers/text_helper.rb#36 +module ActionView::Helpers::TextHelper + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + include ::ActionView::Helpers::TagHelper + extend ::ActiveSupport::Concern + include ::ActionView::Helpers::SanitizeHelper + + mixes_in_class_methods ::ActionView::Helpers::SanitizeHelper::ClassMethods + + # The preferred method of outputting text in your views is to use the + # <%= "text" %> eRuby syntax. The regular +puts+ and +print+ methods + # do not operate as expected in an eRuby code block. If you absolutely must + # output text within a non-output code block (i.e., <% %>), you + # can use the +concat+ method. + # + # <% concat "hello" %> is equivalent to <%= "hello" %> + # + # <% + # unless signed_in? + # concat link_to("Sign In", action: :sign_in) + # end + # %> + # + # is equivalent to + # + # <% unless signed_in? %> + # <%= link_to "Sign In", action: :sign_in %> + # <% end %> + # + # source://actionview//lib/action_view/helpers/text_helper.rb#63 + def concat(string); end + + # Returns the current cycle string after a cycle has been started. Useful + # for complex table highlighting or any other design need which requires + # the current cycle string in more than one place. + # + # <%# Alternate background colors %> + # <% @items = [1,2,3,4] %> + # <% @items.each do |item| %> + #
    "> + # <%= item %> + #
    + # <% end %> + # + # source://actionview//lib/action_view/helpers/text_helper.rb#461 + def current_cycle(name = T.unsafe(nil)); end + + # Creates a Cycle object whose +to_s+ method cycles through elements of an + # array every time it is called. This can be used for example, to alternate + # classes for table rows. You can use named cycles to allow nesting in loops. + # Passing a Hash as the last parameter with a :name key will create a + # named cycle. The default name for a cycle without a +:name+ key is + # "default". You can manually reset a cycle by calling reset_cycle + # and passing the name of the cycle. The current cycle string can be obtained + # anytime using the current_cycle method. + # + # <%# Alternate CSS classes for even and odd numbers... %> + # <% @items = [1,2,3,4] %> + # + # <% @items.each do |item| %> + # "> + # + # + # <% end %> + #
    <%= item %>
    + # + # + # <%# Cycle CSS classes for rows, and text colors for values within each row %> + # <% @items = [ + # { first: "Robert", middle: "Daniel", last: "James" }, + # { first: "Emily", middle: "Shannon", maiden: "Pike", last: "Hicks" }, + # { first: "June", middle: "Dae", last: "Jones" }, + # ] %> + # <% @items.each do |item| %> + # "> + # + # <% item.values.each do |value| %> + # <%# Create a named cycle "colors" %> + # "> + # <%= value %> + # + # <% end %> + # <% reset_cycle("colors") %> + # + # + # <% end %> + # + # source://actionview//lib/action_view/helpers/text_helper.rb#437 + def cycle(first_value, *values); end + + # Extracts the first occurrence of +phrase+ plus surrounding text from + # +text+. An omission marker is prepended / appended if the start / end of + # the result does not coincide with the start / end of +text+. The result + # is always stripped in any case. Returns +nil+ if +phrase+ isn't found. + # + # ==== Options + # + # [+:radius+] + # The number of characters (or tokens — see +:separator+ option) around + # +phrase+ to include in the result. Defaults to 100. + # + # [+:omission+] + # The marker to prepend / append when the start / end of the excerpt + # does not coincide with the start / end of +text+. Defaults to + # "...". + # + # [+:separator+] + # The separator between tokens to count for +:radius+. Defaults to + # "", which treats each character as a token. + # + # ==== Examples + # + # excerpt('This is an example', 'an', radius: 5) + # # => "...s is an exam..." + # + # excerpt('This is an example', 'is', radius: 5) + # # => "This is a..." + # + # excerpt('This is an example', 'is') + # # => "This is an example" + # + # excerpt('This next thing is an example', 'ex', radius: 2) + # # => "...next..." + # + # excerpt('This is also an example', 'an', radius: 8, omission: ' ') + # # => " is also an example" + # + # excerpt('This is a very beautiful morning', 'very', separator: ' ', radius: 1) + # # => "...a very beautiful..." + # + # source://actionview//lib/action_view/helpers/text_helper.rb#235 + def excerpt(text, phrase, options = T.unsafe(nil)); end + + # Highlights occurrences of +phrases+ in +text+ by formatting them with a + # highlighter string. +phrases+ can be one or more strings or regular + # expressions. The result will be marked HTML safe. By default, +text+ is + # sanitized before highlighting to prevent possible XSS attacks. + # + # If a block is specified, it will be used instead of the highlighter + # string. Each occurrence of a phrase will be passed to the block, and its + # return value will be inserted into the final result. + # + # ==== Options + # + # [+:highlighter+] + # The highlighter string. Uses \1 as the placeholder for a + # phrase, similar to +String#sub+. Defaults to "\1". + # This option is ignored if a block is specified. + # + # [+:sanitize+] + # Whether to sanitize +text+ before highlighting. Defaults to true. + # + # ==== Examples + # + # highlight('You searched for: rails', 'rails') + # # => "You searched for: rails" + # + # highlight('You searched for: rails', /for|rails/) + # # => "You searched for: rails" + # + # highlight('You searched for: ruby, rails, dhh', 'actionpack') + # # => "You searched for: ruby, rails, dhh" + # + # highlight('You searched for: rails', ['for', 'rails'], highlighter: '\1') + # # => "You searched for: rails" + # + # highlight('You searched for: rails', 'rails', highlighter: '\1') + # # => "You searched for: rails" + # + # highlight('You searched for: rails', 'rails') { |match| link_to(search_path(q: match)) } + # # => "You searched for: rails" + # + # highlight('ruby on rails', 'rails', sanitize: false) + # # => "ruby on rails" + # + # source://actionview//lib/action_view/helpers/text_helper.rb#174 + def highlight(text, phrases, options = T.unsafe(nil), &block); end + + # Attempts to pluralize the +singular+ word unless +count+ is 1. If + # +plural+ is supplied, it will use that when count is > 1, otherwise + # it will use the Inflector to determine the plural form for the given locale, + # which defaults to +I18n.locale+. + # + # The word will be pluralized using rules defined for the locale + # (you must define your own inflection rules for languages other than English). + # See ActiveSupport::Inflector.pluralize. + # + # pluralize(1, 'person') + # # => "1 person" + # + # pluralize(2, 'person') + # # => "2 people" + # + # pluralize(3, 'person', plural: 'users') + # # => "3 users" + # + # pluralize(0, 'person') + # # => "0 people" + # + # pluralize(2, 'Person', locale: :de) + # # => "2 Personen" + # + # source://actionview//lib/action_view/helpers/text_helper.rb#297 + def pluralize(count, singular, plural_arg = T.unsafe(nil), plural: T.unsafe(nil), locale: T.unsafe(nil)); end + + # Resets a cycle so that it starts from the first element the next time + # it is called. Pass in +name+ to reset a named cycle. + # + # <%# Alternate CSS classes for even and odd numbers... %> + # <% @items = [[1,2,3,4], [5,6,3], [3,4,5,6,7,4]] %> + # + # <% @items.each do |item| %> + # "> + # <% item.each do |value| %> + # "> + # <%= value %> + # + # <% end %> + # + # <% reset_cycle("colors") %> + # + # <% end %> + #
    + # + # source://actionview//lib/action_view/helpers/text_helper.rb#484 + def reset_cycle(name = T.unsafe(nil)); end + + # source://actionview//lib/action_view/helpers/text_helper.rb#67 + def safe_concat(string); end + + # Returns +text+ transformed into HTML using simple formatting rules. + # Two or more consecutive newlines (\n\n or \r\n\r\n) are + # considered a paragraph and wrapped in

    tags. One newline + # (\n or \r\n) is considered a linebreak and a + #
    tag is appended. This method does not remove the + # newlines from the +text+. + # + # You can pass any HTML attributes into html_options. These + # will be added to all created paragraphs. + # + # ==== Options + # * :sanitize - If +false+, does not sanitize +text+. + # * :sanitize_options - Any extra options you want appended to the sanitize. + # * :wrapper_tag - String representing the wrapper tag, defaults to "p". + # + # ==== Examples + # my_text = "Here is some basic text...\n...with a line break." + # + # simple_format(my_text) + # # => "

    Here is some basic text...\n
    ...with a line break.

    " + # + # simple_format(my_text, {}, wrapper_tag: "div") + # # => "
    Here is some basic text...\n
    ...with a line break.
    " + # + # more_text = "We want to put a paragraph...\n\n...right there." + # + # simple_format(more_text) + # # => "

    We want to put a paragraph...

    \n\n

    ...right there.

    " + # + # simple_format("Look ma! A class!", class: 'description') + # # => "

    Look ma! A class!

    " + # + # simple_format("Unblinkable.") + # # => "

    Unblinkable.

    " + # + # simple_format("Blinkable! It's true.", {}, sanitize: false) + # # => "

    Blinkable! It's true.

    " + # + # simple_format("Continue", {}, { sanitize_options: { attributes: %w[target href] } }) + # # => "

    Continue

    " + # + # source://actionview//lib/action_view/helpers/text_helper.rb#383 + def simple_format(text, html_options = T.unsafe(nil), options = T.unsafe(nil)); end + + # Truncates +text+ if it is longer than a specified +:length+. If +text+ + # is truncated, an omission marker will be appended to the result for a + # total length not exceeding +:length+. + # + # You can also pass a block to render and append extra content after the + # omission marker when +text+ is truncated. However, this content _can_ + # cause the total length to exceed +:length+ characters. + # + # The result will be escaped unless escape: false is specified. + # In any case, the result will be marked HTML-safe. Care should be taken + # if +text+ might contain HTML tags or entities, because truncation could + # produce invalid HTML, such as unbalanced or incomplete tags. + # + # ==== Options + # + # [+:length+] + # The maximum number of characters that should be returned, excluding + # any extra content from the block. Defaults to 30. + # + # [+:omission+] + # The string to append after truncating. Defaults to "...". + # + # [+:separator+] + # A string or regexp used to find a breaking point at which to truncate. + # By default, truncation can occur at any character in +text+. + # + # [+:escape+] + # Whether to escape the result. Defaults to true. + # + # ==== Examples + # + # truncate("Once upon a time in a world far far away") + # # => "Once upon a time in a world..." + # + # truncate("Once upon a time in a world far far away", length: 17) + # # => "Once upon a ti..." + # + # truncate("Once upon a time in a world far far away", length: 17, separator: ' ') + # # => "Once upon a..." + # + # truncate("And they found that many people were sleeping better.", length: 25, omission: '... (continued)') + # # => "And they f... (continued)" + # + # truncate("

    Once upon a time in a world far far away

    ") + # # => "<p>Once upon a time in a wo..." + # + # truncate("

    Once upon a time in a world far far away

    ", escape: false) + # # => "

    Once upon a time in a wo..." + # + # truncate("Once upon a time in a world far far away") { link_to "Continue", "#" } + # # => "Once upon a time in a world...Continue" + # + # source://actionview//lib/action_view/helpers/text_helper.rb#122 + def truncate(text, options = T.unsafe(nil), &block); end + + # Wraps the +text+ into lines no longer than +line_width+ width. This method + # breaks on the first whitespace character that does not exceed +line_width+ + # (which is 80 by default). + # + # word_wrap('Once upon a time') + # # => "Once upon a time" + # + # word_wrap('Once upon a time, in a kingdom called Far Far Away, a king fell ill, and finding a successor to the throne turned out to be more trouble than anyone could have imagined...') + # # => "Once upon a time, in a kingdom called Far Far Away, a king fell ill, and finding\na successor to the throne turned out to be more trouble than anyone could have\nimagined..." + # + # word_wrap('Once upon a time', line_width: 8) + # # => "Once\nupon a\ntime" + # + # word_wrap('Once upon a time', line_width: 1) + # # => "Once\nupon\na\ntime" + # + # You can also specify a custom +break_sequence+ ("\n" by default): + # + # word_wrap('Once upon a time', line_width: 1, break_sequence: "\r\n") + # # => "Once\r\nupon\r\na\r\ntime" + # + # source://actionview//lib/action_view/helpers/text_helper.rb#327 + def word_wrap(text, line_width: T.unsafe(nil), break_sequence: T.unsafe(nil)); end + + private + + # source://actionview//lib/action_view/helpers/text_helper.rb#547 + def cut_excerpt_part(part_position, part, separator, options); end + + # The cycle helpers need to store the cycles in a place that is + # guaranteed to be reset every time a page is rendered, so it + # uses an instance variable of ActionView::Base. + # + # source://actionview//lib/action_view/helpers/text_helper.rb#529 + def get_cycle(name); end + + # source://actionview//lib/action_view/helpers/text_helper.rb#534 + def set_cycle(name, cycle_object); end + + # source://actionview//lib/action_view/helpers/text_helper.rb#539 + def split_paragraphs(text); end +end + +# source://actionview//lib/action_view/helpers/text_helper.rb#489 +class ActionView::Helpers::TextHelper::Cycle + # @return [Cycle] a new instance of Cycle + # + # source://actionview//lib/action_view/helpers/text_helper.rb#492 + def initialize(first_value, *values); end + + # source://actionview//lib/action_view/helpers/text_helper.rb#501 + def current_value; end + + # source://actionview//lib/action_view/helpers/text_helper.rb#497 + def reset; end + + # source://actionview//lib/action_view/helpers/text_helper.rb#505 + def to_s; end + + # Returns the value of attribute values. + # + # source://actionview//lib/action_view/helpers/text_helper.rb#490 + def values; end + + private + + # source://actionview//lib/action_view/helpers/text_helper.rb#512 + def next_index; end + + # source://actionview//lib/action_view/helpers/text_helper.rb#516 + def previous_index; end + + # source://actionview//lib/action_view/helpers/text_helper.rb#520 + def step_index(n); end +end + +# = Action View Translation \Helpers +# +# source://actionview//lib/action_view/helpers/translation_helper.rb#9 +module ActionView::Helpers::TranslationHelper + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + include ::ActionView::Helpers::TagHelper + extend ::ActiveSupport::Concern + + # Delegates to I18n.localize with no additional functionality. + # + # See https://www.rubydoc.info/gems/i18n/I18n/Backend/Base:localize + # for more information. + # + # source://actionview//lib/action_view/helpers/translation_helper.rb#119 + def l(object, **options); end + + # Delegates to I18n.localize with no additional functionality. + # + # See https://www.rubydoc.info/gems/i18n/I18n/Backend/Base:localize + # for more information. + # + # source://actionview//lib/action_view/helpers/translation_helper.rb#116 + def localize(object, **options); end + + # Delegates to I18n#translate but also performs three additional + # functions. + # + # First, it will ensure that any thrown +MissingTranslation+ messages will + # be rendered as inline spans that: + # + # * Have a translation-missing class applied + # * Contain the missing key as the value of the +title+ attribute + # * Have a titleized version of the last key segment as text + # + # For example, the value returned for the missing translation key + # "blog.post.title" will be: + # + # Title + # + # This allows for views to display rather reasonable strings while still + # giving developers a way to find missing translations. + # + # If you would prefer missing translations to raise an error, you can + # opt out of span-wrapping behavior globally by setting + # config.i18n.raise_on_missing_translations = true or + # individually by passing raise: true as an option to + # translate. + # + # Second, if the key starts with a period translate will scope + # the key by the current partial. Calling translate(".foo") from + # the people/index.html.erb template is equivalent to calling + # translate("people.index.foo"). This makes it less + # repetitive to translate many keys within the same partial and provides + # a convention to scope keys consistently. + # + # Third, the translation will be marked as html_safe if the key + # has the suffix "_html" or the last element of the key is "html". Calling + # translate("footer_html") or translate("footer.html") + # will return an HTML safe string that won't be escaped by other HTML + # helper methods. This naming convention helps to identify translations + # that include HTML tags so that you know what kind of output to expect + # when you call translate in a template and translators know which keys + # they can provide HTML values for. + # + # To access the translated text along with the fully resolved + # translation key, translate accepts a block: + # + # <%= translate(".relative_key") do |translation, resolved_key| %> + # <%= translation %> + # <% end %> + # + # This enables annotate translated text to be aware of the scope it was + # resolved against. + # + # source://actionview//lib/action_view/helpers/translation_helper.rb#110 + def t(key, **options); end + + # Delegates to I18n#translate but also performs three additional + # functions. + # + # First, it will ensure that any thrown +MissingTranslation+ messages will + # be rendered as inline spans that: + # + # * Have a translation-missing class applied + # * Contain the missing key as the value of the +title+ attribute + # * Have a titleized version of the last key segment as text + # + # For example, the value returned for the missing translation key + # "blog.post.title" will be: + # + # Title + # + # This allows for views to display rather reasonable strings while still + # giving developers a way to find missing translations. + # + # If you would prefer missing translations to raise an error, you can + # opt out of span-wrapping behavior globally by setting + # config.i18n.raise_on_missing_translations = true or + # individually by passing raise: true as an option to + # translate. + # + # Second, if the key starts with a period translate will scope + # the key by the current partial. Calling translate(".foo") from + # the people/index.html.erb template is equivalent to calling + # translate("people.index.foo"). This makes it less + # repetitive to translate many keys within the same partial and provides + # a convention to scope keys consistently. + # + # Third, the translation will be marked as html_safe if the key + # has the suffix "_html" or the last element of the key is "html". Calling + # translate("footer_html") or translate("footer.html") + # will return an HTML safe string that won't be escaped by other HTML + # helper methods. This naming convention helps to identify translations + # that include HTML tags so that you know what kind of output to expect + # when you call translate in a template and translators know which keys + # they can provide HTML values for. + # + # To access the translated text along with the fully resolved + # translation key, translate accepts a block: + # + # <%= translate(".relative_key") do |translation, resolved_key| %> + # <%= translation %> + # <% end %> + # + # This enables annotate translated text to be aware of the scope it was + # resolved against. + # + # source://actionview//lib/action_view/helpers/translation_helper.rb#73 + def translate(key, **options); end + + private + + # source://actionview//lib/action_view/helpers/translation_helper.rb#142 + def missing_translation(key, options); end + + # source://actionview//lib/action_view/helpers/translation_helper.rb#128 + def scope_key_by_partial(key); end + + class << self + # source://actionview//lib/action_view/helpers/translation_helper.rb#15 + def raise_on_missing_translations; end + + # source://actionview//lib/action_view/helpers/translation_helper.rb#15 + def raise_on_missing_translations=(_arg0); end + end +end + +# source://actionview//lib/action_view/helpers/translation_helper.rb#122 +ActionView::Helpers::TranslationHelper::MISSING_TRANSLATION = T.let(T.unsafe(nil), Integer) + +# source://actionview//lib/action_view/helpers/translation_helper.rb#125 +ActionView::Helpers::TranslationHelper::NO_DEFAULT = T.let(T.unsafe(nil), Array) + +# = Action View URL \Helpers +# +# Provides a set of methods for making links and getting URLs that +# depend on the routing subsystem (see ActionDispatch::Routing). +# This allows you to use the same format for links in views +# and controllers. +# +# source://actionview//lib/action_view/helpers/url_helper.rb#17 +module ActionView::Helpers::UrlHelper + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + include ::ActionView::Helpers::TagHelper + include ::ActionView::Helpers::ContentExfiltrationPreventionHelper + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionView::Helpers::UrlHelper::ClassMethods + + # Generates a form containing a single button that submits to the URL created + # by the set of +options+. This is the safest method to ensure links that + # cause changes to your data are not triggered by search bots or accelerators. + # + # You can control the form and button behavior with +html_options+. Most + # values in +html_options+ are passed through to the button element. For + # example, passing a +:class+ option within +html_options+ will set the + # class attribute of the button element. + # + # The class attribute of the form element can be set by passing a + # +:form_class+ option within +html_options+. It defaults to + # "button_to" to allow styling of the form and its children. + # + # The form submits a POST request by default if the object is not persisted; + # conversely, if the object is persisted, it will submit a PATCH request. + # To specify a different HTTP verb use the +:method+ option within +html_options+. + # + # If the HTML button generated from +button_to+ does not work with your layout, you can + # consider using the +link_to+ method with the +data-turbo-method+ + # attribute as described in the +link_to+ documentation. + # + # ==== Options + # The +options+ hash accepts the same options as +url_for+. To generate a + # element without an [action] attribute, pass + # false: + # + # <%= button_to "New", false %> + # # => " + # # + # # + # #

    " + # + # Most values in +html_options+ are passed through to the button element, + # but there are a few special options: + # + # * :method - \Symbol of HTTP verb. Supported verbs are :post, :get, + # :delete, :patch, and :put. By default it will be :post. + # * :disabled - If set to true, it will generate a disabled button. + # * :data - This option can be used to add custom data attributes. + # * :form - This hash will be form attributes + # * :form_class - This controls the class of the form within which the submit button will + # be placed + # * :params - \Hash of parameters to be rendered as hidden fields within the form. + # + # ==== Examples + # <%= button_to "New", action: "new" %> + # # => "
    + # # + # # + # #
    " + # + # <%= button_to "New", new_article_path %> + # # => "
    + # # + # # + # #
    " + # + # <%= button_to "New", new_article_path, params: { time: Time.now } %> + # # => "
    + # # + # # + # # + # #
    " + # + # <%= button_to [:make_happy, @user] do %> + # Make happy <%= @user.name %> + # <% end %> + # # => "
    + # # + # # + # #
    " + # + # <%= button_to "New", { action: "new" }, form_class: "new-thing" %> + # # => "
    + # # + # # + # #
    " + # + # <%= button_to "Create", { action: "create" }, form: { "data-type" => "json" } %> + # # => "
    + # # + # # + # #
    " + # + # source://actionview//lib/action_view/helpers/url_helper.rb#296 + def button_to(name = T.unsafe(nil), options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # source://actionview//lib/action_view/helpers/url_helper.rb#35 + def button_to_generates_button_tag; end + + # source://actionview//lib/action_view/helpers/url_helper.rb#35 + def button_to_generates_button_tag=(val); end + + # True if the current request URI was generated by the given +options+. + # + # ==== Examples + # Let's say we're in the http://www.example.com/shop/checkout?order=desc&page=1 action. + # + # current_page?(action: 'process') + # # => false + # + # current_page?(action: 'checkout') + # # => true + # + # current_page?(controller: 'library', action: 'checkout') + # # => false + # + # current_page?(controller: 'shop', action: 'checkout') + # # => true + # + # current_page?(controller: 'shop', action: 'checkout', order: 'asc') + # # => false + # + # current_page?(controller: 'shop', action: 'checkout', order: 'desc', page: '1') + # # => true + # + # current_page?(controller: 'shop', action: 'checkout', order: 'desc', page: '2') + # # => false + # + # current_page?('http://www.example.com/shop/checkout') + # # => true + # + # current_page?('http://www.example.com/shop/checkout', check_parameters: true) + # # => false + # + # current_page?('/shop/checkout') + # # => true + # + # current_page?('http://www.example.com/shop/checkout?order=desc&page=1') + # # => true + # + # Different actions may share the same URL path but have a different HTTP method. Let's say we + # sent a POST to http://www.example.com/products and rendered a validation error. + # + # current_page?(controller: 'product', action: 'index') + # # => false + # + # current_page?(controller: 'product', action: 'create') + # # => false + # + # current_page?(controller: 'product', action: 'create', method: :post) + # # => true + # + # current_page?(controller: 'product', action: 'index', method: [:get, :post]) + # # => true + # + # We can also pass in the symbol arguments instead of strings. + # + # @return [Boolean] + # + # source://actionview//lib/action_view/helpers/url_helper.rb#559 + def current_page?(options = T.unsafe(nil), check_parameters: T.unsafe(nil), method: T.unsafe(nil), **options_as_kwargs); end + + # Creates an anchor element of the given +name+ using a URL created by the set of +options+. + # See the valid options in the documentation for +url_for+. It's also possible to + # pass a \String instead of an options hash, which generates an anchor element that uses the + # value of the \String as the href for the link. Using a :back \Symbol instead + # of an options hash will generate a link to the referrer (a JavaScript back link + # will be used in place of a referrer if none exists). If +nil+ is passed as the name + # the value of the link itself will become the name. + # + # ==== Signatures + # + # link_to(body, url, html_options = {}) + # # url is a String; you can use URL helpers like + # # posts_path + # + # link_to(body, url_options = {}, html_options = {}) + # # url_options, except :method, is passed to url_for + # + # link_to(options = {}, html_options = {}) do + # # name + # end + # + # link_to(url, html_options = {}) do + # # name + # end + # + # link_to(active_record_model) + # + # ==== Options + # * :data - This option can be used to add custom data attributes. + # + # ==== Examples + # + # Because it relies on +url_for+, +link_to+ supports both older-style controller/action/id arguments + # and newer RESTful routes. Current \Rails style favors RESTful routes whenever possible, so base + # your application on resources and use + # + # link_to "Profile", profile_path(@profile) + # # => Profile + # + # or the even pithier + # + # link_to "Profile", @profile + # # => Profile + # + # in place of the older more verbose, non-resource-oriented + # + # link_to "Profile", controller: "profiles", action: "show", id: @profile + # # => Profile + # + # Similarly, + # + # link_to "Profiles", profiles_path + # # => Profiles + # + # is better than + # + # link_to "Profiles", controller: "profiles" + # # => Profiles + # + # When name is +nil+ the href is presented instead + # + # link_to nil, "http://example.com" + # # => http://www.example.com + # + # More concise yet, when +name+ is an Active Record model that defines a + # +to_s+ method returning a default value or a model instance attribute + # + # link_to @profile + # # => Eileen + # + # You can use a block as well if your link target is hard to fit into the name parameter. ERB example: + # + # <%= link_to(@profile) do %> + # <%= @profile.name %> -- Check it out! + # <% end %> + # # => + # David -- Check it out! + # + # + # Classes and ids for CSS are easy to produce: + # + # link_to "Articles", articles_path, id: "news", class: "article" + # # => Articles + # + # Be careful when using the older argument style, as an extra literal hash is needed: + # + # link_to "Articles", { controller: "articles" }, id: "news", class: "article" + # # => Articles + # + # Leaving the hash off gives the wrong link: + # + # link_to "WRONG!", controller: "articles", id: "news", class: "article" + # # => WRONG! + # + # +link_to+ can also produce links with anchors or query strings: + # + # link_to "Comment wall", profile_path(@profile, anchor: "wall") + # # => Comment wall + # + # link_to "Ruby on Rails search", controller: "searches", query: "ruby on rails" + # # => Ruby on Rails search + # + # link_to "Nonsense search", searches_path(foo: "bar", baz: "quux") + # # => Nonsense search + # + # You can set any link attributes such as target, rel, type: + # + # link_to "External link", "http://www.rubyonrails.org/", target: "_blank", rel: "nofollow" + # # => External link + # + # ==== Turbo + # + # Rails 7 ships with Turbo enabled by default. Turbo provides the following +:data+ options: + # + # * turbo_method: symbol of HTTP verb - Performs a Turbo link visit + # with the given HTTP verb. Forms are recommended when performing non-+GET+ requests. + # Only use data-turbo-method where a form is not possible. + # + # * turbo_confirm: "question?" - Adds a confirmation dialog to the link with the + # given value. + # + # {Consult the Turbo Handbook for more information on the options + # above.}[https://turbo.hotwired.dev/handbook/drive#performing-visits-with-a-different-method] + # + # ===== \Examples + # + # link_to "Delete profile", @profile, data: { turbo_method: :delete } + # # => Delete profile + # + # link_to "Visit Other Site", "https://rubyonrails.org/", data: { turbo_confirm: "Are you sure?" } + # # => Visit Other Site + # + # source://actionview//lib/action_view/helpers/url_helper.rb#198 + def link_to(name = T.unsafe(nil), options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # Creates a link tag of the given +name+ using a URL created by the set of + # +options+ if +condition+ is true, otherwise only the name is + # returned. To specialize the default behavior, you can pass a block that + # accepts the name or the full argument list for +link_to_if+. + # + # ==== Examples + # <%= link_to_if(@current_user.nil?, "Login", { controller: "sessions", action: "new" }) %> + # # If the user isn't logged in... + # # => Login + # + # <%= + # link_to_if(@current_user.nil?, "Login", { controller: "sessions", action: "new" }) do + # link_to(@current_user.login, { controller: "accounts", action: "show", id: @current_user }) + # end + # %> + # # If the user isn't logged in... + # # => Login + # # If they are logged in... + # # => my_username + # + # source://actionview//lib/action_view/helpers/url_helper.rb#438 + def link_to_if(condition, name, options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # Creates a link tag of the given +name+ using a URL created by the set of + # +options+ unless +condition+ is true, in which case only the name is + # returned. To specialize the default behavior (i.e., show a login link rather + # than just the plaintext link text), you can pass a block that + # accepts the name or the full argument list for +link_to_unless+. + # + # ==== Examples + # <%= link_to_unless(@current_user.nil?, "Reply", { action: "reply" }) %> + # # If the user is logged in... + # # => Reply + # + # <%= + # link_to_unless(@current_user.nil?, "Reply", { action: "reply" }) do |name| + # link_to(name, { controller: "accounts", action: "signup" }) + # end + # %> + # # If the user is logged in... + # # => Reply + # # If not... + # # => Reply + # + # source://actionview//lib/action_view/helpers/url_helper.rb#415 + def link_to_unless(condition, name, options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # Creates a link tag of the given +name+ using a URL created by the set of + # +options+ unless the current request URI is the same as the links, in + # which case only the name is returned (or the given block is yielded, if + # one exists). You can give +link_to_unless_current+ a block which will + # specialize the default behavior (e.g., show a "Start Here" link rather + # than the link's text). + # + # ==== Examples + # Let's say you have a navigation menu... + # + # + # + # If in the "about" action, it will render... + # + # + # + # ...but if in the "index" action, it will render: + # + # + # + # The implicit block given to +link_to_unless_current+ is evaluated if the current + # action is the action given. So, if we had a comments page and wanted to render a + # "Go Back" link instead of a link to the comments page, we could do something like this... + # + # <%= + # link_to_unless_current("Comment", { controller: "comments", action: "new" }) do + # link_to("Go back", { controller: "posts", action: "index" }) + # end + # %> + # + # source://actionview//lib/action_view/helpers/url_helper.rb#391 + def link_to_unless_current(name, options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # Creates a mailto link tag to the specified +email_address+, which is + # also used as the name of the link unless +name+ is specified. Additional + # HTML attributes for the link can be passed in +html_options+. + # + # +mail_to+ has several methods for customizing the email itself by + # passing special keys to +html_options+. + # + # ==== Options + # * :subject - Preset the subject line of the email. + # * :body - Preset the body of the email. + # * :cc - Carbon Copy additional recipients on the email. + # * :bcc - Blind Carbon Copy additional recipients on the email. + # * :reply_to - Preset the +Reply-To+ field of the email. + # + # ==== Obfuscation + # Prior to \Rails 4.0, +mail_to+ provided options for encoding the address + # in order to hinder email harvesters. To take advantage of these options, + # install the +actionview-encoded_mail_to+ gem. + # + # ==== Examples + # mail_to "me@domain.com" + # # => me@domain.com + # + # mail_to "me@domain.com", "My email" + # # => My email + # + # mail_to "me@domain.com", cc: "ccaddress@domain.com", + # subject: "This is an example email" + # # => me@domain.com + # + # You can use a block as well if your link target is hard to fit into the name parameter. ERB example: + # + # <%= mail_to "me@domain.com" do %> + # Email me: me@domain.com + # <% end %> + # # => + # Email me: me@domain.com + # + # + # source://actionview//lib/action_view/helpers/url_helper.rb#488 + def mail_to(email_address, name = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # Creates a TEL anchor link tag to the specified +phone_number+. When the + # link is clicked, the default app to make phone calls is opened and + # prepopulated with the phone number. + # + # If +name+ is not specified, +phone_number+ will be used as the name of + # the link. + # + # A +country_code+ option is supported, which prepends a plus sign and the + # given country code to the linked phone number. For example, + # country_code: "01" will prepend +01 to the linked + # phone number. + # + # Additional HTML attributes for the link can be passed via +html_options+. + # + # ==== Options + # * :country_code - Prepends the country code to the phone number + # + # ==== Examples + # phone_to "1234567890" + # # => 1234567890 + # + # phone_to "1234567890", "Phone me" + # # => Phone me + # + # phone_to "1234567890", country_code: "01" + # # => 1234567890 + # + # You can use a block as well if your link target is hard to fit into the name parameter. \ERB example: + # + # <%= phone_to "1234567890" do %> + # Phone me: + # <% end %> + # # => + # Phone me: + # + # + # source://actionview//lib/action_view/helpers/url_helper.rb#693 + def phone_to(phone_number, name = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # Creates an SMS anchor link tag to the specified +phone_number+. When the + # link is clicked, the default SMS messaging app is opened ready to send a + # message to the linked phone number. If the +body+ option is specified, + # the contents of the message will be preset to +body+. + # + # If +name+ is not specified, +phone_number+ will be used as the name of + # the link. + # + # A +country_code+ option is supported, which prepends a plus sign and the + # given country code to the linked phone number. For example, + # country_code: "01" will prepend +01 to the linked + # phone number. + # + # Additional HTML attributes for the link can be passed via +html_options+. + # + # ==== Options + # * :country_code - Prepend the country code to the phone number. + # * :body - Preset the body of the message. + # + # ==== Examples + # sms_to "5155555785" + # # => 5155555785 + # + # sms_to "5155555785", country_code: "01" + # # => 5155555785 + # + # sms_to "5155555785", "Text me" + # # => Text me + # + # sms_to "5155555785", body: "I have a question about your product." + # # => 5155555785 + # + # You can use a block as well if your link target is hard to fit into the name parameter. \ERB example: + # + # <%= sms_to "5155555785" do %> + # Text me: + # <% end %> + # # => + # Text me: + # + # + # source://actionview//lib/action_view/helpers/url_helper.rb#642 + def sms_to(phone_number, name = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # Basic implementation of url_for to allow use helpers without routes existence + # + # source://actionview//lib/action_view/helpers/url_helper.rb#38 + def url_for(options = T.unsafe(nil)); end + + private + + # source://actionview//lib/action_view/helpers/url_helper.rb#50 + def _back_url; end + + # source://actionview//lib/action_view/helpers/url_helper.rb#55 + def _filtered_referrer; end + + # source://actionview//lib/action_view/helpers/url_helper.rb#736 + def add_method_to_attributes!(html_options, method); end + + # source://actionview//lib/action_view/helpers/url_helper.rb#707 + def convert_options_to_data_attributes(options, html_options); end + + # @return [Boolean] + # + # source://actionview//lib/action_view/helpers/url_helper.rb#730 + def link_to_remote_options?(options); end + + # source://actionview//lib/action_view/helpers/url_helper.rb#747 + def method_for_options(options); end + + # @return [Boolean] + # + # source://actionview//lib/action_view/helpers/url_helper.rb#765 + def method_not_get_method?(method); end + + # source://actionview//lib/action_view/helpers/url_helper.rb#786 + def method_tag(method); end + + # source://actionview//lib/action_view/helpers/url_helper.rb#834 + def remove_trailing_slash!(url_string); end + + # Returns an array of hashes each containing :name and :value keys + # suitable for use as the names and values of form input fields: + # + # to_form_params(name: 'David', nationality: 'Danish') + # # => [{name: 'name', value: 'David'}, {name: 'nationality', value: 'Danish'}] + # + # to_form_params(country: { name: 'Denmark' }) + # # => [{name: 'country[name]', value: 'Denmark'}] + # + # to_form_params(countries: ['Denmark', 'Sweden']}) + # # => [{name: 'countries[]', value: 'Denmark'}, {name: 'countries[]', value: 'Sweden'}] + # + # An optional namespace can be passed to enclose key names: + # + # to_form_params({ name: 'Denmark' }, 'country') + # # => [{name: 'country[name]', value: 'Denmark'}] + # + # source://actionview//lib/action_view/helpers/url_helper.rb#808 + def to_form_params(attribute, namespace = T.unsafe(nil)); end + + # source://actionview//lib/action_view/helpers/url_helper.rb#770 + def token_tag(token = T.unsafe(nil), form_options: T.unsafe(nil)); end + + # source://actionview//lib/action_view/helpers/url_helper.rb#722 + def url_target(name, options); end + + class << self + # source://actionview//lib/action_view/helpers/url_helper.rb#35 + def button_to_generates_button_tag; end + + # source://actionview//lib/action_view/helpers/url_helper.rb#35 + def button_to_generates_button_tag=(val); end + end +end + +# This helper may be included in any class that includes the +# URL helpers of a routes (routes.url_helpers). Some methods +# provided here will only work in the context of a request +# (link_to_unless_current, for instance), which must be provided +# as a method called #request on the context. +# +# source://actionview//lib/action_view/helpers/url_helper.rb#23 +ActionView::Helpers::UrlHelper::BUTTON_TAG_METHOD_VERBS = T.let(T.unsafe(nil), Array) + +# source://actionview//lib/action_view/helpers/url_helper.rb#29 +module ActionView::Helpers::UrlHelper::ClassMethods + # source://actionview//lib/action_view/helpers/url_helper.rb#30 + def _url_for_modules; end +end + +# source://actionview//lib/action_view/helpers/url_helper.rb#757 +ActionView::Helpers::UrlHelper::STRINGIFIED_COMMON_METHODS = T.let(T.unsafe(nil), Hash) + +# This is a class to fix I18n global state. Whenever you provide I18n.locale during a request, +# it will trigger the lookup_context and consequently expire the cache. +# +# source://actionview//lib/action_view/rendering.rb#8 +class ActionView::I18nProxy < ::I18n::Config + # @return [I18nProxy] a new instance of I18nProxy + # + # source://actionview//lib/action_view/rendering.rb#11 + def initialize(original_config, lookup_context); end + + # source://actionview//lib/action_view/rendering.rb#17 + def locale; end + + # source://actionview//lib/action_view/rendering.rb#21 + def locale=(value); end + + # source://actionview//lib/action_view/rendering.rb#9 + def lookup_context; end + + # source://actionview//lib/action_view/rendering.rb#9 + def original_config; end +end + +# = Action View \Layouts +# +# Layouts reverse the common pattern of including shared headers and footers in many templates to isolate changes in +# repeated setups. The inclusion pattern has pages that look like this: +# +# <%= render "application/header" %> +# Hello World +# <%= render "application/footer" %> +# +# This approach is a decent way of keeping common structures isolated from the changing content, but it's verbose +# and if you ever want to change the structure of these two includes, you'll have to change all the templates. +# +# With layouts, you can flip it around and have the common structure know where to insert changing content. This means +# that the header and footer are only mentioned in one place, like this: +# +# // The header part of this layout +# <%= yield %> +# // The footer part of this layout +# +# And then you have content pages that look like this: +# +# hello world +# +# At rendering time, the content page is computed and then inserted in the layout, like this: +# +# // The header part of this layout +# hello world +# // The footer part of this layout +# +# == Accessing shared variables +# +# Layouts have access to variables specified in the content pages and vice versa. This allows you to have layouts with +# references that won't materialize before rendering time: +# +#

    <%= @page_title %>

    +# <%= yield %> +# +# ...and content pages that fulfill these references _at_ rendering time: +# +# <% @page_title = "Welcome" %> +# Off-world colonies offers you a chance to start a new life +# +# The result after rendering is: +# +#

    Welcome

    +# Off-world colonies offers you a chance to start a new life +# +# == Layout assignment +# +# You can either specify a layout declaratively (using the #layout class method) or give +# it the same name as your controller, and place it in app/views/layouts. +# If a subclass does not have a layout specified, it inherits its layout using normal Ruby inheritance. +# +# For instance, if you have PostsController and a template named app/views/layouts/posts.html.erb, +# that template will be used for all actions in PostsController and controllers inheriting +# from PostsController. +# +# If you use a module, for instance Weblog::PostsController, you will need a template named +# app/views/layouts/weblog/posts.html.erb. +# +# Since all your controllers inherit from ApplicationController, they will use +# app/views/layouts/application.html.erb if no other layout is specified +# or provided. +# +# == Inheritance Examples +# +# class BankController < ActionController::Base +# # bank.html.erb exists +# +# class ExchangeController < BankController +# # exchange.html.erb exists +# +# class CurrencyController < BankController +# +# class InformationController < BankController +# layout "information" +# +# class TellerController < InformationController +# # teller.html.erb exists +# +# class EmployeeController < InformationController +# # employee.html.erb exists +# layout nil +# +# class VaultController < BankController +# layout :access_level_layout +# +# class TillController < BankController +# layout false +# +# In these examples, we have three implicit lookup scenarios: +# * The +BankController+ uses the "bank" layout. +# * The +ExchangeController+ uses the "exchange" layout. +# * The +CurrencyController+ inherits the layout from BankController. +# +# However, when a layout is explicitly set, the explicitly set layout wins: +# * The +InformationController+ uses the "information" layout, explicitly set. +# * The +TellerController+ also uses the "information" layout, because the parent explicitly set it. +# * The +EmployeeController+ uses the "employee" layout, because it set the layout to +nil+, resetting the parent configuration. +# * The +VaultController+ chooses a layout dynamically by calling the access_level_layout method. +# * The +TillController+ does not use a layout at all. +# +# == Types of layouts +# +# Layouts are basically just regular templates, but the name of this template needs not be specified statically. Sometimes +# you want to alternate layouts depending on runtime information, such as whether someone is logged in or not. This can +# be done either by specifying a method reference as a symbol or using an inline method (as a proc). +# +# The method reference is the preferred approach to variable layouts and is used like this: +# +# class WeblogController < ActionController::Base +# layout :writers_and_readers +# +# def index +# # fetching posts +# end +# +# private +# def writers_and_readers +# logged_in? ? "writer_layout" : "reader_layout" +# end +# end +# +# Now when a new request for the index action is processed, the layout will vary depending on whether the person accessing +# is logged in or not. +# +# If you want to use an inline method, such as a proc, do something like this: +# +# class WeblogController < ActionController::Base +# layout proc { |controller| controller.logged_in? ? "writer_layout" : "reader_layout" } +# end +# +# If an argument isn't given to the proc, it's evaluated in the context of +# the current controller anyway. +# +# class WeblogController < ActionController::Base +# layout proc { logged_in? ? "writer_layout" : "reader_layout" } +# end +# +# Of course, the most common way of specifying a layout is still just as a plain template name: +# +# class WeblogController < ActionController::Base +# layout "weblog_standard" +# end +# +# The template will be looked always in app/views/layouts/ folder. But you can point +# layouts folder direct also. layout "layouts/demo" is the same as layout "demo". +# +# Setting the layout to +nil+ forces it to be looked up in the filesystem and falls back to the parent behavior if none exists. +# Setting it to +nil+ is useful to re-enable template lookup overriding a previous configuration set in the parent: +# +# class ApplicationController < ActionController::Base +# layout "application" +# end +# +# class PostsController < ApplicationController +# # Will use "application" layout +# end +# +# class CommentsController < ApplicationController +# # Will search for "comments" layout and fall back to "application" layout +# layout nil +# end +# +# == Conditional layouts +# +# If you have a layout that by default is applied to all the actions of a controller, you still have the option of rendering +# a given action or set of actions without a layout, or restricting a layout to only a single action or a set of actions. The +# :only and :except options can be passed to the layout call. For example: +# +# class WeblogController < ActionController::Base +# layout "weblog_standard", except: :rss +# +# # ... +# +# end +# +# This will assign "weblog_standard" as the WeblogController's layout for all actions except for the +rss+ action, which will +# be rendered directly, without wrapping a layout around the rendered view. +# +# Both the :only and :except condition can accept an arbitrary number of method references, so +# except: [ :rss, :text_only ] is valid, as is except: :rss. +# +# == Using a different layout in the action render call +# +# If most of your actions use the same layout, it makes perfect sense to define a controller-wide layout as described above. +# Sometimes you'll have exceptions where one action wants to use a different layout than the rest of the controller. +# You can do this by passing a :layout option to the render call. For example: +# +# class WeblogController < ActionController::Base +# layout "weblog_standard" +# +# def help +# render action: "help", layout: "help" +# end +# end +# +# This will override the controller-wide "weblog_standard" layout, and will render the help action with the "help" layout instead. +# +# source://actionview//lib/action_view/layouts.rb#205 +module ActionView::Layouts + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActionView::ViewPaths + include ::ActionView::Rendering + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionView::ViewPaths::ClassMethods + mixes_in_class_methods ::ActionView::Rendering::ClassMethods + mixes_in_class_methods ::ActionView::Layouts::ClassMethods + + # source://actionview//lib/action_view/layouts.rb#361 + def initialize(*_arg0); end + + # source://actionview//lib/action_view/layouts.rb#350 + def _process_render_template_options(options); end + + # source://actionview//lib/action_view/layouts.rb#359 + def action_has_layout=(_arg0); end + + # Controls whether an action should be rendered using a layout. + # If you want to disable any layout settings for the + # current action so that it is rendered without a layout then + # either override this method in your controller to return false + # for that action or set the action_has_layout attribute + # to false before rendering. + # + # @return [Boolean] + # + # source://actionview//lib/action_view/layouts.rb#372 + def action_has_layout?; end + + private + + # @return [Boolean] + # + # source://actionview//lib/action_view/layouts.rb#377 + def _conditional_layout?; end + + # Returns the default layout for this controller. + # Optionally raises an exception if the layout could not be found. + # + # ==== Parameters + # * formats - The formats accepted to this layout + # * require_layout - If set to +true+ and layout is not found, + # an +ArgumentError+ exception is raised (defaults to +false+) + # + # ==== Returns + # * template - The template object for the default layout (or +nil+) + # + # source://actionview//lib/action_view/layouts.rb#415 + def _default_layout(lookup_context, formats, keys, require_layout = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://actionview//lib/action_view/layouts.rb#430 + def _include_layout?(options); end + + # This will be overwritten by _write_layout_method + # + # source://actionview//lib/action_view/layouts.rb#382 + def _layout(*_arg0); end + + # Determine the layout for a given name, taking into account the name type. + # + # ==== Parameters + # * name - The name of the template + # + # source://actionview//lib/action_view/layouts.rb#388 + def _layout_for_option(name); end + + # source://actionview//lib/action_view/layouts.rb#401 + def _normalize_layout(value); end + + module GeneratedClassMethods + def _layout; end + def _layout=(value); end + def _layout?; end + def _layout_conditions; end + def _layout_conditions=(value); end + def _layout_conditions?; end + end + + module GeneratedInstanceMethods + def _layout_conditions; end + def _layout_conditions?; end + end +end + +# source://actionview//lib/action_view/layouts.rb#217 +module ActionView::Layouts::ClassMethods + # Creates a _layout method to be called by _default_layout . + # + # If a layout is not explicitly mentioned then look for a layout with the controller's name. + # if nothing is found then try same procedure to find super class's layout. + # + # source://actionview//lib/action_view/layouts.rb#283 + def _write_layout_method; end + + # source://actionview//lib/action_view/layouts.rb#218 + def inherited(klass); end + + # Specify the layout to use for this class. + # + # If the specified layout is a: + # String:: the String is the template name + # Symbol:: call the method specified by the symbol + # Proc:: call the passed Proc + # false:: There is no layout + # true:: raise an ArgumentError + # nil:: Force default layout behavior with inheritance + # + # Return value of +Proc+ and +Symbol+ arguments should be +String+, +false+, +true+, or +nil+ + # with the same meaning as described above. + # + # ==== Parameters + # + # * layout - The layout to use. + # + # ==== Options (conditions) + # + # * +:only+ - A list of actions to apply this layout to. + # * +:except+ - Apply this layout to all actions but this one. + # + # source://actionview//lib/action_view/layouts.rb#269 + def layout(layout, conditions = T.unsafe(nil)); end + + private + + # If no layout is supplied, look for a template named the return + # value of this method. + # + # ==== Returns + # * String - A template name + # + # source://actionview//lib/action_view/layouts.rb#345 + def _implied_layout_name; end +end + +# This module is mixed in if layout conditions are provided. This means +# that if no layout conditions are used, this method is not used +# +# source://actionview//lib/action_view/layouts.rb#225 +module ActionView::Layouts::ClassMethods::LayoutConditions + private + + # Determines whether the current action has a layout definition by + # checking the action name against the :only and :except conditions + # set by the layout method. + # + # ==== Returns + # * Boolean - True if the action has a layout definition, false otherwise. + # + # @return [Boolean] + # + # source://actionview//lib/action_view/layouts.rb#233 + def _conditional_layout?; end +end + +# source://actionview//lib/action_view/log_subscriber.rb#6 +class ActionView::LogSubscriber < ::ActiveSupport::LogSubscriber + include ::ActionView::LogSubscriber::Utils + + # @return [LogSubscriber] a new instance of LogSubscriber + # + # source://actionview//lib/action_view/log_subscriber.rb#9 + def initialize; end + + # source://actionview//lib/action_view/log_subscriber.rb#42 + def render_collection(event); end + + # source://actionview//lib/action_view/log_subscriber.rb#34 + def render_layout(event); end + + # source://actionview//lib/action_view/log_subscriber.rb#23 + def render_partial(event); end + + # source://actionview//lib/action_view/log_subscriber.rb#14 + def render_template(event); end + + private + + # source://actionview//lib/action_view/log_subscriber.rb#118 + def cache_message(payload); end + + # source://actionview//lib/action_view/log_subscriber.rb#110 + def render_count(payload); end + + class << self + # source://actionview//lib/action_view/log_subscriber.rb#102 + def attach_to(*_arg0); end + + private + + # source://actionview//lib/action_view/log_subscriber.rb#21 + def __class_attr_log_levels; end + + # source://actionview//lib/action_view/log_subscriber.rb#21 + def __class_attr_log_levels=(new_value); end + end +end + +# source://actionview//lib/action_view/log_subscriber.rb#73 +class ActionView::LogSubscriber::Start + include ::ActionView::LogSubscriber::Utils + + # source://actionview//lib/action_view/log_subscriber.rb#94 + def finish(name, id, payload); end + + # @return [Boolean] + # + # source://actionview//lib/action_view/log_subscriber.rb#97 + def silenced?(_); end + + # source://actionview//lib/action_view/log_subscriber.rb#76 + def start(name, id, payload); end +end + +# source://actionview//lib/action_view/log_subscriber.rb#54 +module ActionView::LogSubscriber::Utils + # source://actionview//lib/action_view/log_subscriber.rb#55 + def logger; end + + private + + # source://actionview//lib/action_view/log_subscriber.rb#60 + def from_rails_root(string); end + + # source://actionview//lib/action_view/log_subscriber.rb#66 + def rails_root; end +end + +# source://actionview//lib/action_view/log_subscriber.rb#7 +ActionView::LogSubscriber::VIEWS_PATTERN = T.let(T.unsafe(nil), Regexp) + +# = Action View Lookup Context +# +# LookupContext is the object responsible for holding all information +# required for looking up templates, i.e. view paths and details. +# LookupContext is also responsible for generating a key, given to +# view paths, used in the resolver cache lookup. Since this key is generated +# only once during the request, it speeds up all cache accesses. +# +# source://actionview//lib/action_view/lookup_context.rb#15 +class ActionView::LookupContext + include ::ActionView::LookupContext::Accessors + include ::ActionView::LookupContext::DetailsCache + include ::ActionView::LookupContext::ViewPaths + + # @return [LookupContext] a new instance of LookupContext + # + # source://actionview//lib/action_view/lookup_context.rb#232 + def initialize(view_paths, details = T.unsafe(nil), prefixes = T.unsafe(nil)); end + + # source://actionview//lib/action_view/lookup_context.rb#242 + def digest_cache; end + + # Override formats= to expand ["*/*"] values and automatically + # add :html as fallback to :js. + # + # source://actionview//lib/action_view/lookup_context.rb#263 + def formats=(values); end + + # Override locale to return a symbol instead of array. + # + # source://actionview//lib/action_view/lookup_context.rb#283 + def locale; end + + # Overload locale= to also set the I18n.locale. If the current I18n.config object responds + # to original_config, it means that it has a copy of the original I18n configuration and it's + # acting as proxy, which we need to skip. + # + # source://actionview//lib/action_view/lookup_context.rb#290 + def locale=(value); end + + # source://actionview//lib/action_view/lookup_context.rb#16 + def prefixes; end + + # source://actionview//lib/action_view/lookup_context.rb#16 + def prefixes=(_arg0); end + + # source://actionview//lib/action_view/lookup_context.rb#246 + def with_prepended_formats(formats); end + + private + + # source://actionview//lib/action_view/lookup_context.rb#253 + def initialize_details(target, details); end + + class << self + # source://actionview//lib/action_view/lookup_context.rb#21 + def register_detail(name, &block); end + + # source://actionview//lib/action_view/lookup_context.rb#18 + def registered_details; end + + # source://actionview//lib/action_view/lookup_context.rb#18 + def registered_details=(_arg0); end + end +end + +# Holds accessors for the registered details. +# +# source://actionview//lib/action_view/lookup_context.rb#39 +module ActionView::LookupContext::Accessors + # source://actionview//lib/action_view/lookup_context.rb#25 + def default_formats; end + + # source://actionview//lib/action_view/lookup_context.rb#25 + def default_handlers; end + + # source://actionview//lib/action_view/lookup_context.rb#25 + def default_locale; end + + # source://actionview//lib/action_view/lookup_context.rb#25 + def default_variants; end + + # source://actionview//lib/action_view/lookup_context.rb#26 + def formats; end + + # source://actionview//lib/action_view/lookup_context.rb#26 + def formats=(value); end + + # source://actionview//lib/action_view/lookup_context.rb#26 + def handlers; end + + # source://actionview//lib/action_view/lookup_context.rb#26 + def handlers=(value); end + + # source://actionview//lib/action_view/lookup_context.rb#26 + def locale; end + + # source://actionview//lib/action_view/lookup_context.rb#26 + def locale=(value); end + + # source://actionview//lib/action_view/lookup_context.rb#26 + def variants; end + + # source://actionview//lib/action_view/lookup_context.rb#26 + def variants=(value); end +end + +# source://actionview//lib/action_view/lookup_context.rb#40 +ActionView::LookupContext::Accessors::DEFAULT_PROCS = T.let(T.unsafe(nil), Hash) + +# Add caching behavior on top of Details. +# +# source://actionview//lib/action_view/lookup_context.rb#98 +module ActionView::LookupContext::DetailsCache + # Returns the value of attribute cache. + # + # source://actionview//lib/action_view/lookup_context.rb#99 + def cache; end + + # Sets the attribute cache + # + # @param value the value to set the attribute cache to. + # + # source://actionview//lib/action_view/lookup_context.rb#99 + def cache=(_arg0); end + + # Calculate the details key. Remove the handlers from calculation to improve performance + # since the user cannot modify it explicitly. + # + # source://actionview//lib/action_view/lookup_context.rb#103 + def details_key; end + + # Temporary skip passing the details_key forward. + # + # source://actionview//lib/action_view/lookup_context.rb#108 + def disable_cache; end + + private + + # source://actionview//lib/action_view/lookup_context.rb#116 + def _set_detail(key, value); end +end + +# source://actionview//lib/action_view/lookup_context.rb#54 +class ActionView::LookupContext::DetailsKey + # source://actionview//lib/action_view/lookup_context.rb#55 + def eql?(_arg0); end + + class << self + # source://actionview//lib/action_view/lookup_context.rb#77 + def clear; end + + # source://actionview//lib/action_view/lookup_context.rb#65 + def details_cache_key(details); end + + # source://actionview//lib/action_view/lookup_context.rb#61 + def digest_cache(details); end + + # source://actionview//lib/action_view/lookup_context.rb#86 + def digest_caches; end + + # source://actionview//lib/action_view/lookup_context.rb#90 + def view_context_class; end + end +end + +# Helpers related to template lookup using the lookup context information. +# +# source://actionview//lib/action_view/lookup_context.rb#125 +module ActionView::LookupContext::ViewPaths + # @return [Boolean] + # + # source://actionview//lib/action_view/lookup_context.rb#148 + def any?(name, prefixes = T.unsafe(nil), partial = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://actionview//lib/action_view/lookup_context.rb#153 + def any_templates?(name, prefixes = T.unsafe(nil), partial = T.unsafe(nil)); end + + # source://actionview//lib/action_view/lookup_context.rb#155 + def append_view_paths(paths); end + + # @return [Boolean] + # + # source://actionview//lib/action_view/lookup_context.rb#141 + def exists?(name, prefixes = T.unsafe(nil), partial = T.unsafe(nil), keys = T.unsafe(nil), **options); end + + # source://actionview//lib/action_view/lookup_context.rb#128 + def find(name, prefixes = T.unsafe(nil), partial = T.unsafe(nil), keys = T.unsafe(nil), options = T.unsafe(nil)); end + + # source://actionview//lib/action_view/lookup_context.rb#135 + def find_all(name, prefixes = T.unsafe(nil), partial = T.unsafe(nil), keys = T.unsafe(nil), options = T.unsafe(nil)); end + + # source://actionview//lib/action_view/lookup_context.rb#133 + def find_template(name, prefixes = T.unsafe(nil), partial = T.unsafe(nil), keys = T.unsafe(nil), options = T.unsafe(nil)); end + + # Returns the value of attribute html_fallback_for_js. + # + # source://actionview//lib/action_view/lookup_context.rb#126 + def html_fallback_for_js; end + + # source://actionview//lib/action_view/lookup_context.rb#159 + def prepend_view_paths(paths); end + + # @return [Boolean] + # + # source://actionview//lib/action_view/lookup_context.rb#146 + def template_exists?(name, prefixes = T.unsafe(nil), partial = T.unsafe(nil), keys = T.unsafe(nil), **options); end + + # Returns the value of attribute view_paths. + # + # source://actionview//lib/action_view/lookup_context.rb#126 + def view_paths; end + + private + + # Whenever setting view paths, makes a copy so that we can manipulate them in + # instance objects as we wish. + # + # source://actionview//lib/action_view/lookup_context.rb#166 + def build_view_paths(paths); end + + # Compute details hash and key according to user options (e.g. passed from #render). + # + # source://actionview//lib/action_view/lookup_context.rb#175 + def detail_args_for(options); end + + # source://actionview//lib/action_view/lookup_context.rb#188 + def detail_args_for_any; end + + # Fix when prefix is specified as part of the template name + # + # source://actionview//lib/action_view/lookup_context.rb#209 + def normalize_name(name, prefixes); end +end + +# source://actionview//lib/action_view/template/error.rb#41 +class ActionView::MissingTemplate < ::ActionView::ActionViewError + include ::DidYouMean::Correctable + + # @return [MissingTemplate] a new instance of MissingTemplate + # + # source://actionview//lib/action_view/template/error.rb#44 + def initialize(paths, path, prefixes, partial, details, *_arg5); end + + # Apps may have thousands of candidate templates so we attempt to + # generate the suggestions as efficiently as possible. + # First we split templates into prefixes and basenames, so that those can + # be matched separately. + # + # source://actionview//lib/action_view/template/error.rb#104 + def corrections; end + + # Returns the value of attribute partial. + # + # source://actionview//lib/action_view/template/error.rb#42 + def partial; end + + # Returns the value of attribute path. + # + # source://actionview//lib/action_view/template/error.rb#42 + def path; end + + # Returns the value of attribute paths. + # + # source://actionview//lib/action_view/template/error.rb#42 + def paths; end + + # Returns the value of attribute prefixes. + # + # source://actionview//lib/action_view/template/error.rb#42 + def prefixes; end +end + +# source://actionview//lib/action_view/template/error.rb#71 +class ActionView::MissingTemplate::Results + # @return [Results] a new instance of Results + # + # source://actionview//lib/action_view/template/error.rb#74 + def initialize(size); end + + # source://actionview//lib/action_view/template/error.rb#91 + def add(path, score); end + + # @return [Boolean] + # + # source://actionview//lib/action_view/template/error.rb#83 + def should_record?(score); end + + # source://actionview//lib/action_view/template/error.rb#79 + def to_a; end +end + +# source://actionview//lib/action_view/template/error.rb#72 +class ActionView::MissingTemplate::Results::Result < ::Struct + # Returns the value of attribute path + # + # @return [Object] the current value of path + # + # source://actionview//lib/action_view/template/error.rb#72 + def path; end + + # Sets the attribute path + # + # @param value [Object] the value to set the attribute path to. + # @return [Object] the newly set value + # + # source://actionview//lib/action_view/template/error.rb#72 + def path=(_); end + + # Returns the value of attribute score + # + # @return [Object] the current value of score + # + # source://actionview//lib/action_view/template/error.rb#72 + def score; end + + # Sets the attribute score + # + # @param value [Object] the value to set the attribute score to. + # @return [Object] the newly set value + # + # source://actionview//lib/action_view/template/error.rb#72 + def score=(_); end + + class << self + # source://actionview//lib/action_view/template/error.rb#72 + def [](*_arg0); end + + # source://actionview//lib/action_view/template/error.rb#72 + def inspect; end + + # source://actionview//lib/action_view/template/error.rb#72 + def keyword_init?; end + + # source://actionview//lib/action_view/template/error.rb#72 + def members; end + + # source://actionview//lib/action_view/template/error.rb#72 + def new(*_arg0); end + end +end + +# source://actionview//lib/action_view/model_naming.rb#4 +module ActionView::ModelNaming + # Converts the given object to an Active Model compliant one. + # + # source://actionview//lib/action_view/model_naming.rb#6 + def convert_to_model(object); end + + # source://actionview//lib/action_view/model_naming.rb#10 + def model_name_from_record_or_class(record_or_class); end +end + +# source://actionview//lib/action_view/renderer/object_renderer.rb#4 +class ActionView::ObjectRenderer < ::ActionView::PartialRenderer + include ::ActionView::AbstractRenderer::ObjectRendering + + # @return [ObjectRenderer] a new instance of ObjectRenderer + # + # source://actionview//lib/action_view/renderer/object_renderer.rb#7 + def initialize(lookup_context, options); end + + # source://actionview//lib/action_view/renderer/object_renderer.rb#19 + def render_object_derive_partial(object, context, block); end + + # source://actionview//lib/action_view/renderer/object_renderer.rb#13 + def render_object_with_partial(object, partial, context, block); end + + private + + # source://actionview//lib/action_view/renderer/object_renderer.rb#29 + def render_partial_template(view, locals, template, layout, block); end + + # source://actionview//lib/action_view/renderer/object_renderer.rb#25 + def template_keys(path); end +end + +# Used as a buffer for views +# +# The main difference between this and ActiveSupport::SafeBuffer +# is for the methods `<<` and `safe_expr_append=` the inputs are +# checked for nil before they are assigned and `to_s` is called on +# the input. For example: +# +# obuf = ActionView::OutputBuffer.new "hello" +# obuf << 5 +# puts obuf # => "hello5" +# +# sbuf = ActiveSupport::SafeBuffer.new "hello" +# sbuf << 5 +# puts sbuf # => "hello\u0005" +# +# source://actionview//lib/action_view/buffers.rb#21 +class ActionView::OutputBuffer + # @return [OutputBuffer] a new instance of OutputBuffer + # + # source://actionview//lib/action_view/buffers.rb#22 + def initialize(buffer = T.unsafe(nil)); end + + # source://actionview//lib/action_view/buffers.rb#42 + def <<(value); end + + # source://actionview//lib/action_view/buffers.rb#81 + def ==(other); end + + # source://actionview//lib/action_view/buffers.rb#54 + def append=(value); end + + # source://actionview//lib/action_view/buffers.rb#27 + def blank?(*_arg0, **_arg1, &_arg2); end + + # source://actionview//lib/action_view/buffers.rb#72 + def capture(*args); end + + # source://actionview//lib/action_view/buffers.rb#53 + def concat(value); end + + # source://actionview//lib/action_view/buffers.rb#27 + def empty?(*_arg0, **_arg1, &_arg2); end + + # source://actionview//lib/action_view/buffers.rb#27 + def encode!(*_arg0, **_arg1, &_arg2); end + + # source://actionview//lib/action_view/buffers.rb#27 + def encoding(*_arg0, **_arg1, &_arg2); end + + # source://actionview//lib/action_view/buffers.rb#27 + def force_encoding(*_arg0, **_arg1, &_arg2); end + + # source://actionview//lib/action_view/buffers.rb#32 + def html_safe; end + + # @return [Boolean] + # + # source://actionview//lib/action_view/buffers.rb#38 + def html_safe?; end + + # source://actionview//lib/action_view/buffers.rb#27 + def length(*_arg0, **_arg1, &_arg2); end + + # source://actionview//lib/action_view/buffers.rb#85 + def raw; end + + # Returns the value of attribute raw_buffer. + # + # source://actionview//lib/action_view/buffers.rb#89 + def raw_buffer; end + + # source://actionview//lib/action_view/buffers.rb#60 + def safe_append=(value); end + + # source://actionview//lib/action_view/buffers.rb#56 + def safe_concat(value); end + + # source://actionview//lib/action_view/buffers.rb#62 + def safe_expr_append=(val); end + + # source://actionview//lib/action_view/buffers.rb#29 + def to_s; end + + # source://actionview//lib/action_view/buffers.rb#34 + def to_str; end + + private + + # source://actionview//lib/action_view/buffers.rb#68 + def initialize_copy(other); end +end + +# source://actionview//lib/action_view/flows.rb#6 +class ActionView::OutputFlow + # @return [OutputFlow] a new instance of OutputFlow + # + # source://actionview//lib/action_view/flows.rb#9 + def initialize; end + + # Called by content_for + # + # source://actionview//lib/action_view/flows.rb#24 + def append(key, value); end + + # Called by content_for + # + # source://actionview//lib/action_view/flows.rb#27 + def append!(key, value); end + + # Returns the value of attribute content. + # + # source://actionview//lib/action_view/flows.rb#7 + def content; end + + # Called by _layout_for to read stored values. + # + # source://actionview//lib/action_view/flows.rb#14 + def get(key); end + + # Called by each renderer object to set the layout contents. + # + # source://actionview//lib/action_view/flows.rb#19 + def set(key, value); end +end + +# source://actionview//lib/action_view/renderer/collection_renderer.rb#6 +class ActionView::PartialIteration + # @return [PartialIteration] a new instance of PartialIteration + # + # source://actionview//lib/action_view/renderer/collection_renderer.rb#13 + def initialize(size); end + + # Check if this is the first iteration of the partial. + # + # @return [Boolean] + # + # source://actionview//lib/action_view/renderer/collection_renderer.rb#19 + def first?; end + + # The current iteration of the partial. + # + # source://actionview//lib/action_view/renderer/collection_renderer.rb#11 + def index; end + + # source://actionview//lib/action_view/renderer/collection_renderer.rb#28 + def iterate!; end + + # Check if this is the last iteration of the partial. + # + # @return [Boolean] + # + # source://actionview//lib/action_view/renderer/collection_renderer.rb#24 + def last?; end + + # The number of iterations that will be done by the partial. + # + # source://actionview//lib/action_view/renderer/collection_renderer.rb#8 + def size; end +end + +# = Action View Partials +# +# There's also a convenience method for rendering sub templates within the current controller that depends on a +# single object (we call this kind of sub templates for partials). It relies on the fact that partials should +# follow the naming convention of being prefixed with an underscore -- as to separate them from regular +# templates that could be rendered on their own. +# +# In a template for Advertiser#account: +# +# <%= render partial: "account" %> +# +# This would render "advertiser/_account.html.erb". +# +# In another template for Advertiser#buy, we could have: +# +# <%= render partial: "account", locals: { account: @buyer } %> +# +# <% @advertisements.each do |ad| %> +# <%= render partial: "ad", locals: { ad: ad } %> +# <% end %> +# +# This would first render advertiser/_account.html.erb with @buyer passed in as the local variable +account+, then +# render advertiser/_ad.html.erb and pass the local variable +ad+ to the template for display. +# +# == The +:as+ and +:object+ options +# +# By default ActionView::PartialRenderer doesn't have any local variables. +# The :object option can be used to pass an object to the partial. For instance: +# +# <%= render partial: "account", object: @buyer %> +# +# would provide the @buyer object to the partial, available under the local variable +account+ and is +# equivalent to: +# +# <%= render partial: "account", locals: { account: @buyer } %> +# +# With the :as option we can specify a different name for said local variable. For example, if we +# wanted it to be +user+ instead of +account+ we'd do: +# +# <%= render partial: "account", object: @buyer, as: 'user' %> +# +# This is equivalent to +# +# <%= render partial: "account", locals: { user: @buyer } %> +# +# == \Rendering variants of a partial +# +# The :variants option can be used to render a different template variant of a partial. For instance: +# +# <%= render partial: "account", variants: :mobile %> +# +# This will render _account.html+mobile.erb. This option also accepts multiple variants +# like so: +# +# <%= render partial: "account", variants: [:desktop, :mobile] %> +# +# This will look for the following templates and render the first one that exists: +# * _account.html+desktop.erb +# * _account.html+mobile.erb +# * _account.html.erb +# +# == \Rendering a collection of partials +# +# The example of partial use describes a familiar pattern where a template needs to iterate over an array and +# render a sub template for each of the elements. This pattern has been implemented as a single method that +# accepts an array and renders a partial by the same name as the elements contained within. So the three-lined +# example in "Using partials" can be rewritten with a single line: +# +# <%= render partial: "ad", collection: @advertisements %> +# +# This will render advertiser/_ad.html.erb and pass the local variable +ad+ to the template for display. An +# iteration object will automatically be made available to the template with a name of the form +# +partial_name_iteration+. The iteration object has knowledge about which index the current object has in +# the collection and the total size of the collection. The iteration object also has two convenience methods, +# +first?+ and +last?+. In the case of the example above, the template would be fed +ad_iteration+. +# For backwards compatibility the +partial_name_counter+ is still present and is mapped to the iteration's +# +index+ method. +# +# The :as option may be used when rendering partials. +# +# You can specify a partial to be rendered between elements via the :spacer_template option. +# The following example will render advertiser/_ad_divider.html.erb between each ad partial: +# +# <%= render partial: "ad", collection: @advertisements, spacer_template: "ad_divider" %> +# +# If the given :collection is +nil+ or empty, render will return +nil+. This will allow you +# to specify a text which will be displayed instead by using this form: +# +# <%= render(partial: "ad", collection: @advertisements) || "There's no ad to be displayed" %> +# +# == \Rendering shared partials +# +# Two controllers can share a set of partials and render them like this: +# +# <%= render partial: "advertisement/ad", locals: { ad: @advertisement } %> +# +# This will render the partial advertisement/_ad.html.erb regardless of which controller this is being called from. +# +# == \Rendering objects that respond to +to_partial_path+ +# +# Instead of explicitly naming the location of a partial, you can also let PartialRenderer do the work +# and pick the proper path by checking +to_partial_path+ method. +# +# # @account.to_partial_path returns 'accounts/account', so it can be used to replace: +# # <%= render partial: "accounts/account", locals: { account: @account} %> +# <%= render partial: @account %> +# +# # @posts is an array of Post instances, so every post record returns 'posts/post' on #to_partial_path, +# # that's why we can replace: +# # <%= render partial: "posts/post", collection: @posts %> +# <%= render partial: @posts %> +# +# == \Rendering the default case +# +# If you're not going to be using any of the options like collections or layouts, you can also use the short-hand +# defaults of render to render partials. Examples: +# +# # Instead of <%= render partial: "account" %> +# <%= render "account" %> +# +# # Instead of <%= render partial: "account", locals: { account: @buyer } %> +# <%= render "account", account: @buyer %> +# +# # @account.to_partial_path returns 'accounts/account', so it can be used to replace: +# # <%= render partial: "accounts/account", locals: { account: @account} %> +# <%= render @account %> +# +# # @posts is an array of Post instances, so every post record returns 'posts/post' on #to_partial_path, +# # that's why we can replace: +# # <%= render partial: "posts/post", collection: @posts %> +# <%= render @posts %> +# +# == \Rendering partials with layouts +# +# Partials can have their own layouts applied to them. These layouts are different than the ones that are +# specified globally for the entire action, but they work in a similar fashion. Imagine a list with two types +# of users: +# +# <%# app/views/users/index.html.erb %> +# Here's the administrator: +# <%= render partial: "user", layout: "administrator", locals: { user: administrator } %> +# +# Here's the editor: +# <%= render partial: "user", layout: "editor", locals: { user: editor } %> +# +# <%# app/views/users/_user.html.erb %> +# Name: <%= user.name %> +# +# <%# app/views/users/_administrator.html.erb %> +#
    +# Budget: $<%= user.budget %> +# <%= yield %> +#
    +# +# <%# app/views/users/_editor.html.erb %> +#
    +# Deadline: <%= user.deadline %> +# <%= yield %> +#
    +# +# ...this will return: +# +# Here's the administrator: +#
    +# Budget: $<%= user.budget %> +# Name: <%= user.name %> +#
    +# +# Here's the editor: +#
    +# Deadline: <%= user.deadline %> +# Name: <%= user.name %> +#
    +# +# If a collection is given, the layout will be rendered once for each item in +# the collection. For example, these two snippets have the same output: +# +# <%# app/views/users/_user.html.erb %> +# Name: <%= user.name %> +# +# <%# app/views/users/index.html.erb %> +# <%# This does not use layouts %> +#
      +# <% users.each do |user| -%> +#
    • +# <%= render partial: "user", locals: { user: user } %> +#
    • +# <% end -%> +#
    +# +# <%# app/views/users/_li_layout.html.erb %> +#
  • +# <%= yield %> +#
  • +# +# <%# app/views/users/index.html.erb %> +#
      +# <%= render partial: "user", layout: "li_layout", collection: users %> +#
    +# +# Given two users whose names are Alice and Bob, these snippets return: +# +#
      +#
    • +# Name: Alice +#
    • +#
    • +# Name: Bob +#
    • +#
    +# +# The current object being rendered, as well as the object_counter, will be +# available as local variables inside the layout template under the same names +# as available in the partial. +# +# You can also apply a layout to a block within any template: +# +# <%# app/views/users/_chief.html.erb %> +# <%= render(layout: "administrator", locals: { user: chief }) do %> +# Title: <%= chief.title %> +# <% end %> +# +# ...this will return: +# +#
    +# Budget: $<%= user.budget %> +# Title: <%= chief.name %> +#
    +# +# As you can see, the :locals hash is shared between both the partial and its layout. +# +# source://actionview//lib/action_view/renderer/partial_renderer.rb#236 +class ActionView::PartialRenderer < ::ActionView::AbstractRenderer + include ::ActionView::CollectionCaching + + # @return [PartialRenderer] a new instance of PartialRenderer + # + # source://actionview//lib/action_view/renderer/partial_renderer.rb#239 + def initialize(lookup_context, options); end + + # source://actionview//lib/action_view/renderer/partial_renderer.rb#237 + def collection_cache; end + + # source://actionview//lib/action_view/renderer/partial_renderer.rb#237 + def collection_cache=(val); end + + # source://actionview//lib/action_view/renderer/partial_renderer.rb#246 + def render(partial, context, block); end + + private + + # source://actionview//lib/action_view/renderer/partial_renderer.rb#278 + def find_template(path, locals); end + + # source://actionview//lib/action_view/renderer/partial_renderer.rb#261 + def render_partial_template(view, locals, template, layout, block); end + + # source://actionview//lib/action_view/renderer/partial_renderer.rb#257 + def template_keys(_); end + + class << self + # source://actionview//lib/action_view/renderer/partial_renderer.rb#237 + def collection_cache; end + + # source://actionview//lib/action_view/renderer/partial_renderer.rb#237 + def collection_cache=(val); end + end +end + +# source://actionview//lib/action_view/path_registry.rb#4 +module ActionView::PathRegistry + class << self + # source://actionview//lib/action_view/path_registry.rb#53 + def all_file_system_resolvers; end + + # source://actionview//lib/action_view/path_registry.rb#47 + def all_resolvers; end + + # source://actionview//lib/action_view/path_registry.rb#22 + def cast_file_system_resolvers(paths); end + + # Returns the value of attribute file_system_resolver_hooks. + # + # source://actionview//lib/action_view/path_registry.rb#11 + def file_system_resolver_hooks; end + + # source://actionview//lib/action_view/path_registry.rb#14 + def get_view_paths(klass); end + + # source://actionview//lib/action_view/path_registry.rb#18 + def set_view_paths(klass, paths); end + end +end + +# = Action View PathSet +# +# This class is used to store and access paths in Action View. A number of +# operations are defined so that you can search among the paths in this +# set and also perform operations on other +PathSet+ objects. +# +# A +LookupContext+ will use a +PathSet+ to store the paths in its context. +# +# source://actionview//lib/action_view/path_set.rb#11 +class ActionView::PathSet + include ::Enumerable + + # @return [PathSet] a new instance of PathSet + # + # source://actionview//lib/action_view/path_set.rb#18 + def initialize(paths = T.unsafe(nil)); end + + # source://actionview//lib/action_view/path_set.rb#35 + def +(other); end + + # source://actionview//lib/action_view/path_set.rb#16 + def [](*_arg0, **_arg1, &_arg2); end + + # source://actionview//lib/action_view/path_set.rb#31 + def compact; end + + # source://actionview//lib/action_view/path_set.rb#16 + def each(*_arg0, **_arg1, &_arg2); end + + # @return [Boolean] + # + # source://actionview//lib/action_view/path_set.rb#53 + def exists?(path, prefixes, partial, details, details_key, locals); end + + # source://actionview//lib/action_view/path_set.rb#40 + def find(path, prefixes, partial, details, details_key, locals); end + + # source://actionview//lib/action_view/path_set.rb#45 + def find_all(path, prefixes, partial, details, details_key, locals); end + + # source://actionview//lib/action_view/path_set.rb#16 + def include?(*_arg0, **_arg1, &_arg2); end + + # Returns the value of attribute paths. + # + # source://actionview//lib/action_view/path_set.rb#14 + def paths; end + + # source://actionview//lib/action_view/path_set.rb#16 + def size(*_arg0, **_arg1, &_arg2); end + + # source://actionview//lib/action_view/path_set.rb#27 + def to_ary; end + + private + + # source://actionview//lib/action_view/path_set.rb#22 + def initialize_copy(other); end + + # source://actionview//lib/action_view/path_set.rb#58 + def search_combinations(prefixes); end + + # source://actionview//lib/action_view/path_set.rb#67 + def typecast(paths); end +end + +# = Action View Railtie +# +# source://actionview//lib/action_view/railtie.rb#8 +class ActionView::Railtie < ::Rails::Engine; end + +# source://actionview//lib/action_view/buffers.rb#92 +class ActionView::RawOutputBuffer + # @return [RawOutputBuffer] a new instance of RawOutputBuffer + # + # source://actionview//lib/action_view/buffers.rb#93 + def initialize(buffer); end + + # source://actionview//lib/action_view/buffers.rb#97 + def <<(value); end + + # source://actionview//lib/action_view/buffers.rb#103 + def raw; end +end + +# source://actionview//lib/action_view/buffers.rb#150 +class ActionView::RawStreamingBuffer + # @return [RawStreamingBuffer] a new instance of RawStreamingBuffer + # + # source://actionview//lib/action_view/buffers.rb#151 + def initialize(buffer); end + + # source://actionview//lib/action_view/buffers.rb#155 + def <<(value); end + + # source://actionview//lib/action_view/buffers.rb#161 + def raw; end +end + +# = Action View \Record \Identifier +# +# RecordIdentifier encapsulates methods used by various ActionView helpers +# to associate records with DOM elements. +# +# Consider for example the following code that form of post: +# +# <%= form_with(model: post) do |f| %> +# <%= f.text_field :body %> +# <% end %> +# +# When +post+ is a new, unsaved ActiveRecord::Base instance, the resulting HTML +# is: +# +#
    +# +#
    +# +# When +post+ is a persisted ActiveRecord::Base instance, the resulting HTML +# is: +# +#
    +# +#
    +# +# In both cases, the +id+ and +class+ of the wrapping DOM element are +# automatically generated, following naming conventions encapsulated by the +# RecordIdentifier methods #dom_id and #dom_class: +# +# dom_id(Post) # => "new_post" +# dom_class(Post) # => "post" +# dom_id(Post.new) # => "new_post" +# dom_class(Post.new) # => "post" +# dom_id(Post.find 42) # => "post_42" +# dom_class(Post.find 42) # => "post" +# +# Note that these methods do not strictly require +Post+ to be a subclass of +# ActiveRecord::Base. +# Any +Post+ class will work as long as its instances respond to +to_key+ +# and +model_name+, given that +model_name+ responds to +param_key+. +# For instance: +# +# class Post +# attr_accessor :to_key +# +# def model_name +# OpenStruct.new param_key: 'post' +# end +# +# def self.find(id) +# new.tap { |post| post.to_key = [id] } +# end +# end +# +# source://actionview//lib/action_view/record_identifier.rb#60 +module ActionView::RecordIdentifier + include ::ActionView::ModelNaming + extend ::ActionView::RecordIdentifier + extend ::ActionView::ModelNaming + + # The DOM class convention is to use the singular form of an object or class. + # + # dom_class(post) # => "post" + # dom_class(Person) # => "person" + # + # If you need to address multiple instances of the same class in the same view, you can prefix the dom_class: + # + # dom_class(post, :edit) # => "edit_post" + # dom_class(Person, :edit) # => "edit_person" + # + # source://actionview//lib/action_view/record_identifier.rb#78 + def dom_class(record_or_class, prefix = T.unsafe(nil)); end + + # The DOM id convention is to use the singular form of an object or class with the id following an underscore. + # If no id is found, prefix with "new_" instead. + # + # dom_id(Post.find(45)) # => "post_45" + # dom_id(Post) # => "new_post" + # + # If you need to address multiple instances of the same class in the same view, you can prefix the dom_id: + # + # dom_id(Post.find(45), :edit) # => "edit_post_45" + # dom_id(Post, :custom) # => "custom_post" + # + # @raise [ArgumentError] + # + # source://actionview//lib/action_view/record_identifier.rb#93 + def dom_id(record_or_class, prefix = T.unsafe(nil)); end + + # The DOM target convention is to concatenate any number of parameters into a string. + # Records are passed through dom_id, while string and symbols are retained. + # + # dom_target(Post.find(45)) # => "post_45" + # dom_target(Post.find(45), :edit) # => "post_45_edit" + # dom_target(Post.find(45), :edit, :special) # => "post_45_edit_special" + # dom_target(Post.find(45), Comment.find(1)) # => "post_45_comment_1" + # + # source://actionview//lib/action_view/record_identifier.rb#111 + def dom_target(*objects); end + + private + + # Returns a string representation of the key attribute(s) that is suitable for use in an HTML DOM id. + # This can be overwritten to customize the default generated string representation if desired. + # If you need to read back a key from a dom_id in order to query for the underlying database record, + # you should write a helper like 'person_record_from_dom_id' that will extract the key either based + # on the default implementation (which just joins all key attributes with '_') or on your own + # overwritten version of the method. By default, this implementation passes the key string through a + # method that replaces all characters that are invalid inside DOM ids, with valid ones. You need to + # make sure yourself that your dom ids are valid, in case you override this method. + # + # source://actionview//lib/action_view/record_identifier.rb#134 + def record_key_for_dom_id(record); end +end + +# source://actionview//lib/action_view/record_identifier.rb#66 +ActionView::RecordIdentifier::JOIN = T.let(T.unsafe(nil), String) + +# source://actionview//lib/action_view/record_identifier.rb#67 +ActionView::RecordIdentifier::NEW = T.let(T.unsafe(nil), String) + +# source://actionview//lib/action_view/render_parser.rb#4 +module ActionView::RenderParser; end + +# source://actionview//lib/action_view/render_parser.rb#5 +ActionView::RenderParser::ALL_KNOWN_KEYS = T.let(T.unsafe(nil), Array) + +# source://actionview//lib/action_view/render_parser.rb#8 +class ActionView::RenderParser::Base + # @return [Base] a new instance of Base + # + # source://actionview//lib/action_view/render_parser.rb#9 + def initialize(name, code); end + + private + + # source://actionview//lib/action_view/render_parser.rb#15 + def directory; end + + # source://actionview//lib/action_view/render_parser.rb#19 + def partial_to_virtual_path(render_type, partial_path); end +end + +# source://actionview//lib/action_view/render_parser.rb#37 +ActionView::RenderParser::Default = ActionView::RenderParser::PrismRenderParser + +# source://actionview//lib/action_view/render_parser/prism_render_parser.rb#5 +class ActionView::RenderParser::PrismRenderParser < ::ActionView::RenderParser::Base + # source://actionview//lib/action_view/render_parser/prism_render_parser.rb#6 + def render_calls; end + + private + + # Accept a call node and return a hash of options for the render call. + # If it doesn't match the expected format, return nil. + # + # source://actionview//lib/action_view/render_parser/prism_render_parser.rb#43 + def render_call_options(node); end + + # Accept the node that is being passed in the position of the template + # and return the template name and whether or not it is an object + # template. + # + # source://actionview//lib/action_view/render_parser/prism_render_parser.rb#97 + def render_call_template(node); end +end + +# source://actionview//lib/action_view/render_parser.rb#6 +ActionView::RenderParser::RENDER_TYPE_KEYS = T.let(T.unsafe(nil), Array) + +# = Action View \Renderer +# +# This is the main entry point for rendering. It basically delegates +# to other objects like TemplateRenderer and PartialRenderer which +# actually renders the template. +# +# The Renderer will parse the options from the +render+ or +render_body+ +# method and render a partial or a template based on the options. The +# +TemplateRenderer+ and +PartialRenderer+ objects are wrappers which do all +# the setup and logic necessary to render a view and a new object is created +# each time +render+ is called. +# +# source://actionview//lib/action_view/renderer/renderer.rb#15 +class ActionView::Renderer + # @return [Renderer] a new instance of Renderer + # + # source://actionview//lib/action_view/renderer/renderer.rb#18 + def initialize(lookup_context); end + + # source://actionview//lib/action_view/renderer/renderer.rb#52 + def cache_hits; end + + # Returns the value of attribute lookup_context. + # + # source://actionview//lib/action_view/renderer/renderer.rb#16 + def lookup_context; end + + # Sets the attribute lookup_context + # + # @param value the value to set the attribute lookup_context to. + # + # source://actionview//lib/action_view/renderer/renderer.rb#16 + def lookup_context=(_arg0); end + + # Main render entry point shared by Action View and Action Controller. + # + # source://actionview//lib/action_view/renderer/renderer.rb#23 + def render(context, options); end + + # Render but returns a valid Rack body. If fibers are defined, we return + # a streaming body that renders the template piece by piece. + # + # Note that partials are not supported to be rendered with streaming, + # so in such cases, we just wrap them in an array. + # + # source://actionview//lib/action_view/renderer/renderer.rb#40 + def render_body(context, options); end + + # source://actionview//lib/action_view/renderer/renderer.rb#48 + def render_partial(context, options, &block); end + + # source://actionview//lib/action_view/renderer/renderer.rb#27 + def render_to_object(context, options); end + + private + + # source://actionview//lib/action_view/renderer/renderer.rb#103 + def collection_from_object(object); end + + # source://actionview//lib/action_view/renderer/renderer.rb#96 + def collection_from_options(options); end + + # source://actionview//lib/action_view/renderer/renderer.rb#61 + def render_partial_to_object(context, options, &block); end + + # source://actionview//lib/action_view/renderer/renderer.rb#57 + def render_template_to_object(context, options); end +end + +# source://actionview//lib/action_view/rendering.rb#26 +module ActionView::Rendering + extend ::ActiveSupport::Concern + include ::ActionView::ViewPaths + + mixes_in_class_methods ::ActionView::ViewPaths::ClassMethods + mixes_in_class_methods ::ActionView::Rendering::ClassMethods + + # source://actionview//lib/action_view/rendering.rb#32 + def initialize; end + + # Override process to set up I18n proxy. + # + # source://actionview//lib/action_view/rendering.rb#38 + def process(*_arg0, **_arg1, &_arg2); end + + # source://actionview//lib/action_view/rendering.rb#119 + def render_to_body(options = T.unsafe(nil)); end + + # source://actionview//lib/action_view/rendering.rb#30 + def rendered_format; end + + # An instance of a view class. The default view class is ActionView::Base. + # + # The view class must have the following methods: + # + # * View.new(lookup_context, assigns, controller) — Create a new + # ActionView instance for a controller and we can also pass the arguments. + # + # * View#render(option) — Returns String with the rendered template. + # + # Override this method in a module to change the default behavior. + # + # source://actionview//lib/action_view/rendering.rb#109 + def view_context; end + + # source://actionview//lib/action_view/rendering.rb#95 + def view_context_class; end + + # Returns an object that is able to render templates. + # + # source://actionview//lib/action_view/rendering.rb#114 + def view_renderer; end + + private + + # Normalize args by converting render "foo" to render action: "foo" and + # render "foo/bar" to render template: "foo/bar". + # + # source://actionview//lib/action_view/rendering.rb#153 + def _normalize_args(action = T.unsafe(nil), options = T.unsafe(nil)); end + + # Assign the rendered format to look up context. + # + # source://actionview//lib/action_view/rendering.rb#146 + def _process_format(format); end + + # Normalize options. + # + # source://actionview//lib/action_view/rendering.rb#177 + def _process_render_template_options(options); end + + # Find and render a template based on the options given. + # + # source://actionview//lib/action_view/rendering.rb#127 + def _render_template(options); end +end + +# source://actionview//lib/action_view/rendering.rb#45 +module ActionView::Rendering::ClassMethods + # source://actionview//lib/action_view/rendering.rb#49 + def _helpers; end + + # source://actionview//lib/action_view/rendering.rb#46 + def _routes; end + + # source://actionview//lib/action_view/rendering.rb#59 + def build_view_context_class(klass, supports_path, routes, helpers); end + + # source://actionview//lib/action_view/rendering.rb#76 + def eager_load!; end + + # @return [Boolean] + # + # source://actionview//lib/action_view/rendering.rb#52 + def inherit_view_context_class?; end + + # source://actionview//lib/action_view/rendering.rb#82 + def view_context_class; end +end + +# = Action View Resolver +# +# source://actionview//lib/action_view/template/resolver.rb#11 +class ActionView::Resolver + # source://actionview//lib/action_view/template/resolver.rb#69 + def all_template_paths; end + + # source://actionview//lib/action_view/template/resolver.rb#64 + def built_templates; end + + # source://actionview//lib/action_view/template/resolver.rb#50 + def caching; end + + # source://actionview//lib/action_view/template/resolver.rb#50 + def caching=(val); end + + # source://actionview//lib/action_view/template/resolver.rb#79 + def caching?(&_arg0); end + + # source://actionview//lib/action_view/template/resolver.rb#56 + def clear_cache; end + + # Normalizes the arguments and passes it on to find_templates. + # + # source://actionview//lib/action_view/template/resolver.rb#60 + def find_all(name, prefix = T.unsafe(nil), partial = T.unsafe(nil), details = T.unsafe(nil), key = T.unsafe(nil), locals = T.unsafe(nil)); end + + private + + # source://actionview//lib/action_view/template/resolver.rb#75 + def _find_all(name, prefix, partial, details, key, locals); end + + # This is what child classes implement. No defaults are needed + # because Resolver guarantees that the arguments are present and + # normalized. + # + # @raise [NotImplementedError] + # + # source://actionview//lib/action_view/template/resolver.rb#84 + def find_templates(name, prefix, partial, details, locals = T.unsafe(nil)); end + + class << self + # source://actionview//lib/action_view/template/resolver.rb#50 + def caching; end + + # source://actionview//lib/action_view/template/resolver.rb#50 + def caching=(val); end + + # source://actionview//lib/action_view/template/resolver.rb#53 + def caching?; end + end +end + +# source://actionview//lib/action_view/template/resolver.rb#12 +class ActionView::Resolver::PathParser + # source://actionview//lib/action_view/template/resolver.rb#15 + def build_path_regex; end + + # source://actionview//lib/action_view/template/resolver.rb#36 + def parse(path); end +end + +# source://actionview//lib/action_view/template/resolver.rb#13 +class ActionView::Resolver::PathParser::ParsedPath < ::Struct + # Returns the value of attribute details + # + # @return [Object] the current value of details + # + # source://actionview//lib/action_view/template/resolver.rb#13 + def details; end + + # Sets the attribute details + # + # @param value [Object] the value to set the attribute details to. + # @return [Object] the newly set value + # + # source://actionview//lib/action_view/template/resolver.rb#13 + def details=(_); end + + # Returns the value of attribute path + # + # @return [Object] the current value of path + # + # source://actionview//lib/action_view/template/resolver.rb#13 + def path; end + + # Sets the attribute path + # + # @param value [Object] the value to set the attribute path to. + # @return [Object] the newly set value + # + # source://actionview//lib/action_view/template/resolver.rb#13 + def path=(_); end + + class << self + # source://actionview//lib/action_view/template/resolver.rb#13 + def [](*_arg0); end + + # source://actionview//lib/action_view/template/resolver.rb#13 + def inspect; end + + # source://actionview//lib/action_view/template/resolver.rb#13 + def keyword_init?; end + + # source://actionview//lib/action_view/template/resolver.rb#13 + def members; end + + # source://actionview//lib/action_view/template/resolver.rb#13 + def new(*_arg0); end + end +end + +# source://actionview//lib/action_view/routing_url_for.rb#6 +module ActionView::RoutingUrlFor + include ::ActionDispatch::Routing::PolymorphicRoutes + + # Returns the URL for the set of +options+ provided. This takes the + # same options as +url_for+ in Action Controller (see the + # documentation for ActionDispatch::Routing::UrlFor#url_for). Note that by default + # :only_path is true so you'll get the relative "/controller/action" + # instead of the fully qualified URL like "http://example.com/controller/action". + # + # ==== Options + # * :anchor - Specifies the anchor name to be appended to the path. + # * :only_path - If true, returns the relative URL (omitting the protocol, host name, and port) (true by default unless :host is specified). + # * :trailing_slash - If true, adds a trailing slash, as in "/archive/2005/". Note that this + # is currently not recommended since it breaks caching. + # * :host - Overrides the default (current) host if provided. + # * :protocol - Overrides the default (current) protocol if provided. + # * :user - Inline HTTP authentication (only plucked out if :password is also present). + # * :password - Inline HTTP authentication (only plucked out if :user is also present). + # + # ==== Relying on named routes + # + # Passing a record (like an Active Record) instead of a hash as the options parameter will + # trigger the named route for that record. The lookup will happen on the name of the class. So passing a + # Workshop object will attempt to use the +workshop_path+ route. If you have a nested route, such as + # +admin_workshop_path+ you'll have to call that explicitly (it's impossible for +url_for+ to guess that route). + # + # ==== Implicit Controller Namespacing + # + # Controllers passed in using the +:controller+ option will retain their namespace unless it is an absolute one. + # + # ==== Examples + # <%= url_for(action: 'index') %> + # # => /blogs/ + # + # <%= url_for(action: 'find', controller: 'books') %> + # # => /books/find + # + # <%= url_for(action: 'login', controller: 'members', only_path: false, protocol: 'https') %> + # # => https://www.example.com/members/login/ + # + # <%= url_for(action: 'play', anchor: 'player') %> + # # => /messages/play/#player + # + # <%= url_for(action: 'jump', anchor: 'tax&ship') %> + # # => /testing/jump/#tax&ship + # + # <%= url_for(Workshop) %> + # # => /workshops + # + # <%= url_for(Workshop.new) %> + # # relies on Workshop answering a persisted? call (and in this case returning false) + # # => /workshops + # + # <%= url_for(@workshop) %> + # # calls @workshop.to_param which by default returns the id + # # => /workshops/5 + # + # # to_param can be re-defined in a model to provide different URL names: + # # => /workshops/1-workshop-name + # + # <%= url_for("http://www.example.com") %> + # # => http://www.example.com + # + # <%= url_for(:back) %> + # # if request.env["HTTP_REFERER"] is set to "http://www.example.com" + # # => http://www.example.com + # + # <%= url_for(:back) %> + # # if request.env["HTTP_REFERER"] is not set or is blank + # # => javascript:history.back() + # + # <%= url_for(action: 'index', controller: 'users') %> + # # Assuming an "admin" namespace + # # => /admin/users + # + # <%= url_for(action: 'index', controller: '/users') %> + # # Specify absolute path with beginning slash + # # => /users + # + # source://actionview//lib/action_view/routing_url_for.rb#82 + def url_for(options = T.unsafe(nil)); end + + # source://actionview//lib/action_view/routing_url_for.rb#124 + def url_options; end + + private + + # source://actionview//lib/action_view/routing_url_for.rb#139 + def _generate_paths_by_default; end + + # source://actionview//lib/action_view/routing_url_for.rb#130 + def _routes_context; end + + # source://actionview//lib/action_view/routing_url_for.rb#143 + def ensure_only_path_option(options); end + + # @return [Boolean] + # + # source://actionview//lib/action_view/routing_url_for.rb#134 + def optimize_routes_generation?; end +end + +# source://actionview//lib/action_view/buffers.rb#108 +class ActionView::StreamingBuffer + # @return [StreamingBuffer] a new instance of StreamingBuffer + # + # source://actionview//lib/action_view/buffers.rb#109 + def initialize(block); end + + # source://actionview//lib/action_view/buffers.rb#113 + def <<(value); end + + # source://actionview//lib/action_view/buffers.rb#119 + def append=(value); end + + # Returns the value of attribute block. + # + # source://actionview//lib/action_view/buffers.rb#147 + def block; end + + # source://actionview//lib/action_view/buffers.rb#126 + def capture; end + + # source://actionview//lib/action_view/buffers.rb#118 + def concat(value); end + + # source://actionview//lib/action_view/buffers.rb#139 + def html_safe; end + + # @return [Boolean] + # + # source://actionview//lib/action_view/buffers.rb#135 + def html_safe?; end + + # source://actionview//lib/action_view/buffers.rb#143 + def raw; end + + # source://actionview//lib/action_view/buffers.rb#124 + def safe_append=(value); end + + # source://actionview//lib/action_view/buffers.rb#121 + def safe_concat(value); end +end + +# source://actionview//lib/action_view/flows.rb#30 +class ActionView::StreamingFlow < ::ActionView::OutputFlow + # @return [StreamingFlow] a new instance of StreamingFlow + # + # source://actionview//lib/action_view/flows.rb#31 + def initialize(view, fiber); end + + # Appends the contents for the given key. This is called + # by providing and resuming back to the fiber, + # if that's the key it's waiting for. + # + # source://actionview//lib/action_view/flows.rb#65 + def append!(key, value); end + + # Try to get stored content. If the content + # is not available and we're inside the layout fiber, + # then it will begin waiting for the given key and yield. + # + # source://actionview//lib/action_view/flows.rb#43 + def get(key); end + + private + + # @return [Boolean] + # + # source://actionview//lib/action_view/flows.rb#71 + def inside_fiber?; end +end + +# == TODO +# +# * Support streaming from child templates, partials and so on. +# * Rack::Cache needs to support streaming bodies +# +# source://actionview//lib/action_view/renderer/streaming_template_renderer.rb#12 +class ActionView::StreamingTemplateRenderer < ::ActionView::TemplateRenderer + # For streaming, instead of rendering a given a template, we return a Body + # object that responds to each. This object is initialized with a block + # that knows how to render the template. + # + # source://actionview//lib/action_view/renderer/streaming_template_renderer.rb#51 + def render_template(view, template, layout_name = T.unsafe(nil), locals = T.unsafe(nil)); end + + private + + # source://actionview//lib/action_view/renderer/streaming_template_renderer.rb#63 + def delayed_render(buffer, template, layout, view, locals); end +end + +# A valid Rack::Body (i.e. it responds to each). +# It is initialized with a block that, when called, starts +# rendering the template. +# +# source://actionview//lib/action_view/renderer/streaming_template_renderer.rb#13 +class ActionView::StreamingTemplateRenderer::Body + # @return [Body] a new instance of Body + # + # source://actionview//lib/action_view/renderer/streaming_template_renderer.rb#14 + def initialize(&start); end + + # Returns the complete body as a string. + # + # source://actionview//lib/action_view/renderer/streaming_template_renderer.rb#29 + def body; end + + # source://actionview//lib/action_view/renderer/streaming_template_renderer.rb#18 + def each(&block); end + + private + + # This is the same logging logic as in ShowExceptions middleware. + # + # source://actionview//lib/action_view/renderer/streaming_template_renderer.rb#37 + def log_error(exception); end +end + +# source://actionview//lib/action_view/template/error.rb#30 +class ActionView::StrictLocalsError < ::ArgumentError + # @return [StrictLocalsError] a new instance of StrictLocalsError + # + # source://actionview//lib/action_view/template/error.rb#31 + def initialize(argument_error, template); end +end + +# source://actionview//lib/action_view/structured_event_subscriber.rb#6 +class ActionView::StructuredEventSubscriber < ::ActiveSupport::StructuredEventSubscriber + include ::ActionView::StructuredEventSubscriber::Utils + + # @return [StructuredEventSubscriber] a new instance of StructuredEventSubscriber + # + # source://actionview//lib/action_view/structured_event_subscriber.rb#9 + def initialize; end + + # source://actionview//lib/action_view/structured_event_subscriber.rb#44 + def render_collection(event); end + + # source://actionview//lib/action_view/structured_event_subscriber.rb#35 + def render_layout(event); end + + # source://actionview//lib/action_view/structured_event_subscriber.rb#24 + def render_partial(event); end + + # source://actionview//lib/action_view/structured_event_subscriber.rb#14 + def render_template(event); end + + class << self + # source://actionview//lib/action_view/structured_event_subscriber.rb#88 + def attach_to(*_arg0); end + end +end + +# source://actionview//lib/action_view/structured_event_subscriber.rb#73 +class ActionView::StructuredEventSubscriber::Start + include ::ActionView::StructuredEventSubscriber::Utils + + # source://actionview//lib/action_view/structured_event_subscriber.rb#84 + def finish(name, id, payload); end + + # source://actionview//lib/action_view/structured_event_subscriber.rb#76 + def start(name, id, payload); end +end + +# source://actionview//lib/action_view/structured_event_subscriber.rb#56 +module ActionView::StructuredEventSubscriber::Utils + private + + # source://actionview//lib/action_view/structured_event_subscriber.rb#58 + def from_rails_root(string); end + + # source://actionview//lib/action_view/structured_event_subscriber.rb#66 + def rails_root; end +end + +# source://actionview//lib/action_view/structured_event_subscriber.rb#7 +ActionView::StructuredEventSubscriber::VIEWS_PATTERN = T.let(T.unsafe(nil), Regexp) + +# source://actionview//lib/action_view/template/error.rb#256 +class ActionView::SyntaxErrorInTemplate < ::ActionView::Template::Error + # @return [SyntaxErrorInTemplate] a new instance of SyntaxErrorInTemplate + # + # source://actionview//lib/action_view/template/error.rb#257 + def initialize(template, offending_code_string); end + + # source://actionview//lib/action_view/template/error.rb#272 + def annotated_source_code; end + + # source://actionview//lib/action_view/template/error.rb#262 + def message; end +end + +# = Action View \Template +# +# source://actionview//lib/action_view/template.rb#7 +class ActionView::Template + extend ::ActiveSupport::Autoload + extend ::ActionView::Template::Handlers + + # @return [Template] a new instance of Template + # + # source://actionview//lib/action_view/template.rb#199 + def initialize(source, identifier, handler, locals:, format: T.unsafe(nil), variant: T.unsafe(nil), virtual_path: T.unsafe(nil)); end + + # This method is responsible for properly setting the encoding of the + # source. Until this point, we assume that the source is BINARY data. + # If no additional information is supplied, we assume the encoding is + # the same as Encoding.default_external. + # + # The user can also specify the encoding via a comment on the first + # with any template engine, as we process out the encoding comment + # before passing the source on to the template engine, leaving a + # blank line in its stead. + # + # source://actionview//lib/action_view/template.rb#321 + def encode!; end + + # Returns the value of attribute format. + # + # source://actionview//lib/action_view/template.rb#195 + def format; end + + # Returns the value of attribute handler. + # + # source://actionview//lib/action_view/template.rb#194 + def handler; end + + # Returns the value of attribute identifier. + # + # source://actionview//lib/action_view/template.rb#194 + def identifier; end + + # source://actionview//lib/action_view/template.rb#300 + def inspect; end + + # The locals this template has been or will be compiled for, or nil if this + # is a strict locals template. + # + # source://actionview//lib/action_view/template.rb#223 + def locals; end + + # Exceptions are marshalled when using the parallel test runner with DRb, so we need + # to ensure that references to the template object can be marshalled as well. This means forgoing + # the marshalling of the compiler mutex and instantiating that again on unmarshalling. + # + # source://actionview//lib/action_view/template.rb#387 + def marshal_dump; end + + # source://actionview//lib/action_view/template.rb#391 + def marshal_load(array); end + + # source://actionview//lib/action_view/template.rb#396 + def method_name; end + + # Render a template. If the template was not compiled yet, it is done + # exactly before rendering. + # + # This method is instrumented as "!render_template.action_view". Notice that + # we use a bang in this instrumentation because you don't want to + # consume this in production. This is only slow if it's being listened to. + # + # source://actionview//lib/action_view/template.rb#271 + def render(view, locals, buffer = T.unsafe(nil), implicit_locals: T.unsafe(nil), add_to_stack: T.unsafe(nil), &block); end + + # source://actionview//lib/action_view/template.rb#296 + def short_identifier; end + + # source://actionview//lib/action_view/template.rb#304 + def source; end + + # source://actionview//lib/action_view/template.rb#231 + def spot(location); end + + # This method is responsible for marking a template as having strict locals + # which means the template can only accept the locals defined in a magic + # comment. For example, if your template accepts the locals +title+ and + # +comment_count+, add the following to your template file: + # + # <%# locals: (title: "Default title", comment_count: 0) %> + # + # Strict locals are useful for validating template arguments and for + # specifying defaults. + # + # source://actionview//lib/action_view/template.rb#366 + def strict_locals!; end + + # Returns whether a template is using strict locals. + # + # @return [Boolean] + # + # source://actionview//lib/action_view/template.rb#380 + def strict_locals?; end + + # Returns whether the underlying handler supports streaming. If so, + # a streaming buffer *may* be passed when it starts rendering. + # + # @return [Boolean] + # + # source://actionview//lib/action_view/template.rb#261 + def supports_streaming?; end + + # Translate an error location returned by ErrorHighlight to the correct + # source location inside the template. + # + # source://actionview//lib/action_view/template.rb#251 + def translate_location(backtrace_location, spot); end + + # source://actionview//lib/action_view/template.rb#292 + def type; end + + # Returns the value of attribute variable. + # + # source://actionview//lib/action_view/template.rb#195 + def variable; end + + # Returns the value of attribute variant. + # + # source://actionview//lib/action_view/template.rb#195 + def variant; end + + # Returns the value of attribute virtual_path. + # + # source://actionview//lib/action_view/template.rb#195 + def virtual_path; end + + private + + # Among other things, this method is responsible for properly setting + # the encoding of the compiled template. + # + # If the template engine handles encodings, we send the encoded + # String to the engine without further processing. This allows + # the template engine to support additional mechanisms for + # + # Otherwise, after we figure out the correct encoding, we then + # encode the source into Encoding.default_internal. + # In general, this means that templates will be UTF-8 inside of Rails, + # regardless of the original source encoding. + # + # source://actionview//lib/action_view/template.rb#500 + def compile(mod); end + + # Compile a template. This method ensures a template is compiled + # just once and removes the source after it is compiled. + # + # source://actionview//lib/action_view/template.rb#418 + def compile!(view); end + + # This method compiles the source of the template. The compilation of templates + # involves setting strict_locals! if applicable, encoding the template, and setting + # frozen string literal. + # + # source://actionview//lib/action_view/template.rb#443 + def compiled_source; end + + # source://actionview//lib/action_view/template.rb#405 + def find_node_by_id(node, node_id); end + + # source://actionview//lib/action_view/template.rb#549 + def handle_render_error(view, e); end + + # source://actionview//lib/action_view/template.rb#574 + def identifier_method_name; end + + # source://actionview//lib/action_view/template.rb#578 + def instrument(action, &block); end + + # source://actionview//lib/action_view/template.rb#586 + def instrument_payload; end + + # source://actionview//lib/action_view/template.rb#582 + def instrument_render_template(&block); end + + # source://actionview//lib/action_view/template.rb#561 + def locals_code; end + + # source://actionview//lib/action_view/template.rb#541 + def offset; end + + class << self + # source://actionview//lib/action_view/template.rb#180 + def frozen_string_literal; end + + # source://actionview//lib/action_view/template.rb#180 + def frozen_string_literal=(_arg0); end + + # source://actionview//lib/action_view/template.rb#184 + def mime_types_implementation=(implementation); end + end +end + +# The Template::Error exception is raised when the compilation or rendering of the template +# fails. This exception then gathers a bunch of intimate details and uses it to report a +# precise exception message. +# +# source://actionview//lib/action_view/template/error.rb#165 +class ActionView::Template::Error < ::ActionView::ActionViewError + # @return [Error] a new instance of Error + # + # source://actionview//lib/action_view/template/error.rb#173 + def initialize(template); end + + # source://actionview//lib/action_view/template/error.rb#231 + def annotated_source_code; end + + # source://actionview//lib/action_view/template/error.rb#182 + def backtrace; end + + # source://actionview//lib/action_view/template/error.rb#186 + def backtrace_locations; end + + # Override to prevent #cause resetting during re-raise. + # + # source://actionview//lib/action_view/template/error.rb#169 + def cause; end + + # source://actionview//lib/action_view/template/error.rb#190 + def file_name; end + + # source://actionview//lib/action_view/template/error.rb#223 + def line_number; end + + # source://actionview//lib/action_view/template/error.rb#203 + def source_extract(indentation = T.unsafe(nil)); end + + # source://actionview//lib/action_view/template/error.rb#194 + def sub_template_message; end + + # source://actionview//lib/action_view/template/error.rb#218 + def sub_template_of(template_path); end + + # Returns the value of attribute template. + # + # source://actionview//lib/action_view/template/error.rb#171 + def template; end + + private + + # source://actionview//lib/action_view/template/error.rb#244 + def formatted_code_for(source_code, line_counter, indent); end + + # source://actionview//lib/action_view/template/error.rb#236 + def source_location; end +end + +# source://actionview//lib/action_view/template/error.rb#166 +ActionView::Template::Error::SOURCE_CODE_RADIUS = T.let(T.unsafe(nil), Integer) + +# = Action View HTML Template +# +# source://actionview//lib/action_view/template/html.rb#6 +class ActionView::Template::HTML + # @return [HTML] a new instance of HTML + # + # source://actionview//lib/action_view/template/html.rb#9 + def initialize(string, type); end + + # source://actionview//lib/action_view/template/html.rb#28 + def format; end + + # source://actionview//lib/action_view/template/html.rb#14 + def identifier; end + + # source://actionview//lib/action_view/template/html.rb#18 + def inspect; end + + # source://actionview//lib/action_view/template/html.rb#24 + def render(*args); end + + # source://actionview//lib/action_view/template/html.rb#20 + def to_str; end + + # source://actionview//lib/action_view/template/html.rb#7 + def type; end +end + +# = Action View Template Handlers +# +# source://actionview//lib/action_view/template/handlers.rb#6 +module ActionView::Template::Handlers + # source://actionview//lib/action_view/template/handlers.rb#61 + def handler_for_extension(extension); end + + # source://actionview//lib/action_view/template/handlers.rb#56 + def register_default_template_handler(extension, klass); end + + # Register an object that knows how to handle template files with the given + # extensions. This can be used to implement new template types. + # The handler must respond to +:call+, which will be passed the template + # and should return the rendered template as a String. + # + # @raise [ArgumentError] + # + # source://actionview//lib/action_view/template/handlers.rb#31 + def register_template_handler(*extensions, handler); end + + # source://actionview//lib/action_view/template/handlers.rb#52 + def registered_template_handler(extension); end + + # source://actionview//lib/action_view/template/handlers.rb#48 + def template_handler_extensions; end + + # Opposite to register_template_handler. + # + # source://actionview//lib/action_view/template/handlers.rb#40 + def unregister_template_handler(*extensions); end + + class << self + # @private + # + # source://actionview//lib/action_view/template/handlers.rb#12 + def extended(base); end + + # source://actionview//lib/action_view/template/handlers.rb#23 + def extensions; end + end +end + +# source://actionview//lib/action_view/template/handlers/builder.rb#5 +class ActionView::Template::Handlers::Builder + # source://actionview//lib/action_view/template/handlers/builder.rb#8 + def call(template, source); end + + # source://actionview//lib/action_view/template/handlers/builder.rb#6 + def default_format; end + + # source://actionview//lib/action_view/template/handlers/builder.rb#6 + def default_format=(_arg0); end + + # source://actionview//lib/action_view/template/handlers/builder.rb#6 + def default_format?; end + + private + + # source://actionview//lib/action_view/template/handlers/builder.rb#17 + def require_engine; end + + class << self + # source://actionview//lib/action_view/template/handlers/builder.rb#6 + def default_format; end + + # source://actionview//lib/action_view/template/handlers/builder.rb#6 + def default_format=(value); end + + # source://actionview//lib/action_view/template/handlers/builder.rb#6 + def default_format?; end + + private + + # source://actionview//lib/action_view/template/handlers/builder.rb#6 + def __class_attr_default_format; end + + # source://actionview//lib/action_view/template/handlers/builder.rb#6 + def __class_attr_default_format=(new_value); end + end +end + +# source://actionview//lib/action_view/template/handlers/erb.rb#9 +class ActionView::Template::Handlers::ERB + # source://actionview//lib/action_view/template/handlers/erb.rb#65 + def call(template, source); end + + # source://actionview//lib/action_view/template/handlers/erb.rb#17 + def erb_implementation; end + + # source://actionview//lib/action_view/template/handlers/erb.rb#17 + def erb_implementation=(_arg0); end + + # source://actionview//lib/action_view/template/handlers/erb.rb#17 + def erb_implementation?; end + + # source://actionview//lib/action_view/template/handlers/erb.rb#14 + def erb_trim_mode; end + + # source://actionview//lib/action_view/template/handlers/erb.rb#14 + def erb_trim_mode=(_arg0); end + + # source://actionview//lib/action_view/template/handlers/erb.rb#14 + def erb_trim_mode?; end + + # source://actionview//lib/action_view/template/handlers/erb.rb#20 + def escape_ignore_list; end + + # source://actionview//lib/action_view/template/handlers/erb.rb#20 + def escape_ignore_list=(_arg0); end + + # source://actionview//lib/action_view/template/handlers/erb.rb#20 + def escape_ignore_list?; end + + # @return [Boolean] + # + # source://actionview//lib/action_view/template/handlers/erb.rb#37 + def handles_encoding?; end + + # source://actionview//lib/action_view/template/handlers/erb.rb#23 + def strip_trailing_newlines; end + + # source://actionview//lib/action_view/template/handlers/erb.rb#23 + def strip_trailing_newlines=(_arg0); end + + # source://actionview//lib/action_view/template/handlers/erb.rb#23 + def strip_trailing_newlines?; end + + # @return [Boolean] + # + # source://actionview//lib/action_view/template/handlers/erb.rb#33 + def supports_streaming?; end + + # Translate an error location returned by ErrorHighlight to the correct + # source location inside the template. + # + # source://actionview//lib/action_view/template/handlers/erb.rb#43 + def translate_location(spot, _backtrace_location, source); end + + private + + # Return the offset between the error lineno and the source lineno. + # Searches in reverse from the backtrace lineno so we have a better + # chance of finding the correct line + # + # The compiled template is likely to be longer than the source. + # Use the difference between the compiled and source sizes to + # determine the earliest line that could contain the highlight. + # + # @raise [LocationParsingError] + # + # source://actionview//lib/action_view/template/handlers/erb.rb#119 + def find_lineno_offset(compiled, source_lines, highlight, error_lineno); end + + # Find which token in the source template spans the byte range that + # contains the error_column, then return the offset compared to the + # original source template. + # + # Iterate consecutive pairs of CODE or TEXT tokens, requiring + # a match of the first token before matching either token. + # + # For example, if we want to find tokens A, B, C, we do the following: + # 1. Find a match for A: test error_column or advance scanner. + # 2. Find a match for B or A: + # a. If B: start over with next token set (B, C). + # b. If A: test error_column or advance scanner. + # c. Otherwise: Advance 1 byte + # + # Prioritize matching the next token over the current token once + # a match for the current token has been found. This is to prevent + # the current token from looping past the next token if they both + # match (i.e. if the current token is a single space character). + # + # @raise [LocationParsingError] + # + # source://actionview//lib/action_view/template/handlers/erb.rb#152 + def find_offset(compiled, source_tokens, error_column); end + + # source://actionview//lib/action_view/template/handlers/erb.rb#177 + def offset_source_tokens(source_tokens); end + + # @raise [WrongEncodingError] + # + # source://actionview//lib/action_view/template/handlers/erb.rb#97 + def valid_encoding(string, encoding); end + + class << self + # source://actionview//lib/action_view/template/handlers/erb.rb#29 + def call(template, source); end + + # source://actionview//lib/action_view/template/handlers/erb.rb#17 + def erb_implementation; end + + # source://actionview//lib/action_view/template/handlers/erb.rb#17 + def erb_implementation=(value); end + + # source://actionview//lib/action_view/template/handlers/erb.rb#17 + def erb_implementation?; end + + # source://actionview//lib/action_view/template/handlers/erb.rb#14 + def erb_trim_mode; end + + # source://actionview//lib/action_view/template/handlers/erb.rb#14 + def erb_trim_mode=(value); end + + # source://actionview//lib/action_view/template/handlers/erb.rb#14 + def erb_trim_mode?; end + + # source://actionview//lib/action_view/template/handlers/erb.rb#20 + def escape_ignore_list; end + + # source://actionview//lib/action_view/template/handlers/erb.rb#20 + def escape_ignore_list=(value); end + + # source://actionview//lib/action_view/template/handlers/erb.rb#20 + def escape_ignore_list?; end + + # source://actionview//lib/action_view/template/handlers/erb.rb#23 + def strip_trailing_newlines; end + + # source://actionview//lib/action_view/template/handlers/erb.rb#23 + def strip_trailing_newlines=(value); end + + # source://actionview//lib/action_view/template/handlers/erb.rb#23 + def strip_trailing_newlines?; end + + private + + # source://actionview//lib/action_view/template/handlers/erb.rb#17 + def __class_attr_erb_implementation; end + + # source://actionview//lib/action_view/template/handlers/erb.rb#17 + def __class_attr_erb_implementation=(new_value); end + + # source://actionview//lib/action_view/template/handlers/erb.rb#14 + def __class_attr_erb_trim_mode; end + + # source://actionview//lib/action_view/template/handlers/erb.rb#14 + def __class_attr_erb_trim_mode=(new_value); end + + # source://actionview//lib/action_view/template/handlers/erb.rb#20 + def __class_attr_escape_ignore_list; end + + # source://actionview//lib/action_view/template/handlers/erb.rb#20 + def __class_attr_escape_ignore_list=(new_value); end + + # source://actionview//lib/action_view/template/handlers/erb.rb#23 + def __class_attr_strip_trailing_newlines; end + + # source://actionview//lib/action_view/template/handlers/erb.rb#23 + def __class_attr_strip_trailing_newlines=(new_value); end + end +end + +# source://actionview//lib/action_view/template/handlers/erb.rb#25 +ActionView::Template::Handlers::ERB::ENCODING_TAG = T.let(T.unsafe(nil), Regexp) + +# source://actionview//lib/action_view/template/handlers/erb/erubi.rb#9 +class ActionView::Template::Handlers::ERB::Erubi < ::Erubi::Engine + # @return [Erubi] a new instance of Erubi + # + # source://actionview//lib/action_view/template/handlers/erb/erubi.rb#11 + def initialize(input, properties = T.unsafe(nil)); end + + private + + # source://actionview//lib/action_view/template/handlers/erb/erubi.rb#65 + def add_code(code); end + + # source://actionview//lib/action_view/template/handlers/erb/erubi.rb#47 + def add_expression(indicator, code); end + + # source://actionview//lib/action_view/template/handlers/erb/erubi.rb#70 + def add_postamble(_); end + + # source://actionview//lib/action_view/template/handlers/erb/erubi.rb#30 + def add_text(text); end + + # source://actionview//lib/action_view/template/handlers/erb/erubi.rb#75 + def flush_newline_if_pending(src); end +end + +# source://actionview//lib/action_view/template/handlers/erb/erubi.rb#45 +ActionView::Template::Handlers::ERB::Erubi::BLOCK_EXPR = T.let(T.unsafe(nil), Regexp) + +# source://actionview//lib/action_view/template/handlers/erb.rb#27 +class ActionView::Template::Handlers::ERB::LocationParsingError < ::StandardError; end + +# source://actionview//lib/action_view/template/handlers/html.rb#5 +class ActionView::Template::Handlers::Html < ::ActionView::Template::Handlers::Raw + # source://actionview//lib/action_view/template/handlers/html.rb#6 + def call(template, source); end +end + +# source://actionview//lib/action_view/template/handlers/raw.rb#5 +class ActionView::Template::Handlers::Raw + # source://actionview//lib/action_view/template/handlers/raw.rb#6 + def call(template, source); end +end + +# source://actionview//lib/action_view/template/inline.rb#7 +class ActionView::Template::Inline < ::ActionView::Template + # source://actionview//lib/action_view/template/inline.rb#16 + def compile(mod); end +end + +# This finalizer is needed (and exactly with a proc inside another proc) +# otherwise templates leak in development. +# +# source://actionview//lib/action_view/template/inline.rb#8 +ActionView::Template::Inline::Finalizer = T.let(T.unsafe(nil), Proc) + +# source://actionview//lib/action_view/template.rb#308 +ActionView::Template::LEADING_ENCODING_REGEXP = T.let(T.unsafe(nil), Regexp) + +# source://actionview//lib/action_view/template.rb#197 +ActionView::Template::NONE = T.let(T.unsafe(nil), Object) + +# source://actionview//lib/action_view/template.rb#558 +ActionView::Template::RUBY_RESERVED_KEYWORDS = T.let(T.unsafe(nil), Array) + +# = Action View RawFile Template +# +# source://actionview//lib/action_view/template/raw_file.rb#6 +class ActionView::Template::RawFile + # @return [RawFile] a new instance of RawFile + # + # source://actionview//lib/action_view/template/raw_file.rb#9 + def initialize(filename); end + + # source://actionview//lib/action_view/template/raw_file.rb#7 + def format; end + + # source://actionview//lib/action_view/template/raw_file.rb#7 + def format=(_arg0); end + + # source://actionview//lib/action_view/template/raw_file.rb#16 + def identifier; end + + # source://actionview//lib/action_view/template/raw_file.rb#20 + def render(*args); end + + # @return [Boolean] + # + # source://actionview//lib/action_view/template/raw_file.rb#24 + def supports_streaming?; end + + # source://actionview//lib/action_view/template/raw_file.rb#7 + def type; end + + # source://actionview//lib/action_view/template/raw_file.rb#7 + def type=(_arg0); end +end + +# = Action View Renderable Template for objects that respond to #render_in +# +# source://actionview//lib/action_view/template/renderable.rb#6 +class ActionView::Template::Renderable + # @return [Renderable] a new instance of Renderable + # + # source://actionview//lib/action_view/template/renderable.rb#7 + def initialize(renderable); end + + # source://actionview//lib/action_view/template/renderable.rb#25 + def format; end + + # source://actionview//lib/action_view/template/renderable.rb#11 + def identifier; end + + # source://actionview//lib/action_view/template/renderable.rb#15 + def render(context, *args); end +end + +# source://actionview//lib/action_view/template.rb#10 +ActionView::Template::STRICT_LOCALS_REGEX = T.let(T.unsafe(nil), Regexp) + +# SimpleType is mostly just a stub implementation for when Action View +# is used without Action Dispatch. +# +# source://actionview//lib/action_view/template/types.rb#9 +class ActionView::Template::SimpleType + # @return [SimpleType] a new instance of SimpleType + # + # source://actionview//lib/action_view/template/types.rb#29 + def initialize(symbol); end + + # source://actionview//lib/action_view/template/types.rb#43 + def ==(type); end + + # source://actionview//lib/action_view/template/types.rb#38 + def ref; end + + # Returns the value of attribute symbol. + # + # source://actionview//lib/action_view/template/types.rb#27 + def symbol; end + + # source://actionview//lib/action_view/template/types.rb#33 + def to_s; end + + # source://actionview//lib/action_view/template/types.rb#36 + def to_str; end + + # source://actionview//lib/action_view/template/types.rb#41 + def to_sym; end + + class << self + # source://actionview//lib/action_view/template/types.rb#14 + def [](type); end + + # Returns the value of attribute symbols. + # + # source://actionview//lib/action_view/template/types.rb#12 + def symbols; end + + # :nodoc + # + # @return [Boolean] + # + # source://actionview//lib/action_view/template/types.rb#22 + def valid_symbols?(symbols); end + end +end + +# source://actionview//lib/action_view/template/sources.rb#5 +module ActionView::Template::Sources + extend ::ActiveSupport::Autoload +end + +# source://actionview//lib/action_view/template/sources/file.rb#6 +class ActionView::Template::Sources::File + # @return [File] a new instance of File + # + # source://actionview//lib/action_view/template/sources/file.rb#7 + def initialize(filename); end + + # source://actionview//lib/action_view/template/sources/file.rb#11 + def to_s; end +end + +# = Action View Text Template +# +# source://actionview//lib/action_view/template/text.rb#6 +class ActionView::Template::Text + # @return [Text] a new instance of Text + # + # source://actionview//lib/action_view/template/text.rb#9 + def initialize(string); end + + # source://actionview//lib/action_view/template/text.rb#27 + def format; end + + # source://actionview//lib/action_view/template/text.rb#13 + def identifier; end + + # source://actionview//lib/action_view/template/text.rb#17 + def inspect; end + + # source://actionview//lib/action_view/template/text.rb#23 + def render(*args); end + + # source://actionview//lib/action_view/template/text.rb#19 + def to_str; end + + # source://actionview//lib/action_view/template/text.rb#7 + def type; end + + # source://actionview//lib/action_view/template/text.rb#7 + def type=(_arg0); end +end + +# source://actionview//lib/action_view/template.rb#189 +ActionView::Template::Types = Mime + +# source://actionview//lib/action_view/template_details.rb#4 +class ActionView::TemplateDetails + # @return [TemplateDetails] a new instance of TemplateDetails + # + # source://actionview//lib/action_view/template_details.rb#35 + def initialize(locale, handler, format, variant); end + + # Returns the value of attribute format. + # + # source://actionview//lib/action_view/template_details.rb#33 + def format; end + + # source://actionview//lib/action_view/template_details.rb#62 + def format_or_default; end + + # Returns the value of attribute handler. + # + # source://actionview//lib/action_view/template_details.rb#33 + def handler; end + + # source://actionview//lib/action_view/template_details.rb#58 + def handler_class; end + + # Returns the value of attribute locale. + # + # source://actionview//lib/action_view/template_details.rb#33 + def locale; end + + # @return [Boolean] + # + # source://actionview//lib/action_view/template_details.rb#42 + def matches?(requested); end + + # source://actionview//lib/action_view/template_details.rb#49 + def sort_key_for(requested); end + + # Returns the value of attribute variant. + # + # source://actionview//lib/action_view/template_details.rb#33 + def variant; end +end + +# source://actionview//lib/action_view/template_details.rb#5 +class ActionView::TemplateDetails::Requested + # @return [Requested] a new instance of Requested + # + # source://actionview//lib/action_view/template_details.rb#11 + def initialize(locale:, handlers:, formats:, variants:); end + + # Returns the value of attribute formats. + # + # source://actionview//lib/action_view/template_details.rb#6 + def formats; end + + # Returns the value of attribute formats_idx. + # + # source://actionview//lib/action_view/template_details.rb#7 + def formats_idx; end + + # Returns the value of attribute handlers. + # + # source://actionview//lib/action_view/template_details.rb#6 + def handlers; end + + # Returns the value of attribute handlers_idx. + # + # source://actionview//lib/action_view/template_details.rb#7 + def handlers_idx; end + + # Returns the value of attribute locale. + # + # source://actionview//lib/action_view/template_details.rb#6 + def locale; end + + # Returns the value of attribute locale_idx. + # + # source://actionview//lib/action_view/template_details.rb#7 + def locale_idx; end + + # Returns the value of attribute variants. + # + # source://actionview//lib/action_view/template_details.rb#6 + def variants; end + + # Returns the value of attribute variants_idx. + # + # source://actionview//lib/action_view/template_details.rb#7 + def variants_idx; end + + private + + # source://actionview//lib/action_view/template_details.rb#28 + def build_idx_hash(arr); end +end + +# source://actionview//lib/action_view/template_details.rb#9 +ActionView::TemplateDetails::Requested::ANY_HASH = T.let(T.unsafe(nil), Hash) + +# source://actionview//lib/action_view/template/error.rb#254 +ActionView::TemplateError = ActionView::Template::Error + +# = Action View \TemplatePath +# +# Represents a template path within ActionView's lookup and rendering system, +# like "users/show" +# +# TemplatePath makes it convenient to convert between separate name, prefix, +# partial arguments and the virtual path. +# +# source://actionview//lib/action_view/template_path.rb#11 +class ActionView::TemplatePath + # @return [TemplatePath] a new instance of TemplatePath + # + # source://actionview//lib/action_view/template_path.rb#47 + def initialize(name, prefix, partial, virtual); end + + # @return [Boolean] + # + # source://actionview//lib/action_view/template_path.rb#64 + def ==(other); end + + # @return [Boolean] + # + # source://actionview//lib/action_view/template_path.rb#61 + def eql?(other); end + + # source://actionview//lib/action_view/template_path.rb#57 + def hash; end + + # Returns the value of attribute name. + # + # source://actionview//lib/action_view/template_path.rb#12 + def name; end + + # Returns the value of attribute partial. + # + # source://actionview//lib/action_view/template_path.rb#12 + def partial; end + + # Returns the value of attribute partial. + # + # source://actionview//lib/action_view/template_path.rb#13 + def partial?; end + + # Returns the value of attribute prefix. + # + # source://actionview//lib/action_view/template_path.rb#12 + def prefix; end + + # Returns the value of attribute virtual. + # + # source://actionview//lib/action_view/template_path.rb#55 + def to_s; end + + # Returns the value of attribute virtual. + # + # source://actionview//lib/action_view/template_path.rb#54 + def to_str; end + + # Returns the value of attribute virtual. + # + # source://actionview//lib/action_view/template_path.rb#12 + def virtual; end + + # Returns the value of attribute virtual. + # + # source://actionview//lib/action_view/template_path.rb#14 + def virtual_path; end + + class << self + # Convert name, prefix, and partial into a TemplatePath + # + # source://actionview//lib/action_view/template_path.rb#43 + def build(name, prefix, partial); end + + # Build a TemplatePath form a virtual path + # + # source://actionview//lib/action_view/template_path.rb#28 + def parse(virtual); end + + # Convert name, prefix, and partial into a virtual path string + # + # source://actionview//lib/action_view/template_path.rb#17 + def virtual(name, prefix, partial); end + end +end + +# source://actionview//lib/action_view/renderer/template_renderer.rb#4 +class ActionView::TemplateRenderer < ::ActionView::AbstractRenderer + # source://actionview//lib/action_view/renderer/template_renderer.rb#5 + def render(context, options); end + + private + + # Determine the template to be rendered using the given options. + # + # source://actionview//lib/action_view/renderer/template_renderer.rb#16 + def determine_template(options); end + + # This is the method which actually finds the layout using details in the lookup + # context object. If no layout is found, it checks if at least a layout with + # the given name exists across all details before raising the error. + # + # source://actionview//lib/action_view/renderer/template_renderer.rb#88 + def find_layout(layout, keys, formats); end + + # Renders the given template. A string representing the layout can be + # supplied as well. + # + # source://actionview//lib/action_view/renderer/template_renderer.rb#58 + def render_template(view, template, layout_name, locals); end + + # source://actionview//lib/action_view/renderer/template_renderer.rb#71 + def render_with_layout(view, template, path, locals); end + + # source://actionview//lib/action_view/renderer/template_renderer.rb#92 + def resolve_layout(layout, keys, formats); end +end + +# = Action View Test Case +# +# Read more about ActionView::TestCase in {Testing Rails Applications}[https://guides.rubyonrails.org/testing.html#testing-view-partials] +# in the guides. +# +# source://actionview//lib/action_view/test_case.rb#15 +class ActionView::TestCase < ::ActiveSupport::TestCase + include ::ActionDispatch::Assertions::RoutingAssertions + include ::ActionDispatch::Assertions::ResponseAssertions + include ::ActionDispatch::TestProcess::FixtureFile + include ::ActionDispatch::TestProcess + include ::Rails::Dom::Testing::Assertions::DomAssertions + include ::Rails::Dom::Testing::Assertions::SelectorAssertions + include ::Rails::Dom::Testing::Assertions + include ::ActionDispatch::Assertions + include ::AbstractController::Helpers + include ::ActiveSupport::Benchmarkable + include ::ActionView::Helpers::ActiveModelHelper + include ::ActionView::Helpers::AssetUrlHelper + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + include ::ActionView::Helpers::TagHelper + include ::ActionView::Helpers::AssetTagHelper + include ::ActionView::Helpers::AtomFeedHelper + include ::ActionView::Helpers::CacheHelper + include ::ActionView::Helpers::ContentExfiltrationPreventionHelper + include ::ActionView::Helpers::UrlHelper + include ::ActionView::Helpers::SanitizeHelper + include ::ActionView::Helpers::ControllerHelper + include ::ActionView::Helpers::CspHelper + include ::ActionView::Helpers::CsrfHelper + include ::ActionView::Helpers::DateHelper + include ::ActionView::Helpers::DebugHelper + include ::ActionView::Helpers::TextHelper + include ::ActionView::Helpers::FormTagHelper + include ::ActionController::TemplateAssertions + include ::ActionView::Context + include ::ActionDispatch::Routing::PolymorphicRoutes + include ::ActionView::ModelNaming + include ::ActionView::RecordIdentifier + include ::ActionView::Helpers::FormHelper + include ::ActionView::Helpers::TranslationHelper + include ::ActionView::Helpers::FormOptionsHelper + include ::ActionView::Helpers::JavaScriptHelper + include ::ActionView::Helpers::NumberHelper + include ::ActionView::Helpers::RenderingHelper + include ::ActionView::Helpers + include ::ActiveSupport::Testing::ConstantLookup + include ::ActionDispatch::Routing::UrlFor + include ::ActionView::RoutingUrlFor + include ::ActionView::TestCase::Behavior + extend ::ActionDispatch::Assertions::RoutingAssertions::ClassMethods + extend ::AbstractController::Helpers::Resolution + extend ::AbstractController::Helpers::ClassMethods + extend ::ActionView::Helpers::UrlHelper::ClassMethods + extend ::ActionView::Helpers::SanitizeHelper::ClassMethods + extend ::ActiveSupport::Testing::ConstantLookup::ClassMethods + extend ::ActionView::TestCase::Behavior::ClassMethods + + # source://actionview//lib/action_view/test_case.rb#444 + def _helper_methods; end + + # source://actionview//lib/action_view/test_case.rb#444 + def _helper_methods=(_arg0); end + + # source://actionview//lib/action_view/test_case.rb#444 + def _helper_methods?; end + + # source://actionview//lib/action_view/test_case.rb#251 + def _run_setup_callbacks(&block); end + + # source://actionview//lib/action_view/test_case.rb#444 + def debug_missing_translation; end + + # source://actionview//lib/action_view/test_case.rb#444 + def debug_missing_translation=(val); end + + class << self + # source://actionview//lib/action_view/test_case.rb#444 + def _helper_methods; end + + # source://actionview//lib/action_view/test_case.rb#444 + def _helper_methods=(value); end + + # source://actionview//lib/action_view/test_case.rb#444 + def _helper_methods?; end + + # source://actionview//lib/action_view/test_case.rb#444 + def _helpers; end + + # source://actionview//lib/action_view/test_case.rb#249 + def content_class; end + + # source://actionview//lib/action_view/test_case.rb#249 + def content_class=(value); end + + # source://actionview//lib/action_view/test_case.rb#249 + def content_class?; end + + # source://actionview//lib/action_view/test_case.rb#444 + def debug_missing_translation; end + + # source://actionview//lib/action_view/test_case.rb#444 + def debug_missing_translation=(val); end + + private + + # source://actionview//lib/action_view/test_case.rb#251 + def __class_attr___callbacks; end + + # source://actionview//lib/action_view/test_case.rb#251 + def __class_attr___callbacks=(new_value); end + + # source://actionview//lib/action_view/test_case.rb#444 + def __class_attr__helper_methods; end + + # source://actionview//lib/action_view/test_case.rb#444 + def __class_attr__helper_methods=(new_value); end + + # source://actionview//lib/action_view/test_case.rb#249 + def __class_attr_content_class; end + + # source://actionview//lib/action_view/test_case.rb#249 + def __class_attr_content_class=(new_value); end + end +end + +# source://actionview//lib/action_view/test_case.rb#45 +module ActionView::TestCase::Behavior + include ::ActionDispatch::TestProcess::FixtureFile + include ::ActionDispatch::TestProcess + include ::Rails::Dom::Testing::Assertions::DomAssertions + include ::Rails::Dom::Testing::Assertions::SelectorAssertions + include ::Rails::Dom::Testing::Assertions + include ::ActionController::TemplateAssertions + include ::ActionView::Context + include ::ActionDispatch::Routing::PolymorphicRoutes + include ::ActionView::ModelNaming + include ::ActionView::RecordIdentifier + include ::ActionDispatch::Routing::UrlFor + include ::ActionView::RoutingUrlFor + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActionDispatch::Assertions::RoutingAssertions + include ::ActionDispatch::Assertions + include ::AbstractController::Helpers + include ::ActionView::Helpers::UrlHelper + include ::ActionView::Helpers::SanitizeHelper + include ::ActionView::Helpers::TextHelper + include ::ActionView::Helpers::FormTagHelper + include ::ActionView::Helpers::FormHelper + include ::ActionView::Helpers::TranslationHelper + include ::ActionView::Helpers + include ::ActiveSupport::Testing::ConstantLookup + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionDispatch::Assertions::RoutingAssertions::ClassMethods + mixes_in_class_methods ::AbstractController::Helpers::ClassMethods + mixes_in_class_methods ::ActionView::Helpers::UrlHelper::ClassMethods + mixes_in_class_methods ::ActionView::Helpers::SanitizeHelper::ClassMethods + mixes_in_class_methods ::ActiveSupport::Testing::ConstantLookup::ClassMethods + mixes_in_class_methods ::ActionView::TestCase::Behavior::ClassMethods + + # source://actionview//lib/action_view/test_case.rb#295 + def _routes; end + + # source://actionview//lib/action_view/test_case.rb#281 + def config; end + + # Returns the value of attribute controller. + # + # source://actionview//lib/action_view/test_case.rb#63 + def controller; end + + # Sets the attribute controller + # + # @param value the value to set the attribute controller to. + # + # source://actionview//lib/action_view/test_case.rb#63 + def controller=(_arg0); end + + # source://actionview//lib/action_view/test_case.rb#62 + def lookup_context(*_arg0, **_arg1, &_arg2); end + + # Returns the value of attribute output_buffer. + # + # source://actionview//lib/action_view/test_case.rb#63 + def output_buffer; end + + # Sets the attribute output_buffer + # + # @param value the value to set the attribute output_buffer to. + # + # source://actionview//lib/action_view/test_case.rb#63 + def output_buffer=(_arg0); end + + # source://actionview//lib/action_view/test_case.rb#285 + def render(options = T.unsafe(nil), local_assigns = T.unsafe(nil), &block); end + + # Returns the content rendered by the last +render+ call. + # + # The returned object behaves like a string but also exposes a number of methods + # that allows you to parse the content string in formats registered using + # .register_parser. + # + # By default includes the following parsers: + # + # +.html+ + # + # Parse the rendered content String into HTML. By default, this means + # a Nokogiri::XML::Node. + # + # test "renders HTML" do + # article = Article.create!(title: "Hello, world") + # + # render partial: "articles/article", locals: { article: article } + # + # assert_pattern { rendered.html.at("main h1") => { content: "Hello, world" } } + # end + # + # To parse the rendered content into a Capybara::Simple::Node, + # re-register an :html parser with a call to + # Capybara.string: + # + # register_parser :html, -> rendered { Capybara.string(rendered) } + # + # test "renders HTML" do + # article = Article.create!(title: "Hello, world") + # + # render partial: article + # + # rendered.html.assert_css "h1", text: "Hello, world" + # end + # + # +.json+ + # + # Parse the rendered content String into JSON. By default, this means + # a ActiveSupport::HashWithIndifferentAccess. + # + # test "renders JSON" do + # article = Article.create!(title: "Hello, world") + # + # render formats: :json, partial: "articles/article", locals: { article: article } + # + # assert_pattern { rendered.json => { title: "Hello, world" } } + # end + # + # source://actionview//lib/action_view/test_case.rb#112 + def rendered; end + + # Returns the content rendered by the last +render+ call. + # + # The returned object behaves like a string but also exposes a number of methods + # that allows you to parse the content string in formats registered using + # .register_parser. + # + # By default includes the following parsers: + # + # +.html+ + # + # Parse the rendered content String into HTML. By default, this means + # a Nokogiri::XML::Node. + # + # test "renders HTML" do + # article = Article.create!(title: "Hello, world") + # + # render partial: "articles/article", locals: { article: article } + # + # assert_pattern { rendered.html.at("main h1") => { content: "Hello, world" } } + # end + # + # To parse the rendered content into a Capybara::Simple::Node, + # re-register an :html parser with a call to + # Capybara.string: + # + # register_parser :html, -> rendered { Capybara.string(rendered) } + # + # test "renders HTML" do + # article = Article.create!(title: "Hello, world") + # + # render partial: article + # + # rendered.html.assert_css "h1", text: "Hello, world" + # end + # + # +.json+ + # + # Parse the rendered content String into JSON. By default, this means + # a ActiveSupport::HashWithIndifferentAccess. + # + # test "renders JSON" do + # article = Article.create!(title: "Hello, world") + # + # render formats: :json, partial: "articles/article", locals: { article: article } + # + # assert_pattern { rendered.json => { title: "Hello, world" } } + # end + # + # source://actionview//lib/action_view/test_case.rb#112 + def rendered=(_arg0); end + + # source://actionview//lib/action_view/test_case.rb#291 + def rendered_views; end + + # Returns the value of attribute request. + # + # source://actionview//lib/action_view/test_case.rb#63 + def request; end + + # Sets the attribute request + # + # @param value the value to set the attribute request to. + # + # source://actionview//lib/action_view/test_case.rb#63 + def request=(_arg0); end + + # source://actionview//lib/action_view/test_case.rb#269 + def setup_with_controller; end + + private + + # source://actionview//lib/action_view/test_case.rb#401 + def _user_defined_ivars; end + + # The instance of ActionView::Base that is used by +render+. + # + # source://actionview//lib/action_view/test_case.rb#364 + def _view; end + + # Need to experiment if this priority is the best one: rendered => output_buffer + # + # source://actionview//lib/action_view/test_case.rb#329 + def document_root_element; end + + # source://actionview//lib/action_view/test_case.rb#415 + def method_missing(selector, *_arg1, **_arg2, &_arg3); end + + # @return [Boolean] + # + # source://actionview//lib/action_view/test_case.rb#431 + def respond_to_missing?(name, include_private = T.unsafe(nil)); end + + # The instance of ActionView::Base that is used by +render+. + # + # source://actionview//lib/action_view/test_case.rb#353 + def view; end + + # Returns a Hash of instance variables and their values, as defined by + # the user in the test case, which are then assigned to the view being + # rendered. This is generally intended for internal use and extension + # frameworks. + # + # source://actionview//lib/action_view/test_case.rb#409 + def view_assigns; end + + module GeneratedClassMethods + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + def content_class; end + def content_class=(value); end + def content_class?; end + end + + module GeneratedInstanceMethods + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + end +end + +# source://actionview//lib/action_view/test_case.rb#114 +module ActionView::TestCase::Behavior::ClassMethods + # source://actionview//lib/action_view/test_case.rb#213 + def determine_default_helper_class(name); end + + # source://actionview//lib/action_view/test_case.rb#232 + def helper_class; end + + # Sets the attribute helper_class + # + # @param value the value to set the attribute helper_class to. + # + # source://actionview//lib/action_view/test_case.rb#230 + def helper_class=(_arg0); end + + # source://actionview//lib/action_view/test_case.rb#219 + def helper_method(*methods); end + + # source://actionview//lib/action_view/test_case.rb#115 + def inherited(descendant); end + + # source://actionview//lib/action_view/test_case.rb#236 + def new(*_arg0); end + + # Register a callable to parse rendered content for a given template + # format. + # + # Each registered parser will also define a +#rendered.[FORMAT]+ helper + # method, where +[FORMAT]+ corresponds to the value of the + # +format+ argument. + # + # By default, ActionView::TestCase defines parsers for: + # + # * +:html+ - returns an instance of +Nokogiri::XML::Node+ + # * +:json+ - returns an instance of ActiveSupport::HashWithIndifferentAccess + # + # These pre-registered parsers also define corresponding helpers: + # + # * +:html+ - defines +rendered.html+ + # * +:json+ - defines +rendered.json+ + # + # ==== Parameters + # + # [+format+] + # The name (as a +Symbol+) of the format used to render the content. + # + # [+callable+] + # The parser. A callable object that accepts the rendered string as + # its sole argument. Alternatively, the parser can be specified as a + # block. + # + # ==== Examples + # + # test "renders HTML" do + # article = Article.create!(title: "Hello, world") + # + # render partial: "articles/article", locals: { article: article } + # + # assert_pattern { rendered.html.at("main h1") => { content: "Hello, world" } } + # end + # + # test "renders JSON" do + # article = Article.create!(title: "Hello, world") + # + # render formats: :json, partial: "articles/article", locals: { article: article } + # + # assert_pattern { rendered.json => { title: "Hello, world" } } + # end + # + # To parse the rendered content into RSS, register a call to +RSS::Parser.parse+: + # + # register_parser :rss, -> rendered { RSS::Parser.parse(rendered) } + # + # test "renders RSS" do + # article = Article.create!(title: "Hello, world") + # + # render formats: :rss, partial: article + # + # assert_equal "Hello, world", rendered.rss.items.last.title + # end + # + # To parse the rendered content into a +Capybara::Simple::Node+, + # re-register an +:html+ parser with a call to +Capybara.string+: + # + # register_parser :html, -> rendered { Capybara.string(rendered) } + # + # test "renders HTML" do + # article = Article.create!(title: "Hello, world") + # + # render partial: article + # + # rendered.html.assert_css "h1", text: "Hello, world" + # end + # + # source://actionview//lib/action_view/test_case.rb#197 + def register_parser(format, callable = T.unsafe(nil), &block); end + + # source://actionview//lib/action_view/test_case.rb#204 + def tests(helper_class); end + + private + + # source://actionview//lib/action_view/test_case.rb#242 + def include_helper_modules!; end +end + +# source://actionview//lib/action_view/test_case.rb#366 +ActionView::TestCase::Behavior::INTERNAL_IVARS = T.let(T.unsafe(nil), Array) + +# source://actionview//lib/action_view/test_case.rb#333 +module ActionView::TestCase::Behavior::Locals + # source://actionview//lib/action_view/test_case.rb#336 + def render(options = T.unsafe(nil), local_assigns = T.unsafe(nil)); end + + # Returns the value of attribute rendered_views. + # + # source://actionview//lib/action_view/test_case.rb#334 + def rendered_views; end + + # Sets the attribute rendered_views + # + # @param value the value to set the attribute rendered_views to. + # + # source://actionview//lib/action_view/test_case.rb#334 + def rendered_views=(_arg0); end +end + +# source://actionview//lib/action_view/test_case.rb#299 +class ActionView::TestCase::Behavior::RenderedViewContent < ::String + # source://actionview//lib/action_view/test_case.rb#199 + def html; end + + # source://actionview//lib/action_view/test_case.rb#199 + def json; end +end + +# source://actionview//lib/action_view/test_case.rb#302 +class ActionView::TestCase::Behavior::RenderedViewsCollection + # @return [RenderedViewsCollection] a new instance of RenderedViewsCollection + # + # source://actionview//lib/action_view/test_case.rb#303 + def initialize; end + + # source://actionview//lib/action_view/test_case.rb#307 + def add(view, locals); end + + # source://actionview//lib/action_view/test_case.rb#312 + def locals_for(view); end + + # source://actionview//lib/action_view/test_case.rb#316 + def rendered_views; end + + # @return [Boolean] + # + # source://actionview//lib/action_view/test_case.rb#320 + def view_rendered?(view, expected_locals); end +end + +# source://actionview//lib/action_view/test_case.rb#444 +module ActionView::TestCase::HelperMethods + # source://actionview//lib/action_view/test_case.rb#263 + def _test_case; end + + # source://actionview//lib/action_view/test_case.rb#259 + def protect_against_forgery?; end +end + +# source://actionview//lib/action_view/test_case.rb#16 +class ActionView::TestCase::TestController < ::ActionController::Base + include ::ActionDispatch::TestProcess::FixtureFile + include ::ActionDispatch::TestProcess + + # @return [TestController] a new instance of TestController + # + # source://actionview//lib/action_view/test_case.rb#34 + def initialize; end + + # source://actionview//lib/action_view/test_case.rb#26 + def controller_path=(path); end + + # Returns the value of attribute params. + # + # source://actionview//lib/action_view/test_case.rb#19 + def params; end + + # Sets the attribute params + # + # @param value the value to set the attribute params to. + # + # source://actionview//lib/action_view/test_case.rb#19 + def params=(_arg0); end + + # Returns the value of attribute request. + # + # source://actionview//lib/action_view/test_case.rb#19 + def request; end + + # Sets the attribute request + # + # @param value the value to set the attribute request to. + # + # source://actionview//lib/action_view/test_case.rb#19 + def request=(_arg0); end + + # Returns the value of attribute response. + # + # source://actionview//lib/action_view/test_case.rb#19 + def response; end + + # Sets the attribute response + # + # @param value the value to set the attribute response to. + # + # source://actionview//lib/action_view/test_case.rb#19 + def response=(_arg0); end + + private + + # source://actionview//lib/action_view/test_case.rb#16 + def _layout(lookup_context, formats, keys); end + + # source://actionview//lib/action_view/test_case.rb#16 + def _layout_from_proc; end + + class << self + # source://actionview//lib/action_view/test_case.rb#30 + def controller_name; end + + # Overrides AbstractController::Base#controller_path + # + # source://actionview//lib/action_view/test_case.rb#23 + def controller_path; end + + # Overrides AbstractController::Base#controller_path + # + # source://actionview//lib/action_view/test_case.rb#23 + def controller_path=(_arg0); end + + private + + # source://actionview//lib/action_view/test_case.rb#16 + def __class_attr_config; end + + # source://actionview//lib/action_view/test_case.rb#16 + def __class_attr_config=(new_value); end + + # source://actionview//lib/action_view/test_case.rb#16 + def __class_attr_middleware_stack; end + + # source://actionview//lib/action_view/test_case.rb#16 + def __class_attr_middleware_stack=(new_value); end + end +end + +# source://actionview//lib/action_view/unbound_template.rb#6 +class ActionView::UnboundTemplate + # @return [UnboundTemplate] a new instance of UnboundTemplate + # + # source://actionview//lib/action_view/unbound_template.rb#10 + def initialize(source, identifier, details:, virtual_path:); end + + # source://actionview//lib/action_view/unbound_template.rb#20 + def bind_locals(locals); end + + # source://actionview//lib/action_view/unbound_template.rb#44 + def built_templates; end + + # Returns the value of attribute details. + # + # source://actionview//lib/action_view/unbound_template.rb#7 + def details; end + + # source://actionview//lib/action_view/unbound_template.rb#8 + def format(*_arg0, **_arg1, &_arg2); end + + # source://actionview//lib/action_view/unbound_template.rb#8 + def handler(*_arg0, **_arg1, &_arg2); end + + # source://actionview//lib/action_view/unbound_template.rb#8 + def locale(*_arg0, **_arg1, &_arg2); end + + # source://actionview//lib/action_view/unbound_template.rb#8 + def variant(*_arg0, **_arg1, &_arg2); end + + # Returns the value of attribute virtual_path. + # + # source://actionview//lib/action_view/unbound_template.rb#7 + def virtual_path; end + + private + + # source://actionview//lib/action_view/unbound_template.rb#49 + def build_template(locals); end + + # source://actionview//lib/action_view/unbound_template.rb#63 + def normalize_locals(locals); end +end + +# source://actionview//lib/action_view/gem_version.rb#9 +module ActionView::VERSION; end + +# source://actionview//lib/action_view/gem_version.rb#10 +ActionView::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# source://actionview//lib/action_view/gem_version.rb#11 +ActionView::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# source://actionview//lib/action_view/gem_version.rb#13 +ActionView::VERSION::PRE = T.let(T.unsafe(nil), T.untyped) + +# source://actionview//lib/action_view/gem_version.rb#15 +ActionView::VERSION::STRING = T.let(T.unsafe(nil), String) + +# source://actionview//lib/action_view/gem_version.rb#12 +ActionView::VERSION::TINY = T.let(T.unsafe(nil), Integer) + +# source://actionview//lib/action_view/view_paths.rb#4 +module ActionView::ViewPaths + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionView::ViewPaths::ClassMethods + + # The prefixes used in render "foo" shortcuts. + # + # source://actionview//lib/action_view/view_paths.rb#81 + def _prefixes; end + + # source://actionview//lib/action_view/view_paths.rb#11 + def any_templates?(*_arg0, **_arg1, &_arg2); end + + # Append a path to the list of view paths for the current LookupContext. + # + # ==== Parameters + # * path - If a String is provided, it gets converted into + # the default view path. You may also provide a custom view path + # (see ActionView::PathSet for more information) + # + # source://actionview//lib/action_view/view_paths.rb#103 + def append_view_path(path); end + + # source://actionview//lib/action_view/view_paths.rb#93 + def details_for_lookup; end + + # source://actionview//lib/action_view/view_paths.rb#11 + def formats(*_arg0, **_arg1, &_arg2); end + + # source://actionview//lib/action_view/view_paths.rb#11 + def formats=(arg); end + + # source://actionview//lib/action_view/view_paths.rb#11 + def locale(*_arg0, **_arg1, &_arg2); end + + # source://actionview//lib/action_view/view_paths.rb#11 + def locale=(arg); end + + # LookupContext is the object responsible for holding all + # information required for looking up templates, i.e. view paths and + # details. Check ActionView::LookupContext for more information. + # + # source://actionview//lib/action_view/view_paths.rb#88 + def lookup_context; end + + # Prepend a path to the list of view paths for the current LookupContext. + # + # ==== Parameters + # * path - If a String is provided, it gets converted into + # the default view path. You may also provide a custom view path + # (see ActionView::PathSet for more information) + # + # source://actionview//lib/action_view/view_paths.rb#113 + def prepend_view_path(path); end + + # source://actionview//lib/action_view/view_paths.rb#11 + def template_exists?(*_arg0, **_arg1, &_arg2); end + + # source://actionview//lib/action_view/view_paths.rb#11 + def view_paths(*_arg0, **_arg1, &_arg2); end +end + +# source://actionview//lib/action_view/view_paths.rb#14 +module ActionView::ViewPaths::ClassMethods + # source://actionview//lib/action_view/view_paths.rb#31 + def _build_view_paths(paths); end + + # source://actionview//lib/action_view/view_paths.rb#23 + def _prefixes; end + + # source://actionview//lib/action_view/view_paths.rb#15 + def _view_paths; end + + # source://actionview//lib/action_view/view_paths.rb#19 + def _view_paths=(paths); end + + # Append a path to the list of view paths for this controller. + # + # ==== Parameters + # * path - If a String is provided, it gets converted into + # the default view path. You may also provide a custom view path + # (see ActionView::PathSet for more information) + # + # source://actionview//lib/action_view/view_paths.rb#44 + def append_view_path(path); end + + # Prepend a path to the list of view paths for this controller. + # + # ==== Parameters + # * path - If a String is provided, it gets converted into + # the default view path. You may also provide a custom view path + # (see ActionView::PathSet for more information) + # + # source://actionview//lib/action_view/view_paths.rb#54 + def prepend_view_path(path); end + + # A list of all of the default view paths for this controller. + # + # source://actionview//lib/action_view/view_paths.rb#59 + def view_paths; end + + # Set the view paths. + # + # ==== Parameters + # * paths - If a PathSet is provided, use that; + # otherwise, process the parameter into a PathSet. + # + # source://actionview//lib/action_view/view_paths.rb#68 + def view_paths=(paths); end + + private + + # Override this method in your controller if you want to change paths prefixes for finding views. + # Prefixes defined here will still be added to parents' ._prefixes. + # + # source://actionview//lib/action_view/view_paths.rb#75 + def local_prefixes; end +end + +# source://actionview//lib/action_view/template/error.rb#14 +class ActionView::WrongEncodingError < ::ActionView::EncodingError + # @return [WrongEncodingError] a new instance of WrongEncodingError + # + # source://actionview//lib/action_view/template/error.rb#15 + def initialize(string, encoding); end + + # source://actionview//lib/action_view/template/error.rb#19 + def message; end +end + +module ERB::Escape; end diff --git a/sorbet/rbi/gems/activejob@8.1.1.rbi b/sorbet/rbi/gems/activejob@8.1.1.rbi new file mode 100644 index 0000000..bac01bd --- /dev/null +++ b/sorbet/rbi/gems/activejob@8.1.1.rbi @@ -0,0 +1,3577 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `activejob` gem. +# Please instead update this file by running `bin/tapioca gem activejob`. + + +# :markup: markdown +# :include: ../README.md +# +# source://activejob//lib/active_job/gem_version.rb#3 +module ActiveJob + extend ::ActiveSupport::Autoload + + class << self + # source://activejob//lib/active_job/queue_adapter.rb#7 + def adapter_name(adapter); end + + # source://activejob//lib/active_job/deprecator.rb#4 + def deprecator; end + + # Returns the currently loaded version of Active Job as a +Gem::Version+. + # + # source://activejob//lib/active_job/gem_version.rb#5 + def gem_version; end + + # Push many jobs onto the queue at once without running enqueue callbacks. + # Queue adapters may communicate the enqueue status of each job by setting + # successfully_enqueued and/or enqueue_error on the passed-in job instances. + # + # source://activejob//lib/active_job/enqueuing.rb#14 + def perform_all_later(*jobs); end + + # source://activejob//lib/active_job.rb#60 + def verbose_enqueue_logs; end + + # source://activejob//lib/active_job.rb#60 + def verbose_enqueue_logs=(_arg0); end + + # Returns the currently loaded version of Active Job as a +Gem::Version+. + # + # source://activejob//lib/active_job/version.rb#7 + def version; end + + private + + # source://activejob//lib/active_job/instrumentation.rb#6 + def instrument_enqueue_all(queue_adapter, jobs); end + end +end + +# source://activejob//lib/active_job/arguments.rb#28 +module ActiveJob::Arguments + extend ::ActiveJob::Arguments + + # Deserializes a set of arguments. Intrinsic types that can safely be + # deserialized without mutation are returned as-is. Arrays/Hashes are + # deserialized element by element. All other types are deserialized using + # GlobalID. + # + # source://activejob//lib/active_job/arguments.rb#82 + def deserialize(arguments); end + + # Serializes a set of arguments. Intrinsic types that can safely be + # serialized without mutation are returned as-is. Arrays/Hashes are + # serialized element by element. All other types are serialized using + # GlobalID. + # + # source://activejob//lib/active_job/arguments.rb#34 + def serialize(arguments); end + + # source://activejob//lib/active_job/arguments.rb#38 + def serialize_argument(argument); end + + private + + # source://activejob//lib/active_job/arguments.rb#193 + def convert_to_global_id_hash(argument); end + + # @return [Boolean] + # + # source://activejob//lib/active_job/arguments.rb#138 + def custom_serialized?(hash); end + + # source://activejob//lib/active_job/arguments.rb#111 + def deserialize_argument(argument); end + + # source://activejob//lib/active_job/arguments.rb#134 + def deserialize_global_id(hash); end + + # source://activejob//lib/active_job/arguments.rb#148 + def deserialize_hash(serialized_hash); end + + # source://activejob//lib/active_job/arguments.rb#142 + def serialize_hash(argument); end + + # source://activejob//lib/active_job/arguments.rb#161 + def serialize_hash_key(key); end + + # source://activejob//lib/active_job/arguments.rb#174 + def serialize_indifferent_hash(indifferent_hash); end + + # @return [Boolean] + # + # source://activejob//lib/active_job/arguments.rb#130 + def serialized_global_id?(hash); end + + # source://activejob//lib/active_job/arguments.rb#180 + def transform_symbol_keys(hash, symbol_keys); end +end + +# source://activejob//lib/active_job/arguments.rb#90 +ActiveJob::Arguments::GLOBALID_KEY = T.let(T.unsafe(nil), String) + +# source://activejob//lib/active_job/arguments.rb#98 +ActiveJob::Arguments::OBJECT_SERIALIZER_KEY = T.let(T.unsafe(nil), String) + +# source://activejob//lib/active_job/arguments.rb#101 +ActiveJob::Arguments::RESERVED_KEYS = T.let(T.unsafe(nil), Set) + +# source://activejob//lib/active_job/arguments.rb#94 +ActiveJob::Arguments::RUBY2_KEYWORDS_KEY = T.let(T.unsafe(nil), String) + +# source://activejob//lib/active_job/arguments.rb#92 +ActiveJob::Arguments::SYMBOL_KEYS_KEY = T.let(T.unsafe(nil), String) + +# source://activejob//lib/active_job/arguments.rb#96 +ActiveJob::Arguments::WITH_INDIFFERENT_ACCESS_KEY = T.let(T.unsafe(nil), String) + +# = Active Job \Base +# +# Active Job objects can be configured to work with different backend +# queuing frameworks. To specify a queue adapter to use: +# +# ActiveJob::Base.queue_adapter = :inline +# +# A list of supported adapters can be found in QueueAdapters. +# +# Active Job objects can be defined by creating a class that inherits +# from the ActiveJob::Base class. The only necessary method to +# implement is the "perform" method. +# +# To define an Active Job object: +# +# class ProcessPhotoJob < ActiveJob::Base +# def perform(photo) +# photo.watermark!('Rails') +# photo.rotate!(90.degrees) +# photo.resize_to_fit!(300, 300) +# photo.upload! +# end +# end +# +# Records that are passed in are serialized/deserialized using Global +# ID. More information can be found in ActiveJob::Arguments. +# +# To enqueue a job to be performed as soon as the queuing system is free: +# +# ProcessPhotoJob.perform_later(photo) +# +# To enqueue a job to be processed at some point in the future: +# +# ProcessPhotoJob.set(wait_until: Date.tomorrow.noon).perform_later(photo) +# +# More information can be found in ActiveJob::Core::ClassMethods#set. +# +# A job can also be processed immediately without sending to the queue: +# +# ProcessPhotoJob.perform_now(photo) +# +# == Exceptions +# +# * DeserializationError - Error class for deserialization errors. +# * SerializationError - Error class for serialization errors. +# +# source://activejob//lib/active_job/base.rb#63 +class ActiveJob::Base + include ::ActiveJob::Core + include ::ActiveJob::QueueAdapter + include ::ActiveJob::QueueName + include ::ActiveJob::QueuePriority + include ::ActiveJob::Enqueuing + include ::ActiveSupport::Rescuable + include ::ActiveJob::Execution + include ::ActiveSupport::Callbacks + include ::ActiveJob::Callbacks + include ::ActiveJob::Exceptions + include ::ActiveJob::Instrumentation + include ::ActiveJob::Logging + include ::ActiveJob::ExecutionState + include ::ActiveJob::ConcurrencyControls + include ::ActiveJob::TestHelper::TestQueueAdapter + extend ::ActiveJob::Core::ClassMethods + extend ::ActiveJob::QueueAdapter::ClassMethods + extend ::ActiveJob::QueueName::ClassMethods + extend ::ActiveJob::QueuePriority::ClassMethods + extend ::ActiveJob::Enqueuing::ClassMethods + extend ::ActiveSupport::Rescuable::ClassMethods + extend ::ActiveJob::Execution::ClassMethods + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::ActiveSupport::DescendantsTracker + extend ::ActiveJob::Callbacks::ClassMethods + extend ::ActiveJob::Exceptions::ClassMethods + extend ::ActiveJob::ConcurrencyControls::ClassMethods + extend ::ActiveJob::TestHelper::TestQueueAdapter::ClassMethods + + # source://activejob//lib/active_job/base.rb#70 + def __callbacks; end + + # source://activejob//lib/active_job/base.rb#70 + def _enqueue_callbacks; end + + # source://activejob//lib/active_job/base.rb#70 + def _perform_callbacks; end + + # source://activejob//lib/active_job/base.rb#70 + def _run_enqueue_callbacks(&block); end + + # source://activejob//lib/active_job/base.rb#70 + def _run_enqueue_callbacks!(&block); end + + # source://activejob//lib/active_job/base.rb#70 + def _run_perform_callbacks; end + + # source://activejob//lib/active_job/base.rb#70 + def _run_perform_callbacks!(&block); end + + # source://activejob//lib/active_job/base.rb#71 + def after_discard_procs; end + + # source://activejob//lib/active_job/base.rb#71 + def after_discard_procs=(_arg0); end + + # source://activejob//lib/active_job/base.rb#71 + def after_discard_procs?; end + + # source://activejob//lib/active_job/base.rb#76 + def concurrency_duration; end + + # source://activejob//lib/active_job/base.rb#76 + def concurrency_duration=(_arg0); end + + # source://activejob//lib/active_job/base.rb#76 + def concurrency_duration?; end + + # source://activejob//lib/active_job/base.rb#76 + def concurrency_limit; end + + # source://activejob//lib/active_job/base.rb#76 + def concurrency_limit=(_arg0); end + + # source://activejob//lib/active_job/base.rb#76 + def concurrency_limit?; end + + # source://activejob//lib/active_job/base.rb#76 + def concurrency_on_conflict; end + + # source://activejob//lib/active_job/base.rb#76 + def concurrency_on_conflict=(_arg0); end + + # source://activejob//lib/active_job/base.rb#76 + def concurrency_on_conflict?; end + + # source://activejob//lib/active_job/base.rb#73 + def logger; end + + # source://activejob//lib/active_job/base.rb#73 + def logger=(val); end + + # source://activejob//lib/active_job/base.rb#65 + def queue_adapter(&_arg0); end + + # source://activejob//lib/active_job/base.rb#66 + def queue_name_prefix; end + + # source://activejob//lib/active_job/base.rb#66 + def queue_name_prefix=(_arg0); end + + # source://activejob//lib/active_job/base.rb#66 + def queue_name_prefix?; end + + # source://activejob//lib/active_job/base.rb#69 + def rescue_handlers; end + + # source://activejob//lib/active_job/base.rb#69 + def rescue_handlers=(_arg0); end + + # source://activejob//lib/active_job/base.rb#69 + def rescue_handlers?; end + + class << self + # source://activejob//lib/active_job/base.rb#70 + def __callbacks; end + + # source://activejob//lib/active_job/base.rb#70 + def __callbacks=(value); end + + # source://activejob//lib/active_job/base.rb#70 + def _enqueue_callbacks; end + + # source://activejob//lib/active_job/base.rb#70 + def _enqueue_callbacks=(value); end + + # source://activejob//lib/active_job/base.rb#70 + def _perform_callbacks; end + + # source://activejob//lib/active_job/base.rb#70 + def _perform_callbacks=(value); end + + # source://activejob//lib/active_job/base.rb#65 + def _queue_adapter; end + + # source://activejob//lib/active_job/base.rb#65 + def _queue_adapter=(value); end + + # source://activejob//lib/active_job/base.rb#65 + def _queue_adapter_name; end + + # source://activejob//lib/active_job/base.rb#65 + def _queue_adapter_name=(value); end + + # source://activejob//lib/active_job/test_helper.rb#19 + def _test_adapter; end + + # source://activejob//lib/active_job/test_helper.rb#19 + def _test_adapter=(value); end + + # source://activejob//lib/active_job/base.rb#71 + def after_discard_procs; end + + # source://activejob//lib/active_job/base.rb#71 + def after_discard_procs=(value); end + + # source://activejob//lib/active_job/base.rb#71 + def after_discard_procs?; end + + # source://activejob//lib/active_job/base.rb#76 + def concurrency_duration; end + + # source://activejob//lib/active_job/base.rb#76 + def concurrency_duration=(value); end + + # source://activejob//lib/active_job/base.rb#76 + def concurrency_duration?; end + + # source://activejob//lib/active_job/base.rb#76 + def concurrency_group; end + + # source://activejob//lib/active_job/base.rb#76 + def concurrency_group=(value); end + + # source://activejob//lib/active_job/base.rb#76 + def concurrency_group?; end + + # source://activejob//lib/active_job/base.rb#76 + def concurrency_key; end + + # source://activejob//lib/active_job/base.rb#76 + def concurrency_key=(value); end + + # source://activejob//lib/active_job/base.rb#76 + def concurrency_key?; end + + # source://activejob//lib/active_job/base.rb#76 + def concurrency_limit; end + + # source://activejob//lib/active_job/base.rb#76 + def concurrency_limit=(value); end + + # source://activejob//lib/active_job/base.rb#76 + def concurrency_limit?; end + + # source://activejob//lib/active_job/base.rb#76 + def concurrency_on_conflict; end + + # source://activejob//lib/active_job/base.rb#76 + def concurrency_on_conflict=(value); end + + # source://activejob//lib/active_job/base.rb#76 + def concurrency_on_conflict?; end + + # source://activejob//lib/active_job/base.rb#68 + def enqueue_after_transaction_commit; end + + # source://activejob//lib/active_job/base.rb#68 + def enqueue_after_transaction_commit=(value); end + + # source://activejob//lib/active_job/base.rb#73 + def log_arguments; end + + # source://activejob//lib/active_job/base.rb#73 + def log_arguments=(value); end + + # source://activejob//lib/active_job/base.rb#73 + def log_arguments?; end + + # source://activejob//lib/active_job/base.rb#73 + def logger; end + + # source://activejob//lib/active_job/base.rb#73 + def logger=(val); end + + # source://activejob//lib/active_job/base.rb#67 + def priority; end + + # source://activejob//lib/active_job/base.rb#67 + def priority=(value); end + + # source://activejob//lib/active_job/base.rb#67 + def priority?; end + + # source://activejob//lib/active_job/base.rb#66 + def queue_name; end + + # source://activejob//lib/active_job/base.rb#66 + def queue_name=(value); end + + # source://activejob//lib/active_job/base.rb#66 + def queue_name?; end + + # source://activejob//lib/active_job/base.rb#66 + def queue_name_delimiter; end + + # source://activejob//lib/active_job/base.rb#66 + def queue_name_delimiter=(value); end + + # source://activejob//lib/active_job/base.rb#66 + def queue_name_delimiter?; end + + # source://activejob//lib/active_job/base.rb#66 + def queue_name_prefix; end + + # source://activejob//lib/active_job/base.rb#66 + def queue_name_prefix=(value); end + + # source://activejob//lib/active_job/base.rb#66 + def queue_name_prefix?; end + + # source://activejob//lib/active_job/base.rb#69 + def rescue_handlers; end + + # source://activejob//lib/active_job/base.rb#69 + def rescue_handlers=(value); end + + # source://activejob//lib/active_job/base.rb#69 + def rescue_handlers?; end + + # source://activejob//lib/active_job/base.rb#71 + def retry_jitter; end + + # source://activejob//lib/active_job/base.rb#71 + def retry_jitter=(value); end + + private + + # source://activejob//lib/active_job/base.rb#70 + def __class_attr___callbacks; end + + # source://activejob//lib/active_job/base.rb#70 + def __class_attr___callbacks=(new_value); end + + # source://activejob//lib/active_job/base.rb#65 + def __class_attr__queue_adapter; end + + # source://activejob//lib/active_job/base.rb#65 + def __class_attr__queue_adapter=(new_value); end + + # source://activejob//lib/active_job/base.rb#65 + def __class_attr__queue_adapter_name; end + + # source://activejob//lib/active_job/base.rb#65 + def __class_attr__queue_adapter_name=(new_value); end + + # source://activejob//lib/active_job/test_helper.rb#19 + def __class_attr__test_adapter; end + + # source://activejob//lib/active_job/test_helper.rb#19 + def __class_attr__test_adapter=(new_value); end + + # source://activejob//lib/active_job/base.rb#71 + def __class_attr_after_discard_procs; end + + # source://activejob//lib/active_job/base.rb#71 + def __class_attr_after_discard_procs=(new_value); end + + # source://activejob//lib/active_job/base.rb#76 + def __class_attr_concurrency_duration; end + + # source://activejob//lib/active_job/base.rb#76 + def __class_attr_concurrency_duration=(new_value); end + + # source://activejob//lib/active_job/base.rb#76 + def __class_attr_concurrency_group; end + + # source://activejob//lib/active_job/base.rb#76 + def __class_attr_concurrency_group=(new_value); end + + # source://activejob//lib/active_job/base.rb#76 + def __class_attr_concurrency_key; end + + # source://activejob//lib/active_job/base.rb#76 + def __class_attr_concurrency_key=(new_value); end + + # source://activejob//lib/active_job/base.rb#76 + def __class_attr_concurrency_limit; end + + # source://activejob//lib/active_job/base.rb#76 + def __class_attr_concurrency_limit=(new_value); end + + # source://activejob//lib/active_job/base.rb#76 + def __class_attr_concurrency_on_conflict; end + + # source://activejob//lib/active_job/base.rb#76 + def __class_attr_concurrency_on_conflict=(new_value); end + + # source://activejob//lib/active_job/base.rb#68 + def __class_attr_enqueue_after_transaction_commit; end + + # source://activejob//lib/active_job/base.rb#68 + def __class_attr_enqueue_after_transaction_commit=(new_value); end + + # source://activejob//lib/active_job/base.rb#73 + def __class_attr_log_arguments; end + + # source://activejob//lib/active_job/base.rb#73 + def __class_attr_log_arguments=(new_value); end + + # source://activejob//lib/active_job/base.rb#67 + def __class_attr_priority; end + + # source://activejob//lib/active_job/base.rb#67 + def __class_attr_priority=(new_value); end + + # source://activejob//lib/active_job/base.rb#66 + def __class_attr_queue_name; end + + # source://activejob//lib/active_job/base.rb#66 + def __class_attr_queue_name=(new_value); end + + # source://activejob//lib/active_job/base.rb#66 + def __class_attr_queue_name_delimiter; end + + # source://activejob//lib/active_job/base.rb#66 + def __class_attr_queue_name_delimiter=(new_value); end + + # source://activejob//lib/active_job/base.rb#66 + def __class_attr_queue_name_prefix; end + + # source://activejob//lib/active_job/base.rb#66 + def __class_attr_queue_name_prefix=(new_value); end + + # source://activejob//lib/active_job/base.rb#69 + def __class_attr_rescue_handlers; end + + # source://activejob//lib/active_job/base.rb#69 + def __class_attr_rescue_handlers=(new_value); end + + # source://activejob//lib/active_job/base.rb#71 + def __class_attr_retry_jitter; end + + # source://activejob//lib/active_job/base.rb#71 + def __class_attr_retry_jitter=(new_value); end + end +end + +# = Active Job \Callbacks +# +# Active Job provides hooks during the life cycle of a job. Callbacks allow you +# to trigger logic during this cycle. Available callbacks are: +# +# * before_enqueue +# * around_enqueue +# * after_enqueue +# * before_perform +# * around_perform +# * after_perform +# +# source://activejob//lib/active_job/callbacks.rb#18 +module ActiveJob::Callbacks + extend ::ActiveSupport::Concern + extend ::ActiveSupport::Callbacks + include GeneratedInstanceMethods + include ::ActiveSupport::Callbacks + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods + mixes_in_class_methods ::ActiveSupport::DescendantsTracker + mixes_in_class_methods ::ActiveJob::Callbacks::ClassMethods + + class << self + # source://activejob//lib/active_job/callbacks.rb#23 + def __callbacks; end + + # source://activejob//lib/active_job/callbacks.rb#24 + def _execute_callbacks; end + + # source://activejob//lib/active_job/callbacks.rb#24 + def _run_execute_callbacks; end + + # source://activejob//lib/active_job/callbacks.rb#24 + def _run_execute_callbacks!(&block); end + + private + + # source://activejob//lib/active_job/callbacks.rb#23 + def __class_attr___callbacks; end + end + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + end + + module GeneratedInstanceMethods + def __callbacks; end + end +end + +# These methods will be included into any Active Job object, adding +# callbacks for +perform+ and +enqueue+ methods. +# +# source://activejob//lib/active_job/callbacks.rb#34 +module ActiveJob::Callbacks::ClassMethods + # Defines a callback that will get called right after the + # job is enqueued. + # + # class VideoProcessJob < ActiveJob::Base + # queue_as :default + # + # after_enqueue do |job| + # result = job.successfully_enqueued? ? "success" : "failure" + # $statsd.increment "enqueue-video-job.#{result}" + # end + # + # def perform(video_id) + # Video.find(video_id).process + # end + # end + # + # source://activejob//lib/active_job/callbacks.rb#141 + def after_enqueue(*filters, &blk); end + + # Defines a callback that will get called right after the + # job's perform method has finished. + # + # class VideoProcessJob < ActiveJob::Base + # queue_as :default + # + # after_perform do |job| + # UserMailer.notify_video_processed(job.arguments.first) + # end + # + # def perform(video_id) + # Video.find(video_id).process + # end + # end + # + # source://activejob//lib/active_job/callbacks.rb#69 + def after_perform(*filters, &blk); end + + # Defines a callback that will get called around the enqueuing + # of the job. + # + # class VideoProcessJob < ActiveJob::Base + # queue_as :default + # + # around_enqueue do |job, block| + # $statsd.time "video-job.process" do + # block.call + # end + # end + # + # def perform(video_id) + # Video.find(video_id).process + # end + # end + # + # source://activejob//lib/active_job/callbacks.rb#162 + def around_enqueue(*filters, &blk); end + + # Defines a callback that will get called around the job's perform method. + # + # class VideoProcessJob < ActiveJob::Base + # queue_as :default + # + # around_perform do |job, block| + # UserMailer.notify_video_started_processing(job.arguments.first) + # block.call + # UserMailer.notify_video_processed(job.arguments.first) + # end + # + # def perform(video_id) + # Video.find(video_id).process + # end + # end + # + # You can access the return value of the job only if the execution wasn't halted. + # + # class VideoProcessJob < ActiveJob::Base + # around_perform do |job, block| + # value = block.call + # puts value # => "Hello World!" + # end + # + # def perform + # "Hello World!" + # end + # end + # + # source://activejob//lib/active_job/callbacks.rb#102 + def around_perform(*filters, &blk); end + + # Defines a callback that will get called right before the + # job is enqueued. + # + # class VideoProcessJob < ActiveJob::Base + # queue_as :default + # + # before_enqueue do |job| + # $statsd.increment "enqueue-video-job.try" + # end + # + # def perform(video_id) + # Video.find(video_id).process + # end + # end + # + # source://activejob//lib/active_job/callbacks.rb#121 + def before_enqueue(*filters, &blk); end + + # Defines a callback that will get called right before the + # job's perform method is executed. + # + # class VideoProcessJob < ActiveJob::Base + # queue_as :default + # + # before_perform do |job| + # UserMailer.notify_video_started_processing(job.arguments.first) + # end + # + # def perform(video_id) + # Video.find(video_id).process + # end + # end + # + # source://activejob//lib/active_job/callbacks.rb#50 + def before_perform(*filters, &blk); end +end + +# source://activejob//lib/active_job/configured_job.rb#4 +class ActiveJob::ConfiguredJob + # @return [ConfiguredJob] a new instance of ConfiguredJob + # + # source://activejob//lib/active_job/configured_job.rb#5 + def initialize(job_class, options = T.unsafe(nil)); end + + # @yield [job] + # + # source://activejob//lib/active_job/configured_job.rb#14 + def perform_later(*_arg0, **_arg1, &_arg2); end + + # source://activejob//lib/active_job/configured_job.rb#10 + def perform_now(*_arg0, **_arg1, &_arg2); end +end + +# = Active Job Continuable +# +# The Continuable module provides the ability to track the progress of your +# jobs, and continue from where they left off if interrupted. +# +# Mix ActiveJob::Continuable into your job to enable continuations. +# +# See {ActiveJob::Continuation}[rdoc-ref:ActiveJob::Continuation] for usage. +# +# source://activejob//lib/active_job/continuable.rb#13 +module ActiveJob::Continuable + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + # source://activejob//lib/active_job/continuable.rb#62 + def checkpoint!; end + + # source://activejob//lib/active_job/continuable.rb#33 + def continuation; end + + # source://activejob//lib/active_job/continuable.rb#33 + def continuation=(_arg0); end + + # source://activejob//lib/active_job/continuable.rb#56 + def deserialize(job_data); end + + # @raise [Continuation::Interrupt] + # + # source://activejob//lib/active_job/continuable.rb#66 + def interrupt!(reason:); end + + # The number of times the job has been resumed. + # + # source://activejob//lib/active_job/continuable.rb#31 + def resumptions; end + + # The number of times the job has been resumed. + # + # source://activejob//lib/active_job/continuable.rb#31 + def resumptions=(_arg0); end + + # source://activejob//lib/active_job/continuable.rb#52 + def serialize; end + + # Start a new continuation step + # + # source://activejob//lib/active_job/continuable.rb#36 + def step(step_name, start: T.unsafe(nil), isolated: T.unsafe(nil), &block); end + + private + + # source://activejob//lib/active_job/continuable.rb#72 + def continue(&block); end + + # source://activejob//lib/active_job/continuable.rb#91 + def resume_job(exception); end + + module GeneratedClassMethods + def max_resumptions; end + def max_resumptions=(value); end + def max_resumptions?; end + def resume_errors_after_advancing; end + def resume_errors_after_advancing=(value); end + def resume_errors_after_advancing?; end + def resume_options; end + def resume_options=(value); end + def resume_options?; end + end + + module GeneratedInstanceMethods + def max_resumptions; end + def max_resumptions?; end + def resume_errors_after_advancing; end + def resume_errors_after_advancing?; end + def resume_options; end + def resume_options?; end + end +end + +# = Active Job \Continuation +# +# Continuations provide a mechanism for interrupting and resuming jobs. This allows +# long-running jobs to make progress across application restarts. +# +# Jobs should include the ActiveJob::Continuable module to enable continuations. +# \Continuable jobs are automatically retried when interrupted. +# +# Use the +step+ method to define the steps in your job. Steps can use an optional +# cursor to track progress in the step. +# +# Steps are executed as soon as they are encountered. If a job is interrupted, previously +# completed steps will be skipped. If a step is in progress, it will be resumed +# with the last recorded cursor. +# +# Code that is not part of a step will be executed on each job run. +# +# You can pass a block or a method name to the step method. The block will be called with +# the step object as an argument. Methods can either take no arguments or a single argument +# for the step object. +# +# class ProcessImportJob < ApplicationJob +# include ActiveJob::Continuable +# +# def perform(import_id) +# # This always runs, even if the job is resumed. +# @import = Import.find(import_id) +# +# step :validate do +# @import.validate! +# end +# +# step(:process_records) do |step| +# @import.records.find_each(start: step.cursor) do |record| +# record.process +# step.advance! from: record.id +# end +# end +# +# step :reprocess_records +# step :finalize +# end +# +# def reprocess_records(step) +# @import.records.find_each(start: step.cursor) do |record| +# record.reprocess +# step.advance! from: record.id +# end +# end +# +# def finalize +# @import.finalize! +# end +# end +# +# === Cursors +# +# Cursors are used to track progress within a step. The cursor can be any object that is +# serializable as an argument to +ActiveJob::Base.serialize+. It defaults to +nil+. +# +# When a step is resumed, the last cursor value is restored. The code in the step is responsible +# for using the cursor to continue from the right point. +# +# +set!+ sets the cursor to a specific value. +# +# step :iterate_items do |step| +# items[step.cursor..].each do |item| +# process(item) +# step.set! (step.cursor || 0) + 1 +# end +# end +# +# An starting value for the cursor can be set when defining the step: +# +# step :iterate_items, start: 0 do |step| +# items[step.cursor..].each do |item| +# process(item) +# step.set! step.cursor + 1 +# end +# end +# +# The cursor can be advanced with +advance!+. This calls +succ+ on the current cursor value. +# It raises an ActiveJob::Continuation::UnadvanceableCursorError if the cursor does not implement +succ+. +# +# step :iterate_items, start: 0 do |step| +# items[step.cursor..].each do |item| +# process(item) +# step.advance! +# end +# end +# +# You can optionally pass a +from+ argument to +advance!+. This is useful when iterating +# over a collection of records where IDs may not be contiguous. +# +# step :process_records do |step| +# import.records.find_each(start: step.cursor) do |record| +# record.process +# step.advance! from: record.id +# end +# end +# +# You can use an array to iterate over nested records: +# +# step :process_nested_records, start: [ 0, 0 ] do |step| +# Account.find_each(start: step.cursor[0]) do |account| +# account.records.find_each(start: step.cursor[1]) do |record| +# record.process +# step.set! [ account.id, record.id + 1 ] +# end +# step.set! [ account.id + 1, 0 ] +# end +# end +# +# Setting or advancing the cursor creates a checkpoint. You can also create a checkpoint +# manually by calling the +checkpoint!+ method on the step. This is useful if you want to +# allow interruptions, but don't need to update the cursor. +# +# step :destroy_records do |step| +# import.records.find_each do |record| +# record.destroy! +# step.checkpoint! +# end +# end +# +# === Checkpoints +# +# A checkpoint is where a job can be interrupted. At a checkpoint the job will call +# +queue_adapter.stopping?+. If it returns true, the job will raise an +# ActiveJob::Continuation::Interrupt exception. +# +# There is an automatic checkpoint before the start of each step except for the first for +# each job execution. Within a step one is created when calling +set!+, +advance!+ or +checkpoint!+. +# +# Jobs are not automatically interrupted when the queue adapter is marked as stopping - they +# will continue to run either until the next checkpoint, or when the process is stopped. +# +# This is to allow jobs to be interrupted at a safe point, but it also means that the jobs +# should checkpoint more frequently than the shutdown timeout to ensure a graceful restart. +# +# When interrupted, the job will automatically retry with the progress serialized +# in the job data under the +continuation+ key. +# +# The serialized progress contains: +# - a list of the completed steps +# - the current step and its cursor value (if one is in progress) +# +# === Isolated Steps +# +# Steps run sequentially in a single job execution, unless the job is interrupted. +# +# You can specify that a step should always run in its own execution by passing the +isolated: true+ option. +# +# This is useful for long-running steps where it may not be possible to checkpoint within +# the job grace period - it ensures that progress is serialized back into the job data before +# the step starts. +# +# step :quick_step1 +# step :slow_step, isolated: true +# step :quick_step2 +# step :quick_step3 +# +# === Errors +# +# If a job raises an error and is not retried via Active Job, it will be passed back to the underlying +# queue backend and any progress in this execution will be lost. +# +# To mitigate this, the job will be automatically retried if it raises an error after it has made progress. +# Making progress is defined as having completed a step or advanced the cursor within the current step. +# +# === Configuration +# +# Continuable jobs have several configuration options: +# * :max_resumptions - The maximum number of times a job can be resumed. Defaults to +nil+ which means +# unlimited resumptions. +# * :resume_options - Options to pass to +retry_job+ when resuming the job. +# Defaults to { wait: 5.seconds }. +# See {ActiveJob::Exceptions#retry_job}[rdoc-ref:ActiveJob::Exceptions#retry_job] for available options. +# * :resume_errors_after_advancing - Whether to resume errors after advancing the continuation. +# Defaults to +true+. +# +# source://activejob//lib/active_job/continuation.rb#186 +class ActiveJob::Continuation + include ::ActiveJob::Continuation::Validation + extend ::ActiveSupport::Autoload + + # @return [Continuation] a new instance of Continuation + # + # source://activejob//lib/active_job/continuation.rb#214 + def initialize(job, serialized_progress); end + + # @return [Boolean] + # + # source://activejob//lib/active_job/continuation.rb#256 + def advanced?; end + + # source://activejob//lib/active_job/continuation.rb#242 + def description; end + + # source://activejob//lib/active_job/continuation.rb#260 + def instrumentation; end + + # @return [Boolean] + # + # source://activejob//lib/active_job/continuation.rb#252 + def started?; end + + # source://activejob//lib/active_job/continuation.rb#224 + def step(name, **options, &block); end + + # source://activejob//lib/active_job/continuation.rb#235 + def to_h; end + + private + + # Returns the value of attribute completed. + # + # source://activejob//lib/active_job/continuation.rb#267 + def completed; end + + # @return [Boolean] + # + # source://activejob//lib/active_job/continuation.rb#277 + def completed?(name); end + + # Returns the value of attribute current. + # + # source://activejob//lib/active_job/continuation.rb#267 + def current; end + + # Returns the value of attribute encountered. + # + # source://activejob//lib/active_job/continuation.rb#267 + def encountered; end + + # source://activejob//lib/active_job/continuation.rb#326 + def instrument(*_arg0, **_arg1, &_arg2); end + + # source://activejob//lib/active_job/continuation.rb#315 + def instrumenting_step(step, &block); end + + # @return [Boolean] + # + # source://activejob//lib/active_job/continuation.rb#273 + def isolating?; end + + # Returns the value of attribute job. + # + # source://activejob//lib/active_job/continuation.rb#267 + def job; end + + # source://activejob//lib/active_job/continuation.rb#281 + def new_step(*args, **options); end + + # source://activejob//lib/active_job/continuation.rb#289 + def run_step(name, start:, isolated:, &block); end + + # source://activejob//lib/active_job/continuation.rb#299 + def run_step_inline(name, start:, **options, &block); end + + # @return [Boolean] + # + # source://activejob//lib/active_job/continuation.rb#269 + def running_step?; end + + # source://activejob//lib/active_job/continuation.rb#285 + def skip_step(name); end +end + +# Raised when there is an error with a checkpoint, such as open database transactions. +# +# source://activejob//lib/active_job/continuation.rb#203 +class ActiveJob::Continuation::CheckpointError < ::ActiveJob::Continuation::Error; end + +# Base class for all Continuation errors. +# +# source://activejob//lib/active_job/continuation.rb#197 +class ActiveJob::Continuation::Error < ::StandardError; end + +# Raised when a job is interrupted, allowing Active Job to requeue it. +# This inherits from +Exception+ rather than +StandardError+, so it's not +# caught by normal exception handling. +# +# source://activejob//lib/active_job/continuation.rb#194 +class ActiveJob::Continuation::Interrupt < ::Exception; end + +# Raised when a step is invalid. +# +# source://activejob//lib/active_job/continuation.rb#200 +class ActiveJob::Continuation::InvalidStepError < ::ActiveJob::Continuation::Error; end + +# Raised when a job has reached its limit of the number of resumes. +# The limit is defined by the +max_resumes+ class attribute. +# +# source://activejob//lib/active_job/continuation.rb#210 +class ActiveJob::Continuation::ResumeLimitError < ::ActiveJob::Continuation::Error; end + +# = Active Job Continuation Step +# +# Represents a step within a continuable job. +# +# When a step is completed, it is recorded in the job's continuation state. +# If the job is interrupted, it will be resumed from after the last completed step. +# +# Steps also have an optional cursor that can be used to track progress within the step. +# If a job is interrupted during a step, the cursor will be saved and passed back when +# the job is resumed. +# +# It is the responsibility of the code in the step to use the cursor correctly to resume +# from where it left off. +# +# source://activejob//lib/active_job/continuation/step.rb#18 +class ActiveJob::Continuation::Step + # @return [Step] a new instance of Step + # + # source://activejob//lib/active_job/continuation/step.rb#25 + def initialize(name, cursor, job:, resumed:); end + + # Advance the cursor from the current or supplied value + # + # The cursor will be advanced by calling the +succ+ method on the cursor. + # An UnadvanceableCursorError error will be raised if the cursor does not implement +succ+. + # + # source://activejob//lib/active_job/continuation/step.rb#49 + def advance!(from: T.unsafe(nil)); end + + # Has the cursor been advanced during this job execution? + # + # @return [Boolean] + # + # source://activejob//lib/active_job/continuation/step.rb#67 + def advanced?; end + + # Check if the job should be interrupted, and if so raise an Interrupt exception. + # The job will be requeued for retry. + # + # source://activejob//lib/active_job/continuation/step.rb#35 + def checkpoint!; end + + # The cursor for the step. + # + # source://activejob//lib/active_job/continuation/step.rb#23 + def cursor; end + + # source://activejob//lib/active_job/continuation/step.rb#75 + def description; end + + # The name of the step. + # + # source://activejob//lib/active_job/continuation/step.rb#20 + def name; end + + # Has this step been resumed from a previous job execution? + # + # @return [Boolean] + # + # source://activejob//lib/active_job/continuation/step.rb#62 + def resumed?; end + + # Set the cursor and interrupt the job if necessary. + # + # source://activejob//lib/active_job/continuation/step.rb#40 + def set!(cursor); end + + # source://activejob//lib/active_job/continuation/step.rb#71 + def to_a; end + + private + + # Returns the value of attribute initial_cursor. + # + # source://activejob//lib/active_job/continuation/step.rb#80 + def initial_cursor; end + + # Returns the value of attribute job. + # + # source://activejob//lib/active_job/continuation/step.rb#80 + def job; end +end + +# Raised when attempting to advance a cursor that doesn't implement `succ`. +# +# source://activejob//lib/active_job/continuation.rb#206 +class ActiveJob::Continuation::UnadvanceableCursorError < ::ActiveJob::Continuation::Error; end + +# source://activejob//lib/active_job/continuation/validation.rb#5 +module ActiveJob::Continuation::Validation + private + + # @raise [InvalidStepError] + # + # source://activejob//lib/active_job/continuation/validation.rb#45 + def raise_step_error!(message); end + + # source://activejob//lib/active_job/continuation/validation.rb#7 + def validate_step!(name); end + + # source://activejob//lib/active_job/continuation/validation.rb#39 + def validate_step_expected_order!(name); end + + # source://activejob//lib/active_job/continuation/validation.rb#21 + def validate_step_not_encountered!(name); end + + # source://activejob//lib/active_job/continuation/validation.rb#27 + def validate_step_not_nested!(name); end + + # source://activejob//lib/active_job/continuation/validation.rb#33 + def validate_step_resume_expected!(name); end + + # source://activejob//lib/active_job/continuation/validation.rb#15 + def validate_step_symbol!(name); end +end + +# = Active Job \Core +# +# Provides general behavior that will be included into every Active Job +# object that inherits from ActiveJob::Base. +# +# source://activejob//lib/active_job/core.rb#15 +module ActiveJob::Core + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveJob::Core::ClassMethods + + # Creates a new job instance. Takes the arguments that will be + # passed to the perform method. + # + # source://activejob//lib/active_job/core.rb#103 + def initialize(*arguments, **_arg1); end + + # Job arguments + # + # source://activejob//lib/active_job/core.rb#19 + def arguments; end + + # Job arguments + # + # source://activejob//lib/active_job/core.rb#19 + def arguments=(_arg0); end + + # Attaches the stored job data to the current instance. Receives a hash + # returned from +serialize+ + # + # ==== Examples + # + # class DeliverWebhookJob < ActiveJob::Base + # attr_writer :attempt_number + # + # def attempt_number + # @attempt_number ||= 0 + # end + # + # def serialize + # super.merge('attempt_number' => attempt_number + 1) + # end + # + # def deserialize(job_data) + # super + # self.attempt_number = job_data['attempt_number'] + # end + # + # rescue_from(Timeout::Error) do |exception| + # raise exception if attempt_number > 5 + # retry_job(wait: 10) + # end + # end + # + # source://activejob//lib/active_job/core.rb#160 + def deserialize(job_data); end + + # Track any exceptions raised by the backend so callers can inspect the errors. + # + # source://activejob//lib/active_job/core.rb#63 + def enqueue_error; end + + # Track any exceptions raised by the backend so callers can inspect the errors. + # + # source://activejob//lib/active_job/core.rb#63 + def enqueue_error=(_arg0); end + + # Track when a job was enqueued + # + # source://activejob//lib/active_job/core.rb#53 + def enqueued_at; end + + # Track when a job was enqueued + # + # source://activejob//lib/active_job/core.rb#53 + def enqueued_at=(_arg0); end + + # Hash that contains the number of times this job handled errors for each specific retry_on declaration. + # Keys are the string representation of the exceptions listed in the retry_on declaration, + # while its associated value holds the number of executions where the corresponding retry_on + # declaration handled one of its listed exceptions. + # + # source://activejob//lib/active_job/core.rb#44 + def exception_executions; end + + # Hash that contains the number of times this job handled errors for each specific retry_on declaration. + # Keys are the string representation of the exceptions listed in the retry_on declaration, + # while its associated value holds the number of executions where the corresponding retry_on + # declaration handled one of its listed exceptions. + # + # source://activejob//lib/active_job/core.rb#44 + def exception_executions=(_arg0); end + + # Number of times this job has been executed (which increments on every retry, like after an exception). + # + # source://activejob//lib/active_job/core.rb#38 + def executions; end + + # Number of times this job has been executed (which increments on every retry, like after an exception). + # + # source://activejob//lib/active_job/core.rb#38 + def executions=(_arg0); end + + # Job Identifier + # + # source://activejob//lib/active_job/core.rb#26 + def job_id; end + + # Job Identifier + # + # source://activejob//lib/active_job/core.rb#26 + def job_id=(_arg0); end + + # I18n.locale to be used during the job. + # + # source://activejob//lib/active_job/core.rb#47 + def locale; end + + # I18n.locale to be used during the job. + # + # source://activejob//lib/active_job/core.rb#47 + def locale=(_arg0); end + + # Priority that the job will have (lower is more priority). + # + # source://activejob//lib/active_job/core.rb#32 + def priority=(_arg0); end + + # ID optionally provided by adapter + # + # source://activejob//lib/active_job/core.rb#35 + def provider_job_id; end + + # ID optionally provided by adapter + # + # source://activejob//lib/active_job/core.rb#35 + def provider_job_id=(_arg0); end + + # Queue in which the job will reside. + # + # source://activejob//lib/active_job/core.rb#29 + def queue_name=(_arg0); end + + # Time when the job should be performed + # + # source://activejob//lib/active_job/core.rb#23 + def scheduled_at; end + + # Time when the job should be performed + # + # source://activejob//lib/active_job/core.rb#23 + def scheduled_at=(_arg0); end + + # Returns a hash with the job data that can safely be passed to the + # queuing adapter. + # + # source://activejob//lib/active_job/core.rb#117 + def serialize; end + + # Sets the attribute serialized_arguments + # + # @param value the value to set the attribute serialized_arguments to. + # + # source://activejob//lib/active_job/core.rb#20 + def serialized_arguments=(_arg0); end + + # Configures the job with the given options. + # + # source://activejob//lib/active_job/core.rb#175 + def set(options = T.unsafe(nil)); end + + # Track whether the adapter received the job successfully. + # + # source://activejob//lib/active_job/core.rb#56 + def successfully_enqueued=(_arg0); end + + # @return [Boolean] + # + # source://activejob//lib/active_job/core.rb#58 + def successfully_enqueued?; end + + # Timezone to be used during the job. + # + # source://activejob//lib/active_job/core.rb#50 + def timezone; end + + # Timezone to be used during the job. + # + # source://activejob//lib/active_job/core.rb#50 + def timezone=(_arg0); end + + private + + # @return [Boolean] + # + # source://activejob//lib/active_job/core.rb#208 + def arguments_serialized?; end + + # source://activejob//lib/active_job/core.rb#204 + def deserialize_arguments(serialized_args); end + + # source://activejob//lib/active_job/core.rb#193 + def deserialize_arguments_if_needed; end + + # source://activejob//lib/active_job/core.rb#212 + def deserialize_time(time); end + + # source://activejob//lib/active_job/core.rb#200 + def serialize_arguments(arguments); end + + # source://activejob//lib/active_job/core.rb#185 + def serialize_arguments_if_needed(arguments); end +end + +# These methods will be included into any Active Job object, adding +# helpers for de/serialization and creation of job instances. +# +# source://activejob//lib/active_job/core.rb#67 +module ActiveJob::Core::ClassMethods + # Creates a new job instance from a hash created with +serialize+ + # + # @raise [UnknownJobClassError] + # + # source://activejob//lib/active_job/core.rb#69 + def deserialize(job_data); end + + # Creates a job preconfigured with the given options. You can call + # perform_later with the job arguments to enqueue the job with the + # preconfigured options + # + # ==== Options + # * :wait - Enqueues the job with the specified delay + # * :wait_until - Enqueues the job at the time specified + # * :queue - Enqueues the job on the specified queue + # * :priority - Enqueues the job with the specified priority + # + # ==== Examples + # + # VideoJob.set(queue: :some_queue).perform_later(Video.last) + # VideoJob.set(wait: 5.minutes).perform_later(Video.last) + # VideoJob.set(wait_until: Time.now.tomorrow).perform_later(Video.last) + # VideoJob.set(queue: :some_queue, wait: 5.minutes).perform_later(Video.last) + # VideoJob.set(queue: :some_queue, wait_until: Time.now.tomorrow).perform_later(Video.last) + # VideoJob.set(queue: :some_queue, wait: 5.minutes, priority: 10).perform_later(Video.last) + # + # source://activejob//lib/active_job/core.rb#96 + def set(options = T.unsafe(nil)); end +end + +# Raised when an exception is raised during job arguments deserialization. +# +# Wraps the original exception raised as +cause+. +# +# source://activejob//lib/active_job/arguments.rb#10 +class ActiveJob::DeserializationError < ::StandardError + # @return [DeserializationError] a new instance of DeserializationError + # + # source://activejob//lib/active_job/arguments.rb#11 + def initialize; end +end + +# source://activejob//lib/active_job/enqueue_after_transaction_commit.rb#4 +module ActiveJob::EnqueueAfterTransactionCommit + private + + # source://activejob//lib/active_job/enqueue_after_transaction_commit.rb#6 + def raw_enqueue; end +end + +# Can be raised by adapters if they wish to communicate to the caller a reason +# why the adapter was unexpectedly unable to enqueue a job. +# +# source://activejob//lib/active_job/enqueuing.rb#8 +class ActiveJob::EnqueueError < ::StandardError; end + +# source://activejob//lib/active_job/enqueuing.rb#40 +module ActiveJob::Enqueuing + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveJob::Enqueuing::ClassMethods + + # Enqueues the job to be performed by the queue adapter. + # + # ==== Options + # * :wait - Enqueues the job with the specified delay + # * :wait_until - Enqueues the job at the time specified + # * :queue - Enqueues the job on the specified queue + # * :priority - Enqueues the job with the specified priority + # + # ==== Examples + # + # my_job_instance.enqueue + # my_job_instance.enqueue wait: 5.minutes + # my_job_instance.enqueue queue: :important + # my_job_instance.enqueue wait_until: Date.tomorrow.midnight + # my_job_instance.enqueue priority: 10 + # + # source://activejob//lib/active_job/enqueuing.rb#112 + def enqueue(options = T.unsafe(nil)); end + + private + + # source://activejob//lib/active_job/enqueuing.rb#132 + def _raw_enqueue; end + + # source://activejob//lib/active_job/enqueuing.rb#126 + def raw_enqueue; end + + module GeneratedClassMethods + def enqueue_after_transaction_commit; end + def enqueue_after_transaction_commit=(value); end + end + + module GeneratedInstanceMethods; end +end + +# Includes the +perform_later+ method for job initialization. +# +# source://activejob//lib/active_job/enqueuing.rb#57 +module ActiveJob::Enqueuing::ClassMethods + # Push a job onto the queue. By default the arguments must be either String, + # Integer, Float, NilClass, TrueClass, FalseClass, BigDecimal, Symbol, Date, + # Time, DateTime, ActiveSupport::TimeWithZone, ActiveSupport::Duration, + # Hash, ActiveSupport::HashWithIndifferentAccess, Array, Range, or + # GlobalID::Identification instances, although this can be extended by adding + # custom serializers. + # + # Returns an instance of the job class queued with arguments available in + # Job#arguments or +false+ if the enqueue did not succeed. + # + # After the attempted enqueue, the job will be yielded to an optional block. + # + # If Active Job is used conjointly with Active Record, and #perform_later is called + # inside an Active Record transaction, then the enqueue is implicitly deferred to after + # the transaction is committed, or dropped if it's rolled back. In such case #perform_later + # will return the job instance like if it was successfully enqueued, but will still return + # +false+ if a callback prevented the job from being enqueued. + # + # This behavior can be changed on a per job basis: + # + # class NotificationJob < ApplicationJob + # self.enqueue_after_transaction_commit = false + # end + # + # @yield [job] + # + # source://activejob//lib/active_job/enqueuing.rb#81 + def perform_later(*_arg0, **_arg1, &_arg2); end + + private + + # source://activejob//lib/active_job/enqueuing.rb#91 + def job_or_instantiate(*args, **_arg1, &_arg2); end +end + +# Provides behavior for retrying and discarding jobs on exceptions. +# +# source://activejob//lib/active_job/exceptions.rb#7 +module ActiveJob::Exceptions + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveJob::Exceptions::ClassMethods + + # Reschedules the job to be re-executed. This is useful in combination with + # {rescue_from}[rdoc-ref:ActiveSupport::Rescuable::ClassMethods#rescue_from]. + # When you rescue an exception from your job you can ask Active Job to retry + # performing your job. + # + # ==== Options + # * :wait - Enqueues the job with the specified delay in seconds + # * :wait_until - Enqueues the job at the time specified + # * :queue - Enqueues the job on the specified queue + # * :priority - Enqueues the job with the specified priority + # + # ==== Examples + # + # class SiteScraperJob < ActiveJob::Base + # rescue_from(ErrorLoadingSite) do + # retry_job queue: :low_priority + # end + # + # def perform(*args) + # # raise ErrorLoadingSite if cannot scrape + # end + # end + # + # source://activejob//lib/active_job/exceptions.rb#158 + def retry_job(options = T.unsafe(nil)); end + + private + + # source://activejob//lib/active_job/exceptions.rb#171 + def determine_delay(seconds_or_duration_or_algorithm:, executions:, jitter: T.unsafe(nil)); end + + # source://activejob//lib/active_job/exceptions.rb#192 + def determine_jitter_for_delay(delay, jitter); end + + # source://activejob//lib/active_job/exceptions.rb#197 + def executions_for(exceptions); end + + # source://activejob//lib/active_job/exceptions.rb#206 + def run_after_discard_procs(exception); end + + module GeneratedClassMethods + def after_discard_procs; end + def after_discard_procs=(value); end + def after_discard_procs?; end + def retry_jitter; end + def retry_jitter=(value); end + end + + module GeneratedInstanceMethods + def after_discard_procs; end + def after_discard_procs=(value); end + def after_discard_procs?; end + end +end + +# source://activejob//lib/active_job/exceptions.rb#15 +module ActiveJob::Exceptions::ClassMethods + # A block to run when a job is about to be discarded for any reason. + # + # ==== Example + # + # class WorkJob < ActiveJob::Base + # after_discard do |job, exception| + # ExceptionNotifier.report(exception) + # end + # + # ... + # + # end + # + # source://activejob//lib/active_job/exceptions.rb#131 + def after_discard(&blk); end + + # Discard the job with no attempts to retry, if the exception is raised. This is useful when the subject of the job, + # like an Active Record, is no longer available, and the job is thus no longer relevant. + # + # Passing the :report option reports the error through the error reporter before discarding the job. + # + # You can also pass a block that'll be invoked. This block is yielded with the job instance as the first and the error instance as the second parameter. + # + # +retry_on+ and +discard_on+ handlers are searched from bottom to top, and up the class hierarchy. The handler of the first class for + # which exception.is_a?(klass) holds true is the one invoked, if any. + # + # ==== Example + # + # class SearchIndexingJob < ActiveJob::Base + # discard_on ActiveJob::DeserializationError + # discard_on CustomAppException, report: true + # discard_on(AnotherCustomAppException) do |job, error| + # CustomErrorHandlingCode.handle(job, error) + # end + # + # def perform(record) + # # Will raise ActiveJob::DeserializationError if the record can't be deserialized + # # Might raise CustomAppException for something domain specific + # end + # end + # + # source://activejob//lib/active_job/exceptions.rb#109 + def discard_on(*exceptions, report: T.unsafe(nil)); end + + # Catch the exception and reschedule job for re-execution after so many seconds, for a specific number of attempts. + # If the exception keeps getting raised beyond the specified number of attempts, the exception is allowed to + # bubble up to the underlying queuing system, which may have its own retry mechanism or place it in a + # holding queue for inspection. + # + # You can also pass a block that'll be invoked if the retry attempts fail for custom logic rather than letting + # the exception bubble up. This block is yielded with the job instance as the first and the error instance as the second parameter. + # + # +retry_on+ and +discard_on+ handlers are searched from bottom to top, and up the class hierarchy. The handler of the first class for + # which exception.is_a?(klass) holds true is the one invoked, if any. + # + # ==== Options + # * :wait - Re-enqueues the job with a delay specified either in seconds (default: 3 seconds), + # as a computing proc that takes the number of executions so far as an argument, or as a symbol reference of + # :polynomially_longer, which applies the wait algorithm of ((executions**4) + (Kernel.rand * (executions**4) * jitter)) + 2 + # (first wait ~3s, then ~18s, then ~83s, etc) + # * :attempts - Enqueues the job the specified number of times (default: 5 attempts) or a symbol reference of :unlimited + # to retry the job until it succeeds. The number of attempts includes the original job execution. + # * :queue - Re-enqueues the job on a different queue + # * :priority - Re-enqueues the job with a different priority + # * :jitter - A random delay of wait time used when calculating backoff. The default is 15% (0.15) which represents the upper bound of possible wait time (expressed as a percentage) + # * :report - Errors will be reported to the Rails.error reporter before being retried + # + # ==== Examples + # + # class RemoteServiceJob < ActiveJob::Base + # retry_on CustomAppException # defaults to ~3s wait, 5 attempts + # retry_on AnotherCustomAppException, wait: ->(executions) { executions * 2 } + # retry_on CustomInfrastructureException, wait: 5.minutes, attempts: :unlimited + # + # retry_on ActiveRecord::Deadlocked, wait: 5.seconds, attempts: 3 + # retry_on Net::OpenTimeout, Timeout::Error, wait: :polynomially_longer, attempts: 10 # retries at most 10 times for Net::OpenTimeout and Timeout::Error combined + # # To retry at most 10 times for each individual exception: + # # retry_on Net::OpenTimeout, wait: :polynomially_longer, attempts: 10 + # # retry_on Net::ReadTimeout, wait: 5.seconds, jitter: 0.30, attempts: 10 + # # retry_on Timeout::Error, wait: :polynomially_longer, attempts: 10 + # + # retry_on YetAnotherCustomAppException, report: true + # retry_on EvenWorseCustomAppException do |job, error| + # CustomErrorHandlingCode.handle(job, error) + # end + # + # def perform(*args) + # # Might raise CustomAppException, AnotherCustomAppException, or YetAnotherCustomAppException for something domain specific + # # Might raise ActiveRecord::Deadlocked when a local db deadlock is detected + # # Might raise Net::OpenTimeout or Timeout::Error when the remote service is down + # end + # end + # + # source://activejob//lib/active_job/exceptions.rb#64 + def retry_on(*exceptions, wait: T.unsafe(nil), attempts: T.unsafe(nil), queue: T.unsafe(nil), priority: T.unsafe(nil), jitter: T.unsafe(nil), report: T.unsafe(nil)); end +end + +# source://activejob//lib/active_job/exceptions.rb#168 +ActiveJob::Exceptions::JITTER_DEFAULT = T.let(T.unsafe(nil), Object) + +# = Active Job \Execution +# +# Provides methods to execute jobs immediately, and wraps job execution so +# that exceptions configured with +# {rescue_from}[rdoc-ref:ActiveSupport::Rescuable::ClassMethods#rescue_from] +# are handled. +# +# source://activejob//lib/active_job/execution.rb#12 +module ActiveJob::Execution + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActiveSupport::Rescuable + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveSupport::Rescuable::ClassMethods + mixes_in_class_methods ::ActiveJob::Execution::ClassMethods + + # source://activejob//lib/active_job/execution.rb#60 + def perform(*_arg0); end + + # Performs the job immediately. The job is not sent to the queuing adapter + # but directly executed by blocking the execution of others until it's finished. + # +perform_now+ returns the value of your job's +perform+ method. + # + # class MyJob < ActiveJob::Base + # def perform + # "Hello World!" + # end + # end + # + # puts MyJob.new(*args).perform_now # => "Hello World!" + # + # source://activejob//lib/active_job/execution.rb#45 + def perform_now; end + + private + + # source://activejob//lib/active_job/execution.rb#65 + def _perform_job; end + + module GeneratedClassMethods + def rescue_handlers; end + def rescue_handlers=(value); end + def rescue_handlers?; end + end + + module GeneratedInstanceMethods + def rescue_handlers; end + def rescue_handlers=(value); end + def rescue_handlers?; end + end +end + +# Includes methods for executing and performing jobs instantly. +# +# source://activejob//lib/active_job/execution.rb#17 +module ActiveJob::Execution::ClassMethods + # source://activejob//lib/active_job/execution.rb#26 + def execute(job_data); end + + # Performs the job immediately. + # + # MyJob.perform_now("mike") + # + # source://activejob//lib/active_job/execution.rb#22 + def perform_now(*_arg0, **_arg1, &_arg2); end +end + +# source://activejob//lib/active_job/execution_state.rb#4 +module ActiveJob::ExecutionState + # source://activejob//lib/active_job/execution_state.rb#5 + def perform_now; end +end + +# source://activejob//lib/active_job/instrumentation.rb#16 +module ActiveJob::Instrumentation + extend ::ActiveSupport::Concern + + # source://activejob//lib/active_job/instrumentation.rb#29 + def instrument(operation, payload = T.unsafe(nil), &block); end + + # source://activejob//lib/active_job/instrumentation.rb#25 + def perform_now; end + + private + + # source://activejob//lib/active_job/instrumentation.rb#42 + def _perform_job; end + + # source://activejob//lib/active_job/instrumentation.rb#47 + def halted_callback_hook(*_arg0); end +end + +# source://activejob//lib/active_job/log_subscriber.rb#6 +class ActiveJob::LogSubscriber < ::ActiveSupport::LogSubscriber + # source://activejob//lib/active_job/log_subscriber.rb#7 + def backtrace_cleaner; end + + # source://activejob//lib/active_job/log_subscriber.rb#7 + def backtrace_cleaner=(_arg0); end + + # source://activejob//lib/active_job/log_subscriber.rb#7 + def backtrace_cleaner?; end + + # source://activejob//lib/active_job/log_subscriber.rb#131 + def discard(event); end + + # source://activejob//lib/active_job/log_subscriber.rb#9 + def enqueue(event); end + + # source://activejob//lib/active_job/log_subscriber.rb#49 + def enqueue_all(event); end + + # source://activejob//lib/active_job/log_subscriber.rb#29 + def enqueue_at(event); end + + # source://activejob//lib/active_job/log_subscriber.rb#106 + def enqueue_retry(event); end + + # source://activejob//lib/active_job/log_subscriber.rb#141 + def interrupt(event); end + + # source://activejob//lib/active_job/log_subscriber.rb#86 + def perform(event); end + + # source://activejob//lib/active_job/log_subscriber.rb#76 + def perform_start(event); end + + # source://activejob//lib/active_job/log_subscriber.rb#149 + def resume(event); end + + # source://activejob//lib/active_job/log_subscriber.rb#121 + def retry_stopped(event); end + + # source://activejob//lib/active_job/log_subscriber.rb#178 + def step(event); end + + # source://activejob//lib/active_job/log_subscriber.rb#157 + def step_skipped(event); end + + # source://activejob//lib/active_job/log_subscriber.rb#165 + def step_started(event); end + + private + + # source://activejob//lib/active_job/log_subscriber.rb#204 + def args_info(job); end + + # source://activejob//lib/active_job/log_subscriber.rb#258 + def enqueue_source_location; end + + # source://activejob//lib/active_job/log_subscriber.rb#262 + def enqueued_jobs_message(adapter, enqueued_jobs); end + + # source://activejob//lib/active_job/log_subscriber.rb#242 + def error(progname = T.unsafe(nil), &block); end + + # source://activejob//lib/active_job/log_subscriber.rb#213 + def format(arg); end + + # source://activejob//lib/active_job/log_subscriber.rb#234 + def info(progname = T.unsafe(nil), &block); end + + # source://activejob//lib/active_job/log_subscriber.rb#250 + def log_enqueue_source; end + + # source://activejob//lib/active_job/log_subscriber.rb#230 + def logger; end + + # source://activejob//lib/active_job/log_subscriber.rb#200 + def queue_name(event); end + + # source://activejob//lib/active_job/log_subscriber.rb#226 + def scheduled_at(event); end + + class << self + # source://activejob//lib/active_job/log_subscriber.rb#7 + def backtrace_cleaner; end + + # source://activejob//lib/active_job/log_subscriber.rb#7 + def backtrace_cleaner=(value); end + + # source://activejob//lib/active_job/log_subscriber.rb#7 + def backtrace_cleaner?; end + + private + + # source://activejob//lib/active_job/log_subscriber.rb#7 + def __class_attr_backtrace_cleaner; end + + # source://activejob//lib/active_job/log_subscriber.rb#7 + def __class_attr_backtrace_cleaner=(new_value); end + + # source://activejob//lib/active_job/log_subscriber.rb#27 + def __class_attr_log_levels; end + + # source://activejob//lib/active_job/log_subscriber.rb#27 + def __class_attr_log_levels=(new_value); end + end +end + +# source://activejob//lib/active_job/logging.rb#7 +module ActiveJob::Logging + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + # source://activejob//lib/active_job/logging.rb#31 + def perform_now; end + + private + + # @return [Boolean] + # + # source://activejob//lib/active_job/logging.rb#45 + def logger_tagged_by_active_job?; end + + # source://activejob//lib/active_job/logging.rb#36 + def tag_logger(*tags, &block); end + + module GeneratedClassMethods + def log_arguments; end + def log_arguments=(value); end + def log_arguments?; end + end + + module GeneratedInstanceMethods; end +end + +# = Active Job Queue adapter +# +# The +ActiveJob::QueueAdapter+ module is used to load the +# correct adapter. The default queue adapter is +:async+, +# which loads the ActiveJob::QueueAdapters::AsyncAdapter. +# +# source://activejob//lib/active_job/queue_adapter.rb#20 +module ActiveJob::QueueAdapter + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveJob::QueueAdapter::ClassMethods + + module GeneratedClassMethods + def _queue_adapter; end + def _queue_adapter=(value); end + def _queue_adapter_name; end + def _queue_adapter_name=(value); end + end + + module GeneratedInstanceMethods; end +end + +# Includes the setter method for changing the active queue adapter. +# +# source://activejob//lib/active_job/queue_adapter.rb#31 +module ActiveJob::QueueAdapter::ClassMethods + # Returns the backend queue provider. The default queue adapter + # is +:async+. See QueueAdapters for more information. + # + # source://activejob//lib/active_job/queue_adapter.rb#34 + def queue_adapter; end + + # Specify the backend queue provider. The default queue adapter + # is the +:async+ queue. See QueueAdapters for more + # information. + # + # source://activejob//lib/active_job/queue_adapter.rb#49 + def queue_adapter=(name_or_adapter); end + + # Returns string denoting the name of the configured queue adapter. + # By default returns "async". + # + # source://activejob//lib/active_job/queue_adapter.rb#41 + def queue_adapter_name; end + + private + + # source://activejob//lib/active_job/queue_adapter.rb#66 + def assign_adapter(adapter_name, queue_adapter); end + + # @return [Boolean] + # + # source://activejob//lib/active_job/queue_adapter.rb#73 + def queue_adapter?(object); end +end + +# source://activejob//lib/active_job/queue_adapter.rb#71 +ActiveJob::QueueAdapter::ClassMethods::QUEUE_ADAPTER_METHODS = T.let(T.unsafe(nil), Array) + +# = Active Job adapters +# +# Active Job has adapters for the following queuing backends: +# +# * {Backburner}[https://github.com/nesquena/backburner] +# * {Delayed Job}[https://github.com/collectiveidea/delayed_job] +# * {Que}[https://github.com/chanks/que] +# * {queue_classic}[https://github.com/QueueClassic/queue_classic] +# * {Resque}[https://github.com/resque/resque] +# * {Sidekiq}[https://sidekiq.org] +# * {Sneakers}[https://github.com/jondot/sneakers] +# * Please Note: We are not accepting pull requests for new adapters. See the {README}[link:files/activejob/README_md.html] for more details. +# +# For testing and development Active Job has three built-in adapters: +# +# * {Active Job Async}[https://api.rubyonrails.org/classes/ActiveJob/QueueAdapters/AsyncAdapter.html] +# * {Active Job Inline}[https://api.rubyonrails.org/classes/ActiveJob/QueueAdapters/InlineAdapter.html] +# * {Active Job Test}[https://api.rubyonrails.org/classes/ActiveJob/QueueAdapters/TestAdapter.html] +# +# === Backends Features +# +# | | Async | Queues | Delayed | Priorities | Timeout | Retries | +# |-------------------|-------|--------|------------|------------|---------|---------| +# | Backburner | Yes | Yes | Yes | Yes | Job | Global | +# | Delayed Job | Yes | Yes | Yes | Job | Global | Global | +# | Que | Yes | Yes | Yes | Job | No | Job | +# | queue_classic | Yes | Yes | Yes* | No | No | No | +# | Resque | Yes | Yes | Yes (Gem) | Queue | Global | Yes | +# | Sidekiq | Yes | Yes | Yes | Queue | No | Job | +# | Sneakers | Yes | Yes | No | Queue | Queue | No | +# | Active Job Async | Yes | Yes | Yes | No | No | No | +# | Active Job Inline | No | Yes | N/A | N/A | N/A | N/A | +# | Active Job Test | No | Yes | N/A | N/A | N/A | N/A | +# +# ==== Async +# +# Yes: The Queue Adapter has the ability to run the job in a non-blocking manner. +# It either runs on a separate or forked process, or on a different thread. +# +# No: The job is run in the same process. +# +# ==== Queues +# +# Yes: Jobs may set which queue they are run in with queue_as or by using the set +# method. +# +# ==== Delayed +# +# Yes: The adapter will run the job in the future through perform_later. +# +# (Gem): An additional gem is required to use perform_later with this adapter. +# +# No: The adapter will run jobs at the next opportunity and cannot use perform_later. +# +# N/A: The adapter does not support queuing. +# +# NOTE: +# queue_classic supports job scheduling since version 3.1. +# For older versions you can use the queue_classic-later gem. +# +# ==== Priorities +# +# The order in which jobs are processed can be configured differently depending +# on the adapter. +# +# Job: Any class inheriting from the adapter may set the priority on the job +# object relative to other jobs. +# +# Queue: The adapter can set the priority for job queues, when setting a queue +# with Active Job this will be respected. +# +# Yes: Allows the priority to be set on the job object, at the queue level or +# as default configuration option. +# +# No: The adapter does not allow the priority of jobs to be configured. +# +# N/A: The adapter does not support queuing, and therefore sorting them. +# +# ==== Timeout +# +# When a job will stop after the allotted time. +# +# Job: The timeout can be set for each instance of the job class. +# +# Queue: The timeout is set for all jobs on the queue. +# +# Global: The adapter is configured that all jobs have a maximum run time. +# +# No: The adapter does not allow the timeout of jobs to be configured. +# +# N/A: This adapter does not run in a separate process, and therefore timeout +# is unsupported. +# +# ==== Retries +# +# Job: The number of retries can be set per instance of the job class. +# +# Yes: The Number of retries can be configured globally, for each instance or +# on the queue. This adapter may also present failed instances of the job class +# that can be restarted. +# +# Global: The adapter has a global number of retries. +# +# No: The adapter does not allow the number of retries to be configured. +# +# N/A: The adapter does not run in a separate process, and therefore doesn't +# support retries. +# +# source://activejob//lib/active_job/queue_adapters.rb#112 +module ActiveJob::QueueAdapters + extend ::ActiveSupport::Autoload + + class << self + # Returns adapter for specified name. + # + # ActiveJob::QueueAdapters.lookup(:sidekiq) + # # => ActiveJob::QueueAdapters::SidekiqAdapter + # + # source://activejob//lib/active_job/queue_adapters.rb#135 + def lookup(name); end + end +end + +# source://activejob//lib/active_job/queue_adapters.rb#127 +ActiveJob::QueueAdapters::ADAPTER = T.let(T.unsafe(nil), String) + +# = Active Job Abstract Adapter +# +# Active Job supports multiple job queue systems. ActiveJob::QueueAdapters::AbstractAdapter +# forms the abstraction layer which makes this possible. +# +# source://activejob//lib/active_job/queue_adapters/abstract_adapter.rb#9 +class ActiveJob::QueueAdapters::AbstractAdapter + # @raise [NotImplementedError] + # + # source://activejob//lib/active_job/queue_adapters/abstract_adapter.rb#12 + def enqueue(job); end + + # @raise [NotImplementedError] + # + # source://activejob//lib/active_job/queue_adapters/abstract_adapter.rb#16 + def enqueue_at(job, timestamp); end + + # Returns the value of attribute stopping. + # + # source://activejob//lib/active_job/queue_adapters/abstract_adapter.rb#10 + def stopping; end + + # Sets the attribute stopping + # + # @param value the value to set the attribute stopping to. + # + # source://activejob//lib/active_job/queue_adapters/abstract_adapter.rb#10 + def stopping=(_arg0); end + + # @return [Boolean] + # + # source://activejob//lib/active_job/queue_adapters/abstract_adapter.rb#20 + def stopping?; end +end + +# = Active Job Async adapter +# +# The Async adapter runs jobs with an in-process thread pool. +# +# This is the default queue adapter. It's well-suited for dev/test since +# it doesn't need an external infrastructure, but it's a poor fit for +# production since it drops pending jobs on restart. +# +# To use this adapter, set queue adapter to +:async+: +# +# config.active_job.queue_adapter = :async +# +# To configure the adapter's thread pool, instantiate the adapter and +# pass your own config: +# +# config.active_job.queue_adapter = ActiveJob::QueueAdapters::AsyncAdapter.new \ +# min_threads: 1, +# max_threads: 2 * Concurrent.processor_count, +# idletime: 600.seconds +# +# The adapter uses a {Concurrent Ruby}[https://github.com/ruby-concurrency/concurrent-ruby] thread pool to schedule and execute +# jobs. Since jobs share a single thread pool, long-running jobs will block +# short-lived jobs. Fine for dev/test; bad for production. +# +# source://activejob//lib/active_job/queue_adapters/async_adapter.rb#33 +class ActiveJob::QueueAdapters::AsyncAdapter < ::ActiveJob::QueueAdapters::AbstractAdapter + # See {Concurrent::ThreadPoolExecutor}[https://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent/ThreadPoolExecutor.html] for executor options. + # + # @return [AsyncAdapter] a new instance of AsyncAdapter + # + # source://activejob//lib/active_job/queue_adapters/async_adapter.rb#35 + def initialize(**executor_options); end + + # source://activejob//lib/active_job/queue_adapters/async_adapter.rb#39 + def enqueue(job); end + + # source://activejob//lib/active_job/queue_adapters/async_adapter.rb#43 + def enqueue_at(job, timestamp); end + + # Used for our test suite. + # + # source://activejob//lib/active_job/queue_adapters/async_adapter.rb#55 + def immediate=(immediate); end + + # Gracefully stop processing jobs. Finishes in-progress work and handles + # any new jobs following the executor's fallback policy (`caller_runs`). + # Waits for termination by default. Pass `wait: false` to continue. + # + # source://activejob//lib/active_job/queue_adapters/async_adapter.rb#50 + def shutdown(wait: T.unsafe(nil)); end +end + +# Note that we don't actually need to serialize the jobs since we're +# performing them in-process, but we do so anyway for parity with other +# adapters and deployment environments. Otherwise, serialization bugs +# may creep in undetected. +# +# source://activejob//lib/active_job/queue_adapters/async_adapter.rb#63 +class ActiveJob::QueueAdapters::AsyncAdapter::JobWrapper + # @return [JobWrapper] a new instance of JobWrapper + # + # source://activejob//lib/active_job/queue_adapters/async_adapter.rb#64 + def initialize(job); end + + # source://activejob//lib/active_job/queue_adapters/async_adapter.rb#69 + def perform; end +end + +# source://activejob//lib/active_job/queue_adapters/async_adapter.rb#74 +class ActiveJob::QueueAdapters::AsyncAdapter::Scheduler + # @return [Scheduler] a new instance of Scheduler + # + # source://activejob//lib/active_job/queue_adapters/async_adapter.rb#86 + def initialize(**options); end + + # source://activejob//lib/active_job/queue_adapters/async_adapter.rb#96 + def enqueue(job, queue_name:); end + + # source://activejob//lib/active_job/queue_adapters/async_adapter.rb#100 + def enqueue_at(job, timestamp, queue_name:); end + + # source://activejob//lib/active_job/queue_adapters/async_adapter.rb#114 + def executor; end + + # Returns the value of attribute immediate. + # + # source://activejob//lib/active_job/queue_adapters/async_adapter.rb#84 + def immediate; end + + # Sets the attribute immediate + # + # @param value the value to set the attribute immediate to. + # + # source://activejob//lib/active_job/queue_adapters/async_adapter.rb#84 + def immediate=(_arg0); end + + # source://activejob//lib/active_job/queue_adapters/async_adapter.rb#109 + def shutdown(wait: T.unsafe(nil)); end +end + +# source://activejob//lib/active_job/queue_adapters/async_adapter.rb#75 +ActiveJob::QueueAdapters::AsyncAdapter::Scheduler::DEFAULT_EXECUTOR_OPTIONS = T.let(T.unsafe(nil), Hash) + +# = Active Job Inline adapter +# +# When enqueuing jobs with the Inline adapter the job will be executed +# immediately. +# +# To use the Inline set the queue_adapter config to +:inline+. +# +# Rails.application.config.active_job.queue_adapter = :inline +# +# source://activejob//lib/active_job/queue_adapters/inline_adapter.rb#13 +class ActiveJob::QueueAdapters::InlineAdapter < ::ActiveJob::QueueAdapters::AbstractAdapter + # source://activejob//lib/active_job/queue_adapters/inline_adapter.rb#14 + def enqueue(job); end + + # @raise [NotImplementedError] + # + # source://activejob//lib/active_job/queue_adapters/inline_adapter.rb#18 + def enqueue_at(*_arg0); end +end + +# = Test adapter for Active Job +# +# The test adapter should be used only in testing. Along with +# ActiveJob::TestCase and ActiveJob::TestHelper +# it makes a great tool to test your \Rails application. +# +# To use the test adapter set +queue_adapter+ config to +:test+. +# +# Rails.application.config.active_job.queue_adapter = :test +# +# source://activejob//lib/active_job/queue_adapters/test_adapter.rb#14 +class ActiveJob::QueueAdapters::TestAdapter < ::ActiveJob::QueueAdapters::AbstractAdapter + # Returns the value of attribute at. + # + # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#15 + def at; end + + # Sets the attribute at + # + # @param value the value to set the attribute at to. + # + # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#15 + def at=(_arg0); end + + # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#28 + def enqueue(job); end + + # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#33 + def enqueue_at(job, timestamp); end + + # Provides a store of all the enqueued jobs with the TestAdapter so you can check them. + # + # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#19 + def enqueued_jobs; end + + # Sets the attribute enqueued_jobs + # + # @param value the value to set the attribute enqueued_jobs to. + # + # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#16 + def enqueued_jobs=(_arg0); end + + # Returns the value of attribute filter. + # + # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#15 + def filter; end + + # Sets the attribute filter + # + # @param value the value to set the attribute filter to. + # + # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#15 + def filter=(_arg0); end + + # Returns the value of attribute perform_enqueued_at_jobs. + # + # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#15 + def perform_enqueued_at_jobs; end + + # Sets the attribute perform_enqueued_at_jobs + # + # @param value the value to set the attribute perform_enqueued_at_jobs to. + # + # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#15 + def perform_enqueued_at_jobs=(_arg0); end + + # Returns the value of attribute perform_enqueued_jobs. + # + # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#15 + def perform_enqueued_jobs; end + + # Sets the attribute perform_enqueued_jobs + # + # @param value the value to set the attribute perform_enqueued_jobs to. + # + # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#15 + def perform_enqueued_jobs=(_arg0); end + + # Provides a store of all the performed jobs with the TestAdapter so you can check them. + # + # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#24 + def performed_jobs; end + + # Sets the attribute performed_jobs + # + # @param value the value to set the attribute performed_jobs to. + # + # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#16 + def performed_jobs=(_arg0); end + + # Returns the value of attribute queue. + # + # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#15 + def queue; end + + # Sets the attribute queue + # + # @param value the value to set the attribute queue to. + # + # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#15 + def queue=(_arg0); end + + # Returns the value of attribute reject. + # + # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#15 + def reject; end + + # Sets the attribute reject + # + # @param value the value to set the attribute reject to. + # + # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#15 + def reject=(_arg0); end + + # Returns the value of attribute stopping. + # + # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#15 + def stopping; end + + # Sets the attribute stopping + # + # @param value the value to set the attribute stopping to. + # + # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#15 + def stopping=(_arg0); end + + # @return [Boolean] + # + # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#38 + def stopping?; end + + private + + # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#83 + def filter_as_proc(filter); end + + # @return [Boolean] + # + # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#61 + def filtered?(job); end + + # @return [Boolean] + # + # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#75 + def filtered_job_class?(job); end + + # @return [Boolean] + # + # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#69 + def filtered_queue?(job); end + + # @return [Boolean] + # + # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#65 + def filtered_time?(job); end + + # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#43 + def job_to_hash(job, extras = T.unsafe(nil)); end + + # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#52 + def perform_or_enqueue(perform, job, job_data); end +end + +# source://activejob//lib/active_job/queue_name.rb#4 +module ActiveJob::QueueName + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveJob::QueueName::ClassMethods + + # Returns the name of the queue the job will be run on. + # + # source://activejob//lib/active_job/queue_name.rb#61 + def queue_name; end + + module GeneratedClassMethods + def queue_name; end + def queue_name=(value); end + def queue_name?; end + def queue_name_delimiter; end + def queue_name_delimiter=(value); end + def queue_name_delimiter?; end + def queue_name_prefix; end + def queue_name_prefix=(value); end + def queue_name_prefix?; end + end + + module GeneratedInstanceMethods + def queue_name_prefix; end + def queue_name_prefix=(value); end + def queue_name_prefix?; end + end +end + +# Includes the ability to override the default queue name and prefix. +# +# source://activejob//lib/active_job/queue_name.rb#8 +module ActiveJob::QueueName::ClassMethods + # source://activejob//lib/active_job/queue_name.rb#9 + def default_queue_name; end + + # source://activejob//lib/active_job/queue_name.rb#9 + def default_queue_name=(val); end + + # Specifies the name of the queue to process the job on. + # + # class PublishToFeedJob < ActiveJob::Base + # queue_as :feeds + # + # def perform(post) + # post.to_feed! + # end + # end + # + # Can be given a block that will evaluate in the context of the job + # so that a dynamic queue name can be applied: + # + # class PublishToFeedJob < ApplicationJob + # queue_as do + # post = self.arguments.first + # + # if post.paid? + # :paid_feeds + # else + # :feeds + # end + # end + # + # def perform(post) + # post.to_feed! + # end + # end + # + # source://activejob//lib/active_job/queue_name.rb#39 + def queue_as(part_name = T.unsafe(nil), &block); end + + # source://activejob//lib/active_job/queue_name.rb#47 + def queue_name_from_part(part_name); end + + class << self + # source://activejob//lib/active_job/queue_name.rb#9 + def default_queue_name; end + + # source://activejob//lib/active_job/queue_name.rb#9 + def default_queue_name=(val); end + end +end + +# source://activejob//lib/active_job/queue_priority.rb#4 +module ActiveJob::QueuePriority + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveJob::QueuePriority::ClassMethods + + # Returns the priority that the job will be created with + # + # source://activejob//lib/active_job/queue_priority.rb#53 + def priority; end + + module GeneratedClassMethods + def priority; end + def priority=(value); end + def priority?; end + end + + module GeneratedInstanceMethods; end +end + +# Includes the ability to override the default queue priority. +# +# source://activejob//lib/active_job/queue_priority.rb#8 +module ActiveJob::QueuePriority::ClassMethods + # source://activejob//lib/active_job/queue_priority.rb#9 + def default_priority; end + + # source://activejob//lib/active_job/queue_priority.rb#9 + def default_priority=(val); end + + # Specifies the priority of the queue to create the job with. + # + # class PublishToFeedJob < ActiveJob::Base + # queue_with_priority 50 + # + # def perform(post) + # post.to_feed! + # end + # end + # + # Can be given a block that will evaluate in the context of the job + # so that a dynamic priority can be applied: + # + # class PublishToFeedJob < ApplicationJob + # queue_with_priority do + # post = self.arguments.first + # + # if post.paid? + # 10 + # else + # 50 + # end + # end + # + # def perform(post) + # post.to_feed! + # end + # end + # + # source://activejob//lib/active_job/queue_priority.rb#39 + def queue_with_priority(priority = T.unsafe(nil), &block); end + + class << self + # source://activejob//lib/active_job/queue_priority.rb#9 + def default_priority; end + + # source://activejob//lib/active_job/queue_priority.rb#9 + def default_priority=(val); end + end +end + +# = Active Job Railtie +# +# source://activejob//lib/active_job/railtie.rb#9 +class ActiveJob::Railtie < ::Rails::Railtie; end + +# Raised when an unsupported argument type is set as a job argument. We +# currently support String, Integer, Float, NilClass, TrueClass, FalseClass, +# BigDecimal, Symbol, Date, Time, DateTime, ActiveSupport::TimeWithZone, +# ActiveSupport::Duration, Hash, ActiveSupport::HashWithIndifferentAccess, +# Array, Range, or GlobalID::Identification instances, although this can be +# extended by adding custom serializers. +# Raised if you set the key for a Hash something else than a string or +# a symbol. Also raised when trying to serialize an object which can't be +# identified with a GlobalID - such as an unpersisted Active Record model. +# +# source://activejob//lib/active_job/arguments.rb#26 +class ActiveJob::SerializationError < ::ArgumentError; end + +# = Active Job \Serializers +# +# The +ActiveJob::Serializers+ module is used to store a list of known serializers +# and to add new ones. It also has helpers to serialize/deserialize objects. +# +# source://activejob//lib/active_job/serializers.rb#8 +module ActiveJob::Serializers + extend ::ActiveSupport::Autoload + + class << self + # Adds new serializers to a list of known serializers. + # + # source://activejob//lib/active_job/serializers.rb#60 + def add_serializers(*new_serializers); end + + # Returns deserialized object. + # Will look up through all known serializers. + # If no serializer found will raise ArgumentError. + # + # @raise [ArgumentError] + # + # source://activejob//lib/active_job/serializers.rb#40 + def deserialize(argument); end + + # Returns serialized representative of the passed object. + # Will look up through all known serializers. + # Raises ActiveJob::SerializationError if it can't find a proper serializer. + # + # @raise [SerializationError] + # + # source://activejob//lib/active_job/serializers.rb#31 + def serialize(argument); end + + # Returns list of known serializers. + # + # source://activejob//lib/active_job/serializers.rb#51 + def serializers; end + + # source://activejob//lib/active_job/serializers.rb#53 + def serializers=(serializers); end + + private + + # source://activejob//lib/active_job/serializers.rb#66 + def add_new_serializers(new_serializers); end + + # source://activejob//lib/active_job/serializers.rb#80 + def index_serializers(new_serializers); end + end +end + +# source://activejob//lib/active_job/serializers/action_controller_parameters_serializer.rb#5 +class ActiveJob::Serializers::ActionControllerParametersSerializer < ::ActiveJob::Serializers::ObjectSerializer + # @raise [NotImplementedError] + # + # source://activejob//lib/active_job/serializers/action_controller_parameters_serializer.rb#10 + def deserialize(hash); end + + # source://activejob//lib/active_job/serializers/action_controller_parameters_serializer.rb#18 + def klass; end + + # source://activejob//lib/active_job/serializers/action_controller_parameters_serializer.rb#6 + def serialize(argument); end + + # @return [Boolean] + # + # source://activejob//lib/active_job/serializers/action_controller_parameters_serializer.rb#14 + def serialize?(argument); end +end + +# source://activejob//lib/active_job/serializers/big_decimal_serializer.rb#7 +class ActiveJob::Serializers::BigDecimalSerializer < ::ActiveJob::Serializers::ObjectSerializer + # source://activejob//lib/active_job/serializers/big_decimal_serializer.rb#12 + def deserialize(hash); end + + # source://activejob//lib/active_job/serializers/big_decimal_serializer.rb#16 + def klass; end + + # source://activejob//lib/active_job/serializers/big_decimal_serializer.rb#8 + def serialize(big_decimal); end +end + +# source://activejob//lib/active_job/serializers/date_serializer.rb#5 +class ActiveJob::Serializers::DateSerializer < ::ActiveJob::Serializers::ObjectSerializer + # source://activejob//lib/active_job/serializers/date_serializer.rb#10 + def deserialize(hash); end + + # source://activejob//lib/active_job/serializers/date_serializer.rb#14 + def klass; end + + # source://activejob//lib/active_job/serializers/date_serializer.rb#6 + def serialize(date); end +end + +# source://activejob//lib/active_job/serializers/date_time_serializer.rb#5 +class ActiveJob::Serializers::DateTimeSerializer < ::ActiveJob::Serializers::TimeObjectSerializer + # source://activejob//lib/active_job/serializers/date_time_serializer.rb#6 + def deserialize(hash); end + + # source://activejob//lib/active_job/serializers/date_time_serializer.rb#10 + def klass; end +end + +# source://activejob//lib/active_job/serializers/duration_serializer.rb#5 +class ActiveJob::Serializers::DurationSerializer < ::ActiveJob::Serializers::ObjectSerializer + # source://activejob//lib/active_job/serializers/duration_serializer.rb#12 + def deserialize(hash); end + + # source://activejob//lib/active_job/serializers/duration_serializer.rb#19 + def klass; end + + # source://activejob//lib/active_job/serializers/duration_serializer.rb#6 + def serialize(duration); end +end + +# source://activejob//lib/active_job/serializers/module_serializer.rb#5 +class ActiveJob::Serializers::ModuleSerializer < ::ActiveJob::Serializers::ObjectSerializer + # source://activejob//lib/active_job/serializers/module_serializer.rb#11 + def deserialize(hash); end + + # source://activejob//lib/active_job/serializers/module_serializer.rb#15 + def klass; end + + # @raise [SerializationError] + # + # source://activejob//lib/active_job/serializers/module_serializer.rb#6 + def serialize(constant); end +end + +# Base class for serializing and deserializing custom objects. +# +# Example: +# +# class MoneySerializer < ActiveJob::Serializers::ObjectSerializer +# def serialize(money) +# super("amount" => money.amount, "currency" => money.currency) +# end +# +# def deserialize(hash) +# Money.new(hash["amount"], hash["currency"]) +# end +# +# def klass +# Money +# end +# end +# +# source://activejob//lib/active_job/serializers/object_serializer.rb#24 +class ActiveJob::Serializers::ObjectSerializer + include ::Singleton::SingletonInstanceMethods + include ::Singleton + extend ::Singleton::SingletonClassMethods + + # @return [ObjectSerializer] a new instance of ObjectSerializer + # + # source://activejob//lib/active_job/serializers/object_serializer.rb#31 + def initialize; end + + # Deserializes an argument from a JSON primitive type. + # + # @raise [NotImplementedError] + # + # source://activejob//lib/active_job/serializers/object_serializer.rb#47 + def deserialize(hash); end + + # Serializes an argument to a JSON primitive type. + # + # source://activejob//lib/active_job/serializers/object_serializer.rb#42 + def serialize(hash); end + + # Determines if an argument should be serialized by a serializer. + # + # @return [Boolean] + # + # source://activejob//lib/active_job/serializers/object_serializer.rb#37 + def serialize?(argument); end + + class << self + # source://activejob//lib/active_job/serializers/object_serializer.rb#28 + def deserialize(*_arg0, **_arg1, &_arg2); end + + # source://activejob//lib/active_job/serializers/object_serializer.rb#28 + def serialize(*_arg0, **_arg1, &_arg2); end + + # source://activejob//lib/active_job/serializers/object_serializer.rb#28 + def serialize?(*_arg0, **_arg1, &_arg2); end + + private + + # source://activejob//lib/active_job/serializers/object_serializer.rb#25 + def allocate; end + + # source://activejob//lib/active_job/serializers/object_serializer.rb#25 + def new(*_arg0); end + end +end + +# source://activejob//lib/active_job/serializers/range_serializer.rb#5 +class ActiveJob::Serializers::RangeSerializer < ::ActiveJob::Serializers::ObjectSerializer + # source://activejob//lib/active_job/serializers/range_serializer.rb#14 + def deserialize(hash); end + + # source://activejob//lib/active_job/serializers/range_serializer.rb#18 + def klass; end + + # source://activejob//lib/active_job/serializers/range_serializer.rb#6 + def serialize(range); end +end + +# source://activejob//lib/active_job/serializers/symbol_serializer.rb#5 +class ActiveJob::Serializers::SymbolSerializer < ::ActiveJob::Serializers::ObjectSerializer + # source://activejob//lib/active_job/serializers/symbol_serializer.rb#10 + def deserialize(argument); end + + # source://activejob//lib/active_job/serializers/symbol_serializer.rb#14 + def klass; end + + # source://activejob//lib/active_job/serializers/symbol_serializer.rb#6 + def serialize(argument); end +end + +# source://activejob//lib/active_job/serializers/time_object_serializer.rb#5 +class ActiveJob::Serializers::TimeObjectSerializer < ::ActiveJob::Serializers::ObjectSerializer + # source://activejob//lib/active_job/serializers/time_object_serializer.rb#8 + def serialize(time); end +end + +# source://activejob//lib/active_job/serializers/time_object_serializer.rb#6 +ActiveJob::Serializers::TimeObjectSerializer::NANO_PRECISION = T.let(T.unsafe(nil), Integer) + +# source://activejob//lib/active_job/serializers/time_serializer.rb#5 +class ActiveJob::Serializers::TimeSerializer < ::ActiveJob::Serializers::TimeObjectSerializer + # source://activejob//lib/active_job/serializers/time_serializer.rb#6 + def deserialize(hash); end + + # source://activejob//lib/active_job/serializers/time_serializer.rb#10 + def klass; end +end + +# source://activejob//lib/active_job/serializers/time_with_zone_serializer.rb#5 +class ActiveJob::Serializers::TimeWithZoneSerializer < ::ActiveJob::Serializers::ObjectSerializer + # source://activejob//lib/active_job/serializers/time_with_zone_serializer.rb#15 + def deserialize(hash); end + + # source://activejob//lib/active_job/serializers/time_with_zone_serializer.rb#19 + def klass; end + + # source://activejob//lib/active_job/serializers/time_with_zone_serializer.rb#8 + def serialize(time_with_zone); end +end + +# source://activejob//lib/active_job/serializers/time_with_zone_serializer.rb#6 +ActiveJob::Serializers::TimeWithZoneSerializer::NANO_PRECISION = T.let(T.unsafe(nil), Integer) + +# source://activejob//lib/active_job/structured_event_subscriber.rb#6 +class ActiveJob::StructuredEventSubscriber < ::ActiveSupport::StructuredEventSubscriber + # source://activejob//lib/active_job/structured_event_subscriber.rb#137 + def discard(event); end + + # source://activejob//lib/active_job/structured_event_subscriber.rb#7 + def enqueue(event); end + + # source://activejob//lib/active_job/structured_event_subscriber.rb#56 + def enqueue_all(event); end + + # source://activejob//lib/active_job/structured_event_subscriber.rb#31 + def enqueue_at(event); end + + # source://activejob//lib/active_job/structured_event_subscriber.rb#109 + def enqueue_retry(event); end + + # source://activejob//lib/active_job/structured_event_subscriber.rb#149 + def interrupt(event); end + + # source://activejob//lib/active_job/structured_event_subscriber.rb#87 + def perform(event); end + + # source://activejob//lib/active_job/structured_event_subscriber.rb#73 + def perform_start(event); end + + # source://activejob//lib/active_job/structured_event_subscriber.rb#162 + def resume(event); end + + # source://activejob//lib/active_job/structured_event_subscriber.rb#124 + def retry_stopped(event); end + + # source://activejob//lib/active_job/structured_event_subscriber.rb#197 + def step(event); end + + # source://activejob//lib/active_job/structured_event_subscriber.rb#173 + def step_skipped(event); end + + # source://activejob//lib/active_job/structured_event_subscriber.rb#184 + def step_started(event); end +end + +# source://activejob//lib/active_job/test_case.rb#6 +class ActiveJob::TestCase < ::ActiveSupport::TestCase + include ::ActiveJob::TestHelper +end + +# Provides helper methods for testing Active Job +# +# source://activejob//lib/active_job/test_helper.rb#8 +module ActiveJob::TestHelper + include ::ActiveSupport::Testing::Assertions + + # source://activejob//lib/active_job/test_helper.rb#56 + def after_teardown; end + + # Asserts that the number of enqueued jobs matches the given number. + # + # def test_jobs + # assert_enqueued_jobs 0 + # HelloJob.perform_later('david') + # assert_enqueued_jobs 1 + # HelloJob.perform_later('abdelkader') + # assert_enqueued_jobs 2 + # end + # + # If a block is passed, asserts that the block will cause the specified number of + # jobs to be enqueued. + # + # def test_jobs_again + # assert_enqueued_jobs 1 do + # HelloJob.perform_later('cristian') + # end + # + # assert_enqueued_jobs 2 do + # HelloJob.perform_later('aaron') + # HelloJob.perform_later('rafael') + # end + # end + # + # Asserts the number of times a specific job was enqueued by passing +:only+ option. + # + # def test_logging_job + # assert_enqueued_jobs 1, only: LoggingJob do + # LoggingJob.perform_later + # HelloJob.perform_later('jeremy') + # end + # end + # + # Asserts the number of times a job except specific class was enqueued by passing +:except+ option. + # + # def test_logging_job + # assert_enqueued_jobs 1, except: HelloJob do + # LoggingJob.perform_later + # HelloJob.perform_later('jeremy') + # end + # end + # + # +:only+ and +:except+ options accept Class, Array of Class, or Proc. When passed a Proc, + # a hash containing the job's class and it's argument are passed as argument. + # + # Asserts the number of times a job is enqueued to a specific queue by passing +:queue+ option. + # + # def test_logging_job + # assert_enqueued_jobs 2, queue: 'default' do + # LoggingJob.perform_later + # HelloJob.perform_later('elfassy') + # end + # end + # + # source://activejob//lib/active_job/test_helper.rb#122 + def assert_enqueued_jobs(number, only: T.unsafe(nil), except: T.unsafe(nil), queue: T.unsafe(nil), &block); end + + # Asserts that the job has been enqueued with the given arguments. + # + # def test_assert_enqueued_with + # MyJob.perform_later(1,2,3) + # assert_enqueued_with(job: MyJob, args: [1,2,3]) + # + # MyJob.set(wait_until: Date.tomorrow.noon, queue: "my_queue").perform_later + # assert_enqueued_with(at: Date.tomorrow.noon, queue: "my_queue") + # end + # + # For keyword arguments, specify them as a hash inside an array: + # + # def test_assert_enqueued_with_keyword_arguments + # MyJob.perform_later(arg1: 'value1', arg2: 'value2') + # assert_enqueued_with(job: MyJob, args: [{ arg1: 'value1', arg2: 'value2' }]) + # end + # + # The given arguments may also be specified as matcher procs that return a + # boolean value indicating whether a job's attribute meets certain criteria. + # + # For example, a proc can be used to match a range of times: + # + # def test_assert_enqueued_with + # at_matcher = ->(job_at) { (Date.yesterday..Date.tomorrow).cover?(job_at) } + # + # MyJob.set(wait_until: Date.today.noon).perform_later + # + # assert_enqueued_with(job: MyJob, at: at_matcher) + # end + # + # A proc can also be used to match a subset of a job's args: + # + # def test_assert_enqueued_with + # args_matcher = ->(job_args) { job_args[0].key?(:foo) } + # + # MyJob.perform_later(foo: "bar", other_arg: "No need to check in the test") + # + # assert_enqueued_with(job: MyJob, args: args_matcher) + # end + # + # If a block is passed, asserts that the block will cause the job to be + # enqueued with the given arguments. + # + # def test_assert_enqueued_with + # assert_enqueued_with(job: MyJob, args: [1,2,3]) do + # MyJob.perform_later(1,2,3) + # end + # + # assert_enqueued_with(job: MyJob, at: Date.tomorrow.noon) do + # MyJob.set(wait_until: Date.tomorrow.noon).perform_later + # end + # end + # + # source://activejob//lib/active_job/test_helper.rb#406 + def assert_enqueued_with(job: T.unsafe(nil), args: T.unsafe(nil), at: T.unsafe(nil), queue: T.unsafe(nil), priority: T.unsafe(nil), &block); end + + # Asserts that no jobs have been enqueued. + # + # def test_jobs + # assert_no_enqueued_jobs + # HelloJob.perform_later('jeremy') + # assert_enqueued_jobs 1 + # end + # + # If a block is passed, asserts that the block will not cause any job to be enqueued. + # + # def test_jobs_again + # assert_no_enqueued_jobs do + # # No job should be enqueued from this block + # end + # end + # + # Asserts that no jobs of a specific kind are enqueued by passing +:only+ option. + # + # def test_no_logging + # assert_no_enqueued_jobs only: LoggingJob do + # HelloJob.perform_later('jeremy') + # end + # end + # + # Asserts that no jobs except specific class are enqueued by passing +:except+ option. + # + # def test_no_logging + # assert_no_enqueued_jobs except: HelloJob do + # HelloJob.perform_later('jeremy') + # end + # end + # + # +:only+ and +:except+ options accept Class, Array of Class, or Proc. When passed a Proc, + # a hash containing the job's class and it's argument are passed as argument. + # + # Asserts that no jobs are enqueued to a specific queue by passing +:queue+ option + # + # def test_no_logging + # assert_no_enqueued_jobs queue: 'default' do + # LoggingJob.set(queue: :some_queue).perform_later + # end + # end + # + # Note: This assertion is simply a shortcut for: + # + # assert_enqueued_jobs 0, &block + # + # source://activejob//lib/active_job/test_helper.rb#186 + def assert_no_enqueued_jobs(only: T.unsafe(nil), except: T.unsafe(nil), queue: T.unsafe(nil), &block); end + + # Asserts that no jobs have been performed. + # + # def test_jobs + # assert_no_performed_jobs + # + # perform_enqueued_jobs do + # HelloJob.perform_later('matthew') + # assert_performed_jobs 1 + # end + # end + # + # If a block is passed, asserts that the block will not cause any job to be performed. + # + # def test_jobs_again + # assert_no_performed_jobs do + # # No job should be performed from this block + # end + # end + # + # The block form supports filtering. If the +:only+ option is specified, + # then only the listed job(s) will not be performed. + # + # def test_no_logging + # assert_no_performed_jobs only: LoggingJob do + # HelloJob.perform_later('jeremy') + # end + # end + # + # Also if the +:except+ option is specified, + # then the job(s) except specific class will not be performed. + # + # def test_no_logging + # assert_no_performed_jobs except: HelloJob do + # HelloJob.perform_later('jeremy') + # end + # end + # + # +:only+ and +:except+ options accept Class, Array of Class, or Proc. When passed a Proc, + # an instance of the job will be passed as argument. + # + # If the +:queue+ option is specified, + # then only the job(s) enqueued to a specific queue will not be performed. + # + # def test_assert_no_performed_jobs_with_queue_option + # assert_no_performed_jobs queue: :some_queue do + # HelloJob.set(queue: :other_queue).perform_later("jeremy") + # end + # end + # + # Note: This assertion is simply a shortcut for: + # + # assert_performed_jobs 0, &block + # + # source://activejob//lib/active_job/test_helper.rb#348 + def assert_no_performed_jobs(only: T.unsafe(nil), except: T.unsafe(nil), queue: T.unsafe(nil), &block); end + + # Asserts that the number of performed jobs matches the given number. + # If no block is passed, perform_enqueued_jobs + # must be called around or after the job call. + # + # def test_jobs + # assert_performed_jobs 0 + # + # perform_enqueued_jobs do + # HelloJob.perform_later('xavier') + # end + # assert_performed_jobs 1 + # + # HelloJob.perform_later('yves') + # + # perform_enqueued_jobs + # + # assert_performed_jobs 2 + # end + # + # If a block is passed, asserts that the block will cause the specified number of + # jobs to be performed. + # + # def test_jobs_again + # assert_performed_jobs 1 do + # HelloJob.perform_later('robin') + # end + # + # assert_performed_jobs 2 do + # HelloJob.perform_later('carlos') + # HelloJob.perform_later('sean') + # end + # end + # + # This method also supports filtering. If the +:only+ option is specified, + # then only the listed job(s) will be performed. + # + # def test_hello_job + # assert_performed_jobs 1, only: HelloJob do + # HelloJob.perform_later('jeremy') + # LoggingJob.perform_later + # end + # end + # + # Also if the +:except+ option is specified, + # then the job(s) except specific class will be performed. + # + # def test_hello_job + # assert_performed_jobs 1, except: LoggingJob do + # HelloJob.perform_later('jeremy') + # LoggingJob.perform_later + # end + # end + # + # An array may also be specified, to support testing multiple jobs. + # + # def test_hello_and_logging_jobs + # assert_nothing_raised do + # assert_performed_jobs 2, only: [HelloJob, LoggingJob] do + # HelloJob.perform_later('jeremy') + # LoggingJob.perform_later('stewie') + # RescueJob.perform_later('david') + # end + # end + # end + # + # A proc may also be specified. When passed a Proc, the job's instance will be passed as argument. + # + # def test_hello_and_logging_jobs + # assert_nothing_raised do + # assert_performed_jobs(1, only: ->(job) { job.is_a?(HelloJob) }) do + # HelloJob.perform_later('jeremy') + # LoggingJob.perform_later('stewie') + # RescueJob.perform_later('david') + # end + # end + # end + # + # If the +:queue+ option is specified, + # then only the job(s) enqueued to a specific queue will be performed. + # + # def test_assert_performed_jobs_with_queue_option + # assert_performed_jobs 1, queue: :some_queue do + # HelloJob.set(queue: :some_queue).perform_later("jeremy") + # HelloJob.set(queue: :other_queue).perform_later("bogdan") + # end + # end + # + # source://activejob//lib/active_job/test_helper.rb#278 + def assert_performed_jobs(number, only: T.unsafe(nil), except: T.unsafe(nil), queue: T.unsafe(nil), &block); end + + # Asserts that the job has been performed with the given arguments. + # + # def test_assert_performed_with + # MyJob.perform_later(1,2,3) + # + # perform_enqueued_jobs + # + # assert_performed_with(job: MyJob, args: [1,2,3]) + # + # MyJob.set(wait_until: Date.tomorrow.noon, queue: "my_queue").perform_later + # + # perform_enqueued_jobs + # + # assert_performed_with(at: Date.tomorrow.noon, queue: "my_queue") + # end + # + # The given arguments may also be specified as matcher procs that return a + # boolean value indicating whether a job's attribute meets certain criteria. + # + # For example, a proc can be used to match a range of times: + # + # def test_assert_performed_with + # at_matcher = ->(job_at) { (Date.yesterday..Date.tomorrow).cover?(job_at) } + # + # MyJob.set(wait_until: Date.today.noon).perform_later + # + # perform_enqueued_jobs + # + # assert_performed_with(job: MyJob, at: at_matcher) + # end + # + # A proc can also be used to match a subset of a job's args: + # + # def test_assert_performed_with + # args_matcher = ->(job_args) { job_args[0].key?(:foo) } + # + # MyJob.perform_later(foo: "bar", other_arg: "No need to check in the test") + # + # perform_enqueued_jobs + # + # assert_performed_with(job: MyJob, args: args_matcher) + # end + # + # If a block is passed, that block performs all of the jobs that were + # enqueued throughout the duration of the block and asserts that + # the job has been performed with the given arguments in the block. + # + # def test_assert_performed_with + # assert_performed_with(job: MyJob, args: [1,2,3]) do + # MyJob.perform_later(1,2,3) + # end + # + # assert_performed_with(job: MyJob, at: Date.tomorrow.noon) do + # MyJob.set(wait_until: Date.tomorrow.noon).perform_later + # end + # end + # + # source://activejob//lib/active_job/test_helper.rb#510 + def assert_performed_with(job: T.unsafe(nil), args: T.unsafe(nil), at: T.unsafe(nil), queue: T.unsafe(nil), priority: T.unsafe(nil), &block); end + + # source://activejob//lib/active_job/test_helper.rb#41 + def before_setup; end + + # source://activejob//lib/active_job/test_helper.rb#9 + def enqueued_jobs(*_arg0, **_arg1, &_arg2); end + + # source://activejob//lib/active_job/test_helper.rb#9 + def enqueued_jobs=(arg); end + + # Performs all enqueued jobs. If a block is given, performs all of the jobs + # that were enqueued throughout the duration of the block. If a block is + # not given, performs all of the enqueued jobs up to this point in the test. + # + # def test_perform_enqueued_jobs + # perform_enqueued_jobs do + # MyJob.perform_later(1, 2, 3) + # end + # assert_performed_jobs 1 + # end + # + # def test_perform_enqueued_jobs_without_block + # MyJob.perform_later(1, 2, 3) + # + # perform_enqueued_jobs + # + # assert_performed_jobs 1 + # end + # + # This method also supports filtering. If the +:only+ option is specified, + # then only the listed job(s) will be performed. + # + # def test_perform_enqueued_jobs_with_only + # perform_enqueued_jobs(only: MyJob) do + # MyJob.perform_later(1, 2, 3) # will be performed + # HelloJob.perform_later(1, 2, 3) # will not be performed + # end + # assert_performed_jobs 1 + # end + # + # Also if the +:except+ option is specified, + # then the job(s) except specific class will be performed. + # + # def test_perform_enqueued_jobs_with_except + # perform_enqueued_jobs(except: HelloJob) do + # MyJob.perform_later(1, 2, 3) # will be performed + # HelloJob.perform_later(1, 2, 3) # will not be performed + # end + # assert_performed_jobs 1 + # end + # + # +:only+ and +:except+ options accept Class, Array of Class, or Proc. When passed a Proc, + # an instance of the job will be passed as argument. + # + # If the +:queue+ option is specified, + # then only the job(s) enqueued to a specific queue will be performed. + # + # def test_perform_enqueued_jobs_with_queue + # perform_enqueued_jobs queue: :some_queue do + # MyJob.set(queue: :some_queue).perform_later(1, 2, 3) # will be performed + # HelloJob.set(queue: :other_queue).perform_later(1, 2, 3) # will not be performed + # end + # assert_performed_jobs 1 + # end + # + # If the +:at+ option is specified, then only jobs that have been enqueued + # to run at or before the given time will be performed. This includes jobs + # that have been enqueued without a time. + # + # If queue_adapter_for_test is overridden to return a different adapter, + # +perform_enqueued_jobs+ will merely execute the block. + # + # source://activejob//lib/active_job/test_helper.rb#620 + def perform_enqueued_jobs(only: T.unsafe(nil), except: T.unsafe(nil), queue: T.unsafe(nil), at: T.unsafe(nil), &block); end + + # source://activejob//lib/active_job/test_helper.rb#9 + def performed_jobs(*_arg0, **_arg1, &_arg2); end + + # source://activejob//lib/active_job/test_helper.rb#9 + def performed_jobs=(arg); end + + # Accesses the queue_adapter set by ActiveJob::Base. + # + # def test_assert_job_has_custom_queue_adapter_set + # assert_instance_of CustomQueueAdapter, HelloJob.queue_adapter + # end + # + # source://activejob//lib/active_job/test_helper.rb#661 + def queue_adapter; end + + # Returns a queue adapter instance to use with all Active Job test helpers. + # By default, returns an instance of ActiveJob::QueueAdapters::TestAdapter. + # Override this method to specify a different adapter. The adapter must + # implement the same interface as ActiveJob::QueueAdapters::TestAdapter. + # + # source://activejob//lib/active_job/test_helper.rb#66 + def queue_adapter_for_test; end + + private + + # source://activejob//lib/active_job/test_helper.rb#676 + def clear_enqueued_jobs; end + + # source://activejob//lib/active_job/test_helper.rb#680 + def clear_performed_jobs; end + + # source://activejob//lib/active_job/test_helper.rb#745 + def deserialize_args_for_assertion(job); end + + # source://activejob//lib/active_job/test_helper.rb#716 + def enqueued_jobs_with(only: T.unsafe(nil), except: T.unsafe(nil), queue: T.unsafe(nil), at: T.unsafe(nil), &block); end + + # source://activejob//lib/active_job/test_helper.rb#710 + def filter_as_proc(filter); end + + # source://activejob//lib/active_job/test_helper.rb#724 + def flush_enqueued_jobs(only: T.unsafe(nil), except: T.unsafe(nil), queue: T.unsafe(nil), at: T.unsafe(nil)); end + + # source://activejob//lib/active_job/test_helper.rb#752 + def instantiate_job(payload, skip_deserialize_arguments: T.unsafe(nil)); end + + # source://activejob//lib/active_job/test_helper.rb#684 + def jobs_with(jobs, only: T.unsafe(nil), except: T.unsafe(nil), queue: T.unsafe(nil), at: T.unsafe(nil)); end + + # source://activejob//lib/active_job/test_helper.rb#720 + def performed_jobs_with(only: T.unsafe(nil), except: T.unsafe(nil), queue: T.unsafe(nil), &block); end + + # source://activejob//lib/active_job/test_helper.rb#732 + def prepare_args_for_assertion(args); end + + # source://activejob//lib/active_job/test_helper.rb#759 + def queue_adapter_changed_jobs; end + + # source://activejob//lib/active_job/test_helper.rb#666 + def require_active_job_test_adapter!(method); end + + # @return [Boolean] + # + # source://activejob//lib/active_job/test_helper.rb#672 + def using_test_adapter?; end + + # @raise [ArgumentError] + # + # source://activejob//lib/active_job/test_helper.rb#766 + def validate_option(only: T.unsafe(nil), except: T.unsafe(nil)); end +end + +# source://activejob//lib/active_job/test_helper.rb#15 +module ActiveJob::TestHelper::TestQueueAdapter + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveJob::TestHelper::TestQueueAdapter::ClassMethods + + module GeneratedClassMethods + def _test_adapter; end + def _test_adapter=(value); end + end + + module GeneratedInstanceMethods; end +end + +# source://activejob//lib/active_job/test_helper.rb#22 +module ActiveJob::TestHelper::TestQueueAdapter::ClassMethods + # source://activejob//lib/active_job/test_helper.rb#27 + def disable_test_adapter; end + + # source://activejob//lib/active_job/test_helper.rb#31 + def enable_test_adapter(test_adapter); end + + # source://activejob//lib/active_job/test_helper.rb#23 + def queue_adapter; end +end + +# Raised during job payload deserialization when it references an uninitialized job class. +# +# source://activejob//lib/active_job/core.rb#5 +class ActiveJob::UnknownJobClassError < ::NameError + # @return [UnknownJobClassError] a new instance of UnknownJobClassError + # + # source://activejob//lib/active_job/core.rb#6 + def initialize(job_class_name); end +end + +# source://activejob//lib/active_job/gem_version.rb#9 +module ActiveJob::VERSION; end + +# source://activejob//lib/active_job/gem_version.rb#10 +ActiveJob::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# source://activejob//lib/active_job/gem_version.rb#11 +ActiveJob::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# source://activejob//lib/active_job/gem_version.rb#13 +ActiveJob::VERSION::PRE = T.let(T.unsafe(nil), T.untyped) + +# source://activejob//lib/active_job/gem_version.rb#15 +ActiveJob::VERSION::STRING = T.let(T.unsafe(nil), String) + +# source://activejob//lib/active_job/gem_version.rb#12 +ActiveJob::VERSION::TINY = T.let(T.unsafe(nil), Integer) diff --git a/sorbet/rbi/gems/activemodel@8.1.1.rbi b/sorbet/rbi/gems/activemodel@8.1.1.rbi new file mode 100644 index 0000000..406c202 --- /dev/null +++ b/sorbet/rbi/gems/activemodel@8.1.1.rbi @@ -0,0 +1,7204 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `activemodel` gem. +# Please instead update this file by running `bin/tapioca gem activemodel`. + + +# :include: ../README.rdoc +# +# source://activemodel//lib/active_model/gem_version.rb#3 +module ActiveModel + extend ::ActiveSupport::Autoload + + class << self + # source://activemodel//lib/active_model/deprecator.rb#4 + def deprecator; end + + # source://activemodel//lib/active_model.rb#82 + def eager_load!; end + + # Returns the currently loaded version of \Active \Model as a +Gem::Version+. + # + # source://activemodel//lib/active_model/gem_version.rb#5 + def gem_version; end + + # Returns the currently loaded version of \Active \Model as a +Gem::Version+. + # + # source://activemodel//lib/active_model/version.rb#7 + def version; end + end +end + +# = Active \Model \API +# +# Includes the required interface for an object to interact with +# Action Pack and Action View, using different Active \Model modules. +# It includes model name introspections, conversions, translations, and +# validations. Besides that, it allows you to initialize the object with a +# hash of attributes, pretty much like Active Record does. +# +# A minimal implementation could be: +# +# class Person +# include ActiveModel::API +# attr_accessor :name, :age +# end +# +# person = Person.new(name: 'bob', age: '18') +# person.name # => "bob" +# person.age # => "18" +# +# Note that, by default, +ActiveModel::API+ implements #persisted? +# to return +false+, which is the most common case. You may want to override +# it in your class to simulate a different scenario: +# +# class Person +# include ActiveModel::API +# attr_accessor :id, :name +# +# def persisted? +# self.id.present? +# end +# end +# +# person = Person.new(id: 1, name: 'bob') +# person.persisted? # => true +# +# Also, if for some reason you need to run code on initialize ( ::new ), make +# sure you call +super+ if you want the attributes hash initialization to +# happen. +# +# class Person +# include ActiveModel::API +# attr_accessor :id, :name, :omg +# +# def initialize(attributes={}) +# super +# @omg ||= true +# end +# end +# +# person = Person.new(id: 1, name: 'bob') +# person.omg # => true +# +# For more detailed information on other functionalities available, please +# refer to the specific modules included in +ActiveModel::API+ +# (see below). +# +# source://activemodel//lib/active_model/api.rb#59 +module ActiveModel::API + include ::ActiveModel::ForbiddenAttributesProtection + include ::ActiveModel::AttributeAssignment + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActiveSupport::Callbacks + include ::ActiveModel::Validations::HelperMethods + include ::ActiveModel::Validations + include ::ActiveModel::Conversion + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveModel::Validations::ClassMethods + mixes_in_class_methods ::ActiveModel::Callbacks + mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods + mixes_in_class_methods ::ActiveSupport::DescendantsTracker + mixes_in_class_methods ::ActiveModel::Translation + mixes_in_class_methods ::ActiveModel::Validations::HelperMethods + mixes_in_class_methods ::ActiveModel::Conversion::ClassMethods + + # Initializes a new model with the given +params+. + # + # class Person + # include ActiveModel::API + # attr_accessor :name, :age + # end + # + # person = Person.new(name: 'bob', age: '18') + # person.name # => "bob" + # person.age # => "18" + # + # source://activemodel//lib/active_model/api.rb#80 + def initialize(attributes = T.unsafe(nil)); end + + # Indicates if the model is persisted. Default is +false+. + # + # class Person + # include ActiveModel::API + # attr_accessor :id, :name + # end + # + # person = Person.new(id: 1, name: 'bob') + # person.persisted? # => false + # + # @return [Boolean] + # + # source://activemodel//lib/active_model/api.rb#95 + def persisted?; end + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + def _validators; end + def _validators=(value); end + def _validators?; end + def param_delimiter; end + def param_delimiter=(value); end + def param_delimiter?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + def _validators; end + def _validators?; end + def param_delimiter=(value); end + end +end + +# source://activemodel//lib/active_model/access.rb#7 +module ActiveModel::Access + # source://activemodel//lib/active_model/access.rb#8 + def slice(*methods); end + + # source://activemodel//lib/active_model/access.rb#12 + def values_at(*methods); end +end + +# source://activemodel//lib/active_model/attribute.rb#6 +class ActiveModel::Attribute + # This method should not be called directly. + # Use #from_database or #from_user + # + # @return [Attribute] a new instance of Attribute + # + # source://activemodel//lib/active_model/attribute.rb#33 + def initialize(name, value_before_type_cast, type, original_attribute = T.unsafe(nil), value = T.unsafe(nil)); end + + # source://activemodel//lib/active_model/attribute.rb#123 + def ==(other); end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/attribute.rb#115 + def came_from_user?; end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/attribute.rb#66 + def changed?; end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/attribute.rb#70 + def changed_in_place?; end + + # source://activemodel//lib/active_model/attribute.rb#99 + def dup_or_share; end + + # source://activemodel//lib/active_model/attribute.rb#143 + def encode_with(coder); end + + # source://activemodel//lib/active_model/attribute.rb#129 + def eql?(other); end + + # source://activemodel//lib/active_model/attribute.rb#74 + def forgetting_assignment; end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/attribute.rb#119 + def has_been_read?; end + + # source://activemodel//lib/active_model/attribute.rb#131 + def hash; end + + # source://activemodel//lib/active_model/attribute.rb#135 + def init_with(coder); end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/attribute.rb#111 + def initialized?; end + + # Returns the value of attribute name. + # + # source://activemodel//lib/active_model/attribute.rb#29 + def name; end + + # source://activemodel//lib/active_model/attribute.rb#47 + def original_value; end + + # source://activemodel//lib/active_model/attribute.rb#151 + def original_value_for_database; end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/attribute.rb#62 + def serializable?(&block); end + + # Returns the value of attribute type. + # + # source://activemodel//lib/active_model/attribute.rb#29 + def type; end + + # @raise [NotImplementedError] + # + # source://activemodel//lib/active_model/attribute.rb#107 + def type_cast(*_arg0); end + + # source://activemodel//lib/active_model/attribute.rb#41 + def value(&_arg0); end + + # Returns the value of attribute value_before_type_cast. + # + # source://activemodel//lib/active_model/attribute.rb#29 + def value_before_type_cast; end + + # source://activemodel//lib/active_model/attribute.rb#55 + def value_for_database; end + + # source://activemodel//lib/active_model/attribute.rb#87 + def with_cast_value(value); end + + # source://activemodel//lib/active_model/attribute.rb#91 + def with_type(type); end + + # source://activemodel//lib/active_model/attribute/user_provided_default.rb#7 + def with_user_default(value); end + + # source://activemodel//lib/active_model/attribute.rb#83 + def with_value_from_database(value); end + + # source://activemodel//lib/active_model/attribute.rb#78 + def with_value_from_user(value); end + + private + + # source://activemodel//lib/active_model/attribute.rb#177 + def _original_value_for_database; end + + # source://activemodel//lib/active_model/attribute.rb#173 + def _value_for_database; end + + # Returns the value of attribute original_attribute. + # + # source://activemodel//lib/active_model/attribute.rb#161 + def assigned?; end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/attribute.rb#169 + def changed_from_assignment?; end + + # source://activemodel//lib/active_model/attribute.rb#163 + def initialize_dup(other); end + + # Returns the value of attribute original_attribute. + # + # source://activemodel//lib/active_model/attribute.rb#160 + def original_attribute; end + + class << self + # source://activemodel//lib/active_model/attribute.rb#8 + def from_database(name, value_before_type_cast, type, value = T.unsafe(nil)); end + + # source://activemodel//lib/active_model/attribute.rb#12 + def from_user(name, value_before_type_cast, type, original_attribute = T.unsafe(nil)); end + + # source://activemodel//lib/active_model/attribute.rb#20 + def null(name); end + + # source://activemodel//lib/active_model/attribute.rb#24 + def uninitialized(name, type); end + + # source://activemodel//lib/active_model/attribute.rb#16 + def with_cast_value(name, value_before_type_cast, type); end + end +end + +# source://activemodel//lib/active_model/attribute.rb#181 +class ActiveModel::Attribute::FromDatabase < ::ActiveModel::Attribute + # source://activemodel//lib/active_model/attribute.rb#186 + def forgetting_assignment; end + + # source://activemodel//lib/active_model/attribute.rb#182 + def type_cast(value); end + + private + + # source://activemodel//lib/active_model/attribute.rb#200 + def _original_value_for_database; end +end + +# source://activemodel//lib/active_model/attribute.rb#205 +class ActiveModel::Attribute::FromUser < ::ActiveModel::Attribute + # @return [Boolean] + # + # source://activemodel//lib/active_model/attribute.rb#210 + def came_from_user?; end + + # source://activemodel//lib/active_model/attribute.rb#206 + def type_cast(value); end + + private + + # source://activemodel//lib/active_model/attribute.rb#215 + def _value_for_database; end +end + +# source://activemodel//lib/active_model/attribute.rb#230 +class ActiveModel::Attribute::Null < ::ActiveModel::Attribute + # @return [Null] a new instance of Null + # + # source://activemodel//lib/active_model/attribute.rb#231 + def initialize(name); end + + # source://activemodel//lib/active_model/attribute.rb#235 + def type_cast(*_arg0); end + + # @raise [ActiveModel::MissingAttributeError] + # + # source://activemodel//lib/active_model/attribute.rb#247 + def with_cast_value(value); end + + # source://activemodel//lib/active_model/attribute.rb#239 + def with_type(type); end + + # @raise [ActiveModel::MissingAttributeError] + # + # source://activemodel//lib/active_model/attribute.rb#243 + def with_value_from_database(value); end + + # @raise [ActiveModel::MissingAttributeError] + # + # source://activemodel//lib/active_model/attribute.rb#246 + def with_value_from_user(value); end +end + +# source://activemodel//lib/active_model/attribute.rb#250 +class ActiveModel::Attribute::Uninitialized < ::ActiveModel::Attribute + # @return [Uninitialized] a new instance of Uninitialized + # + # source://activemodel//lib/active_model/attribute.rb#253 + def initialize(name, type); end + + # source://activemodel//lib/active_model/attribute.rb#274 + def forgetting_assignment; end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/attribute.rb#270 + def initialized?; end + + # source://activemodel//lib/active_model/attribute.rb#263 + def original_value; end + + # source://activemodel//lib/active_model/attribute.rb#257 + def value; end + + # source://activemodel//lib/active_model/attribute.rb#267 + def value_for_database; end + + # source://activemodel//lib/active_model/attribute.rb#278 + def with_type(type); end +end + +# source://activemodel//lib/active_model/attribute.rb#251 +ActiveModel::Attribute::Uninitialized::UNINITIALIZED_ORIGINAL_VALUE = T.let(T.unsafe(nil), Object) + +# source://activemodel//lib/active_model/attribute/user_provided_default.rb#11 +class ActiveModel::Attribute::UserProvidedDefault < ::ActiveModel::Attribute::FromUser + # @return [UserProvidedDefault] a new instance of UserProvidedDefault + # + # source://activemodel//lib/active_model/attribute/user_provided_default.rb#12 + def initialize(name, value, type, database_default); end + + # source://activemodel//lib/active_model/attribute/user_provided_default.rb#29 + def dup_or_share; end + + # source://activemodel//lib/active_model/attribute/user_provided_default.rb#39 + def marshal_dump; end + + # source://activemodel//lib/active_model/attribute/user_provided_default.rb#50 + def marshal_load(values); end + + # source://activemodel//lib/active_model/attribute/user_provided_default.rb#17 + def value_before_type_cast; end + + # source://activemodel//lib/active_model/attribute/user_provided_default.rb#25 + def with_type(type); end + + private + + # Returns the value of attribute user_provided_value. + # + # source://activemodel//lib/active_model/attribute/user_provided_default.rb#62 + def user_provided_value; end +end + +# source://activemodel//lib/active_model/attribute.rb#220 +class ActiveModel::Attribute::WithCastValue < ::ActiveModel::Attribute + # @return [Boolean] + # + # source://activemodel//lib/active_model/attribute.rb#225 + def changed_in_place?; end + + # source://activemodel//lib/active_model/attribute.rb#221 + def type_cast(value); end +end + +# source://activemodel//lib/active_model/attribute_assignment.rb#6 +module ActiveModel::AttributeAssignment + include ::ActiveModel::ForbiddenAttributesProtection + + # Allows you to set all the attributes by passing in a hash of attributes with + # keys matching the attribute names. + # + # If the passed hash responds to permitted? method and the return value + # of this method is +false+ an ActiveModel::ForbiddenAttributesError + # exception is raised. + # + # class Cat + # include ActiveModel::AttributeAssignment + # attr_accessor :name, :status + # end + # + # cat = Cat.new + # cat.assign_attributes(name: "Gorby", status: "yawning") + # cat.name # => 'Gorby' + # cat.status # => 'yawning' + # cat.assign_attributes(status: "sleeping") + # cat.name # => 'Gorby' + # cat.status # => 'sleeping' + # + # source://activemodel//lib/active_model/attribute_assignment.rb#28 + def assign_attributes(new_attributes); end + + # Like `BasicObject#method_missing`, `#attribute_writer_missing` is invoked + # when `#assign_attributes` is passed an unknown attribute name. + # + # By default, `#attribute_writer_missing` raises an UnknownAttributeError. + # + # class Rectangle + # include ActiveModel::AttributeAssignment + # + # attr_accessor :length, :width + # + # def attribute_writer_missing(name, value) + # Rails.logger.warn "Tried to assign to unknown attribute #{name}" + # end + # end + # + # rectangle = Rectangle.new + # rectangle.assign_attributes(height: 10) # => Logs "Tried to assign to unknown attribute 'height'" + # + # @raise [UnknownAttributeError] + # + # source://activemodel//lib/active_model/attribute_assignment.rb#56 + def attribute_writer_missing(name, value); end + + # Allows you to set all the attributes by passing in a hash of attributes with + # keys matching the attribute names. + # + # If the passed hash responds to permitted? method and the return value + # of this method is +false+ an ActiveModel::ForbiddenAttributesError + # exception is raised. + # + # class Cat + # include ActiveModel::AttributeAssignment + # attr_accessor :name, :status + # end + # + # cat = Cat.new + # cat.assign_attributes(name: "Gorby", status: "yawning") + # cat.name # => 'Gorby' + # cat.status # => 'yawning' + # cat.assign_attributes(status: "sleeping") + # cat.name # => 'Gorby' + # cat.status # => 'sleeping' + # + # source://activemodel//lib/active_model/attribute_assignment.rb#37 + def attributes=(new_attributes); end + + private + + # source://activemodel//lib/active_model/attribute_assignment.rb#67 + def _assign_attribute(k, v); end + + # source://activemodel//lib/active_model/attribute_assignment.rb#61 + def _assign_attributes(attributes); end +end + +# = Active \Model \Attribute \Methods +# +# Provides a way to add prefixes and suffixes to your methods as +# well as handling the creation of ActiveRecord::Base - like +# class methods such as +table_name+. +# +# The requirements to implement +ActiveModel::AttributeMethods+ are to: +# +# * include ActiveModel::AttributeMethods in your class. +# * Call each of its methods you want to add, such as +attribute_method_suffix+ +# or +attribute_method_prefix+. +# * Call +define_attribute_methods+ after the other methods are called. +# * Define the various generic +_attribute+ methods that you have declared. +# * Define an +attributes+ method which returns a hash with each +# attribute name in your model as hash key and the attribute value as hash value. +# Hash keys must be strings. +# +# A minimal implementation could be: +# +# class Person +# include ActiveModel::AttributeMethods +# +# attribute_method_affix prefix: 'reset_', suffix: '_to_default!' +# attribute_method_suffix '_contrived?' +# attribute_method_prefix 'clear_' +# define_attribute_methods :name +# +# attr_accessor :name +# +# def attributes +# { 'name' => @name } +# end +# +# private +# def attribute_contrived?(attr) +# true +# end +# +# def clear_attribute(attr) +# send("#{attr}=", nil) +# end +# +# def reset_attribute_to_default!(attr) +# send("#{attr}=", 'Default Name') +# end +# end +# +# source://activemodel//lib/active_model/attribute_methods.rb#64 +module ActiveModel::AttributeMethods + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveModel::AttributeMethods::ClassMethods + + # +attribute_missing+ is like +method_missing+, but for attributes. When + # +method_missing+ is called we check to see if there is a matching + # attribute method. If so, we tell +attribute_missing+ to dispatch the + # attribute. This method can be overloaded to customize the behavior. + # + # source://activemodel//lib/active_model/attribute_methods.rb#520 + def attribute_missing(match, *_arg1, **_arg2, &_arg3); end + + # Allows access to the object attributes, which are held in the hash + # returned by attributes, as though they were first-class + # methods. So a +Person+ class with a +name+ attribute can for example use + # Person#name and Person#name= and never directly use + # the attributes hash -- except for multiple assignments with + # ActiveRecord::Base#attributes=. + # + # It's also possible to instantiate related objects, so a Client + # class belonging to the +clients+ table with a +master_id+ foreign key + # can instantiate master through Client#master. + # + # source://activemodel//lib/active_model/attribute_methods.rb#507 + def method_missing(method, *_arg1, **_arg2, &_arg3); end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/attribute_methods.rb#528 + def respond_to?(method, include_private_methods = T.unsafe(nil)); end + + # A +Person+ instance with a +name+ attribute can ask + # person.respond_to?(:name), person.respond_to?(:name=), + # and person.respond_to?(:name?) which will all return +true+. + # + # source://activemodel//lib/active_model/attribute_methods.rb#527 + def respond_to_without_attributes?(*_arg0); end + + private + + # source://activemodel//lib/active_model/attribute_methods.rb#556 + def _read_attribute(attr); end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/attribute_methods.rb#541 + def attribute_method?(attr_name); end + + # Returns a struct representing the matching attribute method. + # The struct's attributes are prefix, base and suffix. + # + # source://activemodel//lib/active_model/attribute_methods.rb#547 + def matched_attribute_method(method_name); end + + # @raise [ActiveModel::MissingAttributeError] + # + # source://activemodel//lib/active_model/attribute_methods.rb#552 + def missing_attribute(attr_name, stack); end + + module GeneratedClassMethods + def attribute_aliases; end + def attribute_aliases=(value); end + def attribute_aliases?; end + def attribute_method_patterns; end + def attribute_method_patterns=(value); end + def attribute_method_patterns?; end + end + + module GeneratedInstanceMethods + def attribute_aliases; end + def attribute_aliases?; end + def attribute_method_patterns; end + def attribute_method_patterns?; end + end +end + +# source://activemodel//lib/active_model/attribute_methods.rb#560 +module ActiveModel::AttributeMethods::AttrNames + class << self + # We want to generate the methods via module_eval rather than + # define_method, because define_method is slower on dispatch. + # + # But sometimes the database might return columns with + # characters that are not allowed in normal method names (like + # 'my_column(omg)'. So to work around this we first define with + # the __temp__ identifier, and then use alias method to rename + # it to what we want. + # + # We are also defining a constant to hold the frozen string of + # the attribute name. Using a constant means that we do not have + # to allocate an object on each call to the attribute method. + # Making it frozen means that it doesn't get duped when used to + # key the @attributes in read_attribute. + # + # source://activemodel//lib/active_model/attribute_methods.rb#577 + def define_attribute_accessor_method(owner, attr_name, writer: T.unsafe(nil)); end + end +end + +# source://activemodel//lib/active_model/attribute_methods.rb#561 +ActiveModel::AttributeMethods::AttrNames::DEF_SAFE_NAME = T.let(T.unsafe(nil), Regexp) + +# source://activemodel//lib/active_model/attribute_methods.rb#68 +ActiveModel::AttributeMethods::CALL_COMPILABLE_REGEXP = T.let(T.unsafe(nil), Regexp) + +# source://activemodel//lib/active_model/attribute_methods.rb#75 +module ActiveModel::AttributeMethods::ClassMethods + # Allows you to make aliases for attributes. + # + # class Person + # include ActiveModel::AttributeMethods + # + # attr_accessor :name + # attribute_method_suffix '_short?' + # define_attribute_methods :name + # + # alias_attribute :nickname, :name + # + # private + # def attribute_short?(attr) + # send(attr).length < 5 + # end + # end + # + # person = Person.new + # person.name = 'Bob' + # person.name # => "Bob" + # person.nickname # => "Bob" + # person.name_short? # => true + # person.nickname_short? # => true + # + # source://activemodel//lib/active_model/attribute_methods.rb#203 + def alias_attribute(new_name, old_name); end + + # source://activemodel//lib/active_model/attribute_methods.rb#226 + def alias_attribute_method_definition(code_generator, pattern, new_name, old_name); end + + # source://activemodel//lib/active_model/attribute_methods.rb#382 + def aliases_by_attribute_name; end + + # Returns the original name for the alias +name+ + # + # source://activemodel//lib/active_model/attribute_methods.rb#245 + def attribute_alias(name); end + + # Is +new_name+ an alias? + # + # @return [Boolean] + # + # source://activemodel//lib/active_model/attribute_methods.rb#240 + def attribute_alias?(new_name); end + + # Declares a method available for all attributes with the given prefix + # and suffix. Uses +method_missing+ and respond_to? to rewrite + # the method. + # + # #{prefix}#{attr}#{suffix}(*args, &block) + # + # to + # + # #{prefix}attribute#{suffix}(#{attr}, *args, &block) + # + # An #{prefix}attribute#{suffix} instance method must exist and + # accept at least the +attr+ argument. + # + # class Person + # include ActiveModel::AttributeMethods + # + # attr_accessor :name + # attribute_method_affix prefix: 'reset_', suffix: '_to_default!' + # define_attribute_methods :name + # + # private + # def reset_attribute_to_default!(attr) + # send("#{attr}=", 'Default Name') + # end + # end + # + # person = Person.new + # person.name # => 'Gem' + # person.reset_name_to_default! + # person.name # => 'Default Name' + # + # source://activemodel//lib/active_model/attribute_methods.rb#175 + def attribute_method_affix(*affixes); end + + # Declares a method available for all attributes with the given prefix. + # Uses +method_missing+ and respond_to? to rewrite the method. + # + # #{prefix}#{attr}(*args, &block) + # + # to + # + # #{prefix}attribute(#{attr}, *args, &block) + # + # An instance method #{prefix}attribute must exist and accept + # at least the +attr+ argument. + # + # class Person + # include ActiveModel::AttributeMethods + # + # attr_accessor :name + # attribute_method_prefix 'clear_' + # define_attribute_methods :name + # + # private + # def clear_attribute(attr) + # send("#{attr}=", nil) + # end + # end + # + # person = Person.new + # person.name = 'Bob' + # person.name # => "Bob" + # person.clear_name + # person.name # => nil + # + # source://activemodel//lib/active_model/attribute_methods.rb#106 + def attribute_method_prefix(*prefixes, parameters: T.unsafe(nil)); end + + # Declares a method available for all attributes with the given suffix. + # Uses +method_missing+ and respond_to? to rewrite the method. + # + # #{attr}#{suffix}(*args, &block) + # + # to + # + # attribute#{suffix}(#{attr}, *args, &block) + # + # An attribute#{suffix} instance method must exist and accept at + # least the +attr+ argument. + # + # class Person + # include ActiveModel::AttributeMethods + # + # attr_accessor :name + # attribute_method_suffix '_short?' + # define_attribute_methods :name + # + # private + # def attribute_short?(attr) + # send(attr).length < 5 + # end + # end + # + # person = Person.new + # person.name = 'Bob' + # person.name # => "Bob" + # person.name_short? # => true + # + # source://activemodel//lib/active_model/attribute_methods.rb#140 + def attribute_method_suffix(*suffixes, parameters: T.unsafe(nil)); end + + # Declares an attribute that should be prefixed and suffixed by + # +ActiveModel::AttributeMethods+. + # + # To use, pass an attribute name (as string or symbol). Be sure to declare + # +define_attribute_method+ after you define any prefix, suffix or affix + # method, or they will not hook in. + # + # class Person + # include ActiveModel::AttributeMethods + # + # attr_accessor :name + # attribute_method_suffix '_short?' + # + # # Call to define_attribute_method must appear after the + # # attribute_method_prefix, attribute_method_suffix or + # # attribute_method_affix declarations. + # define_attribute_method :name + # + # private + # def attribute_short?(attr) + # send(attr).length < 5 + # end + # end + # + # person = Person.new + # person.name = 'Bob' + # person.name # => "Bob" + # person.name_short? # => true + # + # source://activemodel//lib/active_model/attribute_methods.rb#311 + def define_attribute_method(attr_name, _owner: T.unsafe(nil), as: T.unsafe(nil)); end + + # source://activemodel//lib/active_model/attribute_methods.rb#320 + def define_attribute_method_pattern(pattern, attr_name, owner:, as:, override: T.unsafe(nil)); end + + # Declares the attributes that should be prefixed and suffixed by + # +ActiveModel::AttributeMethods+. + # + # To use, pass attribute names (as strings or symbols). Be sure to declare + # +define_attribute_methods+ after you define any prefix, suffix, or affix + # methods, or they will not hook in. + # + # class Person + # include ActiveModel::AttributeMethods + # + # attr_accessor :name, :age, :address + # attribute_method_prefix 'clear_' + # + # # Call to define_attribute_methods must appear after the + # # attribute_method_prefix, attribute_method_suffix or + # # attribute_method_affix declarations. + # define_attribute_methods :name, :age, :address + # + # private + # def clear_attribute(attr) + # send("#{attr}=", nil) + # end + # end + # + # source://activemodel//lib/active_model/attribute_methods.rb#272 + def define_attribute_methods(*attr_names); end + + # source://activemodel//lib/active_model/attribute_methods.rb#211 + def eagerly_generate_alias_attribute_methods(new_name, old_name); end + + # source://activemodel//lib/active_model/attribute_methods.rb#217 + def generate_alias_attribute_methods(code_generator, new_name, old_name); end + + # Removes all the previously dynamically defined methods from the class, including alias attribute methods. + # + # class Person + # include ActiveModel::AttributeMethods + # + # attr_accessor :name + # attribute_method_suffix '_short?' + # define_attribute_method :name + # alias_attribute :first_name, :name + # + # private + # def attribute_short?(attr) + # send(attr).length < 5 + # end + # end + # + # person = Person.new + # person.name = 'Bob' + # person.first_name # => "Bob" + # person.name_short? # => true + # + # Person.undefine_attribute_methods + # + # person.name_short? # => NoMethodError + # person.first_name # => NoMethodError + # + # source://activemodel//lib/active_model/attribute_methods.rb#375 + def undefine_attribute_methods; end + + private + + # The methods +method_missing+ and +respond_to?+ of this module are + # invoked often in a typical rails, both of which invoke the method + # +matched_attribute_method+. The latter method iterates through an + # array doing regular expression matches, which results in a lot of + # object creations. Most of the time it returns a +nil+ match. As the + # match result is always the same given a +method_name+, this cache is + # used to alleviate the GC, which ultimately also speeds up the app + # significantly (in our case our test suite finishes 10% faster with + # this cache). + # + # source://activemodel//lib/active_model/attribute_methods.rb#417 + def attribute_method_patterns_cache; end + + # source://activemodel//lib/active_model/attribute_methods.rb#421 + def attribute_method_patterns_matching(method_name); end + + # source://activemodel//lib/active_model/attribute_methods.rb#445 + def build_mangled_name(name); end + + # source://activemodel//lib/active_model/attribute_methods.rb#455 + def define_call(code_generator, name, target_name, mangled_name, parameters, call_args, namespace:, as:); end + + # Define a method `name` in `mod` that dispatches to `send` + # using the given `extra` args. This falls back on `send` + # if the called name cannot be compiled. + # + # source://activemodel//lib/active_model/attribute_methods.rb#430 + def define_proxy_call(code_generator, name, proxy_target, parameters, *call_args, namespace:, as: T.unsafe(nil)); end + + # source://activemodel//lib/active_model/attribute_methods.rb#400 + def generated_attribute_methods; end + + # source://activemodel//lib/active_model/attribute_methods.rb#387 + def inherited(base); end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/attribute_methods.rb#404 + def instance_method_already_implemented?(method_name); end + + # source://activemodel//lib/active_model/attribute_methods.rb#396 + def resolve_attribute_name(name); end +end + +# source://activemodel//lib/active_model/attribute_methods.rb#471 +class ActiveModel::AttributeMethods::ClassMethods::AttributeMethodPattern + # @return [AttributeMethodPattern] a new instance of AttributeMethodPattern + # + # source://activemodel//lib/active_model/attribute_methods.rb#476 + def initialize(prefix: T.unsafe(nil), suffix: T.unsafe(nil), parameters: T.unsafe(nil)); end + + # source://activemodel//lib/active_model/attribute_methods.rb#485 + def match(method_name); end + + # source://activemodel//lib/active_model/attribute_methods.rb#491 + def method_name(attr_name); end + + # Returns the value of attribute parameters. + # + # source://activemodel//lib/active_model/attribute_methods.rb#472 + def parameters; end + + # Returns the value of attribute prefix. + # + # source://activemodel//lib/active_model/attribute_methods.rb#472 + def prefix; end + + # Returns the value of attribute proxy_target. + # + # source://activemodel//lib/active_model/attribute_methods.rb#472 + def proxy_target; end + + # Returns the value of attribute suffix. + # + # source://activemodel//lib/active_model/attribute_methods.rb#472 + def suffix; end +end + +# source://activemodel//lib/active_model/attribute_methods.rb#474 +class ActiveModel::AttributeMethods::ClassMethods::AttributeMethodPattern::AttributeMethod < ::Struct + # Returns the value of attribute attr_name + # + # @return [Object] the current value of attr_name + # + # source://activemodel//lib/active_model/attribute_methods.rb#474 + def attr_name; end + + # Sets the attribute attr_name + # + # @param value [Object] the value to set the attribute attr_name to. + # @return [Object] the newly set value + # + # source://activemodel//lib/active_model/attribute_methods.rb#474 + def attr_name=(_); end + + # Returns the value of attribute proxy_target + # + # @return [Object] the current value of proxy_target + # + # source://activemodel//lib/active_model/attribute_methods.rb#474 + def proxy_target; end + + # Sets the attribute proxy_target + # + # @param value [Object] the value to set the attribute proxy_target to. + # @return [Object] the newly set value + # + # source://activemodel//lib/active_model/attribute_methods.rb#474 + def proxy_target=(_); end + + class << self + # source://activemodel//lib/active_model/attribute_methods.rb#474 + def [](*_arg0); end + + # source://activemodel//lib/active_model/attribute_methods.rb#474 + def inspect; end + + # source://activemodel//lib/active_model/attribute_methods.rb#474 + def keyword_init?; end + + # source://activemodel//lib/active_model/attribute_methods.rb#474 + def members; end + + # source://activemodel//lib/active_model/attribute_methods.rb#474 + def new(*_arg0); end + end +end + +# source://activemodel//lib/active_model/attribute_methods.rb#67 +ActiveModel::AttributeMethods::NAME_COMPILABLE_REGEXP = T.let(T.unsafe(nil), Regexp) + +# source://activemodel//lib/active_model/attribute_mutation_tracker.rb#7 +class ActiveModel::AttributeMutationTracker + # @return [AttributeMutationTracker] a new instance of AttributeMutationTracker + # + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#10 + def initialize(attributes); end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#40 + def any_changes?; end + + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#34 + def change_to_attribute(attr_name); end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#44 + def changed?(attr_name, from: T.unsafe(nil), to: T.unsafe(nil)); end + + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#14 + def changed_attribute_names; end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#50 + def changed_in_place?(attr_name); end + + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#18 + def changed_values; end + + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#26 + def changes; end + + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#63 + def force_change(attr_name); end + + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#54 + def forget_change(attr_name); end + + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#59 + def original_value(attr_name); end + + private + + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#74 + def attr_names; end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#78 + def attribute_changed?(attr_name); end + + # Returns the value of attribute attributes. + # + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#68 + def attributes; end + + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#82 + def fetch_value(attr_name); end + + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#70 + def forced_changes; end + + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#86 + def type_cast(attr_name, value); end +end + +# source://activemodel//lib/active_model/attribute_mutation_tracker.rb#8 +ActiveModel::AttributeMutationTracker::OPTION_NOT_GIVEN = T.let(T.unsafe(nil), Object) + +# source://activemodel//lib/active_model/attribute_registration.rb#8 +module ActiveModel::AttributeRegistration + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveModel::AttributeRegistration::ClassMethods +end + +# source://activemodel//lib/active_model/attribute_registration.rb#11 +module ActiveModel::AttributeRegistration::ClassMethods + # source://activemodel//lib/active_model/attribute_registration.rb#31 + def _default_attributes; end + + # source://activemodel//lib/active_model/attribute_registration.rb#12 + def attribute(name, type = T.unsafe(nil), default: T.unsafe(nil), **options); end + + # source://activemodel//lib/active_model/attribute_registration.rb#37 + def attribute_types; end + + # source://activemodel//lib/active_model/attribute_registration.rb#23 + def decorate_attributes(names = T.unsafe(nil), &decorator); end + + # source://activemodel//lib/active_model/attribute_registration.rb#43 + def type_for_attribute(attribute_name, &block); end + + private + + # source://activemodel//lib/active_model/attribute_registration.rb#81 + def apply_pending_attribute_modifications(attribute_set); end + + # Hook for other modules to override. The attribute type is passed + # through this method immediately after it is resolved, before any type + # decorations are applied. + # + # source://activemodel//lib/active_model/attribute_registration.rb#112 + def hook_attribute_type(attribute, type); end + + # source://activemodel//lib/active_model/attribute_registration.rb#77 + def pending_attribute_modifications; end + + # source://activemodel//lib/active_model/attribute_registration.rb#91 + def reset_default_attributes; end + + # source://activemodel//lib/active_model/attribute_registration.rb#96 + def reset_default_attributes!; end + + # source://activemodel//lib/active_model/attribute_registration.rb#101 + def resolve_attribute_name(name); end + + # source://activemodel//lib/active_model/attribute_registration.rb#105 + def resolve_type_name(name, **options); end +end + +# source://activemodel//lib/active_model/attribute_registration.rb#67 +class ActiveModel::AttributeRegistration::ClassMethods::PendingDecorator < ::Struct + # source://activemodel//lib/active_model/attribute_registration.rb#68 + def apply_to(attribute_set); end + + # Returns the value of attribute decorator + # + # @return [Object] the current value of decorator + # + # source://activemodel//lib/active_model/attribute_registration.rb#67 + def decorator; end + + # Sets the attribute decorator + # + # @param value [Object] the value to set the attribute decorator to. + # @return [Object] the newly set value + # + # source://activemodel//lib/active_model/attribute_registration.rb#67 + def decorator=(_); end + + # Returns the value of attribute names + # + # @return [Object] the current value of names + # + # source://activemodel//lib/active_model/attribute_registration.rb#67 + def names; end + + # Sets the attribute names + # + # @param value [Object] the value to set the attribute names to. + # @return [Object] the newly set value + # + # source://activemodel//lib/active_model/attribute_registration.rb#67 + def names=(_); end + + class << self + # source://activemodel//lib/active_model/attribute_registration.rb#67 + def [](*_arg0); end + + # source://activemodel//lib/active_model/attribute_registration.rb#67 + def inspect; end + + # source://activemodel//lib/active_model/attribute_registration.rb#67 + def keyword_init?; end + + # source://activemodel//lib/active_model/attribute_registration.rb#67 + def members; end + + # source://activemodel//lib/active_model/attribute_registration.rb#67 + def new(*_arg0); end + end +end + +# source://activemodel//lib/active_model/attribute_registration.rb#61 +class ActiveModel::AttributeRegistration::ClassMethods::PendingDefault < ::Struct + # source://activemodel//lib/active_model/attribute_registration.rb#62 + def apply_to(attribute_set); end + + # Returns the value of attribute default + # + # @return [Object] the current value of default + # + # source://activemodel//lib/active_model/attribute_registration.rb#61 + def default; end + + # Sets the attribute default + # + # @param value [Object] the value to set the attribute default to. + # @return [Object] the newly set value + # + # source://activemodel//lib/active_model/attribute_registration.rb#61 + def default=(_); end + + # Returns the value of attribute name + # + # @return [Object] the current value of name + # + # source://activemodel//lib/active_model/attribute_registration.rb#61 + def name; end + + # Sets the attribute name + # + # @param value [Object] the value to set the attribute name to. + # @return [Object] the newly set value + # + # source://activemodel//lib/active_model/attribute_registration.rb#61 + def name=(_); end + + class << self + # source://activemodel//lib/active_model/attribute_registration.rb#61 + def [](*_arg0); end + + # source://activemodel//lib/active_model/attribute_registration.rb#61 + def inspect; end + + # source://activemodel//lib/active_model/attribute_registration.rb#61 + def keyword_init?; end + + # source://activemodel//lib/active_model/attribute_registration.rb#61 + def members; end + + # source://activemodel//lib/active_model/attribute_registration.rb#61 + def new(*_arg0); end + end +end + +# source://activemodel//lib/active_model/attribute_registration.rb#54 +class ActiveModel::AttributeRegistration::ClassMethods::PendingType < ::Struct + # source://activemodel//lib/active_model/attribute_registration.rb#55 + def apply_to(attribute_set); end + + # Returns the value of attribute name + # + # @return [Object] the current value of name + # + # source://activemodel//lib/active_model/attribute_registration.rb#54 + def name; end + + # Sets the attribute name + # + # @param value [Object] the value to set the attribute name to. + # @return [Object] the newly set value + # + # source://activemodel//lib/active_model/attribute_registration.rb#54 + def name=(_); end + + # Returns the value of attribute type + # + # @return [Object] the current value of type + # + # source://activemodel//lib/active_model/attribute_registration.rb#54 + def type; end + + # Sets the attribute type + # + # @param value [Object] the value to set the attribute type to. + # @return [Object] the newly set value + # + # source://activemodel//lib/active_model/attribute_registration.rb#54 + def type=(_); end + + class << self + # source://activemodel//lib/active_model/attribute_registration.rb#54 + def [](*_arg0); end + + # source://activemodel//lib/active_model/attribute_registration.rb#54 + def inspect; end + + # source://activemodel//lib/active_model/attribute_registration.rb#54 + def keyword_init?; end + + # source://activemodel//lib/active_model/attribute_registration.rb#54 + def members; end + + # source://activemodel//lib/active_model/attribute_registration.rb#54 + def new(*_arg0); end + end +end + +# source://activemodel//lib/active_model/attribute_set/builder.rb#6 +class ActiveModel::AttributeSet + # @return [AttributeSet] a new instance of AttributeSet + # + # source://activemodel//lib/active_model/attribute_set.rb#12 + def initialize(attributes); end + + # source://activemodel//lib/active_model/attribute_set.rb#106 + def ==(other); end + + # source://activemodel//lib/active_model/attribute_set.rb#16 + def [](name); end + + # source://activemodel//lib/active_model/attribute_set.rb#20 + def []=(name, value); end + + # source://activemodel//lib/active_model/attribute_set.rb#93 + def accessed; end + + # source://activemodel//lib/active_model/attribute_set.rb#24 + def cast_types; end + + # source://activemodel//lib/active_model/attribute_set.rb#73 + def deep_dup; end + + # source://activemodel//lib/active_model/attribute_set.rb#10 + def each_value(*_arg0, **_arg1, &_arg2); end + + # source://activemodel//lib/active_model/attribute_set.rb#10 + def except(*_arg0, **_arg1, &_arg2); end + + # source://activemodel//lib/active_model/attribute_set.rb#10 + def fetch(*_arg0, **_arg1, &_arg2); end + + # source://activemodel//lib/active_model/attribute_set.rb#50 + def fetch_value(name, &block); end + + # source://activemodel//lib/active_model/attribute_set.rb#68 + def freeze; end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/attribute_set.rb#44 + def include?(name); end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/attribute_set.rb#41 + def key?(name); end + + # source://activemodel//lib/active_model/attribute_set.rb#46 + def keys; end + + # source://activemodel//lib/active_model/attribute_set.rb#97 + def map(&block); end + + # source://activemodel//lib/active_model/attribute_set.rb#87 + def reset(key); end + + # source://activemodel//lib/active_model/attribute_set.rb#102 + def reverse_merge!(target_attributes); end + + # source://activemodel//lib/active_model/attribute_set.rb#39 + def to_h; end + + # source://activemodel//lib/active_model/attribute_set.rb#36 + def to_hash; end + + # source://activemodel//lib/active_model/attribute_set.rb#28 + def values_before_type_cast; end + + # source://activemodel//lib/active_model/attribute_set.rb#32 + def values_for_database; end + + # source://activemodel//lib/active_model/attribute_set.rb#64 + def write_cast_value(name, value); end + + # source://activemodel//lib/active_model/attribute_set.rb#54 + def write_from_database(name, value); end + + # @raise [FrozenError] + # + # source://activemodel//lib/active_model/attribute_set.rb#58 + def write_from_user(name, value); end + + protected + + # Returns the value of attribute attributes. + # + # source://activemodel//lib/active_model/attribute_set.rb#111 + def attributes; end + + private + + # source://activemodel//lib/active_model/attribute_set.rb#114 + def default_attribute(name); end + + # source://activemodel//lib/active_model/attribute_set.rb#82 + def initialize_clone(_); end + + # source://activemodel//lib/active_model/attribute_set.rb#77 + def initialize_dup(_); end +end + +# source://activemodel//lib/active_model/attribute_set/builder.rb#7 +class ActiveModel::AttributeSet::Builder + # @return [Builder] a new instance of Builder + # + # source://activemodel//lib/active_model/attribute_set/builder.rb#10 + def initialize(types, default_attributes = T.unsafe(nil)); end + + # source://activemodel//lib/active_model/attribute_set/builder.rb#15 + def build_from_database(values = T.unsafe(nil), additional_types = T.unsafe(nil)); end + + # Returns the value of attribute default_attributes. + # + # source://activemodel//lib/active_model/attribute_set/builder.rb#8 + def default_attributes; end + + # Returns the value of attribute types. + # + # source://activemodel//lib/active_model/attribute_set/builder.rb#8 + def types; end +end + +# Attempts to do more intelligent YAML dumping of an +# ActiveModel::AttributeSet to reduce the size of the resulting string +# +# source://activemodel//lib/active_model/attribute_set/yaml_encoder.rb#7 +class ActiveModel::AttributeSet::YAMLEncoder + # @return [YAMLEncoder] a new instance of YAMLEncoder + # + # source://activemodel//lib/active_model/attribute_set/yaml_encoder.rb#8 + def initialize(default_types); end + + # source://activemodel//lib/active_model/attribute_set/yaml_encoder.rb#22 + def decode(coder); end + + # source://activemodel//lib/active_model/attribute_set/yaml_encoder.rb#12 + def encode(attribute_set, coder); end + + private + + # Returns the value of attribute default_types. + # + # source://activemodel//lib/active_model/attribute_set/yaml_encoder.rb#37 + def default_types; end +end + +# = Active \Model \Attributes +# +# The Attributes module allows models to define attributes beyond simple Ruby +# readers and writers. Similar to Active Record attributes, which are +# typically inferred from the database schema, Active Model Attributes are +# aware of data types, can have default values, and can handle casting and +# serialization. +# +# To use Attributes, include the module in your model class and define your +# attributes using the +attribute+ macro. It accepts a name, a type, a default +# value, and any other options supported by the attribute type. +# +# ==== Examples +# +# class Person +# include ActiveModel::Attributes +# +# attribute :name, :string +# attribute :active, :boolean, default: true +# end +# +# person = Person.new +# person.name = "Volmer" +# +# person.name # => "Volmer" +# person.active # => true +# +# source://activemodel//lib/active_model/attributes.rb#30 +module ActiveModel::Attributes + extend ::ActiveSupport::Concern + extend ::ActiveSupport::Autoload + include GeneratedInstanceMethods + include ::ActiveModel::AttributeRegistration + include ::ActiveModel::AttributeMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveModel::AttributeRegistration::ClassMethods + mixes_in_class_methods ::ActiveModel::AttributeMethods::ClassMethods + mixes_in_class_methods ::ActiveModel::Attributes::ClassMethods + + # source://activemodel//lib/active_model/attributes.rb#106 + def initialize(*_arg0); end + + # Returns an array of attribute names as strings. + # + # class Person + # include ActiveModel::Attributes + # + # attribute :name, :string + # attribute :age, :integer + # end + # + # person = Person.new + # person.attribute_names # => ["name", "age"] + # + # source://activemodel//lib/active_model/attributes.rb#146 + def attribute_names; end + + # Returns a hash of all the attributes with their names as keys and the + # values of the attributes as values. + # + # class Person + # include ActiveModel::Attributes + # + # attribute :name, :string + # attribute :age, :integer + # end + # + # person = Person.new + # person.name = "Francesco" + # person.age = 22 + # + # person.attributes # => { "name" => "Francesco", "age" => 22} + # + # source://activemodel//lib/active_model/attributes.rb#131 + def attributes; end + + # source://activemodel//lib/active_model/attributes.rb#150 + def freeze; end + + private + + # source://activemodel//lib/active_model/attributes.rb#156 + def _write_attribute(attr_name, value); end + + # source://activemodel//lib/active_model/attributes.rb#161 + def attribute(attr_name); end + + # source://activemodel//lib/active_model/attributes.rb#159 + def attribute=(attr_name, value); end + + # source://activemodel//lib/active_model/attributes.rb#111 + def initialize_dup(other); end + + module GeneratedClassMethods + def attribute_aliases; end + def attribute_aliases=(value); end + def attribute_aliases?; end + def attribute_method_patterns; end + def attribute_method_patterns=(value); end + def attribute_method_patterns?; end + end + + module GeneratedInstanceMethods + def attribute_aliases; end + def attribute_aliases?; end + def attribute_method_patterns; end + def attribute_method_patterns?; end + end +end + +# source://activemodel//lib/active_model/attributes.rb#39 +module ActiveModel::Attributes::ClassMethods + # :call-seq: attribute(name, cast_type = nil, default: nil, **options) + # + # Defines a model attribute. In addition to the attribute name, a cast + # type and default value may be specified, as well as any options + # supported by the given cast type. + # + # class Person + # include ActiveModel::Attributes + # + # attribute :name, :string + # attribute :active, :boolean, default: true + # end + # + # person = Person.new + # person.name = "Volmer" + # + # person.name # => "Volmer" + # person.active # => true + # + # source://activemodel//lib/active_model/attributes.rb#59 + def attribute(name, *_arg1, **_arg2, &_arg3); end + + # Returns an array of attribute names as strings. + # + # class Person + # include ActiveModel::Attributes + # + # attribute :name, :string + # attribute :age, :integer + # end + # + # Person.attribute_names # => ["name", "age"] + # + # source://activemodel//lib/active_model/attributes.rb#74 + def attribute_names; end + + private + + # source://activemodel//lib/active_model/attributes.rb#92 + def define_method_attribute=(canonical_name, owner:, as: T.unsafe(nil)); end +end + +# source://activemodel//lib/active_model/attributes/normalization.rb#5 +module ActiveModel::Attributes::Normalization + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActiveModel::AttributeMethods + include ::ActiveModel::Dirty + include ::ActiveSupport::Callbacks + include ::ActiveModel::Validations::Callbacks + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveModel::Attributes::Normalization::ClassMethods + mixes_in_class_methods ::ActiveModel::AttributeMethods::ClassMethods + mixes_in_class_methods ::ActiveModel::Validations::Callbacks::ClassMethods + mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods + mixes_in_class_methods ::ActiveSupport::DescendantsTracker + + # Normalizes a specified attribute using its declared normalizations. + # + # ==== Examples + # + # class User + # include ActiveModel::Attributes + # include ActiveModel::Attributes::Normalization + # + # attribute :email, :string + # + # normalizes :email, with: -> email { email.strip.downcase } + # end + # + # legacy_user = User.load_from_legacy_data(...) + # legacy_user.email # => " CRUISE-CONTROL@EXAMPLE.COM\n" + # legacy_user.normalize_attribute(:email) + # legacy_user.email # => "cruise-control@example.com" + # + # ==== Behavior with Active Record + # + # To prevent confusion, normalization will not be applied + # when the attribute is fetched from the database. This means that if a + # record was persisted before the normalization was declared, the record's + # attribute will not be normalized until either it is assigned a new + # value, or it is explicitly migrated via Normalization#normalize_attribute. + # + # Be aware that if your app was created before Rails 7.1, and your app + # marshals instances of the targeted model (for example, when caching), + # then you should set ActiveRecord.marshalling_format_version to +7.1+ or + # higher via either config.load_defaults 7.1 or + # config.active_record.marshalling_format_version = 7.1. + # Otherwise, +Marshal+ may attempt to serialize the normalization +Proc+ + # and raise +TypeError+. + # + # class User < ActiveRecord::Base + # normalizes :email, with: -> email { email.strip.downcase } + # normalizes :phone, with: -> phone { phone.delete("^0-9").delete_prefix("1") } + # end + # + # user = User.create(email: " CRUISE-CONTROL@EXAMPLE.COM\n") + # user.email # => "cruise-control@example.com" + # + # user = User.find_by(email: "\tCRUISE-CONTROL@EXAMPLE.COM ") + # user.email # => "cruise-control@example.com" + # user.email_before_type_cast # => "cruise-control@example.com" + # + # User.where(email: "\tCRUISE-CONTROL@EXAMPLE.COM ").count # => 1 + # User.where(["email = ?", "\tCRUISE-CONTROL@EXAMPLE.COM "]).count # => 0 + # + # User.exists?(email: "\tCRUISE-CONTROL@EXAMPLE.COM ") # => true + # User.exists?(["email = ?", "\tCRUISE-CONTROL@EXAMPLE.COM "]) # => false + # + # User.normalize_value_for(:phone, "+1 (555) 867-5309") # => "5558675309" + # + # source://activemodel//lib/active_model/attributes/normalization.rb#70 + def normalize_attribute(name); end + + private + + # source://activemodel//lib/active_model/attributes/normalization.rb#140 + def normalize_changed_in_place_attributes; end + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + def attribute_aliases; end + def attribute_aliases=(value); end + def attribute_aliases?; end + def attribute_method_patterns; end + def attribute_method_patterns=(value); end + def attribute_method_patterns?; end + def normalized_attributes; end + def normalized_attributes=(value); end + def normalized_attributes?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + def attribute_aliases; end + def attribute_aliases?; end + def attribute_method_patterns; end + def attribute_method_patterns?; end + def normalized_attributes; end + def normalized_attributes=(value); end + def normalized_attributes?; end + end +end + +# source://activemodel//lib/active_model/attributes/normalization.rb#75 +module ActiveModel::Attributes::Normalization::ClassMethods + # Normalizes a given +value+ using normalizations declared for +name+. + # + # ==== Examples + # + # class User + # include ActiveModel::Attributes + # include ActiveModel::Attributes::Normalization + # + # attribute :email, :string + # + # normalizes :email, with: -> email { email.strip.downcase } + # end + # + # User.normalize_value_for(:email, " CRUISE-CONTROL@EXAMPLE.COM\n") + # # => "cruise-control@example.com" + # + # source://activemodel//lib/active_model/attributes/normalization.rb#134 + def normalize_value_for(name, value); end + + # Declares a normalization for one or more attributes. The normalization + # is applied when the attribute is assigned or validated. + # + # Because the normalization may be applied multiple times, it should be + # _idempotent_. In other words, applying the normalization more than once + # should have the same result as applying it only once. + # + # By default, the normalization will not be applied to +nil+ values. This + # behavior can be changed with the +:apply_to_nil+ option. + # + # ==== Options + # + # * +:with+ - Any callable object that accepts the attribute's value as + # its sole argument, and returns it normalized. + # * +:apply_to_nil+ - Whether to apply the normalization to +nil+ values. + # Defaults to +false+. + # + # ==== Examples + # + # class User + # include ActiveModel::Attributes + # include ActiveModel::Attributes::Normalization + # + # attribute :email, :string + # attribute :phone, :string + # + # normalizes :email, with: -> email { email.strip.downcase } + # normalizes :phone, with: -> phone { phone.delete("^0-9").delete_prefix("1") } + # end + # + # user = User.new + # user.email = " CRUISE-CONTROL@EXAMPLE.COM\n" + # user.email # => "cruise-control@example.com" + # + # User.normalize_value_for(:phone, "+1 (555) 867-5309") # => "5558675309" + # + # source://activemodel//lib/active_model/attributes/normalization.rb#111 + def normalizes(*names, with:, apply_to_nil: T.unsafe(nil)); end +end + +# source://activemodel//lib/active_model/attributes/normalization.rb#146 +class ActiveModel::Attributes::Normalization::NormalizedValueType + include ::ActiveModel::Type::SerializeCastValue + extend ::ActiveModel::Type::SerializeCastValue::ClassMethods + + # @return [NormalizedValueType] a new instance of NormalizedValueType + # + # source://activemodel//lib/active_model/attributes/normalization.rb#152 + def initialize(cast_type:, normalizer:, normalize_nil:); end + + # source://activemodel//lib/active_model/attributes/normalization.rb#171 + def ==(other); end + + # source://activemodel//lib/active_model/attributes/normalization.rb#159 + def cast(value); end + + # Returns the value of attribute cast_type. + # + # source://activemodel//lib/active_model/attributes/normalization.rb#149 + def cast_type; end + + # source://activemodel//lib/active_model/attributes/normalization.rb#177 + def eql?(other); end + + # source://activemodel//lib/active_model/attributes/normalization.rb#179 + def hash; end + + # source://activemodel//lib/active_model/attributes/normalization.rb#183 + def inspect; end + + # Returns the value of attribute normalize_nil. + # + # source://activemodel//lib/active_model/attributes/normalization.rb#149 + def normalize_nil; end + + # Returns the value of attribute normalize_nil. + # + # source://activemodel//lib/active_model/attributes/normalization.rb#150 + def normalize_nil?; end + + # Returns the value of attribute normalizer. + # + # source://activemodel//lib/active_model/attributes/normalization.rb#149 + def normalizer; end + + # source://activemodel//lib/active_model/attributes/normalization.rb#163 + def serialize(value); end + + # source://activemodel//lib/active_model/attributes/normalization.rb#167 + def serialize_cast_value(value); end + + private + + # source://activemodel//lib/active_model/attributes/normalization.rb#186 + def normalize(value); end +end + +# +BlockValidator+ is a special +EachValidator+ which receives a block on initialization +# and call this block for each attribute being validated. +validates_each+ uses this validator. +# +# source://activemodel//lib/active_model/validator.rb#179 +class ActiveModel::BlockValidator < ::ActiveModel::EachValidator + # @return [BlockValidator] a new instance of BlockValidator + # + # source://activemodel//lib/active_model/validator.rb#180 + def initialize(options, &block); end + + private + + # source://activemodel//lib/active_model/validator.rb#186 + def validate_each(record, attribute, value); end +end + +# = Active \Model \Callbacks +# +# Provides an interface for any class to have Active Record like callbacks. +# +# Like the Active Record methods, the callback chain is aborted as soon as +# one of the methods throws +:abort+. +# +# First, extend +ActiveModel::Callbacks+ from the class you are creating: +# +# class MyModel +# extend ActiveModel::Callbacks +# end +# +# Then define a list of methods that you want callbacks attached to: +# +# define_model_callbacks :create, :update +# +# This will provide all three standard callbacks (before, around and after) +# for both the :create and :update methods. To implement, +# you need to wrap the methods you want callbacks on in a block so that the +# callbacks get a chance to fire: +# +# def create +# run_callbacks :create do +# # Your create action methods here +# end +# end +# +# Then in your class, you can use the +before_create+, +after_create+, and +# +around_create+ methods, just as you would in an Active Record model. +# +# before_create :action_before_create +# +# def action_before_create +# # Your code here +# end +# +# When defining an around callback remember to yield to the block, otherwise +# it won't be executed: +# +# around_create :log_status +# +# def log_status +# puts 'going to call the block...' +# yield +# puts 'block successfully called.' +# end +# +# You can choose to have only specific callbacks by passing a hash to the +# +define_model_callbacks+ method. +# +# define_model_callbacks :create, only: [:after, :before] +# +# Would only create the +after_create+ and +before_create+ callback methods in +# your class. +# +# NOTE: Defining the same callback multiple times will overwrite previous callback definitions. +# +# source://activemodel//lib/active_model/callbacks.rb#65 +module ActiveModel::Callbacks + # +define_model_callbacks+ accepts the same options +define_callbacks+ does, + # in case you want to overwrite a default. Besides that, it also accepts an + # :only option, where you can choose if you want all types (before, + # around or after) or just some. + # + # define_model_callbacks :initialize, only: :after + # + # Note, the only: hash will apply to all callbacks defined + # on that method call. To get around this you can call the +define_model_callbacks+ + # method as many times as you need. + # + # define_model_callbacks :create, only: :after + # define_model_callbacks :update, only: :before + # define_model_callbacks :destroy, only: :around + # + # Would create +after_create+, +before_update+, and +around_destroy+ methods + # only. + # + # You can pass in a class to before_, after_ and around_, + # in which case the callback will call that class's _ method + # passing the object that the callback is being called on. + # + # class MyModel + # extend ActiveModel::Callbacks + # define_model_callbacks :create + # + # before_create AnotherClass + # end + # + # class AnotherClass + # def self.before_create( obj ) + # # obj is the MyModel instance that the callback is being called on + # end + # end + # + # NOTE: +method_name+ passed to +define_model_callbacks+ must not end with + # !, ? or =. + # + # source://activemodel//lib/active_model/callbacks.rb#109 + def define_model_callbacks(*callbacks); end + + private + + # source://activemodel//lib/active_model/callbacks.rb#143 + def _define_after_model_callback(klass, callback); end + + # source://activemodel//lib/active_model/callbacks.rb#136 + def _define_around_model_callback(klass, callback); end + + # source://activemodel//lib/active_model/callbacks.rb#129 + def _define_before_model_callback(klass, callback); end + + class << self + # source://activemodel//lib/active_model/callbacks.rb#66 + def extended(base); end + end +end + +# = Active \Model \Conversion +# +# Handles default conversions: #to_model, #to_key, #to_param, and #to_partial_path. +# +# Let's take for example this non-persisted object. +# +# class ContactMessage +# include ActiveModel::Conversion +# +# # ContactMessage are never persisted in the DB +# def persisted? +# false +# end +# end +# +# cm = ContactMessage.new +# cm.to_model == cm # => true +# cm.to_key # => nil +# cm.to_param # => nil +# cm.to_partial_path # => "contact_messages/contact_message" +# +# source://activemodel//lib/active_model/conversion.rb#24 +module ActiveModel::Conversion + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveModel::Conversion::ClassMethods + + # Returns an Array of all key attributes if any of the attributes is set, whether or not + # the object is persisted. Returns +nil+ if there are no key attributes. + # + # class Person + # include ActiveModel::Conversion + # attr_accessor :id + # + # def initialize(id) + # @id = id + # end + # end + # + # person = Person.new(1) + # person.to_key # => [1] + # + # source://activemodel//lib/active_model/conversion.rb#67 + def to_key; end + + # If your object is already designed to implement all of the \Active \Model + # you can use the default :to_model implementation, which simply + # returns +self+. + # + # class Person + # include ActiveModel::Conversion + # end + # + # person = Person.new + # person.to_model == person # => true + # + # If your model does not act like an \Active \Model object, then you should + # define :to_model yourself returning a proxy object that wraps + # your object with \Active \Model compliant methods. + # + # source://activemodel//lib/active_model/conversion.rb#49 + def to_model; end + + # Returns a +string+ representing the object's key suitable for use in URLs, + # or +nil+ if persisted? is +false+. + # + # class Person + # include ActiveModel::Conversion + # attr_accessor :id + # + # def initialize(id) + # @id = id + # end + # + # def persisted? + # true + # end + # end + # + # person = Person.new(1) + # person.to_param # => "1" + # + # source://activemodel//lib/active_model/conversion.rb#90 + def to_param; end + + # Returns a +string+ identifying the path associated with the object. + # ActionPack uses this to find a suitable partial to represent the object. + # + # class Person + # include ActiveModel::Conversion + # end + # + # person = Person.new + # person.to_partial_path # => "people/person" + # + # source://activemodel//lib/active_model/conversion.rb#103 + def to_partial_path; end + + module GeneratedClassMethods + def param_delimiter; end + def param_delimiter=(value); end + def param_delimiter?; end + end + + module GeneratedInstanceMethods + def param_delimiter=(value); end + end +end + +# source://activemodel//lib/active_model/conversion.rb#107 +module ActiveModel::Conversion::ClassMethods + # Provide a class level cache for #to_partial_path. This is an + # internal method and should not be accessed directly. + # + # source://activemodel//lib/active_model/conversion.rb#110 + def _to_partial_path; end +end + +# = Active \Model \Dirty +# +# Provides a way to track changes in your object in the same way as +# Active Record does. +# +# The requirements for implementing ActiveModel::Dirty are: +# +# * include ActiveModel::Dirty in your object. +# * Call define_attribute_methods passing each method you want to +# track. +# * Call *_will_change! before each change to the tracked attribute. +# * Call changes_applied after the changes are persisted. +# * Call clear_changes_information when you want to reset the changes +# information. +# * Call restore_attributes when you want to restore previous data. +# +# A minimal implementation could be: +# +# class Person +# include ActiveModel::Dirty +# +# define_attribute_methods :name +# +# def initialize +# @name = nil +# end +# +# def name +# @name +# end +# +# def name=(val) +# name_will_change! unless val == @name +# @name = val +# end +# +# def save +# # do persistence work +# +# changes_applied +# end +# +# def reload! +# # get the values from the persistence layer +# +# clear_changes_information +# end +# +# def rollback! +# restore_attributes +# end +# end +# +# A newly instantiated +Person+ object is unchanged: +# +# person = Person.new +# person.changed? # => false +# +# Change the name: +# +# person.name = 'Bob' +# person.changed? # => true +# person.name_changed? # => true +# person.name_changed?(from: nil, to: "Bob") # => true +# person.name_was # => nil +# person.name_change # => [nil, "Bob"] +# person.name = 'Bill' +# person.name_change # => [nil, "Bill"] +# +# Save the changes: +# +# person.save +# person.changed? # => false +# person.name_changed? # => false +# +# Reset the changes: +# +# person.previous_changes # => {"name" => [nil, "Bill"]} +# person.name_previously_changed? # => true +# person.name_previously_changed?(from: nil, to: "Bill") # => true +# person.name_previous_change # => [nil, "Bill"] +# person.name_previously_was # => nil +# person.reload! +# person.previous_changes # => {} +# +# Rollback the changes: +# +# person.name = "Uncle Bob" +# person.rollback! +# person.name # => "Bill" +# person.name_changed? # => false +# +# Assigning the same value leaves the attribute unchanged: +# +# person.name = 'Bill' +# person.name_changed? # => false +# person.name_change # => nil +# +# Which attributes have changed? +# +# person.name = 'Bob' +# person.changed # => ["name"] +# person.changes # => {"name" => ["Bill", "Bob"]} +# +# If an attribute is modified in-place then make use of +# {*_will_change!}[rdoc-ref:#*_will_change!] to mark that the attribute is changing. +# Otherwise \Active \Model can't track changes to in-place attributes. Note +# that Active Record can detect in-place modifications automatically. You do +# not need to call *_will_change! on Active Record models. +# +# person.name_will_change! +# person.name_change # => ["Bill", "Bill"] +# person.name << 'y' +# person.name_change # => ["Bill", "Billy"] +# +# Methods can be invoked as +name_changed?+ or by passing an argument to the +# generic method attribute_changed?("name"). +# +# source://activemodel//lib/active_model/dirty.rb#123 +module ActiveModel::Dirty + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActiveModel::AttributeMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveModel::AttributeMethods::ClassMethods + + # source://activemodel//lib/active_model/dirty.rb#264 + def as_json(options = T.unsafe(nil)); end + + # Dispatch target for {*_changed?}[rdoc-ref:#*_changed?] attribute methods. + # + # @return [Boolean] + # + # source://activemodel//lib/active_model/dirty.rb#300 + def attribute_changed?(attr_name, **options); end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/dirty.rb#367 + def attribute_changed_in_place?(attr_name); end + + # Dispatch target for {*_previously_changed?}[rdoc-ref:#*_previously_changed?] attribute methods. + # + # @return [Boolean] + # + # source://activemodel//lib/active_model/dirty.rb#310 + def attribute_previously_changed?(attr_name, **options); end + + # Dispatch target for {*_previously_was}[rdoc-ref:#*_previously_was] attribute methods. + # + # source://activemodel//lib/active_model/dirty.rb#315 + def attribute_previously_was(attr_name); end + + # Dispatch target for {*_was}[rdoc-ref:#*_was] attribute methods. + # + # source://activemodel//lib/active_model/dirty.rb#305 + def attribute_was(attr_name); end + + # Returns an array with the name of the attributes with unsaved changes. + # + # person.changed # => [] + # person.name = 'bob' + # person.changed # => ["name"] + # + # source://activemodel//lib/active_model/dirty.rb#295 + def changed; end + + # Returns +true+ if any of the attributes has unsaved changes, +false+ otherwise. + # + # person.changed? # => false + # person.name = 'bob' + # person.changed? # => true + # + # @return [Boolean] + # + # source://activemodel//lib/active_model/dirty.rb#286 + def changed?; end + + # Returns a hash of the attributes with unsaved changes indicating their original + # values like attr => original value. + # + # person.name # => "bob" + # person.name = 'robert' + # person.changed_attributes # => {"name" => "bob"} + # + # source://activemodel//lib/active_model/dirty.rb#343 + def changed_attributes; end + + # Returns a hash of changed attributes indicating their original + # and new values like attr => [original value, new value]. + # + # person.changes # => {} + # person.name = 'bob' + # person.changes # => { "name" => ["bill", "bob"] } + # + # source://activemodel//lib/active_model/dirty.rb#353 + def changes; end + + # Clears dirty data and moves +changes+ to +previous_changes+ and + # +mutations_from_database+ to +mutations_before_last_save+ respectively. + # + # source://activemodel//lib/active_model/dirty.rb#272 + def changes_applied; end + + # source://activemodel//lib/active_model/dirty.rb#331 + def clear_attribute_changes(attr_names); end + + # Clears all dirty data: current changes and previous changes. + # + # source://activemodel//lib/active_model/dirty.rb#325 + def clear_changes_information; end + + # source://activemodel//lib/active_model/dirty.rb#253 + def init_attributes(other); end + + # Returns a hash of attributes that were changed before the model was saved. + # + # person.name # => "bob" + # person.name = 'robert' + # person.save + # person.previous_changes # => {"name" => ["bob", "robert"]} + # + # source://activemodel//lib/active_model/dirty.rb#363 + def previous_changes; end + + # Restore all previous data of the provided attributes. + # + # source://activemodel//lib/active_model/dirty.rb#320 + def restore_attributes(attr_names = T.unsafe(nil)); end + + private + + # Dispatch target for *_change attribute methods. + # + # source://activemodel//lib/active_model/dirty.rb#399 + def attribute_change(attr_name); end + + # Dispatch target for *_previous_change attribute methods. + # + # source://activemodel//lib/active_model/dirty.rb#404 + def attribute_previous_change(attr_name); end + + # Dispatch target for *_will_change! attribute methods. + # + # source://activemodel//lib/active_model/dirty.rb#409 + def attribute_will_change!(attr_name); end + + # source://activemodel//lib/active_model/dirty.rb#378 + def clear_attribute_change(attr_name); end + + # source://activemodel//lib/active_model/dirty.rb#390 + def forget_attribute_assignments; end + + # source://activemodel//lib/active_model/dirty.rb#372 + def init_internals; end + + # source://activemodel//lib/active_model/dirty.rb#248 + def initialize_dup(other); end + + # source://activemodel//lib/active_model/dirty.rb#394 + def mutations_before_last_save; end + + # source://activemodel//lib/active_model/dirty.rb#382 + def mutations_from_database; end + + # Dispatch target for restore_*! attribute methods. + # + # source://activemodel//lib/active_model/dirty.rb#414 + def restore_attribute!(attr_name); end + + module GeneratedClassMethods + def attribute_aliases; end + def attribute_aliases=(value); end + def attribute_aliases?; end + def attribute_method_patterns; end + def attribute_method_patterns=(value); end + def attribute_method_patterns?; end + end + + module GeneratedInstanceMethods + def attribute_aliases; end + def attribute_aliases?; end + def attribute_method_patterns; end + def attribute_method_patterns?; end + end +end + +# = Active \Model \EachValidator +# +# +EachValidator+ is a validator which iterates through the attributes given +# in the options hash invoking the validate_each method passing in the +# record, attribute, and value. +# +# All \Active \Model validations are built on top of this validator. +# +# source://activemodel//lib/active_model/validator.rb#134 +class ActiveModel::EachValidator < ::ActiveModel::Validator + # Returns a new validator instance. All options will be available via the + # +options+ reader, however the :attributes option will be removed + # and instead be made available through the +attributes+ reader. + # + # @raise [ArgumentError] + # @return [EachValidator] a new instance of EachValidator + # + # source://activemodel//lib/active_model/validator.rb#140 + def initialize(options); end + + # Returns the value of attribute attributes. + # + # source://activemodel//lib/active_model/validator.rb#135 + def attributes; end + + # Hook method that gets called by the initializer allowing verification + # that the arguments supplied are valid. You could for example raise an + # +ArgumentError+ when invalid options are supplied. + # + # source://activemodel//lib/active_model/validator.rb#168 + def check_validity!; end + + # Performs validation on the supplied record. By default this will call + # +validate_each+ to determine validity therefore subclasses should + # override +validate_each+ with validation logic. + # + # source://activemodel//lib/active_model/validator.rb#150 + def validate(record); end + + # Override this method in subclasses with the validation logic, adding + # errors to the records +errors+ array where necessary. + # + # @raise [NotImplementedError] + # + # source://activemodel//lib/active_model/validator.rb#161 + def validate_each(record, attribute, value); end + + private + + # source://activemodel//lib/active_model/validator.rb#172 + def prepare_value_for_validation(value, record, attr_name); end +end + +# = Active \Model \Error +# +# Represents one single error +# +# source://activemodel//lib/active_model/error.rb#8 +class ActiveModel::Error + # @return [Error] a new instance of Error + # + # source://activemodel//lib/active_model/error.rb#102 + def initialize(base, attribute, type = T.unsafe(nil), **options); end + + # source://activemodel//lib/active_model/error.rb#189 + def ==(other); end + + # The attribute of +base+ which the error belongs to + # + # source://activemodel//lib/active_model/error.rb#120 + def attribute; end + + # The object which the error belongs to + # + # source://activemodel//lib/active_model/error.rb#118 + def base; end + + # Returns the error details. + # + # error = ActiveModel::Error.new(person, :name, :too_short, count: 5) + # error.details + # # => { error: :too_short, count: 5 } + # + # source://activemodel//lib/active_model/error.rb#151 + def detail; end + + # Returns the error details. + # + # error = ActiveModel::Error.new(person, :name, :too_short, count: 5) + # error.details + # # => { error: :too_short, count: 5 } + # + # source://activemodel//lib/active_model/error.rb#148 + def details; end + + # source://activemodel//lib/active_model/error.rb#192 + def eql?(other); end + + # Returns the full error message. + # + # error = ActiveModel::Error.new(person, :name, :too_short, count: 5) + # error.full_message + # # => "Name is too short (minimum is 5 characters)" + # + # source://activemodel//lib/active_model/error.rb#158 + def full_message; end + + # source://activemodel//lib/active_model/error.rb#194 + def hash; end + + # source://activemodel//lib/active_model/error.rb#12 + def i18n_customize_full_message; end + + # source://activemodel//lib/active_model/error.rb#12 + def i18n_customize_full_message=(_arg0); end + + # source://activemodel//lib/active_model/error.rb#12 + def i18n_customize_full_message?; end + + # source://activemodel//lib/active_model/error.rb#198 + def inspect; end + + # See if error matches provided +attribute+, +type+, and +options+. + # + # Omitted params are not checked for a match. + # + # @return [Boolean] + # + # source://activemodel//lib/active_model/error.rb#165 + def match?(attribute, type = T.unsafe(nil), **options); end + + # Returns the error message. + # + # error = ActiveModel::Error.new(person, :name, :too_short, count: 5) + # error.message + # # => "is too short (minimum is 5 characters)" + # + # source://activemodel//lib/active_model/error.rb#134 + def message; end + + # The options provided when calling errors#add + # + # source://activemodel//lib/active_model/error.rb#127 + def options; end + + # The raw value provided as the second parameter when calling + # errors#add + # + # source://activemodel//lib/active_model/error.rb#125 + def raw_type; end + + # See if error matches provided +attribute+, +type+, and +options+ exactly. + # + # All params must be equal to Error's own attributes to be considered a + # strict match. + # + # @return [Boolean] + # + # source://activemodel//lib/active_model/error.rb#183 + def strict_match?(attribute, type, **options); end + + # The type of error, defaults to +:invalid+ unless specified + # + # source://activemodel//lib/active_model/error.rb#122 + def type; end + + protected + + # source://activemodel//lib/active_model/error.rb#203 + def attributes_for_hash; end + + private + + # source://activemodel//lib/active_model/error.rb#110 + def initialize_dup(other); end + + class << self + # source://activemodel//lib/active_model/error.rb#14 + def full_message(attribute, message, base); end + + # source://activemodel//lib/active_model/error.rb#63 + def generate_message(attribute, type, base, options); end + + # source://activemodel//lib/active_model/error.rb#12 + def i18n_customize_full_message; end + + # source://activemodel//lib/active_model/error.rb#12 + def i18n_customize_full_message=(value); end + + # source://activemodel//lib/active_model/error.rb#12 + def i18n_customize_full_message?; end + + private + + # source://activemodel//lib/active_model/error.rb#12 + def __class_attr_i18n_customize_full_message; end + + # source://activemodel//lib/active_model/error.rb#12 + def __class_attr_i18n_customize_full_message=(new_value); end + end +end + +# source://activemodel//lib/active_model/error.rb#9 +ActiveModel::Error::CALLBACKS_OPTIONS = T.let(T.unsafe(nil), Array) + +# source://activemodel//lib/active_model/error.rb#10 +ActiveModel::Error::MESSAGE_OPTIONS = T.let(T.unsafe(nil), Array) + +# = Active \Model \Errors +# +# Provides error related functionalities you can include in your object +# for handling error messages and interacting with Action View helpers. +# +# A minimal implementation could be: +# +# class Person +# # Required dependency for ActiveModel::Errors +# extend ActiveModel::Naming +# +# def initialize +# @errors = ActiveModel::Errors.new(self) +# end +# +# attr_accessor :name +# attr_reader :errors +# +# def validate! +# errors.add(:name, :blank, message: "cannot be nil") if name.nil? +# end +# +# # The following methods are needed to be minimally implemented +# +# def read_attribute_for_validation(attr) +# send(attr) +# end +# +# def self.human_attribute_name(attr, options = {}) +# attr +# end +# +# def self.lookup_ancestors +# [self] +# end +# end +# +# The last three methods are required in your object for +Errors+ to be +# able to generate error messages correctly and also handle multiple +# languages. Of course, if you extend your object with ActiveModel::Translation +# you will not need to implement the last two. Likewise, using +# ActiveModel::Validations will handle the validation related methods +# for you. +# +# The above allows you to do: +# +# person = Person.new +# person.validate! # => ["cannot be nil"] +# person.errors.full_messages # => ["name cannot be nil"] +# # etc.. +# +# source://activemodel//lib/active_model/errors.rb#60 +class ActiveModel::Errors + include ::Enumerable + + # Pass in the instance of the object that is using the errors object. + # + # class Person + # def initialize + # @errors = ActiveModel::Errors.new(self) + # end + # end + # + # @return [Errors] a new instance of Errors + # + # source://activemodel//lib/active_model/errors.rb#114 + def initialize(base); end + + # When passed a symbol or a name of a method, returns an array of errors + # for the method. + # + # person.errors[:name] # => ["cannot be nil"] + # person.errors['name'] # => ["cannot be nil"] + # + # source://activemodel//lib/active_model/errors.rb#226 + def [](attribute); end + + # Adds a new error of +type+ on +attribute+. + # More than one error can be added to the same +attribute+. + # If no +type+ is supplied, :invalid is assumed. + # + # person.errors.add(:name) + # # Adds <#ActiveModel::Error attribute=name, type=invalid> + # person.errors.add(:name, :not_implemented, message: "must be implemented") + # # Adds <#ActiveModel::Error attribute=name, type=not_implemented, + # options={:message=>"must be implemented"}> + # + # person.errors.messages + # # => {:name=>["is invalid", "must be implemented"]} + # + # If +type+ is a string, it will be used as error message. + # + # If +type+ is a symbol, it will be translated using the appropriate + # scope (see +generate_message+). + # + # person.errors.add(:name, :blank) + # person.errors.messages + # # => {:name=>["can't be blank"]} + # + # person.errors.add(:name, :too_long, count: 25) + # person.errors.messages + # # => ["is too long (maximum is 25 characters)"] + # + # If +type+ is a proc, it will be called, allowing for things like + # Time.now to be used within an error. + # + # If the :strict option is set to +true+, it will raise + # ActiveModel::StrictValidationFailed instead of adding the error. + # :strict option can also be set to any other exception. + # + # person.errors.add(:name, :invalid, strict: true) + # # => ActiveModel::StrictValidationFailed: Name is invalid + # person.errors.add(:name, :invalid, strict: NameIsInvalid) + # # => NameIsInvalid: Name is invalid + # + # person.errors.messages # => {} + # + # +attribute+ should be set to :base if the error is not + # directly associated with a single attribute. + # + # person.errors.add(:base, :name_or_email_blank, + # message: "either name or email must be present") + # person.errors.messages + # # => {:base=>["either name or email must be present"]} + # person.errors.details + # # => {:base=>[{error: :name_or_email_blank}]} + # + # source://activemodel//lib/active_model/errors.rb#339 + def add(attribute, type = T.unsafe(nil), **options); end + + # Returns +true+ if an error matches provided +attribute+ and +type+, + # or +false+ otherwise. +type+ is treated the same as for +add+. + # + # person.errors.add :name, :blank + # person.errors.added? :name, :blank # => true + # person.errors.added? :name, "can't be blank" # => true + # + # If the error requires options, then it returns +true+ with + # the correct options, or +false+ with incorrect or missing options. + # + # person.errors.add :name, :too_long, count: 25 + # person.errors.added? :name, :too_long, count: 25 # => true + # person.errors.added? :name, "is too long (maximum is 25 characters)" # => true + # person.errors.added? :name, :too_long, count: 24 # => false + # person.errors.added? :name, :too_long # => false + # person.errors.added? :name, "is too long" # => false + # + # @return [Boolean] + # + # source://activemodel//lib/active_model/errors.rb#369 + def added?(attribute, type = T.unsafe(nil), options = T.unsafe(nil)); end + + # Returns a Hash that can be used as the JSON representation for this + # object. You can pass the :full_messages option. This determines + # if the JSON object should contain full messages or not (false by default). + # + # person.errors.as_json # => {:name=>["cannot be nil"]} + # person.errors.as_json(full_messages: true) # => {:name=>["name cannot be nil"]} + # + # source://activemodel//lib/active_model/errors.rb#244 + def as_json(options = T.unsafe(nil)); end + + # Returns all error attribute names + # + # person.errors.messages # => {:name=>["cannot be nil", "must be specified"]} + # person.errors.attribute_names # => [:name] + # + # source://activemodel//lib/active_model/errors.rb#234 + def attribute_names; end + + # source://activemodel//lib/active_model/errors.rb#100 + def clear(*_arg0, **_arg1, &_arg2); end + + # Copies the errors from other. + # For copying errors but keep @base as is. + # + # ==== Parameters + # + # * +other+ - The ActiveModel::Errors instance. + # + # ==== Examples + # + # person.errors.copy!(other) + # + # source://activemodel//lib/active_model/errors.rb#135 + def copy!(other); end + + # Delete messages for +key+. Returns the deleted messages. + # + # person.errors[:name] # => ["cannot be nil"] + # person.errors.delete(:name) # => ["cannot be nil"] + # person.errors[:name] # => [] + # + # source://activemodel//lib/active_model/errors.rb#212 + def delete(attribute, type = T.unsafe(nil), **options); end + + # Returns a Hash of attributes with an array of their error details. + # + # source://activemodel//lib/active_model/errors.rb#273 + def details; end + + # :method: size + # + # :call-seq: size + # + # Returns number of errors. + # + # source://activemodel//lib/active_model/errors.rb#100 + def each(*_arg0, **_arg1, &_arg2); end + + # source://activemodel//lib/active_model/errors.rb#100 + def empty?(*_arg0, **_arg1, &_arg2); end + + # The actual array of +Error+ objects + # This method is aliased to objects. + # + # source://activemodel//lib/active_model/errors.rb#104 + def errors; end + + # Returns a full message for a given attribute. + # + # person.errors.full_message(:name, 'is invalid') # => "Name is invalid" + # + # source://activemodel//lib/active_model/errors.rb#448 + def full_message(attribute, message); end + + # Returns all the full error messages in an array. + # + # class Person + # validates_presence_of :name, :address, :email + # validates_length_of :name, in: 5..30 + # end + # + # person = Person.create(address: '123 First St.') + # person.errors.full_messages + # # => ["Name is too short (minimum is 5 characters)", "Name can't be blank", "Email can't be blank"] + # + # source://activemodel//lib/active_model/errors.rb#412 + def full_messages; end + + # Returns all the full error messages for a given attribute in an array. + # + # class Person + # validates_presence_of :name, :email + # validates_length_of :name, in: 5..30 + # end + # + # person = Person.create() + # person.errors.full_messages_for(:name) + # # => ["Name is too short (minimum is 5 characters)", "Name can't be blank"] + # + # source://activemodel//lib/active_model/errors.rb#427 + def full_messages_for(attribute); end + + # Translates an error message in its default scope + # (activemodel.errors.messages). + # + # Error messages are first looked up in activemodel.errors.models.MODEL.attributes.ATTRIBUTE.MESSAGE, + # if it's not there, it's looked up in activemodel.errors.models.MODEL.MESSAGE and if + # that is not there also, it returns the translation of the default message + # (e.g. activemodel.errors.messages.MESSAGE). The translated model + # name, translated attribute name, and the value are available for + # interpolation. + # + # When using inheritance in your models, it will check all the inherited + # models too, but only if the model itself hasn't been found. Say you have + # class Admin < User; end and you wanted the translation for + # the :blank error message for the title attribute, + # it looks for these translations: + # + # * activemodel.errors.models.admin.attributes.title.blank + # * activemodel.errors.models.admin.blank + # * activemodel.errors.models.user.attributes.title.blank + # * activemodel.errors.models.user.blank + # * any default you provided through the +options+ hash (in the activemodel.errors scope) + # * activemodel.errors.messages.blank + # * errors.attributes.title.blank + # * errors.messages.blank + # + # source://activemodel//lib/active_model/errors.rb#476 + def generate_message(attribute, type = T.unsafe(nil), options = T.unsafe(nil)); end + + # Returns a Hash of attributes with an array of their Error objects. + # + # person.errors.group_by_attribute + # # => {:name=>[<#ActiveModel::Error>, <#ActiveModel::Error>]} + # + # source://activemodel//lib/active_model/errors.rb#286 + def group_by_attribute; end + + # Returns +true+ if the error messages include an error for the given key + # +attribute+, +false+ otherwise. + # + # person.errors.messages # => {:name=>["cannot be nil"]} + # person.errors.include?(:name) # => true + # person.errors.include?(:age) # => false + # + # @return [Boolean] + # + # source://activemodel//lib/active_model/errors.rb#204 + def has_key?(attribute); end + + # Imports one error. + # Imported errors are wrapped as a NestedError, + # providing access to original error object. + # If attribute or type needs to be overridden, use +override_options+. + # + # ==== Options + # + # * +:attribute+ - Override the attribute the error belongs to. + # * +:type+ - Override type of the error. + # + # source://activemodel//lib/active_model/errors.rb#151 + def import(error, override_options = T.unsafe(nil)); end + + # Returns +true+ if the error messages include an error for the given key + # +attribute+, +false+ otherwise. + # + # person.errors.messages # => {:name=>["cannot be nil"]} + # person.errors.include?(:name) # => true + # person.errors.include?(:age) # => false + # + # @return [Boolean] + # + # source://activemodel//lib/active_model/errors.rb#199 + def include?(attribute); end + + # source://activemodel//lib/active_model/errors.rb#480 + def inspect; end + + # Returns +true+ if the error messages include an error for the given key + # +attribute+, +false+ otherwise. + # + # person.errors.messages # => {:name=>["cannot be nil"]} + # person.errors.include?(:name) # => true + # person.errors.include?(:age) # => false + # + # @return [Boolean] + # + # source://activemodel//lib/active_model/errors.rb#205 + def key?(attribute); end + + # Merges the errors from other, + # each Error wrapped as NestedError. + # + # ==== Parameters + # + # * +other+ - The ActiveModel::Errors instance. + # + # ==== Examples + # + # person.errors.merge!(other) + # + # source://activemodel//lib/active_model/errors.rb#171 + def merge!(other); end + + # Returns a Hash of attributes with an array of their error messages. + # + # source://activemodel//lib/active_model/errors.rb#265 + def messages; end + + # Returns all the error messages for a given attribute in an array. + # + # class Person + # validates_presence_of :name, :email + # validates_length_of :name, in: 5..30 + # end + # + # person = Person.create() + # person.errors.messages_for(:name) + # # => ["is too short (minimum is 5 characters)", "can't be blank"] + # + # source://activemodel//lib/active_model/errors.rb#441 + def messages_for(attribute); end + + # The actual array of +Error+ objects + # This method is aliased to objects. + # + # source://activemodel//lib/active_model/errors.rb#105 + def objects; end + + # Returns +true+ if an error on the attribute with the given type is + # present, or +false+ otherwise. +type+ is treated the same as for +add+. + # + # person.errors.add :age + # person.errors.add :name, :too_long, count: 25 + # person.errors.of_kind? :age # => true + # person.errors.of_kind? :name # => false + # person.errors.of_kind? :name, :too_long # => true + # person.errors.of_kind? :name, "is too long (maximum is 25 characters)" # => true + # person.errors.of_kind? :name, :not_too_long # => false + # person.errors.of_kind? :name, "is too long" # => false + # + # @return [Boolean] + # + # source://activemodel//lib/active_model/errors.rb#392 + def of_kind?(attribute, type = T.unsafe(nil)); end + + # source://activemodel//lib/active_model/errors.rb#100 + def size(*_arg0, **_arg1, &_arg2); end + + # Returns all the full error messages in an array. + # + # class Person + # validates_presence_of :name, :address, :email + # validates_length_of :name, in: 5..30 + # end + # + # person = Person.create(address: '123 First St.') + # person.errors.full_messages + # # => ["Name is too short (minimum is 5 characters)", "Name can't be blank", "Email can't be blank"] + # + # source://activemodel//lib/active_model/errors.rb#415 + def to_a; end + + # Returns a Hash of attributes with their error messages. If +full_messages+ + # is +true+, it will contain full messages (see +full_message+). + # + # person.errors.to_hash # => {:name=>["cannot be nil"]} + # person.errors.to_hash(true) # => {:name=>["name cannot be nil"]} + # + # source://activemodel//lib/active_model/errors.rb#253 + def to_hash(full_messages = T.unsafe(nil)); end + + # source://activemodel//lib/active_model/errors.rb#100 + def uniq!(*_arg0, **_arg1, &_arg2); end + + # Search for errors matching +attribute+, +type+, or +options+. + # + # Only supplied params will be matched. + # + # person.errors.where(:name) # => all name errors. + # person.errors.where(:name, :too_short) # => all name errors being too short + # person.errors.where(:name, :too_short, minimum: 2) # => all name errors being too short and minimum is 2 + # + # source://activemodel//lib/active_model/errors.rb#186 + def where(attribute, type = T.unsafe(nil), **options); end + + private + + # source://activemodel//lib/active_model/errors.rb#119 + def initialize_dup(other); end + + # source://activemodel//lib/active_model/errors.rb#487 + def normalize_arguments(attribute, type, **options); end +end + +# source://activemodel//lib/active_model/errors.rb#262 +ActiveModel::Errors::EMPTY_ARRAY = T.let(T.unsafe(nil), Array) + +# = Active \Model \ForbiddenAttributesError +# +# Raised when forbidden attributes are used for mass assignment. +# +# class Person < ActiveRecord::Base +# end +# +# params = ActionController::Parameters.new(name: 'Bob') +# Person.new(params) +# # => ActiveModel::ForbiddenAttributesError +# +# params.permit! +# Person.new(params) +# # => # +# +# source://activemodel//lib/active_model/forbidden_attributes_protection.rb#18 +class ActiveModel::ForbiddenAttributesError < ::StandardError; end + +# source://activemodel//lib/active_model/forbidden_attributes_protection.rb#21 +module ActiveModel::ForbiddenAttributesProtection + private + + # source://activemodel//lib/active_model/forbidden_attributes_protection.rb#23 + def sanitize_for_mass_assignment(attributes); end + + # source://activemodel//lib/active_model/forbidden_attributes_protection.rb#31 + def sanitize_forbidden_attributes(attributes); end +end + +# source://activemodel//lib/active_model/attribute_mutation_tracker.rb#91 +class ActiveModel::ForcedMutationTracker < ::ActiveModel::AttributeMutationTracker + # @return [ForcedMutationTracker] a new instance of ForcedMutationTracker + # + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#92 + def initialize(attributes); end + + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#101 + def change_to_attribute(attr_name); end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#97 + def changed_in_place?(attr_name); end + + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#125 + def finalize_changes; end + + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#121 + def force_change(attr_name); end + + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#109 + def forget_change(attr_name); end + + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#113 + def original_value(attr_name); end + + private + + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#132 + def attr_names; end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#136 + def attribute_changed?(attr_name); end + + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#144 + def clone_value(attr_name); end + + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#140 + def fetch_value(attr_name); end + + # Returns the value of attribute finalized_changes. + # + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#130 + def finalized_changes; end + + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#151 + def type_cast(attr_name, value); end +end + +# source://activemodel//lib/active_model/attribute_set/builder.rb#94 +class ActiveModel::LazyAttributeHash + # @return [LazyAttributeHash] a new instance of LazyAttributeHash + # + # source://activemodel//lib/active_model/attribute_set/builder.rb#97 + def initialize(types, values, additional_types, default_attributes, delegate_hash = T.unsafe(nil)); end + + # source://activemodel//lib/active_model/attribute_set/builder.rb#134 + def ==(other); end + + # source://activemodel//lib/active_model/attribute_set/builder.rb#110 + def [](key); end + + # source://activemodel//lib/active_model/attribute_set/builder.rb#114 + def []=(key, value); end + + # source://activemodel//lib/active_model/attribute_set/builder.rb#118 + def deep_dup; end + + # source://activemodel//lib/active_model/attribute_set/builder.rb#129 + def each_key(&block); end + + # source://activemodel//lib/active_model/attribute_set/builder.rb#95 + def each_value(*_arg0, **_arg1, &_arg2); end + + # source://activemodel//lib/active_model/attribute_set/builder.rb#95 + def except(*_arg0, **_arg1, &_arg2); end + + # source://activemodel//lib/active_model/attribute_set/builder.rb#95 + def fetch(*_arg0, **_arg1, &_arg2); end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/attribute_set/builder.rb#106 + def key?(key); end + + # source://activemodel//lib/active_model/attribute_set/builder.rb#142 + def marshal_dump; end + + # source://activemodel//lib/active_model/attribute_set/builder.rb#146 + def marshal_load(values); end + + # source://activemodel//lib/active_model/attribute_set/builder.rb#95 + def transform_values(*_arg0, **_arg1, &_arg2); end + + protected + + # source://activemodel//lib/active_model/attribute_set/builder.rb#151 + def materialize; end + + private + + # Returns the value of attribute additional_types. + # + # source://activemodel//lib/active_model/attribute_set/builder.rb#163 + def additional_types; end + + # source://activemodel//lib/active_model/attribute_set/builder.rb#165 + def assign_default_value(name); end + + # Returns the value of attribute default_attributes. + # + # source://activemodel//lib/active_model/attribute_set/builder.rb#163 + def default_attributes; end + + # Returns the value of attribute delegate_hash. + # + # source://activemodel//lib/active_model/attribute_set/builder.rb#163 + def delegate_hash; end + + # source://activemodel//lib/active_model/attribute_set/builder.rb#124 + def initialize_dup(_); end + + # Returns the value of attribute types. + # + # source://activemodel//lib/active_model/attribute_set/builder.rb#163 + def types; end + + # Returns the value of attribute values. + # + # source://activemodel//lib/active_model/attribute_set/builder.rb#163 + def values; end +end + +# source://activemodel//lib/active_model/attribute_set/builder.rb#21 +class ActiveModel::LazyAttributeSet < ::ActiveModel::AttributeSet + # @return [LazyAttributeSet] a new instance of LazyAttributeSet + # + # source://activemodel//lib/active_model/attribute_set/builder.rb#22 + def initialize(values, types, additional_types, default_attributes, attributes = T.unsafe(nil)); end + + # source://activemodel//lib/active_model/attribute_set/builder.rb#41 + def fetch_value(name, &block); end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/attribute_set/builder.rb#32 + def key?(name); end + + # source://activemodel//lib/active_model/attribute_set/builder.rb#36 + def keys; end + + protected + + # source://activemodel//lib/active_model/attribute_set/builder.rb#61 + def attributes; end + + private + + # Returns the value of attribute additional_types. + # + # source://activemodel//lib/active_model/attribute_set/builder.rb#71 + def additional_types; end + + # source://activemodel//lib/active_model/attribute_set/builder.rb#73 + def default_attribute(name, value_present = T.unsafe(nil), value = T.unsafe(nil)); end + + # Returns the value of attribute default_attributes. + # + # source://activemodel//lib/active_model/attribute_set/builder.rb#71 + def default_attributes; end + + # Returns the value of attribute types. + # + # source://activemodel//lib/active_model/attribute_set/builder.rb#71 + def types; end + + # Returns the value of attribute values. + # + # source://activemodel//lib/active_model/attribute_set/builder.rb#71 + def values; end +end + +# source://activemodel//lib/active_model/lint.rb#4 +module ActiveModel::Lint; end + +# == Active \Model \Lint \Tests +# +# You can test whether an object is compliant with the Active \Model API by +# including +ActiveModel::Lint::Tests+ in your TestCase. It will +# include tests that tell you whether your object is fully compliant, +# or if not, which aspects of the API are not implemented. +# +# Note an object is not required to implement all APIs in order to work +# with Action Pack. This module only intends to provide guidance in case +# you want all features out of the box. +# +# These tests do not attempt to determine the semantic correctness of the +# returned values. For instance, you could implement valid? to +# always return +true+, and the tests would pass. It is up to you to ensure +# that the values are semantically meaningful. +# +# Objects you pass in are expected to return a compliant object from a call +# to to_model. It is perfectly fine for to_model to return +# +self+. +# +# source://activemodel//lib/active_model/lint.rb#24 +module ActiveModel::Lint::Tests + # Passes if the object's model responds to errors and if calling + # [](attribute) on the result of this method returns an array. + # Fails otherwise. + # + # errors[attribute] is used to retrieve the errors of a model + # for a given attribute. If errors are present, the method should return + # an array of strings that are the errors for the attribute in question. + # If localization is used, the strings should be localized for the current + # locale. If no error is present, the method should return an empty array. + # + # source://activemodel//lib/active_model/lint.rb#102 + def test_errors_aref; end + + # Passes if the object's model responds to model_name both as + # an instance method and as a class method, and if calling this method + # returns a string with some convenience methods: :human, + # :singular and :plural. + # + # Check ActiveModel::Naming for more information. + # + # source://activemodel//lib/active_model/lint.rb#81 + def test_model_naming; end + + # Passes if the object's model responds to persisted? and if + # calling this method returns either +true+ or +false+. Fails otherwise. + # + # persisted? is used when calculating the URL for an object. + # If the object is not persisted, a form for that object, for instance, + # will route to the create action. If it is persisted, a form for the + # object will route to the update action. + # + # @return [Boolean] + # + # source://activemodel//lib/active_model/lint.rb#70 + def test_persisted?; end + + # Passes if the object's model responds to to_key and if calling + # this method returns +nil+ when the object is not persisted. + # Fails otherwise. + # + # to_key returns an Enumerable of all (primary) key attributes + # of the model, and is used to a generate unique DOM id for the object. + # + # source://activemodel//lib/active_model/lint.rb#31 + def test_to_key; end + + # Passes if the object's model responds to to_param and if + # calling this method returns +nil+ when the object is not persisted. + # Fails otherwise. + # + # to_param is used to represent the object's key in URLs. + # Implementers can decide to either raise an exception or provide a + # default in case the record uses a composite primary key. There are no + # tests for this behavior in lint because it doesn't make sense to force + # any of the possible implementation strategies on the implementer. + # + # source://activemodel//lib/active_model/lint.rb#46 + def test_to_param; end + + # Passes if the object's model responds to to_partial_path and if + # calling this method returns a string. Fails otherwise. + # + # to_partial_path is used for looking up partials. For example, + # a BlogPost model might return "blog_posts/blog_post". + # + # source://activemodel//lib/active_model/lint.rb#58 + def test_to_partial_path; end + + private + + # source://activemodel//lib/active_model/lint.rb#117 + def assert_boolean(result, name); end + + # source://activemodel//lib/active_model/lint.rb#108 + def def_method(receiver, name, &block); end + + # source://activemodel//lib/active_model/lint.rb#112 + def model; end +end + +# Raised when an attribute is not defined. +# +# class User < ActiveRecord::Base +# has_many :pets +# end +# +# user = User.first +# user.pets.select(:id).first.user_id +# # => ActiveModel::MissingAttributeError: missing attribute 'user_id' for Pet +# +# source://activemodel//lib/active_model/attribute_methods.rb#15 +class ActiveModel::MissingAttributeError < ::NoMethodError; end + +# = Active \Model \Basic \Model +# +# Allows implementing models similar to ActiveRecord::Base. +# Includes ActiveModel::API for the required interface for an +# object to interact with Action Pack and Action View, but can be +# extended with other functionalities. +# +# A minimal implementation could be: +# +# class Person +# include ActiveModel::Model +# attr_accessor :name, :age +# end +# +# person = Person.new(name: 'bob', age: '18') +# person.name # => "bob" +# person.age # => "18" +# +# If for some reason you need to run code on initialize, make +# sure you call +super+ if you want the attributes hash initialization to +# happen. +# +# class Person +# include ActiveModel::Model +# attr_accessor :id, :name, :omg +# +# def initialize(attributes={}) +# super +# @omg ||= true +# end +# end +# +# person = Person.new(id: 1, name: 'bob') +# person.omg # => true +# +# For more detailed information on other functionalities available, please +# refer to the specific modules included in +ActiveModel::Model+ +# (see below). +# +# source://activemodel//lib/active_model/model.rb#42 +module ActiveModel::Model + include ::ActiveModel::Access + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActiveSupport::Callbacks + include ::ActiveModel::Validations::HelperMethods + include ::ActiveModel::Validations + include ::ActiveModel::Conversion + include ::ActiveModel::API + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveModel::Validations::ClassMethods + mixes_in_class_methods ::ActiveModel::Callbacks + mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods + mixes_in_class_methods ::ActiveSupport::DescendantsTracker + mixes_in_class_methods ::ActiveModel::Translation + mixes_in_class_methods ::ActiveModel::Validations::HelperMethods + mixes_in_class_methods ::ActiveModel::Conversion::ClassMethods + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + def _validators; end + def _validators=(value); end + def _validators?; end + def param_delimiter; end + def param_delimiter=(value); end + def param_delimiter?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + def _validators; end + def _validators?; end + def param_delimiter=(value); end + end +end + +# source://activemodel//lib/active_model/naming.rb#8 +class ActiveModel::Name + include ::Comparable + + # Returns a new ActiveModel::Name instance. By default, the +namespace+ + # and +name+ option will take the namespace and name of the given class + # respectively. + # Use +locale+ argument for singularize and pluralize model name. + # + # module Foo + # class Bar + # end + # end + # + # ActiveModel::Name.new(Foo::Bar).to_s + # # => "Foo::Bar" + # + # @raise [ArgumentError] + # @return [Name] a new instance of Name + # + # source://activemodel//lib/active_model/naming.rb#165 + def initialize(klass, namespace = T.unsafe(nil), name = T.unsafe(nil), locale = T.unsafe(nil)); end + + # source://activemodel//lib/active_model/naming.rb#150 + def !~(*_arg0, **_arg1, &_arg2); end + + # source://activemodel//lib/active_model/naming.rb#150 + def <=>(*_arg0, **_arg1, &_arg2); end + + # source://activemodel//lib/active_model/naming.rb#150 + def ==(arg); end + + # source://activemodel//lib/active_model/naming.rb#150 + def ===(arg); end + + # source://activemodel//lib/active_model/naming.rb#150 + def =~(*_arg0, **_arg1, &_arg2); end + + # source://activemodel//lib/active_model/naming.rb#150 + def as_json(*_arg0, **_arg1, &_arg2); end + + # Returns the value of attribute collection. + # + # source://activemodel//lib/active_model/naming.rb#15 + def cache_key; end + + # Returns the value of attribute collection. + # + # source://activemodel//lib/active_model/naming.rb#11 + def collection; end + + # Sets the attribute collection + # + # @param value the value to set the attribute collection to. + # + # source://activemodel//lib/active_model/naming.rb#11 + def collection=(_arg0); end + + # Returns the value of attribute element. + # + # source://activemodel//lib/active_model/naming.rb#11 + def element; end + + # Sets the attribute element + # + # @param value the value to set the attribute element to. + # + # source://activemodel//lib/active_model/naming.rb#11 + def element=(_arg0); end + + # source://activemodel//lib/active_model/naming.rb#150 + def eql?(*_arg0, **_arg1, &_arg2); end + + # Transform the model name into a more human format, using I18n. By default, + # it will underscore then humanize the class name. + # + # class BlogPost + # extend ActiveModel::Naming + # end + # + # BlogPost.model_name.human # => "Blog post" + # + # Specify +options+ with additional translating options. + # + # source://activemodel//lib/active_model/naming.rb#196 + def human(options = T.unsafe(nil)); end + + # Returns the value of attribute i18n_key. + # + # source://activemodel//lib/active_model/naming.rb#11 + def i18n_key; end + + # Sets the attribute i18n_key + # + # @param value the value to set the attribute i18n_key to. + # + # source://activemodel//lib/active_model/naming.rb#11 + def i18n_key=(_arg0); end + + # source://activemodel//lib/active_model/naming.rb#150 + def match?(*_arg0, **_arg1, &_arg2); end + + # Returns the value of attribute name. + # + # source://activemodel//lib/active_model/naming.rb#11 + def name; end + + # Sets the attribute name + # + # @param value the value to set the attribute name to. + # + # source://activemodel//lib/active_model/naming.rb#11 + def name=(_arg0); end + + # Returns the value of attribute param_key. + # + # source://activemodel//lib/active_model/naming.rb#11 + def param_key; end + + # Sets the attribute param_key + # + # @param value the value to set the attribute param_key to. + # + # source://activemodel//lib/active_model/naming.rb#11 + def param_key=(_arg0); end + + # Returns the value of attribute plural. + # + # source://activemodel//lib/active_model/naming.rb#11 + def plural; end + + # Sets the attribute plural + # + # @param value the value to set the attribute plural to. + # + # source://activemodel//lib/active_model/naming.rb#11 + def plural=(_arg0); end + + # Returns the value of attribute route_key. + # + # source://activemodel//lib/active_model/naming.rb#11 + def route_key; end + + # Sets the attribute route_key + # + # @param value the value to set the attribute route_key to. + # + # source://activemodel//lib/active_model/naming.rb#11 + def route_key=(_arg0); end + + # Returns the value of attribute singular. + # + # source://activemodel//lib/active_model/naming.rb#11 + def singular; end + + # Sets the attribute singular + # + # @param value the value to set the attribute singular to. + # + # source://activemodel//lib/active_model/naming.rb#11 + def singular=(_arg0); end + + # Returns the value of attribute singular_route_key. + # + # source://activemodel//lib/active_model/naming.rb#11 + def singular_route_key; end + + # Sets the attribute singular_route_key + # + # @param value the value to set the attribute singular_route_key to. + # + # source://activemodel//lib/active_model/naming.rb#11 + def singular_route_key=(_arg0); end + + # source://activemodel//lib/active_model/naming.rb#150 + def to_s(*_arg0, **_arg1, &_arg2); end + + # source://activemodel//lib/active_model/naming.rb#150 + def to_str(*_arg0, **_arg1, &_arg2); end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/naming.rb#208 + def uncountable?; end + + private + + # source://activemodel//lib/active_model/naming.rb#215 + def _singularize(string); end + + # source://activemodel//lib/active_model/naming.rb#219 + def i18n_keys; end + + # source://activemodel//lib/active_model/naming.rb#227 + def i18n_scope; end +end + +# source://activemodel//lib/active_model/naming.rb#213 +ActiveModel::Name::MISSING_TRANSLATION = T.let(T.unsafe(nil), Integer) + +# = Active \Model \Naming +# +# Creates a +model_name+ method on your object. +# +# To implement, just extend ActiveModel::Naming in your object: +# +# class BookCover +# extend ActiveModel::Naming +# end +# +# BookCover.model_name.name # => "BookCover" +# BookCover.model_name.human # => "Book cover" +# +# BookCover.model_name.i18n_key # => :book_cover +# BookModule::BookCover.model_name.i18n_key # => :"book_module/book_cover" +# +# Providing the functionality that ActiveModel::Naming provides in your object +# is required to pass the \Active \Model Lint test. So either extending the +# provided method below, or rolling your own is required. +# +# source://activemodel//lib/active_model/naming.rb#251 +module ActiveModel::Naming + # Returns an ActiveModel::Name object for module. It can be + # used to retrieve all kinds of naming-related information + # (See ActiveModel::Name for more information). + # + # class Person + # extend ActiveModel::Naming + # end + # + # Person.model_name.name # => "Person" + # Person.model_name.class # => ActiveModel::Name + # Person.model_name.singular # => "person" + # Person.model_name.plural # => "people" + # + # source://activemodel//lib/active_model/naming.rb#269 + def model_name; end + + private + + # source://activemodel//lib/active_model/naming.rb#351 + def inherited(base); end + + class << self + # source://activemodel//lib/active_model/naming.rb#252 + def extended(base); end + + # Returns string to use for params names. It differs for + # namespaced models regarding whether it's inside isolated engine. + # + # # For isolated engine: + # ActiveModel::Naming.param_key(Blog::Post) # => "post" + # + # # For shared engine: + # ActiveModel::Naming.param_key(Blog::Post) # => "blog_post" + # + # source://activemodel//lib/active_model/naming.rb#337 + def param_key(record_or_class); end + + # Returns the plural class name of a record or class. + # + # ActiveModel::Naming.plural(post) # => "posts" + # ActiveModel::Naming.plural(Highrise::Person) # => "highrise_people" + # + # source://activemodel//lib/active_model/naming.rb#282 + def plural(record_or_class); end + + # Returns string to use while generating route names. It differs for + # namespaced models regarding whether it's inside isolated engine. + # + # # For isolated engine: + # ActiveModel::Naming.route_key(Blog::Post) # => "posts" + # + # # For shared engine: + # ActiveModel::Naming.route_key(Blog::Post) # => "blog_posts" + # + # The route key also considers if the noun is uncountable and, in + # such cases, automatically appends _index. + # + # source://activemodel//lib/active_model/naming.rb#325 + def route_key(record_or_class); end + + # Returns the singular class name of a record or class. + # + # ActiveModel::Naming.singular(post) # => "post" + # ActiveModel::Naming.singular(Highrise::Person) # => "highrise_person" + # + # source://activemodel//lib/active_model/naming.rb#290 + def singular(record_or_class); end + + # Returns string to use while generating route names. It differs for + # namespaced models regarding whether it's inside isolated engine. + # + # # For isolated engine: + # ActiveModel::Naming.singular_route_key(Blog::Post) # => "post" + # + # # For shared engine: + # ActiveModel::Naming.singular_route_key(Blog::Post) # => "blog_post" + # + # source://activemodel//lib/active_model/naming.rb#310 + def singular_route_key(record_or_class); end + + # Identifies whether the class name of a record or class is uncountable. + # + # ActiveModel::Naming.uncountable?(Sheep) # => true + # ActiveModel::Naming.uncountable?(Post) # => false + # + # @return [Boolean] + # + # source://activemodel//lib/active_model/naming.rb#298 + def uncountable?(record_or_class); end + + private + + # source://activemodel//lib/active_model/naming.rb#341 + def model_name_from_record_or_class(record_or_class); end + end +end + +# source://activemodel//lib/active_model/nested_error.rb#6 +class ActiveModel::NestedError < ::ActiveModel::Error + # @return [NestedError] a new instance of NestedError + # + # source://activemodel//lib/active_model/nested_error.rb#7 + def initialize(base, inner_error, override_options = T.unsafe(nil)); end + + # Returns the value of attribute inner_error. + # + # source://activemodel//lib/active_model/nested_error.rb#16 + def inner_error; end + + # source://activemodel//lib/active_model/nested_error.rb#18 + def message(*_arg0, **_arg1, &_arg2); end +end + +# source://activemodel//lib/active_model/attribute_mutation_tracker.rb#156 +class ActiveModel::NullMutationTracker + include ::Singleton::SingletonInstanceMethods + include ::Singleton + extend ::Singleton::SingletonClassMethods + + # @return [Boolean] + # + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#174 + def any_changes?; end + + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#171 + def change_to_attribute(attr_name); end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#178 + def changed?(attr_name, **_arg1); end + + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#159 + def changed_attribute_names; end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#182 + def changed_in_place?(attr_name); end + + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#163 + def changed_values; end + + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#167 + def changes; end + + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#186 + def original_value(attr_name); end + + class << self + private + + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#157 + def allocate; end + + # source://activemodel//lib/active_model/attribute_mutation_tracker.rb#157 + def new(*_arg0); end + end +end + +# source://activemodel//lib/active_model/railtie.rb#7 +class ActiveModel::Railtie < ::Rails::Railtie; end + +# = Active \Model \RangeError +# +# Raised when attribute values are out of range. +# +# source://activemodel//lib/active_model/errors.rb#520 +class ActiveModel::RangeError < ::RangeError; end + +# source://activemodel//lib/active_model/secure_password.rb#4 +module ActiveModel::SecurePassword + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveModel::SecurePassword::ClassMethods + + class << self + # source://activemodel//lib/active_model/secure_password.rb#15 + def min_cost; end + + # source://activemodel//lib/active_model/secure_password.rb#15 + def min_cost=(_arg0); end + end +end + +# source://activemodel//lib/active_model/secure_password.rb#19 +module ActiveModel::SecurePassword::ClassMethods + # Adds methods to set and authenticate against a BCrypt password. + # This mechanism requires you to have a +XXX_digest+ attribute, + # where +XXX+ is the attribute name of your desired password. + # + # The following validations are added automatically: + # * Password must be present on creation + # * Password length should be less than or equal to 72 bytes + # * Confirmation of password (using a +XXX_confirmation+ attribute) + # + # If confirmation validation is not needed, simply leave out the + # value for +XXX_confirmation+ (i.e. don't provide a form field for + # it). When this attribute has a +nil+ value, the validation will not be + # triggered. + # + # Additionally, a +XXX_challenge+ attribute is created. When set to a + # value other than +nil+, it will validate against the currently persisted + # password. This validation relies on dirty tracking, as provided by + # ActiveModel::Dirty; if dirty tracking methods are not defined, this + # validation will fail. + # + # All of the above validations can be omitted by passing + # validations: false as an argument. This allows complete + # customizability of validation behavior. + # + # A password reset token (valid for 15 minutes by default) is automatically + # configured when +reset_token+ is set to true (which it is by default) + # and the object responds to +generates_token_for+ (which Active Records do). + # + # Finally, the reset token expiry can be customized by passing a hash to + # +has_secure_password+: + # + # has_secure_password reset_token: { expires_in: 1.hour } + # + # To use +has_secure_password+, add bcrypt (~> 3.1.7) to your Gemfile: + # + # gem "bcrypt", "~> 3.1.7" + # + # ==== Examples + # + # ===== Using Active Record (which automatically includes ActiveModel::SecurePassword) + # + # # Schema: User(name:string, password_digest:string, recovery_password_digest:string) + # class User < ActiveRecord::Base + # has_secure_password + # has_secure_password :recovery_password, validations: false + # end + # + # user = User.new(name: "david", password: "", password_confirmation: "nomatch") + # + # user.save # => false, password required + # user.password = "vr00m" + # user.save # => false, confirmation doesn't match + # user.password_confirmation = "vr00m" + # user.save # => true + # + # user.authenticate("notright") # => false + # user.authenticate("vr00m") # => user + # User.find_by(name: "david")&.authenticate("notright") # => false + # User.find_by(name: "david")&.authenticate("vr00m") # => user + # + # user.recovery_password = "42password" + # user.recovery_password_digest # => "$2a$04$iOfhwahFymCs5weB3BNH/uXkTG65HR.qpW.bNhEjFP3ftli3o5DQC" + # user.save # => true + # + # user.authenticate_recovery_password("42password") # => user + # + # user.update(password: "pwn3d", password_challenge: "") # => false, challenge doesn't authenticate + # user.update(password: "nohack4u", password_challenge: "vr00m") # => true + # + # user.authenticate("vr00m") # => false, old password + # user.authenticate("nohack4u") # => user + # + # ===== Conditionally requiring a password + # + # class Account + # include ActiveModel::SecurePassword + # + # attr_accessor :is_guest, :password_digest + # + # has_secure_password + # + # def errors + # super.tap { |errors| errors.delete(:password, :blank) if is_guest } + # end + # end + # + # account = Account.new + # account.valid? # => false, password required + # + # account.is_guest = true + # account.valid? # => true + # + # ===== Using the password reset token + # + # user = User.create!(name: "david", password: "123", password_confirmation: "123") + # token = user.password_reset_token + # User.find_by_password_reset_token(token) # returns user + # + # # 16 minutes later... + # User.find_by_password_reset_token(token) # returns nil + # + # # raises ActiveSupport::MessageVerifier::InvalidSignature since the token is expired + # User.find_by_password_reset_token!(token) + # + # source://activemodel//lib/active_model/secure_password.rb#123 + def has_secure_password(attribute = T.unsafe(nil), validations: T.unsafe(nil), reset_token: T.unsafe(nil)); end +end + +# source://activemodel//lib/active_model/secure_password.rb#12 +ActiveModel::SecurePassword::DEFAULT_RESET_TOKEN_EXPIRES_IN = T.let(T.unsafe(nil), ActiveSupport::Duration) + +# source://activemodel//lib/active_model/secure_password.rb#194 +class ActiveModel::SecurePassword::InstanceMethodsOnActivation < ::Module + # @return [InstanceMethodsOnActivation] a new instance of InstanceMethodsOnActivation + # + # source://activemodel//lib/active_model/secure_password.rb#195 + def initialize(attribute, reset_token:); end +end + +# BCrypt hash function can handle maximum 72 bytes, and if we pass +# password of length more than 72 bytes it ignores extra characters. +# Hence need to put a restriction on password length. +# +# source://activemodel//lib/active_model/secure_password.rb#10 +ActiveModel::SecurePassword::MAX_PASSWORD_LENGTH_ALLOWED = T.let(T.unsafe(nil), Integer) + +# = Active \Model \Serialization +# +# Provides a basic serialization to a serializable_hash for your objects. +# +# A minimal implementation could be: +# +# class Person +# include ActiveModel::Serialization +# +# attr_accessor :name +# +# def attributes +# {'name' => nil} +# end +# end +# +# Which would provide you with: +# +# person = Person.new +# person.serializable_hash # => {"name"=>nil} +# person.name = "Bob" +# person.serializable_hash # => {"name"=>"Bob"} +# +# An +attributes+ hash must be defined and should contain any attributes you +# need to be serialized. Attributes must be strings, not symbols. +# When called, serializable hash will use instance methods that match the name +# of the attributes hash's keys. In order to override this behavior, override +# the +read_attribute_for_serialization+ method. +# +# ActiveModel::Serializers::JSON module automatically includes +# the +ActiveModel::Serialization+ module, so there is no need to +# explicitly include +ActiveModel::Serialization+. +# +# A minimal implementation including JSON would be: +# +# class Person +# include ActiveModel::Serializers::JSON +# +# attr_accessor :name +# +# def attributes +# {'name' => nil} +# end +# end +# +# Which would provide you with: +# +# person = Person.new +# person.serializable_hash # => {"name"=>nil} +# person.as_json # => {"name"=>nil} +# person.to_json # => "{\"name\":null}" +# +# person.name = "Bob" +# person.serializable_hash # => {"name"=>"Bob"} +# person.as_json # => {"name"=>"Bob"} +# person.to_json # => "{\"name\":\"Bob\"}" +# +# Valid options are :only, :except, :methods and +# :include. The following are all valid examples: +# +# person.serializable_hash(only: 'name') +# person.serializable_hash(include: :address) +# person.serializable_hash(include: { address: { only: 'city' }}) +# +# source://activemodel//lib/active_model/serialization.rb#69 +module ActiveModel::Serialization + # Hook method defining how an attribute value should be retrieved for + # serialization. By default this is assumed to be an instance named after + # the attribute. Override this method in subclasses should you need to + # retrieve the value for a given attribute differently: + # + # class MyClass + # include ActiveModel::Serialization + # + # def initialize(data = {}) + # @data = data + # end + # + # def read_attribute_for_serialization(key) + # @data[key] + # end + # end + # + # source://activemodel//lib/active_model/serialization.rb#167 + def read_attribute_for_serialization(*_arg0); end + + # Returns a serialized hash of your object. + # + # class Person + # include ActiveModel::Serialization + # + # attr_accessor :name, :age + # + # def attributes + # {'name' => nil, 'age' => nil} + # end + # + # def capitalized_name + # name.capitalize + # end + # end + # + # person = Person.new + # person.name = 'bob' + # person.age = 22 + # person.serializable_hash # => {"name"=>"bob", "age"=>22} + # person.serializable_hash(only: :name) # => {"name"=>"bob"} + # person.serializable_hash(except: :name) # => {"age"=>22} + # person.serializable_hash(methods: :capitalized_name) + # # => {"name"=>"bob", "age"=>22, "capitalized_name"=>"Bob"} + # + # Example with :include option + # + # class User + # include ActiveModel::Serializers::JSON + # attr_accessor :name, :notes # Emulate has_many :notes + # def attributes + # {'name' => nil} + # end + # end + # + # class Note + # include ActiveModel::Serializers::JSON + # attr_accessor :title, :text + # def attributes + # {'title' => nil, 'text' => nil} + # end + # end + # + # note = Note.new + # note.title = 'Battle of Austerlitz' + # note.text = 'Some text here' + # + # user = User.new + # user.name = 'Napoleon' + # user.notes = [note] + # + # user.serializable_hash + # # => {"name" => "Napoleon"} + # user.serializable_hash(include: { notes: { only: 'title' }}) + # # => {"name" => "Napoleon", "notes" => [{"title"=>"Battle of Austerlitz"}]} + # + # source://activemodel//lib/active_model/serialization.rb#125 + def serializable_hash(options = T.unsafe(nil)); end + + private + + # source://activemodel//lib/active_model/serialization.rb#170 + def attribute_names_for_serialization; end + + # Add associations specified via the :include option. + # + # Expects a block that takes as arguments: + # +association+ - name of the association + # +records+ - the association record(s) to be serialized + # +opts+ - options for the association records + # + # source://activemodel//lib/active_model/serialization.rb#184 + def serializable_add_includes(options = T.unsafe(nil)); end + + # source://activemodel//lib/active_model/serialization.rb#174 + def serializable_attributes(attribute_names); end +end + +# source://activemodel//lib/active_model.rb#74 +module ActiveModel::Serializers + extend ::ActiveSupport::Autoload +end + +# = Active \Model \JSON \Serializer +# +# source://activemodel//lib/active_model/serializers/json.rb#8 +module ActiveModel::Serializers::JSON + include ::ActiveModel::Serialization + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveModel::Naming + + # Returns a hash representing the model. Some configuration can be + # passed through +options+. + # + # The option include_root_in_json controls the top-level behavior + # of +as_json+. If +true+, +as_json+ will emit a single root node named + # after the object's type. The default value for include_root_in_json + # option is +false+. + # + # user = User.find(1) + # user.as_json + # # => { "id" => 1, "name" => "Konata Izumi", "age" => 16, + # # "created_at" => "2006-08-01T17:27:133.000Z", "awesome" => true} + # + # ActiveRecord::Base.include_root_in_json = true + # + # user.as_json + # # => { "user" => { "id" => 1, "name" => "Konata Izumi", "age" => 16, + # # "created_at" => "2006-08-01T17:27:13.000Z", "awesome" => true } } + # + # This behavior can also be achieved by setting the :root option + # to +true+ as in: + # + # user = User.find(1) + # user.as_json(root: true) + # # => { "user" => { "id" => 1, "name" => "Konata Izumi", "age" => 16, + # # "created_at" => "2006-08-01T17:27:13.000Z", "awesome" => true } } + # + # If you prefer, :root may also be set to a custom string key instead as in: + # + # user = User.find(1) + # user.as_json(root: "author") + # # => { "author" => { "id" => 1, "name" => "Konata Izumi", "age" => 16, + # # "created_at" => "2006-08-01T17:27:13.000Z", "awesome" => true } } + # + # Without any +options+, the returned Hash will include all the model's + # attributes. + # + # user = User.find(1) + # user.as_json + # # => { "id" => 1, "name" => "Konata Izumi", "age" => 16, + # # "created_at" => "2006-08-01T17:27:13.000Z", "awesome" => true} + # + # The :only and :except options can be used to limit + # the attributes included, and work similar to the +attributes+ method. + # + # user.as_json(only: [:id, :name]) + # # => { "id" => 1, "name" => "Konata Izumi" } + # + # user.as_json(except: [:id, :created_at, :age]) + # # => { "name" => "Konata Izumi", "awesome" => true } + # + # To include the result of some method calls on the model use :methods: + # + # user.as_json(methods: :permalink) + # # => { "id" => 1, "name" => "Konata Izumi", "age" => 16, + # # "created_at" => "2006-08-01T17:27:13.000Z", "awesome" => true, + # # "permalink" => "1-konata-izumi" } + # + # To include associations use :include: + # + # user.as_json(include: :posts) + # # => { "id" => 1, "name" => "Konata Izumi", "age" => 16, + # # "created_at" => "2006-08-01T17:27:13.000Z", "awesome" => true, + # # "posts" => [ { "id" => 1, "author_id" => 1, "title" => "Welcome to the weblog" }, + # # { "id" => 2, "author_id" => 1, "title" => "So I was thinking" } ] } + # + # Second level and higher order associations work as well: + # + # user.as_json(include: { posts: { + # include: { comments: { + # only: :body } }, + # only: :title } }) + # # => { "id" => 1, "name" => "Konata Izumi", "age" => 16, + # # "created_at" => "2006-08-01T17:27:13.000Z", "awesome" => true, + # # "posts" => [ { "comments" => [ { "body" => "1st post!" }, { "body" => "Second!" } ], + # # "title" => "Welcome to the weblog" }, + # # { "comments" => [ { "body" => "Don't think too hard" } ], + # # "title" => "So I was thinking" } ] } + # + # source://activemodel//lib/active_model/serializers/json.rb#96 + def as_json(options = T.unsafe(nil)); end + + # Sets the model +attributes+ from a JSON string. Returns +self+. + # + # class Person + # include ActiveModel::Serializers::JSON + # + # attr_accessor :name, :age, :awesome + # + # def attributes=(hash) + # hash.each do |key, value| + # send("#{key}=", value) + # end + # end + # + # def attributes + # instance_values + # end + # end + # + # json = { name: 'bob', age: 22, awesome:true }.to_json + # person = Person.new + # person.from_json(json) # => # + # person.name # => "bob" + # person.age # => 22 + # person.awesome # => true + # + # The default value for +include_root+ is +false+. You can change it to + # +true+ if the given JSON string includes a single root node. + # + # json = { person: { name: 'bob', age: 22, awesome:true } }.to_json + # person = Person.new + # person.from_json(json, true) # => # + # person.name # => "bob" + # person.age # => 22 + # person.awesome # => true + # + # source://activemodel//lib/active_model/serializers/json.rb#146 + def from_json(json, include_root = T.unsafe(nil)); end + + module GeneratedClassMethods + def include_root_in_json; end + def include_root_in_json=(value); end + def include_root_in_json?; end + end + + module GeneratedInstanceMethods + def include_root_in_json; end + def include_root_in_json?; end + end +end + +# = Active \Model \StrictValidationFailed +# +# Raised when a validation cannot be corrected by end users and are considered +# exceptional. +# +# class Person +# include ActiveModel::Validations +# +# attr_accessor :name +# +# validates_presence_of :name, strict: true +# end +# +# person = Person.new +# person.name = nil +# person.valid? +# # => ActiveModel::StrictValidationFailed: Name can't be blank +# +# source://activemodel//lib/active_model/errors.rb#514 +class ActiveModel::StrictValidationFailed < ::StandardError; end + +# = Active \Model \Translation +# +# Provides integration between your object and the \Rails internationalization +# (i18n) framework. +# +# A minimal implementation could be: +# +# class TranslatedPerson +# extend ActiveModel::Translation +# end +# +# TranslatedPerson.human_attribute_name('my_attribute') +# # => "My attribute" +# +# This also provides the required class methods for hooking into the +# \Rails internationalization API, including being able to define a +# class-based +i18n_scope+ and +lookup_ancestors+ to find translations in +# parent classes. +# +# source://activemodel//lib/active_model/translation.rb#22 +module ActiveModel::Translation + include ::ActiveModel::Naming + + # Transforms attribute names into a more human format, such as "First name" + # instead of "first_name". + # + # Person.human_attribute_name("first_name") # => "First name" + # + # Specify +options+ with additional translating options. + # + # source://activemodel//lib/active_model/translation.rb#48 + def human_attribute_name(attribute, options = T.unsafe(nil)); end + + # Returns the +i18n_scope+ for the class. Override if you want custom lookup. + # + # source://activemodel//lib/active_model/translation.rb#28 + def i18n_scope; end + + # When localizing a string, it goes through the lookup returned by this + # method, which is used in ActiveModel::Name#human, + # ActiveModel::Errors#full_messages and + # ActiveModel::Translation#human_attribute_name. + # + # source://activemodel//lib/active_model/translation.rb#36 + def lookup_ancestors; end + + class << self + # source://activemodel//lib/active_model/translation.rb#25 + def raise_on_missing_translations; end + + # source://activemodel//lib/active_model/translation.rb#25 + def raise_on_missing_translations=(_arg0); end + end +end + +# source://activemodel//lib/active_model/translation.rb#40 +ActiveModel::Translation::MISSING_TRANSLATION = T.let(T.unsafe(nil), Integer) + +# source://activemodel//lib/active_model/type/helpers/accepts_multiparameter_time.rb#4 +module ActiveModel::Type + class << self + # source://activemodel//lib/active_model/type.rb#38 + def default_value; end + + # source://activemodel//lib/active_model/type.rb#34 + def lookup(*_arg0, **_arg1, &_arg2); end + + # Add a new type to the registry, allowing it to be referenced as a + # symbol by {attribute}[rdoc-ref:Attributes::ClassMethods#attribute]. + # + # source://activemodel//lib/active_model/type.rb#30 + def register(type_name, klass = T.unsafe(nil), &block); end + + # source://activemodel//lib/active_model/type.rb#26 + def registry; end + + # source://activemodel//lib/active_model/type.rb#26 + def registry=(_arg0); end + end +end + +# = Active Model \BigInteger \Type +# +# Attribute type for integers that can be serialized to an unlimited number +# of bytes. This type is registered under the +:big_integer+ key. +# +# class Person +# include ActiveModel::Attributes +# +# attribute :id, :big_integer +# end +# +# person = Person.new +# person.id = "18_000_000_000" +# +# person.id # => 18000000000 +# +# All casting and serialization are performed in the same way as the +# standard ActiveModel::Type::Integer type. +# +# source://activemodel//lib/active_model/type/big_integer.rb#25 +class ActiveModel::Type::BigInteger < ::ActiveModel::Type::Integer + # @return [Boolean] + # + # source://activemodel//lib/active_model/type/big_integer.rb#47 + def serializable?(value, &_arg1); end + + # source://activemodel//lib/active_model/type/big_integer.rb#26 + def serialize(value); end + + # source://activemodel//lib/active_model/type/big_integer.rb#43 + def serialize_cast_value(value); end + + private + + # source://activemodel//lib/active_model/type/big_integer.rb#52 + def max_value; end +end + +# = Active Model \Binary \Type +# +# Attribute type for representation of binary data. This type is registered +# under the +:binary+ key. +# +# Non-string values are coerced to strings using their +to_s+ method. +# +# source://activemodel//lib/active_model/type/binary.rb#11 +class ActiveModel::Type::Binary < ::ActiveModel::Type::Value + # @return [Boolean] + # + # source://activemodel//lib/active_model/type/binary.rb#16 + def binary?; end + + # source://activemodel//lib/active_model/type/binary.rb#20 + def cast(value); end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/type/binary.rb#35 + def changed_in_place?(raw_old_value, value); end + + # source://activemodel//lib/active_model/type/binary.rb#30 + def serialize(value); end + + # source://activemodel//lib/active_model/type/binary.rb#12 + def type; end +end + +# source://activemodel//lib/active_model/type/binary.rb#40 +class ActiveModel::Type::Binary::Data + # @return [Data] a new instance of Data + # + # source://activemodel//lib/active_model/type/binary.rb#41 + def initialize(value); end + + # source://activemodel//lib/active_model/type/binary.rb#56 + def ==(other); end + + # source://activemodel//lib/active_model/type/binary.rb#52 + def hex; end + + # source://activemodel//lib/active_model/type/binary.rb#47 + def to_s; end + + # source://activemodel//lib/active_model/type/binary.rb#50 + def to_str; end +end + +# = Active Model \Boolean \Type +# +# A class that behaves like a boolean type, including rules for coercion of +# user input. +# +# - "false", "f", "0", +0+ or any other value in +# +FALSE_VALUES+ will be coerced to +false+. +# - Empty strings are coerced to +nil+. +# - All other values will be coerced to +true+. +# +# source://activemodel//lib/active_model/type/boolean.rb#14 +class ActiveModel::Type::Boolean < ::ActiveModel::Type::Value + include ::ActiveModel::Type::Helpers::Immutable + + # source://activemodel//lib/active_model/type/boolean.rb#31 + def serialize(value); end + + # source://activemodel//lib/active_model/type/boolean.rb#35 + def serialize_cast_value(value); end + + # source://activemodel//lib/active_model/type/boolean.rb#27 + def type; end + + private + + # source://activemodel//lib/active_model/type/boolean.rb#40 + def cast_value(value); end +end + +# source://activemodel//lib/active_model/type/boolean.rb#16 +ActiveModel::Type::Boolean::FALSE_VALUES = T.let(T.unsafe(nil), Set) + +# = Active Model \Date \Type +# +# Attribute type for date representation. It is registered under the +# +:date+ key. +# +# class Person +# include ActiveModel::Attributes +# +# attribute :birthday, :date +# end +# +# person = Person.new +# person.birthday = "1989-07-13" +# +# person.birthday.class # => Date +# person.birthday.year # => 1989 +# person.birthday.month # => 7 +# person.birthday.day # => 13 +# +# String values are parsed using the ISO 8601 date format. Any other values +# are cast using their +to_date+ method, if it exists. +# +# source://activemodel//lib/active_model/type/date.rb#26 +class ActiveModel::Type::Date < ::ActiveModel::Type::Value + include ::ActiveModel::Type::Helpers::Immutable + include ::ActiveModel::Type::Helpers::Timezone + include ::ActiveModel::Type::Helpers::AcceptsMultiparameterTime::InstanceMethods + + # source://activemodel//lib/active_model/type/date.rb#31 + def type; end + + # source://activemodel//lib/active_model/type/date.rb#35 + def type_cast_for_schema(value); end + + private + + # source://activemodel//lib/active_model/type/date.rb#40 + def cast_value(value); end + + # source://activemodel//lib/active_model/type/date.rb#58 + def fallback_string_to_date(string); end + + # source://activemodel//lib/active_model/type/date.rb#52 + def fast_string_to_date(string); end + + # source://activemodel//lib/active_model/type/date.rb#67 + def new_date(year, mon, mday); end + + # source://activemodel//lib/active_model/type/date.rb#73 + def value_from_multiparameter_assignment(*_arg0); end +end + +# source://activemodel//lib/active_model/type/date.rb#51 +ActiveModel::Type::Date::ISO_DATE = T.let(T.unsafe(nil), Regexp) + +# = Active Model \DateTime \Type +# +# Attribute type to represent dates and times. It is registered under the +# +:datetime+ key. +# +# class Event +# include ActiveModel::Attributes +# +# attribute :start, :datetime +# end +# +# event = Event.new +# event.start = "Wed, 04 Sep 2013 03:00:00 EAT" +# +# event.start.class # => Time +# event.start.year # => 2013 +# event.start.month # => 9 +# event.start.day # => 4 +# event.start.hour # => 3 +# event.start.min # => 0 +# event.start.sec # => 0 +# event.start.zone # => "EAT" +# +# String values are parsed using the ISO 8601 datetime format. Partial +# time-only formats are also accepted. +# +# event.start = "06:07:08+09:00" +# event.start.utc # => 1999-12-31 21:07:08 UTC +# +# The degree of sub-second precision can be customized when declaring an +# attribute: +# +# class Event +# include ActiveModel::Attributes +# +# attribute :start, :datetime, precision: 4 +# end +# +# source://activemodel//lib/active_model/type/date_time.rb#42 +class ActiveModel::Type::DateTime < ::ActiveModel::Type::Value + include ::ActiveModel::Type::Helpers::Timezone + include ::ActiveModel::Type::Helpers::AcceptsMultiparameterTime::InstanceMethods + include ::ActiveModel::Type::Helpers::TimeValue + + # @return [Boolean] + # + # source://activemodel//lib/active_model/type/date_time.rb#53 + def mutable?; end + + # source://activemodel//lib/active_model/type/date_time.rb#49 + def type; end + + private + + # source://activemodel//lib/active_model/type/date_time.rb#62 + def cast_value(value); end + + # source://activemodel//lib/active_model/type/date_time.rb#75 + def fallback_string_to_time(string); end + + # '0.123456' -> 123456 + # '1.123456' -> 123456 + # + # source://activemodel//lib/active_model/type/date_time.rb#71 + def microseconds(time); end + + # source://activemodel//lib/active_model/type/date_time.rb#87 + def value_from_multiparameter_assignment(values_hash); end +end + +# = Active Model \Decimal \Type +# +# Attribute type for decimal, high-precision floating point numeric +# representation. It is registered under the +:decimal+ key. +# +# class BagOfCoffee +# include ActiveModel::Attributes +# +# attribute :weight, :decimal +# end +# +# Numeric instances are converted to BigDecimal instances. Any other objects +# are cast using their +to_d+ method, except for blank strings, which are +# cast to +nil+. If a +to_d+ method is not defined, the object is converted +# to a string using +to_s+, which is then cast using +to_d+. +# +# bag = BagOfCoffee.new +# +# bag.weight = 0.01 +# bag.weight # => 0.1e-1 +# +# bag.weight = "0.01" +# bag.weight # => 0.1e-1 +# +# bag.weight = "" +# bag.weight # => nil +# +# bag.weight = :arbitrary +# bag.weight # => nil (the result of `.to_s.to_d`) +# +# Decimal precision defaults to 18, and can be customized when declaring an +# attribute: +# +# class BagOfCoffee +# include ActiveModel::Attributes +# +# attribute :weight, :decimal, precision: 24 +# end +# +# source://activemodel//lib/active_model/type/decimal.rb#45 +class ActiveModel::Type::Decimal < ::ActiveModel::Type::Value + include ::ActiveModel::Type::Helpers::Immutable + include ::ActiveModel::Type::Helpers::Numeric + + # source://activemodel//lib/active_model/type/decimal.rb#50 + def type; end + + # source://activemodel//lib/active_model/type/decimal.rb#54 + def type_cast_for_schema(value); end + + private + + # source://activemodel//lib/active_model/type/decimal.rb#99 + def apply_scale(value); end + + # source://activemodel//lib/active_model/type/decimal.rb#59 + def cast_value(value); end + + # source://activemodel//lib/active_model/type/decimal.rb#83 + def convert_float_to_big_decimal(value); end + + # source://activemodel//lib/active_model/type/decimal.rb#91 + def float_precision; end +end + +# source://activemodel//lib/active_model/type/decimal.rb#48 +ActiveModel::Type::Decimal::BIGDECIMAL_PRECISION = T.let(T.unsafe(nil), Integer) + +# = Active Model \Float \Type +# +# Attribute type for floating point numeric values. It is registered under +# the +:float+ key. +# +# class BagOfCoffee +# include ActiveModel::Attributes +# +# attribute :weight, :float +# end +# +# bag = BagOfCoffee.new +# +# bag.weight = "0.25" +# bag.weight # => 0.25 +# +# bag.weight = "" +# bag.weight # => nil +# +# bag.weight = "NaN" +# bag.weight # => Float::NAN +# +# Values are cast using their +to_f+ method, except for the following +# strings: +# +# - Blank strings are cast to +nil+. +# - "Infinity" is cast to +Float::INFINITY+. +# - "-Infinity" is cast to -Float::INFINITY. +# - "NaN" is cast to +Float::NAN+. +# +# source://activemodel//lib/active_model/type/float.rb#36 +class ActiveModel::Type::Float < ::ActiveModel::Type::Value + include ::ActiveModel::Type::Helpers::Immutable + include ::ActiveModel::Type::Helpers::Numeric + + # source://activemodel//lib/active_model/type/float.rb#40 + def type; end + + # source://activemodel//lib/active_model/type/float.rb#44 + def type_cast_for_schema(value); end + + private + + # source://activemodel//lib/active_model/type/float.rb#54 + def cast_value(value); end +end + +# source://activemodel//lib/active_model/type/helpers/accepts_multiparameter_time.rb#5 +module ActiveModel::Type::Helpers; end + +# source://activemodel//lib/active_model/type/helpers/accepts_multiparameter_time.rb#6 +class ActiveModel::Type::Helpers::AcceptsMultiparameterTime < ::Module + # @return [AcceptsMultiparameterTime] a new instance of AcceptsMultiparameterTime + # + # source://activemodel//lib/active_model/type/helpers/accepts_multiparameter_time.rb#37 + def initialize(defaults: T.unsafe(nil)); end +end + +# source://activemodel//lib/active_model/type/helpers/accepts_multiparameter_time.rb#7 +module ActiveModel::Type::Helpers::AcceptsMultiparameterTime::InstanceMethods + # source://activemodel//lib/active_model/type/helpers/accepts_multiparameter_time.rb#24 + def assert_valid_value(value); end + + # source://activemodel//lib/active_model/type/helpers/accepts_multiparameter_time.rb#16 + def cast(value); end + + # source://activemodel//lib/active_model/type/helpers/accepts_multiparameter_time.rb#8 + def serialize(value); end + + # source://activemodel//lib/active_model/type/helpers/accepts_multiparameter_time.rb#12 + def serialize_cast_value(value); end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/type/helpers/accepts_multiparameter_time.rb#32 + def value_constructed_by_mass_assignment?(value); end +end + +# source://activemodel//lib/active_model/type/helpers/immutable.rb#6 +module ActiveModel::Type::Helpers::Immutable + # @return [Boolean] + # + # source://activemodel//lib/active_model/type/helpers/immutable.rb#7 + def mutable?; end +end + +# source://activemodel//lib/active_model/type/helpers/mutable.rb#6 +module ActiveModel::Type::Helpers::Mutable + # source://activemodel//lib/active_model/type/helpers/mutable.rb#7 + def cast(value); end + + # +raw_old_value+ will be the `_before_type_cast` version of the + # value (likely a string). +new_value+ will be the current, type + # cast value. + # + # @return [Boolean] + # + # source://activemodel//lib/active_model/type/helpers/mutable.rb#14 + def changed_in_place?(raw_old_value, new_value); end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/type/helpers/mutable.rb#18 + def mutable?; end +end + +# source://activemodel//lib/active_model/type/helpers/numeric.rb#6 +module ActiveModel::Type::Helpers::Numeric + # source://activemodel//lib/active_model/type/helpers/numeric.rb#15 + def cast(value); end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/type/helpers/numeric.rb#31 + def changed?(old_value, _new_value, new_value_before_type_cast); end + + # source://activemodel//lib/active_model/type/helpers/numeric.rb#7 + def serialize(value); end + + # source://activemodel//lib/active_model/type/helpers/numeric.rb#11 + def serialize_cast_value(value); end + + private + + # @return [Boolean] + # + # source://activemodel//lib/active_model/type/helpers/numeric.rb#37 + def equal_nan?(old_value, new_value); end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/type/helpers/numeric.rb#49 + def non_numeric_string?(value); end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/type/helpers/numeric.rb#44 + def number_to_non_number?(old_value, new_value_before_type_cast); end +end + +# source://activemodel//lib/active_model/type/helpers/numeric.rb#56 +ActiveModel::Type::Helpers::Numeric::NUMERIC_REGEX = T.let(T.unsafe(nil), Regexp) + +# source://activemodel//lib/active_model/type/helpers/time_value.rb#9 +module ActiveModel::Type::Helpers::TimeValue + # source://activemodel//lib/active_model/type/helpers/time_value.rb#24 + def apply_seconds_precision(value); end + + # source://activemodel//lib/active_model/type/helpers/time_value.rb#10 + def serialize_cast_value(value); end + + # source://activemodel//lib/active_model/type/helpers/time_value.rb#38 + def type_cast_for_schema(value); end + + # source://activemodel//lib/active_model/type/helpers/time_value.rb#42 + def user_input_in_time_zone(value); end + + private + + # BUG: Wrapping the Time object with Time.at because Time.new with `in:` in Ruby 3.2.0 + # used to return an invalid Time object + # see: https://bugs.ruby-lang.org/issues/19292 + # + # source://activemodel//lib/active_model/type/helpers/time_value.rb#88 + def fast_string_to_time(string); end + + # source://activemodel//lib/active_model/type/helpers/time_value.rb#47 + def new_time(year, mon, mday, hour, min, sec, microsec, offset = T.unsafe(nil)); end +end + +# source://activemodel//lib/active_model/type/helpers/time_value.rb#64 +ActiveModel::Type::Helpers::TimeValue::ISO_DATETIME = T.let(T.unsafe(nil), Regexp) + +# source://activemodel//lib/active_model/type/helpers/timezone.rb#8 +module ActiveModel::Type::Helpers::Timezone + # source://activemodel//lib/active_model/type/helpers/timezone.rb#17 + def default_timezone; end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/type/helpers/timezone.rb#9 + def is_utc?; end +end + +# = Active Model \ImmutableString \Type +# +# Attribute type to represent immutable strings. It casts incoming values to +# frozen strings. +# +# class Person +# include ActiveModel::Attributes +# +# attribute :name, :immutable_string +# end +# +# person = Person.new +# person.name = 1 +# +# person.name # => "1" +# person.name.frozen? # => true +# +# Values are coerced to strings using their +to_s+ method. Boolean values +# are treated differently, however: +true+ will be cast to "t" and +# +false+ will be cast to "f". These strings can be customized when +# declaring an attribute: +# +# class Person +# include ActiveModel::Attributes +# +# attribute :active, :immutable_string, true: "aye", false: "nay" +# end +# +# person = Person.new +# person.active = true +# +# person.active # => "aye" +# +# source://activemodel//lib/active_model/type/immutable_string.rb#37 +class ActiveModel::Type::ImmutableString < ::ActiveModel::Type::Value + include ::ActiveModel::Type::Helpers::Immutable + + # @return [ImmutableString] a new instance of ImmutableString + # + # source://activemodel//lib/active_model/type/immutable_string.rb#40 + def initialize(**args); end + + # source://activemodel//lib/active_model/type/immutable_string.rb#50 + def serialize(value); end + + # source://activemodel//lib/active_model/type/immutable_string.rb#59 + def serialize_cast_value(value); end + + # source://activemodel//lib/active_model/type/immutable_string.rb#46 + def type; end + + private + + # source://activemodel//lib/active_model/type/immutable_string.rb#64 + def cast_value(value); end +end + +# = Active Model \Integer \Type +# +# Attribute type for integer representation. This type is registered under +# the +:integer+ key. +# +# class Person +# include ActiveModel::Attributes +# +# attribute :age, :integer +# end +# +# Values are cast using their +to_i+ method, except for blank strings, which +# are cast to +nil+. If a +to_i+ method is not defined or raises an error, +# the value will be cast to +nil+. +# +# person = Person.new +# +# person.age = "18" +# person.age # => 18 +# +# person.age = "" +# person.age # => nil +# +# person.age = :not_an_integer +# person.age # => nil (because Symbol does not define #to_i) +# +# Serialization also works under the same principle. Non-numeric strings are +# serialized as +nil+, for example. +# +# Serialization also validates that the integer can be stored using a +# limited number of bytes. If it cannot, an ActiveModel::RangeError will be +# raised. The default limit is 4 bytes, and can be customized when declaring +# an attribute: +# +# class Person +# include ActiveModel::Attributes +# +# attribute :age, :integer, limit: 6 +# end +# +# source://activemodel//lib/active_model/type/integer.rb#44 +class ActiveModel::Type::Integer < ::ActiveModel::Type::Value + include ::ActiveModel::Type::Helpers::Immutable + include ::ActiveModel::Type::Helpers::Numeric + + # @return [Integer] a new instance of Integer + # + # source://activemodel//lib/active_model/type/integer.rb#52 + def initialize(**_arg0); end + + # source://activemodel//lib/active_model/type/integer.rb#62 + def deserialize(value); end + + # @return [Boolean] + # @yield [cast_value] + # + # source://activemodel//lib/active_model/type/integer.rb#96 + def serializable?(value); end + + # source://activemodel//lib/active_model/type/integer.rb#67 + def serialize(value); end + + # source://activemodel//lib/active_model/type/integer.rb#88 + def serialize_cast_value(value); end + + # source://activemodel//lib/active_model/type/integer.rb#58 + def type; end + + private + + # source://activemodel//lib/active_model/type/integer.rb#120 + def _limit; end + + # source://activemodel//lib/active_model/type/integer.rb#108 + def cast_value(value); end + + # source://activemodel//lib/active_model/type/integer.rb#112 + def max_value; end + + # source://activemodel//lib/active_model/type/integer.rb#116 + def min_value; end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/type/integer.rb#104 + def out_of_range?(value); end +end + +# Column storage size in bytes. +# 4 bytes means an integer as opposed to smallint etc. +# +# source://activemodel//lib/active_model/type/integer.rb#50 +ActiveModel::Type::Integer::DEFAULT_LIMIT = T.let(T.unsafe(nil), Integer) + +# source://activemodel//lib/active_model/type/registry.rb#5 +class ActiveModel::Type::Registry + # @return [Registry] a new instance of Registry + # + # source://activemodel//lib/active_model/type/registry.rb#6 + def initialize; end + + # source://activemodel//lib/active_model/type/registry.rb#23 + def lookup(symbol, *_arg1, **_arg2, &_arg3); end + + # source://activemodel//lib/active_model/type/registry.rb#15 + def register(type_name, klass = T.unsafe(nil), &block); end + + private + + # source://activemodel//lib/active_model/type/registry.rb#10 + def initialize_copy(other); end + + # Returns the value of attribute registrations. + # + # source://activemodel//lib/active_model/type/registry.rb#34 + def registrations; end +end + +# source://activemodel//lib/active_model/type/serialize_cast_value.rb#5 +module ActiveModel::Type::SerializeCastValue + extend ::ActiveSupport::Concern + include ::ActiveModel::Type::SerializeCastValue::DefaultImplementation + + mixes_in_class_methods ::ActiveModel::Type::SerializeCastValue::ClassMethods + + # source://activemodel//lib/active_model/type/serialize_cast_value.rb#41 + def initialize(*_arg0, **_arg1, &_arg2); end + + # source://activemodel//lib/active_model/type/serialize_cast_value.rb#37 + def itself_if_serialize_cast_value_compatible; end + + class << self + # @private + # + # source://activemodel//lib/active_model/type/serialize_cast_value.rb#21 + def included(klass); end + + # source://activemodel//lib/active_model/type/serialize_cast_value.rb#25 + def serialize(type, value); end + end +end + +# source://activemodel//lib/active_model/type/serialize_cast_value.rb#8 +module ActiveModel::Type::SerializeCastValue::ClassMethods + # @return [Boolean] + # + # source://activemodel//lib/active_model/type/serialize_cast_value.rb#9 + def serialize_cast_value_compatible?; end +end + +# source://activemodel//lib/active_model/type/serialize_cast_value.rb#15 +module ActiveModel::Type::SerializeCastValue::DefaultImplementation + # source://activemodel//lib/active_model/type/serialize_cast_value.rb#16 + def serialize_cast_value(value); end +end + +# = Active Model \String \Type +# +# Attribute type for strings. It is registered under the +:string+ key. +# +# This class is a specialization of ActiveModel::Type::ImmutableString. It +# performs coercion in the same way, and can be configured in the same way. +# However, it accounts for mutable strings, so dirty tracking can properly +# check if a string has changed. +# +# source://activemodel//lib/active_model/type/string.rb#15 +class ActiveModel::Type::String < ::ActiveModel::Type::ImmutableString + # @return [Boolean] + # + # source://activemodel//lib/active_model/type/string.rb#16 + def changed_in_place?(raw_old_value, new_value); end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/type/string.rb#22 + def mutable?; end + + # source://activemodel//lib/active_model/type/string.rb#26 + def to_immutable_string; end + + private + + # source://activemodel//lib/active_model/type/string.rb#37 + def cast_value(value); end +end + +# = Active Model \Time \Type +# +# Attribute type for time of day representation. It is registered under the +# +:time+ key. +# +# class Event +# include ActiveModel::Attributes +# +# attribute :start, :time +# end +# +# String values are parsed using the ISO 8601 datetime format, but are +# normalized to have a date of 2000-01-01 and be in the UTC time zone. +# +# event = Event.new +# event.start = "2004-10-25T01:23:45-06:00" +# +# event.start.class # => Time +# event.start # => 2000-01-01 07:23:45 UTC +# +# Partial time-only formats are also accepted. +# +# event.start = "00:01:02+03:00" +# event.start # => 1999-12-31 21:01:02 UTC +# +# The degree of sub-second precision can be customized when declaring an +# attribute: +# +# class Event +# include ActiveModel::Attributes +# +# attribute :start, :time, precision: 4 +# end +# +# source://activemodel//lib/active_model/type/time.rb#38 +class ActiveModel::Type::Time < ::ActiveModel::Type::Value + include ::ActiveModel::Type::Helpers::Timezone + include ::ActiveModel::Type::Helpers::AcceptsMultiparameterTime::InstanceMethods + include ::ActiveModel::Type::Helpers::TimeValue + + # source://activemodel//lib/active_model/type/time.rb#45 + def type; end + + # source://activemodel//lib/active_model/type/time.rb#49 + def user_input_in_time_zone(value); end + + private + + # source://activemodel//lib/active_model/type/time.rb#69 + def cast_value(value); end +end + +# = Active Model \Value \Type +# +# The base class for all attribute types. This class also serves as the +# default type for attributes that do not specify a type. +# +# source://activemodel//lib/active_model/type/value.rb#9 +class ActiveModel::Type::Value + include ::ActiveModel::Type::SerializeCastValue + include ::ActiveModel::Type::SerializeCastValue::DefaultImplementation + extend ::ActiveModel::Type::SerializeCastValue::ClassMethods + + # Initializes a type with three basic configuration settings: precision, + # limit, and scale. The Value base class does not define behavior for + # these settings. It uses them for equality comparison and hash key + # generation only. + # + # @return [Value] a new instance of Value + # + # source://activemodel//lib/active_model/type/value.rb#17 + def initialize(precision: T.unsafe(nil), limit: T.unsafe(nil), scale: T.unsafe(nil)); end + + # source://activemodel//lib/active_model/type/value.rb#121 + def ==(other); end + + # @raise [NoMethodError] + # + # source://activemodel//lib/active_model/type/value.rb#144 + def as_json(*_arg0); end + + # source://activemodel//lib/active_model/type/value.rb#133 + def assert_valid_value(_); end + + # These predicates are not documented, as I need to look further into + # their use, and see if they can be removed entirely. + # + # @return [Boolean] + # + # source://activemodel//lib/active_model/type/value.rb#77 + def binary?; end + + # Type casts a value from user input (e.g. from a setter). This value may + # be a string from the form builder, or a ruby object passed to a setter. + # There is currently no way to differentiate between which source it came + # from. + # + # The return value of this method will be returned from + # ActiveRecord::AttributeMethods::Read#read_attribute. See also: + # Value#cast_value. + # + # +value+ The raw input, as provided to the attribute setter. + # + # source://activemodel//lib/active_model/type/value.rb#57 + def cast(value); end + + # Determines whether a value has changed for dirty checking. +old_value+ + # and +new_value+ will always be type-cast. Types should not need to + # override this method. + # + # @return [Boolean] + # + # source://activemodel//lib/active_model/type/value.rb#84 + def changed?(old_value, new_value, _new_value_before_type_cast); end + + # Determines whether the mutable value has been modified since it was + # read. Returns +false+ by default. If your type returns an object + # which could be mutated, you should override this method. You will need + # to either: + # + # - pass +new_value+ to Value#serialize and compare it to + # +raw_old_value+ + # + # or + # + # - pass +raw_old_value+ to Value#deserialize and compare it to + # +new_value+ + # + # +raw_old_value+ The original value, before being passed to + # +deserialize+. + # + # +new_value+ The current value, after type casting. + # + # @return [Boolean] + # + # source://activemodel//lib/active_model/type/value.rb#105 + def changed_in_place?(raw_old_value, new_value); end + + # Converts a value from database input to the appropriate ruby type. The + # return value of this method will be returned from + # ActiveRecord::AttributeMethods::Read#read_attribute. The default + # implementation just calls Value#cast. + # + # +value+ The raw input, as provided from the database. + # + # source://activemodel//lib/active_model/type/value.rb#43 + def deserialize(value); end + + # source://activemodel//lib/active_model/type/value.rb#127 + def eql?(other); end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/type/value.rb#113 + def force_equality?(_value); end + + # source://activemodel//lib/active_model/type/value.rb#129 + def hash; end + + # Returns the value of attribute limit. + # + # source://activemodel//lib/active_model/type/value.rb#11 + def limit; end + + # source://activemodel//lib/active_model/type/value.rb#117 + def map(value, &_arg1); end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/type/value.rb#140 + def mutable?; end + + # Returns the value of attribute precision. + # + # source://activemodel//lib/active_model/type/value.rb#11 + def precision; end + + # Returns the value of attribute scale. + # + # source://activemodel//lib/active_model/type/value.rb#11 + def scale; end + + # Returns true if this type can convert +value+ to a type that is usable + # by the database. For example a boolean type can return +true+ if the + # value parameter is a Ruby boolean, but may return +false+ if the value + # parameter is some other object. + # + # @return [Boolean] + # + # source://activemodel//lib/active_model/type/value.rb#28 + def serializable?(value, &_arg1); end + + # Casts a value from the ruby type to a type that the database knows how + # to understand. The returned value from this method should be a + # +String+, +Numeric+, +Date+, +Time+, +Symbol+, +true+, +false+, or + # +nil+. + # + # source://activemodel//lib/active_model/type/value.rb#65 + def serialize(value); end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/type/value.rb#136 + def serialized?; end + + # Returns the unique type name as a Symbol. Subclasses should override + # this method. + # + # source://activemodel//lib/active_model/type/value.rb#34 + def type; end + + # Type casts a value for schema dumping. This method is private, as we are + # hoping to remove it entirely. + # + # source://activemodel//lib/active_model/type/value.rb#71 + def type_cast_for_schema(value); end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/type/value.rb#109 + def value_constructed_by_mass_assignment?(_value); end + + private + + # Convenience method for types which do not need separate type casting + # behavior for user and database inputs. Called by Value#cast for + # values except +nil+. + # + # source://activemodel//lib/active_model/type/value.rb#152 + def cast_value(value); end +end + +# = Active \Model \UnknownAttributeError +# +# Raised when unknown attributes are supplied via mass assignment. +# +# class Person +# include ActiveModel::AttributeAssignment +# include ActiveModel::Validations +# end +# +# person = Person.new +# person.assign_attributes(name: 'Gorby') +# # => ActiveModel::UnknownAttributeError: unknown attribute 'name' for Person. +# +# source://activemodel//lib/active_model/errors.rb#535 +class ActiveModel::UnknownAttributeError < ::NoMethodError + # @return [UnknownAttributeError] a new instance of UnknownAttributeError + # + # source://activemodel//lib/active_model/errors.rb#538 + def initialize(record, attribute); end + + # Returns the value of attribute attribute. + # + # source://activemodel//lib/active_model/errors.rb#536 + def attribute; end + + # Returns the value of attribute record. + # + # source://activemodel//lib/active_model/errors.rb#536 + def record; end +end + +# source://activemodel//lib/active_model/gem_version.rb#9 +module ActiveModel::VERSION; end + +# source://activemodel//lib/active_model/gem_version.rb#10 +ActiveModel::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# source://activemodel//lib/active_model/gem_version.rb#11 +ActiveModel::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# source://activemodel//lib/active_model/gem_version.rb#13 +ActiveModel::VERSION::PRE = T.let(T.unsafe(nil), T.untyped) + +# source://activemodel//lib/active_model/gem_version.rb#15 +ActiveModel::VERSION::STRING = T.let(T.unsafe(nil), String) + +# source://activemodel//lib/active_model/gem_version.rb#12 +ActiveModel::VERSION::TINY = T.let(T.unsafe(nil), Integer) + +# source://activemodel//lib/active_model/validations.rb#491 +class ActiveModel::ValidationContext + # Returns the value of attribute context. + # + # source://activemodel//lib/active_model/validations.rb#492 + def context; end + + # Sets the attribute context + # + # @param value the value to set the attribute context to. + # + # source://activemodel//lib/active_model/validations.rb#492 + def context=(_arg0); end +end + +# = Active \Model \ValidationError +# +# Raised by validate! when the model is invalid. Use the +# +model+ method to retrieve the record which did not validate. +# +# begin +# complex_operation_that_internally_calls_validate! +# rescue ActiveModel::ValidationError => invalid +# puts invalid.model.errors +# end +# +# source://activemodel//lib/active_model/validations.rb#481 +class ActiveModel::ValidationError < ::StandardError + # @return [ValidationError] a new instance of ValidationError + # + # source://activemodel//lib/active_model/validations.rb#484 + def initialize(model); end + + # Returns the value of attribute model. + # + # source://activemodel//lib/active_model/validations.rb#482 + def model; end +end + +# = Active \Model \Validations +# +# Provides a full validation framework to your objects. +# +# A minimal implementation could be: +# +# class Person +# include ActiveModel::Validations +# +# attr_accessor :first_name, :last_name +# +# validates_each :first_name, :last_name do |record, attr, value| +# record.errors.add attr, "starts with z." if value.start_with?("z") +# end +# end +# +# Which provides you with the full standard validation stack that you +# know from Active Record: +# +# person = Person.new +# person.valid? # => true +# person.invalid? # => false +# +# person.first_name = 'zoolander' +# person.valid? # => false +# person.invalid? # => true +# person.errors.messages # => {first_name:["starts with z."]} +# +# Note that +ActiveModel::Validations+ automatically adds an +errors+ +# method to your instances initialized with a new ActiveModel::Errors +# object, so there is no need for you to do this manually. +# +# source://activemodel//lib/active_model/validations.rb#37 +module ActiveModel::Validations + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActiveSupport::Callbacks + include ::ActiveModel::Validations::HelperMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveModel::Validations::ClassMethods + mixes_in_class_methods ::ActiveModel::Callbacks + mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods + mixes_in_class_methods ::ActiveSupport::DescendantsTracker + mixes_in_class_methods ::ActiveModel::Translation + mixes_in_class_methods ::ActiveModel::Validations::HelperMethods + + # Returns the +Errors+ object that holds all information about attribute + # error messages. + # + # class Person + # include ActiveModel::Validations + # + # attr_accessor :name + # validates_presence_of :name + # end + # + # person = Person.new + # person.valid? # => false + # person.errors # => # + # + # source://activemodel//lib/active_model/validations.rb#330 + def errors; end + + # source://activemodel//lib/active_model/validations.rb#374 + def freeze; end + + # Performs the opposite of valid?. Returns +true+ if errors were + # added, +false+ otherwise. + # + # class Person + # include ActiveModel::Validations + # + # attr_accessor :name + # validates_presence_of :name + # end + # + # person = Person.new + # person.name = '' + # person.invalid? # => true + # person.name = 'david' + # person.invalid? # => false + # + # Context can optionally be supplied to define which callbacks to test + # against (the context is defined on the validations using :on). + # + # class Person + # include ActiveModel::Validations + # + # attr_accessor :name + # validates_presence_of :name, on: :new + # end + # + # person = Person.new + # person.invalid? # => false + # person.invalid?(:new) # => true + # + # @return [Boolean] + # + # source://activemodel//lib/active_model/validations.rb#410 + def invalid?(context = T.unsafe(nil)); end + + # Hook method defining how an attribute value should be retrieved. By default + # this is assumed to be an instance named after the attribute. Override this + # method in subclasses should you need to retrieve the value for a given + # attribute differently: + # + # class MyClass + # include ActiveModel::Validations + # + # def initialize(data = {}) + # @data = data + # end + # + # def read_attribute_for_validation(key) + # @data[key] + # end + # end + # + # source://activemodel//lib/active_model/validations.rb#439 + def read_attribute_for_validation(*_arg0); end + + # Runs all the specified validations and returns +true+ if no errors were + # added otherwise +false+. + # + # class Person + # include ActiveModel::Validations + # + # attr_accessor :name + # validates_presence_of :name + # end + # + # person = Person.new + # person.name = '' + # person.valid? # => false + # person.name = 'david' + # person.valid? # => true + # + # Context can optionally be supplied to define which callbacks to test + # against (the context is defined on the validations using :on). + # + # class Person + # include ActiveModel::Validations + # + # attr_accessor :name + # validates_presence_of :name, on: :new + # end + # + # person = Person.new + # person.valid? # => true + # person.valid?(:new) # => false + # + # @return [Boolean] + # + # source://activemodel//lib/active_model/validations.rb#363 + def valid?(context = T.unsafe(nil)); end + + # Runs all the specified validations and returns +true+ if no errors were + # added otherwise +false+. + # + # class Person + # include ActiveModel::Validations + # + # attr_accessor :name + # validates_presence_of :name + # end + # + # person = Person.new + # person.name = '' + # person.valid? # => false + # person.name = 'david' + # person.valid? # => true + # + # Context can optionally be supplied to define which callbacks to test + # against (the context is defined on the validations using :on). + # + # class Person + # include ActiveModel::Validations + # + # attr_accessor :name + # validates_presence_of :name, on: :new + # end + # + # person = Person.new + # person.valid? # => true + # person.valid?(:new) # => false + # + # @return [Boolean] + # + # source://activemodel//lib/active_model/validations.rb#372 + def validate(context = T.unsafe(nil)); end + + # Runs all the validations within the specified context. Returns +true+ if + # no errors are found, raises +ValidationError+ otherwise. + # + # Validations with no :on option will run no matter the context. Validations with + # some :on option will only run in the specified context. + # + # source://activemodel//lib/active_model/validations.rb#419 + def validate!(context = T.unsafe(nil)); end + + # Passes the record off to the class or classes specified and allows them + # to add errors based on more complex conditions. + # + # class Person + # include ActiveModel::Validations + # + # validate :instance_validations + # + # def instance_validations + # validates_with MyValidator + # end + # end + # + # Please consult the class method documentation for more information on + # creating your own validator. + # + # You may also pass it multiple classes, like so: + # + # class Person + # include ActiveModel::Validations + # + # validate :instance_validations, on: :create + # + # def instance_validations + # validates_with MyValidator, MyOtherValidator + # end + # end + # + # Standard configuration options (:on, :if and + # :unless), which are available on the class version of + # +validates_with+, should instead be placed on the +validates+ method + # as these are applied and tested in the callback. + # + # If you pass any additional configuration options, they will be passed + # to the class and available as +options+, please refer to the + # class version of this method for more information. + # + # source://activemodel//lib/active_model/validations/with.rb#144 + def validates_with(*args, &block); end + + # Returns the context when running validations. + # + # source://activemodel//lib/active_model/validations.rb#442 + def validation_context; end + + private + + # source://activemodel//lib/active_model/validations.rb#451 + def context_for_validation; end + + # source://activemodel//lib/active_model/validations.rb#455 + def init_internals; end + + # Clean the +Errors+ object if instance is duped. + # + # source://activemodel//lib/active_model/validations.rb#312 + def initialize_dup(other); end + + # @raise [ValidationError] + # + # source://activemodel//lib/active_model/validations.rb#466 + def raise_validation_error; end + + # source://activemodel//lib/active_model/validations.rb#461 + def run_validations!; end + + # source://activemodel//lib/active_model/validations.rb#447 + def validation_context=(context); end + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + def _validators; end + def _validators=(value); end + def _validators?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + def _validators; end + def _validators?; end + end +end + +# == \Active \Model Absence Validator +# +# source://activemodel//lib/active_model/validations/absence.rb#6 +class ActiveModel::Validations::AbsenceValidator < ::ActiveModel::EachValidator + # source://activemodel//lib/active_model/validations/absence.rb#7 + def validate_each(record, attr_name, value); end +end + +# source://activemodel//lib/active_model/validations/acceptance.rb#5 +class ActiveModel::Validations::AcceptanceValidator < ::ActiveModel::EachValidator + # @return [AcceptanceValidator] a new instance of AcceptanceValidator + # + # source://activemodel//lib/active_model/validations/acceptance.rb#6 + def initialize(options); end + + # source://activemodel//lib/active_model/validations/acceptance.rb#11 + def validate_each(record, attribute, value); end + + private + + # @return [Boolean] + # + # source://activemodel//lib/active_model/validations/acceptance.rb#23 + def acceptable_option?(value); end + + # source://activemodel//lib/active_model/validations/acceptance.rb#18 + def setup!(klass); end +end + +# source://activemodel//lib/active_model/validations/acceptance.rb#27 +class ActiveModel::Validations::AcceptanceValidator::LazilyDefineAttributes < ::Module + # @return [LazilyDefineAttributes] a new instance of LazilyDefineAttributes + # + # source://activemodel//lib/active_model/validations/acceptance.rb#28 + def initialize(attributes); end + + # source://activemodel//lib/active_model/validations/acceptance.rb#73 + def ==(other); end + + # source://activemodel//lib/active_model/validations/acceptance.rb#56 + def define_on(klass); end + + # source://activemodel//lib/active_model/validations/acceptance.rb#32 + def included(klass); end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/validations/acceptance.rb#51 + def matches?(method_name); end + + protected + + # Returns the value of attribute attributes. + # + # source://activemodel//lib/active_model/validations/acceptance.rb#78 + def attributes; end +end + +# = Active \Model \Validation \Callbacks +# +# Provides an interface for any class to have ClassMethods#before_validation and +# ClassMethods#after_validation callbacks. +# +# First, include +ActiveModel::Validations::Callbacks+ from the class you are +# creating: +# +# class MyModel +# include ActiveModel::Validations::Callbacks +# +# before_validation :do_stuff_before_validation +# after_validation :do_stuff_after_validation +# end +# +# Like other before_* callbacks if +before_validation+ throws +# +:abort+ then valid? will not be called. +# +# source://activemodel//lib/active_model/validations/callbacks.rb#22 +module ActiveModel::Validations::Callbacks + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActiveSupport::Callbacks + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveModel::Validations::Callbacks::ClassMethods + mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods + mixes_in_class_methods ::ActiveSupport::DescendantsTracker + + private + + # Override run_validations! to include callbacks. + # + # source://activemodel//lib/active_model/validations/callbacks.rb#124 + def run_validations!; end + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + end + + module GeneratedInstanceMethods + def __callbacks; end + end +end + +# source://activemodel//lib/active_model/validations/callbacks.rb#32 +module ActiveModel::Validations::Callbacks::ClassMethods + # Defines a callback that will get called right after validation. + # + # class Person + # include ActiveModel::Validations + # include ActiveModel::Validations::Callbacks + # + # attr_accessor :name, :status + # + # validates_presence_of :name + # + # after_validation :set_status + # + # private + # def set_status + # self.status = errors.empty? + # end + # end + # + # person = Person.new + # person.name = '' + # person.valid? # => false + # person.status # => false + # person.name = 'bob' + # person.valid? # => true + # person.status # => true + # + # source://activemodel//lib/active_model/validations/callbacks.rb#88 + def after_validation(*args, &block); end + + # Defines a callback that will get called right before validation. + # + # class Person + # include ActiveModel::Validations + # include ActiveModel::Validations::Callbacks + # + # attr_accessor :name + # + # validates_length_of :name, maximum: 6 + # + # before_validation :remove_whitespaces + # + # private + # def remove_whitespaces + # name.strip! + # end + # end + # + # person = Person.new + # person.name = ' bob ' + # person.valid? # => true + # person.name # => "bob" + # + # source://activemodel//lib/active_model/validations/callbacks.rb#55 + def before_validation(*args, &block); end + + private + + # source://activemodel//lib/active_model/validations/callbacks.rb#99 + def set_options_for_callback(options); end +end + +# source://activemodel//lib/active_model/validations.rb#53 +module ActiveModel::Validations::ClassMethods + # Returns +true+ if +attribute+ is an attribute method, +false+ otherwise. + # + # class Person + # include ActiveModel::Validations + # + # attr_accessor :name + # end + # + # User.attribute_method?(:name) # => true + # User.attribute_method?(:age) # => false + # + # @return [Boolean] + # + # source://activemodel//lib/active_model/validations.rb#284 + def attribute_method?(attribute); end + + # Clears all of the validators and validations. + # + # Note that this will clear anything that is being used to validate + # the model for both the +validates_with+ and +validate+ methods. + # It clears the validators that are created with an invocation of + # +validates_with+ and the callbacks that are set by an invocation + # of +validate+. + # + # class Person + # include ActiveModel::Validations + # + # validates_with MyValidator + # validates_with OtherValidator, on: :create + # validates_with StrictValidator, strict: true + # validate :cannot_be_robot + # + # def cannot_be_robot + # errors.add(:base, 'A person cannot be a robot') if person_is_robot + # end + # end + # + # Person.validators + # # => [ + # # #, + # # #, + # # # + # # ] + # + # If one runs Person.clear_validators! and then checks to see what + # validators this class has, you would obtain: + # + # Person.validators # => [] + # + # Also, the callback set by validate :cannot_be_robot will be erased + # so that: + # + # Person._validate_callbacks.empty? # => true + # + # source://activemodel//lib/active_model/validations.rb#248 + def clear_validators!; end + + # Copy validators on inheritance. + # + # source://activemodel//lib/active_model/validations.rb#289 + def inherited(base); end + + # Adds a validation method or block to the class. This is useful when + # overriding the +validate+ instance method becomes too unwieldy and + # you're looking for more descriptive declaration of your validations. + # + # This can be done with a symbol pointing to a method: + # + # class Comment + # include ActiveModel::Validations + # + # validate :must_be_friends + # + # def must_be_friends + # errors.add(:base, 'Must be friends to leave a comment') unless commenter.friend_of?(commentee) + # end + # end + # + # With a block which is passed with the current record to be validated: + # + # class Comment + # include ActiveModel::Validations + # + # validate do |comment| + # comment.must_be_friends + # end + # + # def must_be_friends + # errors.add(:base, 'Must be friends to leave a comment') unless commenter.friend_of?(commentee) + # end + # end + # + # Or with a block where +self+ points to the current record to be validated: + # + # class Comment + # include ActiveModel::Validations + # + # validate do + # errors.add(:base, 'Must be friends to leave a comment') unless commenter.friend_of?(commentee) + # end + # end + # + # Note that the return value of validation methods is not relevant. + # It's not possible to halt the validate callback chain. + # + # ==== Options + # + # * :on - Specifies the contexts where this validation is active. + # Runs in all validation contexts by default +nil+. You can pass a symbol + # or an array of symbols. (e.g. on: :create or + # on: :custom_validation_context or + # on: [:create, :custom_validation_context]) + # * :except_on - Specifies the contexts where this validation is not active. + # Runs in all validation contexts by default +nil+. You can pass a symbol + # or an array of symbols. (e.g. except: :create or + # except_on: :custom_validation_context or + # except_on: [:create, :custom_validation_context]) + # * :if - Specifies a method or proc to call to determine + # if the validation should occur (e.g. if: :allow_validation, + # or if: Proc.new { |user| user.signup_step > 2 }). The method or + # proc should return or evaluate to a +true+ or +false+ value. + # * :unless - Specifies a method or proc to call to + # determine if the validation should not occur (e.g. unless: :skip_validation, + # or unless: Proc.new { |user| user.signup_step <= 2 }). The + # method or proc should return or evaluate to a +true+ or +false+ + # value. + # + # NOTE: Calling +validate+ multiple times on the same method will overwrite previous definitions. + # + # source://activemodel//lib/active_model/validations.rb#162 + def validate(*args, &block); end + + # This method is a shortcut to all default validators and any custom + # validator classes ending in 'Validator'. Note that \Rails default + # validators can be overridden inside specific classes by creating + # custom validator classes in their place such as PresenceValidator. + # + # Examples of using the default Rails validators: + # + # validates :username, absence: true + # validates :terms, acceptance: true + # validates :password, confirmation: true + # validates :username, exclusion: { in: %w(admin superuser) } + # validates :email, format: { with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, on: :create } + # validates :age, inclusion: { in: 0..9 } + # validates :first_name, length: { maximum: 30 } + # validates :age, numericality: true + # validates :username, presence: true + # + # The power of the +validates+ method comes when using custom validators + # and default validators in one call for a given attribute. + # + # class EmailValidator < ActiveModel::EachValidator + # def validate_each(record, attribute, value) + # record.errors.add attribute, (options[:message] || "is not an email") unless + # /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i.match?(value) + # end + # end + # + # class Person + # include ActiveModel::Validations + # attr_accessor :name, :email + # + # validates :name, presence: true, length: { maximum: 100 } + # validates :email, presence: true, email: true + # end + # + # Validator classes may also exist within the class being validated + # allowing custom modules of validators to be included as needed. + # + # class Film + # include ActiveModel::Validations + # + # class TitleValidator < ActiveModel::EachValidator + # def validate_each(record, attribute, value) + # record.errors.add attribute, "must start with 'the'" unless /\Athe/i.match?(value) + # end + # end + # + # validates :name, title: true + # end + # + # Additionally validator classes may be in another namespace and still + # used within any class. + # + # validates :name, :'film/title' => true + # + # The validators hash can also handle regular expressions, ranges, arrays + # and strings in shortcut form. + # + # validates :email, format: /@/ + # validates :role, inclusion: %w(admin contributor) + # validates :password, length: 6..20 + # + # When using shortcut form, ranges and arrays are passed to your + # validator's initializer as options[:in] while other types + # including regular expressions and strings are passed as options[:with]. + # + # There is also a list of options that could be used along with validators: + # + # * :on - Specifies the contexts where this validation is active. + # Runs in all validation contexts by default +nil+. You can pass a symbol + # or an array of symbols. (e.g. on: :create or + # on: :custom_validation_context or + # on: [:create, :custom_validation_context]) + # * :except_on - Specifies the contexts where this validation is not active. + # Runs in all validation contexts by default +nil+. You can pass a symbol + # or an array of symbols. (e.g. except: :create or + # except_on: :custom_validation_context or + # except_on: [:create, :custom_validation_context]) + # * :if - Specifies a method, proc or string to call to determine + # if the validation should occur (e.g. if: :allow_validation, + # or if: Proc.new { |user| user.signup_step > 2 }). The method, + # proc or string should return or evaluate to a +true+ or +false+ value. + # * :unless - Specifies a method, proc, or string to call to determine + # if the validation should not occur (e.g. unless: :skip_validation, + # or unless: Proc.new { |user| user.signup_step <= 2 }). The + # method, proc, or string should return or evaluate to a +true+ or + # +false+ value. + # * :allow_nil - Skip validation if the attribute is +nil+. + # * :allow_blank - Skip validation if the attribute is blank. + # * :strict - If the :strict option is set to true + # will raise ActiveModel::StrictValidationFailed instead of adding the error. + # :strict option can also be set to any other exception. + # + # Example: + # + # validates :password, presence: true, confirmation: true, if: :password_required? + # validates :token, length: { is: 24 }, strict: TokenLengthException + # + # + # Finally, the options +:if+, +:unless+, +:on+, +:allow_blank+, +:allow_nil+, +:strict+ + # and +:message+ can be given to one specific validator, as a hash: + # + # validates :password, presence: { if: :password_required?, message: 'is forgotten.' }, confirmation: true + # + # @raise [ArgumentError] + # + # source://activemodel//lib/active_model/validations/validates.rb#111 + def validates(*attributes); end + + # This method is used to define validations that cannot be corrected by end + # users and are considered exceptional. So each validator defined with bang + # or :strict option set to true will always raise + # ActiveModel::StrictValidationFailed instead of adding error + # when validation fails. See validates for more information about + # the validation itself. + # + # class Person + # include ActiveModel::Validations + # + # attr_accessor :name + # validates! :name, presence: true + # end + # + # person = Person.new + # person.name = '' + # person.valid? + # # => ActiveModel::StrictValidationFailed: Name can't be blank + # + # source://activemodel//lib/active_model/validations/validates.rb#153 + def validates!(*attributes); end + + # Validates each attribute against a block. + # + # class Person + # include ActiveModel::Validations + # + # attr_accessor :first_name, :last_name + # + # validates_each :first_name, :last_name, allow_blank: true do |record, attr, value| + # record.errors.add attr, "starts with z." if value.start_with?("z") + # end + # end + # + # ==== Options + # + # * :on - Specifies the contexts where this validation is active. + # Runs in all validation contexts by default +nil+. You can pass a symbol + # or an array of symbols. (e.g. on: :create or + # on: :custom_validation_context or + # on: [:create, :custom_validation_context]) + # * :except_on - Specifies the contexts where this validation is not active. + # Runs in all validation contexts by default +nil+. You can pass a symbol + # or an array of symbols. (e.g. except: :create or + # except_on: :custom_validation_context or + # except_on: [:create, :custom_validation_context]) + # * :allow_nil - Skip validation if attribute is +nil+. + # * :allow_blank - Skip validation if attribute is blank. + # * :if - Specifies a method, proc, or string to call to determine + # if the validation should occur (e.g. if: :allow_validation, + # or if: Proc.new { |user| user.signup_step > 2 }). The method, + # proc or string should return or evaluate to a +true+ or +false+ value. + # * :unless - Specifies a method, proc, or string to call to + # determine if the validation should not occur (e.g. unless: :skip_validation, + # or unless: Proc.new { |user| user.signup_step <= 2 }). The + # method, proc, or string should return or evaluate to a +true+ or +false+ + # value. + # + # source://activemodel//lib/active_model/validations.rb#89 + def validates_each(*attr_names, &block); end + + # Passes the record off to the class or classes specified and allows them + # to add errors based on more complex conditions. + # + # class Person + # include ActiveModel::Validations + # validates_with MyValidator + # end + # + # class MyValidator < ActiveModel::Validator + # def validate(record) + # if some_complex_logic + # record.errors.add :base, 'This record is invalid' + # end + # end + # + # private + # def some_complex_logic + # # ... + # end + # end + # + # You may also pass it multiple classes, like so: + # + # class Person + # include ActiveModel::Validations + # validates_with MyValidator, MyOtherValidator, on: :create + # end + # + # There is no default error message for +validates_with+. You must + # manually add errors to the record's errors collection in the validator + # class. + # + # To implement the validate method, you must have a +record+ parameter + # defined, which is the record to be validated. + # + # Configuration options: + # * :on - Specifies the contexts where this validation is active. + # Runs in all validation contexts by default +nil+. You can pass a symbol + # or an array of symbols. (e.g. on: :create or + # on: :custom_validation_context or + # on: [:create, :custom_validation_context]) + # * :if - Specifies a method, proc, or string to call to determine + # if the validation should occur (e.g. if: :allow_validation, + # or if: Proc.new { |user| user.signup_step > 2 }). + # The method, proc, or string should return or evaluate to a +true+ or + # +false+ value. + # * :unless - Specifies a method, proc, or string to call to + # determine if the validation should not occur + # (e.g. unless: :skip_validation, or + # unless: Proc.new { |user| user.signup_step <= 2 }). + # The method, proc, or string should return or evaluate to a +true+ or + # +false+ value. + # * :strict - Specifies whether validation should be strict. + # See ActiveModel::Validations#validates! for more information. + # + # If you pass any additional configuration options, they will be passed + # to the class and available as +options+: + # + # class Person + # include ActiveModel::Validations + # validates_with MyValidator, my_custom_key: 'my custom value' + # end + # + # class MyValidator < ActiveModel::Validator + # def validate(record) + # options[:my_custom_key] # => "my custom value" + # end + # end + # + # source://activemodel//lib/active_model/validations/with.rb#88 + def validates_with(*args, &block); end + + # List all validators that are being used to validate the model using + # +validates_with+ method. + # + # class Person + # include ActiveModel::Validations + # + # validates_with MyValidator + # validates_with OtherValidator, on: :create + # validates_with StrictValidator, strict: true + # end + # + # Person.validators + # # => [ + # # #, + # # #, + # # # + # # ] + # + # source://activemodel//lib/active_model/validations.rb#206 + def validators; end + + # List all validators that are being used to validate a specific attribute. + # + # class Person + # include ActiveModel::Validations + # + # attr_accessor :name, :age + # + # validates_presence_of :name + # validates_inclusion_of :age, in: 0..99 + # end + # + # Person.validators_on(:name) + # # => [ + # # #, + # # ] + # + # source://activemodel//lib/active_model/validations.rb#268 + def validators_on(*attributes); end + + private + + # source://activemodel//lib/active_model/validations/validates.rb#166 + def _parse_validates_options(options); end + + # When creating custom validators, it might be useful to be able to specify + # additional default keys. This can be done by overwriting this method. + # + # source://activemodel//lib/active_model/validations/validates.rb#162 + def _validates_default_keys; end + + # source://activemodel//lib/active_model/validations.rb#298 + def predicate_for_validation_context(context); end +end + +# source://activemodel//lib/active_model/validations.rb#93 +ActiveModel::Validations::ClassMethods::VALID_OPTIONS_FOR_VALIDATE = T.let(T.unsafe(nil), Array) + +# source://activemodel//lib/active_model/validations/clusivity.rb#8 +module ActiveModel::Validations::Clusivity + include ::ActiveModel::Validations::ResolveValue + + # source://activemodel//lib/active_model/validations/clusivity.rb#14 + def check_validity!; end + + private + + # source://activemodel//lib/active_model/validations/clusivity.rb#31 + def delimiter; end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/validations/clusivity.rb#21 + def include?(record, value); end + + # After Ruby 2.2, Range#include? on non-number-or-time-ish ranges checks all + # possible values in the range for equality, which is slower but more accurate. + # Range#cover? uses the previous logic of comparing a value with the range + # endpoints, which is fast but is only accurate on Numeric, Time, Date, + # or DateTime ranges. + # + # source://activemodel//lib/active_model/validations/clusivity.rb#40 + def inclusion_method(enumerable); end +end + +# source://activemodel//lib/active_model/validations/clusivity.rb#11 +ActiveModel::Validations::Clusivity::ERROR_MESSAGE = T.let(T.unsafe(nil), String) + +# source://activemodel//lib/active_model/validations/comparability.rb#5 +module ActiveModel::Validations::Comparability + # source://activemodel//lib/active_model/validations/comparability.rb#10 + def error_options(value, option_value); end +end + +# source://activemodel//lib/active_model/validations/comparability.rb#6 +ActiveModel::Validations::Comparability::COMPARE_CHECKS = T.let(T.unsafe(nil), Hash) + +# source://activemodel//lib/active_model/validations/comparison.rb#8 +class ActiveModel::Validations::ComparisonValidator < ::ActiveModel::EachValidator + include ::ActiveModel::Validations::Comparability + include ::ActiveModel::Validations::ResolveValue + + # source://activemodel//lib/active_model/validations/comparison.rb#12 + def check_validity!; end + + # source://activemodel//lib/active_model/validations/comparison.rb#19 + def validate_each(record, attr_name, value); end +end + +# source://activemodel//lib/active_model/validations/confirmation.rb#5 +class ActiveModel::Validations::ConfirmationValidator < ::ActiveModel::EachValidator + # @return [ConfirmationValidator] a new instance of ConfirmationValidator + # + # source://activemodel//lib/active_model/validations/confirmation.rb#6 + def initialize(options); end + + # source://activemodel//lib/active_model/validations/confirmation.rb#11 + def validate_each(record, attribute, value); end + + private + + # @return [Boolean] + # + # source://activemodel//lib/active_model/validations/confirmation.rb#31 + def confirmation_value_equal?(record, attribute, value, confirmed); end + + # source://activemodel//lib/active_model/validations/confirmation.rb#21 + def setup!(klass); end +end + +# source://activemodel//lib/active_model/validations/exclusion.rb#7 +class ActiveModel::Validations::ExclusionValidator < ::ActiveModel::EachValidator + include ::ActiveModel::Validations::ResolveValue + include ::ActiveModel::Validations::Clusivity + + # source://activemodel//lib/active_model/validations/exclusion.rb#10 + def validate_each(record, attribute, value); end +end + +# source://activemodel//lib/active_model/validations/format.rb#7 +class ActiveModel::Validations::FormatValidator < ::ActiveModel::EachValidator + include ::ActiveModel::Validations::ResolveValue + + # source://activemodel//lib/active_model/validations/format.rb#20 + def check_validity!; end + + # source://activemodel//lib/active_model/validations/format.rb#10 + def validate_each(record, attribute, value); end + + private + + # source://activemodel//lib/active_model/validations/format.rb#34 + def check_options_validity(name); end + + # source://activemodel//lib/active_model/validations/format.rb#30 + def record_error(record, attribute, name, value); end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/validations/format.rb#48 + def regexp_using_multiline_anchors?(regexp); end +end + +# source://activemodel//lib/active_model/validations/absence.rb#12 +module ActiveModel::Validations::HelperMethods + # Validates that the specified attributes are blank (as defined by + # Object#present?). + # + # class Person < ActiveRecord::Base + # validates_absence_of :first_name + # end + # + # The first_name attribute must be in the object and it must be blank. + # + # Configuration options: + # * :message - A custom error message (default is: "must be blank"). + # + # There is also a list of default options supported by every validator: + # +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+. + # See ActiveModel::Validations::ClassMethods#validates for more information. + # + # source://activemodel//lib/active_model/validations/absence.rb#28 + def validates_absence_of(*attr_names); end + + # Encapsulates the pattern of wanting to validate the acceptance of a + # terms of service check box (or similar agreement). + # + # class Person < ActiveRecord::Base + # validates_acceptance_of :terms_of_service + # validates_acceptance_of :eula, message: 'must be abided' + # end + # + # If the database column does not exist, the +terms_of_service+ attribute + # is entirely virtual. This check is performed only if +terms_of_service+ + # is not +nil+. + # + # Configuration options: + # * :message - A custom error message (default is: "must be + # accepted"). + # * :accept - Specifies a value that is considered accepted. + # Also accepts an array of possible values. The default value is + # an array ["1", true], which makes it easy to relate to an HTML + # checkbox. This should be set to, or include, +true+ if you are validating + # a database column, since the attribute is typecast from "1" to +true+ + # before validation. + # + # There is also a list of default options supported by every validator: + # +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+. + # See ActiveModel::Validations::ClassMethods#validates for more information. + # + # source://activemodel//lib/active_model/validations/acceptance.rb#108 + def validates_acceptance_of(*attr_names); end + + # Validates the value of a specified attribute fulfills all + # defined comparisons with another value, proc, or attribute. + # + # class Person < ActiveRecord::Base + # validates_comparison_of :value, greater_than: 'the sum of its parts' + # end + # + # Configuration options: + # * :message - A custom error message (default is: "failed comparison"). + # * :greater_than - Specifies the value must be greater than the + # supplied value. The default error message for this option is _"must be + # greater than %{count}"_. + # * :greater_than_or_equal_to - Specifies the value must be + # greater than or equal to the supplied value. The default error message + # for this option is _"must be greater than or equal to %{count}"_. + # * :equal_to - Specifies the value must be equal to the supplied + # value. The default error message for this option is _"must be equal to + # %{count}"_. + # * :less_than - Specifies the value must be less than the + # supplied value. The default error message for this option is _"must be + # less than %{count}"_. + # * :less_than_or_equal_to - Specifies the value must be less + # than or equal to the supplied value. The default error message for + # this option is _"must be less than or equal to %{count}"_. + # * :other_than - Specifies the value must not be equal to the + # supplied value. The default error message for this option is _"must be + # other than %{count}"_. + # + # There is also a list of default options supported by every validator: + # +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+ . + # See ActiveModel::Validations::ClassMethods#validates for more information. + # + # The validator requires at least one of the following checks to be supplied. + # Each will accept a proc, value, or a symbol which corresponds to a method: + # + # * :greater_than + # * :greater_than_or_equal_to + # * :equal_to + # * :less_than + # * :less_than_or_equal_to + # * :other_than + # + # For example: + # + # class Person < ActiveRecord::Base + # validates_comparison_of :birth_date, less_than_or_equal_to: -> { Date.today } + # validates_comparison_of :preferred_name, other_than: :given_name, allow_nil: true + # end + # + # source://activemodel//lib/active_model/validations/comparison.rb#85 + def validates_comparison_of(*attr_names); end + + # Encapsulates the pattern of wanting to validate a password or email + # address field with a confirmation. + # + # Model: + # class Person < ActiveRecord::Base + # validates_confirmation_of :user_name, :password + # validates_confirmation_of :email_address, + # message: 'should match confirmation' + # end + # + # View: + # <%= password_field "person", "password" %> + # <%= password_field "person", "password_confirmation" %> + # + # The added +password_confirmation+ attribute is virtual; it exists only + # as an in-memory attribute for validating the password. To achieve this, + # the validation adds accessors to the model for the confirmation + # attribute. + # + # NOTE: This check is performed only if +password_confirmation+ is not + # +nil+. To require confirmation, make sure to add a presence check for + # the confirmation attribute: + # + # validates_presence_of :password_confirmation, if: :password_changed? + # + # Configuration options: + # * :message - A custom error message (default is: "doesn't match + # %{translated_attribute_name}"). + # * :case_sensitive - Looks for an exact match. Ignored by + # non-text columns (+true+ by default). + # + # There is also a list of default options supported by every validator: + # +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+. + # See ActiveModel::Validations::ClassMethods#validates for more information. + # + # source://activemodel//lib/active_model/validations/confirmation.rb#75 + def validates_confirmation_of(*attr_names); end + + # Validates that the value of the specified attribute is not in a + # particular enumerable object. + # + # class Person < ActiveRecord::Base + # validates_exclusion_of :username, in: %w( admin superuser ), message: "You don't belong here" + # validates_exclusion_of :age, in: 30..60, message: 'This site is only for under 30 and over 60' + # validates_exclusion_of :format, in: %w( mov avi ), message: "extension %{value} is not allowed" + # validates_exclusion_of :password, in: ->(person) { [person.username, person.first_name] }, + # message: 'should not be the same as your username or first name' + # validates_exclusion_of :karma, in: :reserved_karmas + # end + # + # Configuration options: + # * :in - An enumerable object of items that the value shouldn't + # be part of. This can be supplied as a proc, lambda, or symbol which returns an + # enumerable. If the enumerable is a numerical, time, or datetime range the test + # is performed with Range#cover?, otherwise with include?. When + # using a proc or lambda the instance under validation is passed as an argument. + # * :within - A synonym(or alias) for :in + # Range#cover?, otherwise with include?. + # * :message - Specifies a custom error message (default is: "is + # reserved"). + # + # There is also a list of default options supported by every validator: + # +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+. + # See ActiveModel::Validations::ClassMethods#validates for more information. + # + # source://activemodel//lib/active_model/validations/exclusion.rb#44 + def validates_exclusion_of(*attr_names); end + + # Validates whether the value of the specified attribute is of the correct + # form, going by the regular expression provided. You can require that the + # attribute matches the regular expression: + # + # class Person < ActiveRecord::Base + # validates_format_of :email, with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, on: :create + # end + # + # Alternatively, you can require that the specified attribute does _not_ + # match the regular expression: + # + # class Person < ActiveRecord::Base + # validates_format_of :email, without: /NOSPAM/ + # end + # + # You can also provide a proc or lambda which will determine the regular + # expression that will be used to validate the attribute. + # + # class Person < ActiveRecord::Base + # # Admin can have number as a first letter in their screen name + # validates_format_of :screen_name, + # with: ->(person) { person.admin? ? /\A[a-z0-9][a-z0-9_\-]*\z/i : /\A[a-z][a-z0-9_\-]*\z/i } + # end + # + # Note: use \A and \z to match the start and end of the + # string, ^ and $ match the start/end of a line. + # + # Due to frequent misuse of ^ and $, you need to pass + # the multiline: true option in case you use any of these two + # anchors in the provided regular expression. In most cases, you should be + # using \A and \z. + # + # You must pass either :with or :without as an option. + # In addition, both must be a regular expression or a proc or lambda, or + # else an exception will be raised. + # + # Configuration options: + # * :message - A custom error message (default is: "is invalid"). + # * :with - Regular expression that if the attribute matches will + # result in a successful validation. This can be provided as a proc or + # lambda returning regular expression which will be called at runtime. + # * :without - Regular expression that if the attribute does not + # match will result in a successful validation. This can be provided as + # a proc or lambda returning regular expression which will be called at + # runtime. + # * :multiline - Set to true if your regular expression contains + # anchors that match the beginning or end of lines as opposed to the + # beginning or end of the string. These anchors are ^ and $. + # + # There is also a list of default options supported by every validator: + # +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+. + # See ActiveModel::Validations::ClassMethods#validates for more information. + # + # source://activemodel//lib/active_model/validations/format.rb#107 + def validates_format_of(*attr_names); end + + # Validates whether the value of the specified attribute is available in a + # particular enumerable object. + # + # class Person < ActiveRecord::Base + # validates_inclusion_of :role, in: %w( admin contributor ) + # validates_inclusion_of :age, in: 0..99 + # validates_inclusion_of :format, in: %w( jpg gif png ), message: "extension %{value} is not included in the list" + # validates_inclusion_of :states, in: ->(person) { STATES[person.country] } + # validates_inclusion_of :karma, in: :available_karmas + # end + # + # Configuration options: + # * :in - An enumerable object of available items. This can be + # supplied as a proc, lambda, or symbol which returns an enumerable. If the + # enumerable is a numerical, time, or datetime range the test is performed + # with Range#cover?, otherwise with include?. When using + # a proc or lambda the instance under validation is passed as an argument. + # * :within - A synonym(or alias) for :in + # * :message - Specifies a custom error message (default is: "is + # not included in the list"). + # + # There is also a list of default options supported by every validator: + # +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+. + # See ActiveModel::Validations::ClassMethods#validates for more information. + # + # source://activemodel//lib/active_model/validations/inclusion.rb#42 + def validates_inclusion_of(*attr_names); end + + # Validates that the specified attributes match the length restrictions + # supplied. Only one constraint option can be used at a time apart from + # +:minimum+ and +:maximum+ that can be combined together: + # + # class Person < ActiveRecord::Base + # validates_length_of :first_name, maximum: 30 + # validates_length_of :last_name, maximum: 30, message: "less than 30 if you don't mind" + # validates_length_of :fax, in: 7..32, allow_nil: true + # validates_length_of :phone, in: 7..32, allow_blank: true + # validates_length_of :user_name, within: 6..20, too_long: 'pick a shorter name', too_short: 'pick a longer name' + # validates_length_of :zip_code, minimum: 5, too_short: 'please enter at least 5 characters' + # validates_length_of :smurf_leader, is: 4, message: "papa is spelled with 4 characters... don't play me." + # validates_length_of :words_in_essay, minimum: 100, too_short: 'Your essay must be at least 100 words.' + # + # private + # def words_in_essay + # essay.scan(/\w+/) + # end + # end + # + # Constraint options: + # + # * :minimum - The minimum size of the attribute. + # * :maximum - The maximum size of the attribute. Allows +nil+ by + # default if not used with +:minimum+. + # * :is - The exact size of the attribute. + # * :within - A range specifying the minimum and maximum size of + # the attribute. + # * :in - A synonym (or alias) for :within. + # + # Other options: + # + # * :allow_nil - Attribute may be +nil+; skip validation. + # * :allow_blank - Attribute may be blank; skip validation. + # * :too_long - The error message if the attribute goes over the + # maximum (default is: "is too long (maximum is %{count} characters)"). + # * :too_short - The error message if the attribute goes under the + # minimum (default is: "is too short (minimum is %{count} characters)"). + # * :wrong_length - The error message if using the :is + # method and the attribute is the wrong size (default is: "is the wrong + # length (should be %{count} characters)"). + # * :message - The error message to use for a :minimum, + # :maximum, or :is violation. An alias of the appropriate + # too_long/too_short/wrong_length message. + # + # There is also a list of default options supported by every validator: + # +:if+, +:unless+, +:on+, and +:strict+. + # See ActiveModel::Validations::ClassMethods#validates for more information. + # + # source://activemodel//lib/active_model/validations/length.rb#123 + def validates_length_of(*attr_names); end + + # Validates whether the value of the specified attribute is numeric by + # trying to convert it to a float with +Kernel.Float+ (if + # only_integer is +false+) or applying it to the regular + # expression /\A[\+\-]?\d+\z/ (if only_integer is set to + # +true+). Precision of +Kernel.Float+ values are guaranteed up to 15 + # digits. + # + # class Person < ActiveRecord::Base + # validates_numericality_of :value, on: :create + # end + # + # Configuration options: + # * :message - A custom error message (default is: "is not a number"). + # * :only_integer - Specifies whether the value has to be an + # integer (default is +false+). + # * :only_numeric - Specifies whether the value has to be an + # instance of Numeric (default is +false+). The default behavior is to + # attempt parsing the value if it is a String. + # * :allow_nil - Skip validation if attribute is +nil+ (default is + # +false+). Notice that for Integer and Float columns empty strings are + # converted to +nil+. + # * :greater_than - Specifies the value must be greater than the + # supplied value. The default error message for this option is _"must be + # greater than %{count}"_. + # * :greater_than_or_equal_to - Specifies the value must be + # greater than or equal the supplied value. The default error message + # for this option is _"must be greater than or equal to %{count}"_. + # * :equal_to - Specifies the value must be equal to the supplied + # value. The default error message for this option is _"must be equal to + # %{count}"_. + # * :less_than - Specifies the value must be less than the + # supplied value. The default error message for this option is _"must be + # less than %{count}"_. + # * :less_than_or_equal_to - Specifies the value must be less + # than or equal the supplied value. The default error message for this + # option is _"must be less than or equal to %{count}"_. + # * :other_than - Specifies the value must be other than the + # supplied value. The default error message for this option is _"must be + # other than %{count}"_. + # * :odd - Specifies the value must be an odd number. The default + # error message for this option is _"must be odd"_. + # * :even - Specifies the value must be an even number. The + # default error message for this option is _"must be even"_. + # * :in - Check that the value is within a range. The default + # error message for this option is _"must be in %{count}"_. + # + # There is also a list of default options supported by every validator: + # +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+ . + # See ActiveModel::Validations::ClassMethods#validates for more information. + # + # The following checks can also be supplied with a proc or a symbol which + # corresponds to a method: + # + # * :greater_than + # * :greater_than_or_equal_to + # * :equal_to + # * :less_than + # * :less_than_or_equal_to + # * :only_integer + # * :other_than + # + # For example: + # + # class Person < ActiveRecord::Base + # validates_numericality_of :width, less_than: ->(person) { person.height } + # validates_numericality_of :width, greater_than: :minimum_weight + # end + # + # source://activemodel//lib/active_model/validations/numericality.rb#217 + def validates_numericality_of(*attr_names); end + + # Validates that the specified attributes are not blank (as defined by + # Object#blank?). + # + # class Person < ActiveRecord::Base + # validates_presence_of :first_name + # end + # + # The first_name attribute must be in the object and it cannot be blank. + # + # If you want to validate the presence of a boolean field (where the real + # values are +true+ and +false+), you will want to use + # validates_inclusion_of :field_name, in: [true, false]. + # + # This is due to the way Object#blank? handles boolean values: + # false.blank? # => true. + # + # Configuration options: + # * :message - A custom error message (default is: "can't be blank"). + # + # There is also a list of default options supported by every validator: + # +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+. + # See ActiveModel::Validations::ClassMethods#validates for more information. + # + # source://activemodel//lib/active_model/validations/presence.rb#34 + def validates_presence_of(*attr_names); end + + # Validates that the specified attributes match the length restrictions + # supplied. Only one constraint option can be used at a time apart from + # +:minimum+ and +:maximum+ that can be combined together: + # + # class Person < ActiveRecord::Base + # validates_length_of :first_name, maximum: 30 + # validates_length_of :last_name, maximum: 30, message: "less than 30 if you don't mind" + # validates_length_of :fax, in: 7..32, allow_nil: true + # validates_length_of :phone, in: 7..32, allow_blank: true + # validates_length_of :user_name, within: 6..20, too_long: 'pick a shorter name', too_short: 'pick a longer name' + # validates_length_of :zip_code, minimum: 5, too_short: 'please enter at least 5 characters' + # validates_length_of :smurf_leader, is: 4, message: "papa is spelled with 4 characters... don't play me." + # validates_length_of :words_in_essay, minimum: 100, too_short: 'Your essay must be at least 100 words.' + # + # private + # def words_in_essay + # essay.scan(/\w+/) + # end + # end + # + # Constraint options: + # + # * :minimum - The minimum size of the attribute. + # * :maximum - The maximum size of the attribute. Allows +nil+ by + # default if not used with +:minimum+. + # * :is - The exact size of the attribute. + # * :within - A range specifying the minimum and maximum size of + # the attribute. + # * :in - A synonym (or alias) for :within. + # + # Other options: + # + # * :allow_nil - Attribute may be +nil+; skip validation. + # * :allow_blank - Attribute may be blank; skip validation. + # * :too_long - The error message if the attribute goes over the + # maximum (default is: "is too long (maximum is %{count} characters)"). + # * :too_short - The error message if the attribute goes under the + # minimum (default is: "is too short (minimum is %{count} characters)"). + # * :wrong_length - The error message if using the :is + # method and the attribute is the wrong size (default is: "is the wrong + # length (should be %{count} characters)"). + # * :message - The error message to use for a :minimum, + # :maximum, or :is violation. An alias of the appropriate + # too_long/too_short/wrong_length message. + # + # There is also a list of default options supported by every validator: + # +:if+, +:unless+, +:on+, and +:strict+. + # See ActiveModel::Validations::ClassMethods#validates for more information. + # + # source://activemodel//lib/active_model/validations/length.rb#127 + def validates_size_of(*attr_names); end + + private + + # source://activemodel//lib/active_model/validations/helper_methods.rb#7 + def _merge_attributes(attr_names); end +end + +# source://activemodel//lib/active_model/validations/inclusion.rb#7 +class ActiveModel::Validations::InclusionValidator < ::ActiveModel::EachValidator + include ::ActiveModel::Validations::ResolveValue + include ::ActiveModel::Validations::Clusivity + + # source://activemodel//lib/active_model/validations/inclusion.rb#10 + def validate_each(record, attribute, value); end +end + +# source://activemodel//lib/active_model/validations/length.rb#7 +class ActiveModel::Validations::LengthValidator < ::ActiveModel::EachValidator + include ::ActiveModel::Validations::ResolveValue + + # @return [LengthValidator] a new instance of LengthValidator + # + # source://activemodel//lib/active_model/validations/length.rb#15 + def initialize(options); end + + # source://activemodel//lib/active_model/validations/length.rb#29 + def check_validity!; end + + # source://activemodel//lib/active_model/validations/length.rb#47 + def validate_each(record, attribute, value); end + + private + + # @return [Boolean] + # + # source://activemodel//lib/active_model/validations/length.rb#69 + def skip_nil_check?(key); end +end + +# source://activemodel//lib/active_model/validations/length.rb#11 +ActiveModel::Validations::LengthValidator::CHECKS = T.let(T.unsafe(nil), Hash) + +# source://activemodel//lib/active_model/validations/length.rb#10 +ActiveModel::Validations::LengthValidator::MESSAGES = T.let(T.unsafe(nil), Hash) + +# source://activemodel//lib/active_model/validations/length.rb#13 +ActiveModel::Validations::LengthValidator::RESERVED_OPTIONS = T.let(T.unsafe(nil), Array) + +# source://activemodel//lib/active_model/validations/numericality.rb#9 +class ActiveModel::Validations::NumericalityValidator < ::ActiveModel::EachValidator + include ::ActiveModel::Validations::Comparability + include ::ActiveModel::Validations::ResolveValue + + # source://activemodel//lib/active_model/validations/numericality.rb#22 + def check_validity!; end + + # source://activemodel//lib/active_model/validations/numericality.rb#36 + def validate_each(record, attr_name, value, precision: T.unsafe(nil), scale: T.unsafe(nil)); end + + private + + # @return [Boolean] + # + # source://activemodel//lib/active_model/validations/numericality.rb#118 + def allow_only_integer?(record); end + + # source://activemodel//lib/active_model/validations/numericality.rb#112 + def filtered_options(value); end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/validations/numericality.rb#108 + def is_hexadecimal_literal?(raw_value); end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/validations/numericality.rb#104 + def is_integer?(raw_value); end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/validations/numericality.rb#94 + def is_number?(raw_value, precision, scale); end + + # source://activemodel//lib/active_model/validations/numericality.rb#68 + def option_as_number(record, option_value, precision, scale); end + + # source://activemodel//lib/active_model/validations/numericality.rb#72 + def parse_as_number(raw_value, precision, scale); end + + # source://activemodel//lib/active_model/validations/numericality.rb#86 + def parse_float(raw_value, precision, scale); end + + # source://activemodel//lib/active_model/validations/numericality.rb#122 + def prepare_value_for_validation(value, record, attr_name); end + + # @return [Boolean] + # + # source://activemodel//lib/active_model/validations/numericality.rb#143 + def record_attribute_changed_in_place?(record, attr_name); end + + # source://activemodel//lib/active_model/validations/numericality.rb#90 + def round(raw_value, scale); end +end + +# source://activemodel//lib/active_model/validations/numericality.rb#20 +ActiveModel::Validations::NumericalityValidator::HEXADECIMAL_REGEX = T.let(T.unsafe(nil), Regexp) + +# source://activemodel//lib/active_model/validations/numericality.rb#18 +ActiveModel::Validations::NumericalityValidator::INTEGER_REGEX = T.let(T.unsafe(nil), Regexp) + +# source://activemodel//lib/active_model/validations/numericality.rb#14 +ActiveModel::Validations::NumericalityValidator::NUMBER_CHECKS = T.let(T.unsafe(nil), Hash) + +# source://activemodel//lib/active_model/validations/numericality.rb#13 +ActiveModel::Validations::NumericalityValidator::RANGE_CHECKS = T.let(T.unsafe(nil), Hash) + +# source://activemodel//lib/active_model/validations/numericality.rb#16 +ActiveModel::Validations::NumericalityValidator::RESERVED_OPTIONS = T.let(T.unsafe(nil), Array) + +# source://activemodel//lib/active_model/validations/presence.rb#5 +class ActiveModel::Validations::PresenceValidator < ::ActiveModel::EachValidator + # source://activemodel//lib/active_model/validations/presence.rb#6 + def validate_each(record, attr_name, value); end +end + +# source://activemodel//lib/active_model/validations/resolve_value.rb#5 +module ActiveModel::Validations::ResolveValue + # source://activemodel//lib/active_model/validations/resolve_value.rb#6 + def resolve_value(record, value); end +end + +# source://activemodel//lib/active_model/validations/with.rb#7 +class ActiveModel::Validations::WithValidator < ::ActiveModel::EachValidator + # source://activemodel//lib/active_model/validations/with.rb#8 + def validate_each(record, attr, val); end +end + +# = Active \Model \Validator +# +# A simple base class that can be used along with +# ActiveModel::Validations::ClassMethods.validates_with +# +# class Person +# include ActiveModel::Validations +# validates_with MyValidator +# end +# +# class MyValidator < ActiveModel::Validator +# def validate(record) +# if some_complex_logic +# record.errors.add(:base, "This record is invalid") +# end +# end +# +# private +# def some_complex_logic +# # ... +# end +# end +# +# Any class that inherits from \ActiveModel::Validator must implement a method +# called +validate+ which accepts a +record+. +# +# class Person +# include ActiveModel::Validations +# validates_with MyValidator +# end +# +# class MyValidator < ActiveModel::Validator +# def validate(record) +# record # => The person instance being validated +# options # => Any non-standard options passed to validates_with +# end +# end +# +# To cause a validation error, you must add to the +record+'s errors directly +# from within the validators message. +# +# class MyValidator < ActiveModel::Validator +# def validate(record) +# record.errors.add :base, "This is some custom error message" +# record.errors.add :first_name, "This is some complex validation" +# # etc... +# end +# end +# +# To add behavior to the initialize method, use the following signature: +# +# class MyValidator < ActiveModel::Validator +# def initialize(options) +# super +# @my_custom_field = options[:field_name] || :first_name +# end +# end +# +# Note that the validator is initialized only once for the whole application +# life cycle, and not on each validation run. +# +# The easiest way to add custom validators for validating individual attributes +# is with the convenient ActiveModel::EachValidator class. +# +# class TitleValidator < ActiveModel::EachValidator +# def validate_each(record, attribute, value) +# record.errors.add attribute, 'must be Mr., Mrs., or Dr.' unless %w(Mr. Mrs. Dr.).include?(value) +# end +# end +# +# This can now be used in combination with the +validates+ method. +# See ActiveModel::Validations::ClassMethods#validates for more on this. +# +# class Person +# include ActiveModel::Validations +# attr_accessor :title +# +# validates :title, presence: true, title: true +# end +# +# It can be useful to access the class that is using that validator when there are prerequisites such +# as an +attr_accessor+ being present. This class is accessible via options[:class] in the constructor. +# To set up your validator override the constructor. +# +# class MyValidator < ActiveModel::Validator +# def initialize(options={}) +# super +# options[:class].attr_accessor :custom_attribute +# end +# end +# +# source://activemodel//lib/active_model/validator.rb#96 +class ActiveModel::Validator + # Accepts options that will be made available through the +options+ reader. + # + # @return [Validator] a new instance of Validator + # + # source://activemodel//lib/active_model/validator.rb#108 + def initialize(options = T.unsafe(nil)); end + + # Returns the kind for this validator. + # + # PresenceValidator.new(attributes: [:username]).kind # => :presence + # AcceptanceValidator.new(attributes: [:terms]).kind # => :acceptance + # + # source://activemodel//lib/active_model/validator.rb#116 + def kind; end + + # Returns the value of attribute options. + # + # source://activemodel//lib/active_model/validator.rb#97 + def options; end + + # Override this method in subclasses with validation logic, adding errors + # to the records +errors+ array where necessary. + # + # @raise [NotImplementedError] + # + # source://activemodel//lib/active_model/validator.rb#122 + def validate(record); end + + class << self + # Returns the kind of the validator. + # + # PresenceValidator.kind # => :presence + # AcceptanceValidator.kind # => :acceptance + # + # source://activemodel//lib/active_model/validator.rb#103 + def kind; end + end +end diff --git a/sorbet/rbi/gems/activerecord@8.1.1.rbi b/sorbet/rbi/gems/activerecord@8.1.1.rbi new file mode 100644 index 0000000..15172f9 --- /dev/null +++ b/sorbet/rbi/gems/activerecord@8.1.1.rbi @@ -0,0 +1,44406 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `activerecord` gem. +# Please instead update this file by running `bin/tapioca gem activerecord`. + + +# :include: ../README.rdoc +# +# source://activerecord//lib/active_record/gem_version.rb#3 +module ActiveRecord + include ::ActiveSupport::Deprecation::DeprecatedConstantAccessor + extend ::ActiveSupport::Autoload + + class << self + # source://activerecord//lib/active_record.rb#370 + def action_on_strict_loading_violation; end + + # source://activerecord//lib/active_record.rb#370 + def action_on_strict_loading_violation=(_arg0); end + + # Registers a block to be called after all the current transactions have been + # committed. + # + # If there is no currently open transaction, the block is called immediately. + # + # If there are multiple nested transactions, the block is called after the outermost one + # has been committed, + # + # If any of the currently open transactions is rolled back, the block is never called. + # + # If multiple transactions are open across multiple databases, the block will be invoked + # if and once all of them have been committed. But note that nesting transactions across + # two distinct databases is a sharding anti-pattern that comes with a world of hurts. + # + # source://activerecord//lib/active_record.rb#573 + def after_all_transactions_commit(&block); end + + # source://activerecord//lib/active_record.rb#593 + def all_open_transactions; end + + # source://activerecord//lib/active_record.rb#363 + def application_record_class; end + + # source://activerecord//lib/active_record.rb#363 + def application_record_class=(_arg0); end + + # source://activerecord//lib/active_record.rb#288 + def async_query_executor; end + + # source://activerecord//lib/active_record.rb#288 + def async_query_executor=(_arg0); end + + # source://activerecord//lib/active_record.rb#354 + def before_committed_on_all_records; end + + # source://activerecord//lib/active_record.rb#354 + def before_committed_on_all_records=(_arg0); end + + # source://activerecord//lib/active_record.rb#351 + def belongs_to_required_validates_foreign_key; end + + # source://activerecord//lib/active_record.rb#351 + def belongs_to_required_validates_foreign_key=(_arg0); end + + # source://activerecord//lib/active_record.rb#213 + def database_cli; end + + # source://activerecord//lib/active_record.rb#213 + def database_cli=(_arg0); end + + # source://activerecord//lib/active_record.rb#235 + def db_warnings_action; end + + # source://activerecord//lib/active_record.rb#237 + def db_warnings_action=(action); end + + # source://activerecord//lib/active_record.rb#267 + def db_warnings_ignore; end + + # source://activerecord//lib/active_record.rb#267 + def db_warnings_ignore=(_arg0); end + + # source://activerecord//lib/active_record.rb#216 + def default_timezone; end + + # Determines whether to use Time.utc (using :utc) or Time.local (using :local) when pulling + # dates and times from the database. This is set to :utc by default. + # + # source://activerecord//lib/active_record.rb#220 + def default_timezone=(default_timezone); end + + # source://activerecord//lib/active_record.rb#611 + def default_transaction_isolation_level; end + + # source://activerecord//lib/active_record.rb#607 + def default_transaction_isolation_level=(isolation_level); end + + # source://activerecord//lib/active_record.rb#495 + def deprecated_associations_options; end + + # @raise [ArgumentError] + # + # source://activerecord//lib/active_record.rb#479 + def deprecated_associations_options=(options); end + + # source://activerecord//lib/active_record/deprecator.rb#4 + def deprecator; end + + # source://activerecord//lib/active_record.rb#184 + def disable_prepared_statements; end + + # source://activerecord//lib/active_record.rb#184 + def disable_prepared_statements=(_arg0); end + + # Explicitly closes all database connections in all pools. + # + # source://activerecord//lib/active_record.rb#556 + def disconnect_all!; end + + # source://activerecord//lib/active_record.rb#425 + def dump_schema_after_migration; end + + # source://activerecord//lib/active_record.rb#425 + def dump_schema_after_migration=(_arg0); end + + # source://activerecord//lib/active_record.rb#435 + def dump_schemas; end + + # source://activerecord//lib/active_record.rb#435 + def dump_schemas=(_arg0); end + + # source://activerecord//lib/active_record.rb#545 + def eager_load!; end + + # source://activerecord//lib/active_record.rb#390 + def error_on_ignored_order; end + + # source://activerecord//lib/active_record.rb#390 + def error_on_ignored_order=(_arg0); end + + # Returns the currently loaded version of Active Record as a +Gem::Version+. + # + # source://activerecord//lib/active_record/gem_version.rb#5 + def gem_version; end + + # source://activerecord//lib/active_record.rb#476 + def generate_secure_token_on; end + + # source://activerecord//lib/active_record.rb#476 + def generate_secure_token_on=(_arg0); end + + # source://activerecord//lib/active_record.rb#312 + def global_executor_concurrency; end + + # Set the +global_executor_concurrency+. This configuration value can only be used + # with the global thread pool async query executor. + # + # source://activerecord//lib/active_record.rb#304 + def global_executor_concurrency=(global_executor_concurrency); end + + # source://activerecord//lib/active_record.rb#291 + def global_thread_pool_async_query_executor; end + + # source://activerecord//lib/active_record.rb#327 + def index_nested_attribute_errors; end + + # source://activerecord//lib/active_record.rb#327 + def index_nested_attribute_errors=(_arg0); end + + # source://activerecord//lib/active_record.rb#191 + def lazily_load_schema_cache; end + + # source://activerecord//lib/active_record.rb#191 + def lazily_load_schema_cache=(_arg0); end + + # source://activerecord//lib/active_record.rb#345 + def maintain_test_schema; end + + # source://activerecord//lib/active_record.rb#345 + def maintain_test_schema=(_arg0); end + + # source://activerecord//lib/active_record.rb#502 + def marshalling_format_version; end + + # source://activerecord//lib/active_record.rb#506 + def marshalling_format_version=(value); end + + # source://activerecord//lib/active_record.rb#543 + def message_verifiers; end + + # source://activerecord//lib/active_record.rb#543 + def message_verifiers=(_arg0); end + + # source://activerecord//lib/active_record.rb#410 + def migration_strategy; end + + # source://activerecord//lib/active_record.rb#410 + def migration_strategy=(_arg0); end + + # source://activerecord//lib/active_record.rb#317 + def permanent_connection_checkout; end + + # Defines whether +ActiveRecord::Base.connection+ is allowed, deprecated, or entirely disallowed. + # + # source://activerecord//lib/active_record.rb#320 + def permanent_connection_checkout=(value); end + + # source://activerecord//lib/active_record.rb#529 + def protocol_adapters; end + + # source://activerecord//lib/active_record.rb#529 + def protocol_adapters=(_arg0); end + + # source://activerecord//lib/active_record.rb#447 + def query_transformers; end + + # source://activerecord//lib/active_record.rb#447 + def query_transformers=(_arg0); end + + # source://activerecord//lib/active_record.rb#342 + def queues; end + + # source://activerecord//lib/active_record.rb#342 + def queues=(_arg0); end + + # source://activerecord//lib/active_record.rb#462 + def raise_int_wider_than_64bit; end + + # source://activerecord//lib/active_record.rb#462 + def raise_int_wider_than_64bit=(_arg0); end + + # source://activerecord//lib/active_record.rb#348 + def raise_on_assign_to_attr_readonly; end + + # source://activerecord//lib/active_record.rb#348 + def raise_on_assign_to_attr_readonly=(_arg0); end + + # source://activerecord//lib/active_record.rb#360 + def raise_on_missing_required_finder_order_columns; end + + # source://activerecord//lib/active_record.rb#360 + def raise_on_missing_required_finder_order_columns=(_arg0); end + + # source://activerecord//lib/active_record.rb#273 + def reading_role; end + + # source://activerecord//lib/active_record.rb#273 + def reading_role=(_arg0); end + + # source://activerecord//lib/active_record.rb#357 + def run_after_transaction_callbacks_in_order_defined; end + + # source://activerecord//lib/active_record.rb#357 + def run_after_transaction_callbacks_in_order_defined=(_arg0); end + + # Checks to see if the +table_name+ is ignored by checking + # against the +schema_cache_ignored_tables+ option. + # + # ActiveRecord.schema_cache_ignored_table?(:developers) + # + # @return [Boolean] + # + # source://activerecord//lib/active_record.rb#207 + def schema_cache_ignored_table?(table_name); end + + # source://activerecord//lib/active_record.rb#199 + def schema_cache_ignored_tables; end + + # source://activerecord//lib/active_record.rb#199 + def schema_cache_ignored_tables=(_arg0); end + + # source://activerecord//lib/active_record.rb#382 + def schema_format; end + + # source://activerecord//lib/active_record.rb#382 + def schema_format=(_arg0); end + + # source://activerecord//lib/active_record.rb#416 + def schema_versions_formatter; end + + # source://activerecord//lib/active_record.rb#416 + def schema_versions_formatter=(_arg0); end + + # source://activerecord//lib/active_record.rb#396 + def timestamped_migrations; end + + # source://activerecord//lib/active_record.rb#396 + def timestamped_migrations=(_arg0); end + + # source://activerecord//lib/active_record.rb#454 + def use_yaml_unsafe_load; end + + # source://activerecord//lib/active_record.rb#454 + def use_yaml_unsafe_load=(_arg0); end + + # source://activerecord//lib/active_record.rb#404 + def validate_migration_timestamps; end + + # source://activerecord//lib/active_record.rb#404 + def validate_migration_timestamps=(_arg0); end + + # source://activerecord//lib/active_record.rb#335 + def verbose_query_logs; end + + # source://activerecord//lib/active_record.rb#335 + def verbose_query_logs=(_arg0); end + + # source://activerecord//lib/active_record.rb#444 + def verify_foreign_keys_for_fixtures; end + + # source://activerecord//lib/active_record.rb#444 + def verify_foreign_keys_for_fixtures=(_arg0); end + + # Returns the currently loaded version of Active Record as a +Gem::Version+. + # + # source://activerecord//lib/active_record/version.rb#7 + def version; end + + # Sets a transaction isolation level for all connection pools within the block. + # + # source://activerecord//lib/active_record.rb#616 + def with_transaction_isolation_level(isolation_level, &block); end + + # source://activerecord//lib/active_record.rb#270 + def writing_role; end + + # source://activerecord//lib/active_record.rb#270 + def writing_role=(_arg0); end + + # source://activerecord//lib/active_record.rb#469 + def yaml_column_permitted_classes; end + + # source://activerecord//lib/active_record.rb#469 + def yaml_column_permitted_classes=(_arg0); end + end +end + +# = Active Record Errors +# +# Generic Active Record exception class. +# +# source://activerecord//lib/active_record/errors.rb#10 +class ActiveRecord::ActiveRecordError < ::StandardError; end + +# Superclass for all errors raised from an Active Record adapter. +# +# source://activerecord//lib/active_record/errors.rb#54 +class ActiveRecord::AdapterError < ::ActiveRecord::ActiveRecordError + # @return [AdapterError] a new instance of AdapterError + # + # source://activerecord//lib/active_record/errors.rb#55 + def initialize(message = T.unsafe(nil), connection_pool: T.unsafe(nil)); end + + # Returns the value of attribute connection_pool. + # + # source://activerecord//lib/active_record/errors.rb#60 + def connection_pool; end +end + +# Raised when Active Record cannot find database adapter specified in +# +config/database.yml+ or programmatically. +# +# source://activerecord//lib/active_record/errors.rb#50 +class ActiveRecord::AdapterNotFound < ::ActiveRecord::ActiveRecordError; end + +# Raised when adapter not specified on connection (or configuration file +# +config/database.yml+ misses adapter field). +# +# source://activerecord//lib/active_record/errors.rb#41 +class ActiveRecord::AdapterNotSpecified < ::ActiveRecord::ActiveRecordError; end + +# AdapterTimeout will be raised when database clients times out while waiting from the server. +# +# source://activerecord//lib/active_record/errors.rb#590 +class ActiveRecord::AdapterTimeout < ::ActiveRecord::QueryAborted; end + +# See ActiveRecord::Aggregations::ClassMethods for documentation +# +# source://activerecord//lib/active_record/aggregations.rb#5 +module ActiveRecord::Aggregations + # source://activerecord//lib/active_record/aggregations.rb#11 + def reload(*_arg0); end + + private + + # source://activerecord//lib/active_record/aggregations.rb#17 + def clear_aggregation_cache; end + + # source://activerecord//lib/active_record/aggregations.rb#21 + def init_internals; end + + # source://activerecord//lib/active_record/aggregations.rb#6 + def initialize_dup(*_arg0); end +end + +# = Active Record \Aggregations +# +# Active Record implements aggregation through a macro-like class method called #composed_of +# for representing attributes as value objects. It expresses relationships like "Account [is] +# composed of Money [among other things]" or "Person [is] composed of [an] address". Each call +# to the macro adds a description of how the value objects are created from the attributes of +# the entity object (when the entity is initialized either as a new object or from finding an +# existing object) and how it can be turned back into attributes (when the entity is saved to +# the database). +# +# class Customer < ActiveRecord::Base +# composed_of :balance, class_name: "Money", mapping: { balance: :amount } +# composed_of :address, mapping: { address_street: :street, address_city: :city } +# end +# +# The customer class now has the following methods to manipulate the value objects: +# * Customer#balance, Customer#balance=(money) +# * Customer#address, Customer#address=(address) +# +# These methods will operate with value objects like the ones described below: +# +# class Money +# include Comparable +# attr_reader :amount, :currency +# EXCHANGE_RATES = { "USD_TO_DKK" => 6 } +# +# def initialize(amount, currency = "USD") +# @amount, @currency = amount, currency +# end +# +# def exchange_to(other_currency) +# exchanged_amount = (amount * EXCHANGE_RATES["#{currency}_TO_#{other_currency}"]).floor +# Money.new(exchanged_amount, other_currency) +# end +# +# def ==(other_money) +# amount == other_money.amount && currency == other_money.currency +# end +# +# def <=>(other_money) +# if currency == other_money.currency +# amount <=> other_money.amount +# else +# amount <=> other_money.exchange_to(currency).amount +# end +# end +# end +# +# class Address +# attr_reader :street, :city +# def initialize(street, city) +# @street, @city = street, city +# end +# +# def close_to?(other_address) +# city == other_address.city +# end +# +# def ==(other_address) +# city == other_address.city && street == other_address.street +# end +# end +# +# Now it's possible to access attributes from the database through the value objects instead. If +# you choose to name the composition the same as the attribute's name, it will be the only way to +# access that attribute. That's the case with our +balance+ attribute. You interact with the value +# objects just like you would with any other attribute: +# +# customer.balance = Money.new(20) # sets the Money value object and the attribute +# customer.balance # => Money value object +# customer.balance.exchange_to("DKK") # => Money.new(120, "DKK") +# customer.balance > Money.new(10) # => true +# customer.balance == Money.new(20) # => true +# customer.balance < Money.new(5) # => false +# +# Value objects can also be composed of multiple attributes, such as the case of Address. The order +# of the mappings will determine the order of the parameters. +# +# customer.address_street = "Hyancintvej" +# customer.address_city = "Copenhagen" +# customer.address # => Address.new("Hyancintvej", "Copenhagen") +# +# customer.address = Address.new("May Street", "Chicago") +# customer.address_street # => "May Street" +# customer.address_city # => "Chicago" +# +# == Writing value objects +# +# Value objects are immutable and interchangeable objects that represent a given value, such as +# a Money object representing $5. Two Money objects both representing $5 should be equal (through +# methods such as == and <=> from Comparable if ranking makes sense). This is +# unlike entity objects where equality is determined by identity. An entity class such as Customer can +# easily have two different objects that both have an address on Hyancintvej. Entity identity is +# determined by object or relational unique identifiers (such as primary keys). Normal +# ActiveRecord::Base classes are entity objects. +# +# It's also important to treat the value objects as immutable. Don't allow the Money object to have +# its amount changed after creation. Create a new Money object with the new value instead. The +# Money#exchange_to method is an example of this. It returns a new value object instead of changing +# its own values. Active Record won't persist value objects that have been changed through means +# other than the writer method. +# +# The immutable requirement is enforced by Active Record by freezing any object assigned as a value +# object. Attempting to change it afterwards will result in a +RuntimeError+. +# +# Read more about value objects on http://c2.com/cgi/wiki?ValueObject and on the dangers of not +# keeping value objects immutable on http://c2.com/cgi/wiki?ValueObjectsShouldBeImmutable +# +# == Custom constructors and converters +# +# By default value objects are initialized by calling the new constructor of the value +# class passing each of the mapped attributes, in the order specified by the :mapping +# option, as arguments. If the value class doesn't support this convention then #composed_of allows +# a custom constructor to be specified. +# +# When a new value is assigned to the value object, the default assumption is that the new value +# is an instance of the value class. Specifying a custom converter allows the new value to be automatically +# converted to an instance of value class if necessary. +# +# For example, the +NetworkResource+ model has +network_address+ and +cidr_range+ attributes that should be +# aggregated using the +NetAddr::CIDR+ value class (https://www.rubydoc.info/gems/netaddr/1.5.0/NetAddr/CIDR). +# The constructor for the value class is called +create+ and it expects a CIDR address string as a parameter. +# New values can be assigned to the value object using either another +NetAddr::CIDR+ object, a string +# or an array. The :constructor and :converter options can be used to meet +# these requirements: +# +# class NetworkResource < ActiveRecord::Base +# composed_of :cidr, +# class_name: 'NetAddr::CIDR', +# mapping: { network_address: :network, cidr_range: :bits }, +# allow_nil: true, +# constructor: Proc.new { |network_address, cidr_range| NetAddr::CIDR.create("#{network_address}/#{cidr_range}") }, +# converter: Proc.new { |value| NetAddr::CIDR.create(value.is_a?(Array) ? value.join('/') : value) } +# end +# +# # This calls the :constructor +# network_resource = NetworkResource.new(network_address: '192.168.0.1', cidr_range: 24) +# +# # These assignments will both use the :converter +# network_resource.cidr = [ '192.168.2.1', 8 ] +# network_resource.cidr = '192.168.0.1/24' +# +# # This assignment won't use the :converter as the value is already an instance of the value class +# network_resource.cidr = NetAddr::CIDR.create('192.168.2.1/8') +# +# # Saving and then reloading will use the :constructor on reload +# network_resource.save +# network_resource.reload +# +# == Finding records by a value object +# +# Once a #composed_of relationship is specified for a model, records can be loaded from the database +# by specifying an instance of the value object in the conditions hash. The following example +# finds all customers with +address_street+ equal to "May Street" and +address_city+ equal to "Chicago": +# +# Customer.where(address: Address.new("May Street", "Chicago")) +# +# source://activerecord//lib/active_record/aggregations.rb#183 +module ActiveRecord::Aggregations::ClassMethods + # Adds reader and writer methods for manipulating a value object: + # composed_of :address adds address and address=(new_address) methods. + # + # Options are: + # * :class_name - Specifies the class name of the association. Use it only if that name + # can't be inferred from the part id. So composed_of :address will by default be linked + # to the Address class, but if the real class name is +CompanyAddress+, you'll have to specify it + # with this option. + # * :mapping - Specifies the mapping of entity attributes to attributes of the value + # object. Each mapping is represented as a key-value pair where the key is the name of the + # entity attribute and the value is the name of the attribute in the value object. The + # order in which mappings are defined determines the order in which attributes are sent to the + # value class constructor. The mapping can be written as a hash or as an array of pairs. + # * :allow_nil - Specifies that the value object will not be instantiated when all mapped + # attributes are +nil+. Setting the value object to +nil+ has the effect of writing +nil+ to all + # mapped attributes. + # This defaults to +false+. + # * :constructor - A symbol specifying the name of the constructor method or a Proc that + # is called to initialize the value object. The constructor is passed all of the mapped attributes, + # in the order that they are defined in the :mapping option, as arguments and uses them + # to instantiate a :class_name object. + # The default is :new. + # * :converter - A symbol specifying the name of a class method of :class_name + # or a Proc that is called when a new value is assigned to the value object. The converter is + # passed the single value that is used in the assignment and is only called if the new value is + # not an instance of :class_name. If :allow_nil is set to true, the converter + # can return +nil+ to skip the assignment. + # + # Option examples: + # composed_of :temperature, mapping: { reading: :celsius } + # composed_of :balance, class_name: "Money", mapping: { balance: :amount } + # composed_of :address, mapping: { address_street: :street, address_city: :city } + # composed_of :address, mapping: [ %w(address_street street), %w(address_city city) ] + # composed_of :gps_location + # composed_of :gps_location, allow_nil: true + # composed_of :ip_address, + # class_name: 'IPAddr', + # mapping: { ip: :to_i }, + # constructor: Proc.new { |ip| IPAddr.new(ip, Socket::AF_INET) }, + # converter: Proc.new { |ip| ip.is_a?(Integer) ? IPAddr.new(ip, Socket::AF_INET) : IPAddr.new(ip.to_s) } + # + # source://activerecord//lib/active_record/aggregations.rb#225 + def composed_of(part_id, options = T.unsafe(nil)); end + + private + + # source://activerecord//lib/active_record/aggregations.rb#248 + def reader_method(name, class_name, mapping, allow_nil, constructor); end + + # source://activerecord//lib/active_record/aggregations.rb#261 + def writer_method(name, class_name, mapping, allow_nil, converter); end +end + +# source://activerecord//lib/active_record/associations/errors.rb#203 +class ActiveRecord::AmbiguousSourceReflectionForThroughAssociation < ::ActiveRecord::ActiveRecordError + # @return [AmbiguousSourceReflectionForThroughAssociation] a new instance of AmbiguousSourceReflectionForThroughAssociation + # + # source://activerecord//lib/active_record/associations/errors.rb#204 + def initialize(klass, macro, association_name, options, possible_sources); end +end + +# source://activerecord//lib/active_record/associations/errors.rb#4 +class ActiveRecord::AssociationNotFoundError < ::ActiveRecord::ConfigurationError + include ::DidYouMean::Correctable + + # @return [AssociationNotFoundError] a new instance of AssociationNotFoundError + # + # source://activerecord//lib/active_record/associations/errors.rb#7 + def initialize(record = T.unsafe(nil), association_name = T.unsafe(nil)); end + + # Returns the value of attribute association_name. + # + # source://activerecord//lib/active_record/associations/errors.rb#5 + def association_name; end + + # source://activerecord//lib/active_record/associations/errors.rb#20 + def corrections; end + + # Returns the value of attribute record. + # + # source://activerecord//lib/active_record/associations/errors.rb#5 + def record; end +end + +# source://activerecord//lib/active_record/association_relation.rb#4 +class ActiveRecord::AssociationRelation < ::ActiveRecord::Relation + # @return [AssociationRelation] a new instance of AssociationRelation + # + # source://activerecord//lib/active_record/association_relation.rb#5 + def initialize(klass, association, **_arg2); end + + # source://activerecord//lib/active_record/association_relation.rb#14 + def ==(other); end + + # source://activerecord//lib/active_record/association_relation.rb#19 + def insert(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/association_relation.rb#19 + def insert!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/association_relation.rb#19 + def insert_all(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/association_relation.rb#19 + def insert_all!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/association_relation.rb#10 + def proxy_association; end + + # source://activerecord//lib/active_record/association_relation.rb#19 + def upsert(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/association_relation.rb#19 + def upsert_all(*_arg0, **_arg1, &_arg2); end + + private + + # source://activerecord//lib/active_record/association_relation.rb#35 + def _create(attributes, &block); end + + # source://activerecord//lib/active_record/association_relation.rb#39 + def _create!(attributes, &block); end + + # source://activerecord//lib/active_record/association_relation.rb#31 + def _new(attributes, &block); end + + # source://activerecord//lib/active_record/association_relation.rb#43 + def exec_queries; end +end + +# Raised when an object assigned to an association has an incorrect type. +# +# class Ticket < ActiveRecord::Base +# has_many :patches +# end +# +# class Patch < ActiveRecord::Base +# belongs_to :ticket +# end +# +# # Comments are not patches, this assignment raises AssociationTypeMismatch. +# @ticket.patches << Comment.new(content: "Please attach tests to your patch.") +# +# source://activerecord//lib/active_record/errors.rb#32 +class ActiveRecord::AssociationTypeMismatch < ::ActiveRecord::ActiveRecordError; end + +# See ActiveRecord::Associations::ClassMethods for documentation. +# +# source://activerecord//lib/active_record/associations.rb#5 +module ActiveRecord::Associations + extend ::ActiveSupport::Autoload + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::Associations::ClassMethods + + # Returns the association instance for the given name, instantiating it if it doesn't already exist + # + # source://activerecord//lib/active_record/associations.rb#53 + def association(name); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations.rb#67 + def association_cached?(name); end + + private + + # Returns the specified association instance if it exists, +nil+ otherwise. + # + # source://activerecord//lib/active_record/associations.rb#83 + def association_instance_get(name); end + + # Set the specified association instance. + # + # source://activerecord//lib/active_record/associations.rb#88 + def association_instance_set(name, association); end + + # source://activerecord//lib/active_record/associations.rb#92 + def deprecated_associations_api_guard(association, method_name); end + + # source://activerecord//lib/active_record/associations.rb#77 + def init_internals; end + + # source://activerecord//lib/active_record/associations.rb#71 + def initialize_dup(*_arg0); end + + # source://activerecord//lib/active_record/associations.rb#96 + def report_deprecated_association(reflection, context:); end + + class << self + # source://activerecord//lib/active_record/associations.rb#46 + def eager_load!; end + end +end + +# Keeps track of table aliases for ActiveRecord::Associations::JoinDependency +# +# source://activerecord//lib/active_record/associations/alias_tracker.rb#8 +class ActiveRecord::Associations::AliasTracker + # table_joins is an array of arel joins which might conflict with the aliases we assign here + # + # @return [AliasTracker] a new instance of AliasTracker + # + # source://activerecord//lib/active_record/associations/alias_tracker.rb#53 + def initialize(table_alias_length, aliases); end + + # source://activerecord//lib/active_record/associations/alias_tracker.rb#58 + def aliased_table_for(arel_table, table_name = T.unsafe(nil)); end + + # Returns the value of attribute aliases. + # + # source://activerecord//lib/active_record/associations/alias_tracker.rb#80 + def aliases; end + + private + + # source://activerecord//lib/active_record/associations/alias_tracker.rb#83 + def table_alias_for(table_name); end + + # source://activerecord//lib/active_record/associations/alias_tracker.rb#87 + def truncate(name); end + + class << self + # source://activerecord//lib/active_record/associations/alias_tracker.rb#9 + def create(pool, initial_table, joins, aliases = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/associations/alias_tracker.rb#28 + def initial_count_for(connection, name, table_joins); end + end +end + +# = Active Record Associations +# +# This is the root class of all associations ('+ Foo' signifies an included module Foo): +# +# Association +# SingularAssociation +# HasOneAssociation + ForeignAssociation +# HasOneThroughAssociation + ThroughAssociation +# BelongsToAssociation +# BelongsToPolymorphicAssociation +# CollectionAssociation +# HasManyAssociation + ForeignAssociation +# HasManyThroughAssociation + ThroughAssociation +# +# Associations in Active Record are middlemen between the object that +# holds the association, known as the owner, and the associated +# result set, known as the target. Association metadata is available in +# reflection, which is an instance of +ActiveRecord::Reflection::AssociationReflection+. +# +# For example, given +# +# class Blog < ActiveRecord::Base +# has_many :posts +# end +# +# blog = Blog.first +# +# The association of blog.posts has the object +blog+ as its +# owner, the collection of its posts as target, and +# the reflection object represents a :has_many macro. +# +# source://activerecord//lib/active_record/associations/association.rb#35 +class ActiveRecord::Associations::Association + # @return [Association] a new instance of Association + # + # source://activerecord//lib/active_record/associations/association.rb#41 + def initialize(owner, reflection); end + + # source://activerecord//lib/active_record/associations/association.rb#198 + def async_load_target; end + + # Whether the association represents a single record + # or a collection of records. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/association.rb#237 + def collection?; end + + # source://activerecord//lib/active_record/associations/association.rb#227 + def create(attributes = T.unsafe(nil), &block); end + + # source://activerecord//lib/active_record/associations/association.rb#231 + def create!(attributes = T.unsafe(nil), &block); end + + # Returns the value of attribute disable_joins. + # + # source://activerecord//lib/active_record/associations/association.rb#37 + def disable_joins; end + + # source://activerecord//lib/active_record/associations/association.rb#169 + def extensions; end + + # source://activerecord//lib/active_record/associations/association.rb#217 + def initialize_attributes(record, except_from_scope_attributes = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/associations/association.rb#153 + def inversed_from(record); end + + # source://activerecord//lib/active_record/associations/association.rb#157 + def inversed_from_queries(record); end + + # Returns the class of the target. belongs_to polymorphic overrides this to look at the + # polymorphic_type field on the owner. + # + # source://activerecord//lib/active_record/associations/association.rb#165 + def klass; end + + # Loads the \target if needed and returns it. + # + # This method is abstract in the sense that it relies on +find_target+, + # which is expected to be provided by descendants. + # + # If the \target is already \loaded it is just returned. Thus, you can call + # +load_target+ unconditionally to get the \target. + # + # ActiveRecord::RecordNotFound is rescued within the method, and it is + # not reraised. The proxy is \reset and +nil+ is the return value. + # + # source://activerecord//lib/active_record/associations/association.rb#189 + def load_target; end + + # Asserts the \target has been loaded setting the \loaded flag to +true+. + # + # source://activerecord//lib/active_record/associations/association.rb#86 + def loaded!; end + + # Has the \target been already \loaded? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/association.rb#81 + def loaded?; end + + # We can't dump @reflection and @through_reflection since it contains the scope proc + # + # source://activerecord//lib/active_record/associations/association.rb#206 + def marshal_dump; end + + # source://activerecord//lib/active_record/associations/association.rb#211 + def marshal_load(data); end + + # source://activerecord//lib/active_record/associations/association.rb#39 + def options(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/association.rb#36 + def owner; end + + # source://activerecord//lib/active_record/associations/association.rb#36 + def owner=(_arg0); end + + # Returns the value of attribute reflection. + # + # source://activerecord//lib/active_record/associations/association.rb#37 + def reflection; end + + # Reloads the \target and returns +self+ on success. + # The QueryCache is cleared if +force+ is true. + # + # source://activerecord//lib/active_record/associations/association.rb#72 + def reload(force = T.unsafe(nil)); end + + # Remove the inverse association, if possible + # + # source://activerecord//lib/active_record/associations/association.rb#147 + def remove_inverse_instance(record); end + + # Resets the \loaded flag to +false+ and sets the \target to +nil+. + # + # source://activerecord//lib/active_record/associations/association.rb#61 + def reset; end + + # source://activerecord//lib/active_record/associations/association.rb#66 + def reset_negative_cache; end + + # source://activerecord//lib/active_record/associations/association.rb#119 + def reset_scope; end + + # source://activerecord//lib/active_record/associations/association.rb#107 + def scope; end + + # Set the inverse association, if possible + # + # source://activerecord//lib/active_record/associations/association.rb#132 + def set_inverse_instance(record); end + + # source://activerecord//lib/active_record/associations/association.rb#139 + def set_inverse_instance_from_queries(record); end + + # source://activerecord//lib/active_record/associations/association.rb#123 + def set_strict_loading(record); end + + # The target is stale if the target no longer points to the record(s) that the + # relevant foreign_key(s) refers to. If stale, the association accessor method + # on the owner will reload the target. It's up to subclasses to implement the + # stale_state method if relevant. + # + # Note that if the target has not been loaded, it is not considered stale. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/association.rb#97 + def stale_target?; end + + # source://activerecord//lib/active_record/associations/association.rb#53 + def target; end + + # Sets the target of this association to \target, and the \loaded flag to +true+. + # + # source://activerecord//lib/active_record/associations/association.rb#102 + def target=(target); end + + private + + # The scope for this association. + # + # Note that the association_scope is merged into the target_scope only when the + # scope method is called. This is because at that point the call may be surrounded + # by scope.scoping { ... } or unscoped { ... } etc, which affects the scope which + # actually gets built. + # + # source://activerecord//lib/active_record/associations/association.rb#300 + def association_scope; end + + # source://activerecord//lib/active_record/associations/association.rb#383 + def build_record(attributes); end + + # source://activerecord//lib/active_record/associations/association.rb#398 + def enqueue_destroy_association(options); end + + # Reader and writer methods call this so that consistent errors are presented + # when the association target class does not exist. + # + # source://activerecord//lib/active_record/associations/association.rb#244 + def ensure_klass_exists!; end + + # source://activerecord//lib/active_record/associations/association.rb#248 + def find_target(async: T.unsafe(nil)); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/association.rb#320 + def find_target?; end + + # Returns true if record contains the foreign_key + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/association.rb#370 + def foreign_key_for?(record); end + + # Returns true if there is a foreign key present on the owner which + # references the target. This is used to determine whether we can load + # the target if the owner is currently a new record (and therefore + # without a key). If the owner is a new record then foreign_key must + # be present in order to load target. + # + # Currently implemented by belongs_to (vanilla and polymorphic) and + # has_one/has_many :through associations which go through a belongs_to. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/association.rb#332 + def foreign_key_present?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/association.rb#406 + def inversable?(record); end + + # source://activerecord//lib/active_record/associations/association.rb#350 + def inverse_association_for(record); end + + # Can be redefined by subclasses, notably polymorphic belongs_to + # The record parameter is necessary to support polymorphic inverses as we must check for + # the association in the specific class of the record. + # + # source://activerecord//lib/active_record/associations/association.rb#359 + def inverse_reflection_for(record); end + + # Returns true if inverse association on the given record needs to be set. + # This method is redefined by subclasses. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/association.rb#365 + def invertible_for?(record); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/association.rb#411 + def matches_foreign_key?(record); end + + # Raises ActiveRecord::AssociationTypeMismatch unless +record+ is of + # the kind of the class of the associated objects. Meant to be used as + # a safety check when you are about to assign an associated record. + # + # source://activerecord//lib/active_record/associations/association.rb#339 + def raise_on_type_mismatch!(record); end + + # source://activerecord//lib/active_record/associations/association.rb#316 + def scope_for_create; end + + # Returns true if statement cache should be skipped on the association reader. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/association.rb#391 + def skip_statement_cache?(scope); end + + # source://activerecord//lib/active_record/associations/association.rb#276 + def skip_strict_loading(&block); end + + # This should be implemented to return the values of the relevant key(s) on the owner, + # so that when stale_state is different from the value stored on the last find_target, + # the target is stale. + # + # This is only relevant to certain associations, which is why it returns +nil+ by default. + # + # source://activerecord//lib/active_record/associations/association.rb#380 + def stale_state; end + + # Can be overridden (i.e. in ThroughAssociation) to merge in other scopes (i.e. the + # through association's scope) + # + # source://activerecord//lib/active_record/associations/association.rb#312 + def target_scope; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/association.rb#284 + def violates_strict_loading?; end +end + +# source://activerecord//lib/active_record/associations/association_scope.rb#5 +class ActiveRecord::Associations::AssociationScope + # @return [AssociationScope] a new instance of AssociationScope + # + # source://activerecord//lib/active_record/associations/association_scope.rb#15 + def initialize(value_transformation); end + + # source://activerecord//lib/active_record/associations/association_scope.rb#21 + def scope(association); end + + private + + # source://activerecord//lib/active_record/associations/association_scope.rb#124 + def add_constraints(scope, owner, chain); end + + # source://activerecord//lib/active_record/associations/association_scope.rb#161 + def apply_scope(scope, table, key, value); end + + # source://activerecord//lib/active_record/associations/association_scope.rb#169 + def eval_scope(reflection, scope, owner); end + + # source://activerecord//lib/active_record/associations/association_scope.rb#112 + def get_chain(reflection, association, tracker); end + + # source://activerecord//lib/active_record/associations/association_scope.rb#54 + def join(table, constraint); end + + # source://activerecord//lib/active_record/associations/association_scope.rb#58 + def last_chain_scope(scope, reflection, owner); end + + # source://activerecord//lib/active_record/associations/association_scope.rb#81 + def next_chain_scope(scope, reflection, next_reflection); end + + # source://activerecord//lib/active_record/associations/association_scope.rb#77 + def transform_value(value); end + + # Returns the value of attribute value_transformation. + # + # source://activerecord//lib/active_record/associations/association_scope.rb#52 + def value_transformation; end + + class << self + # source://activerecord//lib/active_record/associations/association_scope.rb#10 + def create(&block); end + + # source://activerecord//lib/active_record/associations/association_scope.rb#34 + def get_bind_values(owner, chain); end + + # source://activerecord//lib/active_record/associations/association_scope.rb#6 + def scope(association); end + end +end + +# source://activerecord//lib/active_record/associations/association_scope.rb#19 +ActiveRecord::Associations::AssociationScope::INSTANCE = T.let(T.unsafe(nil), ActiveRecord::Associations::AssociationScope) + +# source://activerecord//lib/active_record/associations/association_scope.rb#101 +class ActiveRecord::Associations::AssociationScope::ReflectionProxy < ::SimpleDelegator + # @return [ReflectionProxy] a new instance of ReflectionProxy + # + # source://activerecord//lib/active_record/associations/association_scope.rb#104 + def initialize(reflection, aliased_table); end + + # Returns the value of attribute aliased_table. + # + # source://activerecord//lib/active_record/associations/association_scope.rb#102 + def aliased_table; end + + # source://activerecord//lib/active_record/associations/association_scope.rb#109 + def all_includes; end +end + +# = Active Record Belongs To Association +# +# source://activerecord//lib/active_record/associations/belongs_to_association.rb#6 +class ActiveRecord::Associations::BelongsToAssociation < ::ActiveRecord::Associations::SingularAssociation + # source://activerecord//lib/active_record/associations/belongs_to_association.rb#59 + def decrement_counters; end + + # source://activerecord//lib/active_record/associations/belongs_to_association.rb#67 + def decrement_counters_before_last_save; end + + # source://activerecord//lib/active_record/associations/belongs_to_association.rb#46 + def default(&block); end + + # source://activerecord//lib/active_record/associations/belongs_to_association.rb#7 + def handle_dependency; end + + # source://activerecord//lib/active_record/associations/belongs_to_association.rb#63 + def increment_counters; end + + # source://activerecord//lib/active_record/associations/belongs_to_association.rb#41 + def inversed_from(record); end + + # source://activerecord//lib/active_record/associations/belongs_to_association.rb#50 + def reset; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/belongs_to_association.rb#90 + def saved_change_to_target?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/belongs_to_association.rb#82 + def target_changed?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/belongs_to_association.rb#86 + def target_previously_changed?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/belongs_to_association.rb#55 + def updated?; end + + private + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/belongs_to_association.rb#124 + def find_target?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/belongs_to_association.rb#157 + def foreign_key_present?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/belongs_to_association.rb#161 + def invertible_for?(record); end + + # source://activerecord//lib/active_record/associations/belongs_to_association.rb#153 + def primary_key(klass); end + + # source://activerecord//lib/active_record/associations/belongs_to_association.rb#95 + def replace(record); end + + # source://activerecord//lib/active_record/associations/belongs_to_association.rb#132 + def replace_keys(record, force: T.unsafe(nil)); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/belongs_to_association.rb#128 + def require_counter_update?; end + + # source://activerecord//lib/active_record/associations/belongs_to_association.rb#166 + def stale_state; end + + # source://activerecord//lib/active_record/associations/belongs_to_association.rb#109 + def update_counters(by); end + + # source://activerecord//lib/active_record/associations/belongs_to_association.rb#119 + def update_counters_via_scope(klass, foreign_key, by); end +end + +# = Active Record Belongs To Polymorphic Association +# +# source://activerecord//lib/active_record/associations/belongs_to_polymorphic_association.rb#6 +class ActiveRecord::Associations::BelongsToPolymorphicAssociation < ::ActiveRecord::Associations::BelongsToAssociation + # source://activerecord//lib/active_record/associations/belongs_to_polymorphic_association.rb#7 + def klass; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/belongs_to_polymorphic_association.rb#20 + def saved_change_to_target?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/belongs_to_polymorphic_association.rb#12 + def target_changed?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/belongs_to_polymorphic_association.rb#16 + def target_previously_changed?; end + + private + + # source://activerecord//lib/active_record/associations/belongs_to_polymorphic_association.rb#35 + def inverse_reflection_for(record); end + + # source://activerecord//lib/active_record/associations/belongs_to_polymorphic_association.rb#39 + def raise_on_type_mismatch!(record); end + + # source://activerecord//lib/active_record/associations/belongs_to_polymorphic_association.rb#25 + def replace_keys(record, force: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/associations/belongs_to_polymorphic_association.rb#43 + def stale_state; end +end + +# source://activerecord//lib/active_record/associations.rb#18 +module ActiveRecord::Associations::Builder; end + +# source://activerecord//lib/active_record/associations/builder/association.rb#15 +class ActiveRecord::Associations::Builder::Association + class << self + # source://activerecord//lib/active_record/associations/builder/association.rb#25 + def build(model, name, scope, options, &block); end + + # @raise [ArgumentError] + # + # source://activerecord//lib/active_record/associations/builder/association.rb#40 + def create_reflection(model, name, scope, options, &block); end + + # Returns the value of attribute extensions. + # + # source://activerecord//lib/active_record/associations/builder/association.rb#17 + def extensions; end + + # Sets the attribute extensions + # + # @param value the value to set the attribute extensions to. + # + # source://activerecord//lib/active_record/associations/builder/association.rb#17 + def extensions=(_arg0); end + + private + + # source://activerecord//lib/active_record/associations/builder/association.rb#156 + def add_after_commit_jobs_callback(model, dependent); end + + # source://activerecord//lib/active_record/associations/builder/association.rb#144 + def add_destroy_callbacks(model, reflection); end + + # source://activerecord//lib/active_record/associations/builder/association.rb#53 + def build_scope(scope); end + + # source://activerecord//lib/active_record/associations/builder/association.rb#134 + def check_dependent_options(dependent, model); end + + # Defines the setter and getter methods for the association + # class Post < ActiveRecord::Base + # has_many :comments + # end + # + # Post.first.comments and Post.first.comments= methods are defined by this method... + # + # source://activerecord//lib/active_record/associations/builder/association.rb#95 + def define_accessors(model, reflection); end + + # source://activerecord//lib/active_record/associations/builder/association.rb#77 + def define_callbacks(model, reflection); end + + # source://activerecord//lib/active_record/associations/builder/association.rb#126 + def define_change_tracking_methods(model, reflection); end + + # source://activerecord//lib/active_record/associations/builder/association.rb#73 + def define_extensions(model, name); end + + # source://activerecord//lib/active_record/associations/builder/association.rb#102 + def define_readers(mixin, name); end + + # source://activerecord//lib/active_record/associations/builder/association.rb#122 + def define_validations(model, reflection); end + + # source://activerecord//lib/active_record/associations/builder/association.rb#112 + def define_writers(mixin, name); end + + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/associations/builder/association.rb#61 + def macro; end + + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/associations/builder/association.rb#130 + def valid_dependent_options; end + + # source://activerecord//lib/active_record/associations/builder/association.rb#65 + def valid_options(options); end + + # source://activerecord//lib/active_record/associations/builder/association.rb#69 + def validate_options(options); end + end +end + +# source://activerecord//lib/active_record/associations/builder/association.rb#21 +ActiveRecord::Associations::Builder::Association::VALID_OPTIONS = T.let(T.unsafe(nil), Array) + +# source://activerecord//lib/active_record/associations/builder/belongs_to.rb#4 +class ActiveRecord::Associations::Builder::BelongsTo < ::ActiveRecord::Associations::Builder::SingularAssociation + class << self + # source://activerecord//lib/active_record/associations/builder/belongs_to.rb#45 + def touch_record(o, changes, foreign_key, name, touch); end + + private + + # source://activerecord//lib/active_record/associations/builder/belongs_to.rb#28 + def add_counter_cache_callbacks(model, reflection); end + + # source://activerecord//lib/active_record/associations/builder/belongs_to.rb#104 + def add_default_callbacks(model, reflection); end + + # source://activerecord//lib/active_record/associations/builder/belongs_to.rb#110 + def add_destroy_callbacks(model, reflection); end + + # source://activerecord//lib/active_record/associations/builder/belongs_to.rb#80 + def add_touch_callbacks(model, reflection); end + + # source://activerecord//lib/active_record/associations/builder/belongs_to.rb#21 + def define_callbacks(model, reflection); end + + # source://activerecord//lib/active_record/associations/builder/belongs_to.rb#153 + def define_change_tracking_methods(model, reflection); end + + # source://activerecord//lib/active_record/associations/builder/belongs_to.rb#122 + def define_validations(model, reflection); end + + # source://activerecord//lib/active_record/associations/builder/belongs_to.rb#5 + def macro; end + + # source://activerecord//lib/active_record/associations/builder/belongs_to.rb#17 + def valid_dependent_options; end + + # source://activerecord//lib/active_record/associations/builder/belongs_to.rb#9 + def valid_options(options); end + end +end + +# source://activerecord//lib/active_record/associations/builder/collection_association.rb#6 +class ActiveRecord::Associations::Builder::CollectionAssociation < ::ActiveRecord::Associations::Builder::Association + class << self + # source://activerecord//lib/active_record/associations/builder/collection_association.rb#13 + def define_callbacks(model, reflection); end + + private + + # source://activerecord//lib/active_record/associations/builder/collection_association.rb#30 + def define_callback(model, callback_name, name, options); end + + # source://activerecord//lib/active_record/associations/builder/collection_association.rb#22 + def define_extensions(model, name, &block); end + + # Defines the setter and getter methods for the collection_singular_ids. + # + # source://activerecord//lib/active_record/associations/builder/collection_association.rb#58 + def define_readers(mixin, name); end + + # source://activerecord//lib/active_record/associations/builder/collection_association.rb#70 + def define_writers(mixin, name); end + + # source://activerecord//lib/active_record/associations/builder/collection_association.rb#9 + def valid_options(options); end + end +end + +# source://activerecord//lib/active_record/associations/builder/collection_association.rb#7 +ActiveRecord::Associations::Builder::CollectionAssociation::CALLBACKS = T.let(T.unsafe(nil), Array) + +# source://activerecord//lib/active_record/associations/builder/has_and_belongs_to_many.rb#4 +class ActiveRecord::Associations::Builder::HasAndBelongsToMany + # @return [HasAndBelongsToMany] a new instance of HasAndBelongsToMany + # + # source://activerecord//lib/active_record/associations/builder/has_and_belongs_to_many.rb#7 + def initialize(association_name, lhs_model, options); end + + # Returns the value of attribute association_name. + # + # source://activerecord//lib/active_record/associations/builder/has_and_belongs_to_many.rb#5 + def association_name; end + + # Returns the value of attribute lhs_model. + # + # source://activerecord//lib/active_record/associations/builder/has_and_belongs_to_many.rb#5 + def lhs_model; end + + # source://activerecord//lib/active_record/associations/builder/has_and_belongs_to_many.rb#59 + def middle_reflection(join_model); end + + # Returns the value of attribute options. + # + # source://activerecord//lib/active_record/associations/builder/has_and_belongs_to_many.rb#5 + def options; end + + # source://activerecord//lib/active_record/associations/builder/has_and_belongs_to_many.rb#13 + def through_model; end + + private + + # source://activerecord//lib/active_record/associations/builder/has_and_belongs_to_many.rb#92 + def belongs_to_options(options); end + + # source://activerecord//lib/active_record/associations/builder/has_and_belongs_to_many.rb#71 + def middle_options(join_model); end + + # source://activerecord//lib/active_record/associations/builder/has_and_belongs_to_many.rb#80 + def table_name; end +end + +# source://activerecord//lib/active_record/associations/builder/has_many.rb#4 +class ActiveRecord::Associations::Builder::HasMany < ::ActiveRecord::Associations::Builder::CollectionAssociation + class << self + private + + # source://activerecord//lib/active_record/associations/builder/has_many.rb#5 + def macro; end + + # source://activerecord//lib/active_record/associations/builder/has_many.rb#17 + def valid_dependent_options; end + + # source://activerecord//lib/active_record/associations/builder/has_many.rb#9 + def valid_options(options); end + end +end + +# source://activerecord//lib/active_record/associations/builder/has_one.rb#4 +class ActiveRecord::Associations::Builder::HasOne < ::ActiveRecord::Associations::Builder::SingularAssociation + class << self + # source://activerecord//lib/active_record/associations/builder/has_one.rb#37 + def touch_record(record, name, touch); end + + private + + # source://activerecord//lib/active_record/associations/builder/has_one.rb#26 + def add_destroy_callbacks(model, reflection); end + + # source://activerecord//lib/active_record/associations/builder/has_one.rb#46 + def add_touch_callbacks(model, reflection); end + + # source://activerecord//lib/active_record/associations/builder/has_one.rb#21 + def define_callbacks(model, reflection); end + + # source://activerecord//lib/active_record/associations/builder/has_one.rb#30 + def define_validations(model, reflection); end + + # source://activerecord//lib/active_record/associations/builder/has_one.rb#5 + def macro; end + + # source://activerecord//lib/active_record/associations/builder/has_one.rb#17 + def valid_dependent_options; end + + # source://activerecord//lib/active_record/associations/builder/has_one.rb#9 + def valid_options(options); end + end +end + +# source://activerecord//lib/active_record/associations/builder/singular_association.rb#6 +class ActiveRecord::Associations::Builder::SingularAssociation < ::ActiveRecord::Associations::Builder::Association + class << self + # source://activerecord//lib/active_record/associations/builder/singular_association.rb#56 + def define_callbacks(model, reflection); end + + private + + # source://activerecord//lib/active_record/associations/builder/singular_association.rb#11 + def define_accessors(model, reflection); end + + # Defines the (build|create)_association methods for belongs_to or has_one association + # + # source://activerecord//lib/active_record/associations/builder/singular_association.rb#34 + def define_constructors(mixin, name); end + + # source://activerecord//lib/active_record/associations/builder/singular_association.rb#7 + def valid_options(options); end + end +end + +# = Active Record \Associations +# +# \Associations are a set of macro-like class methods for tying objects together through +# foreign keys. They express relationships like "Project has one Project Manager" +# or "Project belongs to a Portfolio". Each macro adds a number of methods to the +# class which are specialized according to the collection or association symbol and the +# options hash. It works much the same way as Ruby's own attr* +# methods. +# +# class Project < ActiveRecord::Base +# belongs_to :portfolio +# has_one :project_manager +# has_many :milestones +# has_and_belongs_to_many :categories +# end +# +# The project class now has the following methods (and more) to ease the traversal and +# manipulation of its relationships: +# +# project = Project.first +# project.portfolio +# project.portfolio = Portfolio.first +# project.reload_portfolio +# +# project.project_manager +# project.project_manager = ProjectManager.first +# project.reload_project_manager +# +# project.milestones.empty? +# project.milestones.size +# project.milestones +# project.milestones << Milestone.first +# project.milestones.delete(Milestone.first) +# project.milestones.destroy(Milestone.first) +# project.milestones.find(Milestone.first.id) +# project.milestones.build +# project.milestones.create +# +# project.categories.empty? +# project.categories.size +# project.categories +# project.categories << Category.first +# project.categories.delete(category1) +# project.categories.destroy(category1) +# +# === A word of warning +# +# Don't create associations that have the same name as {instance methods}[rdoc-ref:ActiveRecord::Core] of +# +ActiveRecord::Base+. Since the association adds a method with that name to +# its model, using an association with the same name as one provided by +ActiveRecord::Base+ will override the method inherited through +ActiveRecord::Base+ and will break things. +# For instance, +attributes+ and +connection+ would be bad choices for association names, because those names already exist in the list of +ActiveRecord::Base+ instance methods. +# +# == Auto-generated methods +# See also "Instance Public methods" below ( from #belongs_to ) for more details. +# +# === Singular associations (one-to-one) +# | | belongs_to | +# generated methods | belongs_to | :polymorphic | has_one +# ----------------------------------+------------+--------------+--------- +# other | X | X | X +# other=(other) | X | X | X +# build_other(attributes={}) | X | | X +# create_other(attributes={}) | X | | X +# create_other!(attributes={}) | X | | X +# reload_other | X | X | X +# other_changed? | X | X | +# other_previously_changed? | X | X | +# +# === Collection associations (one-to-many / many-to-many) +# | | | has_many +# generated methods | habtm | has_many | :through +# ----------------------------------+-------+----------+---------- +# others | X | X | X +# others=(other,other,...) | X | X | X +# other_ids | X | X | X +# other_ids=(id,id,...) | X | X | X +# others<< | X | X | X +# others.push | X | X | X +# others.concat | X | X | X +# others.build(attributes={}) | X | X | X +# others.create(attributes={}) | X | X | X +# others.create!(attributes={}) | X | X | X +# others.size | X | X | X +# others.length | X | X | X +# others.count | X | X | X +# others.sum(*args) | X | X | X +# others.empty? | X | X | X +# others.clear | X | X | X +# others.delete(other,other,...) | X | X | X +# others.delete_all | X | X | X +# others.destroy(other,other,...) | X | X | X +# others.destroy_all | X | X | X +# others.find(*args) | X | X | X +# others.exists? | X | X | X +# others.distinct | X | X | X +# others.reset | X | X | X +# others.reload | X | X | X +# +# === Overriding generated methods +# +# Association methods are generated in a module included into the model +# class, making overrides easy. The original generated method can thus be +# called with +super+: +# +# class Car < ActiveRecord::Base +# belongs_to :owner +# belongs_to :old_owner +# +# def owner=(new_owner) +# self.old_owner = self.owner +# super +# end +# end +# +# The association methods module is included immediately after the +# generated attributes methods module, meaning an association will +# override the methods for an attribute with the same name. +# +# == Cardinality and associations +# +# Active Record associations can be used to describe one-to-one, one-to-many, and many-to-many +# relationships between models. Each model uses an association to describe its role in +# the relation. The #belongs_to association is always used in the model that has +# the foreign key. +# +# === One-to-one +# +# Use #has_one in the base, and #belongs_to in the associated model. +# +# class Employee < ActiveRecord::Base +# has_one :office +# end +# class Office < ActiveRecord::Base +# belongs_to :employee # foreign key - employee_id +# end +# +# === One-to-many +# +# Use #has_many in the base, and #belongs_to in the associated model. +# +# class Manager < ActiveRecord::Base +# has_many :employees +# end +# class Employee < ActiveRecord::Base +# belongs_to :manager # foreign key - manager_id +# end +# +# === Many-to-many +# +# There are two ways to build a many-to-many relationship. +# +# The first way uses a #has_many association with the :through option and a join model, so +# there are two stages of associations. +# +# class Assignment < ActiveRecord::Base +# belongs_to :programmer # foreign key - programmer_id +# belongs_to :project # foreign key - project_id +# end +# class Programmer < ActiveRecord::Base +# has_many :assignments +# has_many :projects, through: :assignments +# end +# class Project < ActiveRecord::Base +# has_many :assignments +# has_many :programmers, through: :assignments +# end +# +# For the second way, use #has_and_belongs_to_many in both models. This requires a join table +# that has no corresponding model or primary key. +# +# class Programmer < ActiveRecord::Base +# has_and_belongs_to_many :projects # foreign keys in the join table +# end +# class Project < ActiveRecord::Base +# has_and_belongs_to_many :programmers # foreign keys in the join table +# end +# +# Choosing which way to build a many-to-many relationship is not always simple. +# If you need to work with the relationship model as its own entity, +# use #has_many :through. Use #has_and_belongs_to_many when working with legacy schemas or when +# you never work directly with the relationship itself. +# +# == Is it a #belongs_to or #has_one association? +# +# Both express a 1-1 relationship. The difference is mostly where to place the foreign +# key, which goes on the table for the class declaring the #belongs_to relationship. +# +# class User < ActiveRecord::Base +# # I reference an account. +# belongs_to :account +# end +# +# class Account < ActiveRecord::Base +# # One user references me. +# has_one :user +# end +# +# The tables for these classes could look something like: +# +# CREATE TABLE users ( +# id bigint NOT NULL auto_increment, +# account_id bigint default NULL, +# name varchar default NULL, +# PRIMARY KEY (id) +# ) +# +# CREATE TABLE accounts ( +# id bigint NOT NULL auto_increment, +# name varchar default NULL, +# PRIMARY KEY (id) +# ) +# +# == Unsaved objects and associations +# +# You can manipulate objects and associations before they are saved to the database, but +# there is some special behavior you should be aware of, mostly involving the saving of +# associated objects. +# +# You can set the :autosave option on a #has_one, #belongs_to, +# #has_many, or #has_and_belongs_to_many association. Setting it +# to +true+ will _always_ save the members, whereas setting it to +false+ will +# _never_ save the members. More details about :autosave option is available at +# AutosaveAssociation. +# +# === One-to-one associations +# +# * Assigning an object to a #has_one association automatically saves that object and +# the object being replaced (if there is one), in order to update their foreign +# keys - except if the parent object is unsaved (new_record? == true). +# * If either of these saves fail (due to one of the objects being invalid), an +# ActiveRecord::RecordNotSaved exception is raised and the assignment is +# cancelled. +# * If you wish to assign an object to a #has_one association without saving it, +# use the #build_association method (documented below). The object being +# replaced will still be saved to update its foreign key. +# * Assigning an object to a #belongs_to association does not save the object, since +# the foreign key field belongs on the parent. It does not save the parent either. +# +# === Collections +# +# * Adding an object to a collection (#has_many or #has_and_belongs_to_many) automatically +# saves that object, except if the parent object (the owner of the collection) is not yet +# stored in the database. +# * If saving any of the objects being added to a collection (via push or similar) +# fails, then push returns +false+. +# * If saving fails while replacing the collection (via association=), an +# ActiveRecord::RecordNotSaved exception is raised and the assignment is +# cancelled. +# * You can add an object to a collection without automatically saving it by using the +# collection.build method (documented below). +# * All unsaved (new_record? == true) members of the collection are automatically +# saved when the parent is saved. +# +# == Customizing the query +# +# \Associations are built from Relation objects, and you can use the Relation syntax +# to customize them. For example, to add a condition: +# +# class Blog < ActiveRecord::Base +# has_many :published_posts, -> { where(published: true) }, class_name: 'Post' +# end +# +# Inside the -> { ... } block you can use all of the usual Relation methods. +# +# === Accessing the owner object +# +# Sometimes it is useful to have access to the owner object when building the query. The owner +# is passed as a parameter to the block. For example, the following association would find all +# events that occur on the user's birthday: +# +# class User < ActiveRecord::Base +# has_many :birthday_events, ->(user) { where(starts_on: user.birthday) }, class_name: 'Event' +# end +# +# Note: Joining or eager loading such associations is not possible because +# those operations happen before instance creation. Such associations +# _can_ be preloaded, but doing so will perform N+1 queries because there +# will be a different scope for each record (similar to preloading +# polymorphic scopes). +# +# == Association callbacks +# +# Similar to the normal callbacks that hook into the life cycle of an Active Record object, +# you can also define callbacks that get triggered when you add an object to or remove an +# object from an association collection. +# +# class Firm < ActiveRecord::Base +# has_many :clients, +# dependent: :destroy, +# after_add: :congratulate_client, +# after_remove: :log_after_remove +# +# def congratulate_client(client) +# # ... +# end +# +# def log_after_remove(client) +# # ... +# end +# end +# +# Callbacks can be defined in three ways: +# +# 1. A symbol that references a method defined on the class with the +# associated collection. For example, after_add: :congratulate_client +# invokes Firm#congratulate_client(client). +# 2. A callable with a signature that accepts both the record with the +# associated collection and the record being added or removed. For +# example, after_add: ->(firm, client) { ... }. +# 3. An object that responds to the callback name. For example, passing +# after_add: CallbackObject.new invokes CallbackObject#after_add(firm, +# client). +# +# It's possible to stack callbacks by passing them as an array. Example: +# +# class CallbackObject +# def after_add(firm, client) +# firm.log << "after_adding #{client.id}" +# end +# end +# +# class Firm < ActiveRecord::Base +# has_many :clients, +# dependent: :destroy, +# after_add: [ +# :congratulate_client, +# -> (firm, client) { firm.log << "after_adding #{client.id}" }, +# CallbackObject.new +# ], +# after_remove: :log_after_remove +# end +# +# Possible callbacks are: +before_add+, +after_add+, +before_remove+, and +after_remove+. +# +# If any of the +before_add+ callbacks throw an exception, the object will not be +# added to the collection. +# +# Similarly, if any of the +before_remove+ callbacks throw an exception, the object +# will not be removed from the collection. +# +# Note: To trigger remove callbacks, you must use +destroy+ / +destroy_all+ methods. For example: +# +# * firm.clients.destroy(client) +# * firm.clients.destroy(*clients) +# * firm.clients.destroy_all +# +# +delete+ / +delete_all+ methods like the following do *not* trigger remove callbacks: +# +# * firm.clients.delete(client) +# * firm.clients.delete(*clients) +# * firm.clients.delete_all +# +# == Association extensions +# +# The proxy objects that control the access to associations can be extended through anonymous +# modules. This is especially beneficial for adding new finders, creators, and other +# factory-type methods that are only used as part of this association. +# +# class Account < ActiveRecord::Base +# has_many :people do +# def find_or_create_by_name(name) +# first_name, last_name = name.split(" ", 2) +# find_or_create_by(first_name: first_name, last_name: last_name) +# end +# end +# end +# +# person = Account.first.people.find_or_create_by_name("David Heinemeier Hansson") +# person.first_name # => "David" +# person.last_name # => "Heinemeier Hansson" +# +# If you need to share the same extensions between many associations, you can use a named +# extension module. +# +# module FindOrCreateByNameExtension +# def find_or_create_by_name(name) +# first_name, last_name = name.split(" ", 2) +# find_or_create_by(first_name: first_name, last_name: last_name) +# end +# end +# +# class Account < ActiveRecord::Base +# has_many :people, -> { extending FindOrCreateByNameExtension } +# end +# +# class Company < ActiveRecord::Base +# has_many :people, -> { extending FindOrCreateByNameExtension } +# end +# +# Some extensions can only be made to work with knowledge of the association's internals. +# Extensions can access relevant state using the following methods (where +items+ is the +# name of the association): +# +# * record.association(:items).owner - Returns the object the association is part of. +# * record.association(:items).reflection - Returns the reflection object that describes the association. +# * record.association(:items).target - Returns the associated object for #belongs_to and #has_one, or +# the collection of associated objects for #has_many and #has_and_belongs_to_many. +# +# However, inside the actual extension code, you will not have access to the record as +# above. In this case, you can access proxy_association. For example, +# record.association(:items) and record.items.proxy_association will return +# the same object, allowing you to make calls like proxy_association.owner inside +# association extensions. +# +# == Association Join Models +# +# Has Many associations can be configured with the :through option to use an +# explicit join model to retrieve the data. This operates similarly to a +# #has_and_belongs_to_many association. The advantage is that you're able to add validations, +# callbacks, and extra attributes on the join model. Consider the following schema: +# +# class Author < ActiveRecord::Base +# has_many :authorships +# has_many :books, through: :authorships +# end +# +# class Authorship < ActiveRecord::Base +# belongs_to :author +# belongs_to :book +# end +# +# @author = Author.first +# @author.authorships.collect { |a| a.book } # selects all books that the author's authorships belong to +# @author.books # selects all books by using the Authorship join model +# +# You can also go through a #has_many association on the join model: +# +# class Firm < ActiveRecord::Base +# has_many :clients +# has_many :invoices, through: :clients +# end +# +# class Client < ActiveRecord::Base +# belongs_to :firm +# has_many :invoices +# end +# +# class Invoice < ActiveRecord::Base +# belongs_to :client +# end +# +# @firm = Firm.first +# @firm.clients.flat_map { |c| c.invoices } # select all invoices for all clients of the firm +# @firm.invoices # selects all invoices by going through the Client join model +# +# Similarly you can go through a #has_one association on the join model: +# +# class Group < ActiveRecord::Base +# has_many :users +# has_many :avatars, through: :users +# end +# +# class User < ActiveRecord::Base +# belongs_to :group +# has_one :avatar +# end +# +# class Avatar < ActiveRecord::Base +# belongs_to :user +# end +# +# @group = Group.first +# @group.users.collect { |u| u.avatar }.compact # select all avatars for all users in the group +# @group.avatars # selects all avatars by going through the User join model. +# +# An important caveat with going through #has_one or #has_many associations on the +# join model is that these associations are *read-only*. For example, the following +# would not work following the previous example: +# +# @group.avatars << Avatar.new # this would work if User belonged_to Avatar rather than the other way around +# @group.avatars.delete(@group.avatars.last) # so would this +# +# === Setting Inverses +# +# If you are using a #belongs_to on the join model, it is a good idea to set the +# :inverse_of option on the #belongs_to, which will mean that the following example +# works correctly (where tags is a #has_many :through association): +# +# @post = Post.first +# @tag = @post.tags.build name: "ruby" +# @tag.save +# +# The last line ought to save the through record (a Tagging). This will only work if the +# :inverse_of is set: +# +# class Tagging < ActiveRecord::Base +# belongs_to :post +# belongs_to :tag, inverse_of: :taggings +# end +# +# If you do not set the :inverse_of record, the association will +# do its best to match itself up with the correct inverse. Automatic +# inverse detection only works on #has_many, #has_one, and +# #belongs_to associations. +# +# :foreign_key and :through options on the associations +# will also prevent the association's inverse from being found automatically, +# as will a custom scopes in some cases. See further details in the +# {Active Record Associations guide}[https://guides.rubyonrails.org/association_basics.html#bi-directional-associations]. +# +# The automatic guessing of the inverse association uses a heuristic based +# on the name of the class, so it may not work for all associations, +# especially the ones with non-standard names. +# +# You can turn off the automatic detection of inverse associations by setting +# the :inverse_of option to false like so: +# +# class Tagging < ActiveRecord::Base +# belongs_to :tag, inverse_of: false +# end +# +# == Nested \Associations +# +# You can actually specify *any* association with the :through option, including an +# association which has a :through option itself. For example: +# +# class Author < ActiveRecord::Base +# has_many :posts +# has_many :comments, through: :posts +# has_many :commenters, through: :comments +# end +# +# class Post < ActiveRecord::Base +# has_many :comments +# end +# +# class Comment < ActiveRecord::Base +# belongs_to :commenter +# end +# +# @author = Author.first +# @author.commenters # => People who commented on posts written by the author +# +# An equivalent way of setting up this association this would be: +# +# class Author < ActiveRecord::Base +# has_many :posts +# has_many :commenters, through: :posts +# end +# +# class Post < ActiveRecord::Base +# has_many :comments +# has_many :commenters, through: :comments +# end +# +# class Comment < ActiveRecord::Base +# belongs_to :commenter +# end +# +# When using a nested association, you will not be able to modify the association because there +# is not enough information to know what modification to make. For example, if you tried to +# add a Commenter in the example above, there would be no way to tell how to set up the +# intermediate Post and Comment objects. +# +# == Polymorphic \Associations +# +# Polymorphic associations on models are not restricted on what types of models they +# can be associated with. Rather, they specify an interface that a #has_many association +# must adhere to. +# +# class Asset < ActiveRecord::Base +# belongs_to :attachable, polymorphic: true +# end +# +# class Post < ActiveRecord::Base +# has_many :assets, as: :attachable # The :as option specifies the polymorphic interface to use. +# end +# +# @asset.attachable = @post +# +# This works by using a type column in addition to a foreign key to specify the associated +# record. In the Asset example, you'd need an +attachable_id+ integer column and an +# +attachable_type+ string column. +# +# Using polymorphic associations in combination with single table inheritance (STI) is +# a little tricky. In order for the associations to work as expected, ensure that you +# store the base model for the STI models in the type column of the polymorphic +# association. To continue with the asset example above, suppose there are guest posts +# and member posts that use the posts table for STI. In this case, there must be a +type+ +# column in the posts table. +# +# Note: The attachable_type= method is being called when assigning an +attachable+. +# The +class_name+ of the +attachable+ is passed as a String. +# +# class Asset < ActiveRecord::Base +# belongs_to :attachable, polymorphic: true +# +# def attachable_type=(class_name) +# super(class_name.constantize.base_class.to_s) +# end +# end +# +# class Post < ActiveRecord::Base +# # because we store "Post" in attachable_type now dependent: :destroy will work +# has_many :assets, as: :attachable, dependent: :destroy +# end +# +# class GuestPost < Post +# end +# +# class MemberPost < Post +# end +# +# == Caching +# +# All of the methods are built on a simple caching principle that will keep the result +# of the last query around unless specifically instructed not to. The cache is even +# shared across methods to make it even cheaper to use the macro-added methods without +# worrying too much about performance at the first go. +# +# project.milestones # fetches milestones from the database +# project.milestones.size # uses the milestone cache +# project.milestones.empty? # uses the milestone cache +# project.milestones.reload.size # fetches milestones from the database +# project.milestones # uses the milestone cache +# +# == Eager loading of associations +# +# Eager loading is a way to find objects of a certain class and a number of named associations. +# It is one of the easiest ways to prevent the dreaded N+1 problem in which fetching 100 +# posts that each need to display their author triggers 101 database queries. Through the +# use of eager loading, the number of queries will be reduced from 101 to 2. +# +# class Post < ActiveRecord::Base +# belongs_to :author +# has_many :comments +# end +# +# Consider the following loop using the class above: +# +# Post.all.each do |post| +# puts "Post: " + post.title +# puts "Written by: " + post.author.name +# puts "Last comment on: " + post.comments.first.created_on +# end +# +# To iterate over these one hundred posts, we'll generate 201 database queries. Let's +# first just optimize it for retrieving the author: +# +# Post.includes(:author).each do |post| +# +# This references the name of the #belongs_to association that also used the :author +# symbol. After loading the posts, +find+ will collect the +author_id+ from each one and load +# all of the referenced authors with one query. Doing so will cut down the number of queries +# from 201 to 102. +# +# We can improve upon the situation further by referencing both associations in the finder with: +# +# Post.includes(:author, :comments).each do |post| +# +# This will load all comments with a single query. This reduces the total number of queries +# to 3. In general, the number of queries will be 1 plus the number of associations +# named (except if some of the associations are polymorphic #belongs_to - see below). +# +# To include a deep hierarchy of associations, use a hash: +# +# Post.includes(:author, { comments: { author: :gravatar } }).each do |post| +# +# The above code will load all the comments and all of their associated +# authors and gravatars. You can mix and match any combination of symbols, +# arrays, and hashes to retrieve the associations you want to load. +# +# All of this power shouldn't fool you into thinking that you can pull out huge amounts +# of data with no performance penalty just because you've reduced the number of queries. +# The database still needs to send all the data to Active Record and it still needs to +# be processed. So it's no catch-all for performance problems, but it's a great way to +# cut down on the number of queries in a situation as the one described above. +# +# Since only one table is loaded at a time, conditions or orders cannot reference tables +# other than the main one. If this is the case, Active Record falls back to the previously +# used LEFT OUTER JOIN based strategy. For example: +# +# Post.includes([:author, :comments]).where(['comments.approved = ?', true]) +# +# This will result in a single SQL query with joins along the lines of: +# LEFT OUTER JOIN comments ON comments.post_id = posts.id and +# LEFT OUTER JOIN authors ON authors.id = posts.author_id. Note that using conditions +# like this can have unintended consequences. +# In the above example, posts with no approved comments are not returned at all because +# the conditions apply to the SQL statement as a whole and not just to the association. +# +# You must disambiguate column references for this fallback to happen, for example +# order: "author.name DESC" will work but order: "name DESC" will not. +# +# If you want to load all posts (including posts with no approved comments), then write +# your own LEFT OUTER JOIN query using ON: +# +# Post.joins("LEFT OUTER JOIN comments ON comments.post_id = posts.id AND comments.approved = '1'") +# +# In this case, it is usually more natural to include an association which has conditions defined on it: +# +# class Post < ActiveRecord::Base +# has_many :approved_comments, -> { where(approved: true) }, class_name: 'Comment' +# end +# +# Post.includes(:approved_comments) +# +# This will load posts and eager load the +approved_comments+ association, which contains +# only those comments that have been approved. +# +# If you eager load an association with a specified :limit option, it will be ignored, +# returning all the associated objects: +# +# class Picture < ActiveRecord::Base +# has_many :most_recent_comments, -> { order('id DESC').limit(10) }, class_name: 'Comment' +# end +# +# Picture.includes(:most_recent_comments).first.most_recent_comments # => returns all associated comments. +# +# Eager loading is supported with polymorphic associations. +# +# class Address < ActiveRecord::Base +# belongs_to :addressable, polymorphic: true +# end +# +# A call that tries to eager load the addressable model +# +# Address.includes(:addressable) +# +# This will execute one query to load the addresses and load the addressables with one +# query per addressable type. +# For example, if all the addressables are either of class Person or Company, then a total +# of 3 queries will be executed. The list of addressable types to load is determined on +# the back of the addresses loaded. This is not supported if Active Record has to fall back +# to the previous implementation of eager loading and will raise ActiveRecord::EagerLoadPolymorphicError. +# The reason is that the parent model's type is a column value so its corresponding table +# name cannot be put in the +FROM+/+JOIN+ clauses of that query. +# +# == Table Aliasing +# +# Active Record uses table aliasing in the case that a table is referenced multiple times +# in a join. If a table is referenced only once, the standard table name is used. The +# second time, the table is aliased as #{reflection_name}_#{parent_table_name}. +# Indexes are appended for any more successive uses of the table name. +# +# Post.joins(:comments) +# # SELECT ... FROM posts INNER JOIN comments ON ... +# Post.joins(:special_comments) # STI +# # SELECT ... FROM posts INNER JOIN comments ON ... AND comments.type = 'SpecialComment' +# Post.joins(:comments, :special_comments) # special_comments is the reflection name, posts is the parent table name +# # SELECT ... FROM posts INNER JOIN comments ON ... INNER JOIN comments special_comments_posts +# +# Acts as tree example: +# +# TreeMixin.joins(:children) +# # SELECT ... FROM mixins INNER JOIN mixins childrens_mixins ... +# TreeMixin.joins(children: :parent) +# # SELECT ... FROM mixins INNER JOIN mixins childrens_mixins ... +# # INNER JOIN parents_mixins ... +# TreeMixin.joins(children: {parent: :children}) +# # SELECT ... FROM mixins INNER JOIN mixins childrens_mixins ... +# # INNER JOIN parents_mixins ... +# # INNER JOIN mixins childrens_mixins_2 +# +# Has and Belongs to Many join tables use the same idea, but add a _join suffix: +# +# Post.joins(:categories) +# # SELECT ... FROM posts INNER JOIN categories_posts ... INNER JOIN categories ... +# Post.joins(categories: :posts) +# # SELECT ... FROM posts INNER JOIN categories_posts ... INNER JOIN categories ... +# # INNER JOIN categories_posts posts_categories_join INNER JOIN posts posts_categories +# Post.joins(categories: {posts: :categories}) +# # SELECT ... FROM posts INNER JOIN categories_posts ... INNER JOIN categories ... +# # INNER JOIN categories_posts posts_categories_join INNER JOIN posts posts_categories +# # INNER JOIN categories_posts categories_posts_join INNER JOIN categories categories_posts_2 +# +# If you wish to specify your own custom joins using ActiveRecord::QueryMethods#joins method, those table +# names will take precedence over the eager associations: +# +# Post.joins(:comments).joins("inner join comments ...") +# # SELECT ... FROM posts INNER JOIN comments_posts ON ... INNER JOIN comments ... +# Post.joins(:comments, :special_comments).joins("inner join comments ...") +# # SELECT ... FROM posts INNER JOIN comments comments_posts ON ... +# # INNER JOIN comments special_comments_posts ... +# # INNER JOIN comments ... +# +# Table aliases are automatically truncated according to the maximum length of table identifiers +# according to the specific database. +# +# == Modules +# +# By default, associations will look for objects within the current module scope. Consider: +# +# module MyApplication +# module Business +# class Firm < ActiveRecord::Base +# has_many :clients +# end +# +# class Client < ActiveRecord::Base; end +# end +# end +# +# When Firm#clients is called, it will in turn call +# MyApplication::Business::Client.find_all_by_firm_id(firm.id). +# If you want to associate with a class in another module scope, this can be done by +# specifying the complete class name. +# +# module MyApplication +# module Business +# class Firm < ActiveRecord::Base; end +# end +# +# module Billing +# class Account < ActiveRecord::Base +# belongs_to :firm, class_name: "MyApplication::Business::Firm" +# end +# end +# end +# +# == Bi-directional associations +# +# When you specify an association, there is usually an association on the associated model +# that specifies the same relationship in reverse. For example, with the following models: +# +# class Dungeon < ActiveRecord::Base +# has_many :traps +# has_one :evil_wizard +# end +# +# class Trap < ActiveRecord::Base +# belongs_to :dungeon +# end +# +# class EvilWizard < ActiveRecord::Base +# belongs_to :dungeon +# end +# +# The +traps+ association on +Dungeon+ and the +dungeon+ association on +Trap+ are +# the inverse of each other, and the inverse of the +dungeon+ association on +EvilWizard+ +# is the +evil_wizard+ association on +Dungeon+ (and vice-versa). By default, +# Active Record can guess the inverse of the association based on the name +# of the class. The result is the following: +# +# d = Dungeon.first +# t = d.traps.first +# d.object_id == t.dungeon.object_id # => true +# +# The +Dungeon+ instances +d+ and t.dungeon in the above example refer to +# the same in-memory instance since the association matches the name of the class. +# The result would be the same if we added +:inverse_of+ to our model definitions: +# +# class Dungeon < ActiveRecord::Base +# has_many :traps, inverse_of: :dungeon +# has_one :evil_wizard, inverse_of: :dungeon +# end +# +# class Trap < ActiveRecord::Base +# belongs_to :dungeon, inverse_of: :traps +# end +# +# class EvilWizard < ActiveRecord::Base +# belongs_to :dungeon, inverse_of: :evil_wizard +# end +# +# For more information, see the documentation for the +:inverse_of+ option and the +# {Active Record Associations guide}[https://guides.rubyonrails.org/association_basics.html#bi-directional-associations]. +# +# == Deleting from associations +# +# === Dependent associations +# +# #has_many, #has_one, and #belongs_to associations support the :dependent option. +# This allows you to specify that associated records should be deleted when the owner is +# deleted. +# +# For example: +# +# class Author +# has_many :posts, dependent: :destroy +# end +# Author.find(1).destroy # => Will destroy all of the author's posts, too +# +# The :dependent option can have different values which specify how the deletion +# is done. For more information, see the documentation for this option on the different +# specific association types. When no option is given, the behavior is to do nothing +# with the associated records when destroying a record. +# +# Note that :dependent is implemented using \Rails' callback +# system, which works by processing callbacks in order. Therefore, other +# callbacks declared either before or after the :dependent option +# can affect what it does. +# +# Note that :dependent option is ignored for #has_one :through associations. +# +# === Delete or destroy? +# +# #has_many and #has_and_belongs_to_many associations have the methods destroy, +# delete, destroy_all and delete_all. +# +# For #has_and_belongs_to_many, delete and destroy are the same: they +# cause the records in the join table to be removed. +# +# For #has_many, destroy and destroy_all will always call the destroy method of the +# record(s) being removed so that callbacks are run. However delete and delete_all will either +# do the deletion according to the strategy specified by the :dependent option, or +# if no :dependent option is given, then it will follow the default strategy. +# The default strategy is to do nothing (leave the foreign keys with the parent ids set), except for +# #has_many :through, where the default strategy is delete_all (delete +# the join records, without running their callbacks). +# +# There is also a clear method which is the same as delete_all, except that +# it returns the association rather than the records which have been deleted. +# +# === What gets deleted? +# +# There is a potential pitfall here: #has_and_belongs_to_many and #has_many :through +# associations have records in join tables, as well as the associated records. So when we +# call one of these deletion methods, what exactly should be deleted? +# +# The answer is that it is assumed that deletion on an association is about removing the +# link between the owner and the associated object(s), rather than necessarily the +# associated objects themselves. So with #has_and_belongs_to_many and #has_many +# :through, the join records will be deleted, but the associated records won't. +# +# This makes sense if you think about it: if you were to call post.tags.delete(Tag.find_by(name: 'food')) +# you would want the 'food' tag to be unlinked from the post, rather than for the tag itself +# to be removed from the database. +# +# However, there are examples where this strategy doesn't make sense. For example, suppose +# a person has many projects, and each project has many tasks. If we deleted one of a person's +# tasks, we would probably not want the project to be deleted. In this scenario, the delete method +# won't actually work: it can only be used if the association on the join model is a +# #belongs_to. In other situations you are expected to perform operations directly on +# either the associated records or the :through association. +# +# With a regular #has_many there is no distinction between the "associated records" +# and the "link", so there is only one choice for what gets deleted. +# +# With #has_and_belongs_to_many and #has_many :through, if you want to delete the +# associated records themselves, you can always do something along the lines of +# person.tasks.each(&:destroy). +# +# == Deprecated Associations +# +# Associations can be marked as deprecated by passing deprecated: true: +# +# has_many :posts, deprecated: true +# +# When a deprecated association is used, a warning is issued using the +# Active Record logger, though more options are available via +# configuration. +# +# The message includes some context that helps understand the deprecated +# usage: +# +# The association Author#posts is deprecated, the method post_ids was invoked (...) +# The association Author#posts is deprecated, referenced in query to preload records (...) +# +# The dots in the examples above would have the application-level spot +# where usage occurred, to help locate what triggered the warning. That +# location is computed using the Active Record backtrace cleaner. +# +# === What is considered to be usage? +# +# * Invocation of any association methods like +posts+, posts=, +# etc. +# +# * If the association accepts nested attributes, assignment to those +# attributes. +# +# * If the association is a through association and some of its nested +# associations are deprecated, you'll get warnings for them whenever the +# top-level through is used. This is so regardless of whether the +# through itself is deprecated. +# +# * Execution of queries that refer to the association. Think execution of +# eager_load(:posts), joins(author: :posts), etc. +# +# * If the association has a +:dependent+ option, destroying the +# associated record issues warnings (because that has a side-effect that +# would not happen if the association was removed). +# +# * If the association has a +:touch+ option, saving or destroying the +# record issues a warning (because that has a side-effect that would not +# happen if the association was removed). +# +# === Things that do NOT issue warnings +# +# The rationale behind most of the following edge cases is that Active +# Record accesses associations lazily, when used. Before that, the +# reference to the association is basically just a Ruby symbol. +# +# * If +posts+ is deprecated, has_many :comments, through: :posts +# does not warn. Usage of the +comments+ association reports usage of +# +posts+, as we explained above, but the definition of the +has_many+ +# itself does not. +# +# * Similarly, accepts_nested_attributes_for :posts does not +# warn. Assignment to the posts attributes warns, as explained above, +# but the +accepts_nested_attributes_for+ call itself does not. +# +# * Same if an association declares to be inverse of a deprecated one, the +# macro itself does not warn. +# +# * In the same line, the declaration validates_associated :posts +# does not warn by itself, though access is reported when the validation +# runs. +# +# * Relation query methods like Author.includes(:posts) do not +# warn by themselves. At that point, that is a relation that internally +# stores a symbol for later use. As explained in the previous section, +# you get a warning when/if the query is executed. +# +# * Access to the reflection object of the association as in +# Author.reflect_on_association(:posts) or +# Author.reflect_on_all_associations does not warn. +# +# === Configuration +# +# Reporting deprecated usage can be configured: +# +# config.active_record.deprecated_associations_options = { ... } +# +# If present, this has to be a hash with keys +:mode+ and/or +:backtrace+. +# +# ==== Mode +# +# * In +:warn+ mode, usage issues a warning that includes the +# application-level place where the access happened, if any. This is the +# default mode. +# +# * In +:raise+ mode, usage raises an +# ActiveRecord::DeprecatedAssociationError with a similar message and a +# clean backtrace in the exception object. +# +# * In +:notify+ mode, a deprecated_association.active_record +# Active Support notification is published. The event payload has the +# association reflection (+:reflection+), the application-level location +# (+:location+) where the access happened (a Thread::Backtrace::Location +# object, or +nil+), and a deprecation message (+:message+). +# +# ==== Backtrace +# +# If +:backtrace+ is true, warnings include a clean backtrace in the message +# and notifications have a +:backtrace+ key in the payload with an array +# of clean Thread::Backtrace::Location objects. Exceptions always get a +# clean stack trace set. +# +# Clean backtraces are computed using the Active Record backtrace cleaner. +# In Rails applications, that is by the default the same as +# Rails.backtrace_cleaner. +# +# == Type safety with ActiveRecord::AssociationTypeMismatch +# +# If you attempt to assign an object to an association that doesn't match the inferred +# or specified :class_name, you'll get an ActiveRecord::AssociationTypeMismatch. +# +# == Options +# +# All of the association macros can be specialized through options. This makes cases +# more complex than the simple and guessable ones possible. +# +# source://activerecord//lib/active_record/associations.rb#1152 +module ActiveRecord::Associations::ClassMethods + # Specifies a one-to-one association with another class. This method + # should only be used if this class contains the foreign key. If the + # other class contains the foreign key, then you should use #has_one + # instead. See {Is it a belongs_to or has_one + # association?}[rdoc-ref:Associations::ClassMethods@Is+it+a+-23belongs_to+or+-23has_one+association-3F] + # for more detail on when to use #has_one and when to use #belongs_to. + # + # Methods will be added for retrieval and query for a single associated object, for which + # this object holds an id: + # + # +association+ is a placeholder for the symbol passed as the +name+ argument, so + # belongs_to :author would add among others author.nil?. + # + # [association] + # Returns the associated object. +nil+ is returned if none is found. + # [association=(associate)] + # Assigns the associate object, extracts the primary key, and sets it as the foreign key. + # No modification or deletion of existing records takes place. + # [build_association(attributes = {})] + # Returns a new object of the associated type that has been instantiated + # with +attributes+ and linked to this object through a foreign key, but has not yet been saved. + # [create_association(attributes = {})] + # Returns a new object of the associated type that has been instantiated + # with +attributes+, linked to this object through a foreign key, and that + # has already been saved (if it passed the validation). + # [create_association!(attributes = {})] + # Does the same as create_association, but raises ActiveRecord::RecordInvalid + # if the record is invalid. + # [reload_association] + # Returns the associated object, forcing a database read. + # [reset_association] + # Unloads the associated object. The next access will query it from the database. + # [association_changed?] + # Returns true if a new associate object has been assigned and the next save will update the foreign key. + # [association_previously_changed?] + # Returns true if the previous save updated the association to reference a new associate object. + # + # ==== Example + # + # class Post < ActiveRecord::Base + # belongs_to :author + # end + # + # Declaring belongs_to :author adds the following methods (and more): + # + # post = Post.find(7) + # author = Author.find(19) + # + # post.author # similar to Author.find(post.author_id) + # post.author = author # similar to post.author_id = author.id + # post.build_author # similar to post.author = Author.new + # post.create_author # similar to post.author = Author.new; post.author.save; post.author + # post.create_author! # similar to post.author = Author.new; post.author.save!; post.author + # post.reload_author + # post.reset_author + # post.author_changed? + # post.author_previously_changed? + # + # ==== Scopes + # + # You can pass a second argument +scope+ as a callable (i.e. proc or + # lambda) to retrieve a specific record or customize the generated query + # when you access the associated object. + # + # Scope examples: + # belongs_to :firm, -> { where(id: 2) } + # belongs_to :user, -> { joins(:friends) } + # belongs_to :level, ->(game) { where("game_level > ?", game.current_level) } + # + # ==== Options + # + # The declaration can also include an +options+ hash to specialize the behavior of the association. + # + # [+:class_name+] + # Specify the class name of the association. Use it only if that name can't be inferred + # from the association name. So belongs_to :author will by default be linked to the Author class, but + # if the real class name is Person, you'll have to specify it with this option. +:class_name+ + # is not supported in polymorphic associations, since in that case the class name of the + # associated record is stored in the type column. + # [+:foreign_key+] + # Specify the foreign key used for the association. By default this is guessed to be the name + # of the association with an "_id" suffix. So a class that defines a belongs_to :person + # association will use "person_id" as the default :foreign_key. Similarly, + # belongs_to :favorite_person, class_name: "Person" will use a foreign key + # of "favorite_person_id". + # + # Setting the :foreign_key option prevents automatic detection of the association's + # inverse, so it is generally a good idea to set the :inverse_of option as well. + # [+:foreign_type+] + # Specify the column used to store the associated object's type, if this is a polymorphic + # association. By default this is guessed to be the name of the association with a "_type" + # suffix. So a class that defines a belongs_to :taggable, polymorphic: true + # association will use "taggable_type" as the default :foreign_type. + # [+:primary_key+] + # Specify the method that returns the primary key of associated object used for the association. + # By default this is +id+. + # [+:dependent+] + # If set to :destroy, the associated object is destroyed when this object is. If set to + # :delete, the associated object is deleted *without* calling its destroy method. If set to + # :destroy_async, the associated object is scheduled to be destroyed in a background job. + # This option should not be specified when #belongs_to is used in conjunction with + # a #has_many relationship on another class because of the potential to leave + # orphaned records behind. + # [+:counter_cache+] + # Caches the number of belonging objects on the associate class through the use of CounterCache::ClassMethods#increment_counter + # and CounterCache::ClassMethods#decrement_counter. The counter cache is incremented when an object of this + # class is created and decremented when it's destroyed. This requires that a column + # named #{table_name}_count (such as +comments_count+ for a belonging Comment class) + # is used on the associate class (such as a Post class) - that is the migration for + # #{table_name}_count is created on the associate class (such that Post.comments_count will + # return the count cached). You can also specify a custom counter + # cache column by providing a column name instead of a +true+/+false+ value to this + # option (e.g., counter_cache: :my_custom_counter.) + # + # Starting to use counter caches on existing large tables can be troublesome, because the column + # values must be backfilled separately of the column addition (to not lock the table for too long) + # and before the use of +:counter_cache+ (otherwise methods like +size+/+any?+/etc, which use + # counter caches internally, can produce incorrect results). To safely backfill the values while keeping + # counter cache columns updated with the child records creation/removal and to avoid the mentioned methods + # use the possibly incorrect counter cache column values and always get the results from the database, + # use counter_cache: { active: false }. + # If you also need to specify a custom column name, use counter_cache: { active: false, column: :my_custom_counter }. + # + # Note: If you've enabled the counter cache, then you may want to add the counter cache attribute + # to the +attr_readonly+ list in the associated classes (e.g. class Post; attr_readonly :comments_count; end). + # [+:polymorphic+] + # Specify this association is a polymorphic association by passing +true+. + # Note: Since polymorphic associations rely on storing class names in the database, make sure to update the class names in the + # *_type polymorphic type column of the corresponding rows. + # [+:validate+] + # When set to +true+, validates new objects added to association when saving the parent object. +false+ by default. + # If you want to ensure associated objects are revalidated on every update, use +validates_associated+. + # [+:autosave+] + # If true, always save the associated object or destroy it if marked for destruction, when + # saving the parent object. + # If false, never save or destroy the associated object. + # By default, only save the associated object if it's a new record. + # + # Note that NestedAttributes::ClassMethods#accepts_nested_attributes_for + # sets :autosave to true. + # [+:touch+] + # If true, the associated object will be touched (the +updated_at+ / +updated_on+ attributes set to current time) + # when this record is either saved or destroyed. If you specify a symbol, that attribute + # will be updated with the current time in addition to the +updated_at+ / +updated_on+ attribute. + # Please note that no validation will be performed when touching, and only the +after_touch+, + # +after_commit+, and +after_rollback+ callbacks will be executed. + # [+:inverse_of+] + # Specifies the name of the #has_one or #has_many association on the associated + # object that is the inverse of this #belongs_to association. + # See {Bi-directional associations}[rdoc-ref:Associations::ClassMethods@Bi-directional+associations] + # for more detail. + # [+:optional+] + # When set to +true+, the association will not have its presence validated. + # [+:required+] + # When set to +true+, the association will also have its presence validated. + # This will validate the association itself, not the id. You can use + # +:inverse_of+ to avoid an extra query during validation. + # NOTE: required is set to true by default and is deprecated. If + # you don't want to have association presence validated, use optional: true. + # [+:default+] + # Provide a callable (i.e. proc or lambda) to specify that the association should + # be initialized with a particular record before validation. + # Please note that callable won't be executed if the record exists. + # [+:strict_loading+] + # Enforces strict loading every time the associated record is loaded through this association. + # [+:ensuring_owner_was+] + # Specifies an instance method to be called on the owner. The method must return true in order for the + # associated records to be deleted in a background job. + # [+:query_constraints+] + # Serves as a composite foreign key. Defines the list of columns to be used to query the associated object. + # This is an optional option. By default Rails will attempt to derive the value automatically. + # When the value is set the Array size must match associated model's primary key or +query_constraints+ size. + # [+:deprecated+] + # If true, marks the association as deprecated. Usage of deprecated associations is reported. + # Please, check the class documentation above for details. + # + # Option examples: + # belongs_to :firm, foreign_key: "client_of" + # belongs_to :person, primary_key: "name", foreign_key: "person_name" + # belongs_to :author, class_name: "Person", foreign_key: "author_id" + # belongs_to :valid_coupon, ->(o) { where "discounts > ?", o.payments_count }, + # class_name: "Coupon", foreign_key: "coupon_id" + # belongs_to :attachable, polymorphic: true + # belongs_to :project, -> { readonly } + # belongs_to :post, counter_cache: true + # belongs_to :comment, touch: true + # belongs_to :company, touch: :employees_last_updated_at + # belongs_to :user, optional: true + # belongs_to :account, default: -> { company.account } + # belongs_to :account, strict_loading: true + # belongs_to :note, query_constraints: [:organization_id, :note_id] + # + # source://activerecord//lib/active_record/associations.rb#1824 + def belongs_to(name, scope = T.unsafe(nil), **options); end + + # Specifies a many-to-many relationship with another class. This associates two classes via an + # intermediate join table. Unless the join table is explicitly specified as an option, it is + # guessed using the lexical order of the class names. So a join between Developer and Project + # will give the default join table name of "developers_projects" because "D" precedes "P" alphabetically. + # Note that this precedence is calculated using the < operator for String. This + # means that if the strings are of different lengths, and the strings are equal when compared + # up to the shortest length, then the longer string is considered of higher + # lexical precedence than the shorter one. For example, one would expect the tables "paper_boxes" and "papers" + # to generate a join table name of "papers_paper_boxes" because of the length of the name "paper_boxes", + # but it in fact generates a join table name of "paper_boxes_papers". Be aware of this caveat, and use the + # custom :join_table option if you need to. + # If your tables share a common prefix, it will only appear once at the beginning. For example, + # the tables "catalog_categories" and "catalog_products" generate a join table name of "catalog_categories_products". + # + # The join table should not have a primary key or a model associated with it. You must manually generate the + # join table with a migration such as this: + # + # class CreateDevelopersProjectsJoinTable < ActiveRecord::Migration[8.1] + # def change + # create_join_table :developers, :projects + # end + # end + # + # It's also a good idea to add indexes to each of those columns to speed up the joins process. + # However, in MySQL it is advised to add a compound index for both of the columns as MySQL only + # uses one index per table during the lookup. + # + # Adds the following methods for retrieval and query: + # + # +collection+ is a placeholder for the symbol passed as the +name+ argument, so + # has_and_belongs_to_many :categories would add among others categories.empty?. + # + # [collection] + # Returns a Relation of all the associated objects. + # An empty Relation is returned if none are found. + # [collection<<(object, ...)] + # Adds one or more objects to the collection by creating associations in the join table + # (collection.push and collection.concat are aliases to this method). + # Note that this operation instantly fires update SQL without waiting for the save or update call on the + # parent object, unless the parent object is a new record. + # [collection.delete(object, ...)] + # Removes one or more objects from the collection by removing their associations from the join table. + # This does not destroy the objects. + # [collection.destroy(object, ...)] + # Removes one or more objects from the collection by running destroy on each association in the join table, overriding any dependent option. + # This does not destroy the objects. + # [collection=objects] + # Replaces the collection's content by deleting and adding objects as appropriate. + # [collection_singular_ids] + # Returns an array of the associated objects' ids. + # [collection_singular_ids=ids] + # Replace the collection by the objects identified by the primary keys in +ids+. + # [collection.clear] + # Removes every object from the collection. This does not destroy the objects. + # [collection.empty?] + # Returns +true+ if there are no associated objects. + # [collection.size] + # Returns the number of associated objects. + # [collection.find(id)] + # Finds an associated object responding to the +id+ and that + # meets the condition that it has to be associated with this object. + # Uses the same rules as ActiveRecord::FinderMethods#find. + # [collection.exists?(...)] + # Checks whether an associated object with the given conditions exists. + # Uses the same rules as ActiveRecord::FinderMethods#exists?. + # [collection.build(attributes = {})] + # Returns a new object of the collection type that has been instantiated + # with +attributes+ and linked to this object through the join table, but has not yet been saved. + # [collection.create(attributes = {})] + # Returns a new object of the collection type that has been instantiated + # with +attributes+, linked to this object through the join table, and that has already been + # saved (if it passed the validation). + # [collection.reload] + # Returns a Relation of all of the associated objects, forcing a database read. + # An empty Relation is returned if none are found. + # + # ==== Example + # + # class Developer < ActiveRecord::Base + # has_and_belongs_to_many :projects + # end + # + # Declaring has_and_belongs_to_many :projects adds the following methods (and more): + # + # developer = Developer.find(11) + # project = Project.find(9) + # + # developer.projects + # developer.projects << project + # developer.projects.delete(project) + # developer.projects.destroy(project) + # developer.projects = [project] + # developer.project_ids + # developer.project_ids = [9] + # developer.projects.clear + # developer.projects.empty? + # developer.projects.size + # developer.projects.find(9) + # developer.projects.exists?(9) + # developer.projects.build # similar to Project.new(developer_id: 11) + # developer.projects.create # similar to Project.create(developer_id: 11) + # developer.projects.reload + # + # The declaration may include an +options+ hash to specialize the behavior of the association. + # + # ==== Scopes + # + # You can pass a second argument +scope+ as a callable (i.e. proc or + # lambda) to retrieve a specific set of records or customize the generated + # query when you access the associated collection. + # + # Scope examples: + # has_and_belongs_to_many :projects, -> { includes(:milestones, :manager) } + # has_and_belongs_to_many :categories, ->(post) { + # where("default_category = ?", post.default_category) + # } + # + # ==== Extensions + # + # The +extension+ argument allows you to pass a block into a + # has_and_belongs_to_many association. This is useful for adding new + # finders, creators, and other factory-type methods to be used as part of + # the association. + # + # Extension examples: + # has_and_belongs_to_many :contractors do + # def find_or_create_by_name(name) + # first_name, last_name = name.split(" ", 2) + # find_or_create_by(first_name: first_name, last_name: last_name) + # end + # end + # + # ==== Options + # + # [+:class_name+] + # Specify the class name of the association. Use it only if that name can't be inferred + # from the association name. So has_and_belongs_to_many :projects will by default be linked to the + # Project class, but if the real class name is SuperProject, you'll have to specify it with this option. + # [+:join_table+] + # Specify the name of the join table if the default based on lexical order isn't what you want. + # WARNING: If you're overwriting the table name of either class, the +table_name+ method + # MUST be declared underneath any #has_and_belongs_to_many declaration in order to work. + # [+:foreign_key+] + # Specify the foreign key used for the association. By default this is guessed to be the name + # of this class in lower-case and "_id" suffixed. So a Person class that makes + # a #has_and_belongs_to_many association to Project will use "person_id" as the + # default :foreign_key. + # + # Setting the :foreign_key option prevents automatic detection of the association's + # inverse, so it is generally a good idea to set the :inverse_of option as well. + # [+:association_foreign_key+] + # Specify the foreign key used for the association on the receiving side of the association. + # By default this is guessed to be the name of the associated class in lower-case and "_id" suffixed. + # So if a Person class makes a #has_and_belongs_to_many association to Project, + # the association will use "project_id" as the default :association_foreign_key. + # [+:validate+] + # When set to +true+, validates new objects added to association when saving the parent object. +true+ by default. + # If you want to ensure associated objects are revalidated on every update, use +validates_associated+. + # [+:autosave+] + # If true, always save the associated objects or destroy them if marked for destruction, when + # saving the parent object. + # If false, never save or destroy the associated objects. + # By default, only save associated objects that are new records. + # + # Note that NestedAttributes::ClassMethods#accepts_nested_attributes_for sets + # :autosave to true. + # [+:strict_loading+] + # Enforces strict loading every time an associated record is loaded through this association. + # [+:deprecated+] + # If true, marks the association as deprecated. Usage of deprecated associations is reported. + # Please, check the class documentation above for details. + # + # Option examples: + # has_and_belongs_to_many :projects + # has_and_belongs_to_many :projects, -> { includes(:milestones, :manager) } + # has_and_belongs_to_many :nations, class_name: "Country" + # has_and_belongs_to_many :categories, join_table: "prods_cats" + # has_and_belongs_to_many :categories, -> { readonly } + # has_and_belongs_to_many :categories, strict_loading: true + # + # source://activerecord//lib/active_record/associations.rb#2008 + def has_and_belongs_to_many(name, scope = T.unsafe(nil), **options, &extension); end + + # Specifies a one-to-many association. The following methods for retrieval and query of + # collections of associated objects will be added: + # + # +collection+ is a placeholder for the symbol passed as the +name+ argument, so + # has_many :clients would add among others clients.empty?. + # + # [collection] + # Returns a Relation of all the associated objects. + # An empty Relation is returned if none are found. + # [collection<<(object, ...)] + # Adds one or more objects to the collection by setting their foreign keys to the collection's primary key. + # Note that this operation instantly fires update SQL without waiting for the save or update call on the + # parent object, unless the parent object is a new record. + # This will also run validations and callbacks of associated object(s). + # [collection.delete(object, ...)] + # Removes one or more objects from the collection by setting their foreign keys to +NULL+. + # Objects will be in addition destroyed if they're associated with dependent: :destroy, + # and deleted if they're associated with dependent: :delete_all. + # + # If the :through option is used, then the join records are deleted (rather than + # nullified) by default, but you can specify dependent: :destroy or + # dependent: :nullify to override this. + # [collection.destroy(object, ...)] + # Removes one or more objects from the collection by running destroy on + # each record, regardless of any dependent option, ensuring callbacks are run. + # + # If the :through option is used, then the join records are destroyed + # instead, not the objects themselves. + # [collection=objects] + # Replaces the collections content by deleting and adding objects as appropriate. If the :through + # option is true callbacks in the join models are triggered except destroy callbacks, since deletion is + # direct by default. You can specify dependent: :destroy or + # dependent: :nullify to override this. + # [collection_singular_ids] + # Returns an array of the associated objects' ids + # [collection_singular_ids=ids] + # Replace the collection with the objects identified by the primary keys in +ids+. This + # method loads the models and calls collection=. See above. + # [collection.clear] + # Removes every object from the collection. This destroys the associated objects if they + # are associated with dependent: :destroy, deletes them directly from the + # database if dependent: :delete_all, otherwise sets their foreign keys to +NULL+. + # If the :through option is true no destroy callbacks are invoked on the join models. + # Join models are directly deleted. + # [collection.empty?] + # Returns +true+ if there are no associated objects. + # [collection.size] + # Returns the number of associated objects. + # [collection.find(...)] + # Finds an associated object according to the same rules as ActiveRecord::FinderMethods#find. + # [collection.exists?(...)] + # Checks whether an associated object with the given conditions exists. + # Uses the same rules as ActiveRecord::FinderMethods#exists?. + # [collection.build(attributes = {}, ...)] + # Returns one or more new objects of the collection type that have been instantiated + # with +attributes+ and linked to this object through a foreign key, but have not yet + # been saved. + # [collection.create(attributes = {})] + # Returns a new object of the collection type that has been instantiated + # with +attributes+, linked to this object through a foreign key, and that has already + # been saved (if it passed the validation). *Note*: This only works if the base model + # already exists in the DB, not if it is a new (unsaved) record! + # [collection.create!(attributes = {})] + # Does the same as collection.create, but raises ActiveRecord::RecordInvalid + # if the record is invalid. + # [collection.reload] + # Returns a Relation of all of the associated objects, forcing a database read. + # An empty Relation is returned if none are found. + # + # ==== Example + # + # class Firm < ActiveRecord::Base + # has_many :clients + # end + # + # Declaring has_many :clients adds the following methods (and more): + # + # firm = Firm.find(2) + # client = Client.find(6) + # + # firm.clients # similar to Client.where(firm_id: 2) + # firm.clients << client + # firm.clients.delete(client) + # firm.clients.destroy(client) + # firm.clients = [client] + # firm.client_ids + # firm.client_ids = [6] + # firm.clients.clear + # firm.clients.empty? # similar to firm.clients.size == 0 + # firm.clients.size # similar to Client.count "firm_id = 2" + # firm.clients.find # similar to Client.where(firm_id: 2).find(6) + # firm.clients.exists?(name: 'ACME') # similar to Client.exists?(name: 'ACME', firm_id: 2) + # firm.clients.build # similar to Client.new(firm_id: 2) + # firm.clients.create # similar to Client.create(firm_id: 2) + # firm.clients.create! # similar to Client.create!(firm_id: 2) + # firm.clients.reload + # + # The declaration can also include an +options+ hash to specialize the behavior of the association. + # + # ==== Scopes + # + # You can pass a second argument +scope+ as a callable (i.e. proc or + # lambda) to retrieve a specific set of records or customize the generated + # query when you access the associated collection. + # + # Scope examples: + # has_many :comments, -> { where(author_id: 1) } + # has_many :employees, -> { joins(:address) } + # has_many :posts, ->(blog) { where("max_post_length > ?", blog.max_post_length) } + # + # ==== Extensions + # + # The +extension+ argument allows you to pass a block into a has_many + # association. This is useful for adding new finders, creators, and other + # factory-type methods to be used as part of the association. + # + # Extension examples: + # has_many :employees do + # def find_or_create_by_name(name) + # first_name, last_name = name.split(" ", 2) + # find_or_create_by(first_name: first_name, last_name: last_name) + # end + # end + # + # ==== Options + # [+:class_name+] + # Specify the class name of the association. Use it only if that name can't be inferred + # from the association name. So has_many :products will by default be linked + # to the +Product+ class, but if the real class name is +SpecialProduct+, you'll have to + # specify it with this option. + # [+:foreign_key+] + # Specify the foreign key used for the association. By default this is guessed to be the name + # of this class in lower-case and "_id" suffixed. So a Person class that makes a #has_many + # association will use "person_id" as the default :foreign_key. + # + # Setting the :foreign_key option prevents automatic detection of the association's + # inverse, so it is generally a good idea to set the :inverse_of option as well. + # [+:foreign_type+] + # Specify the column used to store the associated object's type, if this is a polymorphic + # association. By default this is guessed to be the name of the polymorphic association + # specified on "as" option with a "_type" suffix. So a class that defines a + # has_many :tags, as: :taggable association will use "taggable_type" as the + # default :foreign_type. + # [+:primary_key+] + # Specify the name of the column to use as the primary key for the association. By default this is +id+. + # [+:dependent+] + # Controls what happens to the associated objects when + # their owner is destroyed. Note that these are implemented as + # callbacks, and \Rails executes callbacks in order. Therefore, other + # similar callbacks may affect the :dependent behavior, and the + # :dependent behavior may affect other callbacks. + # + # * nil do nothing (default). + # * :destroy causes all the associated objects to also be destroyed. + # * :destroy_async destroys all the associated objects in a background job. WARNING: Do not use + # this option if the association is backed by foreign key constraints in your database. The foreign key + # constraint actions will occur inside the same transaction that deletes its owner. + # * :delete_all causes all the associated objects to be deleted directly from the database (so callbacks will not be executed). + # * :nullify causes the foreign keys to be set to +NULL+. Polymorphic type will also be nullified + # on polymorphic associations. Callbacks are not executed. + # * :restrict_with_exception causes an ActiveRecord::DeleteRestrictionError exception to be raised if there are any associated records. + # * :restrict_with_error causes an error to be added to the owner if there are any associated objects. + # + # If using with the :through option, the association on the join model must be + # a #belongs_to, and the records which get deleted are the join records, rather than + # the associated records. + # + # If using dependent: :destroy on a scoped association, only the scoped objects are destroyed. + # For example, if a Post model defines + # has_many :comments, -> { where published: true }, dependent: :destroy and destroy is + # called on a post, only published comments are destroyed. This means that any unpublished comments in the + # database would still contain a foreign key pointing to the now deleted post. + # [+:counter_cache+] + # This option can be used to configure a custom named :counter_cache. You only need this option, + # when you customized the name of your :counter_cache on the #belongs_to association. + # [+:as+] + # Specifies a polymorphic interface (See #belongs_to). + # [+:through+] + # Specifies an association through which to perform the query. + # + # This can be any other type of association, including other :through associations, + # but it cannot be a polymorphic association. Options for :class_name, + # :primary_key and :foreign_key are ignored, as the association uses the + # source reflection. + # + # If the association on the join model is a #belongs_to, the collection can be modified + # and the records on the :through model will be automatically created and removed + # as appropriate. Otherwise, the collection is read-only, so you should manipulate the + # :through association directly. + # + # If you are going to modify the association (rather than just read from it), then it is + # a good idea to set the :inverse_of option on the source association on the + # join model. This allows associated records to be built which will automatically create + # the appropriate join model records when they are saved. See + # {Association Join Models}[rdoc-ref:Associations::ClassMethods@Association+Join+Models] + # and {Setting Inverses}[rdoc-ref:Associations::ClassMethods@Setting+Inverses] for + # more detail. + # + # [+:disable_joins+] + # Specifies whether joins should be skipped for an association. If set to true, two or more queries + # will be generated. Note that in some cases, if order or limit is applied, it will be done in-memory + # due to database limitations. This option is only applicable on has_many :through associations as + # +has_many+ alone do not perform a join. + # [+:source+] + # Specifies the source association name used by #has_many :through queries. + # Only use it if the name cannot be inferred from the association. + # has_many :subscribers, through: :subscriptions will look for either :subscribers or + # :subscriber on Subscription, unless a :source is given. + # [+:source_type+] + # Specifies type of the source association used by #has_many :through queries where the source + # association is a polymorphic #belongs_to. + # [+:validate+] + # When set to +true+, validates new objects added to association when saving the parent object. +true+ by default. + # If you want to ensure associated objects are revalidated on every update, use +validates_associated+. + # [+:autosave+] + # If true, always save the associated objects or destroy them if marked for destruction, + # when saving the parent object. If false, never save or destroy the associated objects. + # By default, only save associated objects that are new records. This option is implemented as a + # +before_save+ callback. Because callbacks are run in the order they are defined, associated objects + # may need to be explicitly saved in any user-defined +before_save+ callbacks. + # + # Note that NestedAttributes::ClassMethods#accepts_nested_attributes_for sets + # :autosave to true. + # [+:inverse_of+] + # Specifies the name of the #belongs_to association on the associated object + # that is the inverse of this #has_many association. + # See {Bi-directional associations}[rdoc-ref:Associations::ClassMethods@Bi-directional+associations] + # for more detail. + # [+:extend+] + # Specifies a module or array of modules that will be extended into the association object returned. + # Useful for defining methods on associations, especially when they should be shared between multiple + # association objects. + # [+:strict_loading+] + # When set to +true+, enforces strict loading every time the associated record is loaded through this + # association. + # [+:ensuring_owner_was+] + # Specifies an instance method to be called on the owner. The method must return true in order for the + # associated records to be deleted in a background job. + # [+:query_constraints+] + # Serves as a composite foreign key. Defines the list of columns to be used to query the associated object. + # This is an optional option. By default Rails will attempt to derive the value automatically. + # When the value is set the Array size must match associated model's primary key or +query_constraints+ size. + # [+:index_errors+] + # Allows differentiation of multiple validation errors from the association records, by including + # an index in the error attribute name, e.g. +roles[2].level+. + # When set to +true+, the index is based on association order, i.e. database order, with yet to be + # persisted new records placed at the end. + # When set to +:nested_attributes_order+, the index is based on the record order received by + # nested attributes setter, when accepts_nested_attributes_for is used. + # [:before_add] + # Defines an {association callback}[rdoc-ref:Associations::ClassMethods@Association+callbacks] that gets triggered before an object is added to the association collection. + # [:after_add] + # Defines an {association callback}[rdoc-ref:Associations::ClassMethods@Association+callbacks] that gets triggered after an object is added to the association collection. + # [:before_remove] + # Defines an {association callback}[rdoc-ref:Associations::ClassMethods@Association+callbacks] that gets triggered before an object is removed from the association collection. + # [:after_remove] + # Defines an {association callback}[rdoc-ref:Associations::ClassMethods@Association+callbacks] that gets triggered after an object is removed from the association collection. + # [+:deprecated+] + # If true, marks the association as deprecated. Usage of deprecated associations is reported. + # Please, check the class documentation above for details. + # + # Option examples: + # has_many :comments, -> { order("posted_on") } + # has_many :comments, -> { includes(:author) } + # has_many :people, -> { where(deleted: false).order("name") }, class_name: "Person" + # has_many :tracks, -> { order("position") }, dependent: :destroy + # has_many :comments, dependent: :nullify + # has_many :tags, as: :taggable + # has_many :reports, -> { readonly } + # has_many :subscribers, through: :subscriptions, source: :user + # has_many :subscribers, through: :subscriptions, disable_joins: true + # has_many :comments, strict_loading: true + # has_many :comments, query_constraints: [:blog_id, :post_id] + # has_many :comments, index_errors: :nested_attributes_order + # + # source://activerecord//lib/active_record/associations.rb#1427 + def has_many(name, scope = T.unsafe(nil), **options, &extension); end + + # Specifies a one-to-one association with another class. This method + # should only be used if the other class contains the foreign key. If + # the current class contains the foreign key, then you should use + # #belongs_to instead. See {Is it a belongs_to or has_one + # association?}[rdoc-ref:Associations::ClassMethods@Is+it+a+-23belongs_to+or+-23has_one+association-3F] + # for more detail on when to use #has_one and when to use #belongs_to. + # + # The following methods for retrieval and query of a single associated object will be added: + # + # +association+ is a placeholder for the symbol passed as the +name+ argument, so + # has_one :manager would add among others manager.nil?. + # + # [association] + # Returns the associated object. +nil+ is returned if none is found. + # [association=(associate)] + # Assigns the associate object, extracts the primary key, sets it as the foreign key, + # and saves the associate object. To avoid database inconsistencies, permanently deletes an existing + # associated object when assigning a new one, even if the new one isn't saved to database. + # [build_association(attributes = {})] + # Returns a new object of the associated type that has been instantiated + # with +attributes+ and linked to this object through a foreign key, but has not + # yet been saved. + # [create_association(attributes = {})] + # Returns a new object of the associated type that has been instantiated + # with +attributes+, linked to this object through a foreign key, and that + # has already been saved (if it passed the validation). + # [create_association!(attributes = {})] + # Does the same as create_association, but raises ActiveRecord::RecordInvalid + # if the record is invalid. + # [reload_association] + # Returns the associated object, forcing a database read. + # [reset_association] + # Unloads the associated object. The next access will query it from the database. + # + # ==== Example + # + # class Account < ActiveRecord::Base + # has_one :beneficiary + # end + # + # Declaring has_one :beneficiary adds the following methods (and more): + # + # account = Account.find(5) + # beneficiary = Beneficiary.find(8) + # + # account.beneficiary # similar to Beneficiary.find_by(account_id: 5) + # account.beneficiary = beneficiary # similar to beneficiary.update(account_id: 5) + # account.build_beneficiary # similar to Beneficiary.new(account_id: 5) + # account.create_beneficiary # similar to Beneficiary.create(account_id: 5) + # account.create_beneficiary! # similar to Beneficiary.create!(account_id: 5) + # account.reload_beneficiary + # account.reset_beneficiary + # + # ==== Scopes + # + # You can pass a second argument +scope+ as a callable (i.e. proc or + # lambda) to retrieve a specific record or customize the generated query + # when you access the associated object. + # + # Scope examples: + # has_one :author, -> { where(comment_id: 1) } + # has_one :employer, -> { joins(:company) } + # has_one :latest_post, ->(blog) { where("created_at > ?", blog.enabled_at) } + # + # ==== Options + # + # The declaration can also include an +options+ hash to specialize the behavior of the association. + # + # Options are: + # [+:class_name+] + # Specify the class name of the association. Use it only if that name can't be inferred + # from the association name. So has_one :manager will by default be linked to the Manager class, but + # if the real class name is Person, you'll have to specify it with this option. + # [+:dependent+] + # Controls what happens to the associated object when + # its owner is destroyed: + # + # * nil do nothing (default). + # * :destroy causes the associated object to also be destroyed + # * :destroy_async causes the associated object to be destroyed in a background job. WARNING: Do not use + # this option if the association is backed by foreign key constraints in your database. The foreign key + # constraint actions will occur inside the same transaction that deletes its owner. + # * :delete causes the associated object to be deleted directly from the database (so callbacks will not execute) + # * :nullify causes the foreign key to be set to +NULL+. Polymorphic type column is also nullified + # on polymorphic associations. Callbacks are not executed. + # * :restrict_with_exception causes an ActiveRecord::DeleteRestrictionError exception to be raised if there is an associated record + # * :restrict_with_error causes an error to be added to the owner if there is an associated object + # + # Note that :dependent option is ignored when using :through option. + # [+:foreign_key+] + # Specify the foreign key used for the association. By default this is guessed to be the name + # of this class in lower-case and "_id" suffixed. So a Person class that makes a #has_one association + # will use "person_id" as the default :foreign_key. + # + # Setting the :foreign_key option prevents automatic detection of the association's + # inverse, so it is generally a good idea to set the :inverse_of option as well. + # [+:foreign_type+] + # Specify the column used to store the associated object's type, if this is a polymorphic + # association. By default this is guessed to be the name of the polymorphic association + # specified on "as" option with a "_type" suffix. So a class that defines a + # has_one :tag, as: :taggable association will use "taggable_type" as the + # default :foreign_type. + # [+:primary_key+] + # Specify the method that returns the primary key used for the association. By default this is +id+. + # [+:as+] + # Specifies a polymorphic interface (See #belongs_to). + # [+:through+] + # Specifies an association through which to perform the query. + # + # The through association must be a +has_one+, has_one :through, or non-polymorphic +belongs_to+. + # That is, a non-polymorphic singular association. Options for :class_name, :primary_key, + # and :foreign_key are ignored, as the association uses the source reflection. You can only + # use a :through query through a #has_one or #belongs_to association on the join model. + # + # If the association on the join model is a #belongs_to, the collection can be modified + # and the records on the :through model will be automatically created and removed + # as appropriate. Otherwise, the collection is read-only, so you should manipulate the + # :through association directly. + # + # If you are going to modify the association (rather than just read from it), then it is + # a good idea to set the :inverse_of option on the source association on the + # join model. This allows associated records to be built which will automatically create + # the appropriate join model records when they are saved. See + # {Association Join Models}[rdoc-ref:Associations::ClassMethods@Association+Join+Models] + # and {Setting Inverses}[rdoc-ref:Associations::ClassMethods@Setting+Inverses] for + # more detail. + # [+:disable_joins+] + # Specifies whether joins should be skipped for an association. If set to true, two or more queries + # will be generated. Note that in some cases, if order or limit is applied, it will be done in-memory + # due to database limitations. This option is only applicable on has_one :through associations as + # +has_one+ alone does not perform a join. + # [+:source+] + # Specifies the source association name used by #has_one :through queries. + # Only use it if the name cannot be inferred from the association. + # has_one :favorite, through: :favorites will look for a + # :favorite on Favorite, unless a :source is given. + # [+:source_type+] + # Specifies type of the source association used by #has_one :through queries where the source + # association is a polymorphic #belongs_to. + # [+:validate+] + # When set to +true+, validates new objects added to association when saving the parent object. +false+ by default. + # If you want to ensure associated objects are revalidated on every update, use +validates_associated+. + # [+:autosave+] + # If +true+, always saves the associated object or destroys it if marked for destruction, + # when saving the parent object. + # If +false+, never save or destroy the associated object. + # + # By default, only saves the associated object if it's a new record. Setting this option + # to +true+ also enables validations on the associated object unless explicitly disabled + # with validate: false. This is because saving an object with invalid associated + # objects would fail, so any associated objects will go through validation checks. + # + # Note that NestedAttributes::ClassMethods#accepts_nested_attributes_for sets + # :autosave to true. + # [+:touch+] + # If true, the associated object will be touched (the +updated_at+ / +updated_on+ attributes set to current time) + # when this record is either saved or destroyed. If you specify a symbol, that attribute + # will be updated with the current time in addition to the +updated_at+ / +updated_on+ attribute. + # Please note that no validation will be performed when touching, and only the +after_touch+, + # +after_commit+, and +after_rollback+ callbacks will be executed. + # [+:inverse_of+] + # Specifies the name of the #belongs_to association on the associated object + # that is the inverse of this #has_one association. + # See {Bi-directional associations}[rdoc-ref:Associations::ClassMethods@Bi-directional+associations] + # for more detail. + # [+:required+] + # When set to +true+, the association will also have its presence validated. + # This will validate the association itself, not the id. You can use + # +:inverse_of+ to avoid an extra query during validation. + # [+:strict_loading+] + # Enforces strict loading every time the associated record is loaded through this association. + # [+:ensuring_owner_was+] + # Specifies an instance method to be called on the owner. The method must return true in order for the + # associated records to be deleted in a background job. + # [+:query_constraints+] + # Serves as a composite foreign key. Defines the list of columns to be used to query the associated object. + # This is an optional option. By default Rails will attempt to derive the value automatically. + # When the value is set the Array size must match associated model's primary key or +query_constraints+ size. + # [+:deprecated+] + # If true, marks the association as deprecated. Usage of deprecated associations is reported. + # Please, check the class documentation above for details. + # + # Option examples: + # has_one :credit_card, dependent: :destroy # destroys the associated credit card + # has_one :credit_card, dependent: :nullify # updates the associated records foreign + # # key value to NULL rather than destroying it + # has_one :last_comment, -> { order('posted_on desc') }, class_name: "Comment" + # has_one :project_manager, -> { where(role: 'project_manager') }, class_name: "Person" + # has_one :attachment, as: :attachable + # has_one :boss, -> { readonly } + # has_one :club, through: :membership + # has_one :club, through: :membership, disable_joins: true + # has_one :primary_address, -> { where(primary: true) }, through: :addressables, source: :addressable + # has_one :credit_card, required: true + # has_one :credit_card, strict_loading: true + # has_one :employment_record_book, query_constraints: [:organization_id, :employee_id] + # + # source://activerecord//lib/active_record/associations.rb#1628 + def has_one(name, scope = T.unsafe(nil), **options); end +end + +# = Active Record Association Collection +# +# CollectionAssociation is an abstract class that provides common stuff to +# ease the implementation of association proxies that represent +# collections. See the class hierarchy in Association. +# +# CollectionAssociation: +# HasManyAssociation => has_many +# HasManyThroughAssociation + ThroughAssociation => has_many :through +# +# The CollectionAssociation class provides common methods to the collections +# defined by +has_and_belongs_to_many+, +has_many+ or +has_many+ with +# the :through association option. +# +# You need to be careful with assumptions regarding the target: The proxy +# does not fetch records from the database until it needs them, but new +# ones created with +build+ are added to the target. So, the target may be +# non-empty and still lack children waiting to be read from the database. +# If you look directly to the database you cannot assume that's the entire +# collection because new records may have been added to the target, etc. +# +# If you need to work on all current children, new and existing records, +# +load_target+ and the +loaded+ flag are your friends. +# +# source://activerecord//lib/active_record/associations/collection_association.rb#30 +class ActiveRecord::Associations::CollectionAssociation < ::ActiveRecord::Associations::Association + # source://activerecord//lib/active_record/associations/collection_association.rb#281 + def add_to_target(record, skip_callbacks: T.unsafe(nil), replace: T.unsafe(nil), &block); end + + # source://activerecord//lib/active_record/associations/collection_association.rb#117 + def build(attributes = T.unsafe(nil), &block); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/collection_association.rb#316 + def collection?; end + + # Add +records+ to this association. Since +<<+ flattens its argument list + # and inserts each record, +push+ and +concat+ behave identically. + # + # source://activerecord//lib/active_record/associations/collection_association.rb#127 + def concat(*records); end + + # Removes +records+ from this association calling +before_remove+ and + # +after_remove+ callbacks. + # + # This method is abstract in the sense that +delete_records+ has to be + # provided by descendants. Note this method does not imply the records + # are actually removed from the database, that depends precisely on + # +delete_records+. They are in any case removed from the collection. + # + # source://activerecord//lib/active_record/associations/collection_association.rb#186 + def delete(*records); end + + # Removes all records from the association without calling callbacks + # on the associated records. It honors the +:dependent+ option. However + # if the +:dependent+ value is +:destroy+ then in that case the +:delete_all+ + # deletion strategy for the association is applied. + # + # You can force a particular deletion strategy by passing a parameter. + # + # Example: + # + # @author.books.delete_all(:nullify) + # @author.books.delete_all(:delete_all) + # + # See delete for more info. + # + # source://activerecord//lib/active_record/associations/collection_association.rb#150 + def delete_all(dependent = T.unsafe(nil)); end + + # Deletes the +records+ and removes them from this association calling + # +before_remove+, +after_remove+, +before_destroy+ and +after_destroy+ callbacks. + # + # Note that this method removes records from the database ignoring the + # +:dependent+ option. + # + # source://activerecord//lib/active_record/associations/collection_association.rb#195 + def destroy(*records); end + + # Destroy all the records from this association. + # + # See destroy for more info. + # + # source://activerecord//lib/active_record/associations/collection_association.rb#172 + def destroy_all; end + + # Returns true if the collection is empty. + # + # If the collection has been loaded + # it is equivalent to collection.size.zero?. If the + # collection has not been loaded, it is equivalent to + # !collection.exists?. If the collection has not already been + # loaded and you are going to fetch the records anyway it is better to + # check collection.length.zero?. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/collection_association.rb#232 + def empty?; end + + # source://activerecord//lib/active_record/associations/collection_association.rb#94 + def find(*args); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/collection_association.rb#308 + def find_from_target?; end + + # Implements the ids reader method, e.g. foo.item_ids for Foo.has_many :items + # + # source://activerecord//lib/active_record/associations/collection_association.rb#51 + def ids_reader; end + + # Implements the ids writer method, e.g. foo.item_ids= for Foo.has_many :items + # + # source://activerecord//lib/active_record/associations/collection_association.rb#62 + def ids_writer(ids); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/collection_association.rb#258 + def include?(record); end + + # source://activerecord//lib/active_record/associations/collection_association.rb#272 + def load_target; end + + # source://activerecord//lib/active_record/associations/collection_association.rb#31 + def nested_attributes_target; end + + # source://activerecord//lib/active_record/associations/collection_association.rb#31 + def nested_attributes_target=(_arg0); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/collection_association.rb#304 + def null_scope?; end + + # Implements the reader method, e.g. foo.items for Foo.has_many :items + # + # source://activerecord//lib/active_record/associations/collection_association.rb#34 + def reader; end + + # Replace this collection with +other_array+. This will perform a diff + # and delete/add only records that have changed. + # + # source://activerecord//lib/active_record/associations/collection_association.rb#242 + def replace(other_array); end + + # source://activerecord//lib/active_record/associations/collection_association.rb#87 + def reset; end + + # source://activerecord//lib/active_record/associations/collection_association.rb#298 + def scope; end + + # Returns the size of the collection by executing a SELECT COUNT(*) + # query if the collection hasn't been loaded, and calling + # collection.size if it has. + # + # If the collection has been already loaded +size+ and +length+ are + # equivalent. If not and you are going to need the records anyway + # +length+ will take one less query. Otherwise +size+ is more efficient. + # + # This method is abstract in the sense that it relies on + # +count_records+, which is a method descendants have to provide. + # + # source://activerecord//lib/active_record/associations/collection_association.rb#209 + def size; end + + # source://activerecord//lib/active_record/associations/collection_association.rb#285 + def target=(record); end + + # Implements the writer method, e.g. foo.items= for Foo.has_many :items + # + # source://activerecord//lib/active_record/associations/collection_association.rb#46 + def writer(records); end + + private + + # source://activerecord//lib/active_record/associations/collection_association.rb#354 + def _create_record(attributes, raise = T.unsafe(nil), &block); end + + # source://activerecord//lib/active_record/associations/collection_association.rb#492 + def callback(method, record); end + + # source://activerecord//lib/active_record/associations/collection_association.rb#498 + def callbacks_for(callback_name); end + + # @raise [ActiveRecord::Rollback] + # + # source://activerecord//lib/active_record/associations/collection_association.rb#438 + def concat_records(records, raise = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/associations/collection_association.rb#385 + def delete_or_destroy(records, method); end + + # Delete the given records from the association, + # using one of the methods +:destroy+, +:delete_all+ + # or +:nullify+ (or +nil+, in which case a default is used). + # + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/associations/collection_association.rb#414 + def delete_records(records, method); end + + # If the :inverse_of option has been + # specified, then #find scans the entire collection. + # + # source://activerecord//lib/active_record/associations/collection_association.rb#521 + def find_by_scan(*args); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/collection_association.rb#507 + def include_in_memory?(record); end + + # Do the relevant stuff to insert the given record into the association collection. + # + # source://activerecord//lib/active_record/associations/collection_association.rb#377 + def insert_record(record, validate = T.unsafe(nil), raise = T.unsafe(nil), &block); end + + # We have some records loaded from the database (persisted) and some that are + # in-memory (memory). The same record may be represented in the persisted array + # and in the memory array. + # + # So the task of this method is to merge them according to the following rules: + # + # * The final array must not have duplicates + # * The order of the persisted array is to be preserved + # * Any changes made to attributes on objects in the memory array are to be preserved + # * Otherwise, attributes should have the value found in the database + # + # source://activerecord//lib/active_record/associations/collection_association.rb#335 + def merge_target_lists(persisted, memory); end + + # source://activerecord//lib/active_record/associations/collection_association.rb#399 + def remove_records(existing_records, records, method); end + + # source://activerecord//lib/active_record/associations/collection_association.rb#430 + def replace_common_records_in_memory(new_target, original_target); end + + # source://activerecord//lib/active_record/associations/collection_association.rb#457 + def replace_on_target(record, skip_callbacks, replace:, inversing: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/associations/collection_association.rb#418 + def replace_records(new_target, original_target); end + + # source://activerecord//lib/active_record/associations/collection_association.rb#321 + def transaction(&block); end +end + +# = Active Record Collection Proxy +# +# Collection proxies in Active Record are middlemen between an +# association, and its target result set. +# +# For example, given +# +# class Blog < ActiveRecord::Base +# has_many :posts +# end +# +# blog = Blog.first +# +# The collection proxy returned by blog.posts is built from a +# :has_many association, and delegates to a collection +# of posts as the target. +# +# This class delegates unknown methods to the association's +# relation class via a delegate cache. +# +# The target result set is not loaded until needed. For example, +# +# blog.posts.count +# +# is computed directly through SQL and does not trigger by itself the +# instantiation of the actual post records. +# +# source://activerecord//lib/active_record/associations/collection_proxy.rb#31 +class ActiveRecord::Associations::CollectionProxy < ::ActiveRecord::Relation + # @return [CollectionProxy] a new instance of CollectionProxy + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#32 + def initialize(klass, association, **_arg2); end + + # Adds one or more +records+ to the collection by setting their foreign keys + # to the association's primary key. Since << flattens its argument list and + # inserts each record, +push+ and +concat+ behave identically. Returns +self+ + # so several appends may be chained together. + # + # class Person < ActiveRecord::Base + # has_many :pets + # end + # + # person.pets.size # => 0 + # person.pets << Pet.new(name: 'Fancy-Fancy') + # person.pets << [Pet.new(name: 'Spook'), Pet.new(name: 'Choo-Choo')] + # person.pets.size # => 3 + # + # person.id # => 1 + # person.pets + # # => [ + # # #, + # # #, + # # # + # # ] + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1049 + def <<(*records); end + + # Equivalent to Array#==. Returns +true+ if the two arrays + # contain the same number of elements and if each element is equal + # to the corresponding element in the +other+ array, otherwise returns + # +false+. + # + # class Person < ActiveRecord::Base + # has_many :pets + # end + # + # person.pets + # # => [ + # # #, + # # # + # # ] + # + # other = person.pets.to_ary + # + # person.pets == other + # # => true + # + # + # Note that unpersisted records can still be seen as equal: + # + # other = [Pet.new(id: 1), Pet.new(id: 2)] + # + # person.pets == other + # # => true + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#980 + def ==(other); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def _select!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def all(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def and(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def and!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def annotate(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def annotate!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def annotate_values(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def annotate_values=(arg); end + + # Adds one or more +records+ to the collection by setting their foreign keys + # to the association's primary key. Since << flattens its argument list and + # inserts each record, +push+ and +concat+ behave identically. Returns +self+ + # so several appends may be chained together. + # + # class Person < ActiveRecord::Base + # has_many :pets + # end + # + # person.pets.size # => 0 + # person.pets << Pet.new(name: 'Fancy-Fancy') + # person.pets << [Pet.new(name: 'Spook'), Pet.new(name: 'Choo-Choo')] + # person.pets.size # => 3 + # + # person.id # => 1 + # person.pets + # # => [ + # # #, + # # #, + # # # + # # ] + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1053 + def append(*records); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def arel(*_arg0, **_arg1, &_arg2); end + + # Returns a new object of the collection type that has been instantiated + # with +attributes+ and linked to this object, but have not yet been saved. + # You can pass an array of attributes hashes, this will return an array + # with the new objects. + # + # class Person + # has_many :pets + # end + # + # person.pets.build + # # => # + # + # person.pets.build(name: 'Fancy-Fancy') + # # => # + # + # person.pets.build([{name: 'Spook'}, {name: 'Choo-Choo'}, {name: 'Brain'}]) + # # => [ + # # #, + # # #, + # # # + # # ] + # + # person.pets.size # => 5 # size of the collection + # person.pets.count # => 0 # count from database + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#318 + def build(attributes = T.unsafe(nil), &block); end + + # -- + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#724 + def calculate(operation, column_name); end + + # Equivalent to +delete_all+. The difference is that returns +self+, instead + # of an array with the deleted objects, so methods can be chained. See + # +delete_all+ for more information. + # Note that because +delete_all+ removes records by directly + # running an SQL query into the database, the +updated_at+ column of + # the object is not changed. + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1066 + def clear; end + + # Adds one or more +records+ to the collection by setting their foreign keys + # to the association's primary key. Since << flattens its argument list and + # inserts each record, +push+ and +concat+ behave identically. Returns +self+ + # so several appends may be chained together. + # + # class Person < ActiveRecord::Base + # has_many :pets + # end + # + # person.pets.size # => 0 + # person.pets << Pet.new(name: 'Fancy-Fancy') + # person.pets << [Pet.new(name: 'Spook'), Pet.new(name: 'Choo-Choo')] + # person.pets.size # => 3 + # + # person.id # => 1 + # person.pets + # # => [ + # # #, + # # #, + # # # + # # ] + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1054 + def concat(*records); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def construct_join_dependency(*_arg0, **_arg1, &_arg2); end + + # Returns a new object of the collection type that has been instantiated with + # attributes, linked to this object and that has already been saved (if it + # passes the validations). + # + # class Person + # has_many :pets + # end + # + # person.pets.create(name: 'Fancy-Fancy') + # # => # + # + # person.pets.create([{name: 'Spook'}, {name: 'Choo-Choo'}]) + # # => [ + # # #, + # # # + # # ] + # + # person.pets.size # => 3 + # person.pets.count # => 3 + # + # person.pets.find(1, 2, 3) + # # => [ + # # #, + # # #, + # # # + # # ] + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#349 + def create(attributes = T.unsafe(nil), &block); end + + # Like #create, except that if the record is invalid, raises an exception. + # + # class Person + # has_many :pets + # end + # + # class Pet + # validates :name, presence: true + # end + # + # person.pets.create!(name: nil) + # # => ActiveRecord::RecordInvalid: Validation failed: Name can't be blank + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#365 + def create!(attributes = T.unsafe(nil), &block); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def create_with(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def create_with!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def create_with_value(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def create_with_value=(arg); end + + # Deletes the +records+ supplied from the collection according to the strategy + # specified by the +:dependent+ option. If no +:dependent+ option is given, + # then it will follow the default strategy. Returns an array with the + # deleted records. + # + # For has_many :through associations, the default deletion strategy is + # +:delete_all+. + # + # For +has_many+ associations, the default deletion strategy is +:nullify+. + # This sets the foreign keys to +NULL+. + # + # class Person < ActiveRecord::Base + # has_many :pets # dependent: :nullify option by default + # end + # + # person.pets.size # => 3 + # person.pets + # # => [ + # # #, + # # #, + # # # + # # ] + # + # person.pets.delete(Pet.find(1)) + # # => [#] + # + # person.pets.size # => 2 + # person.pets + # # => [ + # # #, + # # # + # # ] + # + # Pet.find(1) + # # => # + # + # If it is set to :destroy all the +records+ are removed by calling + # their +destroy+ method. See +destroy+ for more information. + # + # class Person < ActiveRecord::Base + # has_many :pets, dependent: :destroy + # end + # + # person.pets.size # => 3 + # person.pets + # # => [ + # # #, + # # #, + # # # + # # ] + # + # person.pets.delete(Pet.find(1), Pet.find(3)) + # # => [ + # # #, + # # # + # # ] + # + # person.pets.size # => 1 + # person.pets + # # => [#] + # + # Pet.find(1, 3) + # # => ActiveRecord::RecordNotFound: Couldn't find all Pets with 'id': (1, 3) + # + # If it is set to :delete_all, all the +records+ are deleted + # *without* calling their +destroy+ method. + # + # class Person < ActiveRecord::Base + # has_many :pets, dependent: :delete_all + # end + # + # person.pets.size # => 3 + # person.pets + # # => [ + # # #, + # # #, + # # # + # # ] + # + # person.pets.delete(Pet.find(1)) + # # => [#] + # + # person.pets.size # => 2 + # person.pets + # # => [ + # # #, + # # # + # # ] + # + # Pet.find(1) + # # => ActiveRecord::RecordNotFound: Couldn't find Pet with 'id'=1 + # + # You can pass +Integer+ or +String+ values, it finds the records + # responding to the +id+ and executes delete on them. + # + # class Person < ActiveRecord::Base + # has_many :pets + # end + # + # person.pets.size # => 3 + # person.pets + # # => [ + # # #, + # # #, + # # # + # # ] + # + # person.pets.delete("1") + # # => [#] + # + # person.pets.delete(2, 3) + # # => [ + # # #, + # # # + # # ] + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#620 + def delete(*records); end + + # Deletes all the records from the collection according to the strategy + # specified by the +:dependent+ option. If no +:dependent+ option is given, + # then it will follow the default strategy. + # + # For has_many :through associations, the default deletion strategy is + # +:delete_all+. + # + # For +has_many+ associations, the default deletion strategy is +:nullify+. + # This sets the foreign keys to +NULL+. + # + # class Person < ActiveRecord::Base + # has_many :pets # dependent: :nullify option by default + # end + # + # person.pets.size # => 3 + # person.pets + # # => [ + # # #, + # # #, + # # # + # # ] + # + # person.pets.delete_all + # # => [ + # # #, + # # #, + # # # + # # ] + # + # person.pets.size # => 0 + # person.pets # => [] + # + # Pet.find(1, 2, 3) + # # => [ + # # #, + # # #, + # # # + # # ] + # + # Both +has_many+ and has_many :through dependencies default to the + # +:delete_all+ strategy if the +:dependent+ option is set to +:destroy+. + # Records are not instantiated and callbacks will not be fired. + # + # class Person < ActiveRecord::Base + # has_many :pets, dependent: :destroy + # end + # + # person.pets.size # => 3 + # person.pets + # # => [ + # # #, + # # #, + # # # + # # ] + # + # person.pets.delete_all + # + # Pet.find(1, 2, 3) + # # => ActiveRecord::RecordNotFound: Couldn't find all Pets with 'id': (1, 2, 3) + # + # If it is set to :delete_all, all the objects are deleted + # *without* calling their +destroy+ method. + # + # class Person < ActiveRecord::Base + # has_many :pets, dependent: :delete_all + # end + # + # person.pets.size # => 3 + # person.pets + # # => [ + # # #, + # # #, + # # # + # # ] + # + # person.pets.delete_all + # + # Pet.find(1, 2, 3) + # # => ActiveRecord::RecordNotFound: Couldn't find all Pets with 'id': (1, 2, 3) + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#474 + def delete_all(dependent = T.unsafe(nil)); end + + # Destroys the +records+ supplied and removes them from the collection. + # This method will _always_ remove record from the database ignoring + # the +:dependent+ option. Returns an array with the removed records. + # + # class Person < ActiveRecord::Base + # has_many :pets + # end + # + # person.pets.size # => 3 + # person.pets + # # => [ + # # #, + # # #, + # # # + # # ] + # + # person.pets.destroy(Pet.find(1)) + # # => [#] + # + # person.pets.size # => 2 + # person.pets + # # => [ + # # #, + # # # + # # ] + # + # person.pets.destroy(Pet.find(2), Pet.find(3)) + # # => [ + # # #, + # # # + # # ] + # + # person.pets.size # => 0 + # person.pets # => [] + # + # Pet.find(1, 2, 3) # => ActiveRecord::RecordNotFound: Couldn't find all Pets with 'id': (1, 2, 3) + # + # You can pass +Integer+ or +String+ values, it finds the records + # responding to the +id+ and then deletes them from the database. + # + # person.pets.size # => 3 + # person.pets + # # => [ + # # #, + # # #, + # # # + # # ] + # + # person.pets.destroy("4") + # # => # + # + # person.pets.size # => 2 + # person.pets + # # => [ + # # #, + # # # + # # ] + # + # person.pets.destroy(5, 6) + # # => [ + # # #, + # # # + # # ] + # + # person.pets.size # => 0 + # person.pets # => [] + # + # Pet.find(4, 5, 6) # => ActiveRecord::RecordNotFound: Couldn't find all Pets with 'id': (4, 5, 6) + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#692 + def destroy(*records); end + + # Deletes the records of the collection directly from the database + # ignoring the +:dependent+ option. Records are instantiated and it + # invokes +before_remove+, +after_remove+, +before_destroy+, and + # +after_destroy+ callbacks. + # + # class Person < ActiveRecord::Base + # has_many :pets + # end + # + # person.pets.size # => 3 + # person.pets + # # => [ + # # #, + # # #, + # # # + # # ] + # + # person.pets.destroy_all + # + # person.pets.size # => 0 + # person.pets # => [] + # + # Pet.find(1) # => Couldn't find Pet with id=1 + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#501 + def destroy_all; end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def distinct(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def distinct!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def distinct_value(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def distinct_value=(arg); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def eager_load(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def eager_load!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def eager_load_values(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def eager_load_values=(arg); end + + # Returns +true+ if the collection is empty. If the collection has been + # loaded it is equivalent + # to collection.size.zero?. If the collection has not been loaded, + # it is equivalent to !collection.exists?. If the collection has + # not already been loaded and you are going to fetch the records anyway it + # is better to check collection.load.empty?. + # + # class Person < ActiveRecord::Base + # has_many :pets + # end + # + # person.pets.count # => 1 + # person.pets.empty? # => false + # + # person.pets.delete_all + # + # person.pets.count # => 0 + # person.pets.empty? # => true + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#831 + def empty?; end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def except(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def excluding(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def excluding!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def extending(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def extending!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def extending_values(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def extending_values=(arg); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def extensions(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def extract_associated(*_arg0, **_arg1, &_arg2); end + + # Finds an object in the collection responding to the +id+. Uses the same + # rules as ActiveRecord::FinderMethods.find. Raises ActiveRecord::RecordNotFound + # error if the object cannot be found. + # + # class Person < ActiveRecord::Base + # has_many :pets + # end + # + # person.pets + # # => [ + # # #, + # # #, + # # # + # # ] + # + # person.pets.find(1) # => # + # person.pets.find(4) # => ActiveRecord::RecordNotFound: Couldn't find Pet with 'id'=4 + # + # person.pets.find(2) { |pet| pet.name.downcase! } + # # => # + # + # person.pets.find(2, 3) + # # => [ + # # #, + # # # + # # ] + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#138 + def find(*args); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def from(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def from!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def from_clause(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def from_clause=(arg); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def group(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def group!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def group_values(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def group_values=(arg); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def having(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def having!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def having_clause(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def having_clause=(arg); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def in_order_of(*_arg0, **_arg1, &_arg2); end + + # Returns +true+ if the given +record+ is present in the collection. + # + # class Person < ActiveRecord::Base + # has_many :pets + # end + # + # person.pets # => [#] + # + # person.pets.include?(Pet.find(20)) # => true + # person.pets.include?(Pet.find(21)) # => false + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#927 + def include?(record); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def includes(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def includes!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def includes_values(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def includes_values=(arg); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1129 + def insert(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1129 + def insert!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1129 + def insert_all(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1129 + def insert_all!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1118 + def inspect; end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def invert_where(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def invert_where!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def joins(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def joins!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def joins_values(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def joins_values=(arg); end + + # Returns the last record, or the last +n+ records, from the collection. + # If the collection is empty, the first form returns +nil+, and the second + # form returns an empty array. + # + # class Person < ActiveRecord::Base + # has_many :pets + # end + # + # person.pets + # # => [ + # # #, + # # #, + # # # + # # ] + # + # person.pets.last # => # + # + # person.pets.last(2) + # # => [ + # # #, + # # # + # # ] + # + # another_person_without.pets # => [] + # another_person_without.pets.last # => nil + # another_person_without.pets.last(3) # => [] + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#259 + def last(limit = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def left_joins(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def left_outer_joins(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def left_outer_joins!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def left_outer_joins_values(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def left_outer_joins_values=(arg); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def limit(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def limit!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def limit_value(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def limit_value=(arg); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def load_async(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#44 + def load_target; end + + # Returns +true+ if the association has been loaded, otherwise +false+. + # + # person.pets.loaded? # => false + # person.pets.records + # person.pets.loaded? # => true + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#56 + def loaded; end + + # Returns +true+ if the association has been loaded, otherwise +false+. + # + # person.pets.loaded? # => false + # person.pets.records + # person.pets.loaded? # => true + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#53 + def loaded?; end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def lock(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def lock!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def lock_value(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def lock_value=(arg); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def merge(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def merge!(*_arg0, **_arg1, &_arg2); end + + # Returns a new object of the collection type that has been instantiated + # with +attributes+ and linked to this object, but have not yet been saved. + # You can pass an array of attributes hashes, this will return an array + # with the new objects. + # + # class Person + # has_many :pets + # end + # + # person.pets.build + # # => # + # + # person.pets.build(name: 'Fancy-Fancy') + # # => # + # + # person.pets.build([{name: 'Spook'}, {name: 'Choo-Choo'}, {name: 'Brain'}]) + # # => [ + # # #, + # # #, + # # # + # # ] + # + # person.pets.size # => 5 # size of the collection + # person.pets.count # => 0 # count from database + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#321 + def new(attributes = T.unsafe(nil), &block); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def none(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def none!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def null_relation?(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def offset(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def offset!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def offset_value(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def offset_value=(arg); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def only(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def optimizer_hints(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def optimizer_hints!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def optimizer_hints_values(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def optimizer_hints_values=(arg); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def or(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def or!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def order(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def order!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def order_values(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def order_values=(arg); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#728 + def pluck(*column_names); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def preload(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def preload!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def preload_values(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def preload_values=(arg); end + + # @raise [NoMethodError] + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1056 + def prepend(*args); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1123 + def pretty_print(pp); end + + # Returns the association object for the collection. + # + # class Person < ActiveRecord::Base + # has_many :pets + # end + # + # person.pets.proxy_association + # # => # + # + # Returns the same object as person.association(:pets), + # allowing you to make calls like person.pets.proxy_association.owner. + # + # See Associations::ClassMethods@Association+extensions for more. + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#944 + def proxy_association; end + + # Adds one or more +records+ to the collection by setting their foreign keys + # to the association's primary key. Since << flattens its argument list and + # inserts each record, +push+ and +concat+ behave identically. Returns +self+ + # so several appends may be chained together. + # + # class Person < ActiveRecord::Base + # has_many :pets + # end + # + # person.pets.size # => 0 + # person.pets << Pet.new(name: 'Fancy-Fancy') + # person.pets << [Pet.new(name: 'Spook'), Pet.new(name: 'Choo-Choo')] + # person.pets.size # => 3 + # + # person.id # => 1 + # person.pets + # # => [ + # # #, + # # #, + # # # + # # ] + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1052 + def push(*records); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def readonly(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def readonly!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def readonly_value(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def readonly_value=(arg); end + + # :method: to_ary + # + # :call-seq: + # to_ary() + # + # Returns a new array of objects from the collection. If the collection + # hasn't been loaded, it fetches the records from the database. + # + # class Person < ActiveRecord::Base + # has_many :pets + # end + # + # person.pets + # # => [ + # # #, + # # #, + # # # + # # ] + # + # other_pets = person.pets.to_ary + # # => [ + # # #, + # # #, + # # # + # # ] + # + # other_pets.replace([Pet.new(name: 'BooGoo')]) + # + # other_pets + # # => [#] + # + # person.pets + # # This is not affected by replace + # # => [ + # # #, + # # #, + # # # + # # ] + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1024 + def records; end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def references(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def references!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def references_values(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def references_values=(arg); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def regroup(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def regroup!(*_arg0, **_arg1, &_arg2); end + + # Reloads the collection from the database. Returns +self+. + # + # class Person < ActiveRecord::Base + # has_many :pets + # end + # + # person.pets # fetches pets from the database + # # => [#] + # + # person.pets # uses the pets cache + # # => [#] + # + # person.pets.reload # fetches pets from the database + # # => [#] + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1085 + def reload; end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def reorder(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def reorder!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def reordering_value(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def reordering_value=(arg); end + + # Replaces this collection with +other_array+. This will perform a diff + # and delete/add only records that have changed. + # + # class Person < ActiveRecord::Base + # has_many :pets + # end + # + # person.pets + # # => [#] + # + # other_pets = [Pet.new(name: 'Puff', group: 'celebrities')] + # + # person.pets.replace(other_pets) + # + # person.pets + # # => [#] + # + # If the supplied array has an incorrect association type, it raises + # an ActiveRecord::AssociationTypeMismatch error: + # + # person.pets.replace(["doo", "ggie", "gaga"]) + # # => ActiveRecord::AssociationTypeMismatch: Pet expected, got String + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#391 + def replace(other_array); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def reselect(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def reselect!(*_arg0, **_arg1, &_arg2); end + + # Unloads the association. Returns +self+. + # + # class Person < ActiveRecord::Base + # has_many :pets + # end + # + # person.pets # fetches pets from the database + # # => [#] + # + # person.pets # uses the pets cache + # # => [#] + # + # person.pets.reset # clears the pets cache + # + # person.pets # fetches pets from the database + # # => [#] + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1106 + def reset; end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1112 + def reset_scope; end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def reverse_order(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def reverse_order!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def reverse_order_value(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def reverse_order_value=(arg); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def rewhere(*_arg0, **_arg1, &_arg2); end + + # Returns a Relation object for the records in this association + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#949 + def scope; end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def scoping(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def select_values(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def select_values=(arg); end + + # Returns the size of the collection. If the collection hasn't been loaded, + # it executes a SELECT COUNT(*) query. Else it calls collection.size. + # + # If the collection has been already loaded +size+ and +length+ are + # equivalent. If not and you are going to need the records anyway + # +length+ will take one less query. Otherwise +size+ is more efficient. + # + # class Person < ActiveRecord::Base + # has_many :pets + # end + # + # person.pets.size # => 3 + # # executes something like SELECT COUNT(*) FROM "pets" WHERE "pets"."person_id" = 1 + # + # person.pets # This will execute a SELECT * FROM query + # # => [ + # # #, + # # #, + # # # + # # ] + # + # person.pets.size # => 3 + # # Because the collection is already loaded, this will behave like + # # collection.size and no SQL count query is executed. + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#782 + def size; end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def skip_preloading!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def skip_query_cache!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def skip_query_cache_value(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def skip_query_cache_value=(arg); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def spawn(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def strict_loading(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def strict_loading!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def strict_loading_value(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def strict_loading_value=(arg); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def structurally_compatible?(*_arg0, **_arg1, &_arg2); end + + # Gives a record (or N records if a parameter is supplied) from the collection + # using the same rules as ActiveRecord::FinderMethods.take. + # + # class Person < ActiveRecord::Base + # has_many :pets + # end + # + # person.pets + # # => [ + # # #, + # # #, + # # # + # # ] + # + # person.pets.take # => # + # + # person.pets.take(2) + # # => [ + # # #, + # # # + # # ] + # + # another_person_without.pets # => [] + # another_person_without.pets.take # => nil + # another_person_without.pets.take(2) # => [] + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#289 + def take(limit = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#40 + def target; end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def uniq!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def unscope(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def unscope!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def unscope_values(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def unscope_values=(arg); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1129 + def upsert(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1129 + def upsert_all(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def values(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def where(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def where!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def where_clause(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def where_clause=(arg); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def with(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def with!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def with_recursive(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def with_recursive!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def with_values(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def with_values=(arg); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1155 + def without(*_arg0, **_arg1, &_arg2); end + + private + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1176 + def exec_queries; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1172 + def find_from_target?; end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1163 + def find_nth_from_last(index); end + + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1158 + def find_nth_with_limit(index, limit); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/collection_proxy.rb#1168 + def null_scope?; end +end + +# source://activerecord//lib/active_record/associations/deprecation.rb#6 +module ActiveRecord::Associations::Deprecation + class << self + # Returns the value of attribute backtrace. + # + # source://activerecord//lib/active_record/associations/deprecation.rb#14 + def backtrace; end + + # source://activerecord//lib/active_record/associations/deprecation.rb#24 + def backtrace=(value); end + + # source://activerecord//lib/active_record/associations/deprecation.rb#28 + def guard(reflection); end + + # Returns the value of attribute mode. + # + # source://activerecord//lib/active_record/associations/deprecation.rb#14 + def mode; end + + # private setter + # + # source://activerecord//lib/active_record/associations/deprecation.rb#16 + def mode=(value); end + + # source://activerecord//lib/active_record/associations/deprecation.rb#39 + def report(reflection, context:); end + + private + + # source://activerecord//lib/active_record/associations/deprecation.rb#65 + def backtrace_cleaner; end + + # source://activerecord//lib/active_record/associations/deprecation.rb#69 + def clean_frames; end + + # source://activerecord//lib/active_record/associations/deprecation.rb#73 + def clean_locations; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/deprecation.rb#77 + def set_backtrace_supports_array_of_locations?; end + + # source://activerecord//lib/active_record/associations/deprecation.rb#81 + def user_facing_reflection(reflection); end + end +end + +# source://activerecord//lib/active_record/associations/deprecation.rb#7 +ActiveRecord::Associations::Deprecation::EVENT = T.let(T.unsafe(nil), String) + +# source://activerecord//lib/active_record/associations/deprecation.rb#10 +ActiveRecord::Associations::Deprecation::MODES = T.let(T.unsafe(nil), Array) + +# source://activerecord//lib/active_record/associations/disable_joins_association_scope.rb#5 +class ActiveRecord::Associations::DisableJoinsAssociationScope < ::ActiveRecord::Associations::AssociationScope + # source://activerecord//lib/active_record/associations/disable_joins_association_scope.rb#6 + def scope(association); end + + private + + # source://activerecord//lib/active_record/associations/disable_joins_association_scope.rb#33 + def add_constraints(reflection, key, join_ids, owner, ordered); end + + # source://activerecord//lib/active_record/associations/disable_joins_association_scope.rb#18 + def last_scope_chain(reverse_chain, owner); end +end + +# source://activerecord//lib/active_record/associations/foreign_association.rb#4 +module ActiveRecord::Associations::ForeignAssociation + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/foreign_association.rb#5 + def foreign_key_present?; end + + # source://activerecord//lib/active_record/associations/foreign_association.rb#13 + def nullified_owner_attributes; end + + private + + # Sets the owner attributes on the given record + # + # source://activerecord//lib/active_record/associations/foreign_association.rb#22 + def set_owner_attributes(record); end +end + +# = Active Record Has Many Association +# +# This is the proxy that handles a has many association. +# +# If the association has a :through option further specialization +# is provided by its child HasManyThroughAssociation. +# +# source://activerecord//lib/active_record/associations/has_many_association.rb#11 +class ActiveRecord::Associations::HasManyAssociation < ::ActiveRecord::Associations::CollectionAssociation + include ::ActiveRecord::Associations::ForeignAssociation + + # source://activerecord//lib/active_record/associations/has_many_association.rb#14 + def handle_dependency; end + + # source://activerecord//lib/active_record/associations/has_many_association.rb#61 + def insert_record(record, validate = T.unsafe(nil), raise = T.unsafe(nil)); end + + private + + # source://activerecord//lib/active_record/associations/has_many_association.rb#143 + def _create_record(attributes, *_arg1); end + + # source://activerecord//lib/active_record/associations/has_many_association.rb#139 + def concat_records(records, *_arg1); end + + # Returns the number of records in this collection. + # + # If the association has a counter cache it gets that value. Otherwise + # it will attempt to do a count via SQL, bounded to :limit if + # there's one. Some configuration options like :group make it impossible + # to do an SQL count, in those cases the array count will be used. + # + # That does not depend on whether the collection has already been loaded + # or not. The +size+ method is the one that takes the loaded flag into + # account and delegates to +count_records+ if needed. + # + # If the collection is empty the target is set to an empty array and + # the loaded flag is set to true as well. + # + # source://activerecord//lib/active_record/associations/has_many_association.rb#80 + def count_records; end + + # source://activerecord//lib/active_record/associations/has_many_association.rb#112 + def delete_count(method, scope); end + + # source://activerecord//lib/active_record/associations/has_many_association.rb#120 + def delete_or_nullify_all_records(method); end + + # Deletes the records according to the :dependent option. + # + # source://activerecord//lib/active_record/associations/has_many_association.rb#127 + def delete_records(records, method); end + + # source://activerecord//lib/active_record/associations/has_many_association.rb#158 + def difference(a, b); end + + # source://activerecord//lib/active_record/associations/has_many_association.rb#162 + def intersection(a, b); end + + # source://activerecord//lib/active_record/associations/has_many_association.rb#98 + def update_counter(difference, reflection = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/associations/has_many_association.rb#151 + def update_counter_if_success(saved_successfully, difference); end + + # source://activerecord//lib/active_record/associations/has_many_association.rb#104 + def update_counter_in_memory(difference, reflection = T.unsafe(nil)); end +end + +# = Active Record Has Many Through Association +# +# source://activerecord//lib/active_record/associations/has_many_through_association.rb#6 +class ActiveRecord::Associations::HasManyThroughAssociation < ::ActiveRecord::Associations::HasManyAssociation + include ::ActiveRecord::Associations::ThroughAssociation + + # @return [HasManyThroughAssociation] a new instance of HasManyThroughAssociation + # + # source://activerecord//lib/active_record/associations/has_many_through_association.rb#9 + def initialize(owner, reflection); end + + # source://activerecord//lib/active_record/associations/has_many_through_association.rb#14 + def concat(*records); end + + # source://activerecord//lib/active_record/associations/has_many_through_association.rb#24 + def insert_record(record, validate = T.unsafe(nil), raise = T.unsafe(nil)); end + + private + + # source://activerecord//lib/active_record/associations/has_many_through_association.rb#90 + def build_record(attributes); end + + # The through record (built with build_record) is temporarily cached + # so that it may be reused if insert_record is subsequently called. + # + # However, after insert_record has been called, the cache is cleared in + # order to allow multiple instances of the same record in an association. + # + # source://activerecord//lib/active_record/associations/has_many_through_association.rb#56 + def build_through_record(record); end + + # source://activerecord//lib/active_record/associations/has_many_through_association.rb#37 + def concat_records(records); end + + # source://activerecord//lib/active_record/associations/has_many_through_association.rb#136 + def delete_or_nullify_all_records(method); end + + # source://activerecord//lib/active_record/associations/has_many_through_association.rb#140 + def delete_records(records, method); end + + # source://activerecord//lib/active_record/associations/has_many_through_association.rb#209 + def delete_through_records(records); end + + # source://activerecord//lib/active_record/associations/has_many_through_association.rb#177 + def difference(a, b); end + + # source://activerecord//lib/active_record/associations/has_many_through_association.rb#193 + def distribution(array); end + + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/associations/has_many_through_association.rb#225 + def find_target(async: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/associations/has_many_through_association.rb#183 + def intersection(a, b); end + + # NOTE - not sure that we can actually cope with inverses here + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/has_many_through_association.rb#233 + def invertible_for?(record); end + + # source://activerecord//lib/active_record/associations/has_many_through_association.rb#189 + def mark_occurrence(distribution, record); end + + # source://activerecord//lib/active_record/associations/has_many_through_association.rb#116 + def remove_records(existing_records, records, method); end + + # source://activerecord//lib/active_record/associations/has_many_through_association.rb#81 + def save_through_record(record); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/has_many_through_association.rb#121 + def target_reflection_has_associated_record?; end + + # source://activerecord//lib/active_record/associations/has_many_through_association.rb#199 + def through_records_for(record); end + + # Returns the value of attribute through_scope. + # + # source://activerecord//lib/active_record/associations/has_many_through_association.rb#69 + def through_scope; end + + # source://activerecord//lib/active_record/associations/has_many_through_association.rb#71 + def through_scope_attributes; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/has_many_through_association.rb#125 + def update_through_counter?(method); end +end + +# = Active Record Has One Association +# +# source://activerecord//lib/active_record/associations/has_one_association.rb#6 +class ActiveRecord::Associations::HasOneAssociation < ::ActiveRecord::Associations::SingularAssociation + include ::ActiveRecord::Associations::ForeignAssociation + + # source://activerecord//lib/active_record/associations/has_one_association.rb#26 + def delete(method = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/associations/has_one_association.rb#9 + def handle_dependency; end + + private + + # source://activerecord//lib/active_record/associations/has_one_association.rb#133 + def _create_record(attributes, raise_error = T.unsafe(nil), &block); end + + # source://activerecord//lib/active_record/associations/has_one_association.rb#119 + def nullify_owner_attributes(record); end + + # source://activerecord//lib/active_record/associations/has_one_association.rb#95 + def remove_target!(method); end + + # source://activerecord//lib/active_record/associations/has_one_association.rb#59 + def replace(record, save = T.unsafe(nil)); end + + # The reason that the save param for replace is false, if for create (not just build), + # is because the setting of the foreign keys is actually handled by the scoping when + # the record is instantiated, and so they are set straight away and do not need to be + # updated within replace. + # + # source://activerecord//lib/active_record/associations/has_one_association.rb#91 + def set_new_record(record); end + + # source://activerecord//lib/active_record/associations/has_one_association.rb#125 + def transaction_if(value, &block); end +end + +# = Active Record Has One Through Association +# +# source://activerecord//lib/active_record/associations/has_one_through_association.rb#6 +class ActiveRecord::Associations::HasOneThroughAssociation < ::ActiveRecord::Associations::HasOneAssociation + include ::ActiveRecord::Associations::ThroughAssociation + + private + + # source://activerecord//lib/active_record/associations/has_one_through_association.rb#15 + def create_through_record(record, save); end + + # source://activerecord//lib/active_record/associations/has_one_through_association.rb#10 + def replace(record, save = T.unsafe(nil)); end +end + +# source://activerecord//lib/active_record/associations/join_dependency.rb#5 +class ActiveRecord::Associations::JoinDependency + extend ::ActiveSupport::Autoload + + # @return [JoinDependency] a new instance of JoinDependency + # + # source://activerecord//lib/active_record/associations/join_dependency.rb#71 + def initialize(base, table, associations, join_type); end + + # source://activerecord//lib/active_record/associations/join_dependency.rb#153 + def apply_column_aliases(relation); end + + # source://activerecord//lib/active_record/associations/join_dependency.rb#77 + def base_klass; end + + # source://activerecord//lib/active_record/associations/join_dependency.rb#158 + def each(&block); end + + # source://activerecord//lib/active_record/associations/join_dependency.rb#105 + def instantiate(result_set, strict_loading_value, &block); end + + # source://activerecord//lib/active_record/associations/join_dependency.rb#85 + def join_constraints(joins_to_add, alias_tracker, references); end + + # source://activerecord//lib/active_record/associations/join_dependency.rb#81 + def reflections; end + + protected + + # Returns the value of attribute join_root. + # + # source://activerecord//lib/active_record/associations/join_dependency.rb#163 + def join_root; end + + # Returns the value of attribute join_type. + # + # source://activerecord//lib/active_record/associations/join_dependency.rb#163 + def join_type; end + + private + + # Returns the value of attribute alias_tracker. + # + # source://activerecord//lib/active_record/associations/join_dependency.rb#166 + def alias_tracker; end + + # source://activerecord//lib/active_record/associations/join_dependency.rb#168 + def aliases; end + + # source://activerecord//lib/active_record/associations/join_dependency.rb#228 + def build(associations, base_klass); end + + # source://activerecord//lib/active_record/associations/join_dependency.rb#244 + def construct(ar_parent, parent, row, seen, model_cache, strict_loading_value); end + + # source://activerecord//lib/active_record/associations/join_dependency.rb#280 + def construct_model(record, node, row, model_cache, id, strict_loading_value); end + + # source://activerecord//lib/active_record/associations/join_dependency.rb#223 + def find_reflection(klass, name); end + + # Returns the value of attribute join_root_alias. + # + # source://activerecord//lib/active_record/associations/join_dependency.rb#166 + def join_root_alias; end + + # source://activerecord//lib/active_record/associations/join_dependency.rb#190 + def make_constraints(parent, child, join_type); end + + # source://activerecord//lib/active_record/associations/join_dependency.rb#184 + def make_join_constraints(join_root, join_type); end + + # source://activerecord//lib/active_record/associations/join_dependency.rb#214 + def walk(left, right, join_type); end + + class << self + # source://activerecord//lib/active_record/associations/join_dependency.rb#47 + def make_tree(associations); end + + # source://activerecord//lib/active_record/associations/join_dependency.rb#53 + def walk_tree(associations, hash); end + end +end + +# source://activerecord//lib/active_record/associations/join_dependency.rb#13 +class ActiveRecord::Associations::JoinDependency::Aliases + # @return [Aliases] a new instance of Aliases + # + # source://activerecord//lib/active_record/associations/join_dependency.rb#14 + def initialize(tables); end + + # source://activerecord//lib/active_record/associations/join_dependency.rb#34 + def column_alias(node, column); end + + # source://activerecord//lib/active_record/associations/join_dependency.rb#30 + def column_aliases(node); end + + # source://activerecord//lib/active_record/associations/join_dependency.rb#26 + def columns; end +end + +# source://activerecord//lib/active_record/associations/join_dependency.rb#44 +class ActiveRecord::Associations::JoinDependency::Aliases::Column < ::Struct + # Returns the value of attribute alias + # + # @return [Object] the current value of alias + # + # source://activerecord//lib/active_record/associations/join_dependency.rb#44 + def alias; end + + # Sets the attribute alias + # + # @param value [Object] the value to set the attribute alias to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/associations/join_dependency.rb#44 + def alias=(_); end + + # Returns the value of attribute name + # + # @return [Object] the current value of name + # + # source://activerecord//lib/active_record/associations/join_dependency.rb#44 + def name; end + + # Sets the attribute name + # + # @param value [Object] the value to set the attribute name to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/associations/join_dependency.rb#44 + def name=(_); end + + class << self + # source://activerecord//lib/active_record/associations/join_dependency.rb#44 + def [](*_arg0); end + + # source://activerecord//lib/active_record/associations/join_dependency.rb#44 + def inspect; end + + # source://activerecord//lib/active_record/associations/join_dependency.rb#44 + def keyword_init?; end + + # source://activerecord//lib/active_record/associations/join_dependency.rb#44 + def members; end + + # source://activerecord//lib/active_record/associations/join_dependency.rb#44 + def new(*_arg0); end + end +end + +# source://activerecord//lib/active_record/associations/join_dependency.rb#38 +class ActiveRecord::Associations::JoinDependency::Aliases::Table < ::Struct + # source://activerecord//lib/active_record/associations/join_dependency.rb#39 + def column_aliases; end + + # Returns the value of attribute columns + # + # @return [Object] the current value of columns + # + # source://activerecord//lib/active_record/associations/join_dependency.rb#38 + def columns; end + + # Sets the attribute columns + # + # @param value [Object] the value to set the attribute columns to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/associations/join_dependency.rb#38 + def columns=(_); end + + # Returns the value of attribute node + # + # @return [Object] the current value of node + # + # source://activerecord//lib/active_record/associations/join_dependency.rb#38 + def node; end + + # Sets the attribute node + # + # @param value [Object] the value to set the attribute node to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/associations/join_dependency.rb#38 + def node=(_); end + + class << self + # source://activerecord//lib/active_record/associations/join_dependency.rb#38 + def [](*_arg0); end + + # source://activerecord//lib/active_record/associations/join_dependency.rb#38 + def inspect; end + + # source://activerecord//lib/active_record/associations/join_dependency.rb#38 + def keyword_init?; end + + # source://activerecord//lib/active_record/associations/join_dependency.rb#38 + def members; end + + # source://activerecord//lib/active_record/associations/join_dependency.rb#38 + def new(*_arg0); end + end +end + +# source://activerecord//lib/active_record/associations/join_dependency/join_association.rb#9 +class ActiveRecord::Associations::JoinDependency::JoinAssociation < ::ActiveRecord::Associations::JoinDependency::JoinPart + # @return [JoinAssociation] a new instance of JoinAssociation + # + # source://activerecord//lib/active_record/associations/join_dependency/join_association.rb#13 + def initialize(reflection, children); end + + # source://activerecord//lib/active_record/associations/join_dependency/join_association.rb#24 + def join_constraints(foreign_table, foreign_klass, join_type, alias_tracker); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/join_dependency/join_association.rb#19 + def match?(other); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/join_dependency/join_association.rb#79 + def readonly?; end + + # Returns the value of attribute reflection. + # + # source://activerecord//lib/active_record/associations/join_dependency/join_association.rb#10 + def reflection; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/join_dependency/join_association.rb#85 + def strict_loading?; end + + # Returns the value of attribute table. + # + # source://activerecord//lib/active_record/associations/join_dependency/join_association.rb#11 + def table; end + + # Sets the attribute table + # + # @param value the value to set the attribute table to. + # + # source://activerecord//lib/active_record/associations/join_dependency/join_association.rb#11 + def table=(_arg0); end + + # Returns the value of attribute tables. + # + # source://activerecord//lib/active_record/associations/join_dependency/join_association.rb#10 + def tables; end + + private + + # source://activerecord//lib/active_record/associations/join_dependency/join_association.rb#92 + def append_constraints(join, constraints); end +end + +# source://activerecord//lib/active_record/associations/join_dependency/join_base.rb#8 +class ActiveRecord::Associations::JoinDependency::JoinBase < ::ActiveRecord::Associations::JoinDependency::JoinPart + # @return [JoinBase] a new instance of JoinBase + # + # source://activerecord//lib/active_record/associations/join_dependency/join_base.rb#11 + def initialize(base_klass, table, children); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/join_dependency/join_base.rb#16 + def match?(other); end + + # Returns the value of attribute table. + # + # source://activerecord//lib/active_record/associations/join_dependency/join_base.rb#9 + def table; end +end + +# A JoinPart represents a part of a JoinDependency. It is inherited +# by JoinBase and JoinAssociation. A JoinBase represents the Active Record which +# everything else is being joined onto. A JoinAssociation represents an association which +# is joining to the base. A JoinAssociation may result in more than one actual join +# operations (for example a has_and_belongs_to_many JoinAssociation would result in +# two; one for the join table and one for the target table). +# +# source://activerecord//lib/active_record/associations/join_dependency/join_part.rb#12 +class ActiveRecord::Associations::JoinDependency::JoinPart + include ::Enumerable + + # @return [JoinPart] a new instance of JoinPart + # + # source://activerecord//lib/active_record/associations/join_dependency/join_part.rb#22 + def initialize(base_klass, children); end + + # source://activerecord//lib/active_record/associations/join_dependency/join_part.rb#20 + def attribute_types(*_arg0, **_arg1, &_arg2); end + + # The Active Record class which this join part is associated 'about'; for a JoinBase + # this is the actual base model, for a JoinAssociation this is the target model of the + # association. + # + # source://activerecord//lib/active_record/associations/join_dependency/join_part.rb#18 + def base_klass; end + + # The Active Record class which this join part is associated 'about'; for a JoinBase + # this is the actual base model, for a JoinAssociation this is the target model of the + # association. + # + # source://activerecord//lib/active_record/associations/join_dependency/join_part.rb#18 + def children; end + + # source://activerecord//lib/active_record/associations/join_dependency/join_part.rb#20 + def column_names(*_arg0, **_arg1, &_arg2); end + + # @yield [_self] + # @yieldparam _self [ActiveRecord::Associations::JoinDependency::JoinPart] the object that the method was called on + # + # source://activerecord//lib/active_record/associations/join_dependency/join_part.rb#31 + def each(&block); end + + # source://activerecord//lib/active_record/associations/join_dependency/join_part.rb#36 + def each_children(&block); end + + # source://activerecord//lib/active_record/associations/join_dependency/join_part.rb#48 + def extract_record(row, column_names_with_alias); end + + # source://activerecord//lib/active_record/associations/join_dependency/join_part.rb#65 + def instantiate(row, aliases, column_types = T.unsafe(nil), &block); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/join_dependency/join_part.rb#27 + def match?(other); end + + # source://activerecord//lib/active_record/associations/join_dependency/join_part.rb#20 + def primary_key(*_arg0, **_arg1, &_arg2); end + + # An Arel::Table for the active_record + # + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/associations/join_dependency/join_part.rb#44 + def table; end + + # source://activerecord//lib/active_record/associations/join_dependency/join_part.rb#20 + def table_name(*_arg0, **_arg1, &_arg2); end +end + +# source://activerecord//lib/active_record/associations/nested_error.rb#7 +class ActiveRecord::Associations::NestedError < ::ActiveModel::NestedError + # @return [NestedError] a new instance of NestedError + # + # source://activerecord//lib/active_record/associations/nested_error.rb#8 + def initialize(association, inner_error); end + + private + + # Returns the value of attribute association. + # + # source://activerecord//lib/active_record/associations/nested_error.rb#16 + def association; end + + # source://activerecord//lib/active_record/associations/nested_error.rb#18 + def compute_attribute(inner_error); end + + # source://activerecord//lib/active_record/associations/nested_error.rb#33 + def index; end + + # source://activerecord//lib/active_record/associations/nested_error.rb#28 + def index_errors_setting; end + + # source://activerecord//lib/active_record/associations/nested_error.rb#37 + def ordered_records; end +end + +# = Active Record \Preloader +# +# Implements the details of eager loading of Active Record associations. +# +# Suppose that you have the following two Active Record models: +# +# class Author < ActiveRecord::Base +# # columns: name, age +# has_many :books +# end +# +# class Book < ActiveRecord::Base +# # columns: title, sales, author_id +# end +# +# When you load an author with all associated books Active Record will make +# multiple queries like this: +# +# Author.includes(:books).where(name: ['bell hooks', 'Homer']).to_a +# +# # SELECT `authors`.* FROM `authors` WHERE `name` IN ('bell hooks', 'Homer') +# # SELECT `books`.* FROM `books` WHERE `author_id` IN (2, 5) +# +# Active Record saves the ids of the records from the first query to use in +# the second. Depending on the number of associations involved there can be +# arbitrarily many SQL queries made. +# +# However, if there is a WHERE clause that spans across tables Active +# Record will fall back to a slightly more resource-intensive single query: +# +# Author.includes(:books).where(books: {title: 'Illiad'}).to_a +# # SELECT `authors`.`id` AS t0_r0, `authors`.`name` AS t0_r1, `authors`.`age` AS t0_r2, +# # `books`.`id` AS t1_r0, `books`.`title` AS t1_r1, `books`.`sales` AS t1_r2 +# # FROM `authors` +# # LEFT OUTER JOIN `books` ON `authors`.`id` = `books`.`author_id` +# # WHERE `books`.`title` = 'Illiad' +# +# This could result in many rows that contain redundant data and it performs poorly at scale +# and is therefore only used when necessary. +# +# source://activerecord//lib/active_record/associations/preloader.rb#46 +class ActiveRecord::Associations::Preloader + extend ::ActiveSupport::Autoload + + # Eager loads the named associations for the given Active Record record(s). + # + # In this description, 'association name' shall refer to the name passed + # to an association creation method. For example, a model that specifies + # belongs_to :author, has_many :buyers has association + # names +:author+ and +:buyers+. + # + # == Parameters + # +records+ is an array of ActiveRecord::Base. This array needs not be flat, + # i.e. +records+ itself may also contain arrays of records. In any case, + # +preload_associations+ will preload all associations records by + # flattening +records+. + # + # +associations+ specifies one or more associations that you want to + # preload. It may be: + # - a Symbol or a String which specifies a single association name. For + # example, specifying +:books+ allows this method to preload all books + # for an Author. + # - an Array which specifies multiple association names. This array + # is processed recursively. For example, specifying [:avatar, :books] + # allows this method to preload an author's avatar as well as all of their + # books. + # - a Hash which specifies multiple association names, as well as + # association names for the to-be-preloaded association objects. For + # example, specifying { author: :avatar } will preload a + # book's author, as well as that author's avatar. + # + # +:associations+ has the same format as the arguments to + # ActiveRecord::QueryMethods#includes. So +associations+ could look like + # this: + # + # :books + # [ :books, :author ] + # { author: :avatar } + # [ :books, { author: :avatar } ] + # + # +available_records+ is an array of ActiveRecord::Base. The Preloader + # will try to use the objects in this array to preload the requested + # associations before querying the database. This can save database + # queries by reusing in-memory objects. The optimization is only applied + # to single associations (i.e. :belongs_to, :has_one) with no scopes. + # + # @return [Preloader] a new instance of Preloader + # + # source://activerecord//lib/active_record/associations/preloader.rb#99 + def initialize(records:, associations:, scope: T.unsafe(nil), available_records: T.unsafe(nil), associate_by_default: T.unsafe(nil)); end + + # Returns the value of attribute associate_by_default. + # + # source://activerecord//lib/active_record/associations/preloader.rb#56 + def associate_by_default; end + + # Returns the value of attribute associations. + # + # source://activerecord//lib/active_record/associations/preloader.rb#56 + def associations; end + + # source://activerecord//lib/active_record/associations/preloader.rb#126 + def branches; end + + # source://activerecord//lib/active_record/associations/preloader.rb#120 + def call; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/preloader.rb#116 + def empty?; end + + # source://activerecord//lib/active_record/associations/preloader.rb#130 + def loaders; end + + # Returns the value of attribute records. + # + # source://activerecord//lib/active_record/associations/preloader.rb#56 + def records; end + + # Returns the value of attribute scope. + # + # source://activerecord//lib/active_record/associations/preloader.rb#56 + def scope; end +end + +# source://activerecord//lib/active_record/associations/preloader/association.rb#8 +class ActiveRecord::Associations::Preloader::Association + # @return [Association] a new instance of Association + # + # source://activerecord//lib/active_record/associations/preloader/association.rb#104 + def initialize(klass, owners, reflection, preload_scope, reflection_scope, associate_by_default); end + + # source://activerecord//lib/active_record/associations/preloader/association.rb#218 + def associate_records_from_unscoped(unscoped_records); end + + # The name of the key on the associated records + # + # source://activerecord//lib/active_record/associations/preloader/association.rb#161 + def association_key_name; end + + # source://activerecord//lib/active_record/associations/preloader/association.rb#119 + def future_classes; end + + # Returns the value of attribute klass. + # + # source://activerecord//lib/active_record/associations/preloader/association.rb#102 + def klass; end + + # source://activerecord//lib/active_record/associations/preloader/association.rb#197 + def load_records(raw_records = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/preloader/association.rb#176 + def loaded?(owner); end + + # source://activerecord//lib/active_record/associations/preloader/association.rb#165 + def loader_query; end + + # source://activerecord//lib/active_record/associations/preloader/association.rb#169 + def owners_by_key; end + + # source://activerecord//lib/active_record/associations/preloader/association.rb#154 + def preloaded_records; end + + # source://activerecord//lib/active_record/associations/preloader/association.rb#148 + def records_by_owner; end + + # source://activerecord//lib/active_record/associations/preloader/association.rb#135 + def run; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/preloader/association.rb#131 + def run?; end + + # source://activerecord//lib/active_record/associations/preloader/association.rb#127 + def runnable_loaders; end + + # source://activerecord//lib/active_record/associations/preloader/association.rb#184 + def scope; end + + # source://activerecord//lib/active_record/associations/preloader/association.rb#188 + def set_inverse(record); end + + # source://activerecord//lib/active_record/associations/preloader/association.rb#115 + def table_name; end + + # source://activerecord//lib/active_record/associations/preloader/association.rb#180 + def target_for(owner); end + + private + + # source://activerecord//lib/active_record/associations/preloader/association.rb#245 + def associate_records_to_owner(owner, records); end + + # source://activerecord//lib/active_record/associations/preloader/association.rb#282 + def association_key_type; end + + # source://activerecord//lib/active_record/associations/preloader/association.rb#294 + def build_scope; end + + # source://activerecord//lib/active_record/associations/preloader/association.rb#310 + def cascade_strict_loading(scope); end + + # source://activerecord//lib/active_record/associations/preloader/association.rb#274 + def convert_key(key); end + + # source://activerecord//lib/active_record/associations/preloader/association.rb#266 + def derive_key(owner, key); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/preloader/association.rb#258 + def key_conversion_required?; end + + # Returns the value of attribute model. + # + # source://activerecord//lib/active_record/associations/preloader/association.rb#238 + def model; end + + # The name of the key on the model which declares the association + # + # source://activerecord//lib/active_record/associations/preloader/association.rb#241 + def owner_key_name; end + + # source://activerecord//lib/active_record/associations/preloader/association.rb#286 + def owner_key_type; end + + # Returns the value of attribute owners. + # + # source://activerecord//lib/active_record/associations/preloader/association.rb#238 + def owners; end + + # Returns the value of attribute preload_scope. + # + # source://activerecord//lib/active_record/associations/preloader/association.rb#238 + def preload_scope; end + + # Returns the value of attribute reflection. + # + # source://activerecord//lib/active_record/associations/preloader/association.rb#238 + def reflection; end + + # source://activerecord//lib/active_record/associations/preloader/association.rb#290 + def reflection_scope; end +end + +# source://activerecord//lib/active_record/associations/preloader/association.rb#9 +class ActiveRecord::Associations::Preloader::Association::LoaderQuery + # @return [LoaderQuery] a new instance of LoaderQuery + # + # source://activerecord//lib/active_record/associations/preloader/association.rb#12 + def initialize(scope, association_key_name); end + + # Returns the value of attribute association_key_name. + # + # source://activerecord//lib/active_record/associations/preloader/association.rb#10 + def association_key_name; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/preloader/association.rb#17 + def eql?(other); end + + # source://activerecord//lib/active_record/associations/preloader/association.rb#24 + def hash; end + + # source://activerecord//lib/active_record/associations/preloader/association.rb#41 + def load_records_for_keys(keys, &block); end + + # source://activerecord//lib/active_record/associations/preloader/association.rb#32 + def load_records_in_batch(loaders); end + + # source://activerecord//lib/active_record/associations/preloader/association.rb#28 + def records_for(loaders); end + + # Returns the value of attribute scope. + # + # source://activerecord//lib/active_record/associations/preloader/association.rb#10 + def scope; end +end + +# source://activerecord//lib/active_record/associations/preloader/association.rb#60 +class ActiveRecord::Associations::Preloader::Association::LoaderRecords + # @return [LoaderRecords] a new instance of LoaderRecords + # + # source://activerecord//lib/active_record/associations/preloader/association.rb#61 + def initialize(loaders, loader_query); end + + # source://activerecord//lib/active_record/associations/preloader/association.rb#70 + def records; end + + private + + # source://activerecord//lib/active_record/associations/preloader/association.rb#97 + def already_loaded_records; end + + # Returns the value of attribute already_loaded_records_by_key. + # + # source://activerecord//lib/active_record/associations/preloader/association.rb#75 + def already_loaded_records_by_key; end + + # Returns the value of attribute keys_to_load. + # + # source://activerecord//lib/active_record/associations/preloader/association.rb#75 + def keys_to_load; end + + # source://activerecord//lib/active_record/associations/preloader/association.rb#91 + def load_records; end + + # Returns the value of attribute loader_query. + # + # source://activerecord//lib/active_record/associations/preloader/association.rb#75 + def loader_query; end + + # Returns the value of attribute loaders. + # + # source://activerecord//lib/active_record/associations/preloader/association.rb#75 + def loaders; end + + # source://activerecord//lib/active_record/associations/preloader/association.rb#77 + def populate_keys_to_load_and_already_loaded_records; end +end + +# source://activerecord//lib/active_record/associations/preloader/batch.rb#6 +class ActiveRecord::Associations::Preloader::Batch + # @return [Batch] a new instance of Batch + # + # source://activerecord//lib/active_record/associations/preloader/batch.rb#7 + def initialize(preloaders, available_records:); end + + # source://activerecord//lib/active_record/associations/preloader/batch.rb#12 + def call; end + + private + + # source://activerecord//lib/active_record/associations/preloader/batch.rb#40 + def group_and_load_similar(loaders); end + + # Returns the value of attribute loaders. + # + # source://activerecord//lib/active_record/associations/preloader/batch.rb#38 + def loaders; end +end + +# source://activerecord//lib/active_record/associations/preloader/branch.rb#6 +class ActiveRecord::Associations::Preloader::Branch + # @return [Branch] a new instance of Branch + # + # source://activerecord//lib/active_record/associations/preloader/branch.rb#11 + def initialize(association:, children:, parent:, associate_by_default:, scope:); end + + # Returns the value of attribute associate_by_default. + # + # source://activerecord//lib/active_record/associations/preloader/branch.rb#8 + def associate_by_default; end + + # Returns the value of attribute association. + # + # source://activerecord//lib/active_record/associations/preloader/branch.rb#7 + def association; end + + # Returns the value of attribute children. + # + # source://activerecord//lib/active_record/associations/preloader/branch.rb#7 + def children; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/preloader/branch.rb#72 + def done?; end + + # source://activerecord//lib/active_record/associations/preloader/branch.rb#27 + def future_classes; end + + # source://activerecord//lib/active_record/associations/preloader/branch.rb#80 + def grouped_records; end + + # source://activerecord//lib/active_record/associations/preloader/branch.rb#31 + def immediate_future_classes; end + + # source://activerecord//lib/active_record/associations/preloader/branch.rb#53 + def likely_reflections; end + + # source://activerecord//lib/active_record/associations/preloader/branch.rb#118 + def loaders; end + + # Returns the value of attribute parent. + # + # source://activerecord//lib/active_record/associations/preloader/branch.rb#7 + def parent; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/preloader/branch.rb#108 + def polymorphic?; end + + # source://activerecord//lib/active_record/associations/preloader/branch.rb#68 + def preloaded_records; end + + # Sets the attribute preloaded_records + # + # @param value the value to set the attribute preloaded_records to. + # + # source://activerecord//lib/active_record/associations/preloader/branch.rb#9 + def preloaded_records=(_arg0); end + + # source://activerecord//lib/active_record/associations/preloader/branch.rb#91 + def preloaders_for_reflection(reflection, reflection_records); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/preloader/branch.rb#60 + def root?; end + + # source://activerecord//lib/active_record/associations/preloader/branch.rb#76 + def runnable_loaders; end + + # Returns the value of attribute scope. + # + # source://activerecord//lib/active_record/associations/preloader/branch.rb#8 + def scope; end + + # source://activerecord//lib/active_record/associations/preloader/branch.rb#64 + def source_records; end + + # source://activerecord//lib/active_record/associations/preloader/branch.rb#43 + def target_classes; end + + private + + # source://activerecord//lib/active_record/associations/preloader/branch.rb#127 + def build_children(children); end + + # Returns a class containing the logic needed to load preload the data + # and attach it to a relation. The class returned implements a `run` method + # that accepts a preloader. + # + # source://activerecord//lib/active_record/associations/preloader/branch.rb#144 + def preloader_for(reflection); end +end + +# source://activerecord//lib/active_record/associations/preloader/through_association.rb#6 +class ActiveRecord::Associations::Preloader::ThroughAssociation < ::ActiveRecord::Associations::Preloader::Association + # source://activerecord//lib/active_record/associations/preloader/through_association.rb#49 + def future_classes; end + + # source://activerecord//lib/active_record/associations/preloader/through_association.rb#7 + def preloaded_records; end + + # source://activerecord//lib/active_record/associations/preloader/through_association.rb#11 + def records_by_owner; end + + # source://activerecord//lib/active_record/associations/preloader/through_association.rb#39 + def runnable_loaders; end + + private + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/preloader/through_association.rb#65 + def data_available?; end + + # source://activerecord//lib/active_record/associations/preloader/through_association.rb#74 + def middle_records; end + + # source://activerecord//lib/active_record/associations/preloader/through_association.rb#98 + def preload_index; end + + # source://activerecord//lib/active_record/associations/preloader/through_association.rb#70 + def source_preloaders; end + + # source://activerecord//lib/active_record/associations/preloader/through_association.rb#90 + def source_records_by_owner; end + + # source://activerecord//lib/active_record/associations/preloader/through_association.rb#86 + def source_reflection; end + + # source://activerecord//lib/active_record/associations/preloader/through_association.rb#78 + def through_preloaders; end + + # source://activerecord//lib/active_record/associations/preloader/through_association.rb#94 + def through_records_by_owner; end + + # source://activerecord//lib/active_record/associations/preloader/through_association.rb#82 + def through_reflection; end + + # source://activerecord//lib/active_record/associations/preloader/through_association.rb#104 + def through_scope; end +end + +# source://activerecord//lib/active_record/associations/singular_association.rb#6 +class ActiveRecord::Associations::SingularAssociation < ::ActiveRecord::Associations::Association + # source://activerecord//lib/active_record/associations/singular_association.rb#29 + def build(attributes = T.unsafe(nil), &block); end + + # Implements the reload reader method, e.g. foo.reload_bar for + # Foo.has_one :bar + # + # source://activerecord//lib/active_record/associations/singular_association.rb#37 + def force_reload_reader; end + + # Implements the reader method, e.g. foo.bar for Foo.has_one :bar + # + # source://activerecord//lib/active_record/associations/singular_association.rb#7 + def reader; end + + # Resets the \loaded flag to +false+ and sets the \target to +nil+. + # + # source://activerecord//lib/active_record/associations/singular_association.rb#18 + def reset; end + + # Implements the writer method, e.g. foo.bar= for Foo.belongs_to :bar + # + # source://activerecord//lib/active_record/associations/singular_association.rb#25 + def writer(record); end + + private + + # @raise [RecordInvalid] + # + # source://activerecord//lib/active_record/associations/singular_association.rb#67 + def _create_record(attributes, raise_error = T.unsafe(nil), &block); end + + # source://activerecord//lib/active_record/associations/singular_association.rb#47 + def find_target(async: T.unsafe(nil)); end + + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/associations/singular_association.rb#59 + def replace(record); end + + # source://activerecord//lib/active_record/associations/singular_association.rb#43 + def scope_for_create; end + + # source://activerecord//lib/active_record/associations/singular_association.rb#63 + def set_new_record(record); end +end + +# = Active Record Through Association +# +# source://activerecord//lib/active_record/associations/through_association.rb#6 +module ActiveRecord::Associations::ThroughAssociation + # source://activerecord//lib/active_record/associations/through_association.rb#7 + def source_reflection(*_arg0, **_arg1, &_arg2); end + + private + + # source://activerecord//lib/active_record/associations/through_association.rb#116 + def build_record(attributes); end + + # Construct attributes for :through pointing to owner and associate. This is used by the + # methods which create and delete records on the association. + # + # We only support indirectly modifying through associations which have a belongs_to source. + # This is the "has_many :tags, through: :taggings" situation, where the join model + # typically has a belongs_to on both side. In other words, associations which could also + # be represented as has_and_belongs_to_many associations. + # + # We do not support creating/deleting records on the association where the source has + # some other type, because this opens up a whole can of worms, and in basically any + # situation it is more natural for the user to just create or modify their join records + # directly as required. + # + # source://activerecord//lib/active_record/associations/through_association.rb#57 + def construct_join_attributes(*records); end + + # source://activerecord//lib/active_record/associations/through_association.rb#96 + def ensure_mutable; end + + # source://activerecord//lib/active_record/associations/through_association.rb#106 + def ensure_not_nested; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/associations/through_association.rb#90 + def foreign_key_present?; end + + # Note: this does not capture all cases, for example it would be impractical + # to try to properly support stale-checking for nested associations. + # + # source://activerecord//lib/active_record/associations/through_association.rb#82 + def stale_state; end + + # We merge in these scopes for two reasons: + # + # 1. To get the default_scope conditions for any of the other reflections in the chain + # 2. To get the type conditions for any STI models in the chain + # + # source://activerecord//lib/active_record/associations/through_association.rb#34 + def target_scope; end + + # source://activerecord//lib/active_record/associations/through_association.rb#26 + def through_association; end + + # source://activerecord//lib/active_record/associations/through_association.rb#14 + def through_reflection; end + + # source://activerecord//lib/active_record/associations/through_association.rb#10 + def transaction(&block); end +end + +# source://activerecord//lib/active_record/asynchronous_queries_tracker.rb#7 +class ActiveRecord::AsynchronousQueriesTracker + # @return [AsynchronousQueriesTracker] a new instance of AsynchronousQueriesTracker + # + # source://activerecord//lib/active_record/asynchronous_queries_tracker.rb#45 + def initialize; end + + # source://activerecord//lib/active_record/asynchronous_queries_tracker.rb#49 + def current_session; end + + # source://activerecord//lib/active_record/asynchronous_queries_tracker.rb#58 + def finalize_session(wait = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/asynchronous_queries_tracker.rb#53 + def start_session; end + + class << self + # source://activerecord//lib/active_record/asynchronous_queries_tracker.rb#40 + def complete(asynchronous_queries_tracker); end + + # source://activerecord//lib/active_record/asynchronous_queries_tracker.rb#32 + def install_executor_hooks(executor = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/asynchronous_queries_tracker.rb#36 + def run; end + end +end + +# source://activerecord//lib/active_record/asynchronous_queries_tracker.rb#8 +class ActiveRecord::AsynchronousQueriesTracker::Session + # @return [Session] a new instance of Session + # + # source://activerecord//lib/active_record/asynchronous_queries_tracker.rb#9 + def initialize; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/asynchronous_queries_tracker.rb#14 + def active?; end + + # source://activerecord//lib/active_record/asynchronous_queries_tracker.rb#22 + def finalize(wait = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/asynchronous_queries_tracker.rb#18 + def synchronize(&block); end +end + +# AsynchronousQueryInsideTransactionError will be raised when attempting +# to perform an asynchronous query from inside a transaction +# +# source://activerecord//lib/active_record/errors.rb#544 +class ActiveRecord::AsynchronousQueryInsideTransactionError < ::ActiveRecord::ActiveRecordError; end + +# source://activerecord//lib/active_record/attribute_assignment.rb#4 +module ActiveRecord::AttributeAssignment + private + + # source://activerecord//lib/active_record/attribute_assignment.rb#6 + def _assign_attributes(attributes); end + + # Instantiates objects for all attribute classes that needs more than one constructor parameter. This is done + # by calling new on the column type or aggregation type (through composed_of) object with these parameters. + # So having the pairs written_on(1) = "2004", written_on(2) = "6", written_on(3) = "24", will instantiate + # written_on (a date type) with Date.new("2004", "6", "24"). You can also specify a typecast character in the + # parentheses to have the parameters typecasted before they're used in the constructor. Use i for Integer and + # f for Float. If all the values for a given attribute are empty, the attribute will be set to +nil+. + # + # source://activerecord//lib/active_record/attribute_assignment.rb#36 + def assign_multiparameter_attributes(pairs); end + + # Assign any deferred nested attributes after the base attributes have been set. + # + # source://activerecord//lib/active_record/attribute_assignment.rb#26 + def assign_nested_parameter_attributes(pairs); end + + # source://activerecord//lib/active_record/attribute_assignment.rb#42 + def execute_callstack_for_multiparameter_attributes(callstack); end + + # source://activerecord//lib/active_record/attribute_assignment.rb#60 + def extract_callstack_for_multiparameter_attributes(pairs); end + + # source://activerecord//lib/active_record/attribute_assignment.rb#78 + def find_parameter_position(multiparameter_name); end + + # source://activerecord//lib/active_record/attribute_assignment.rb#74 + def type_cast_attribute_value(multiparameter_name, value); end +end + +# Raised when an error occurred while doing a mass assignment to an attribute through the +# {ActiveRecord::Base#attributes=}[rdoc-ref:ActiveModel::AttributeAssignment#attributes=] method. +# The exception has an +attribute+ property that is the name of the offending attribute. +# +# source://activerecord//lib/active_record/errors.rb#456 +class ActiveRecord::AttributeAssignmentError < ::ActiveRecord::ActiveRecordError + # @return [AttributeAssignmentError] a new instance of AttributeAssignmentError + # + # source://activerecord//lib/active_record/errors.rb#459 + def initialize(message = T.unsafe(nil), exception = T.unsafe(nil), attribute = T.unsafe(nil)); end + + # Returns the value of attribute attribute. + # + # source://activerecord//lib/active_record/errors.rb#457 + def attribute; end + + # Returns the value of attribute exception. + # + # source://activerecord//lib/active_record/errors.rb#457 + def exception; end +end + +# = Active Record Attribute Methods +# +# source://activerecord//lib/active_record/attribute_methods.rb#7 +module ActiveRecord::AttributeMethods + extend ::ActiveSupport::Concern + extend ::ActiveSupport::Autoload + include GeneratedInstanceMethods + include ::ActiveModel::AttributeMethods + include ::ActiveRecord::AttributeMethods::Read + include ::ActiveRecord::AttributeMethods::Write + include ::ActiveRecord::AttributeMethods::BeforeTypeCast + include ::ActiveRecord::AttributeMethods::Query + include ::ActiveRecord::AttributeMethods::PrimaryKey + include ::ActiveRecord::AttributeMethods::TimeZoneConversion + include ::ActiveModel::Dirty + include ::ActiveRecord::AttributeMethods::Dirty + include ::ActiveRecord::AttributeMethods::Serialization + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveModel::AttributeMethods::ClassMethods + mixes_in_class_methods ::ActiveRecord::AttributeMethods::ClassMethods + mixes_in_class_methods ::ActiveRecord::AttributeMethods::Read::ClassMethods + mixes_in_class_methods ::ActiveRecord::AttributeMethods::Write::ClassMethods + mixes_in_class_methods ::ActiveRecord::AttributeMethods::PrimaryKey::ClassMethods + mixes_in_class_methods ::ActiveRecord::AttributeMethods::TimeZoneConversion::ClassMethods + mixes_in_class_methods ::ActiveRecord::AttributeMethods::Serialization::ClassMethods + + # Returns the value of the attribute identified by +attr_name+ after it has + # been type cast. (For information about specific type casting behavior, see + # the types under ActiveModel::Type.) + # + # class Person < ActiveRecord::Base + # belongs_to :organization + # end + # + # person = Person.new(name: "Francesco", date_of_birth: "2004-12-12") + # person[:name] # => "Francesco" + # person[:date_of_birth] # => Date.new(2004, 12, 12) + # person[:organization_id] # => nil + # + # Raises ActiveModel::MissingAttributeError if the attribute is missing. + # Note, however, that the +id+ attribute will never be considered missing. + # + # person = Person.select(:name).first + # person[:name] # => "Francesco" + # person[:date_of_birth] # => ActiveModel::MissingAttributeError: missing attribute 'date_of_birth' for Person + # person[:organization_id] # => ActiveModel::MissingAttributeError: missing attribute 'organization_id' for Person + # person[:id] # => nil + # + # source://activerecord//lib/active_record/attribute_methods.rb#415 + def [](attr_name); end + + # Updates the attribute identified by +attr_name+ using the specified + # +value+. The attribute value will be type cast upon being read. + # + # class Person < ActiveRecord::Base + # end + # + # person = Person.new + # person[:date_of_birth] = "2004-12-12" + # person[:date_of_birth] # => Date.new(2004, 12, 12) + # + # source://activerecord//lib/active_record/attribute_methods.rb#428 + def []=(attr_name, value); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/attribute_methods.rb#322 + def _has_attribute?(attr_name); end + + # Returns the name of all database fields which have been read from this + # model. This can be useful in development mode to determine which fields + # need to be selected. For performance critical pages, selecting only the + # required fields can be an easy performance win (assuming you aren't using + # all of the fields on the model). + # + # For example: + # + # class PostsController < ActionController::Base + # after_action :print_accessed_fields, only: :index + # + # def index + # @posts = Post.all + # end + # + # private + # def print_accessed_fields + # p @posts.first.accessed_fields + # end + # end + # + # Which allows you to quickly change your code to: + # + # class PostsController < ActionController::Base + # def index + # @posts = Post.select(:id, :title, :author_id, :updated_at) + # end + # end + # + # source://activerecord//lib/active_record/attribute_methods.rb#460 + def accessed_fields; end + + # Returns an #inspect-like string for the value of the + # attribute +attr_name+. String attributes are truncated up to 50 + # characters. Other attributes return the value of #inspect + # without modification. + # + # person = Person.create!(name: 'David Heinemeier Hansson ' * 3) + # + # person.attribute_for_inspect(:name) + # # => "\"David Heinemeier Hansson David Heinemeier Hansson ...\"" + # + # person.attribute_for_inspect(:created_at) + # # => "\"2012-10-22 00:15:07.000000000 +0000\"" + # + # person.attribute_for_inspect(:tag_ids) + # # => "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]" + # + # source://activerecord//lib/active_record/attribute_methods.rb#365 + def attribute_for_inspect(attr_name); end + + # Returns an array of names for the attributes available on this object. + # + # class Person < ActiveRecord::Base + # end + # + # person = Person.new + # person.attribute_names + # # => ["id", "created_at", "updated_at", "name", "age"] + # + # source://activerecord//lib/active_record/attribute_methods.rb#334 + def attribute_names; end + + # Returns +true+ if the specified +attribute+ has been set by the user or by a + # database load and is neither +nil+ nor empty? (the latter only applies + # to objects that respond to empty?, most notably Strings). Otherwise, +false+. + # Note that it always returns +true+ with boolean attributes. + # + # class Task < ActiveRecord::Base + # end + # + # task = Task.new(title: '', is_done: false) + # task.attribute_present?(:title) # => false + # task.attribute_present?(:is_done) # => true + # task.title = 'Buy milk' + # task.is_done = true + # task.attribute_present?(:title) # => true + # task.attribute_present?(:is_done) # => true + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/attribute_methods.rb#387 + def attribute_present?(attr_name); end + + # Returns a hash of all the attributes with their names as keys and the values of the attributes as values. + # + # class Person < ActiveRecord::Base + # end + # + # person = Person.create(name: 'Francesco', age: 22) + # person.attributes + # # => {"id"=>3, "created_at"=>Sun, 21 Oct 2012 04:53:04, "updated_at"=>Sun, 21 Oct 2012 04:53:04, "name"=>"Francesco", "age"=>22} + # + # source://activerecord//lib/active_record/attribute_methods.rb#346 + def attributes; end + + # Returns +true+ if the given attribute is in the attributes hash, otherwise +false+. + # + # class Person < ActiveRecord::Base + # alias_attribute :new_name, :name + # end + # + # person = Person.new + # person.has_attribute?(:name) # => true + # person.has_attribute?(:new_name) # => true + # person.has_attribute?('age') # => true + # person.has_attribute?(:nothing) # => false + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/attribute_methods.rb#316 + def has_attribute?(attr_name); end + + # A Person object with a name attribute can ask person.respond_to?(:name), + # person.respond_to?(:name=), and person.respond_to?(:name?) + # which will all return +true+. It also defines the attribute methods if they have + # not been generated. + # + # class Person < ActiveRecord::Base + # end + # + # person = Person.new + # person.respond_to?(:name) # => true + # person.respond_to?(:name=) # => true + # person.respond_to?(:name?) # => true + # person.respond_to?('age') # => true + # person.respond_to?('age=') # => true + # person.respond_to?('age?') # => true + # person.respond_to?(:nothing) # => false + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/attribute_methods.rb#291 + def respond_to?(name, include_private = T.unsafe(nil)); end + + private + + # @return [Boolean] + # + # source://activerecord//lib/active_record/attribute_methods.rb#499 + def attribute_method?(attr_name); end + + # Filters out the virtual columns and also primary keys, from the attribute names, when the primary + # key is to be generated (e.g. the id attribute has no value). + # + # source://activerecord//lib/active_record/attribute_methods.rb#519 + def attributes_for_create(attribute_names); end + + # Filters the primary keys, readonly attributes and virtual columns from the attribute names. + # + # source://activerecord//lib/active_record/attribute_methods.rb#508 + def attributes_for_update(attribute_names); end + + # source://activerecord//lib/active_record/attribute_methods.rb#503 + def attributes_with_values(attribute_names); end + + # source://activerecord//lib/active_record/attribute_methods.rb#527 + def format_for_inspect(name, value); end + + # source://activerecord//lib/active_record/attribute_methods.rb#475 + def method_missing(name, *_arg1, **_arg2, &_arg3); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/attribute_methods.rb#543 + def pk_attribute?(name); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/attribute_methods.rb#465 + def respond_to_missing?(name, include_private = T.unsafe(nil)); end + + class << self + # source://activerecord//lib/active_record/attribute_methods.rb#30 + def dangerous_attribute_methods; end + end + + module GeneratedClassMethods + def attribute_aliases; end + def attribute_aliases=(value); end + def attribute_aliases?; end + def attribute_method_patterns; end + def attribute_method_patterns=(value); end + def attribute_method_patterns?; end + def default_column_serializer; end + def default_column_serializer=(value); end + def default_column_serializer?; end + def partial_inserts; end + def partial_inserts=(value); end + def partial_inserts?; end + def partial_updates; end + def partial_updates=(value); end + def partial_updates?; end + def skip_time_zone_conversion_for_attributes; end + def skip_time_zone_conversion_for_attributes=(value); end + def skip_time_zone_conversion_for_attributes?; end + def time_zone_aware_attributes; end + def time_zone_aware_attributes=(value); end + def time_zone_aware_attributes?; end + def time_zone_aware_types; end + def time_zone_aware_types=(value); end + def time_zone_aware_types?; end + end + + module GeneratedInstanceMethods + def attribute_aliases; end + def attribute_aliases?; end + def attribute_method_patterns; end + def attribute_method_patterns?; end + def partial_inserts; end + def partial_inserts?; end + def partial_updates; end + def partial_updates?; end + def skip_time_zone_conversion_for_attributes; end + def skip_time_zone_conversion_for_attributes?; end + def time_zone_aware_attributes; end + def time_zone_aware_attributes?; end + def time_zone_aware_types; end + def time_zone_aware_types?; end + end +end + +# = Active Record Attribute Methods Before Type Cast +# +# ActiveRecord::AttributeMethods::BeforeTypeCast provides a way to +# read the value of the attributes before typecasting and deserialization. +# +# class Task < ActiveRecord::Base +# end +# +# task = Task.new(id: '1', completed_on: '2012-10-21') +# task.id # => 1 +# task.completed_on # => Sun, 21 Oct 2012 +# +# task.attributes_before_type_cast +# # => {"id"=>"1", "completed_on"=>"2012-10-21", ... } +# task.read_attribute_before_type_cast('id') # => "1" +# task.read_attribute_before_type_cast('completed_on') # => "2012-10-21" +# +# In addition to #read_attribute_before_type_cast and #attributes_before_type_cast, +# it declares a method for all attributes with the *_before_type_cast +# suffix. +# +# task.id_before_type_cast # => "1" +# task.completed_on_before_type_cast # => "2012-10-21" +# +# source://activerecord//lib/active_record/attribute_methods/before_type_cast.rb#28 +module ActiveRecord::AttributeMethods::BeforeTypeCast + extend ::ActiveSupport::Concern + + # Returns a hash of attributes before typecasting and deserialization. + # + # class Task < ActiveRecord::Base + # end + # + # task = Task.new(title: nil, is_done: true, completed_on: '2012-10-21') + # task.attributes + # # => {"id"=>nil, "title"=>nil, "is_done"=>true, "completed_on"=>Sun, 21 Oct 2012, "created_at"=>nil, "updated_at"=>nil} + # task.attributes_before_type_cast + # # => {"id"=>nil, "title"=>nil, "is_done"=>true, "completed_on"=>"2012-10-21", "created_at"=>nil, "updated_at"=>nil} + # + # source://activerecord//lib/active_record/attribute_methods/before_type_cast.rb#82 + def attributes_before_type_cast; end + + # Returns a hash of attributes for assignment to the database. + # + # source://activerecord//lib/active_record/attribute_methods/before_type_cast.rb#87 + def attributes_for_database; end + + # Returns the value of the attribute identified by +attr_name+ before + # typecasting and deserialization. + # + # class Task < ActiveRecord::Base + # end + # + # task = Task.new(id: '1', completed_on: '2012-10-21') + # task.read_attribute('id') # => 1 + # task.read_attribute_before_type_cast('id') # => '1' + # task.read_attribute('completed_on') # => Sun, 21 Oct 2012 + # task.read_attribute_before_type_cast('completed_on') # => "2012-10-21" + # task.read_attribute_before_type_cast(:completed_on) # => "2012-10-21" + # + # source://activerecord//lib/active_record/attribute_methods/before_type_cast.rb#48 + def read_attribute_before_type_cast(attr_name); end + + # Returns the value of the attribute identified by +attr_name+ after + # serialization. + # + # class Book < ActiveRecord::Base + # enum :status, { draft: 1, published: 2 } + # end + # + # book = Book.new(status: "published") + # book.read_attribute(:status) # => "published" + # book.read_attribute_for_database(:status) # => 2 + # + # source://activerecord//lib/active_record/attribute_methods/before_type_cast.rb#65 + def read_attribute_for_database(attr_name); end + + private + + # Dispatch target for *_before_type_cast attribute methods. + # + # source://activerecord//lib/active_record/attribute_methods/before_type_cast.rb#93 + def attribute_before_type_cast(attr_name); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/attribute_methods/before_type_cast.rb#101 + def attribute_came_from_user?(attr_name); end + + # source://activerecord//lib/active_record/attribute_methods/before_type_cast.rb#97 + def attribute_for_database(attr_name); end +end + +# source://activerecord//lib/active_record/attribute_methods.rb#41 +module ActiveRecord::AttributeMethods::ClassMethods + # @return [Boolean] + # + # source://activerecord//lib/active_record/attribute_methods.rb#260 + def _has_attribute?(attr_name); end + + # Allows you to make aliases for attributes. + # + # class Person < ActiveRecord::Base + # alias_attribute :nickname, :name + # end + # + # person = Person.create(name: 'Bob') + # person.name # => "Bob" + # person.nickname # => "Bob" + # + # The alias can also be used for querying: + # + # Person.where(nickname: "Bob") + # # SELECT "people".* FROM "people" WHERE "people"."name" = "Bob" + # + # source://activerecord//lib/active_record/attribute_methods.rb#66 + def alias_attribute(new_name, old_name); end + + # source://activerecord//lib/active_record/attribute_methods.rb#87 + def alias_attribute_method_definition(code_generator, pattern, new_name, old_name); end + + # Returns +true+ if +attribute+ is an attribute method and table exists, + # +false+ otherwise. + # + # class Person < ActiveRecord::Base + # end + # + # Person.attribute_method?('name') # => true + # Person.attribute_method?(:age=) # => true + # Person.attribute_method?(:nothing) # => false + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/attribute_methods.rb#224 + def attribute_method?(attribute); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/attribute_methods.rb#98 + def attribute_methods_generated?; end + + # Returns an array of column names as strings if it's not an abstract class and + # table exists. Otherwise it returns an empty array. + # + # class Person < ActiveRecord::Base + # end + # + # Person.attribute_names + # # => ["id", "created_at", "updated_at", "name", "age"] + # + # source://activerecord//lib/active_record/attribute_methods.rb#236 + def attribute_names; end + + # A method name is 'dangerous' if it is already (re)defined by Active Record, but + # not by any ancestors. (So 'puts' is not dangerous but 'save' is.) + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/attribute_methods.rb#183 + def dangerous_attribute_method?(name); end + + # A class method is 'dangerous' if it is already (re)defined by Active Record, but + # not by any ancestors. (So 'puts' is not dangerous but 'new' is.) + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/attribute_methods.rb#201 + def dangerous_class_method?(method_name); end + + # Generates all the attribute related methods for columns in the database + # accessors, mutators and query methods. + # + # source://activerecord//lib/active_record/attribute_methods.rb#104 + def define_attribute_methods; end + + # source://activerecord//lib/active_record/attribute_methods.rb#76 + def eagerly_generate_alias_attribute_methods(_new_name, _old_name); end + + # source://activerecord//lib/active_record/attribute_methods.rb#80 + def generate_alias_attribute_methods(code_generator, new_name, old_name); end + + # source://activerecord//lib/active_record/attribute_methods.rb#127 + def generate_alias_attributes; end + + # Returns true if the given attribute exists, otherwise false. + # + # class Person < ActiveRecord::Base + # alias_attribute :new_name, :name + # end + # + # Person.has_attribute?('name') # => true + # Person.has_attribute?('new_name') # => true + # Person.has_attribute?(:age) # => true + # Person.has_attribute?(:nothing) # => false + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/attribute_methods.rb#254 + def has_attribute?(attr_name); end + + # source://activerecord//lib/active_record/attribute_methods.rb#42 + def initialize_generated_modules; end + + # Raises an ActiveRecord::DangerousAttributeError exception when an + # \Active \Record method is defined in the model, otherwise +false+. + # + # class Person < ActiveRecord::Base + # def save + # 'already defined by Active Record' + # end + # end + # + # Person.instance_method_already_implemented?(:save) + # # => ActiveRecord::DangerousAttributeError: save is defined by Active Record. Check to make sure that you don't have an attribute or method with the same name. + # + # Person.instance_method_already_implemented?(:name) + # # => false + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/attribute_methods.rb#165 + def instance_method_already_implemented?(method_name); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/attribute_methods.rb#187 + def method_defined_within?(name, klass, superklass = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/attribute_methods.rb#143 + def undefine_attribute_methods; end + + private + + # source://activerecord//lib/active_record/attribute_methods.rb#265 + def inherited(child_class); end +end + +# source://activerecord//lib/active_record/attribute_methods/composite_primary_key.rb#5 +module ActiveRecord::AttributeMethods::CompositePrimaryKey + # Returns the primary key column's value. If the primary key is composite, + # returns an array of the primary key column values. + # + # source://activerecord//lib/active_record/attribute_methods/composite_primary_key.rb#8 + def id; end + + # Sets the primary key column's value. If the primary key is composite, + # raises TypeError when the set value not enumerable. + # + # source://activerecord//lib/active_record/attribute_methods/composite_primary_key.rb#26 + def id=(value); end + + # Queries the primary key column's value. If the primary key is composite, + # all primary key column values must be queryable. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/attribute_methods/composite_primary_key.rb#37 + def id?; end + + # Returns the primary key column's value before type cast. If the primary key is composite, + # returns an array of primary key column values before type cast. + # + # source://activerecord//lib/active_record/attribute_methods/composite_primary_key.rb#47 + def id_before_type_cast; end + + # source://activerecord//lib/active_record/attribute_methods/composite_primary_key.rb#75 + def id_for_database; end + + # Returns the primary key column's value from the database. If the primary key is composite, + # returns an array of primary key column values from database. + # + # source://activerecord//lib/active_record/attribute_methods/composite_primary_key.rb#67 + def id_in_database; end + + # Returns the primary key column's previous value. If the primary key is composite, + # returns an array of primary key column previous values. + # + # source://activerecord//lib/active_record/attribute_methods/composite_primary_key.rb#57 + def id_was; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/attribute_methods/composite_primary_key.rb#16 + def primary_key_values_present?; end +end + +# = Active Record Attribute Methods \Dirty +# +# Provides a way to track changes in your Active Record models. It adds all +# methods from ActiveModel::Dirty and adds database-specific methods. +# +# A newly created +Person+ object is unchanged: +# +# class Person < ActiveRecord::Base +# end +# +# person = Person.create(name: "Allison") +# person.changed? # => false +# +# Change the name: +# +# person.name = 'Alice' +# person.name_in_database # => "Allison" +# person.will_save_change_to_name? # => true +# person.name_change_to_be_saved # => ["Allison", "Alice"] +# person.changes_to_save # => {"name"=>["Allison", "Alice"]} +# +# Save the changes: +# +# person.save +# person.name_in_database # => "Alice" +# person.saved_change_to_name? # => true +# person.saved_change_to_name # => ["Allison", "Alice"] +# person.name_before_last_save # => "Allison" +# +# Similar to ActiveModel::Dirty, methods can be invoked as +# +saved_change_to_name?+ or by passing an argument to the generic method +# saved_change_to_attribute?("name"). +# +# source://activerecord//lib/active_record/attribute_methods/dirty.rb#39 +module ActiveRecord::AttributeMethods::Dirty + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActiveModel::AttributeMethods + include ::ActiveModel::Dirty + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveModel::AttributeMethods::ClassMethods + + # Returns the original value of an attribute before the last save. + # + # This method is useful in after callbacks to get the original value of an + # attribute before the save that triggered the callbacks to run. It can be + # invoked as +name_before_last_save+ instead of + # attribute_before_last_save("name"). + # + # source://activerecord//lib/active_record/attribute_methods/dirty.rb#108 + def attribute_before_last_save(attr_name); end + + # Returns the change to an attribute that will be persisted during the + # next save. + # + # This method is useful in validations and before callbacks, to see the + # change to an attribute that will occur when the record is saved. It can + # be invoked as +name_change_to_be_saved+ instead of + # attribute_change_to_be_saved("name"). + # + # If the attribute will change, the result will be an array containing the + # original value and the new value about to be saved. + # + # source://activerecord//lib/active_record/attribute_methods/dirty.rb#152 + def attribute_change_to_be_saved(attr_name); end + + # Returns the value of an attribute in the database, as opposed to the + # in-memory value that will be persisted the next time the record is + # saved. + # + # This method is useful in validations and before callbacks, to see the + # original value of an attribute prior to any changes about to be + # saved. It can be invoked as +name_in_database+ instead of + # attribute_in_database("name"). + # + # source://activerecord//lib/active_record/attribute_methods/dirty.rb#164 + def attribute_in_database(attr_name); end + + # Returns a hash of the attributes that will change when the record is + # next saved. + # + # The hash keys are the attribute names, and the hash values are the + # original attribute values in the database (as opposed to the in-memory + # values about to be saved). + # + # source://activerecord//lib/active_record/attribute_methods/dirty.rb#191 + def attributes_in_database; end + + # Returns an array of the names of any attributes that will change when + # the record is next saved. + # + # source://activerecord//lib/active_record/attribute_methods/dirty.rb#181 + def changed_attribute_names_to_save; end + + # Returns a hash containing all the changes that will be persisted during + # the next save. + # + # source://activerecord//lib/active_record/attribute_methods/dirty.rb#175 + def changes_to_save; end + + # Will the next call to +save+ have any changes to persist? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/attribute_methods/dirty.rb#169 + def has_changes_to_save?; end + + # reload the record and clears changed attributes. + # + # source://activerecord//lib/active_record/attribute_methods/dirty.rb#63 + def reload(*_arg0); end + + # Returns the change to an attribute during the last save. If the + # attribute was changed, the result will be an array containing the + # original value and the saved value. + # + # This method is useful in after callbacks, to see the change in an + # attribute during the save that triggered the callbacks to run. It can be + # invoked as +saved_change_to_name+ instead of + # saved_change_to_attribute("name"). + # + # source://activerecord//lib/active_record/attribute_methods/dirty.rb#98 + def saved_change_to_attribute(attr_name); end + + # Did this attribute change when we last saved? + # + # This method is useful in after callbacks to determine if an attribute + # was changed during the save that triggered the callbacks to run. It can + # be invoked as +saved_change_to_name?+ instead of + # saved_change_to_attribute?("name"). + # + # ==== Options + # + # [+from+] + # When specified, this method will return false unless the original + # value is equal to the given value. + # + # [+to+] + # When specified, this method will return false unless the value will be + # changed to the given value. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/attribute_methods/dirty.rb#86 + def saved_change_to_attribute?(attr_name, **options); end + + # Returns a hash containing all the changes that were just saved. + # + # source://activerecord//lib/active_record/attribute_methods/dirty.rb#118 + def saved_changes; end + + # Did the last call to +save+ have any changes to change? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/attribute_methods/dirty.rb#113 + def saved_changes?; end + + # Will this attribute change the next time we save? + # + # This method is useful in validations and before callbacks to determine + # if the next call to +save+ will change a particular attribute. It can be + # invoked as +will_save_change_to_name?+ instead of + # will_save_change_to_attribute?("name"). + # + # ==== Options + # + # [+from+] + # When specified, this method will return false unless the original + # value is equal to the given value. + # + # [+to+] + # When specified, this method will return false unless the value will be + # changed to the given value. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/attribute_methods/dirty.rb#138 + def will_save_change_to_attribute?(attr_name, **options); end + + private + + # source://activerecord//lib/active_record/attribute_methods/dirty.rb#239 + def _create_record(attribute_names = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/attribute_methods/dirty.rb#204 + def _touch_row(attribute_names, time); end + + # source://activerecord//lib/active_record/attribute_methods/dirty.rb#233 + def _update_record(attribute_names = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/attribute_methods/dirty.rb#249 + def attribute_names_for_partial_inserts; end + + # source://activerecord//lib/active_record/attribute_methods/dirty.rb#245 + def attribute_names_for_partial_updates; end + + # source://activerecord//lib/active_record/attribute_methods/dirty.rb#196 + def init_internals; end + + module GeneratedClassMethods + def attribute_aliases; end + def attribute_aliases=(value); end + def attribute_aliases?; end + def attribute_method_patterns; end + def attribute_method_patterns=(value); end + def attribute_method_patterns?; end + def partial_inserts; end + def partial_inserts=(value); end + def partial_inserts?; end + def partial_updates; end + def partial_updates=(value); end + def partial_updates?; end + end + + module GeneratedInstanceMethods + def attribute_aliases; end + def attribute_aliases?; end + def attribute_method_patterns; end + def attribute_method_patterns?; end + def partial_inserts; end + def partial_inserts?; end + def partial_updates; end + def partial_updates?; end + end +end + +# source://activerecord//lib/active_record/attribute_methods.rb#25 +class ActiveRecord::AttributeMethods::GeneratedAttributeMethods < ::Module; end + +# source://activerecord//lib/active_record/attribute_methods.rb#26 +ActiveRecord::AttributeMethods::GeneratedAttributeMethods::LOCK = T.let(T.unsafe(nil), Monitor) + +# = Active Record Attribute Methods Primary Key +# +# source://activerecord//lib/active_record/attribute_methods/primary_key.rb#6 +module ActiveRecord::AttributeMethods::PrimaryKey + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::AttributeMethods::PrimaryKey::ClassMethods + + # Returns the primary key column's value. If the primary key is composite, + # returns an array of the primary key column values. + # + # source://activerecord//lib/active_record/attribute_methods/primary_key.rb#18 + def id; end + + # Sets the primary key column's value. If the primary key is composite, + # raises TypeError when the set value not enumerable. + # + # source://activerecord//lib/active_record/attribute_methods/primary_key.rb#28 + def id=(value); end + + # Queries the primary key column's value. If the primary key is composite, + # all primary key column values must be queryable. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/attribute_methods/primary_key.rb#34 + def id?; end + + # Returns the primary key column's value before type cast. If the primary key is composite, + # returns an array of primary key column values before type cast. + # + # source://activerecord//lib/active_record/attribute_methods/primary_key.rb#40 + def id_before_type_cast; end + + # source://activerecord//lib/active_record/attribute_methods/primary_key.rb#56 + def id_for_database; end + + # Returns the primary key column's value from the database. If the primary key is composite, + # returns an array of primary key column values from database. + # + # source://activerecord//lib/active_record/attribute_methods/primary_key.rb#52 + def id_in_database; end + + # Returns the primary key column's previous value. If the primary key is composite, + # returns an array of primary key column previous values. + # + # source://activerecord//lib/active_record/attribute_methods/primary_key.rb#46 + def id_was; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/attribute_methods/primary_key.rb#22 + def primary_key_values_present?; end + + # Returns this record's primary key value wrapped in an array if one is + # available. + # + # source://activerecord//lib/active_record/attribute_methods/primary_key.rb#11 + def to_key; end + + private + + # @return [Boolean] + # + # source://activerecord//lib/active_record/attribute_methods/primary_key.rb#61 + def attribute_method?(attr_name); end +end + +# source://activerecord//lib/active_record/attribute_methods/primary_key.rb#65 +module ActiveRecord::AttributeMethods::PrimaryKey::ClassMethods + # @return [Boolean] + # + # source://activerecord//lib/active_record/attribute_methods/primary_key.rb#85 + def composite_primary_key?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/attribute_methods/primary_key.rb#73 + def dangerous_attribute_method?(method_name); end + + # source://activerecord//lib/active_record/attribute_methods/primary_key.rb#103 + def get_primary_key(base_name); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/attribute_methods/primary_key.rb#69 + def instance_method_already_implemented?(method_name); end + + # Defines the primary key field -- can be overridden in subclasses. + # Overwriting will negate any effect of the +primary_key_prefix_type+ + # setting, though. + # + # source://activerecord//lib/active_record/attribute_methods/primary_key.rb#80 + def primary_key; end + + # Sets the name of the primary key column. + # + # class Project < ActiveRecord::Base + # self.primary_key = 'sysid' + # end + # + # You can also define the #primary_key method yourself: + # + # class Project < ActiveRecord::Base + # def self.primary_key + # 'foo_' + super + # end + # end + # + # Project.primary_key # => "foo_id" + # + # source://activerecord//lib/active_record/attribute_methods/primary_key.rb#130 + def primary_key=(value); end + + # Returns a quoted version of the primary key name. + # + # source://activerecord//lib/active_record/attribute_methods/primary_key.rb#91 + def quoted_primary_key; end + + # source://activerecord//lib/active_record/attribute_methods/primary_key.rb#95 + def reset_primary_key; end + + private + + # source://activerecord//lib/active_record/attribute_methods/primary_key.rb#143 + def inherited(base); end +end + +# source://activerecord//lib/active_record/attribute_methods/primary_key.rb#66 +ActiveRecord::AttributeMethods::PrimaryKey::ClassMethods::ID_ATTRIBUTE_METHODS = T.let(T.unsafe(nil), Set) + +# source://activerecord//lib/active_record/attribute_methods/primary_key.rb#67 +ActiveRecord::AttributeMethods::PrimaryKey::ClassMethods::PRIMARY_KEY_NOT_SET = T.let(T.unsafe(nil), BasicObject) + +# = Active Record Attribute Methods \Query +# +# Adds query methods for attributes that return either +true+ or +false+ +# depending on the attribute type and value. +# +# For Boolean attributes this will return +true+ if the value is present +# and return +false+ otherwise: +# +# class Product < ActiveRecord::Base +# end +# +# product = Product.new(archived: false) +# product.archived? # => false +# product.archived = true +# product.archived? # => true +# +# For Numeric attributes this will return +true+ if the value is a non-zero +# number and return +false+ otherwise: +# +# product.inventory_count = 0 +# product.inventory_count? # => false +# product.inventory_count = 1 +# product.inventory_count? # => true +# +# For other attributes it will return +true+ if the value is present +# and return +false+ otherwise: +# +# product.name = nil +# product.name? # => false +# product.name = " " +# product.name? # => false +# product.name = "Orange" +# product.name? # => true +# +# source://activerecord//lib/active_record/attribute_methods/query.rb#38 +module ActiveRecord::AttributeMethods::Query + extend ::ActiveSupport::Concern + + # source://activerecord//lib/active_record/attribute_methods/query.rb#53 + def _query_attribute(attr_name); end + + # Returns +true+ or +false+ for the attribute identified by +attr_name+, + # depending on the attribute type and value. + # + # source://activerecord//lib/active_record/attribute_methods/query.rb#47 + def query_attribute(attr_name); end + + private + + # Returns +true+ or +false+ for the attribute identified by +attr_name+, + # depending on the attribute type and value. + # + # source://activerecord//lib/active_record/attribute_methods/query.rb#59 + def attribute?(attr_name); end + + # source://activerecord//lib/active_record/attribute_methods/query.rb#63 + def query_cast_attribute(attr_name, value); end +end + +# source://activerecord//lib/active_record/attribute_methods.rb#23 +ActiveRecord::AttributeMethods::RESTRICTED_CLASS_METHODS = T.let(T.unsafe(nil), Array) + +# = Active Record Attribute Methods \Read +# +# source://activerecord//lib/active_record/attribute_methods/read.rb#6 +module ActiveRecord::AttributeMethods::Read + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::AttributeMethods::Read::ClassMethods + + # This method exists to avoid the expensive primary_key check internally, without + # breaking compatibility with the read_attribute API + # + # source://activerecord//lib/active_record/attribute_methods/read.rb#38 + def _read_attribute(attr_name, &block); end + + # Returns the value of the attribute identified by +attr_name+ after it + # has been type cast. For example, a date attribute will cast "2004-12-12" + # to Date.new(2004, 12, 12). (For information about specific type + # casting behavior, see the types under ActiveModel::Type.) + # + # source://activerecord//lib/active_record/attribute_methods/read.rb#29 + def read_attribute(attr_name, &block); end + + private + + # This method exists to avoid the expensive primary_key check internally, without + # breaking compatibility with the read_attribute API + # + # source://activerecord//lib/active_record/attribute_methods/read.rb#42 + def attribute(attr_name, &block); end +end + +# source://activerecord//lib/active_record/attribute_methods/read.rb#9 +module ActiveRecord::AttributeMethods::Read::ClassMethods + private + + # source://activerecord//lib/active_record/attribute_methods/read.rb#11 + def define_method_attribute(canonical_name, owner:, as: T.unsafe(nil)); end +end + +# = Active Record Attribute Methods \Serialization +# +# source://activerecord//lib/active_record/attribute_methods/serialization.rb#6 +module ActiveRecord::AttributeMethods::Serialization + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveRecord::AttributeMethods::Serialization::ClassMethods + + module GeneratedClassMethods + def default_column_serializer; end + def default_column_serializer=(value); end + def default_column_serializer?; end + end + + module GeneratedInstanceMethods; end +end + +# source://activerecord//lib/active_record/attribute_methods/serialization.rb#23 +module ActiveRecord::AttributeMethods::Serialization::ClassMethods + # If you have an attribute that needs to be saved to the database as a + # serialized object, and retrieved by deserializing into the same object, + # then specify the name of that attribute using this method and serialization + # will be handled automatically. + # + # The serialization format may be YAML, JSON, or any custom format using a + # custom coder class. + # + # Keep in mind that database adapters handle certain serialization tasks + # for you. For instance: +json+ and +jsonb+ types in PostgreSQL will be + # converted between JSON object/array syntax and Ruby +Hash+ or +Array+ + # objects transparently. There is no need to use #serialize in this + # case. + # + # For more complex cases, such as conversion to or from your application + # domain objects, consider using the ActiveRecord::Attributes API. + # + # ==== Parameters + # + # * +attr_name+ - The name of the attribute to serialize. + # * +coder+ The serializer implementation to use, e.g. +JSON+. + # * The attribute value will be serialized + # using the coder's dump(value) method, and will be + # deserialized using the coder's load(string) method. The + # +dump+ method may return +nil+ to serialize the value as +NULL+. + # * +type+ - Optional. What the type of the serialized object should be. + # * Attempting to serialize another type will raise an + # ActiveRecord::SerializationTypeMismatch error. + # * If the column is +NULL+ or starting from a new record, the default value + # will set to +type.new+ + # * +comparable+ - Specify whether the deserialized object is safely comparable + # for the purpose of detecting changes. Defaults to +false+ + # When set to +false+ the old and new values will be compared by their serialized + # representation (e.g. JSON or YAML), which can sometimes cause two objects that are + # semantically equal to be considered different. + # For instance two hashes with the same keys and values but a different order have a + # different serialized representation, but are semantically equal once deserialized. + # If set to +true+ the comparison will be done on the deserialized object. + # This options should only be enabled if the +type+ is known to have + # a proper == method that deeply compare the objects. + # * +yaml+ - Optional. Yaml specific options. The allowed config is: + # * +:permitted_classes+ - +Array+ with the permitted classes. + # * +:unsafe_load+ - Unsafely load YAML blobs, allow YAML to load any class. + # + # ==== Options + # + # * +:default+ - The default value to use when no value is provided. If + # this option is not passed, the previous default value (if any) will + # be used. Otherwise, the default will be +nil+. + # + # ==== Choosing a serializer + # + # While any serialization format can be used, it is recommended to carefully + # evaluate the properties of a serializer before using it, as migrating to + # another format later on can be difficult. + # + # ===== Avoid accepting arbitrary types + # + # When serializing data in a column, it is heavily recommended to make sure + # only expected types will be serialized. For instance some serializer like + # +Marshal+ or +YAML+ are capable of serializing almost any Ruby object. + # + # This can lead to unexpected types being serialized, and it is important + # that type serialization remains backward and forward compatible as long + # as some database records still contain these serialized types. + # + # class Address + # def initialize(line, city, country) + # @line, @city, @country = line, city, country + # end + # end + # + # In the above example, if any of the +Address+ attributes is renamed, + # instances that were persisted before the change will be loaded with the + # old attributes. This problem is even worse when the serialized type comes + # from a dependency which doesn't expect to be serialized this way and may + # change its internal representation without notice. + # + # As such, it is heavily recommended to instead convert these objects into + # primitives of the serialization format, for example: + # + # class Address + # attr_reader :line, :city, :country + # + # def self.load(payload) + # data = YAML.safe_load(payload) + # new(data["line"], data["city"], data["country"]) + # end + # + # def self.dump(address) + # YAML.safe_dump( + # "line" => address.line, + # "city" => address.city, + # "country" => address.country, + # ) + # end + # + # def initialize(line, city, country) + # @line, @city, @country = line, city, country + # end + # end + # + # class User < ActiveRecord::Base + # serialize :address, coder: Address + # end + # + # This pattern allows to be more deliberate about what is serialized, and + # to evolve the format in a backward compatible way. + # + # ===== Ensure serialization stability + # + # Some serialization methods may accept some types they don't support by + # silently casting them to other types. This can cause bugs when the + # data is deserialized. + # + # For instance the +JSON+ serializer provided in the standard library will + # silently cast unsupported types to +String+: + # + # >> JSON.parse(JSON.dump(Struct.new(:foo))) + # # => "#" + # + # ==== Examples + # + # ===== Serialize the +preferences+ attribute using YAML + # + # class User < ActiveRecord::Base + # serialize :preferences, coder: YAML + # end + # + # ===== Serialize the +preferences+ attribute using JSON + # + # class User < ActiveRecord::Base + # serialize :preferences, coder: JSON + # end + # + # ===== Serialize the +preferences+ +Hash+ using YAML + # + # class User < ActiveRecord::Base + # serialize :preferences, type: Hash, coder: YAML + # end + # + # ===== Serializes +preferences+ to YAML, permitting select classes + # + # class User < ActiveRecord::Base + # serialize :preferences, coder: YAML, yaml: { permitted_classes: [Symbol, Time] } + # end + # + # ===== Serialize the +preferences+ attribute using a custom coder + # + # class Rot13JSON + # def self.rot13(string) + # string.tr("a-zA-Z", "n-za-mN-ZA-M") + # end + # + # # Serializes an attribute value to a string that will be stored in the database. + # def self.dump(value) + # rot13(ActiveSupport::JSON.dump(value)) + # end + # + # # Deserializes a string from the database to an attribute value. + # def self.load(string) + # ActiveSupport::JSON.load(rot13(string)) + # end + # end + # + # class User < ActiveRecord::Base + # serialize :preferences, coder: Rot13JSON + # end + # + # source://activerecord//lib/active_record/attribute_methods/serialization.rb#193 + def serialize(attr_name, coder: T.unsafe(nil), type: T.unsafe(nil), comparable: T.unsafe(nil), yaml: T.unsafe(nil), **options); end + + private + + # source://activerecord//lib/active_record/attribute_methods/serialization.rb#218 + def build_column_serializer(attr_name, coder, type, yaml = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/attribute_methods/serialization.rb#238 + def type_incompatible_with_serialize?(cast_type, coder, type); end +end + +# source://activerecord//lib/active_record/attribute_methods/serialization.rb#9 +class ActiveRecord::AttributeMethods::Serialization::ColumnNotSerializableError < ::StandardError + # @return [ColumnNotSerializableError] a new instance of ColumnNotSerializableError + # + # source://activerecord//lib/active_record/attribute_methods/serialization.rb#10 + def initialize(name, type); end +end + +# source://activerecord//lib/active_record/attribute_methods/time_zone_conversion.rb#7 +module ActiveRecord::AttributeMethods::TimeZoneConversion + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveRecord::AttributeMethods::TimeZoneConversion::ClassMethods + + module GeneratedClassMethods + def skip_time_zone_conversion_for_attributes; end + def skip_time_zone_conversion_for_attributes=(value); end + def skip_time_zone_conversion_for_attributes?; end + def time_zone_aware_attributes; end + def time_zone_aware_attributes=(value); end + def time_zone_aware_attributes?; end + def time_zone_aware_types; end + def time_zone_aware_types=(value); end + def time_zone_aware_types?; end + end + + module GeneratedInstanceMethods + def skip_time_zone_conversion_for_attributes; end + def skip_time_zone_conversion_for_attributes?; end + def time_zone_aware_attributes; end + def time_zone_aware_attributes?; end + def time_zone_aware_types; end + def time_zone_aware_types?; end + end +end + +# source://activerecord//lib/active_record/attribute_methods/time_zone_conversion.rb#73 +module ActiveRecord::AttributeMethods::TimeZoneConversion::ClassMethods + private + + # @return [Boolean] + # + # source://activerecord//lib/active_record/attribute_methods/time_zone_conversion.rb#83 + def create_time_zone_conversion_attribute?(name, cast_type); end + + # source://activerecord//lib/active_record/attribute_methods/time_zone_conversion.rb#75 + def hook_attribute_type(name, cast_type); end +end + +# source://activerecord//lib/active_record/attribute_methods/time_zone_conversion.rb#8 +class ActiveRecord::AttributeMethods::TimeZoneConversion::TimeZoneConverter + # source://activerecord//lib/active_record/attribute_methods/time_zone_conversion.rb#39 + def ==(other); end + + # source://activerecord//lib/active_record/attribute_methods/time_zone_conversion.rb#17 + def cast(value); end + + # source://activerecord//lib/active_record/attribute_methods/time_zone_conversion.rb#13 + def deserialize(value); end + + private + + # source://activerecord//lib/active_record/attribute_methods/time_zone_conversion.rb#44 + def convert_time_to_time_zone(value); end + + # source://activerecord//lib/active_record/attribute_methods/time_zone_conversion.rb#60 + def set_time_zone_without_conversion(value); end + + class << self + # source://activerecord//lib/active_record/attribute_methods/time_zone_conversion.rb#9 + def new(subtype); end + end +end + +# = Active Record Attribute Methods \Write +# +# source://activerecord//lib/active_record/attribute_methods/write.rb#6 +module ActiveRecord::AttributeMethods::Write + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::AttributeMethods::Write::ClassMethods + + # This method exists to avoid the expensive primary_key check internally, without + # breaking compatibility with the write_attribute API + # + # source://activerecord//lib/active_record/attribute_methods/write.rb#41 + def _write_attribute(attr_name, value); end + + # Updates the attribute identified by +attr_name+ using the specified + # +value+. The attribute value will be type cast upon being read. + # + # source://activerecord//lib/active_record/attribute_methods/write.rb#31 + def write_attribute(attr_name, value); end + + private + + # This method exists to avoid the expensive primary_key check internally, without + # breaking compatibility with the write_attribute API + # + # source://activerecord//lib/active_record/attribute_methods/write.rb#45 + def attribute=(attr_name, value); end +end + +# source://activerecord//lib/active_record/attribute_methods/write.rb#13 +module ActiveRecord::AttributeMethods::Write::ClassMethods + private + + # source://activerecord//lib/active_record/attribute_methods/write.rb#15 + def define_method_attribute=(canonical_name, owner:, as: T.unsafe(nil)); end +end + +# See ActiveRecord::Attributes::ClassMethods for documentation +# +# source://activerecord//lib/active_record/attributes.rb#7 +module ActiveRecord::Attributes + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActiveModel::AttributeRegistration + include ::ActiveModel::AttributeMethods + include ::ActiveModel::Dirty + include ::ActiveSupport::Callbacks + include ::ActiveModel::Validations::Callbacks + include ::ActiveModel::Attributes::Normalization + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveModel::AttributeRegistration::ClassMethods + mixes_in_class_methods ::ActiveModel::Attributes::Normalization::ClassMethods + mixes_in_class_methods ::ActiveModel::AttributeMethods::ClassMethods + mixes_in_class_methods ::ActiveModel::Validations::Callbacks::ClassMethods + mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods + mixes_in_class_methods ::ActiveSupport::DescendantsTracker + mixes_in_class_methods ::ActiveRecord::Attributes::ClassMethods + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + def attribute_aliases; end + def attribute_aliases=(value); end + def attribute_aliases?; end + def attribute_method_patterns; end + def attribute_method_patterns=(value); end + def attribute_method_patterns?; end + def normalized_attributes; end + def normalized_attributes=(value); end + def normalized_attributes?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + def attribute_aliases; end + def attribute_aliases?; end + def attribute_method_patterns; end + def attribute_method_patterns?; end + def normalized_attributes; end + def normalized_attributes=(value); end + def normalized_attributes?; end + end +end + +# = Active Record \Attributes +# +# source://activerecord//lib/active_record/attributes.rb#13 +module ActiveRecord::Attributes::ClassMethods + # source://activerecord//lib/active_record/attributes.rb#253 + def _default_attributes; end + + # This API only accepts type objects, and will do its work immediately instead of + # waiting for the schema to load. While this method + # is provided so it can be used by plugin authors, application code + # should probably use ClassMethods#attribute. + # + # ==== Parameters + # + # [+name+] + # The name of the attribute being defined. Expected to be a +String+. + # + # [+cast_type+] + # The type object to use for this attribute. + # + # [+default+] + # The default value to use when no value is provided. If this option + # is not passed, the previous default value (if any) will be used. + # Otherwise, the default will be +nil+. A proc can also be passed, and + # will be called once each time a new value is needed. + # + # [+user_provided_default+] + # Whether the default value should be cast using +cast+ or +deserialize+. + # + # source://activerecord//lib/active_record/attributes.rb#243 + def define_attribute(name, cast_type, default: T.unsafe(nil), user_provided_default: T.unsafe(nil)); end + + protected + + # source://activerecord//lib/active_record/attributes.rb#281 + def reload_schema_from_cache(*_arg0); end + + private + + # source://activerecord//lib/active_record/attributes.rb#290 + def define_default_attribute(name, value, type, from_user:); end + + # source://activerecord//lib/active_record/attributes.rb#306 + def reset_default_attributes; end + + # source://activerecord//lib/active_record/attributes.rb#310 + def resolve_type_name(name, **options); end + + # source://activerecord//lib/active_record/attributes.rb#314 + def type_for_column(connection, column); end +end + +# source://activerecord//lib/active_record/attributes.rb#287 +ActiveRecord::Attributes::ClassMethods::NO_DEFAULT_PROVIDED = T.let(T.unsafe(nil), Object) + +# = Active Record Autosave Association +# +# AutosaveAssociation is a module that takes care of automatically saving +# associated records when their parent is saved. In addition to saving, it +# also destroys any associated records that were marked for destruction. +# (See #mark_for_destruction and #marked_for_destruction?). +# +# Saving of the parent, its associations, and the destruction of marked +# associations, all happen inside a transaction. This should never leave the +# database in an inconsistent state. +# +# If validations for any of the associations fail, their error messages will +# be applied to the parent. +# +# Note that it also means that associations marked for destruction won't +# be destroyed directly. They will however still be marked for destruction. +# +# Note that autosave: false is not same as not declaring :autosave. +# When the :autosave option is not present then new association records are +# saved but the updated association records are not saved. +# +# == Validation +# +# Child records are validated unless :validate is +false+. +# +# == \Callbacks +# +# Association with autosave option defines several callbacks on your +# model (around_save, before_save, after_create, after_update). Please note that +# callbacks are executed in the order they were defined in +# model. You should avoid modifying the association content before +# autosave callbacks are executed. Placing your callbacks after +# associations is usually a good practice. +# +# === One-to-one Example +# +# class Post < ActiveRecord::Base +# has_one :author, autosave: true +# end +# +# Saving changes to the parent and its associated model can now be performed +# automatically _and_ atomically: +# +# post = Post.find(1) +# post.title # => "The current global position of migrating ducks" +# post.author.name # => "alloy" +# +# post.title = "On the migration of ducks" +# post.author.name = "Eloy Duran" +# +# post.save +# post.reload +# post.title # => "On the migration of ducks" +# post.author.name # => "Eloy Duran" +# +# Destroying an associated model, as part of the parent's save action, is as +# simple as marking it for destruction: +# +# post.author.mark_for_destruction +# post.author.marked_for_destruction? # => true +# +# Note that the model is _not_ yet removed from the database: +# +# id = post.author.id +# Author.find_by(id: id).nil? # => false +# +# post.save +# post.reload.author # => nil +# +# Now it _is_ removed from the database: +# +# Author.find_by(id: id).nil? # => true +# +# === One-to-many Example +# +# When :autosave is not declared new children are saved when their parent is saved: +# +# class Post < ActiveRecord::Base +# has_many :comments # :autosave option is not declared +# end +# +# post = Post.new(title: 'ruby rocks') +# post.comments.build(body: 'hello world') +# post.save # => saves both post and comment +# +# post = Post.create(title: 'ruby rocks') +# post.comments.build(body: 'hello world') +# post.save # => saves both post and comment +# +# post = Post.create(title: 'ruby rocks') +# comment = post.comments.create(body: 'hello world') +# comment.body = 'hi everyone' +# post.save # => saves post, but not comment +# +# When :autosave is true all children are saved, no matter whether they +# are new records or not: +# +# class Post < ActiveRecord::Base +# has_many :comments, autosave: true +# end +# +# post = Post.create(title: 'ruby rocks') +# comment = post.comments.create(body: 'hello world') +# comment.body = 'hi everyone' +# post.comments.build(body: "good morning.") +# post.save # => saves post and both comments. +# +# Destroying one of the associated models as part of the parent's save action +# is as simple as marking it for destruction: +# +# post.comments # => [#, # +# post.comments[1].mark_for_destruction +# post.comments[1].marked_for_destruction? # => true +# post.comments.length # => 2 +# +# Note that the model is _not_ yet removed from the database: +# +# id = post.comments.last.id +# Comment.find_by(id: id).nil? # => false +# +# post.save +# post.reload.comments.length # => 1 +# +# Now it _is_ removed from the database: +# +# Comment.find_by(id: id).nil? # => true +# +# === Caveats +# +# Note that autosave will only trigger for already-persisted association records +# if the records themselves have been changed. This is to protect against +# SystemStackError caused by circular association validations. The one +# exception is if a custom validation context is used, in which case the validations +# will always fire on the associated records. +# +# source://activerecord//lib/active_record/autosave_association.rb#140 +module ActiveRecord::AutosaveAssociation + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::AutosaveAssociation::ClassMethods + + # @return [Boolean] + # + # source://activerecord//lib/active_record/autosave_association.rb#284 + def autosaving_belongs_to_for?(association); end + + # Returns whether or not this record has been changed in any way (including whether + # any of its nested autosave associations are likewise changed) + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/autosave_association.rb#275 + def changed_for_autosave?; end + + # Returns the association for the parent being destroyed. + # + # Used to avoid updating the counter cache unnecessarily. + # + # source://activerecord//lib/active_record/autosave_association.rb#269 + def destroyed_by_association; end + + # Records the association that is being destroyed and destroying this + # record in the process. + # + # source://activerecord//lib/active_record/autosave_association.rb#262 + def destroyed_by_association=(reflection); end + + # Marks this record to be destroyed as part of the parent's save transaction. + # This does _not_ actually destroy the record instantly, rather child record will be destroyed + # when parent.save is called. + # + # Only useful if the :autosave option on the parent is enabled for this associated model. + # + # source://activerecord//lib/active_record/autosave_association.rb#249 + def mark_for_destruction; end + + # Returns whether or not this record will be destroyed as part of the parent's save transaction. + # + # Only useful if the :autosave option on the parent is enabled for this associated model. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/autosave_association.rb#256 + def marked_for_destruction?; end + + # Reloads the attributes of the object as usual and clears marked_for_destruction flag. + # + # source://activerecord//lib/active_record/autosave_association.rb#238 + def reload(options = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/autosave_association.rb#279 + def validating_belongs_to_for?(association); end + + private + + # source://activerecord//lib/active_record/autosave_association.rb#592 + def _ensure_no_duplicate_errors; end + + # If the record is new or it has changed, returns true. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/autosave_association.rb#510 + def _record_changed?(reflection, record, key); end + + # Is used as an around_save callback to check while saving a collection + # association whether or not the parent was a new record before saving. + # + # source://activerecord//lib/active_record/autosave_association.rb#402 + def around_save_collection_association; end + + # Returns the record for an association collection that should be validated + # or saved. If +autosave+ is +false+ only new records will be returned, + # unless the parent is/was a new record itself. + # + # source://activerecord//lib/active_record/autosave_association.rb#298 + def associated_records_to_validate_or_save(association, new_record, autosave); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/autosave_association.rb#517 + def association_foreign_key_changed?(reflection, record, key); end + + # Returns whether or not the association is valid and applies any errors to + # the parent, self, if it wasn't. Skips any :autosave + # enabled records if they're marked_for_destruction? or destroyed. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/autosave_association.rb#371 + def association_valid?(association, record); end + + # source://activerecord//lib/active_record/autosave_association.rb#576 + def compute_primary_key(reflection, record); end + + # source://activerecord//lib/active_record/autosave_association.rb#290 + def init_internals; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/autosave_association.rb#526 + def inverse_polymorphic_association_changed?(reflection, record); end + + # Go through nested autosave associations that are loaded in memory (without loading + # any new ones), and return true if any are changed for autosave. + # Returns false if already called to prevent an infinite loop. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/autosave_association.rb#311 + def nested_records_changed_for_autosave?; end + + # Saves the associated record if it's new or :autosave is enabled. + # + # In addition, it will destroy the association if it was marked for destruction. + # + # source://activerecord//lib/active_record/autosave_association.rb#536 + def save_belongs_to_association(reflection); end + + # Saves any new associated records, or all loaded autosave associations if + # :autosave is enabled on the association. + # + # In addition, it destroys all children that were marked for destruction + # with #mark_for_destruction. + # + # This all happens inside a transaction, _if_ the Transactions module is included into + # ActiveRecord::Base after the AutosaveAssociation module, which it does by default. + # + # source://activerecord//lib/active_record/autosave_association.rb#419 + def save_collection_association(reflection); end + + # Saves the associated record if it's new or :autosave is enabled + # on the association. + # + # In addition, it will destroy the association if it was marked for + # destruction with #mark_for_destruction. + # + # This all happens inside a transaction, _if_ the Transactions module is included into + # ActiveRecord::Base after the AutosaveAssociation module, which it does by default. + # + # source://activerecord//lib/active_record/autosave_association.rb#473 + def save_has_one_association(reflection); end + + # Validate the association if :validate or :autosave is + # turned on for the belongs_to association. + # + # source://activerecord//lib/active_record/autosave_association.rb#343 + def validate_belongs_to_association(reflection); end + + # Validate the associated records if :validate or + # :autosave is turned on for the association specified by + # +reflection+. + # + # source://activerecord//lib/active_record/autosave_association.rb#360 + def validate_collection_association(reflection); end + + # Validate the association if :validate or :autosave is + # turned on for the has_one association. + # + # source://activerecord//lib/active_record/autosave_association.rb#329 + def validate_has_one_association(reflection); end +end + +# source://activerecord//lib/active_record/autosave_association.rb#143 +module ActiveRecord::AutosaveAssociation::AssociationBuilderExtension + class << self + # source://activerecord//lib/active_record/autosave_association.rb#144 + def build(model, reflection); end + + # source://activerecord//lib/active_record/autosave_association.rb#148 + def valid_options; end + end +end + +# source://activerecord//lib/active_record/autosave_association.rb#157 +module ActiveRecord::AutosaveAssociation::ClassMethods + private + + # Adds validation and save callbacks for the association as specified by + # the +reflection+. + # + # For performance reasons, we don't check whether to validate at runtime. + # However the validation and callback methods are lazy and those methods + # get created when they are invoked for the very first time. However, + # this can change, for instance, when using nested attributes, which is + # called _after_ the association has been defined. Since we don't want + # the callbacks to get defined multiple times, there are guards that + # check if the save or validation methods have already been defined + # before actually defining them. + # + # source://activerecord//lib/active_record/autosave_association.rb#189 + def add_autosave_association_callbacks(reflection); end + + # source://activerecord//lib/active_record/autosave_association.rb#219 + def define_autosave_validation_callbacks(reflection); end + + # source://activerecord//lib/active_record/autosave_association.rb#159 + def define_non_cyclic_method(name, &block); end +end + +# = Active Record +# +# Active Record objects don't specify their attributes directly, but rather infer them from +# the table definition with which they're linked. Adding, removing, and changing attributes +# and their type is done directly in the database. Any change is instantly reflected in the +# Active Record objects. The mapping that binds a given Active Record class to a certain +# database table will happen automatically in most common cases, but can be overwritten for the uncommon ones. +# +# See the mapping rules in table_name and the full example in link:files/activerecord/README_rdoc.html for more insight. +# +# == Creation +# +# Active Records accept constructor parameters either in a hash or as a block. The hash +# method is especially useful when you're receiving the data from somewhere else, like an +# HTTP request. It works like this: +# +# user = User.new(name: "David", occupation: "Code Artist") +# user.name # => "David" +# +# You can also use block initialization: +# +# user = User.new do |u| +# u.name = "David" +# u.occupation = "Code Artist" +# end +# +# And of course you can just create a bare object and specify the attributes after the fact: +# +# user = User.new +# user.name = "David" +# user.occupation = "Code Artist" +# +# == Conditions +# +# Conditions can either be specified as a string, array, or hash representing the WHERE-part of an SQL statement. +# The array form is to be used when the condition input is tainted and requires sanitization. The string form can +# be used for statements that don't involve tainted data. The hash form works much like the array form, except +# only equality and range is possible. Examples: +# +# class User < ActiveRecord::Base +# def self.authenticate_unsafely(user_name, password) +# where("user_name = '#{user_name}' AND password = '#{password}'").first +# end +# +# def self.authenticate_safely(user_name, password) +# where("user_name = ? AND password = ?", user_name, password).first +# end +# +# def self.authenticate_safely_simply(user_name, password) +# where(user_name: user_name, password: password).first +# end +# end +# +# The authenticate_unsafely method inserts the parameters directly into the query +# and is thus susceptible to SQL-injection attacks if the user_name and +password+ +# parameters come directly from an HTTP request. The authenticate_safely and +# authenticate_safely_simply both will sanitize the user_name and +password+ +# before inserting them in the query, which will ensure that an attacker can't escape the +# query and fake the login (or worse). +# +# When using multiple parameters in the conditions, it can easily become hard to read exactly +# what the fourth or fifth question mark is supposed to represent. In those cases, you can +# resort to named bind variables instead. That's done by replacing the question marks with +# symbols and supplying a hash with values for the matching symbol keys: +# +# Company.where( +# "id = :id AND name = :name AND division = :division AND created_at > :accounting_date", +# { id: 3, name: "37signals", division: "First", accounting_date: '2005-01-01' } +# ).first +# +# Similarly, a simple hash without a statement will generate conditions based on equality with the SQL AND +# operator. For instance: +# +# Student.where(first_name: "Harvey", status: 1) +# Student.where(params[:student]) +# +# A range may be used in the hash to use the SQL BETWEEN operator: +# +# Student.where(grade: 9..12) +# +# An array may be used in the hash to use the SQL IN operator: +# +# Student.where(grade: [9,11,12]) +# +# When joining tables, nested hashes or keys written in the form 'table_name.column_name' +# can be used to qualify the table name of a particular condition. For instance: +# +# Student.joins(:schools).where(schools: { category: 'public' }) +# Student.joins(:schools).where('schools.category' => 'public' ) +# +# == Overwriting default accessors +# +# All column values are automatically available through basic accessors on the Active Record +# object, but sometimes you want to specialize this behavior. This can be done by overwriting +# the default accessors (using the same name as the attribute) and calling +# +super+ to actually change things. +# +# class Song < ActiveRecord::Base +# # Uses an integer of seconds to hold the length of the song +# +# def length=(minutes) +# super(minutes.to_i * 60) +# end +# +# def length +# super / 60 +# end +# end +# +# == Attribute query methods +# +# In addition to the basic accessors, query methods are also automatically available on the Active Record object. +# Query methods allow you to test whether an attribute value is present. +# Additionally, when dealing with numeric values, a query method will return false if the value is zero. +# +# For example, an Active Record User with the name attribute has a name? method that you can call +# to determine whether the user has a name: +# +# user = User.new(name: "David") +# user.name? # => true +# +# anonymous = User.new(name: "") +# anonymous.name? # => false +# +# Query methods will also respect any overrides of default accessors: +# +# class User +# # Has admin boolean column +# def admin +# false +# end +# end +# +# user.update(admin: true) +# +# user.read_attribute(:admin) # => true, gets the column value +# user[:admin] # => true, also gets the column value +# +# user.admin # => false, due to the getter override +# user.admin? # => false, due to the getter override +# +# == Accessing attributes before they have been typecasted +# +# Sometimes you want to be able to read the raw attribute data without having the column-determined +# typecast run its course first. That can be done by using the _before_type_cast +# accessors that all attributes have. For example, if your Account model has a balance attribute, +# you can call account.balance_before_type_cast or account.id_before_type_cast. +# +# This is especially useful in validation situations where the user might supply a string for an +# integer field and you want to display the original string back in an error message. Accessing the +# attribute normally would typecast the string to 0, which isn't what you want. +# +# == Dynamic attribute-based finders +# +# Dynamic attribute-based finders are a mildly deprecated way of getting (and/or creating) objects +# by simple queries without turning to SQL. They work by appending the name of an attribute +# to find_by_ like Person.find_by_user_name. +# Instead of writing Person.find_by(user_name: user_name), you can use +# Person.find_by_user_name(user_name). +# +# It's possible to add an exclamation point (!) on the end of the dynamic finders to get them to raise an +# ActiveRecord::RecordNotFound error if they do not return any records, +# like Person.find_by_last_name!. +# +# It's also possible to use multiple attributes in the same find_by_ by separating them with +# "_and_". +# +# Person.find_by(user_name: user_name, password: password) +# Person.find_by_user_name_and_password(user_name, password) # with dynamic finder +# +# It's even possible to call these dynamic finder methods on relations and named scopes. +# +# Payment.order("created_on").find_by_amount(50) +# +# == Saving arrays, hashes, and other non-mappable objects in text columns +# +# Active Record can serialize any object in text columns using YAML. To do so, you must +# specify this with a call to the class method +# {serialize}[rdoc-ref:AttributeMethods::Serialization::ClassMethods#serialize]. +# This makes it possible to store arrays, hashes, and other non-mappable objects without doing +# any additional work. +# +# class User < ActiveRecord::Base +# serialize :preferences +# end +# +# user = User.create(preferences: { "background" => "black", "display" => large }) +# User.find(user.id).preferences # => { "background" => "black", "display" => large } +# +# You can also specify a class option as the second parameter that'll raise an exception +# if a serialized object is retrieved as a descendant of a class not in the hierarchy. +# +# class User < ActiveRecord::Base +# serialize :preferences, Hash +# end +# +# user = User.create(preferences: %w( one two three )) +# User.find(user.id).preferences # raises SerializationTypeMismatch +# +# When you specify a class option, the default value for that attribute will be a new +# instance of that class. +# +# class User < ActiveRecord::Base +# serialize :preferences, OpenStruct +# end +# +# user = User.new +# user.preferences.theme_color = "red" +# +# +# == Single table inheritance +# +# Active Record allows inheritance by storing the name of the class in a +# column that is named "type" by default. See ActiveRecord::Inheritance for +# more details. +# +# == Connection to multiple databases in different models +# +# Connections are usually created through +# {ActiveRecord::Base.establish_connection}[rdoc-ref:ConnectionHandling#establish_connection] and retrieved +# by ActiveRecord::Base.lease_connection. All classes inheriting from ActiveRecord::Base will use this +# connection. But you can also set a class-specific connection. For example, if Course is an +# ActiveRecord::Base, but resides in a different database, you can just say Course.establish_connection +# and Course and all of its subclasses will use this connection instead. +# +# This feature is implemented by keeping a connection pool in ActiveRecord::Base that is +# a hash indexed by the class. If a connection is requested, the +# {ActiveRecord::Base.retrieve_connection}[rdoc-ref:ConnectionHandling#retrieve_connection] method +# will go up the class-hierarchy until a connection is found in the connection pool. +# +# == Exceptions +# +# * ActiveRecordError - Generic error class and superclass of all other errors raised by Active Record. +# * AdapterNotSpecified - The configuration hash used in +# {ActiveRecord::Base.establish_connection}[rdoc-ref:ConnectionHandling#establish_connection] +# didn't include an :adapter key. +# * AdapterNotFound - The :adapter key used in +# {ActiveRecord::Base.establish_connection}[rdoc-ref:ConnectionHandling#establish_connection] +# specified a non-existent adapter +# (or a bad spelling of an existing one). +# * AssociationTypeMismatch - The object assigned to the association wasn't of the type +# specified in the association definition. +# * AttributeAssignmentError - An error occurred while doing a mass assignment through the +# {ActiveRecord::Base#attributes=}[rdoc-ref:ActiveModel::AttributeAssignment#attributes=] method. +# You can inspect the +attribute+ property of the exception object to determine which attribute +# triggered the error. +# * ConnectionNotEstablished - No connection has been established. +# Use {ActiveRecord::Base.establish_connection}[rdoc-ref:ConnectionHandling#establish_connection] before querying. +# * MultiparameterAssignmentErrors - Collection of errors that occurred during a mass assignment using the +# {ActiveRecord::Base#attributes=}[rdoc-ref:ActiveModel::AttributeAssignment#attributes=] method. +# The +errors+ property of this exception contains an array of +# AttributeAssignmentError +# objects that should be inspected to determine which attributes triggered the errors. +# * RecordInvalid - raised by {ActiveRecord::Base#save!}[rdoc-ref:Persistence#save!] and +# {ActiveRecord::Base.create!}[rdoc-ref:Persistence::ClassMethods#create!] +# when the record is invalid. +# * RecordNotFound - No record responded to the {ActiveRecord::Base.find}[rdoc-ref:FinderMethods#find] method. +# Either the row with the given ID doesn't exist or the row didn't meet the additional restrictions. +# Some {ActiveRecord::Base.find}[rdoc-ref:FinderMethods#find] calls do not raise this exception to signal +# nothing was found, please check its documentation for further details. +# * SerializationTypeMismatch - The serialized object wasn't of the class specified as the second parameter. +# * StatementInvalid - The database server rejected the SQL statement. The precise error is added in the message. +# +# *Note*: The attributes listed are class-level attributes (accessible from both the class and instance level). +# So it's possible to assign a logger to the class through Base.logger= which will then be used by all +# instances in the current object space. +# +# source://activerecord//lib/active_record/base.rb#281 +class ActiveRecord::Base + include ::ActionText::Encryption + include ::ActiveModel::Validations + include ::ActiveSupport::Callbacks + include ::ActiveModel::Validations::HelperMethods + include ::ActiveModel::Conversion + include ::ActiveModel::ForbiddenAttributesProtection + include ::ActiveModel::AttributeAssignment + include ::ActiveModel::API + include ::ActiveModel::Access + include ::ActiveRecord::Core + include ::ActiveRecord::Persistence + include ::ActiveRecord::ReadonlyAttributes + include ::ActiveRecord::ModelSchema + include ::ActiveRecord::Inheritance + include ::ActiveRecord::Scoping + include ::ActiveRecord::Scoping::Default + include ::ActiveRecord::Scoping::Named + include ::ActiveRecord::Sanitization + include ::ActiveRecord::AttributeAssignment + include ::ActiveRecord::Integration + include ::ActiveRecord::Validations + include ::ActiveRecord::CounterCache + include ::ActiveModel::AttributeRegistration + include ::ActiveModel::Attributes::Normalization + include ::ActiveModel::AttributeMethods + include ::ActiveModel::Dirty + include ::ActiveModel::Validations::Callbacks + include ::ActiveRecord::Attributes + include ::ActiveRecord::Locking::Optimistic + include ::ActiveRecord::Locking::Pessimistic + include ::ActiveRecord::Encryption::EncryptableRecord + include ::ActiveRecord::AttributeMethods + include ::ActiveRecord::Base::GeneratedAttributeMethods + include ::ActiveRecord::Base::GeneratedAssociationMethods + include ::ActiveRecord::AttributeMethods::Read + include ::ActiveRecord::AttributeMethods::Write + include ::ActiveRecord::AttributeMethods::BeforeTypeCast + include ::ActiveRecord::AttributeMethods::Query + include ::ActiveRecord::AttributeMethods::PrimaryKey + include ::ActiveRecord::AttributeMethods::TimeZoneConversion + include ::ActiveRecord::AttributeMethods::Dirty + include ::ActiveRecord::AttributeMethods::Serialization + include ::ActiveRecord::Callbacks + include ::ActiveRecord::Timestamp + include ::ActiveRecord::Associations + include ::ActiveModel::SecurePassword + include ::ActiveRecord::SecurePassword + include ::ActiveRecord::AutosaveAssociation + include ::ActiveRecord::NestedAttributes + include ::ActiveRecord::Transactions + include ::ActiveRecord::TouchLater + include ::ActiveRecord::NoTouching + include ::ActiveRecord::Reflection + include ::ActiveModel::Serialization + include ::ActiveModel::Serializers::JSON + include ::ActiveRecord::Serialization + include ::ActiveRecord::Store + include ::ActiveRecord::SecureToken + include ::ActiveRecord::TokenFor + include ::ActiveRecord::SignedId + include ::ActiveRecord::Suppressor + include ::ActiveRecord::Marshalling::Methods + include ::ActiveStorage::Attached::Model + include ::ActiveStorage::Reflection::ActiveRecordExtensions + include ::ActionText::Attribute + include ::Turbo::Broadcastable + extend ::ActiveModel::Validations::ClassMethods + extend ::ActiveModel::Naming + extend ::ActiveModel::Callbacks + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::ActiveSupport::DescendantsTracker + extend ::ActiveModel::Translation + extend ::ActiveModel::Validations::HelperMethods + extend ::ActiveModel::Conversion::ClassMethods + extend ::ActiveSupport::Benchmarkable + extend ::ActiveRecord::ConnectionHandling + extend ::ActiveRecord::QueryCache::ClassMethods + extend ::ActiveRecord::Querying + extend ::ActiveRecord::Translation + extend ::ActiveRecord::DynamicMatchers + extend ::ActiveRecord::DelegatedType + extend ::ActiveRecord::Explain + extend ::ActiveRecord::Enum + extend ::ActiveRecord::Delegation::DelegateCache + extend ::ActiveRecord::Aggregations::ClassMethods + extend ::ActiveRecord::Core::ClassMethods + extend ::ActiveRecord::Persistence::ClassMethods + extend ::ActiveRecord::ReadonlyAttributes::ClassMethods + extend ::ActiveRecord::ModelSchema::ClassMethods + extend ::ActiveRecord::Inheritance::ClassMethods + extend ::ActiveRecord::Scoping::ClassMethods + extend ::ActiveRecord::Scoping::Default::ClassMethods + extend ::ActiveRecord::Scoping::Named::ClassMethods + extend ::ActiveRecord::Sanitization::ClassMethods + extend ::ActiveRecord::Integration::ClassMethods + extend ::ActiveRecord::Validations::ClassMethods + extend ::ActiveRecord::CounterCache::ClassMethods + extend ::ActiveModel::AttributeRegistration::ClassMethods + extend ::ActiveModel::Attributes::Normalization::ClassMethods + extend ::ActiveModel::AttributeMethods::ClassMethods + extend ::ActiveModel::Validations::Callbacks::ClassMethods + extend ::ActiveRecord::Attributes::ClassMethods + extend ::ActiveRecord::Locking::Optimistic::ClassMethods + extend ::ActiveRecord::Encryption::EncryptableRecord::ClassMethods + extend ::ActiveRecord::AttributeMethods::ClassMethods + extend ::ActiveRecord::AttributeMethods::Read::ClassMethods + extend ::ActiveRecord::AttributeMethods::Write::ClassMethods + extend ::ActiveRecord::AttributeMethods::PrimaryKey::ClassMethods + extend ::ActiveRecord::AttributeMethods::TimeZoneConversion::ClassMethods + extend ::ActiveRecord::AttributeMethods::Serialization::ClassMethods + extend ::ActiveRecord::Callbacks::ClassMethods + extend ::ActiveRecord::Timestamp::ClassMethods + extend ::ActiveRecord::Associations::ClassMethods + extend ::ActiveModel::SecurePassword::ClassMethods + extend ::ActiveRecord::SecurePassword::ClassMethods + extend ::ActiveRecord::AutosaveAssociation::ClassMethods + extend ::ActiveRecord::NestedAttributes::ClassMethods + extend ::ActiveRecord::Transactions::ClassMethods + extend ::ActiveRecord::NoTouching::ClassMethods + extend ::ActiveRecord::Reflection::ClassMethods + extend ::ActiveRecord::Store::ClassMethods + extend ::ActiveRecord::SecureToken::ClassMethods + extend ::ActiveRecord::TokenFor::ClassMethods + extend ::ActiveRecord::SignedId::ClassMethods + extend ::ActiveRecord::Suppressor::ClassMethods + extend ::ActiveStorage::Attached::Model::ClassMethods + extend ::ActiveStorage::Reflection::ActiveRecordExtensions::ClassMethods + extend ::ActionText::Attribute::ClassMethods + extend ::Turbo::Broadcastable::ClassMethods + extend ::ActiveRecord::SignedId::DeprecateSignedIdVerifierSecret + + # source://activerecord//lib/active_record/base.rb#282 + def __callbacks; end + + # source://activerecord//lib/active_record/base.rb#320 + def _before_commit_callbacks; end + + # source://activerecord//lib/active_record/base.rb#320 + def _commit_callbacks; end + + # source://activerecord//lib/active_record/base.rb#314 + def _create_callbacks; end + + # source://activerecord//lib/active_record/base.rb#314 + def _destroy_callbacks; end + + # source://activerecord//lib/active_record/base.rb#314 + def _find_callbacks; end + + # source://activerecord//lib/active_record/base.rb#314 + def _initialize_callbacks; end + + # source://activerecord//lib/active_record/base.rb#323 + def _reflections; end + + # source://activerecord//lib/active_record/base.rb#323 + def _reflections?; end + + # source://activerecord//lib/active_record/base.rb#320 + def _rollback_callbacks; end + + # source://activerecord//lib/active_record/base.rb#320 + def _run_before_commit_callbacks; end + + # source://activerecord//lib/active_record/base.rb#320 + def _run_before_commit_callbacks!(&block); end + + # source://activerecord//lib/active_record/base.rb#320 + def _run_commit_callbacks; end + + # source://activerecord//lib/active_record/base.rb#320 + def _run_commit_callbacks!(&block); end + + # source://activerecord//lib/active_record/base.rb#314 + def _run_create_callbacks; end + + # source://activerecord//lib/active_record/base.rb#314 + def _run_create_callbacks!(&block); end + + # source://activerecord//lib/active_record/base.rb#314 + def _run_destroy_callbacks; end + + # source://activerecord//lib/active_record/base.rb#314 + def _run_destroy_callbacks!(&block); end + + # source://activerecord//lib/active_record/base.rb#314 + def _run_find_callbacks; end + + # source://activerecord//lib/active_record/base.rb#314 + def _run_find_callbacks!(&block); end + + # source://activerecord//lib/active_record/base.rb#314 + def _run_initialize_callbacks; end + + # source://activerecord//lib/active_record/base.rb#314 + def _run_initialize_callbacks!(&block); end + + # source://activerecord//lib/active_record/base.rb#320 + def _run_rollback_callbacks; end + + # source://activerecord//lib/active_record/base.rb#320 + def _run_rollback_callbacks!(&block); end + + # source://activerecord//lib/active_record/base.rb#314 + def _run_save_callbacks; end + + # source://activerecord//lib/active_record/base.rb#314 + def _run_save_callbacks!(&block); end + + # source://activerecord//lib/active_record/base.rb#314 + def _run_touch_callbacks; end + + # source://activerecord//lib/active_record/base.rb#314 + def _run_touch_callbacks!(&block); end + + # source://activerecord//lib/active_record/base.rb#314 + def _run_update_callbacks; end + + # source://activerecord//lib/active_record/base.rb#314 + def _run_update_callbacks!(&block); end + + # source://activerecord//lib/active_record/base.rb#282 + def _run_validate_callbacks(&block); end + + # source://activerecord//lib/active_record/base.rb#282 + def _run_validate_callbacks!(&block); end + + # source://activerecord//lib/active_record/base.rb#309 + def _run_validation_callbacks(&block); end + + # source://activerecord//lib/active_record/base.rb#309 + def _run_validation_callbacks!(&block); end + + # source://activerecord//lib/active_record/base.rb#314 + def _save_callbacks; end + + # source://activerecord//lib/active_record/base.rb#314 + def _touch_callbacks; end + + # source://activerecord//lib/active_record/base.rb#314 + def _update_callbacks; end + + # source://activerecord//lib/active_record/base.rb#282 + def _validate_callbacks; end + + # source://activerecord//lib/active_record/base.rb#309 + def _validation_callbacks; end + + # source://activerecord//lib/active_record/base.rb#282 + def _validators; end + + # source://activerecord//lib/active_record/base.rb#282 + def _validators?; end + + # source://activerecord//lib/active_record/base.rb#323 + def aggregate_reflections; end + + # source://activerecord//lib/active_record/base.rb#323 + def aggregate_reflections?; end + + # source://activerecord//lib/active_record/base.rb#335 + def attachment_reflections; end + + # source://activerecord//lib/active_record/base.rb#335 + def attachment_reflections?; end + + # source://activerecord//lib/active_record/base.rb#309 + def attribute_aliases; end + + # source://activerecord//lib/active_record/base.rb#309 + def attribute_aliases?; end + + # source://activerecord//lib/active_record/base.rb#309 + def attribute_method_patterns; end + + # source://activerecord//lib/active_record/base.rb#309 + def attribute_method_patterns?; end + + # source://activerecord//lib/active_record/base.rb#323 + def automatic_scope_inversing; end + + # source://activerecord//lib/active_record/base.rb#323 + def automatic_scope_inversing?; end + + # source://activerecord//lib/active_record/base.rb#323 + def automatically_invert_plural_associations; end + + # source://activerecord//lib/active_record/base.rb#323 + def automatically_invert_plural_associations?; end + + # source://activerecord//lib/active_record/base.rb#306 + def cache_timestamp_format; end + + # source://activerecord//lib/active_record/base.rb#306 + def cache_timestamp_format?; end + + # source://activerecord//lib/active_record/base.rb#306 + def cache_versioning; end + + # source://activerecord//lib/active_record/base.rb#306 + def cache_versioning?; end + + # source://activerecord//lib/active_record/base.rb#306 + def collection_cache_versioning; end + + # source://activerecord//lib/active_record/base.rb#306 + def collection_cache_versioning?; end + + # source://activerecord//lib/active_record/base.rb#301 + def column_for_attribute(name, &_arg1); end + + # source://activerecord//lib/active_record/base.rb#308 + def counter_cached_association_names; end + + # source://activerecord//lib/active_record/base.rb#308 + def counter_cached_association_names?; end + + # source://activerecord//lib/active_record/base.rb#298 + def default_connection_handler; end + + # source://activerecord//lib/active_record/base.rb#298 + def default_connection_handler?; end + + # source://activerecord//lib/active_record/base.rb#298 + def default_role; end + + # source://activerecord//lib/active_record/base.rb#298 + def default_role?; end + + # source://activerecord//lib/active_record/base.rb#303 + def default_scope_override; end + + # source://activerecord//lib/active_record/base.rb#303 + def default_scopes; end + + # source://activerecord//lib/active_record/base.rb#298 + def default_shard; end + + # source://activerecord//lib/active_record/base.rb#298 + def default_shard?; end + + # source://activerecord//lib/active_record/base.rb#294 + def defined_enums; end + + # source://activerecord//lib/active_record/base.rb#294 + def defined_enums?; end + + # source://activerecord//lib/active_record/base.rb#298 + def destroy_association_async_batch_size; end + + # source://activerecord//lib/active_record/base.rb#298 + def destroy_association_async_job(&_arg0); end + + # source://activerecord//lib/active_record/base.rb#312 + def encrypted_attributes; end + + # source://activerecord//lib/active_record/base.rb#312 + def encrypted_attributes=(_arg0); end + + # source://activerecord//lib/active_record/base.rb#312 + def encrypted_attributes?; end + + # source://activerecord//lib/active_record/base.rb#324 + def include_root_in_json; end + + # source://activerecord//lib/active_record/base.rb#324 + def include_root_in_json?; end + + # source://activerecord//lib/active_record/base.rb#310 + def lock_optimistically; end + + # source://activerecord//lib/active_record/base.rb#310 + def lock_optimistically?; end + + # source://activerecord//lib/active_record/base.rb#298 + def logger; end + + # source://activerecord//lib/active_record/base.rb#298 + def logger?; end + + # source://activerecord//lib/active_record/base.rb#282 + def model_name(&_arg0); end + + # source://activerecord//lib/active_record/base.rb#319 + def nested_attributes_options; end + + # source://activerecord//lib/active_record/base.rb#319 + def nested_attributes_options?; end + + # source://activerecord//lib/active_record/base.rb#309 + def normalized_attributes; end + + # source://activerecord//lib/active_record/base.rb#309 + def normalized_attributes=(_arg0); end + + # source://activerecord//lib/active_record/base.rb#309 + def normalized_attributes?; end + + # source://activerecord//lib/active_record/base.rb#282 + def param_delimiter=(_arg0); end + + # source://activerecord//lib/active_record/base.rb#313 + def partial_inserts; end + + # source://activerecord//lib/active_record/base.rb#313 + def partial_inserts?; end + + # source://activerecord//lib/active_record/base.rb#313 + def partial_updates; end + + # source://activerecord//lib/active_record/base.rb#313 + def partial_updates?; end + + # source://activerecord//lib/active_record/base.rb#301 + def pluralize_table_names; end + + # source://activerecord//lib/active_record/base.rb#301 + def pluralize_table_names?; end + + # source://activerecord//lib/active_record/base.rb#301 + def primary_key_prefix_type; end + + # source://activerecord//lib/active_record/base.rb#301 + def primary_key_prefix_type?; end + + # source://activerecord//lib/active_record/base.rb#315 + def record_timestamps; end + + # source://activerecord//lib/active_record/base.rb#315 + def record_timestamps=(_arg0); end + + # source://activerecord//lib/active_record/base.rb#315 + def record_timestamps?; end + + # source://activerecord//lib/active_record/base.rb#328 + def signed_id_verifier_secret; end + + # source://activerecord//lib/active_record/base.rb#328 + def signed_id_verifier_secret?; end + + # source://activerecord//lib/active_record/base.rb#313 + def skip_time_zone_conversion_for_attributes; end + + # source://activerecord//lib/active_record/base.rb#313 + def skip_time_zone_conversion_for_attributes?; end + + # source://activerecord//lib/active_record/base.rb#302 + def store_full_class_name; end + + # source://activerecord//lib/active_record/base.rb#302 + def store_full_class_name?; end + + # source://activerecord//lib/active_record/base.rb#302 + def store_full_sti_class; end + + # source://activerecord//lib/active_record/base.rb#302 + def store_full_sti_class?; end + + # source://activerecord//lib/active_record/base.rb#335 + def suppressed_turbo_broadcasts?(&_arg0); end + + # source://activerecord//lib/active_record/base.rb#301 + def table_name_prefix; end + + # source://activerecord//lib/active_record/base.rb#301 + def table_name_prefix?; end + + # source://activerecord//lib/active_record/base.rb#301 + def table_name_suffix; end + + # source://activerecord//lib/active_record/base.rb#301 + def table_name_suffix?; end + + # source://activerecord//lib/active_record/base.rb#313 + def time_zone_aware_attributes; end + + # source://activerecord//lib/active_record/base.rb#313 + def time_zone_aware_attributes?; end + + # source://activerecord//lib/active_record/base.rb#313 + def time_zone_aware_types; end + + # source://activerecord//lib/active_record/base.rb#313 + def time_zone_aware_types?; end + + # source://activerecord//lib/active_record/base.rb#301 + def type_for_attribute(*_arg0, **_arg1, &_arg2); end + + class << self + # source://activerecord//lib/active_record/base.rb#282 + def __callbacks; end + + # source://activerecord//lib/active_record/base.rb#282 + def __callbacks=(value); end + + # source://activerecord//lib/active_record/base.rb#300 + def _attr_readonly; end + + # source://activerecord//lib/active_record/base.rb#300 + def _attr_readonly=(value); end + + # source://activerecord//lib/active_record/base.rb#300 + def _attr_readonly?; end + + # source://activerecord//lib/active_record/base.rb#320 + def _before_commit_callbacks; end + + # source://activerecord//lib/active_record/base.rb#320 + def _before_commit_callbacks=(value); end + + # source://activerecord//lib/active_record/base.rb#320 + def _commit_callbacks; end + + # source://activerecord//lib/active_record/base.rb#320 + def _commit_callbacks=(value); end + + # source://activerecord//lib/active_record/base.rb#308 + def _counter_cache_columns; end + + # source://activerecord//lib/active_record/base.rb#308 + def _counter_cache_columns=(value); end + + # source://activerecord//lib/active_record/base.rb#308 + def _counter_cache_columns?; end + + # source://activerecord//lib/active_record/base.rb#314 + def _create_callbacks; end + + # source://activerecord//lib/active_record/base.rb#314 + def _create_callbacks=(value); end + + # source://activerecord//lib/active_record/base.rb#298 + def _destroy_association_async_job; end + + # source://activerecord//lib/active_record/base.rb#298 + def _destroy_association_async_job=(value); end + + # source://activerecord//lib/active_record/base.rb#298 + def _destroy_association_async_job?; end + + # source://activerecord//lib/active_record/base.rb#314 + def _destroy_callbacks; end + + # source://activerecord//lib/active_record/base.rb#314 + def _destroy_callbacks=(value); end + + # source://activerecord//lib/active_record/base.rb#314 + def _find_callbacks; end + + # source://activerecord//lib/active_record/base.rb#314 + def _find_callbacks=(value); end + + # source://activerecord//lib/active_record/base.rb#314 + def _initialize_callbacks; end + + # source://activerecord//lib/active_record/base.rb#314 + def _initialize_callbacks=(value); end + + # source://activerecord//lib/active_record/base.rb#323 + def _reflections; end + + # source://activerecord//lib/active_record/base.rb#323 + def _reflections=(value); end + + # source://activerecord//lib/active_record/base.rb#323 + def _reflections?; end + + # source://activerecord//lib/active_record/base.rb#320 + def _rollback_callbacks; end + + # source://activerecord//lib/active_record/base.rb#320 + def _rollback_callbacks=(value); end + + # source://activerecord//lib/active_record/base.rb#314 + def _save_callbacks; end + + # source://activerecord//lib/active_record/base.rb#314 + def _save_callbacks=(value); end + + # source://activerecord//lib/active_record/base.rb#328 + def _signed_id_verifier; end + + # source://activerecord//lib/active_record/base.rb#328 + def _signed_id_verifier=(value); end + + # source://activerecord//lib/active_record/base.rb#314 + def _touch_callbacks; end + + # source://activerecord//lib/active_record/base.rb#314 + def _touch_callbacks=(value); end + + # source://activerecord//lib/active_record/base.rb#314 + def _update_callbacks; end + + # source://activerecord//lib/active_record/base.rb#314 + def _update_callbacks=(value); end + + # source://activerecord//lib/active_record/base.rb#282 + def _validate_callbacks; end + + # source://activerecord//lib/active_record/base.rb#282 + def _validate_callbacks=(value); end + + # source://activerecord//lib/active_record/base.rb#309 + def _validation_callbacks; end + + # source://activerecord//lib/active_record/base.rb#309 + def _validation_callbacks=(value); end + + # source://activerecord//lib/active_record/base.rb#282 + def _validators; end + + # source://activerecord//lib/active_record/base.rb#282 + def _validators=(value); end + + # source://activerecord//lib/active_record/base.rb#282 + def _validators?; end + + # source://activerecord//lib/active_record/base.rb#314 + def after_create(*args, **options, &block); end + + # source://activerecord//lib/active_record/base.rb#314 + def after_destroy(*args, **options, &block); end + + # source://activerecord//lib/active_record/base.rb#314 + def after_find(*args, **options, &block); end + + # source://activerecord//lib/active_record/base.rb#314 + def after_initialize(*args, **options, &block); end + + # source://activerecord//lib/active_record/base.rb#314 + def after_save(*args, **options, &block); end + + # source://activerecord//lib/active_record/base.rb#314 + def after_touch(*args, **options, &block); end + + # source://activerecord//lib/active_record/base.rb#314 + def after_update(*args, **options, &block); end + + # source://activerecord//lib/active_record/base.rb#323 + def aggregate_reflections; end + + # source://activerecord//lib/active_record/base.rb#323 + def aggregate_reflections=(value); end + + # source://activerecord//lib/active_record/base.rb#323 + def aggregate_reflections?; end + + # source://activerecord//lib/active_record/base.rb#298 + def application_record_class?; end + + # source://activerecord//lib/active_record/base.rb#314 + def around_create(*args, **options, &block); end + + # source://activerecord//lib/active_record/base.rb#314 + def around_destroy(*args, **options, &block); end + + # source://activerecord//lib/active_record/base.rb#314 + def around_save(*args, **options, &block); end + + # source://activerecord//lib/active_record/base.rb#314 + def around_update(*args, **options, &block); end + + # source://activerecord//lib/active_record/base.rb#298 + def asynchronous_queries_session; end + + # source://activerecord//lib/active_record/base.rb#298 + def asynchronous_queries_tracker; end + + # source://activerecord//lib/active_record/base.rb#335 + def attachment_reflections; end + + # source://activerecord//lib/active_record/base.rb#335 + def attachment_reflections=(value); end + + # source://activerecord//lib/active_record/base.rb#335 + def attachment_reflections?; end + + # source://activerecord//lib/active_record/base.rb#309 + def attribute_aliases; end + + # source://activerecord//lib/active_record/base.rb#309 + def attribute_aliases=(value); end + + # source://activerecord//lib/active_record/base.rb#309 + def attribute_aliases?; end + + # source://activerecord//lib/active_record/base.rb#309 + def attribute_method_patterns; end + + # source://activerecord//lib/active_record/base.rb#309 + def attribute_method_patterns=(value); end + + # source://activerecord//lib/active_record/base.rb#309 + def attribute_method_patterns?; end + + # source://activerecord//lib/active_record/base.rb#298 + def attributes_for_inspect; end + + # source://activerecord//lib/active_record/base.rb#298 + def attributes_for_inspect=(value); end + + # source://activerecord//lib/active_record/base.rb#298 + def attributes_for_inspect?; end + + # source://activerecord//lib/active_record/base.rb#323 + def automatic_scope_inversing; end + + # source://activerecord//lib/active_record/base.rb#323 + def automatic_scope_inversing=(value); end + + # source://activerecord//lib/active_record/base.rb#323 + def automatic_scope_inversing?; end + + # source://activerecord//lib/active_record/base.rb#323 + def automatically_invert_plural_associations; end + + # source://activerecord//lib/active_record/base.rb#323 + def automatically_invert_plural_associations=(value); end + + # source://activerecord//lib/active_record/base.rb#323 + def automatically_invert_plural_associations?; end + + # source://activerecord//lib/active_record/base.rb#314 + def before_create(*args, **options, &block); end + + # source://activerecord//lib/active_record/base.rb#314 + def before_destroy(*args, **options, &block); end + + # source://activerecord//lib/active_record/base.rb#314 + def before_save(*args, **options, &block); end + + # source://activerecord//lib/active_record/base.rb#314 + def before_update(*args, **options, &block); end + + # source://activerecord//lib/active_record/base.rb#298 + def belongs_to_required_by_default; end + + # source://activerecord//lib/active_record/base.rb#298 + def belongs_to_required_by_default=(value); end + + # source://activerecord//lib/active_record/base.rb#298 + def belongs_to_required_by_default?; end + + # source://activerecord//lib/active_record/base.rb#306 + def cache_timestamp_format; end + + # source://activerecord//lib/active_record/base.rb#306 + def cache_timestamp_format=(value); end + + # source://activerecord//lib/active_record/base.rb#306 + def cache_timestamp_format?; end + + # source://activerecord//lib/active_record/base.rb#306 + def cache_versioning; end + + # source://activerecord//lib/active_record/base.rb#306 + def cache_versioning=(value); end + + # source://activerecord//lib/active_record/base.rb#306 + def cache_versioning?; end + + # source://activerecord//lib/active_record/base.rb#306 + def collection_cache_versioning; end + + # source://activerecord//lib/active_record/base.rb#306 + def collection_cache_versioning=(value); end + + # source://activerecord//lib/active_record/base.rb#306 + def collection_cache_versioning?; end + + # source://activerecord//lib/active_record/base.rb#298 + def configurations; end + + # source://activerecord//lib/active_record/base.rb#298 + def configurations=(config); end + + # source://activerecord//lib/active_record/base.rb#298 + def connected_to_stack; end + + # source://activerecord//lib/active_record/base.rb#298 + def connection_class; end + + # source://activerecord//lib/active_record/base.rb#298 + def connection_class=(b); end + + # source://activerecord//lib/active_record/base.rb#298 + def connection_class?; end + + # source://activerecord//lib/active_record/base.rb#298 + def connection_class_for_self; end + + # source://activerecord//lib/active_record/base.rb#298 + def connection_handler; end + + # source://activerecord//lib/active_record/base.rb#298 + def connection_handler=(handler); end + + # source://activerecord//lib/active_record/base.rb#308 + def counter_cached_association_names; end + + # source://activerecord//lib/active_record/base.rb#308 + def counter_cached_association_names=(value); end + + # source://activerecord//lib/active_record/base.rb#308 + def counter_cached_association_names?; end + + # source://activerecord//lib/active_record/base.rb#298 + def current_preventing_writes; end + + # source://activerecord//lib/active_record/base.rb#298 + def current_role; end + + # source://activerecord//lib/active_record/base.rb#298 + def current_shard; end + + # source://activerecord//lib/active_record/base.rb#313 + def default_column_serializer; end + + # source://activerecord//lib/active_record/base.rb#313 + def default_column_serializer=(value); end + + # source://activerecord//lib/active_record/base.rb#313 + def default_column_serializer?; end + + # source://activerecord//lib/active_record/base.rb#298 + def default_connection_handler; end + + # source://activerecord//lib/active_record/base.rb#298 + def default_connection_handler=(value); end + + # source://activerecord//lib/active_record/base.rb#298 + def default_connection_handler?; end + + # source://activerecord//lib/active_record/base.rb#298 + def default_role; end + + # source://activerecord//lib/active_record/base.rb#298 + def default_role=(value); end + + # source://activerecord//lib/active_record/base.rb#298 + def default_role?; end + + # source://activerecord//lib/active_record/base.rb#303 + def default_scope_override; end + + # source://activerecord//lib/active_record/base.rb#303 + def default_scope_override=(value); end + + # source://activerecord//lib/active_record/base.rb#303 + def default_scopes; end + + # source://activerecord//lib/active_record/base.rb#303 + def default_scopes=(value); end + + # source://activerecord//lib/active_record/base.rb#298 + def default_shard; end + + # source://activerecord//lib/active_record/base.rb#298 + def default_shard=(value); end + + # source://activerecord//lib/active_record/base.rb#298 + def default_shard?; end + + # source://activerecord//lib/active_record/base.rb#294 + def defined_enums; end + + # source://activerecord//lib/active_record/base.rb#294 + def defined_enums=(value); end + + # source://activerecord//lib/active_record/base.rb#294 + def defined_enums?; end + + # source://activerecord//lib/active_record/base.rb#298 + def destroy_association_async_batch_size; end + + # source://activerecord//lib/active_record/base.rb#298 + def destroy_association_async_batch_size=(value); end + + # source://activerecord//lib/active_record/base.rb#298 + def destroy_association_async_job; end + + # source://activerecord//lib/active_record/base.rb#298 + def destroy_association_async_job=(value); end + + # source://activerecord//lib/active_record/base.rb#312 + def encrypted_attributes; end + + # source://activerecord//lib/active_record/base.rb#312 + def encrypted_attributes=(value); end + + # source://activerecord//lib/active_record/base.rb#312 + def encrypted_attributes?; end + + # source://activerecord//lib/active_record/base.rb#298 + def enumerate_columns_in_select_statements; end + + # source://activerecord//lib/active_record/base.rb#298 + def enumerate_columns_in_select_statements=(value); end + + # source://activerecord//lib/active_record/base.rb#298 + def enumerate_columns_in_select_statements?; end + + # source://activerecord//lib/active_record/base.rb#327 + def generated_token_verifier; end + + # source://activerecord//lib/active_record/base.rb#327 + def generated_token_verifier=(value); end + + # source://activerecord//lib/active_record/base.rb#298 + def has_many_inversing; end + + # source://activerecord//lib/active_record/base.rb#298 + def has_many_inversing=(value); end + + # source://activerecord//lib/active_record/base.rb#298 + def has_many_inversing?; end + + # source://activerecord//lib/active_record/base.rb#301 + def immutable_strings_by_default; end + + # source://activerecord//lib/active_record/base.rb#301 + def immutable_strings_by_default=(value); end + + # source://activerecord//lib/active_record/base.rb#301 + def immutable_strings_by_default?; end + + # source://activerecord//lib/active_record/base.rb#301 + def implicit_order_column; end + + # source://activerecord//lib/active_record/base.rb#301 + def implicit_order_column=(value); end + + # source://activerecord//lib/active_record/base.rb#301 + def implicit_order_column?; end + + # source://activerecord//lib/active_record/base.rb#324 + def include_root_in_json; end + + # source://activerecord//lib/active_record/base.rb#324 + def include_root_in_json=(value); end + + # source://activerecord//lib/active_record/base.rb#324 + def include_root_in_json?; end + + # source://activerecord//lib/active_record/base.rb#301 + def inheritance_column; end + + # source://activerecord//lib/active_record/base.rb#301 + def inheritance_column=(value); end + + # source://activerecord//lib/active_record/base.rb#301 + def inheritance_column?; end + + # source://activerecord//lib/active_record/base.rb#301 + def internal_metadata_table_name; end + + # source://activerecord//lib/active_record/base.rb#301 + def internal_metadata_table_name=(value); end + + # source://activerecord//lib/active_record/base.rb#301 + def internal_metadata_table_name?; end + + # source://activerecord//lib/active_record/base.rb#325 + def local_stored_attributes; end + + # source://activerecord//lib/active_record/base.rb#325 + def local_stored_attributes=(_arg0); end + + # source://activerecord//lib/active_record/base.rb#310 + def lock_optimistically; end + + # source://activerecord//lib/active_record/base.rb#310 + def lock_optimistically=(value); end + + # source://activerecord//lib/active_record/base.rb#310 + def lock_optimistically?; end + + # source://activerecord//lib/active_record/base.rb#298 + def logger; end + + # source://activerecord//lib/active_record/base.rb#298 + def logger=(value); end + + # source://activerecord//lib/active_record/base.rb#298 + def logger?; end + + # source://activerecord//lib/active_record/base.rb#319 + def nested_attributes_options; end + + # source://activerecord//lib/active_record/base.rb#319 + def nested_attributes_options=(value); end + + # source://activerecord//lib/active_record/base.rb#319 + def nested_attributes_options?; end + + # source://activerecord//lib/active_record/base.rb#309 + def normalized_attributes; end + + # source://activerecord//lib/active_record/base.rb#309 + def normalized_attributes=(value); end + + # source://activerecord//lib/active_record/base.rb#309 + def normalized_attributes?; end + + # source://activerecord//lib/active_record/base.rb#282 + def param_delimiter; end + + # source://activerecord//lib/active_record/base.rb#282 + def param_delimiter=(value); end + + # source://activerecord//lib/active_record/base.rb#282 + def param_delimiter?; end + + # source://activerecord//lib/active_record/base.rb#313 + def partial_inserts; end + + # source://activerecord//lib/active_record/base.rb#313 + def partial_inserts=(value); end + + # source://activerecord//lib/active_record/base.rb#313 + def partial_inserts?; end + + # source://activerecord//lib/active_record/base.rb#313 + def partial_updates; end + + # source://activerecord//lib/active_record/base.rb#313 + def partial_updates=(value); end + + # source://activerecord//lib/active_record/base.rb#313 + def partial_updates?; end + + # source://activerecord//lib/active_record/base.rb#301 + def pluralize_table_names; end + + # source://activerecord//lib/active_record/base.rb#301 + def pluralize_table_names=(value); end + + # source://activerecord//lib/active_record/base.rb#301 + def pluralize_table_names?; end + + # source://activerecord//lib/active_record/base.rb#298 + def preventing_writes?(class_name); end + + # source://activerecord//lib/active_record/base.rb#301 + def primary_key_prefix_type; end + + # source://activerecord//lib/active_record/base.rb#301 + def primary_key_prefix_type=(value); end + + # source://activerecord//lib/active_record/base.rb#301 + def primary_key_prefix_type?; end + + # source://activerecord//lib/active_record/base.rb#315 + def record_timestamps; end + + # source://activerecord//lib/active_record/base.rb#315 + def record_timestamps=(value); end + + # source://activerecord//lib/active_record/base.rb#315 + def record_timestamps?; end + + # source://activerecord//lib/active_record/base.rb#298 + def run_commit_callbacks_on_first_saved_instances_in_transaction; end + + # source://activerecord//lib/active_record/base.rb#298 + def run_commit_callbacks_on_first_saved_instances_in_transaction=(value); end + + # source://activerecord//lib/active_record/base.rb#298 + def run_commit_callbacks_on_first_saved_instances_in_transaction?; end + + # source://activerecord//lib/active_record/base.rb#301 + def schema_migrations_table_name; end + + # source://activerecord//lib/active_record/base.rb#301 + def schema_migrations_table_name=(value); end + + # source://activerecord//lib/active_record/base.rb#301 + def schema_migrations_table_name?; end + + # source://activerecord//lib/active_record/base.rb#298 + def shard_selector; end + + # source://activerecord//lib/active_record/base.rb#298 + def shard_selector=(value); end + + # source://activerecord//lib/active_record/base.rb#298 + def shard_selector?; end + + # source://activerecord//lib/active_record/base.rb#328 + def signed_id_verifier_secret; end + + # source://activerecord//lib/active_record/base.rb#328 + def signed_id_verifier_secret=(secret); end + + # source://activerecord//lib/active_record/base.rb#328 + def signed_id_verifier_secret?; end + + # source://activerecord//lib/active_record/base.rb#313 + def skip_time_zone_conversion_for_attributes; end + + # source://activerecord//lib/active_record/base.rb#313 + def skip_time_zone_conversion_for_attributes=(value); end + + # source://activerecord//lib/active_record/base.rb#313 + def skip_time_zone_conversion_for_attributes?; end + + # source://activerecord//lib/active_record/base.rb#302 + def store_full_class_name; end + + # source://activerecord//lib/active_record/base.rb#302 + def store_full_class_name=(value); end + + # source://activerecord//lib/active_record/base.rb#302 + def store_full_class_name?; end + + # source://activerecord//lib/active_record/base.rb#302 + def store_full_sti_class; end + + # source://activerecord//lib/active_record/base.rb#302 + def store_full_sti_class=(value); end + + # source://activerecord//lib/active_record/base.rb#302 + def store_full_sti_class?; end + + # source://activerecord//lib/active_record/base.rb#298 + def strict_loading_by_default; end + + # source://activerecord//lib/active_record/base.rb#298 + def strict_loading_by_default=(value); end + + # source://activerecord//lib/active_record/base.rb#298 + def strict_loading_by_default?; end + + # source://activerecord//lib/active_record/base.rb#298 + def strict_loading_mode; end + + # source://activerecord//lib/active_record/base.rb#298 + def strict_loading_mode=(value); end + + # source://activerecord//lib/active_record/base.rb#298 + def strict_loading_mode?; end + + # source://activerecord//lib/active_record/base.rb#298 + def strict_loading_violation!(owner:, reflection:); end + + # source://activerecord//lib/active_record/base.rb#335 + def suppressed_turbo_broadcasts; end + + # source://activerecord//lib/active_record/base.rb#335 + def suppressed_turbo_broadcasts=(obj); end + + # source://activerecord//lib/active_record/base.rb#301 + def table_name_prefix; end + + # source://activerecord//lib/active_record/base.rb#301 + def table_name_prefix=(value); end + + # source://activerecord//lib/active_record/base.rb#301 + def table_name_prefix?; end + + # source://activerecord//lib/active_record/base.rb#301 + def table_name_suffix; end + + # source://activerecord//lib/active_record/base.rb#301 + def table_name_suffix=(value); end + + # source://activerecord//lib/active_record/base.rb#301 + def table_name_suffix?; end + + # source://activerecord//lib/active_record/base.rb#313 + def time_zone_aware_attributes; end + + # source://activerecord//lib/active_record/base.rb#313 + def time_zone_aware_attributes=(value); end + + # source://activerecord//lib/active_record/base.rb#313 + def time_zone_aware_attributes?; end + + # source://activerecord//lib/active_record/base.rb#313 + def time_zone_aware_types; end + + # source://activerecord//lib/active_record/base.rb#313 + def time_zone_aware_types=(value); end + + # source://activerecord//lib/active_record/base.rb#313 + def time_zone_aware_types?; end + + # source://activerecord//lib/active_record/base.rb#327 + def token_definitions; end + + # source://activerecord//lib/active_record/base.rb#327 + def token_definitions=(value); end + + private + + # source://activerecord//lib/active_record/base.rb#282 + def __class_attr___callbacks; end + + # source://activerecord//lib/active_record/base.rb#282 + def __class_attr___callbacks=(new_value); end + + # source://activerecord//lib/active_record/base.rb#300 + def __class_attr__attr_readonly; end + + # source://activerecord//lib/active_record/base.rb#300 + def __class_attr__attr_readonly=(new_value); end + + # source://activerecord//lib/active_record/base.rb#308 + def __class_attr__counter_cache_columns; end + + # source://activerecord//lib/active_record/base.rb#308 + def __class_attr__counter_cache_columns=(new_value); end + + # source://activerecord//lib/active_record/base.rb#298 + def __class_attr__destroy_association_async_job; end + + # source://activerecord//lib/active_record/base.rb#298 + def __class_attr__destroy_association_async_job=(new_value); end + + # source://activerecord//lib/active_record/base.rb#323 + def __class_attr__reflections; end + + # source://activerecord//lib/active_record/base.rb#323 + def __class_attr__reflections=(new_value); end + + # source://activerecord//lib/active_record/base.rb#328 + def __class_attr__signed_id_verifier; end + + # source://activerecord//lib/active_record/base.rb#328 + def __class_attr__signed_id_verifier=(new_value); end + + # source://activerecord//lib/active_record/base.rb#282 + def __class_attr__validators; end + + # source://activerecord//lib/active_record/base.rb#282 + def __class_attr__validators=(new_value); end + + # source://activerecord//lib/active_record/base.rb#323 + def __class_attr_aggregate_reflections; end + + # source://activerecord//lib/active_record/base.rb#323 + def __class_attr_aggregate_reflections=(new_value); end + + # source://activerecord//lib/active_record/base.rb#335 + def __class_attr_attachment_reflections; end + + # source://activerecord//lib/active_record/base.rb#335 + def __class_attr_attachment_reflections=(new_value); end + + # source://activerecord//lib/active_record/base.rb#309 + def __class_attr_attribute_aliases; end + + # source://activerecord//lib/active_record/base.rb#309 + def __class_attr_attribute_aliases=(new_value); end + + # source://activerecord//lib/active_record/base.rb#309 + def __class_attr_attribute_method_patterns; end + + # source://activerecord//lib/active_record/base.rb#309 + def __class_attr_attribute_method_patterns=(new_value); end + + # source://activerecord//lib/active_record/base.rb#298 + def __class_attr_attributes_for_inspect; end + + # source://activerecord//lib/active_record/base.rb#298 + def __class_attr_attributes_for_inspect=(new_value); end + + # source://activerecord//lib/active_record/base.rb#323 + def __class_attr_automatic_scope_inversing; end + + # source://activerecord//lib/active_record/base.rb#323 + def __class_attr_automatic_scope_inversing=(new_value); end + + # source://activerecord//lib/active_record/base.rb#323 + def __class_attr_automatically_invert_plural_associations; end + + # source://activerecord//lib/active_record/base.rb#323 + def __class_attr_automatically_invert_plural_associations=(new_value); end + + # source://activerecord//lib/active_record/base.rb#298 + def __class_attr_belongs_to_required_by_default; end + + # source://activerecord//lib/active_record/base.rb#298 + def __class_attr_belongs_to_required_by_default=(new_value); end + + # source://activerecord//lib/active_record/base.rb#306 + def __class_attr_cache_timestamp_format; end + + # source://activerecord//lib/active_record/base.rb#306 + def __class_attr_cache_timestamp_format=(new_value); end + + # source://activerecord//lib/active_record/base.rb#306 + def __class_attr_cache_versioning; end + + # source://activerecord//lib/active_record/base.rb#306 + def __class_attr_cache_versioning=(new_value); end + + # source://activerecord//lib/active_record/base.rb#306 + def __class_attr_collection_cache_versioning; end + + # source://activerecord//lib/active_record/base.rb#306 + def __class_attr_collection_cache_versioning=(new_value); end + + # source://activerecord//lib/active_record/base.rb#308 + def __class_attr_counter_cached_association_names; end + + # source://activerecord//lib/active_record/base.rb#308 + def __class_attr_counter_cached_association_names=(new_value); end + + # source://activerecord//lib/active_record/base.rb#313 + def __class_attr_default_column_serializer; end + + # source://activerecord//lib/active_record/base.rb#313 + def __class_attr_default_column_serializer=(new_value); end + + # source://activerecord//lib/active_record/base.rb#298 + def __class_attr_default_connection_handler; end + + # source://activerecord//lib/active_record/base.rb#298 + def __class_attr_default_connection_handler=(new_value); end + + # source://activerecord//lib/active_record/base.rb#298 + def __class_attr_default_role; end + + # source://activerecord//lib/active_record/base.rb#298 + def __class_attr_default_role=(new_value); end + + # source://activerecord//lib/active_record/base.rb#303 + def __class_attr_default_scope_override; end + + # source://activerecord//lib/active_record/base.rb#303 + def __class_attr_default_scope_override=(new_value); end + + # source://activerecord//lib/active_record/base.rb#303 + def __class_attr_default_scopes; end + + # source://activerecord//lib/active_record/base.rb#303 + def __class_attr_default_scopes=(new_value); end + + # source://activerecord//lib/active_record/base.rb#298 + def __class_attr_default_shard; end + + # source://activerecord//lib/active_record/base.rb#298 + def __class_attr_default_shard=(new_value); end + + # source://activerecord//lib/active_record/base.rb#294 + def __class_attr_defined_enums; end + + # source://activerecord//lib/active_record/base.rb#294 + def __class_attr_defined_enums=(new_value); end + + # source://activerecord//lib/active_record/base.rb#298 + def __class_attr_destroy_association_async_batch_size; end + + # source://activerecord//lib/active_record/base.rb#298 + def __class_attr_destroy_association_async_batch_size=(new_value); end + + # source://activerecord//lib/active_record/base.rb#312 + def __class_attr_encrypted_attributes; end + + # source://activerecord//lib/active_record/base.rb#312 + def __class_attr_encrypted_attributes=(new_value); end + + # source://activerecord//lib/active_record/base.rb#298 + def __class_attr_enumerate_columns_in_select_statements; end + + # source://activerecord//lib/active_record/base.rb#298 + def __class_attr_enumerate_columns_in_select_statements=(new_value); end + + # source://activerecord//lib/active_record/base.rb#327 + def __class_attr_generated_token_verifier; end + + # source://activerecord//lib/active_record/base.rb#327 + def __class_attr_generated_token_verifier=(new_value); end + + # source://activerecord//lib/active_record/base.rb#298 + def __class_attr_has_many_inversing; end + + # source://activerecord//lib/active_record/base.rb#298 + def __class_attr_has_many_inversing=(new_value); end + + # source://activerecord//lib/active_record/base.rb#301 + def __class_attr_immutable_strings_by_default; end + + # source://activerecord//lib/active_record/base.rb#301 + def __class_attr_immutable_strings_by_default=(new_value); end + + # source://activerecord//lib/active_record/base.rb#301 + def __class_attr_implicit_order_column; end + + # source://activerecord//lib/active_record/base.rb#301 + def __class_attr_implicit_order_column=(new_value); end + + # source://activerecord//lib/active_record/base.rb#324 + def __class_attr_include_root_in_json; end + + # source://activerecord//lib/active_record/base.rb#324 + def __class_attr_include_root_in_json=(new_value); end + + # source://activerecord//lib/active_record/base.rb#301 + def __class_attr_inheritance_column; end + + # source://activerecord//lib/active_record/base.rb#301 + def __class_attr_inheritance_column=(new_value); end + + # source://activerecord//lib/active_record/base.rb#301 + def __class_attr_internal_metadata_table_name; end + + # source://activerecord//lib/active_record/base.rb#301 + def __class_attr_internal_metadata_table_name=(new_value); end + + # source://activerecord//lib/active_record/base.rb#310 + def __class_attr_lock_optimistically; end + + # source://activerecord//lib/active_record/base.rb#310 + def __class_attr_lock_optimistically=(new_value); end + + # source://activerecord//lib/active_record/base.rb#298 + def __class_attr_logger; end + + # source://activerecord//lib/active_record/base.rb#298 + def __class_attr_logger=(new_value); end + + # source://activerecord//lib/active_record/base.rb#319 + def __class_attr_nested_attributes_options; end + + # source://activerecord//lib/active_record/base.rb#319 + def __class_attr_nested_attributes_options=(new_value); end + + # source://activerecord//lib/active_record/base.rb#309 + def __class_attr_normalized_attributes; end + + # source://activerecord//lib/active_record/base.rb#309 + def __class_attr_normalized_attributes=(new_value); end + + # source://activerecord//lib/active_record/base.rb#282 + def __class_attr_param_delimiter; end + + # source://activerecord//lib/active_record/base.rb#282 + def __class_attr_param_delimiter=(new_value); end + + # source://activerecord//lib/active_record/base.rb#313 + def __class_attr_partial_inserts; end + + # source://activerecord//lib/active_record/base.rb#313 + def __class_attr_partial_inserts=(new_value); end + + # source://activerecord//lib/active_record/base.rb#313 + def __class_attr_partial_updates; end + + # source://activerecord//lib/active_record/base.rb#313 + def __class_attr_partial_updates=(new_value); end + + # source://activerecord//lib/active_record/base.rb#301 + def __class_attr_pluralize_table_names; end + + # source://activerecord//lib/active_record/base.rb#301 + def __class_attr_pluralize_table_names=(new_value); end + + # source://activerecord//lib/active_record/base.rb#301 + def __class_attr_primary_key_prefix_type; end + + # source://activerecord//lib/active_record/base.rb#301 + def __class_attr_primary_key_prefix_type=(new_value); end + + # source://activerecord//lib/active_record/base.rb#315 + def __class_attr_record_timestamps; end + + # source://activerecord//lib/active_record/base.rb#315 + def __class_attr_record_timestamps=(new_value); end + + # source://activerecord//lib/active_record/base.rb#298 + def __class_attr_run_commit_callbacks_on_first_saved_instances_in_transaction; end + + # source://activerecord//lib/active_record/base.rb#298 + def __class_attr_run_commit_callbacks_on_first_saved_instances_in_transaction=(new_value); end + + # source://activerecord//lib/active_record/base.rb#301 + def __class_attr_schema_migrations_table_name; end + + # source://activerecord//lib/active_record/base.rb#301 + def __class_attr_schema_migrations_table_name=(new_value); end + + # source://activerecord//lib/active_record/base.rb#298 + def __class_attr_shard_selector; end + + # source://activerecord//lib/active_record/base.rb#298 + def __class_attr_shard_selector=(new_value); end + + # source://activerecord//lib/active_record/base.rb#328 + def __class_attr_signed_id_verifier_secret; end + + # source://activerecord//lib/active_record/base.rb#328 + def __class_attr_signed_id_verifier_secret=(new_value); end + + # source://activerecord//lib/active_record/base.rb#313 + def __class_attr_skip_time_zone_conversion_for_attributes; end + + # source://activerecord//lib/active_record/base.rb#313 + def __class_attr_skip_time_zone_conversion_for_attributes=(new_value); end + + # source://activerecord//lib/active_record/base.rb#302 + def __class_attr_store_full_class_name; end + + # source://activerecord//lib/active_record/base.rb#302 + def __class_attr_store_full_class_name=(new_value); end + + # source://activerecord//lib/active_record/base.rb#302 + def __class_attr_store_full_sti_class; end + + # source://activerecord//lib/active_record/base.rb#302 + def __class_attr_store_full_sti_class=(new_value); end + + # source://activerecord//lib/active_record/base.rb#298 + def __class_attr_strict_loading_by_default; end + + # source://activerecord//lib/active_record/base.rb#298 + def __class_attr_strict_loading_by_default=(new_value); end + + # source://activerecord//lib/active_record/base.rb#298 + def __class_attr_strict_loading_mode; end + + # source://activerecord//lib/active_record/base.rb#298 + def __class_attr_strict_loading_mode=(new_value); end + + # source://activerecord//lib/active_record/base.rb#301 + def __class_attr_table_name_prefix; end + + # source://activerecord//lib/active_record/base.rb#301 + def __class_attr_table_name_prefix=(new_value); end + + # source://activerecord//lib/active_record/base.rb#301 + def __class_attr_table_name_suffix; end + + # source://activerecord//lib/active_record/base.rb#301 + def __class_attr_table_name_suffix=(new_value); end + + # source://activerecord//lib/active_record/base.rb#313 + def __class_attr_time_zone_aware_attributes; end + + # source://activerecord//lib/active_record/base.rb#313 + def __class_attr_time_zone_aware_attributes=(new_value); end + + # source://activerecord//lib/active_record/base.rb#313 + def __class_attr_time_zone_aware_types; end + + # source://activerecord//lib/active_record/base.rb#313 + def __class_attr_time_zone_aware_types=(new_value); end + + # source://activerecord//lib/active_record/base.rb#327 + def __class_attr_token_definitions; end + + # source://activerecord//lib/active_record/base.rb#327 + def __class_attr_token_definitions=(new_value); end + + # source://activerecord//lib/active_record/base.rb#301 + def _inheritance_column=(value); end + end +end + +# source://activerecord//lib/active_record/base.rb#313 +module ActiveRecord::Base::GeneratedAssociationMethods; end + +# source://activerecord//lib/active_record/base.rb#313 +module ActiveRecord::Base::GeneratedAttributeMethods; end + +# = Active Record \Batches +# +# source://activerecord//lib/active_record/relation/batches/batch_enumerator.rb#4 +module ActiveRecord::Batches + # Looping through a collection of records from the database + # (using the Scoping::Named::ClassMethods.all method, for example) + # is very inefficient since it will try to instantiate all the objects at once. + # + # In that case, batch processing methods allow you to work + # with the records in batches, thereby greatly reducing memory consumption. + # + # The #find_each method uses #find_in_batches with a batch size of 1000 (or as + # specified by the +:batch_size+ option). + # + # Person.find_each do |person| + # person.do_awesome_stuff + # end + # + # Person.where("age > 21").find_each do |person| + # person.party_all_night! + # end + # + # If you do not provide a block to #find_each, it will return an Enumerator + # for chaining with other methods: + # + # Person.find_each.with_index do |person, index| + # person.award_trophy(index + 1) + # end + # + # ==== Options + # * :batch_size - Specifies the size of the batch. Defaults to 1000. + # * :start - Specifies the cursor column value to start from, inclusive of the value. + # * :finish - Specifies the cursor column value to end at, inclusive of the value. + # * :error_on_ignore - Overrides the application config to specify if an error should be raised when + # an order is present in the relation. + # * :cursor - Specifies the column to use for batching (can be a column name or an array + # of column names). Defaults to primary key. + # * :order - Specifies the cursor column order (can be +:asc+ or +:desc+ or an array consisting + # of :asc or :desc). Defaults to +:asc+. + # + # class Order < ActiveRecord::Base + # self.primary_key = [:id_1, :id_2] + # end + # + # Order.find_each(order: [:asc, :desc]) + # + # In the above code, +id_1+ is sorted in ascending order and +id_2+ in descending order. + # + # Limits are honored, and if present there is no requirement for the batch + # size: it can be less than, equal to, or greater than the limit. + # + # The options +start+ and +finish+ are especially useful if you want + # multiple workers dealing with the same processing queue. You can make + # worker 1 handle all the records between id 1 and 9999 and worker 2 + # handle from 10000 and beyond by setting the +:start+ and +:finish+ + # option on each worker. + # + # # In worker 1, let's process until 9999 records. + # Person.find_each(finish: 9_999) do |person| + # person.party_all_night! + # end + # + # # In worker 2, let's process from record 10_000 and onwards. + # Person.find_each(start: 10_000) do |person| + # person.party_all_night! + # end + # + # NOTE: Order can be ascending (:asc) or descending (:desc). It is automatically set to + # ascending on the primary key ("id ASC"). + # This also means that this method only works when the cursor column is + # orderable (e.g. an integer or string). + # + # NOTE: When using custom columns for batching, they should include at least one unique column + # (e.g. primary key) as a tiebreaker. Also, to reduce the likelihood of race conditions, + # all columns should be static (unchangeable after it was set). + # + # NOTE: By its nature, batch processing is subject to race conditions if + # other processes are modifying the database. + # + # source://activerecord//lib/active_record/relation/batches.rb#85 + def find_each(start: T.unsafe(nil), finish: T.unsafe(nil), batch_size: T.unsafe(nil), error_on_ignore: T.unsafe(nil), cursor: T.unsafe(nil), order: T.unsafe(nil), &block); end + + # Yields each batch of records that was found by the find options as + # an array. + # + # Person.where("age > 21").find_in_batches do |group| + # sleep(50) # Make sure it doesn't get too crowded in there! + # group.each { |person| person.party_all_night! } + # end + # + # If you do not provide a block to #find_in_batches, it will return an Enumerator + # for chaining with other methods: + # + # Person.find_in_batches.with_index do |group, batch| + # puts "Processing group ##{batch}" + # group.each(&:recover_from_last_night!) + # end + # + # To be yielded each record one by one, use #find_each instead. + # + # ==== Options + # * :batch_size - Specifies the size of the batch. Defaults to 1000. + # * :start - Specifies the cursor column value to start from, inclusive of the value. + # * :finish - Specifies the cursor column value to end at, inclusive of the value. + # * :error_on_ignore - Overrides the application config to specify if an error should be raised when + # an order is present in the relation. + # * :cursor - Specifies the column to use for batching (can be a column name or an array + # of column names). Defaults to primary key. + # * :order - Specifies the cursor column order (can be +:asc+ or +:desc+ or an array consisting + # of :asc or :desc). Defaults to +:asc+. + # + # class Order < ActiveRecord::Base + # self.primary_key = [:id_1, :id_2] + # end + # + # Order.find_in_batches(order: [:asc, :desc]) + # + # In the above code, +id_1+ is sorted in ascending order and +id_2+ in descending order. + # + # Limits are honored, and if present there is no requirement for the batch + # size: it can be less than, equal to, or greater than the limit. + # + # The options +start+ and +finish+ are especially useful if you want + # multiple workers dealing with the same processing queue. You can make + # worker 1 handle all the records between id 1 and 9999 and worker 2 + # handle from 10000 and beyond by setting the +:start+ and +:finish+ + # option on each worker. + # + # # Let's process from record 10_000 on. + # Person.find_in_batches(start: 10_000) do |group| + # group.each { |person| person.party_all_night! } + # end + # + # NOTE: Order can be ascending (:asc) or descending (:desc). It is automatically set to + # ascending on the primary key ("id ASC"). + # This also means that this method only works when the cursor column is + # orderable (e.g. an integer or string). + # + # NOTE: When using custom columns for batching, they should include at least one unique column + # (e.g. primary key) as a tiebreaker. Also, to reduce the likelihood of race conditions, + # all columns should be static (unchangeable after it was set). + # + # NOTE: By its nature, batch processing is subject to race conditions if + # other processes are modifying the database. + # + # source://activerecord//lib/active_record/relation/batches.rb#161 + def find_in_batches(start: T.unsafe(nil), finish: T.unsafe(nil), batch_size: T.unsafe(nil), error_on_ignore: T.unsafe(nil), cursor: T.unsafe(nil), order: T.unsafe(nil)); end + + # Yields ActiveRecord::Relation objects to work with a batch of records. + # + # Person.where("age > 21").in_batches do |relation| + # relation.delete_all + # sleep(10) # Throttle the delete queries + # end + # + # If you do not provide a block to #in_batches, it will return a + # BatchEnumerator which is enumerable. + # + # Person.in_batches.each_with_index do |relation, batch_index| + # puts "Processing relation ##{batch_index}" + # relation.delete_all + # end + # + # Examples of calling methods on the returned BatchEnumerator object: + # + # Person.in_batches.delete_all + # Person.in_batches.update_all(awesome: true) + # Person.in_batches.each_record(&:party_all_night!) + # + # ==== Options + # * :of - Specifies the size of the batch. Defaults to 1000. + # * :load - Specifies if the relation should be loaded. Defaults to false. + # * :start - Specifies the cursor column value to start from, inclusive of the value. + # * :finish - Specifies the cursor column value to end at, inclusive of the value. + # * :error_on_ignore - Overrides the application config to specify if an error should be raised when + # an order is present in the relation. + # * :cursor - Specifies the column to use for batching (can be a column name or an array + # of column names). Defaults to primary key. + # * :order - Specifies the cursor column order (can be +:asc+ or +:desc+ or an array consisting + # of :asc or :desc). Defaults to +:asc+. + # + # class Order < ActiveRecord::Base + # self.primary_key = [:id_1, :id_2] + # end + # + # Order.in_batches(order: [:asc, :desc]) + # + # In the above code, +id_1+ is sorted in ascending order and +id_2+ in descending order. + # + # * :use_ranges - Specifies whether to use range iteration (id >= x AND id <= y). + # It can make iterating over the whole or almost whole tables several times faster. + # Only whole table iterations use this style of iteration by default. You can disable this behavior by passing +false+. + # If you iterate over the table and the only condition is, e.g., archived_at: nil (and only a tiny fraction + # of the records are archived), it makes sense to opt in to this approach. + # + # Limits are honored, and if present there is no requirement for the batch + # size, it can be less than, equal, or greater than the limit. + # + # The options +start+ and +finish+ are especially useful if you want + # multiple workers dealing with the same processing queue. You can make + # worker 1 handle all the records between id 1 and 9999 and worker 2 + # handle from 10000 and beyond by setting the +:start+ and +:finish+ + # option on each worker. + # + # # Let's process from record 10_000 on. + # Person.in_batches(start: 10_000).update_all(awesome: true) + # + # An example of calling where query method on the relation: + # + # Person.in_batches.each do |relation| + # relation.update_all('age = age + 1') + # relation.where('age > 21').update_all(should_party: true) + # relation.where('age <= 21').delete_all + # end + # + # NOTE: If you are going to iterate through each record, you should call + # #each_record on the yielded BatchEnumerator: + # + # Person.in_batches.each_record(&:party_all_night!) + # + # NOTE: Order can be ascending (:asc) or descending (:desc). It is automatically set to + # ascending on the primary key ("id ASC"). + # This also means that this method only works when the cursor column is + # orderable (e.g. an integer or string). + # + # NOTE: When using custom columns for batching, they should include at least one unique column + # (e.g. primary key) as a tiebreaker. Also, to reduce the likelihood of race conditions, + # all columns should be static (unchangeable after it was set). + # + # NOTE: By its nature, batch processing is subject to race conditions if + # other processes are modifying the database. + # + # source://activerecord//lib/active_record/relation/batches.rb#259 + def in_batches(of: T.unsafe(nil), start: T.unsafe(nil), finish: T.unsafe(nil), load: T.unsafe(nil), error_on_ignore: T.unsafe(nil), cursor: T.unsafe(nil), order: T.unsafe(nil), use_ranges: T.unsafe(nil), &block); end + + private + + # source://activerecord//lib/active_record/relation/batches.rb#369 + def act_on_ignored_order(error_on_ignore); end + + # source://activerecord//lib/active_record/relation/batches.rb#341 + def apply_finish_limit(relation, cursor, finish, batch_orders); end + + # source://activerecord//lib/active_record/relation/batches.rb#328 + def apply_limits(relation, cursor, start, finish, batch_orders); end + + # source://activerecord//lib/active_record/relation/batches.rb#334 + def apply_start_limit(relation, cursor, start, batch_orders); end + + # source://activerecord//lib/active_record/relation/batches.rb#348 + def batch_condition(relation, cursor, values, operators); end + + # source://activerecord//lib/active_record/relation/batches.rb#379 + def batch_on_loaded_relation(relation:, start:, finish:, cursor:, order:, batch_limit:); end + + # source://activerecord//lib/active_record/relation/batches.rb#426 + def batch_on_unloaded_relation(relation:, start:, finish:, load:, cursor:, order:, use_ranges:, remaining:, batch_limit:); end + + # source://activerecord//lib/active_record/relation/batches.rb#363 + def build_batch_orders(cursor, order); end + + # This is a custom implementation of `<=>` operator, + # which also takes into account how the collection will be ordered. + # + # source://activerecord//lib/active_record/relation/batches.rb#414 + def compare_values_for_order(values1, values2, order); end + + # source://activerecord//lib/active_record/relation/batches.rb#305 + def ensure_valid_options_for_batching!(cursor, start, finish, order); end + + # source://activerecord//lib/active_record/relation/batches.rb#408 + def record_cursor_values(record, cursor); end +end + +# source://activerecord//lib/active_record/relation/batches/batch_enumerator.rb#5 +class ActiveRecord::Batches::BatchEnumerator + include ::Enumerable + + # @return [BatchEnumerator] a new instance of BatchEnumerator + # + # source://activerecord//lib/active_record/relation/batches/batch_enumerator.rb#8 + def initialize(relation:, cursor:, of: T.unsafe(nil), start: T.unsafe(nil), finish: T.unsafe(nil), order: T.unsafe(nil), use_ranges: T.unsafe(nil)); end + + # The size of the batches yielded by the BatchEnumerator. + # + # source://activerecord//lib/active_record/relation/batches/batch_enumerator.rb#28 + def batch_size; end + + # Deletes records in batches. Returns the total number of rows affected. + # + # Person.in_batches.delete_all + # + # See Relation#delete_all for details of how each batch is deleted. + # + # source://activerecord//lib/active_record/relation/batches/batch_enumerator.rb#66 + def delete_all; end + + # Destroys records in batches. Returns the total number of rows affected. + # + # Person.where("age < 10").in_batches.destroy_all + # + # See Relation#destroy_all for details of how each batch is destroyed. + # + # source://activerecord//lib/active_record/relation/batches/batch_enumerator.rb#97 + def destroy_all; end + + # Yields an ActiveRecord::Relation object for each batch of records. + # + # Person.in_batches.each do |relation| + # relation.update_all(awesome: true) + # end + # + # source://activerecord//lib/active_record/relation/batches/batch_enumerator.rb#108 + def each(&block); end + + # Looping through a collection of records from the database (using the + # +all+ method, for example) is very inefficient since it will try to + # instantiate all the objects at once. + # + # In that case, batch processing methods allow you to work with the + # records in batches, thereby greatly reducing memory consumption. + # + # Person.in_batches.each_record do |person| + # person.do_awesome_stuff + # end + # + # Person.where("age > 21").in_batches(of: 10).each_record do |person| + # person.party_all_night! + # end + # + # If you do not provide a block to #each_record, it will return an Enumerator + # for chaining with other methods: + # + # Person.in_batches.each_record.with_index do |person, index| + # person.award_trophy(index + 1) + # end + # + # source://activerecord//lib/active_record/relation/batches/batch_enumerator.rb#53 + def each_record(&block); end + + # The primary key value at which the BatchEnumerator ends, inclusive of the value. + # + # source://activerecord//lib/active_record/relation/batches/batch_enumerator.rb#22 + def finish; end + + # The relation from which the BatchEnumerator yields batches. + # + # source://activerecord//lib/active_record/relation/batches/batch_enumerator.rb#25 + def relation; end + + # The primary key value from which the BatchEnumerator starts, inclusive of the value. + # + # source://activerecord//lib/active_record/relation/batches/batch_enumerator.rb#19 + def start; end + + # Touches records in batches. Returns the total number of rows affected. + # + # Person.in_batches.touch_all + # + # See Relation#touch_all for details of how each batch is touched. + # + # source://activerecord//lib/active_record/relation/batches/batch_enumerator.rb#86 + def touch_all(*_arg0, **_arg1, &_arg2); end + + # Updates records in batches. Returns the total number of rows affected. + # + # Person.in_batches.update_all("age = age + 1") + # + # See Relation#update_all for details of how each batch is updated. + # + # source://activerecord//lib/active_record/relation/batches/batch_enumerator.rb#75 + def update_all(updates); end +end + +# source://activerecord//lib/active_record/relation/batches.rb#9 +ActiveRecord::Batches::DEFAULT_ORDER = T.let(T.unsafe(nil), Symbol) + +# source://activerecord//lib/active_record/relation/batches.rb#8 +ActiveRecord::Batches::ORDER_IGNORE_MESSAGE = T.let(T.unsafe(nil), String) + +# = Active Record \Calculations +# +# source://activerecord//lib/active_record/relation/calculations.rb#7 +module ActiveRecord::Calculations + # Same as #average, but performs the query asynchronously and returns an + # ActiveRecord::Promise. + # + # source://activerecord//lib/active_record/relation/calculations.rb#122 + def async_average(column_name); end + + # Same as #count, but performs the query asynchronously and returns an + # ActiveRecord::Promise. + # + # source://activerecord//lib/active_record/relation/calculations.rb#108 + def async_count(column_name = T.unsafe(nil)); end + + # Same as #ids, but performs the query asynchronously and returns an + # ActiveRecord::Promise. + # + # source://activerecord//lib/active_record/relation/calculations.rb#413 + def async_ids; end + + # Same as #maximum, but performs the query asynchronously and returns an + # ActiveRecord::Promise. + # + # source://activerecord//lib/active_record/relation/calculations.rb#152 + def async_maximum(column_name); end + + # Same as #minimum, but performs the query asynchronously and returns an + # ActiveRecord::Promise. + # + # source://activerecord//lib/active_record/relation/calculations.rb#137 + def async_minimum(column_name); end + + # Same as #pick, but performs the query asynchronously and returns an + # ActiveRecord::Promise. + # + # source://activerecord//lib/active_record/relation/calculations.rb#367 + def async_pick(*column_names); end + + # Same as #pluck, but performs the query asynchronously and returns an + # ActiveRecord::Promise. + # + # source://activerecord//lib/active_record/relation/calculations.rb#338 + def async_pluck(*column_names); end + + # Same as #sum, but performs the query asynchronously and returns an + # ActiveRecord::Promise. + # + # source://activerecord//lib/active_record/relation/calculations.rb#181 + def async_sum(identity_or_column = T.unsafe(nil)); end + + # Calculates the average value on a given column. Returns +nil+ if there's + # no row. See #calculate for examples with options. + # + # Person.average(:age) # => 35.8 + # + # source://activerecord//lib/active_record/relation/calculations.rb#116 + def average(column_name); end + + # This calculates aggregate values in the given column. Methods for #count, #sum, #average, + # #minimum, and #maximum have been added as shortcuts. + # + # Person.calculate(:count, :all) # The same as Person.count + # Person.average(:age) # SELECT AVG(age) FROM people... + # + # # Selects the minimum age for any family without any minors + # Person.group(:last_name).having("min(age) > 17").minimum(:age) + # + # Person.sum("2 * age") + # + # There are two basic forms of output: + # + # * Single aggregate value: The single value is type cast to Integer for COUNT, Float + # for AVG, and the given column's type for everything else. + # + # * Grouped values: This returns an ordered hash of the values and groups them. It + # takes either a column name, or the name of a belongs_to association. + # + # values = Person.group('last_name').maximum(:age) + # puts values["Drake"] + # # => 43 + # + # drake = Family.find_by(last_name: 'Drake') + # values = Person.group(:family).maximum(:age) # Person belongs_to :family + # puts values[drake] + # # => 43 + # + # values.each do |family, max_age| + # ... + # end + # + # source://activerecord//lib/active_record/relation/calculations.rb#216 + def calculate(operation, column_name); end + + # Count the records. + # + # Person.count + # # => the total count of all people + # + # Person.count(:age) + # # => returns the total count of all people whose age is present in database + # + # Person.count(:all) + # # => performs a COUNT(*) (:all is an alias for '*') + # + # Person.distinct.count(:age) + # # => counts the number of different age values + # + # If +count+ is used with {Relation#group}[rdoc-ref:QueryMethods#group], + # it returns a Hash whose keys represent the aggregated column, + # and the values are the respective amounts: + # + # Person.group(:city).count + # # => { 'Rome' => 5, 'Paris' => 3 } + # + # If +count+ is used with {Relation#group}[rdoc-ref:QueryMethods#group] for multiple columns, it returns a Hash whose + # keys are an array containing the individual values of each column and the value + # of each key would be the count. + # + # Article.group(:status, :category).count + # # => {["draft", "business"]=>10, ["draft", "technology"]=>4, ["published", "technology"]=>2} + # + # If +count+ is used with {Relation#select}[rdoc-ref:QueryMethods#select], it will count the selected columns: + # + # Person.select(:age).count + # # => counts the number of different age values + # + # Note: not all valid {Relation#select}[rdoc-ref:QueryMethods#select] expressions are valid +count+ expressions. The specifics differ + # between databases. In invalid cases, an error from the database is thrown. + # + # When given a block, calls the block with each record in the relation and + # returns the number of records for which the block returns a truthy value. + # + # Person.count { |person| person.age > 21 } + # # => counts the number of people older that 21 + # + # If the relation hasn't been loaded yet, calling +count+ with a block will + # load all records in the relation. If there are a lot of records in the + # relation, loading all records could result in performance issues. + # + # source://activerecord//lib/active_record/relation/calculations.rb#94 + def count(column_name = T.unsafe(nil)); end + + # Returns the base model's ID's for the relation using the table's primary key + # + # Person.ids # SELECT people.id FROM people + # Person.joins(:company).ids # SELECT people.id FROM people INNER JOIN companies ON companies.id = people.company_id + # + # source://activerecord//lib/active_record/relation/calculations.rb#375 + def ids; end + + # Calculates the maximum value on a given column. The value is returned + # with the same data type of the column, or +nil+ if there's no row. See + # #calculate for examples with options. + # + # Person.maximum(:age) # => 93 + # + # source://activerecord//lib/active_record/relation/calculations.rb#146 + def maximum(column_name); end + + # Calculates the minimum value on a given column. The value is returned + # with the same data type of the column, or +nil+ if there's no row. See + # #calculate for examples with options. + # + # Person.minimum(:age) # => 7 + # + # source://activerecord//lib/active_record/relation/calculations.rb#131 + def minimum(column_name); end + + # Pick the value(s) from the named column(s) in the current relation. + # This is short-hand for relation.limit(1).pluck(*column_names).first, and is primarily useful + # when you have a relation that's already narrowed down to a single row. + # + # Just like #pluck, #pick will only load the actual value, not the entire record object, so it's also + # more efficient. The value is, again like with pluck, typecast by the column type. + # + # Person.where(id: 1).pick(:name) + # # SELECT people.name FROM people WHERE id = 1 LIMIT 1 + # # => 'David' + # + # Person.where(id: 1).pick(:name, :email_address) + # # SELECT people.name, people.email_address FROM people WHERE id = 1 LIMIT 1 + # # => [ 'David', 'david@loudthinking.com' ] + # + # source://activerecord//lib/active_record/relation/calculations.rb#356 + def pick(*column_names); end + + # Use #pluck as a shortcut to select one or more attributes without + # loading an entire record object per row. + # + # Person.pluck(:name) + # + # instead of + # + # Person.all.map(&:name) + # + # Pluck returns an Array of attribute values type-casted to match + # the plucked column names, if they can be deduced. Plucking an SQL fragment + # returns String values by default. + # + # Person.pluck(:name) + # # SELECT people.name FROM people + # # => ['David', 'Jeremy', 'Jose'] + # + # Person.pluck(:id, :name) + # # SELECT people.id, people.name FROM people + # # => [[1, 'David'], [2, 'Jeremy'], [3, 'Jose']] + # + # Person.distinct.pluck(:role) + # # SELECT DISTINCT role FROM people + # # => ['admin', 'member', 'guest'] + # + # Person.where(age: 21).limit(5).pluck(:id) + # # SELECT people.id FROM people WHERE people.age = 21 LIMIT 5 + # # => [2, 3] + # + # Comment.joins(:person).pluck(:id, person: :id) + # # SELECT comments.id, person.id FROM comments INNER JOIN people person ON person.id = comments.person_id + # # => [[1, 2], [2, 2]] + # + # Comment.joins(:person).pluck(:id, person: [:id, :name]) + # # SELECT comments.id, person.id, person.name FROM comments INNER JOIN people person ON person.id = comments.person_id + # # => [[1, 2, 'David'], [2, 2, 'David']] + # + # Person.pluck(Arel.sql('DATEDIFF(updated_at, created_at)')) + # # SELECT DATEDIFF(updated_at, created_at) FROM people + # # => ['0', '27761', '173'] + # + # Be aware that #pluck ignores any previous select clauses + # + # Person.select(:name).pluck(:id) + # # SELECT people.id FROM people + # + # See also #ids. + # + # source://activerecord//lib/active_record/relation/calculations.rb#295 + def pluck(*column_names); end + + # Calculates the sum of values on a given column. The value is returned + # with the same data type of the column, +0+ if there's no row. See + # #calculate for examples with options. + # + # Person.sum(:age) # => 4562 + # + # When given a block, calls the block with each record in the relation and + # returns the sum of +initial_value_or_column+ plus the block return values: + # + # Person.sum { |person| person.age } # => 4562 + # Person.sum(1000) { |person| person.age } # => 5562 + # + # If the relation hasn't been loaded yet, calling +sum+ with a block will + # load all records in the relation. If there are a lot of records in the + # relation, loading all records could result in performance issues. + # + # source://activerecord//lib/active_record/relation/calculations.rb#171 + def sum(initial_value_or_column = T.unsafe(nil), &block); end + + protected + + # source://activerecord//lib/active_record/relation/calculations.rb#418 + def aggregate_column(column_name); end + + private + + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation/calculations.rb#430 + def all_attributes?(column_names); end + + # source://activerecord//lib/active_record/relation/calculations.rb#675 + def build_count_subquery(relation, column_name, distinct); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation/calculations.rb#668 + def build_count_subquery?(operation, column_name, distinct); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation/calculations.rb#465 + def distinct_select?(column_name); end + + # source://activerecord//lib/active_record/relation/calculations.rb#528 + def execute_grouped_calculation(operation, column_name, distinct); end + + # source://activerecord//lib/active_record/relation/calculations.rb#483 + def execute_simple_calculation(operation, column_name, distinct); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation/calculations.rb#434 + def has_include?(column_name); end + + # source://activerecord//lib/active_record/relation/calculations.rb#615 + def lookup_cast_type_from_join_dependencies(name, join_dependencies = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation/calculations.rb#479 + def operation_over_aggregate_column(column, operation, distinct); end + + # source://activerecord//lib/active_record/relation/calculations.rb#438 + def perform_calculation(operation, column_name); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation/calculations.rb#469 + def possible_aggregation?(column_names); end + + # source://activerecord//lib/active_record/relation/calculations.rb#658 + def select_for_count; end + + # source://activerecord//lib/active_record/relation/calculations.rb#640 + def type_cast_calculated_value(value, operation, type); end + + # source://activerecord//lib/active_record/relation/calculations.rb#623 + def type_cast_pluck_values(result, columns); end + + # source://activerecord//lib/active_record/relation/calculations.rb#610 + def type_for(field, &block); end +end + +# source://activerecord//lib/active_record/relation/calculations.rb#8 +class ActiveRecord::Calculations::ColumnAliasTracker + # @return [ColumnAliasTracker] a new instance of ColumnAliasTracker + # + # source://activerecord//lib/active_record/relation/calculations.rb#9 + def initialize(connection); end + + # source://activerecord//lib/active_record/relation/calculations.rb#14 + def alias_for(field); end + + private + + # Converts the given field to the value that the database adapter returns as + # a usable column name: + # + # column_alias_for("users.id") # => "users_id" + # column_alias_for("sum(id)") # => "sum_id" + # column_alias_for("count(distinct users.id)") # => "count_distinct_users_id" + # column_alias_for("count(*)") # => "count_all" + # + # source://activerecord//lib/active_record/relation/calculations.rb#35 + def column_alias_for(field); end + + # source://activerecord//lib/active_record/relation/calculations.rb#44 + def truncate(name); end +end + +# = Active Record \Callbacks +# +# \Callbacks are hooks into the life cycle of an Active Record object that allow you to trigger logic +# before or after a change in the object state. This can be used to make sure that associated and +# dependent objects are deleted when {ActiveRecord::Base#destroy}[rdoc-ref:Persistence#destroy] is called (by overwriting +before_destroy+) or +# to massage attributes before they're validated (by overwriting +before_validation+). +# As an example of the callbacks initiated, consider the {ActiveRecord::Base#save}[rdoc-ref:Persistence#save] call for a new record: +# +# * (-) save +# * (-) valid +# * (1) before_validation +# * (-) validate +# * (2) after_validation +# * (3) before_save +# * (4) before_create +# * (-) create +# * (5) after_create +# * (6) after_save +# * (7) after_commit +# +# Also, an after_rollback callback can be configured to be triggered whenever a rollback is issued. +# Check out ActiveRecord::Transactions for more details about after_commit and +# after_rollback. +# +# Additionally, an after_touch callback is triggered whenever an +# object is touched. +# +# Lastly an after_find and after_initialize callback is triggered for each object that +# is found and instantiated by a finder, with after_initialize being triggered after new objects +# are instantiated as well. +# +# There are nineteen callbacks in total, which give a lot of control over how to react and prepare for each state in the +# Active Record life cycle. The sequence for calling {ActiveRecord::Base#save}[rdoc-ref:Persistence#save] for an existing record is similar, +# except that each _create callback is replaced by the corresponding _update callback. +# +# Examples: +# class CreditCard < ActiveRecord::Base +# # Strip everything but digits, so the user can specify "555 234 34" or +# # "5552-3434" and both will mean "55523434" +# before_validation(on: :create) do +# self.number = number.gsub(/[^0-9]/, "") if attribute_present?("number") +# end +# end +# +# class Subscription < ActiveRecord::Base +# before_create :record_signup +# +# private +# def record_signup +# self.signed_up_on = Date.today +# end +# end +# +# class Firm < ActiveRecord::Base +# # Disables access to the system, for associated clients and people when the firm is destroyed +# before_destroy { |record| Person.where(firm_id: record.id).update_all(access: 'disabled') } +# before_destroy { |record| Client.where(client_of: record.id).update_all(access: 'disabled') } +# end +# +# == Inheritable callback queues +# +# Besides the overwritable callback methods, it's also possible to register callbacks through the +# use of the callback macros. Their main advantage is that the macros add behavior into a callback +# queue that is kept intact through an inheritance hierarchy. +# +# class Topic < ActiveRecord::Base +# before_destroy :destroy_author +# end +# +# class Reply < Topic +# before_destroy :destroy_readers +# end +# +# When Topic#destroy is run only +destroy_author+ is called. When Reply#destroy is +# run, both +destroy_author+ and +destroy_readers+ are called. +# +# *IMPORTANT:* In order for inheritance to work for the callback queues, you must specify the +# callbacks before specifying the associations. Otherwise, you might trigger the loading of a +# child before the parent has registered the callbacks and they won't be inherited. +# +# == Types of callbacks +# +# There are three types of callbacks accepted by the callback macros: method references (symbol), callback objects, +# inline methods (using a proc). \Method references and callback objects are the recommended approaches, +# inline methods using a proc are sometimes appropriate (such as for creating mix-ins). +# +# The method reference callbacks work by specifying a protected or private method available in the object, like this: +# +# class Topic < ActiveRecord::Base +# before_destroy :delete_parents +# +# private +# def delete_parents +# self.class.delete_by(parent_id: id) +# end +# end +# +# The callback objects have methods named after the callback called with the record as the only parameter, such as: +# +# class BankAccount < ActiveRecord::Base +# before_save EncryptionWrapper.new +# after_save EncryptionWrapper.new +# after_initialize EncryptionWrapper.new +# end +# +# class EncryptionWrapper +# def before_save(record) +# record.credit_card_number = encrypt(record.credit_card_number) +# end +# +# def after_save(record) +# record.credit_card_number = decrypt(record.credit_card_number) +# end +# +# alias_method :after_initialize, :after_save +# +# private +# def encrypt(value) +# # Secrecy is committed +# end +# +# def decrypt(value) +# # Secrecy is unveiled +# end +# end +# +# So you specify the object you want to be messaged on a given callback. When that callback is triggered, the object has +# a method by the name of the callback messaged. You can make these callbacks more flexible by passing in other +# initialization data such as the name of the attribute to work with: +# +# class BankAccount < ActiveRecord::Base +# before_save EncryptionWrapper.new("credit_card_number") +# after_save EncryptionWrapper.new("credit_card_number") +# after_initialize EncryptionWrapper.new("credit_card_number") +# end +# +# class EncryptionWrapper +# def initialize(attribute) +# @attribute = attribute +# end +# +# def before_save(record) +# record.send("#{@attribute}=", encrypt(record.send("#{@attribute}"))) +# end +# +# def after_save(record) +# record.send("#{@attribute}=", decrypt(record.send("#{@attribute}"))) +# end +# +# alias_method :after_initialize, :after_save +# +# private +# def encrypt(value) +# # Secrecy is committed +# end +# +# def decrypt(value) +# # Secrecy is unveiled +# end +# end +# +# == before_validation* returning statements +# +# If the +before_validation+ callback throws +:abort+, the process will be +# aborted and {ActiveRecord::Base#save}[rdoc-ref:Persistence#save] will return +false+. +# If {ActiveRecord::Base#save!}[rdoc-ref:Persistence#save!] is called it will raise an ActiveRecord::RecordInvalid exception. +# Nothing will be appended to the errors object. +# +# == Canceling callbacks +# +# If a before_* callback throws +:abort+, all the later callbacks and +# the associated action are cancelled. +# \Callbacks are generally run in the order they are defined, with the exception of callbacks defined as +# methods on the model, which are called last. +# +# == Ordering callbacks +# +# Sometimes application code requires that callbacks execute in a specific order. For example, a +before_destroy+ +# callback (+log_children+ in this case) should be executed before records in the +children+ association are destroyed by the +# dependent: :destroy option. +# +# Let's look at the code below: +# +# class Topic < ActiveRecord::Base +# has_many :children, dependent: :destroy +# +# before_destroy :log_children +# +# private +# def log_children +# # Child processing +# end +# end +# +# In this case, the problem is that when the +before_destroy+ callback is executed, records in the +children+ association no +# longer exist because the {ActiveRecord::Base#destroy}[rdoc-ref:Persistence#destroy] callback was executed first. +# You can use the +prepend+ option on the +before_destroy+ callback to avoid this. +# +# class Topic < ActiveRecord::Base +# has_many :children, dependent: :destroy +# +# before_destroy :log_children, prepend: true +# +# private +# def log_children +# # Child processing +# end +# end +# +# This way, the +before_destroy+ is executed before the dependent: :destroy is called, and the data is still available. +# +# Also, there are cases when you want several callbacks of the same type to +# be executed in order. +# +# For example: +# +# class Topic < ActiveRecord::Base +# has_many :children +# +# after_save :log_children +# after_save :do_something_else +# +# private +# def log_children +# # Child processing +# end +# +# def do_something_else +# # Something else +# end +# end +# +# In this case the +log_children+ is executed before +do_something_else+. +# This applies to all non-transactional callbacks, and to +before_commit+. +# +# For transactional +after_+ callbacks (+after_commit+, +after_rollback+, etc), the order +# can be set via configuration. +# +# config.active_record.run_after_transaction_callbacks_in_order_defined = false +# +# When set to +true+ (the default from \Rails 7.1), callbacks are executed in the order they +# are defined, just like the example above. When set to +false+, the order is reversed, so +# +do_something_else+ is executed before +log_children+. +# +# == \Transactions +# +# The entire callback chain of a {#save}[rdoc-ref:Persistence#save], {#save!}[rdoc-ref:Persistence#save!], +# or {#destroy}[rdoc-ref:Persistence#destroy] call runs within a transaction. That includes after_* hooks. +# If everything goes fine a +COMMIT+ is executed once the chain has been completed. +# +# If a before_* callback cancels the action a +ROLLBACK+ is issued. You +# can also trigger a +ROLLBACK+ raising an exception in any of the callbacks, +# including after_* hooks. Note, however, that in that case the client +# needs to be aware of it because an ordinary {#save}[rdoc-ref:Persistence#save] will raise such exception +# instead of quietly returning +false+. +# +# == Debugging callbacks +# +# The callback chain is accessible via the _*_callbacks method on an object. Active Model \Callbacks support +# :before, :after and :around as values for the kind property. The kind property +# defines what part of the chain the callback runs in. +# +# To find all callbacks in the +before_save+ callback chain: +# +# Topic._save_callbacks.select { |cb| cb.kind.eql?(:before) } +# +# Returns an array of callback objects that form the +before_save+ chain. +# +# To further check if the before_save chain contains a proc defined as rest_when_dead use the filter property of the callback object: +# +# Topic._save_callbacks.select { |cb| cb.kind.eql?(:before) }.collect(&:filter).include?(:rest_when_dead) +# +# Returns true or false depending on whether the proc is contained in the +before_save+ callback chain on a Topic model. +# +# source://activerecord//lib/active_record/callbacks.rb#278 +module ActiveRecord::Callbacks + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActiveSupport::Callbacks + include ::ActiveModel::Validations::Callbacks + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveRecord::Callbacks::ClassMethods + mixes_in_class_methods ::ActiveModel::Validations::Callbacks::ClassMethods + mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods + mixes_in_class_methods ::ActiveSupport::DescendantsTracker + + # source://activerecord//lib/active_record/callbacks.rb#419 + def destroy; end + + # source://activerecord//lib/active_record/callbacks.rb#435 + def increment!(attribute, by = T.unsafe(nil), touch: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/callbacks.rb#431 + def touch(*_arg0, **_arg1); end + + private + + # source://activerecord//lib/active_record/callbacks.rb#444 + def _create_record; end + + # source://activerecord//lib/active_record/callbacks.rb#448 + def _update_record; end + + # source://activerecord//lib/active_record/callbacks.rb#440 + def create_or_update(**_arg0); end + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + end + + module GeneratedInstanceMethods + def __callbacks; end + end +end + +# source://activerecord//lib/active_record/callbacks.rb#281 +ActiveRecord::Callbacks::CALLBACKS = T.let(T.unsafe(nil), Array) + +# source://activerecord//lib/active_record/callbacks.rb#288 +module ActiveRecord::Callbacks::ClassMethods + include ::ActiveModel::Callbacks +end + +# Raised when a record cannot be inserted or updated because it would violate a check constraint. +# +# source://activerecord//lib/active_record/errors.rb#296 +class ActiveRecord::CheckViolation < ::ActiveRecord::StatementInvalid; end + +# source://activerecord//lib/active_record.rb#126 +module ActiveRecord::Coders; end + +# source://activerecord//lib/active_record/coders/column_serializer.rb#5 +class ActiveRecord::Coders::ColumnSerializer + # @return [ColumnSerializer] a new instance of ColumnSerializer + # + # source://activerecord//lib/active_record/coders/column_serializer.rb#9 + def initialize(attr_name, coder, object_class = T.unsafe(nil)); end + + # Public because it's called by Type::Serialized + # + # source://activerecord//lib/active_record/coders/column_serializer.rb#46 + def assert_valid_value(object, action:); end + + # Returns the value of attribute coder. + # + # source://activerecord//lib/active_record/coders/column_serializer.rb#7 + def coder; end + + # source://activerecord//lib/active_record/coders/column_serializer.rb#22 + def dump(object); end + + # source://activerecord//lib/active_record/coders/column_serializer.rb#16 + def init_with(coder); end + + # source://activerecord//lib/active_record/coders/column_serializer.rb#29 + def load(payload); end + + # Returns the value of attribute object_class. + # + # source://activerecord//lib/active_record/coders/column_serializer.rb#6 + def object_class; end + + private + + # source://activerecord//lib/active_record/coders/column_serializer.rb#54 + def check_arity_of_constructor; end +end + +# source://activerecord//lib/active_record/coders/json.rb#7 +class ActiveRecord::Coders::JSON + # @return [JSON] a new instance of JSON + # + # source://activerecord//lib/active_record/coders/json.rb#10 + def initialize(options = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/coders/json.rb#15 + def dump(obj); end + + # source://activerecord//lib/active_record/coders/json.rb#19 + def load(json); end +end + +# source://activerecord//lib/active_record/coders/json.rb#8 +ActiveRecord::Coders::JSON::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# source://activerecord//lib/active_record/coders/yaml_column.rb#7 +class ActiveRecord::Coders::YAMLColumn < ::ActiveRecord::Coders::ColumnSerializer + # @return [YAMLColumn] a new instance of YAMLColumn + # + # source://activerecord//lib/active_record/coders/yaml_column.rb#59 + def initialize(attr_name, object_class = T.unsafe(nil), permitted_classes: T.unsafe(nil), unsafe_load: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/coders/yaml_column.rb#77 + def coder; end + + # source://activerecord//lib/active_record/coders/yaml_column.rb#68 + def init_with(coder); end + + private + + # source://activerecord//lib/active_record/coders/yaml_column.rb#88 + def check_arity_of_constructor; end +end + +# source://activerecord//lib/active_record/coders/yaml_column.rb#8 +class ActiveRecord::Coders::YAMLColumn::SafeCoder + # @return [SafeCoder] a new instance of SafeCoder + # + # source://activerecord//lib/active_record/coders/yaml_column.rb#9 + def initialize(permitted_classes: T.unsafe(nil), unsafe_load: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/coders/yaml_column.rb#15 + def dump(object); end + + # source://activerecord//lib/active_record/coders/yaml_column.rb#33 + def load(payload); end +end + +# source://activerecord//lib/active_record/associations/errors.rb#187 +class ActiveRecord::CompositePrimaryKeyMismatchError < ::ActiveRecord::ActiveRecordError + # @return [CompositePrimaryKeyMismatchError] a new instance of CompositePrimaryKeyMismatchError + # + # source://activerecord//lib/active_record/associations/errors.rb#190 + def initialize(reflection = T.unsafe(nil)); end + + # Returns the value of attribute reflection. + # + # source://activerecord//lib/active_record/associations/errors.rb#188 + def reflection; end +end + +# source://activerecord//lib/active_record/migration.rb#186 +class ActiveRecord::ConcurrentMigrationError < ::ActiveRecord::MigrationError + # @return [ConcurrentMigrationError] a new instance of ConcurrentMigrationError + # + # source://activerecord//lib/active_record/migration.rb#190 + def initialize(message = T.unsafe(nil)); end +end + +# source://activerecord//lib/active_record/migration.rb#187 +ActiveRecord::ConcurrentMigrationError::DEFAULT_MESSAGE = T.let(T.unsafe(nil), String) + +# source://activerecord//lib/active_record/migration.rb#188 +ActiveRecord::ConcurrentMigrationError::RELEASE_LOCK_FAILED_MESSAGE = T.let(T.unsafe(nil), String) + +# Raised when association is being configured improperly or user tries to use +# offset and limit together with +# {ActiveRecord::Base.has_many}[rdoc-ref:Associations::ClassMethods#has_many] or +# {ActiveRecord::Base.has_and_belongs_to_many}[rdoc-ref:Associations::ClassMethods#has_and_belongs_to_many] +# associations. +# +# source://activerecord//lib/active_record/errors.rb#397 +class ActiveRecord::ConfigurationError < ::ActiveRecord::ActiveRecordError; end + +# source://activerecord//lib/active_record/connection_adapters.rb#6 +module ActiveRecord::ConnectionAdapters + extend ::ActiveSupport::Autoload + + class << self + # Registers a custom database adapter. + # + # Can also be used to define aliases. + # + # == Example + # + # ActiveRecord::ConnectionAdapters.register("megadb", "MegaDB::ActiveRecordAdapter", "mega_db/active_record_adapter") + # + # ActiveRecord::ConnectionAdapters.register("mysql", "ActiveRecord::ConnectionAdapters::TrilogyAdapter", "active_record/connection_adapters/trilogy_adapter") + # + # source://activerecord//lib/active_record/connection_adapters.rb#22 + def register(name, class_name, path = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters.rb#26 + def resolve(adapter_name); end + end +end + +# = Active Record Abstract Adapter +# +# Active Record supports multiple database systems. AbstractAdapter and +# related classes form the abstraction layer which makes this possible. +# An AbstractAdapter represents a connection to a database, and provides an +# abstract interface for database-specific functionality such as establishing +# a connection, escaping values, building the right SQL fragments for +:offset+ +# and +:limit+ options, etc. +# +# All the concrete database adapters follow the interface laid down in this class. +# {ActiveRecord::Base.lease_connection}[rdoc-ref:ConnectionHandling#lease_connection] returns an AbstractAdapter object, which +# you can use. +# +# Most of the methods in the adapter are useful during migrations. Most +# notably, the instance methods provided by SchemaStatements are very useful. +# +# source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#31 +class ActiveRecord::ConnectionAdapters::AbstractAdapter + include ::ActiveSupport::Callbacks + include ::ActiveRecord::Migration::JoinTable + include ::ActiveRecord::ConnectionAdapters::SchemaStatements + include ::ActiveRecord::ConnectionAdapters::DatabaseStatements + include ::ActiveRecord::ConnectionAdapters::Quoting + include ::ActiveRecord::ConnectionAdapters::DatabaseLimits + include ::ActiveRecord::ConnectionAdapters::QueryCache + include ::ActiveRecord::ConnectionAdapters::Savepoints + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::ActiveSupport::DescendantsTracker + extend ::ActiveRecord::ConnectionAdapters::Quoting::ClassMethods + + # @return [AbstractAdapter] a new instance of AbstractAdapter + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#132 + def initialize(config_or_deprecated_connection, deprecated_logger = T.unsafe(nil), deprecated_connection_options = T.unsafe(nil), deprecated_config = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#33 + def __callbacks; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#34 + def _checkin_callbacks; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#34 + def _checkout_callbacks; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#34 + def _run_checkin_callbacks; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#34 + def _run_checkin_callbacks!(&block); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#34 + def _run_checkout_callbacks; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#34 + def _run_checkout_callbacks!(&block); end + + # Checks whether the connection to the database is still active. This includes + # checking whether the database is actually capable of responding, i.e. whether + # the connection isn't stale. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#705 + def active?; end + + # Returns the human-readable name of the adapter. Use mixed case - one + # can always use downcase if needed. + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#398 + def adapter_name; end + + # This is meant to be implemented by the adapters that support custom enum types + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#637 + def add_enum_value(*_arg0, **_arg1, &_arg2); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#652 + def advisory_locks_enabled?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#46 + def allow_preconnect; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#56 + def allow_preconnect=(value); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#611 + def async_enabled?; end + + # Called by ActiveRecord::InsertAll, + # Passed an instance of ActiveRecord::InsertAll::Builder, + # This method implements standard bulk inserts for all databases, but + # should be overridden by adapters to implement common features with + # non-standard syntax like handling duplicates or returning values. + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#905 + def build_insert_sql(insert); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#876 + def case_insensitive_comparison(attribute, value); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#872 + def case_sensitive_comparison(attribute, value); end + + # Override to check all foreign key constraints in a database. + # The adapter should raise a +ActiveRecord::StatementInvalid+ if foreign key + # constraints are not met. + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#690 + def check_all_foreign_keys_valid!; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#920 + def check_version; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#838 + def clean!; end + + # Clear any caching the database adapter may be doing. + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#792 + def clear_cache!(new_connection: T.unsafe(nil)); end + + # Check the connection back in to the connection pool + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#892 + def close; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#833 + def connect!; end + + # Checks whether the connection to the database was established. This doesn't + # include checking whether the database is actually capable of responding, i.e. + # whether the connection is stale. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#698 + def connected?; end + + # Seconds since this connection was established. nil if not + # connected; infinity if the connection has been explicitly + # retired. + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#377 + def connection_age; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#304 + def connection_descriptor; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#221 + def connection_retries; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#38 + def create(*_arg0, **_arg1, &_arg2); end + + # This is meant to be implemented by the adapters that support custom enum types + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#625 + def create_enum(*_arg0, **_arg1, &_arg2); end + + # This is meant to be implemented by the adapters that support virtual tables + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#645 + def create_virtual_table(*_arg0); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#407 + def database_exists?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#916 + def database_version; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#896 + def default_index_type?(index); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#237 + def default_timezone; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#868 + def default_uniqueness_comparison(attribute, value); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#38 + def delete(*_arg0, **_arg1, &_arg2); end + + # This is meant to be implemented by the adapters that support extensions + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#617 + def disable_extension(name, **_arg1); end + + # Override to turn off referential integrity while executing &block. + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#683 + def disable_referential_integrity; end + + # Immediately forget this connection ever existed. Unlike disconnect!, + # this will not communicate with the server. + # + # After calling this method, the behavior of all other methods becomes + # undefined. This is called internally just before a forked process gets + # rid of a connection that belonged to its parent. + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#767 + def discard!; end + + # Disconnects from the database if already connected. Otherwise, this + # method does nothing. + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#752 + def disconnect!; end + + # This is meant to be implemented by the adapters that support custom enum types + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#629 + def drop_enum(*_arg0, **_arg1, &_arg2); end + + # This is meant to be implemented by the adapters that support virtual tables + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#649 + def drop_virtual_table(*_arg0); end + + # This is meant to be implemented by the adapters that support extensions + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#621 + def enable_extension(name, **_arg1); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#206 + def ensure_writes_are_allowed(sql); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#38 + def exec_insert_all(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#38 + def exec_query(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#38 + def execute(*_arg0, **_arg1, &_arg2); end + + # this method must only be called while holding connection pool's mutex + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#329 + def expire(update_idle = T.unsafe(nil)); end + + # A list of extensions, to be filled in by adapters that support them. + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#671 + def extensions; end + + # Mark the connection as needing to be retired, as if the age has + # exceeded the maximum allowed. + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#385 + def force_retirement; end + + # This is meant to be implemented by the adapters that support advisory + # locks + # + # Return true if we got the lock, otherwise false + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#660 + def get_advisory_lock(lock_id); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#913 + def get_database_version; end + + # Returns the value of attribute owner. + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#48 + def in_use?; end + + # A list of index algorithms, to be filled by adapters that support them. + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#676 + def index_algorithms; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#38 + def insert(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#187 + def inspect; end + + # this method must only be called while holding connection pool's mutex + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#289 + def lease; end + + # Returns the value of attribute lock. + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#45 + def lock; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#194 + def lock_thread=(lock_thread); end + + # Returns the value of attribute logger. + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#45 + def logger; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#213 + def max_jitter; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#284 + def native_database_types; end + + # Returns the value of attribute owner. + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#45 + def owner; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#47 + def pinned; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#47 + def pinned=(_arg0); end + + # Returns the value of attribute pool. + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#44 + def pool; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#50 + def pool=(value); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#324 + def pool_jitter(duration); end + + # Should primary key values be selected from their corresponding + # sequence before the insert statement? If true, next_sequence_value + # is called before each insert to set the record's primary key. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#447 + def prefetch_primary_key?(table_name = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#255 + def prepared_statements; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#252 + def prepared_statements?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#257 + def prepared_statements_disabled_cache; end + + # Determines whether writes are currently being prevented. + # + # Returns true if the connection is a replica or returns + # the value of +current_preventing_writes+. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#245 + def preventing_writes?; end + + # Provides access to the underlying database driver for this adapter. For + # example, this method returns a Mysql2::Client object in case of Mysql2Adapter, + # and a PG::Connection object in case of PostgreSQLAdapter. + # + # This is useful for when you need to call a proprietary method such as + # PostgreSQL's lo_* methods. + # + # Active Record cannot track if the database is getting modified using + # this client. If that is the case, generally you'll want to invalidate + # the query cache using +ActiveRecord::Base.clear_query_cache+. + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#860 + def raw_connection; end + + # Disconnects from the database if already connected, and establishes a new + # connection with the database. Implementors should define private #reconnect + # instead. + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#711 + def reconnect!(restore_transactions: T.unsafe(nil)); end + + # This is meant to be implemented by the adapters that support advisory + # locks. + # + # Return true if we released the lock, otherwise false + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#667 + def release_advisory_lock(lock_id); end + + # This is meant to be implemented by the adapters that support custom enum types + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#633 + def rename_enum(*_arg0, **_arg1, &_arg2); end + + # This is meant to be implemented by the adapters that support custom enum types + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#641 + def rename_enum_value(*_arg0, **_arg1, &_arg2); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#217 + def replica?; end + + # Returns true if its required to reload the connection between requests for development mode. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#805 + def requires_reloading?; end + + # Reset the state of this connection, directing the DBMS to clear + # transactions and other connection-related server-side state. Usually a + # database-dependent operation. + # + # If a database driver or protocol does not support such a feature, + # implementors may alias this to #reconnect!. Otherwise, implementors + # should call super immediately after resetting the connection (and while + # still holding @lock). + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#779 + def reset!; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#38 + def restart_db_transaction(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#229 + def retry_deadline; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#607 + def return_value_after_insert?(column); end + + # The role (e.g. +:writing+) for the current connection. In a + # non-multi role application, +:writing+ is returned. + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#310 + def role; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#38 + def rollback_db_transaction(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#38 + def rollback_to_savepoint(*_arg0, **_arg1, &_arg2); end + + # Do TransactionRollbackErrors on savepoints affect the parent + # transaction? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#431 + def savepoint_errors_invalidate_transactions?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#320 + def schema_cache; end + + # Returns the version identifier of the schema currently available in + # the database. This is generally equal to the number of the highest- + # numbered migration that has been executed, or 0 if no schema + # information is present / the database is empty. + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#927 + def schema_version; end + + # Seconds since this connection was returned to the pool + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#362 + def seconds_idle; end + + # Seconds since this connection last communicated with the server + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#368 + def seconds_since_last_activity; end + + # The shard (e.g. +:default+) for the current connection. In + # a non-sharded application, +:default+ is returned. + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#316 + def shard; end + + # this method must only be called while holding connection pool's mutex (and a desire for segfaults) + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#349 + def steal!; end + + # Does this adapter support application-enforced advisory locking? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#440 + def supports_advisory_locks?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#420 + def supports_bulk_alter?; end + + # Does this adapter support creating check constraints? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#512 + def supports_check_constraints?; end + + # Does this adapter support metadata comments on database objects (tables, columns, indexes)? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#547 + def supports_comments?; end + + # Can comments for tables, columns, and indexes be specified in create/alter table statements? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#552 + def supports_comments_in_create?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#571 + def supports_common_table_expressions?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#595 + def supports_concurrent_connections?; end + + # Does this adapter support datetime with precision? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#537 + def supports_datetime_with_precision?; end + + # Does this adapter support DDL rollbacks in transactions? That is, would + # CREATE TABLE or ALTER TABLE get rolled back by a transaction? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#416 + def supports_ddl_transactions?; end + + # Does this adapter support creating deferrable constraints? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#507 + def supports_deferrable_constraints?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#603 + def supports_disabling_indexes?; end + + # Does this adapter support creating exclusion constraints? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#517 + def supports_exclusion_constraints?; end + + # Does this adapter support explain? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#476 + def supports_explain?; end + + # Does this adapter support expression indices? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#471 + def supports_expression_index?; end + + # Does this adapter support database extensions? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#486 + def supports_extensions?; end + + # Does this adapter support creating foreign key constraints? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#497 + def supports_foreign_keys?; end + + # Does this adapter support foreign/external tables? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#562 + def supports_foreign_tables?; end + + # Does this adapter support including non-key columns? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#466 + def supports_index_include?; end + + # Does this adapter support index sort order? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#456 + def supports_index_sort_order?; end + + # Does this adapter support creating indexes in the same statement as + # creating the table? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#492 + def supports_indexes_in_create?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#591 + def supports_insert_conflict_target?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#583 + def supports_insert_on_duplicate_skip?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#587 + def supports_insert_on_duplicate_update?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#579 + def supports_insert_returning?; end + + # Does this adapter support JSON data type? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#542 + def supports_json?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#575 + def supports_lazy_transactions?; end + + # Does this adapter support materialized views? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#532 + def supports_materialized_views?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#599 + def supports_nulls_not_distinct?; end + + # Does this adapter support optimizer hints? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#567 + def supports_optimizer_hints?; end + + # Does this adapter support partial indices? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#461 + def supports_partial_index?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#451 + def supports_partitioned_indexes?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#435 + def supports_restart_db_transaction?; end + + # Does this adapter support savepoints? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#425 + def supports_savepoints?; end + + # Does this adapter support setting the isolation level for a transaction? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#481 + def supports_transaction_isolation?; end + + # Does this adapter support creating unique constraints? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#522 + def supports_unique_constraints?; end + + # Does this adapter support creating invalid constraints? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#502 + def supports_validate_constraints?; end + + # Does this adapter support views? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#527 + def supports_views?; end + + # Does this adapter support virtual columns? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#557 + def supports_virtual_columns?; end + + # Removes the connection from the pool and disconnect it. + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#786 + def throw_away!; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#38 + def truncate(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#38 + def truncate_tables(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#389 + def unprepared_statement; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#38 + def update(*_arg0, **_arg1, &_arg2); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#280 + def valid_type?(type); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#846 + def verified?; end + + # Checks whether the connection to the database is still active (i.e. not stale). + # This is done under the hood by calling #active?. If the connection + # is no longer active, then this method will reconnect to the database. + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#812 + def verify!; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#225 + def verify_timeout; end + + # Returns the value of attribute visitor. + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#45 + def visitor; end + + private + + # Returns a raw connection for internal use with methods that are known + # to both be thread-safe and not rely upon actual server communication. + # This is useful for e.g. string escaping methods. + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#1155 + def any_raw_connection; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#1258 + def arel_visitor; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#1284 + def attempt_configure_connection; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#1144 + def backoff(counter); end + + # Builds the result object. + # + # This is an internal hook to make possible connection adapters to build + # custom result objects with connection-specific data. + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#1269 + def build_result(columns:, rows:, column_types: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#1262 + def build_statement_pool; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#886 + def can_perform_case_insensitive_comparison_for?(column); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#1244 + def collector; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#1233 + def column_for(table_name, column_name); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#1239 + def column_for_attribute(attribute); end + + # Perform any necessary initialization upon the newly-established + # connection settings, run queries to configure any application-global + # "session" variables, etc. + # + # Implementations may assume this method will only be called while + # holding @lock (or from #initialize). + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#1280 + def configure_connection; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#1291 + def default_prepared_statements; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#1172 + def extended_type_map_key; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#1219 + def instrumenter; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#1130 + def invalidate_transaction(exception); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#1200 + def log(sql, name = T.unsafe(nil), binds = T.unsafe(nil), type_casted_binds = T.unsafe(nil), async: T.unsafe(nil), allow_retry: T.unsafe(nil), &block); end + + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#1148 + def reconnect; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#1012 + def reconnect_can_restore_state?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#1125 + def retryable_connection_error?(exception); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#1137 + def retryable_query_error?(exception); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#1223 + def translate_exception(exception, message:, sql:, binds:); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#1188 + def translate_exception_class(native_error, sql, binds); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#1178 + def type_map; end + + # Similar to any_raw_connection, but ensures it is validated and + # connected. Any method called on this result still needs to be + # independently thread-safe, so it probably shouldn't talk to the + # server... but some drivers fail if they know the connection has gone + # away. + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#1164 + def valid_raw_connection; end + + # Mark the connection as verified. Call this inside a + # `with_raw_connection` block only when the block is guaranteed to + # exercise the raw connection. + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#1120 + def verified!; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#1295 + def warning_ignored?(warning); end + + # Lock the monitor, ensure we're properly connected and + # transactions are materialized, and then yield the underlying + # raw connection object. + # + # If +allow_retry+ is true, a connection-related exception will + # cause an automatic reconnect and re-run of the block, up to + # the connection's configured +connection_retries+ setting + # and the configured +retry_deadline+ limit. (Note that when + # +allow_retry+ is true, it's possible to return without having marked + # the connection as verified. If the block is guaranteed to exercise the + # connection, consider calling `verified!` to avoid needless + # verification queries in subsequent calls.) + # + # If +materialize_transactions+ is false, the block will be run without + # ensuring virtual transactions have been materialized in the DB + # server's state. The active transaction will also remain clean + # (if it is not already dirty), meaning it's able to be restored + # by reconnecting and opening an equivalent-depth set of new + # transactions. This should only be used by transaction control + # methods, and internal transaction-agnostic queries. + # + # + # + # It's not the primary use case, so not something to optimize + # for, but note that this method does need to be re-entrant: + # +materialize_transactions+ will re-enter if it has work to do, + # and the yield block can also do so under some circumstances. + # + # In the latter case, we really ought to guarantee the inner + # call will not reconnect (which would interfere with the + # still-yielded connection in the outer block), but we currently + # provide no special enforcement there. + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#1049 + def with_raw_connection(allow_retry: T.unsafe(nil), materialize_transactions: T.unsafe(nil)); end + + class << self + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#33 + def __callbacks; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#33 + def __callbacks=(value); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#34 + def _checkin_callbacks; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#34 + def _checkin_callbacks=(value); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#34 + def _checkout_callbacks; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#34 + def _checkout_callbacks=(value); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#93 + def build_read_query_regexp(*parts); end + + # Does the database for this adapter exist? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#403 + def database_exists?(config); end + + # Opens a database console session. + # + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#128 + def dbconsole(config, options = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#939 + def extended_type_map(default_timezone:); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#99 + def find_cmd_and_exec(commands, *args); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#932 + def register_class_with_precision(mapping, key, klass, **kwargs); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#72 + def type_cast_config_to_boolean(config); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#62 + def type_cast_config_to_integer(config); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#947 + def valid_type?(type); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#80 + def validate_default_timezone(config); end + + private + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#33 + def __class_attr___callbacks; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#33 + def __class_attr___callbacks=(new_value); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#1003 + def extract_limit(sql_type); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#999 + def extract_precision(sql_type); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#992 + def extract_scale(sql_type); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#952 + def initialize_type_map(m); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#985 + def register_class_with_limit(mapping, key, klass); end + end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#32 +ActiveRecord::ConnectionAdapters::AbstractAdapter::ADAPTER_NAME = T.let(T.unsafe(nil), String) + +# source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#42 +ActiveRecord::ConnectionAdapters::AbstractAdapter::COMMENT_REGEX = T.let(T.unsafe(nil), Regexp) + +# source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#90 +ActiveRecord::ConnectionAdapters::AbstractAdapter::DEFAULT_READ_QUERY = T.let(T.unsafe(nil), Array) + +# source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#1009 +ActiveRecord::ConnectionAdapters::AbstractAdapter::EXTENDED_TYPE_MAPS = T.let(T.unsafe(nil), Concurrent::Map) + +# source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#212 +ActiveRecord::ConnectionAdapters::AbstractAdapter::MAX_JITTER = T.let(T.unsafe(nil), Range) + +# source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#41 +ActiveRecord::ConnectionAdapters::AbstractAdapter::SIMPLE_INT = T.let(T.unsafe(nil), Regexp) + +# source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#1008 +ActiveRecord::ConnectionAdapters::AbstractAdapter::TYPE_MAP = T.let(T.unsafe(nil), ActiveRecord::Type::TypeMap) + +# source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#261 +class ActiveRecord::ConnectionAdapters::AbstractAdapter::Version + include ::Comparable + + # @return [Version] a new instance of Version + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#266 + def initialize(version_string, full_version_string = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#271 + def <=>(version_string); end + + # Returns the value of attribute full_version_string. + # + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#264 + def full_version_string; end + + # source://activerecord//lib/active_record/connection_adapters/abstract_adapter.rb#275 + def to_s; end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#117 +class ActiveRecord::ConnectionAdapters::AddColumnDefinition < ::Struct + # Returns the value of attribute column + # + # @return [Object] the current value of column + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#117 + def column; end + + # Sets the attribute column + # + # @param value [Object] the value to set the attribute column to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#117 + def column=(_); end + + class << self + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#117 + def [](*_arg0); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#117 + def inspect; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#117 + def keyword_init?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#117 + def members; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#117 + def new(*_arg0); end + end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#616 +class ActiveRecord::ConnectionAdapters::AlterTable + # @return [AlterTable] a new instance of AlterTable + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#622 + def initialize(td); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#642 + def add_check_constraint(expression, options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#654 + def add_column(name, type, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#634 + def add_foreign_key(to_table, options); end + + # Returns the value of attribute adds. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#617 + def adds; end + + # Returns the value of attribute check_constraint_adds. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#619 + def check_constraint_adds; end + + # Returns the value of attribute check_constraint_drops. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#619 + def check_constraint_drops; end + + # Returns the value of attribute constraint_drops. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#620 + def constraint_drops; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#646 + def drop_check_constraint(constraint_name); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#650 + def drop_constraint(constraint_name); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#638 + def drop_foreign_key(name); end + + # Returns the value of attribute foreign_key_adds. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#618 + def foreign_key_adds; end + + # Returns the value of attribute foreign_key_drops. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#618 + def foreign_key_drops; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#632 + def name; end +end + +# source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#143 +class ActiveRecord::ConnectionAdapters::BoundSchemaReflection + # @return [BoundSchemaReflection] a new instance of BoundSchemaReflection + # + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#160 + def initialize(abstract_schema_reflection, pool); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#185 + def add(name); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#173 + def cached?(table_name); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#165 + def clear!; end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#217 + def clear_data_source_cache!(name); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#193 + def columns(table_name); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#197 + def columns_hash(table_name); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#201 + def columns_hash?(table_name); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#181 + def data_source_exists?(name); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#189 + def data_sources(name); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#221 + def dump_to(filename); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#205 + def indexes(table_name); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#169 + def load!; end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#177 + def primary_keys(table_name); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#213 + def size; end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#209 + def version; end + + class << self + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#155 + def for_lone_connection(abstract_schema_reflection, connection); end + end +end + +# :nodoc +# +# source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#144 +class ActiveRecord::ConnectionAdapters::BoundSchemaReflection::FakePool + # @return [FakePool] a new instance of FakePool + # + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#145 + def initialize(connection); end + + # @yield [@connection] + # + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#149 + def with_connection; end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#121 +class ActiveRecord::ConnectionAdapters::ChangeColumnDefaultDefinition < ::Struct + # Returns the value of attribute column + # + # @return [Object] the current value of column + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#121 + def column; end + + # Sets the attribute column + # + # @param value [Object] the value to set the attribute column to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#121 + def column=(_); end + + # Returns the value of attribute default + # + # @return [Object] the current value of default + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#121 + def default; end + + # Sets the attribute default + # + # @param value [Object] the value to set the attribute default to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#121 + def default=(_); end + + class << self + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#121 + def [](*_arg0); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#121 + def inspect; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#121 + def keyword_init?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#121 + def members; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#121 + def new(*_arg0); end + end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#119 +class ActiveRecord::ConnectionAdapters::ChangeColumnDefinition < ::Struct + # Returns the value of attribute column + # + # @return [Object] the current value of column + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#119 + def column; end + + # Sets the attribute column + # + # @param value [Object] the value to set the attribute column to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#119 + def column=(_); end + + # Returns the value of attribute name + # + # @return [Object] the current value of name + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#119 + def name; end + + # Sets the attribute name + # + # @param value [Object] the value to set the attribute name to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#119 + def name=(_); end + + class << self + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#119 + def [](*_arg0); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#119 + def inspect; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#119 + def keyword_init?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#119 + def members; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#119 + def new(*_arg0); end + end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#179 +class ActiveRecord::ConnectionAdapters::CheckConstraintDefinition < ::Struct + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#193 + def defined_for?(name:, expression: T.unsafe(nil), validate: T.unsafe(nil), **options); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#189 + def export_name_on_schema_dump?; end + + # Returns the value of attribute expression + # + # @return [Object] the current value of expression + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#179 + def expression; end + + # Sets the attribute expression + # + # @param value [Object] the value to set the attribute expression to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#179 + def expression=(_); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#180 + def name; end + + # Returns the value of attribute options + # + # @return [Object] the current value of options + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#179 + def options; end + + # Sets the attribute options + # + # @param value [Object] the value to set the attribute options to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#179 + def options=(_); end + + # Returns the value of attribute table_name + # + # @return [Object] the current value of table_name + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#179 + def table_name; end + + # Sets the attribute table_name + # + # @param value [Object] the value to set the attribute table_name to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#179 + def table_name=(_); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#184 + def validate?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#187 + def validated?; end + + class << self + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#179 + def [](*_arg0); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#179 + def inspect; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#179 + def keyword_init?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#179 + def members; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#179 + def new(*_arg0); end + end +end + +# An abstract definition of a column in a table. +# +# source://activerecord//lib/active_record/connection_adapters/column.rb#7 +class ActiveRecord::ConnectionAdapters::Column + include ::ActiveRecord::ConnectionAdapters::Deduplicable + extend ::ActiveRecord::ConnectionAdapters::Deduplicable::ClassMethods + + # Instantiates a new column in the table. + # + # +name+ is the column's name, such as supplier_id in supplier_id bigint. + # +default+ is the type-casted default value, such as +new+ in sales_stage varchar(20) default 'new'. + # +sql_type_metadata+ is various information about the type of the column + # +null+ determines if this column allows +NULL+ values. + # + # @return [Column] a new instance of Column + # + # source://activerecord//lib/active_record/connection_adapters/column.rb#20 + def initialize(name, cast_type, default, sql_type_metadata = T.unsafe(nil), null = T.unsafe(nil), default_function = T.unsafe(nil), collation: T.unsafe(nil), comment: T.unsafe(nil), **_arg8); end + + # source://activerecord//lib/active_record/connection_adapters/column.rb#83 + def ==(other); end + + # whether the column is auto-populated by the database using a sequence + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/column.rb#75 + def auto_incremented_by_db?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/column.rb#79 + def auto_populated?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/column.rb#40 + def bigint?; end + + # Returns the value of attribute collation. + # + # source://activerecord//lib/active_record/connection_adapters/column.rb#10 + def collation; end + + # Returns the value of attribute comment. + # + # source://activerecord//lib/active_record/connection_adapters/column.rb#10 + def comment; end + + # Returns the value of attribute default. + # + # source://activerecord//lib/active_record/connection_adapters/column.rb#10 + def default; end + + # Returns the value of attribute default_function. + # + # source://activerecord//lib/active_record/connection_adapters/column.rb#10 + def default_function; end + + # source://activerecord//lib/active_record/connection_adapters/column.rb#63 + def encode_with(coder); end + + # source://activerecord//lib/active_record/connection_adapters/column.rb#94 + def eql?(other); end + + # source://activerecord//lib/active_record/connection_adapters/column.rb#31 + def fetch_cast_type(connection); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/column.rb#36 + def has_default?; end + + # source://activerecord//lib/active_record/connection_adapters/column.rb#96 + def hash; end + + # Returns the human name of the column name. + # + # ===== Examples + # Column.new('sales_stage', ...).human_name # => 'Sales stage' + # + # source://activerecord//lib/active_record/connection_adapters/column.rb#48 + def human_name; end + + # source://activerecord//lib/active_record/connection_adapters/column.rb#52 + def init_with(coder); end + + # source://activerecord//lib/active_record/connection_adapters/column.rb#12 + def limit(*_arg0, **_arg1, &_arg2); end + + # Returns the value of attribute name. + # + # source://activerecord//lib/active_record/connection_adapters/column.rb#10 + def name; end + + # Returns the value of attribute null. + # + # source://activerecord//lib/active_record/connection_adapters/column.rb#10 + def null; end + + # source://activerecord//lib/active_record/connection_adapters/column.rb#12 + def precision(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/column.rb#12 + def scale(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/column.rb#12 + def sql_type(*_arg0, **_arg1, &_arg2); end + + # Returns the value of attribute sql_type_metadata. + # + # source://activerecord//lib/active_record/connection_adapters/column.rb#10 + def sql_type_metadata; end + + # source://activerecord//lib/active_record/connection_adapters/column.rb#12 + def type(*_arg0, **_arg1, &_arg2); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/column.rb#109 + def virtual?; end + + protected + + # Returns the value of attribute cast_type. + # + # source://activerecord//lib/active_record/connection_adapters/column.rb#114 + def cast_type; end + + private + + # source://activerecord//lib/active_record/connection_adapters/column.rb#117 + def deduplicated; end +end + +# Abstract representation of a column definition. Instances of this type +# are typically created by methods in TableDefinition, and added to the +# +columns+ attribute of said TableDefinition object, in order to be used +# for generating a number of table creation or table changing SQL statements. +# +# source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#78 +class ActiveRecord::ConnectionAdapters::ColumnDefinition < ::Struct + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#108 + def aliased_types(name, fallback); end + + # Returns the value of attribute cast_type + # + # @return [Object] the current value of cast_type + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#78 + def cast_type; end + + # Sets the attribute cast_type + # + # @param value [Object] the value to set the attribute cast_type to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#78 + def cast_type=(_); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#97 + def collation; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#97 + def collation=(value); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#97 + def comment; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#97 + def comment=(value); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#97 + def default; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#97 + def default=(value); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#112 + def fetch_cast_type(connection); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#97 + def if_exists; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#97 + def if_exists=(value); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#97 + def if_not_exists; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#97 + def if_not_exists=(value); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#97 + def limit; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#97 + def limit=(value); end + + # Returns the value of attribute name + # + # @return [Object] the current value of name + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#78 + def name; end + + # Sets the attribute name + # + # @param value [Object] the value to set the attribute name to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#78 + def name=(_); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#97 + def null; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#97 + def null=(value); end + + # Returns the value of attribute options + # + # @return [Object] the current value of options + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#78 + def options; end + + # Sets the attribute options + # + # @param value [Object] the value to set the attribute options to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#78 + def options=(_); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#97 + def precision; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#97 + def precision=(value); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#92 + def primary_key?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#97 + def scale; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#97 + def scale=(value); end + + # Returns the value of attribute sql_type + # + # @return [Object] the current value of sql_type + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#78 + def sql_type; end + + # Sets the attribute sql_type + # + # @param value [Object] the value to set the attribute sql_type to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#78 + def sql_type=(_); end + + # Returns the value of attribute type + # + # @return [Object] the current value of type + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#78 + def type; end + + # Sets the attribute type + # + # @param value [Object] the value to set the attribute type to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#78 + def type=(_); end + + class << self + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#78 + def [](*_arg0); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#78 + def inspect; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#78 + def keyword_init?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#78 + def members; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#78 + def new(*_arg0); end + end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#79 +ActiveRecord::ConnectionAdapters::ColumnDefinition::OPTION_NAMES = T.let(T.unsafe(nil), Array) + +# source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#307 +module ActiveRecord::ConnectionAdapters::ColumnMethods + extend ::ActiveSupport::Concern + extend ::ActiveRecord::ConnectionAdapters::ColumnMethods::ClassMethods + + mixes_in_class_methods ::ActiveRecord::ConnectionAdapters::ColumnMethods::ClassMethods + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#314 + def bigint(*names, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#314 + def binary(*names, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#334 + def blob(*names, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#314 + def boolean(*names, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#314 + def date(*names, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#314 + def datetime(*names, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#314 + def decimal(*names, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#314 + def float(*names, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#314 + def integer(*names, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#314 + def json(*names, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#335 + def numeric(*names, **options); end + + # Appends a primary key definition to the table definition. + # Can be called multiple times, but this is probably not a good idea. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#327 + def primary_key(name, type = T.unsafe(nil), **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#314 + def string(*names, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#314 + def text(*names, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#314 + def time(*names, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#314 + def timestamp(*names, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#314 + def virtual(*names, **options); end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#310 +module ActiveRecord::ConnectionAdapters::ColumnMethods::ClassMethods + private + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#312 + def define_column_methods(*column_types); end +end + +# = Active Record Connection Handler +# +# ConnectionHandler is a collection of ConnectionPool objects. It is used +# for keeping separate connection pools that connect to different databases. +# +# For example, suppose that you have 5 models, with the following hierarchy: +# +# class Author < ActiveRecord::Base +# end +# +# class BankAccount < ActiveRecord::Base +# end +# +# class Book < ActiveRecord::Base +# establish_connection :library_db +# end +# +# class ScaryBook < Book +# end +# +# class GoodBook < Book +# end +# +# And a database.yml that looked like this: +# +# development: +# database: my_application +# host: localhost +# +# library_db: +# database: library +# host: some.library.org +# +# Your primary database in the development environment is "my_application" +# but the Book model connects to a separate database called "library_db" +# (this can even be a database on a different machine). +# +# Book, ScaryBook, and GoodBook will all use the same connection pool to +# "library_db" while Author, BankAccount, and any other models you create +# will use the default connection pool to "my_application". +# +# The various connection pools are managed by a single instance of +# ConnectionHandler accessible via ActiveRecord::Base.connection_handler. +# All Active Record models use this handler to determine the connection pool that they +# should use. +# +# The ConnectionHandler class is not coupled with the Active models, as it has no knowledge +# about the model. The model needs to pass a connection specification name to the handler, +# in order to look up the correct connection pool. +# +# source://activerecord//lib/active_record/connection_adapters/abstract/connection_handler.rb#56 +class ActiveRecord::ConnectionAdapters::ConnectionHandler + # @return [ConnectionHandler] a new instance of ConnectionHandler + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_handler.rb#76 + def initialize; end + + # Returns true if there are any active connections among the connection + # pools that the ConnectionHandler is managing. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_handler.rb#157 + def active_connections?(role = T.unsafe(nil)); end + + # Returns any connections in use by the current thread back to the pool. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_handler.rb#162 + def clear_active_connections!(role = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_handler.rb#176 + def clear_all_connections!(role = T.unsafe(nil)); end + + # Clears reloadable connection caches in all connection pools. + # + # See ConnectionPool#clear_reloadable_connections! for details. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_handler.rb#172 + def clear_reloadable_connections!(role = T.unsafe(nil)); end + + # Returns true if a connection that's accessible to this class has + # already been opened. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_handler.rb#198 + def connected?(connection_name, role: T.unsafe(nil), shard: T.unsafe(nil)); end + + # Returns the pools for a connection handler and given role. If +:all+ is passed, + # all pools belonging to the connection handler will be returned. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_handler.rb#95 + def connection_pool_list(role = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_handler.rb#89 + def connection_pool_names; end + + # Returns the pools for a connection handler and given role. If +:all+ is passed, + # all pools belonging to the connection handler will be returned. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_handler.rb#102 + def connection_pools(role = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_handler.rb#104 + def each_connection_pool(role = T.unsafe(nil), &block); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_handler.rb#115 + def establish_connection(config, owner_name: T.unsafe(nil), role: T.unsafe(nil), shard: T.unsafe(nil), clobber: T.unsafe(nil)); end + + # Disconnects all currently idle connections. + # + # See ConnectionPool#flush! for details. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_handler.rb#183 + def flush_idle_connections!(role = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_handler.rb#81 + def prevent_writes; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_handler.rb#85 + def prevent_writes=(prevent_writes); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_handler.rb#203 + def remove_connection_pool(connection_name, role: T.unsafe(nil), shard: T.unsafe(nil)); end + + # Locate the connection of the nearest super class. This can be an + # active or defined connection: if it is the latter, it will be + # opened and set as the active connection for the class it was defined + # for (not necessarily the current class). + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_handler.rb#191 + def retrieve_connection(connection_name, role: T.unsafe(nil), shard: T.unsafe(nil)); end + + # Retrieving the connection pool happens a lot, so we cache it in @connection_name_to_pool_manager. + # This makes retrieving the connection pool O(1) once the process is warm. + # When a connection is established or removed, we invalidate the cache. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_handler.rb#212 + def retrieve_connection_pool(connection_name, role: T.unsafe(nil), shard: T.unsafe(nil), strict: T.unsafe(nil)); end + + private + + # Returns the value of attribute connection_name_to_pool_manager. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_handler.rb#238 + def connection_name_to_pool_manager; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_handler.rb#280 + def determine_owner_name(owner_name, config); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_handler.rb#254 + def disconnect_pool_from_pool_manager(pool_manager, role, shard); end + + # Returns the pool manager for a connection name / identifier. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_handler.rb#241 + def get_pool_manager(connection_name); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_handler.rb#250 + def pool_managers; end + + # Returns an instance of PoolConfig for a given adapter. + # Accepts a hash one layer deep that contains all connection information. + # + # == Example + # + # config = { "production" => { "host" => "localhost", "database" => "foo", "adapter" => "sqlite3" } } + # pool_config = Base.configurations.resolve_pool_config(:production) + # pool_config.db_config.configuration_hash + # # => { host: "localhost", database: "foo", adapter: "sqlite3" } + # + # @raise [AdapterNotSpecified] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_handler.rb#273 + def resolve_pool_config(config, connection_name, role, shard); end + + # Get the existing pool manager or initialize and assign a new one. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_handler.rb#246 + def set_pool_manager(connection_descriptor); end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/connection_handler.rb#57 +class ActiveRecord::ConnectionAdapters::ConnectionHandler::ConnectionDescriptor + # @return [ConnectionDescriptor] a new instance of ConnectionDescriptor + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_handler.rb#58 + def initialize(name, primary = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_handler.rb#71 + def current_preventing_writes; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_handler.rb#63 + def name; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_handler.rb#67 + def primary_class?; end +end + +# = Active Record Connection Pool +# +# Connection pool base class for managing Active Record database +# connections. +# +# == Introduction +# +# A connection pool synchronizes thread access to a limited number of +# database connections. The basic idea is that each thread checks out a +# database connection from the pool, uses that connection, and checks the +# connection back in. ConnectionPool is completely thread-safe, and will +# ensure that a connection cannot be used by two threads at the same time, +# as long as ConnectionPool's contract is correctly followed. It will also +# handle cases in which there are more threads than connections: if all +# connections have been checked out, and a thread tries to checkout a +# connection anyway, then ConnectionPool will wait until some other thread +# has checked in a connection, or the +checkout_timeout+ has expired. +# +# == Obtaining (checking out) a connection +# +# Connections can be obtained and used from a connection pool in several +# ways: +# +# 1. Simply use {ActiveRecord::Base.lease_connection}[rdoc-ref:ConnectionHandling#lease_connection]. +# When you're done with the connection(s) and wish it to be returned to the pool, you call +# {ActiveRecord::Base.connection_handler.clear_active_connections!}[rdoc-ref:ConnectionAdapters::ConnectionHandler#clear_active_connections!]. +# This is the default behavior for Active Record when used in conjunction with +# Action Pack's request handling cycle. +# 2. Manually check out a connection from the pool with +# {ActiveRecord::Base.connection_pool.checkout}[rdoc-ref:#checkout]. You are responsible for +# returning this connection to the pool when finished by calling +# {ActiveRecord::Base.connection_pool.checkin(connection)}[rdoc-ref:#checkin]. +# 3. Use {ActiveRecord::Base.connection_pool.with_connection(&block)}[rdoc-ref:#with_connection], which +# obtains a connection, yields it as the sole argument to the block, +# and returns it to the pool after the block completes. +# +# Connections in the pool are actually AbstractAdapter objects (or objects +# compatible with AbstractAdapter's interface). +# +# While a thread has a connection checked out from the pool using one of the +# above three methods, that connection will automatically be the one used +# by ActiveRecord queries executing on that thread. It is not required to +# explicitly pass the checked out connection to \Rails models or queries, for +# example. +# +# == Options +# +# There are several connection-pooling-related options that you can add to +# your database connection configuration: +# +# * +checkout_timeout+: number of seconds to wait for a connection to +# become available before giving up and raising a timeout error (default +# 5 seconds). +# * +idle_timeout+: number of seconds that a connection will be kept +# unused in the pool before it is automatically disconnected (default +# 300 seconds). Set this to zero to keep connections forever. +# * +keepalive+: number of seconds between keepalive checks if the +# connection has been idle (default 600 seconds). +# * +max_age+: number of seconds the pool will allow the connection to +# exist before retiring it at next checkin. (default Float::INFINITY). +# * +max_connections+: maximum number of connections the pool may manage (default 5). +# Set to +nil+ or -1 for unlimited connections. +# * +min_connections+: minimum number of connections the pool will open and maintain (default 0). +# * +pool_jitter+: maximum reduction factor to apply to +max_age+ and +# +keepalive+ intervals (default 0.2; range 0.0-1.0). +# +# -- +# Synchronization policy: +# * all public methods can be called outside +synchronize+ +# * access to these instance variables needs to be in +synchronize+: +# * @connections +# * @now_connecting +# * @maintaining +# * private methods that require being called in a +synchronize+ blocks +# are now explicitly documented +# +# source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/queue.rb#7 +class ActiveRecord::ConnectionAdapters::ConnectionPool + include ::ActiveRecord::ConnectionAdapters::QueryCache::ConnectionPoolConfiguration + include ::MonitorMixin + + # Creates a new ConnectionPool object. +pool_config+ is a PoolConfig + # object which describes database connection information (e.g. adapter, + # host name, username, password, etc), as well as the maximum size for + # this ConnectionPool. + # + # The default ConnectionPool maximum size is 5. + # + # @return [ConnectionPool] a new instance of ConnectionPool + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#251 + def initialize(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#342 + def activate; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#346 + def activated?; end + + # Returns true if there is an open connection being used for the current thread. + # + # This method only works for connections that have been obtained through + # #lease_connection or #with_connection methods. Connections obtained through + # #checkout will not be detected by #active_connection? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#422 + def active_connection; end + + # Returns true if there is an open connection being used for the current thread. + # + # This method only works for connections that have been obtained through + # #lease_connection or #with_connection methods. Connections obtained through + # #checkout will not be detected by #active_connection? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#419 + def active_connection?; end + + # Returns the value of attribute async_executor. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#240 + def async_executor; end + + # Returns the value of attribute automatic_reconnect. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#239 + def automatic_reconnect; end + + # Sets the attribute automatic_reconnect + # + # @param value the value to set the attribute automatic_reconnect to. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#239 + def automatic_reconnect=(_arg0); end + + # Check-in a database connection back into the pool, indicating that you + # no longer need this connection. + # + # +conn+: an AbstractAdapter object, which was obtained by earlier by + # calling #checkout on this pool. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#658 + def checkin(conn); end + + # Check-out a database connection from the pool, indicating that you want + # to use it. You should call #checkin when you no longer need this. + # + # This is done by either returning and leasing existing connection, or by + # creating a new connection and leasing it. + # + # If all connections are leased and the pool is at capacity (meaning the + # number of currently leased connections is greater than or equal to the + # size limit set), an ActiveRecord::ConnectionTimeoutError exception will be raised. + # + # Returns: an AbstractAdapter object. + # + # Raises: + # - ActiveRecord::ConnectionTimeoutError no connection can be obtained from the pool. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#630 + def checkout(checkout_timeout = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#1274 + def checkout_and_verify(connection); end + + # Returns the value of attribute checkout_timeout. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#239 + def checkout_timeout; end + + # Sets the attribute checkout_timeout + # + # @param value the value to set the attribute checkout_timeout to. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#239 + def checkout_timeout=(_arg0); end + + # Clears reloadable connections from the pool and re-connects connections that + # require reloading. + # + # Raises: + # - ActiveRecord::ExclusiveConnectionTimeoutError if unable to gain ownership of all + # connections in the pool within a timeout interval (default duration is + # spec.db_config.checkout_timeout * 2 seconds). + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#588 + def clear_reloadable_connections(raise_on_acquisition_timeout = T.unsafe(nil)); end + + # Clears reloadable connections from the pool and re-connects connections that + # require reloading. + # + # The pool first tries to gain ownership of all connections. If unable to + # do so within a timeout interval (default duration is + # spec.db_config.checkout_timeout * 2 seconds), then the pool forcefully + # clears the cache and reloads connections without any regard for other + # connection owning threads. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#612 + def clear_reloadable_connections!; end + + # Returns true if a connection has already been opened. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#490 + def connected?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#410 + def connection_descriptor; end + + # Returns an array containing the connections currently in the pool. + # Access to the array does not require synchronization on the pool because + # the array is newly created and not retained by the pool. + # + # However; this method bypasses the ConnectionPool's thread-safe connection + # access pattern. A returned connection may be owned by another thread, + # unowned, or by happen-stance owned by the calling thread. + # + # Calling methods on a connection without ownership is subject to the + # thread-safety guarantees of the underlying method. Many of the methods + # on connection adapter classes are inherently multi-thread unsafe. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#505 + def connections; end + + # Returns the value of attribute db_config. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#240 + def db_config; end + + # Discards all connections in the pool (even if they're currently + # leased!), along with the pool itself. Any further interaction with the + # pool (except #spec and #schema_cache) is undefined. + # + # See AbstractAdapter#discard! + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#555 + def discard!; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#567 + def discarded?; end + + # Disconnects all connections in the pool, and clears the pool. + # + # Raises: + # - ActiveRecord::ExclusiveConnectionTimeoutError if unable to gain ownership of all + # connections in the pool within a timeout interval (default duration is + # spec.db_config.checkout_timeout * 2 seconds). + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#515 + def disconnect(raise_on_acquisition_timeout = T.unsafe(nil)); end + + # Disconnects all connections in the pool, and clears the pool. + # + # The pool first tries to gain ownership of all connections. If unable to + # do so within a timeout interval (default duration is + # spec.db_config.checkout_timeout * 2 seconds), then the pool is forcefully + # disconnected without any regard for other connection owning threads. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#546 + def disconnect!; end + + # Disconnect all connections that have been idle for at least + # +minimum_idle+ seconds. Connections currently checked out, or that were + # checked in less than +minimum_idle+ seconds ago, are unaffected. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#727 + def flush(minimum_idle = T.unsafe(nil)); end + + # Disconnect all currently idle connections. Connections currently checked + # out are unaffected. The pool will stop maintaining its minimum size until + # it is reactivated (such as by a subsequent checkout). + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#766 + def flush!; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#310 + def inspect; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#338 + def internal_metadata; end + + # Prod any connections that have been idle for longer than the configured + # keepalive time. This will incidentally verify the connection is still + # alive, but the main purpose is to show the server (and any intermediate + # network hops) that we're still here and using the connection. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#825 + def keep_alive(threshold = T.unsafe(nil)); end + + # Returns the value of attribute keepalive. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#240 + def keepalive; end + + # Retrieve the connection associated with the current thread, or call + # #checkout to obtain one if necessary. + # + # #lease_connection can be called any number of times; the connection is + # held in a cache keyed by a thread. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#355 + def lease_connection; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#571 + def maintainable?; end + + # Returns the value of attribute max_age. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#240 + def max_age; end + + # Returns the value of attribute max_connections. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#240 + def max_connections; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#326 + def migration_context; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#330 + def migrations_paths; end + + # Returns the value of attribute min_connections. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#240 + def min_connections; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#883 + def new_connection; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#857 + def num_available_in_queue; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#853 + def num_waiting_in_queue; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#362 + def permanent_lease?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#366 + def pin_connection!(lock_thread); end + + # Returns the value of attribute pool_config. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#240 + def pool_config; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#891 + def pool_transaction_isolation_level; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#896 + def pool_transaction_isolation_level=(isolation_level); end + + # Preconnect all connections in the pool. This saves pool users from + # having to wait for a connection to be established when first using it + # after checkout. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#810 + def preconnect; end + + # Ensure that the pool contains at least the configured minimum number of + # connections. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#776 + def prepopulate; end + + # Recover lost connections for the pool. A lost connection can occur if + # a programmer forgets to checkin a connection at the end of a thread + # or a thread dies unexpectedly. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#704 + def reap; end + + # Returns the value of attribute reaper. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#240 + def reaper; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#577 + def reaper_lock(&block); end + + # Immediately mark all current connections as due for replacement, + # equivalent to them having reached +max_age+ -- even if there is + # no +max_age+ configured. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#841 + def recycle!; end + + # Signal that the thread is finished with the current connection. + # #release_connection releases the connection-thread association + # and returns the connection to the pool. + # + # This method only works for connections that have been obtained through + # #lease_connection or #with_connection methods, connections obtained through + # #checkout will not be automatically released. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#431 + def release_connection(existing_lease = T.unsafe(nil)); end + + # Remove a connection from the connection pool. The connection will + # remain open and active but will no longer be managed by this pool. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#672 + def remove(conn); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#797 + def retire_old_connections(max_age = T.unsafe(nil)); end + + # Returns the value of attribute role. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#240 + def role; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#878 + def schedule_query(future_result); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#317 + def schema_cache; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#334 + def schema_migration; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#243 + def schema_reflection(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#321 + def schema_reflection=(schema_reflection); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#243 + def server_version(*_arg0, **_arg1, &_arg2); end + + # Returns the value of attribute shard. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#240 + def shard; end + + # Returns the value of attribute max_connections. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#241 + def size; end + + # Returns the connection pool's usage statistic. + # + # ActiveRecord::Base.connection_pool.stat # => { size: 15, connections: 1, busy: 1, dead: 0, idle: 0, waiting: 0, checkout_timeout: 5 } + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#864 + def stat; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#382 + def unpin_connection!; end + + # Yields a connection from the connection pool to the block. If no connection + # is already checked out by the current thread, a connection will be checked + # out from the pool, yielded to the block, and then returned to the pool when + # the block is finished. If a connection has already been checked out on the + # current thread, such as via #lease_connection or #with_connection, that existing + # connection will be the one yielded and it will not be returned to the pool + # automatically at the end of the block; it is expected that such an existing + # connection will be properly returned to the pool by the code that checked + # it out. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#450 + def with_connection(prevent_permanent_checkout: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#471 + def with_pool_transaction_isolation_level(isolation_level, transaction_open, &block); end + + private + + # Acquire a connection by one of 1) immediately removing one + # from the queue of available connections, 2) creating a new + # connection if the pool is not at capacity, 3) waiting on the + # queue for a connection to become available. + # + # Raises: + # - ActiveRecord::ConnectionTimeoutError if a connection could not be acquired + # + # -- + # Implementation detail: the connection returned by +acquire_connection+ + # will already be "+connection.lease+ -ed" to the current thread. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#1156 + def acquire_connection(checkout_timeout); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#1258 + def adopt_connection(conn); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#1047 + def attempt_to_checkout_all_existing_connections(raise_on_acquisition_timeout = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#906 + def build_async_executor; end + + # -- + # this is unfortunately not concurrent + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#1024 + def bulk_make_new_connections(num_new_conns_needed); end + + # -- + # Must be called in a synchronize block. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#1096 + def checkout_for_exclusive_access(checkout_timeout); end + + # Directly check a specific connection out of the pool. Skips callbacks. + # + # The connection must later either #return_from_maintenance or + # #remove_from_maintenance, or the pool will hang. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#987 + def checkout_for_maintenance(conn); end + + # @raise [ConnectionNotEstablished] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#1269 + def checkout_new_connection; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#902 + def connection_lease; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#1282 + def name_inspect; end + + # -- + # if owner_thread param is omitted, this must be called in synchronize block + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#1211 + def release(conn, owner_thread = T.unsafe(nil)); end + + # -- + # if owner_thread param is omitted, this must be called in synchronize block + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#1206 + def remove_connection_from_thread_cache(conn, owner_thread = T.unsafe(nil)); end + + # Remove a connection from the pool after it has been checked out for + # maintenance. It will be automatically replaced with a new connection if + # necessary. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#1015 + def remove_from_maintenance(conn); end + + # Return a connection to the pool after it has been checked out for + # maintenance. Does not update the connection's idle time, and skips + # callbacks. + # -- + # We assume that a connection that has required maintenance is less + # desirable (either it's been idle for a long time, or it was just + # created and hasn't been used yet). We'll put it at the back of the + # queue. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#1004 + def return_from_maintenance(conn); end + + # Perform maintenance work on pool connections. This method will + # select a connection to work on by calling the +candidate_selector+ + # proc while holding the pool lock. If a connection is selected, it + # will be checked out for maintenance and passed to the + # +maintenance_work+ proc. The connection will always be returned to + # the pool after the proc completes. + # + # If the pool has async threads, all work will be scheduled there. + # Otherwise, this method will block until all work is complete. + # + # Each connection will only be processed once per call to this method, + # but (particularly in the async case) there is no protection against + # a second call to this method starting to work through the list + # before the first call has completed. (Though regular pool behavior + # will prevent two instances from working on the same specific + # connection at the same time.) + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#940 + def sequential_maintenance(candidate_selector, &maintenance_work); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#1286 + def shard_inspect; end + + # If the pool is not at a @max_connections limit, establish new connection. Connecting + # to the DB is done outside main synchronized section. + # + # If a block is supplied, it is an additional constraint (checked while holding the + # pool lock) on whether a new connection should be established. + # -- + # Implementation constraint: a newly established connection returned by this + # method must be in the +.leased+ state. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#1221 + def try_to_checkout_new_connection; end + + # -- + # If new connections are already being established in the background, + # and there are fewer threads already waiting than the number of + # upcoming connections, we can just get in queue and wait to be handed a + # connection. This avoids us overshooting the required connection count + # by starting a new connection ourselves, and is likely to be faster + # too (because at least some of the time it takes to establish a new + # connection must have already passed). + # + # If background connections are available, this method will block and + # return a connection. If no background connections are available, it + # will immediately return +nil+. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#1191 + def try_to_queue_for_background_connection(checkout_timeout); end + + # Take control of all existing connections so a "group" action such as + # reload/disconnect can be performed safely. It is no longer enough to + # wrap it in +synchronize+ because some pool's actions are allowed + # to be performed outside of the main +synchronize+ block. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#1038 + def with_exclusively_acquired_all_connections(raise_on_acquisition_timeout = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#1116 + def with_new_connections_blocked; end + + class << self + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#231 + def install_executor_hooks(executor = T.unsafe(nil)); end + end +end + +# Adds the ability to turn a basic fair FIFO queue into one +# biased to some thread. +# +# source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/queue.rb#150 +module ActiveRecord::ConnectionAdapters::ConnectionPool::BiasableQueue + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/queue.rb#190 + def with_a_bias_for(thread); end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/queue.rb#151 +class ActiveRecord::ConnectionAdapters::ConnectionPool::BiasableQueue::BiasedConditionVariable + # semantics of condition variables guarantee that +broadcast+, +broadcast_on_biased+, + # +signal+ and +wait+ methods are only called while holding a lock + # + # @return [BiasedConditionVariable] a new instance of BiasedConditionVariable + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/queue.rb#154 + def initialize(lock, other_cond, preferred_thread); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/queue.rb#161 + def broadcast; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/queue.rb#166 + def broadcast_on_biased; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/queue.rb#171 + def signal; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/queue.rb#180 + def wait(timeout); end +end + +# Connections must be leased while holding the main pool mutex. This is +# an internal subclass that also +.leases+ returned connections while +# still in queue's critical section (queue synchronizes with the same +# @lock as the main pool) so that a returned connection is already +# leased and there is no need to re-enter synchronized block. +# +# source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/queue.rb#211 +class ActiveRecord::ConnectionAdapters::ConnectionPool::ConnectionLeasingQueue < ::ActiveRecord::ConnectionAdapters::ConnectionPool::Queue + include ::ActiveRecord::ConnectionAdapters::ConnectionPool::BiasableQueue + + private + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/queue.rb#215 + def internal_poll(timeout); end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#211 +module ActiveRecord::ConnectionAdapters::ConnectionPool::ExecutorHooks + class << self + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#217 + def complete(_); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#213 + def run; end + end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#157 +class ActiveRecord::ConnectionAdapters::ConnectionPool::Lease + # @return [Lease] a new instance of Lease + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#160 + def initialize; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#172 + def clear(connection); end + + # Returns the value of attribute connection. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#158 + def connection; end + + # Sets the attribute connection + # + # @param value the value to set the attribute connection to. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#158 + def connection=(_arg0); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#165 + def release; end + + # Returns the value of attribute sticky. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#158 + def sticky; end + + # Sets the attribute sticky + # + # @param value the value to set the attribute sticky to. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#158 + def sticky=(_arg0); end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#185 +class ActiveRecord::ConnectionAdapters::ConnectionPool::LeaseRegistry < ::ObjectSpace::WeakKeyMap + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#186 + def [](context); end +end + +# = Active Record Connection Pool \Queue +# +# Threadsafe, fair, LIFO queue. Meant to be used by ConnectionPool +# with which it shares a Monitor. +# +# source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/queue.rb#12 +class ActiveRecord::ConnectionAdapters::ConnectionPool::Queue + # @return [Queue] a new instance of Queue + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/queue.rb#13 + def initialize(lock = T.unsafe(nil)); end + + # Add +element+ to the queue. Never blocks. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/queue.rb#36 + def add(element); end + + # Add +element+ to the back of the queue. Never blocks. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/queue.rb#44 + def add_back(element); end + + # Test if any threads are currently waiting on the queue. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/queue.rb#21 + def any_waiting?; end + + # Remove all elements from the queue. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/queue.rb#59 + def clear; end + + # If +element+ is in the queue, remove and return it, or +nil+. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/queue.rb#52 + def delete(element); end + + # Returns the number of threads currently waiting on this + # queue. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/queue.rb#29 + def num_waiting; end + + # Remove the head of the queue. + # + # If +timeout+ is not given, remove and return the head of the + # queue if the number of available elements is strictly + # greater than the number of threads currently waiting (that + # is, don't jump ahead in line). Otherwise, return +nil+. + # + # If +timeout+ is given, block if there is no element + # available, waiting up to +timeout+ seconds for an element to + # become available. + # + # Raises: + # - ActiveRecord::ConnectionTimeoutError if +timeout+ is given and no element + # becomes available within +timeout+ seconds, + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/queue.rb#86 + def poll(timeout = T.unsafe(nil)); end + + # Number of elements in the queue. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/queue.rb#66 + def size; end + + private + + # Test if the queue currently contains any elements. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/queue.rb#100 + def any?; end + + # A thread can remove an element from the queue without + # waiting if and only if the number of currently available + # connections is strictly greater than the number of waiting + # threads. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/queue.rb#108 + def can_remove_no_wait?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/queue.rb#91 + def internal_poll(timeout); end + + # Remove and return the head of the queue if the number of + # available elements is strictly greater than the number of + # threads currently waiting. Otherwise, return +nil+. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/queue.rb#120 + def no_wait_poll; end + + # Removes and returns the head of the queue if possible, or +nil+. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/queue.rb#113 + def remove; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/queue.rb#95 + def synchronize(&block); end + + # Waits on the queue up to +timeout+ seconds, then removes and + # returns the head of the queue. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/queue.rb#126 + def wait_poll(timeout); end +end + +# = Active Record Connection Pool \Reaper +# +# The reaper is a singleton that exists in the background of the process +# and is responsible for general maintenance of all the connection pools. +# +# It will reclaim connections that are leased to now-dead threads, +# ensuring that a bad thread can't leak a pool slot forever. By definition, +# this involves touching currently-leased connections, but that is safe +# because the owning thread is known to be dead. +# +# Beyond that, it manages the health of available / unleased connections: +# * retiring connections that have been idle[1] for too long +# * creating occasional activity on inactive[1] connections +# * keeping the pool prepopulated up to its minimum size +# * proactively connecting to the target database from any pooled +# connections that had lazily deferred that step +# * resetting or replacing connections that are known to be broken +# +# +# [1]: "idle" and "inactive" here distinguish between connections that +# have not been requested by the application in a while (idle) and those +# that have not spoken to their remote server in a while (inactive). The +# former is a desirable opportunity to reduce our connection count +# (`idle_timeout`); the latter is a risk that the server or a firewall may +# drop a connection we still anticipate using (avoided by `keepalive`). +# +# source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/reaper.rb#33 +class ActiveRecord::ConnectionAdapters::ConnectionPool::Reaper + # @return [Reaper] a new instance of Reaper + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/reaper.rb#36 + def initialize(pool, frequency); end + + # Returns the value of attribute frequency. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/reaper.rb#34 + def frequency; end + + # Returns the value of attribute pool. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/reaper.rb#34 + def pool; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/reaper.rb#110 + def run; end + + class << self + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/reaper.rb#56 + def pools(refs = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/reaper.rb#46 + def register_pool(pool, frequency); end + + private + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool/reaper.rb#66 + def spawn_thread(frequency); end + end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#133 +ActiveRecord::ConnectionAdapters::ConnectionPool::WeakThreadKeyMap = ObjectSpace::WeakKeyMap + +# source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#123 +class ActiveRecord::ConnectionAdapters::CreateIndexDefinition < ::Struct + # Returns the value of attribute algorithm + # + # @return [Object] the current value of algorithm + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#123 + def algorithm; end + + # Sets the attribute algorithm + # + # @param value [Object] the value to set the attribute algorithm to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#123 + def algorithm=(_); end + + # Returns the value of attribute if_not_exists + # + # @return [Object] the current value of if_not_exists + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#123 + def if_not_exists; end + + # Sets the attribute if_not_exists + # + # @param value [Object] the value to set the attribute if_not_exists to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#123 + def if_not_exists=(_); end + + # Returns the value of attribute index + # + # @return [Object] the current value of index + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#123 + def index; end + + # Sets the attribute index + # + # @param value [Object] the value to set the attribute index to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#123 + def index=(_); end + + class << self + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#123 + def [](*_arg0); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#123 + def inspect; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#123 + def keyword_init?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#123 + def members; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#123 + def new(*_arg0); end + end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/database_limits.rb#5 +module ActiveRecord::ConnectionAdapters::DatabaseLimits + # Returns the maximum length of an index name. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_limits.rb#21 + def index_name_length; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_limits.rb#6 + def max_identifier_length; end + + # Returns the maximum length of a table alias. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_limits.rb#16 + def table_alias_length; end + + # Returns the maximum length of a table name. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_limits.rb#11 + def table_name_length; end + + private + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_limits.rb#26 + def bind_params_length; end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#5 +module ActiveRecord::ConnectionAdapters::DatabaseStatements + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#6 + def initialize; end + + # Register a record with the current transaction so that its after_commit and after_rollback callbacks + # can be called. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#424 + def add_transaction_record(record, ensure_finalize = T.unsafe(nil)); end + + # Begins the transaction (and turns off auto-committing). + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#429 + def begin_db_transaction; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#431 + def begin_deferred_transaction(isolation_level = T.unsafe(nil)); end + + # Begins the transaction with the isolation level set. Raises an error by + # default; adapters that support setting the isolation level should implement + # this method. + # + # @raise [ActiveRecord::TransactionIsolationError] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#454 + def begin_isolated_db_transaction(isolation); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#386 + def begin_transaction(*_arg0, **_arg1, &_arg2); end + + # This is used in the StatementCache object. It returns an object that + # can be used to query the database repeatedly. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#56 + def cacheable_query(klass, arel); end + + # Commits the transaction (and turns on auto-committing). + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#468 + def commit_db_transaction; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#386 + def commit_transaction(*_arg0, **_arg1, &_arg2); end + + # Executes an INSERT query and returns the new record's ID + # + # +id_value+ will be returned unless the value is +nil+, in + # which case the database will attempt to calculate the last inserted + # id and return that value. + # + # If the next id was calculated in advance (as in Oracle), it should be + # passed in as +id_value+. + # Some adapters support the `returning` keyword argument which allows defining the return value of the method: + # `nil` is the default value and maintains default behavior. If an array of column names is passed - + # an array of is returned from the method representing values of the specified columns from the inserted row. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#206 + def create(arel, name = T.unsafe(nil), pk = T.unsafe(nil), id_value = T.unsafe(nil), sequence_name = T.unsafe(nil), binds = T.unsafe(nil), returning: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#386 + def current_transaction(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#558 + def default_insert_value(column); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#490 + def default_sequence_name(table, column); end + + # Executes the delete statement and returns the number of rows affected. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#215 + def delete(arel, name = T.unsafe(nil), binds = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#386 + def dirty_current_transaction(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#386 + def disable_lazy_transactions!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#520 + def empty_insert_statement_value(primary_key = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#386 + def enable_lazy_transactions!(*_arg0, **_arg1, &_arg2); end + + # Executes delete +sql+ statement in the context of this connection using + # +binds+ as the bind substitutes. +name+ is logged along with + # the executed +sql+ statement. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#168 + def exec_delete(sql, name = T.unsafe(nil), binds = T.unsafe(nil)); end + + # Executes insert +sql+ statement in the context of this connection using + # +binds+ as the bind substitutes. +name+ is logged along with + # the executed +sql+ statement. + # Some adapters support the `returning` keyword argument which allows to control the result of the query: + # `nil` is the default value and maintains default behavior. If an array of column names is passed - + # the result will contain values of the specified columns from the inserted row. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#160 + def exec_insert(sql, name = T.unsafe(nil), binds = T.unsafe(nil), pk = T.unsafe(nil), sequence_name = T.unsafe(nil), returning: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#179 + def exec_insert_all(sql, name); end + + # Executes +sql+ statement in the context of this connection using + # +binds+ as the bind substitutes. +name+ is logged along with + # the executed +sql+ statement. + # + # Note: the query is assumed to have side effects and the query cache + # will be cleared. If the query is read-only, consider using #select_all + # instead. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#150 + def exec_query(sql, name = T.unsafe(nil), binds = T.unsafe(nil), prepare: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#484 + def exec_restart_db_transaction; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#478 + def exec_rollback_db_transaction; end + + # Executes update +sql+ statement in the context of this connection using + # +binds+ as the bind substitutes. +name+ is logged along with + # the executed +sql+ statement. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#175 + def exec_update(sql, name = T.unsafe(nil), binds = T.unsafe(nil)); end + + # Executes the SQL statement in the context of this connection and returns + # the raw result from the connection adapter. + # + # Setting +allow_retry+ to true causes the db to reconnect and retry + # executing the SQL statement in case of a connection-related exception. + # This option should only be enabled for known idempotent queries. + # + # Note: the query is assumed to have side effects and the query cache + # will be cleared. If the query is read-only, consider using #select_all + # instead. + # + # Note: depending on your database connector, the result returned by this + # method may be manually memory managed. Consider using #exec_query + # wrapper instead. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#139 + def execute(sql, name = T.unsafe(nil), allow_retry: T.unsafe(nil)); end + + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#183 + def explain(arel, binds = T.unsafe(nil), options = T.unsafe(nil)); end + + # Returns an Arel SQL literal for the CURRENT_TIMESTAMP for usage with + # arbitrary precision date/time columns. + # + # Adapters supporting datetime with precision should override this to + # provide as much precision as is available. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#544 + def high_precision_current_timestamp; end + + # Executes an INSERT query and returns the new record's ID + # + # +id_value+ will be returned unless the value is +nil+, in + # which case the database will attempt to calculate the last inserted + # id and return that value. + # + # If the next id was calculated in advance (as in Oracle), it should be + # passed in as +id_value+. + # Some adapters support the `returning` keyword argument which allows defining the return value of the method: + # `nil` is the default value and maintains default behavior. If an array of column names is passed - + # an array of is returned from the method representing values of the specified columns from the inserted row. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#198 + def insert(arel, name = T.unsafe(nil), pk = T.unsafe(nil), id_value = T.unsafe(nil), sequence_name = T.unsafe(nil), binds = T.unsafe(nil), returning: T.unsafe(nil)); end + + # Inserts the given fixture into the table. Overridden in adapters that require + # something beyond a simple insert (e.g. Oracle). + # Most of adapters should implement +insert_fixtures_set+ that leverages bulk SQL insert. + # We keep this method to provide fallback + # for databases like SQLite that do not support bulk inserts. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#504 + def insert_fixture(fixture, table_name); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#508 + def insert_fixtures_set(fixture_set, tables_to_delete = T.unsafe(nil)); end + + # Execute a query and returns an ActiveRecord::Result + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#554 + def internal_exec_query(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#391 + def mark_transaction_written; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#386 + def materialize_transactions(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#386 + def open_transactions(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#116 + def query(sql, name = T.unsafe(nil), allow_retry: T.unsafe(nil), materialize_transactions: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#108 + def query_value(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#112 + def query_values(*_arg0, **_arg1, &_arg2); end + + # Same as raw_execute but returns an ActiveRecord::Result object. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#549 + def raw_exec_query(*_arg0, **_arg1, &_arg2); end + + # Hook point called after an isolated DB transaction is committed + # or rolled back. + # Most adapters don't need to implement anything because the isolation + # level is set on a per transaction basis. + # But some databases like SQLite set it on a per connection level + # and need to explicitly reset it after commit or rollback. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#464 + def reset_isolation_level; end + + # Set the sequence to the max value of the table's column. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#495 + def reset_sequence!(table, column, sequence = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#402 + def reset_transaction(restore: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#480 + def restart_db_transaction; end + + # Rolls back the transaction (and turns on auto-committing). Must be + # done if the transaction block raises an exception or returns false. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#472 + def rollback_db_transaction; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#486 + def rollback_to_savepoint(name = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#386 + def rollback_transaction(*_arg0, **_arg1, &_arg2); end + + # Returns an ActiveRecord::Result instance. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#72 + def select_all(arel, name = T.unsafe(nil), binds = T.unsafe(nil), preparable: T.unsafe(nil), async: T.unsafe(nil), allow_retry: T.unsafe(nil)); end + + # Returns a record hash with the column names as keys and column values + # as values. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#87 + def select_one(arel, name = T.unsafe(nil), binds = T.unsafe(nil), async: T.unsafe(nil)); end + + # Returns an array of arrays containing the field values. + # Order is the same as that returned by +columns+. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#104 + def select_rows(arel, name = T.unsafe(nil), binds = T.unsafe(nil), async: T.unsafe(nil)); end + + # Returns a single value from a record + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#92 + def select_value(arel, name = T.unsafe(nil), binds = T.unsafe(nil), async: T.unsafe(nil)); end + + # Returns an array of the values of the first column in a select: + # select_values("SELECT id FROM companies LIMIT 3") => [1,2,3] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#98 + def select_values(arel, name = T.unsafe(nil), binds = T.unsafe(nil)); end + + # Converts an arel AST to SQL + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#12 + def to_sql(arel_or_sql_string, binds = T.unsafe(nil)); end + + # Runs the given block in a database transaction, and returns the result + # of the block. + # + # == Transaction callbacks + # + # #transaction yields an ActiveRecord::Transaction object on which it is + # possible to register callback: + # + # ActiveRecord::Base.transaction do |transaction| + # transaction.before_commit { puts "before commit!" } + # transaction.after_commit { puts "after commit!" } + # transaction.after_rollback { puts "after rollback!" } + # end + # + # == Nested transactions support + # + # #transaction calls can be nested. By default, this makes all database + # statements in the nested transaction block become part of the parent + # transaction. For example, the following behavior may be surprising: + # + # ActiveRecord::Base.transaction do + # Post.create(title: 'first') + # ActiveRecord::Base.transaction do + # Post.create(title: 'second') + # raise ActiveRecord::Rollback + # end + # end + # + # This creates both "first" and "second" posts. Reason is the + # ActiveRecord::Rollback exception in the nested block does not issue a + # ROLLBACK. Since these exceptions are captured in transaction blocks, + # the parent block does not see it and the real transaction is committed. + # + # Most databases don't support true nested transactions. At the time of + # writing, the only database that supports true nested transactions that + # we're aware of, is MS-SQL. + # + # In order to get around this problem, #transaction will emulate the effect + # of nested transactions, by using savepoints: + # https://dev.mysql.com/doc/refman/en/savepoint.html. + # + # It is safe to call this method if a database transaction is already open, + # i.e. if #transaction is called within another #transaction block. In case + # of a nested call, #transaction will behave as follows: + # + # - The block will be run without doing anything. All database statements + # that happen within the block are effectively appended to the already + # open database transaction. + # - However, if +:requires_new+ is set, the block will be wrapped in a + # database savepoint acting as a sub-transaction. + # + # In order to get a ROLLBACK for the nested transaction you may ask for a + # real sub-transaction by passing requires_new: true. + # If anything goes wrong, the database rolls back to the beginning of + # the sub-transaction without rolling back the parent transaction. + # If we add it to the previous example: + # + # ActiveRecord::Base.transaction do + # Post.create(title: 'first') + # ActiveRecord::Base.transaction(requires_new: true) do + # Post.create(title: 'second') + # raise ActiveRecord::Rollback + # end + # end + # + # only post with title "first" is created. + # + # See ActiveRecord::Transactions to learn more. + # + # === Caveats + # + # MySQL doesn't support DDL transactions. If you perform a DDL operation, + # then any created savepoints will be automatically released. For example, + # if you've created a savepoint, then you execute a CREATE TABLE statement, + # then the savepoint that was created will be automatically released. + # + # This means that, on MySQL, you shouldn't execute DDL operations inside + # a #transaction call that you know might create a savepoint. Otherwise, + # #transaction will raise exceptions when it tries to release the + # already-automatically-released savepoints: + # + # Model.lease_connection.transaction do # BEGIN + # Model.lease_connection.transaction(requires_new: true) do # CREATE SAVEPOINT active_record_1 + # Model.lease_connection.create_table(...) + # # active_record_1 now automatically released + # end # RELEASE SAVEPOINT active_record_1 <--- BOOM! database error! + # end + # + # == Transaction isolation + # + # If your database supports setting the isolation level for a transaction, you can set + # it like so: + # + # Post.transaction(isolation: :serializable) do + # # ... + # end + # + # Valid isolation levels are: + # + # * :read_uncommitted + # * :read_committed + # * :repeatable_read + # * :serializable + # + # You should consult the documentation for your database to understand the + # semantics of these different levels: + # + # * https://www.postgresql.org/docs/current/static/transaction-iso.html + # * https://dev.mysql.com/doc/refman/en/set-transaction.html + # + # An ActiveRecord::TransactionIsolationError will be raised if: + # + # * The adapter does not support setting the isolation level + # * You are joining an existing open transaction + # * You are creating a nested (savepoint) transaction + # + # The mysql2, trilogy, and postgresql adapters support setting the transaction + # isolation level. + # :args: (requires_new: nil, isolation: nil, &block) + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#355 + def transaction(requires_new: T.unsafe(nil), isolation: T.unsafe(nil), joinable: T.unsafe(nil), &block); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#447 + def transaction_isolation_levels; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#384 + def transaction_manager; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#398 + def transaction_open?; end + + # Executes the truncate statement. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#221 + def truncate(table_name, name = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#225 + def truncate_tables(*table_names); end + + # Executes the update statement and returns the number of rows affected. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#209 + def update(arel, name = T.unsafe(nil), binds = T.unsafe(nil)); end + + # Fixture value is quoted by Arel, however scalar values + # are not quotable. In this case we want to convert + # the column value to YAML. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#527 + def with_yaml_fallback(value); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#386 + def within_new_transaction(*_arg0, **_arg1, &_arg2); end + + # Determines whether the SQL statement is a write query. + # + # @raise [NotImplementedError] + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#121 + def write_query?(sql); end + + private + + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#590 + def affected_rows(raw_result); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#747 + def arel_from_relation(relation); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#622 + def build_fixture_sql(fixtures, table_name); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#664 + def build_fixture_statements(fixture_set); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#671 + def build_truncate_statement(table_name); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#675 + def build_truncate_statements(table_names); end + + # Receive a native adapter result object and returns an ActiveRecord::Result object. + # + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#586 + def cast_result(raw_result); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#681 + def combine_multi_statements(total_sql); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#616 + def execute_batch(statements, name = T.unsafe(nil), **kwargs); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#755 + def extract_table_ref_from_insert_sql(sql); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#582 + def handle_warnings(raw_result, sql); end + + # Same as #internal_exec_query, but yields a native adapter result + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#611 + def internal_execute(sql, name = T.unsafe(nil), binds = T.unsafe(nil), prepare: T.unsafe(nil), async: T.unsafe(nil), allow_retry: T.unsafe(nil), materialize_transactions: T.unsafe(nil), &block); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#734 + def last_inserted_id(result); end + + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#578 + def perform_query(raw_connection, sql, binds, type_casted_binds, prepare:, notification_payload:, batch:); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#594 + def preprocess_query(sql); end + + # Lowest level way to execute a query. Doesn't check for illegal writes, doesn't annotate queries, yields a native result object. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#567 + def raw_execute(sql, name = T.unsafe(nil), binds = T.unsafe(nil), prepare: T.unsafe(nil), async: T.unsafe(nil), allow_retry: T.unsafe(nil), materialize_transactions: T.unsafe(nil), batch: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#738 + def returning_column_values(result); end + + # Returns an ActiveRecord::Result instance. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#686 + def select(sql, name = T.unsafe(nil), binds = T.unsafe(nil), prepare: T.unsafe(nil), async: T.unsafe(nil), allow_retry: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#742 + def single_value_from_rows(rows); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#717 + def sql_for_insert(sql, pk, binds, returning); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#17 + def to_sql_and_binds(arel_or_sql_string, binds = T.unsafe(nil), preparable = T.unsafe(nil), allow_retry = T.unsafe(nil)); end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#563 +ActiveRecord::ConnectionAdapters::DatabaseStatements::DEFAULT_INSERT_VALUE = T.let(T.unsafe(nil), Arel::Nodes::SqlLiteral) + +# This is a safe default, even if not high precision on all databases +# +# source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#536 +ActiveRecord::ConnectionAdapters::DatabaseStatements::HIGH_PRECISION_CURRENT_TIMESTAMP = T.let(T.unsafe(nil), Arel::Nodes::SqlLiteral) + +# source://activerecord//lib/active_record/connection_adapters/abstract/database_statements.rb#439 +ActiveRecord::ConnectionAdapters::DatabaseStatements::TRANSACTION_ISOLATION_LEVELS = T.let(T.unsafe(nil), Hash) + +# source://activerecord//lib/active_record/connection_adapters/deduplicable.rb#5 +module ActiveRecord::ConnectionAdapters::Deduplicable + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::ConnectionAdapters::Deduplicable::ClassMethods + + # source://activerecord//lib/active_record/connection_adapters/deduplicable.rb#21 + def -@; end + + # source://activerecord//lib/active_record/connection_adapters/deduplicable.rb#18 + def deduplicate; end + + private + + # source://activerecord//lib/active_record/connection_adapters/deduplicable.rb#24 + def deduplicated; end +end + +# source://activerecord//lib/active_record/connection_adapters/deduplicable.rb#8 +module ActiveRecord::ConnectionAdapters::Deduplicable::ClassMethods + # source://activerecord//lib/active_record/connection_adapters/deduplicable.rb#13 + def new(*_arg0, **_arg1); end + + # source://activerecord//lib/active_record/connection_adapters/deduplicable.rb#9 + def registry; end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#127 +class ActiveRecord::ConnectionAdapters::ForeignKeyDefinition < ::Struct + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#132 + def column; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#152 + def custom_primary_key?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#148 + def deferrable; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#165 + def defined_for?(to_table: T.unsafe(nil), validate: T.unsafe(nil), **options); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#161 + def export_name_on_schema_dump?; end + + # Returns the value of attribute from_table + # + # @return [Object] the current value of from_table + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#127 + def from_table; end + + # Sets the attribute from_table + # + # @param value [Object] the value to set the attribute from_table to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#127 + def from_table=(_); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#128 + def name; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#140 + def on_delete; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#144 + def on_update; end + + # Returns the value of attribute options + # + # @return [Object] the current value of options + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#127 + def options; end + + # Sets the attribute options + # + # @param value [Object] the value to set the attribute options to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#127 + def options=(_); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#136 + def primary_key; end + + # Returns the value of attribute to_table + # + # @return [Object] the current value of to_table + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#127 + def to_table; end + + # Sets the attribute to_table + # + # @param value [Object] the value to set the attribute to_table to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#127 + def to_table=(_); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#156 + def validate?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#159 + def validated?; end + + private + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#174 + def default_primary_key; end + + class << self + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#127 + def [](*_arg0); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#127 + def inspect; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#127 + def keyword_init?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#127 + def members; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#127 + def new(*_arg0); end + end +end + +# Abstract representation of an index definition on a table. Instances of +# this type are typically created and returned by methods in database +# adapters. e.g. ActiveRecord::ConnectionAdapters::MySQL::SchemaStatements#indexes +# +# source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#8 +class ActiveRecord::ConnectionAdapters::IndexDefinition + # @return [IndexDefinition] a new instance of IndexDefinition + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#11 + def initialize(table, name, unique = T.unsafe(nil), columns = T.unsafe(nil), lengths: T.unsafe(nil), orders: T.unsafe(nil), opclasses: T.unsafe(nil), where: T.unsafe(nil), type: T.unsafe(nil), using: T.unsafe(nil), include: T.unsafe(nil), nulls_not_distinct: T.unsafe(nil), comment: T.unsafe(nil), valid: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#46 + def column_options; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#9 + def columns; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#9 + def comment; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#54 + def defined_for?(columns = T.unsafe(nil), name: T.unsafe(nil), unique: T.unsafe(nil), valid: T.unsafe(nil), include: T.unsafe(nil), nulls_not_distinct: T.unsafe(nil), **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#9 + def include; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#9 + def lengths; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#9 + def name; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#9 + def nulls_not_distinct; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#9 + def opclasses; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#9 + def orders; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#9 + def table; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#9 + def type; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#9 + def unique; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#9 + def using; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#9 + def valid; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#42 + def valid?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#9 + def where; end + + private + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#65 + def concise_options(options); end +end + +# source://activerecord//lib/active_record/connection_adapters/column.rb#128 +class ActiveRecord::ConnectionAdapters::NullColumn < ::ActiveRecord::ConnectionAdapters::Column + # @return [NullColumn] a new instance of NullColumn + # + # source://activerecord//lib/active_record/connection_adapters/column.rb#129 + def initialize(name, **_arg1); end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#11 +class ActiveRecord::ConnectionAdapters::NullPool + # @return [NullPool] a new instance of NullPool + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#19 + def initialize; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#38 + def async_executor; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#36 + def checkin(_); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#35 + def connection_descriptor; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#40 + def db_config; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#44 + def dirties_query_cache; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#48 + def pool_transaction_isolation_level; end + + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#49 + def pool_transaction_isolation_level=(isolation_level); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#34 + def query_cache; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#37 + def remove(_); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#33 + def schema_cache; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#29 + def schema_reflection; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#25 + def server_version(connection); end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#17 +ActiveRecord::ConnectionAdapters::NullPool::NULL_CONFIG = T.let(T.unsafe(nil), ActiveRecord::ConnectionAdapters::NullPool::NullConfig) + +# source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#12 +class ActiveRecord::ConnectionAdapters::NullPool::NullConfig + # source://activerecord//lib/active_record/connection_adapters/abstract/connection_pool.rb#13 + def method_missing(*_arg0, **_arg1, &_arg2); end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#110 +class ActiveRecord::ConnectionAdapters::NullTransaction + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#116 + def add_record(record, _ = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#124 + def after_commit; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#125 + def after_rollback; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#123 + def before_commit; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#112 + def closed?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#119 + def dirty!; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#118 + def dirty?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#121 + def invalidate!; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#120 + def invalidated?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#115 + def isolation; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#127 + def isolation=(_); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#114 + def joinable?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#122 + def materialized?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#113 + def open?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#117 + def restartable?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#111 + def state; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#126 + def user_transaction; end +end + +# source://activerecord//lib/active_record/connection_adapters/pool_config.rb#5 +class ActiveRecord::ConnectionAdapters::PoolConfig + include ::MonitorMixin + + # @return [PoolConfig] a new instance of PoolConfig + # + # source://activerecord//lib/active_record/connection_adapters/pool_config.rb#28 + def initialize(connection_class, db_config, role, shard); end + + # Returns the value of attribute connection_descriptor. + # + # source://activerecord//lib/active_record/connection_adapters/pool_config.rb#8 + def connection_descriptor; end + + # source://activerecord//lib/active_record/connection_adapters/pool_config.rb#43 + def connection_descriptor=(connection_descriptor); end + + # Returns the value of attribute db_config. + # + # source://activerecord//lib/active_record/connection_adapters/pool_config.rb#8 + def db_config; end + + # source://activerecord//lib/active_record/connection_adapters/pool_config.rb#69 + def discard_pool!; end + + # source://activerecord//lib/active_record/connection_adapters/pool_config.rb#52 + def disconnect!(automatic_reconnect: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/pool_config.rb#65 + def pool; end + + # Returns the value of attribute role. + # + # source://activerecord//lib/active_record/connection_adapters/pool_config.rb#8 + def role; end + + # source://activerecord//lib/active_record/connection_adapters/pool_config.rb#11 + def schema_reflection; end + + # Sets the attribute schema_reflection + # + # @param value the value to set the attribute schema_reflection to. + # + # source://activerecord//lib/active_record/connection_adapters/pool_config.rb#9 + def schema_reflection=(_arg0); end + + # source://activerecord//lib/active_record/connection_adapters/pool_config.rb#39 + def server_version(connection); end + + # Sets the attribute server_version + # + # @param value the value to set the attribute server_version to. + # + # source://activerecord//lib/active_record/connection_adapters/pool_config.rb#9 + def server_version=(_arg0); end + + # Returns the value of attribute shard. + # + # source://activerecord//lib/active_record/connection_adapters/pool_config.rb#8 + def shard; end + + class << self + # source://activerecord//lib/active_record/connection_adapters/pool_config.rb#19 + def discard_pools!; end + + # source://activerecord//lib/active_record/connection_adapters/pool_config.rb#23 + def disconnect_all!; end + end +end + +# source://activerecord//lib/active_record/connection_adapters/pool_config.rb#15 +ActiveRecord::ConnectionAdapters::PoolConfig::INSTANCES = T.let(T.unsafe(nil), ObjectSpace::WeakMap) + +# source://activerecord//lib/active_record/connection_adapters/pool_manager.rb#5 +class ActiveRecord::ConnectionAdapters::PoolManager + # @return [PoolManager] a new instance of PoolManager + # + # source://activerecord//lib/active_record/connection_adapters/pool_manager.rb#6 + def initialize; end + + # source://activerecord//lib/active_record/connection_adapters/pool_manager.rb#26 + def each_pool_config(role = T.unsafe(nil), &block); end + + # source://activerecord//lib/active_record/connection_adapters/pool_manager.rb#44 + def get_pool_config(role, shard); end + + # source://activerecord//lib/active_record/connection_adapters/pool_manager.rb#18 + def pool_configs(role = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/pool_manager.rb#40 + def remove_pool_config(role, shard); end + + # source://activerecord//lib/active_record/connection_adapters/pool_manager.rb#36 + def remove_role(role); end + + # source://activerecord//lib/active_record/connection_adapters/pool_manager.rb#14 + def role_names; end + + # source://activerecord//lib/active_record/connection_adapters/pool_manager.rb#48 + def set_pool_config(role, shard, pool_config); end + + # source://activerecord//lib/active_record/connection_adapters/pool_manager.rb#10 + def shard_names; end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#125 +class ActiveRecord::ConnectionAdapters::PrimaryKeyDefinition < ::Struct + # Returns the value of attribute name + # + # @return [Object] the current value of name + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#125 + def name; end + + # Sets the attribute name + # + # @param value [Object] the value to set the attribute name to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#125 + def name=(_); end + + class << self + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#125 + def [](*_arg0); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#125 + def inspect; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#125 + def keyword_init?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#125 + def members; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#125 + def new(*_arg0); end + end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#8 +module ActiveRecord::ConnectionAdapters::QueryCache + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#210 + def initialize(*_arg0); end + + # Enable the query cache within the block. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#233 + def cache(&block); end + + # Clears the query cache. + # + # One reason you may wish to call this method explicitly is between queries + # that ask the database to randomize results. Otherwise the cache would see + # the same SQL query and repeatedly return the same result each time, silently + # undermining the randomness you were expecting. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#259 + def clear_query_cache; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#249 + def disable_query_cache!; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#237 + def enable_query_cache!; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#217 + def query_cache; end + + # Sets the attribute query_cache + # + # @param value the value to set the attribute query_cache to. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#215 + def query_cache=(_arg0); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#228 + def query_cache_enabled; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#263 + def select_all(arel, name = T.unsafe(nil), binds = T.unsafe(nil), preparable: T.unsafe(nil), async: T.unsafe(nil), allow_retry: T.unsafe(nil)); end + + # Disable the query cache within the block. + # + # Set dirties: false to prevent query caches on all connections from being cleared by write operations. + # (By default, write operations dirty all connections' query caches in case they are replicas whose cache would now be outdated.) + # + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#245 + def uncached(dirties: T.unsafe(nil), &block); end + + private + + # Database adapters can override this method to + # provide custom cache information. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#335 + def cache_notification_info(sql, name, binds); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#327 + def cache_notification_info_result(sql, name, binds, result); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#305 + def cache_sql(sql, name, binds); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#287 + def lookup_sql_cache(sql, name, binds); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#283 + def unset_query_cache!; end + + class << self + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#18 + def dirties_query_cache(base, *method_names); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#12 + def included(base); end + end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#132 +module ActiveRecord::ConnectionAdapters::QueryCache::ConnectionPoolConfiguration + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#133 + def initialize(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#148 + def checkout_and_verify(connection); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#193 + def clear_query_cache; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#189 + def dirties_query_cache; end + + # Disable the query cache within the block. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#155 + def disable_query_cache(dirties: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#180 + def disable_query_cache!; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#165 + def enable_query_cache; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#175 + def enable_query_cache!; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#203 + def query_cache; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#185 + def query_cache_enabled; end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#9 +ActiveRecord::ConnectionAdapters::QueryCache::DEFAULT_SIZE = T.let(T.unsafe(nil), Integer) + +# Each connection pool has one of these registries. They map execution +# contexts to query cache stores. +# +# The keys of the internal map are threads or fibers (whatever +# ActiveSupport::IsolatedExecutionState.context returns), and their +# associated values are their respective query cache stores. +# +# source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#113 +class ActiveRecord::ConnectionAdapters::QueryCache::QueryCacheRegistry + # @return [QueryCacheRegistry] a new instance of QueryCacheRegistry + # + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#114 + def initialize; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#125 + def clear; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#119 + def compute_if_absent(context); end +end + +# This is the actual query cache store. +# +# It has an internal hash whose keys are either SQL strings, or arrays of +# two elements [SQL string, binds], if there are binds. The hash values +# are their corresponding ActiveRecord::Result objects. +# +# Keeping the hash size under max size is achieved with LRU eviction. +# +# The store gets passed a version object, which is shared among the query +# cache stores of a given connection pool (see ConnectionPoolConfiguration +# down below). The version value may be externally changed as a way to +# signal cache invalidation, that is why all methods have a guard for it. +# +# source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#44 +class ActiveRecord::ConnectionAdapters::QueryCache::Store + # @return [Store] a new instance of Store + # + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#49 + def initialize(version, max_size); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#68 + def [](key); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#93 + def clear; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#77 + def compute_if_absent(key); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#45 + def dirties; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#45 + def dirties=(_arg0); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#47 + def dirties?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#63 + def empty?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#45 + def enabled; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#45 + def enabled=(_arg0); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#46 + def enabled?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#58 + def size; end + + private + + # source://activerecord//lib/active_record/connection_adapters/abstract/query_cache.rb#99 + def check_version; end +end + +# = Active Record Connection Adapters \Quoting +# +# source://activerecord//lib/active_record/connection_adapters/abstract/quoting.rb#8 +module ActiveRecord::ConnectionAdapters::Quoting + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::ConnectionAdapters::Quoting::ClassMethods + + # Cast a value to be used as a bound parameter of unknown type. For example, + # MySQL might perform dangerous castings when comparing a string to a number, + # so this method will cast numbers to string. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/quoting.rb#113 + def cast_bound_value(value); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/quoting.rb#213 + def lookup_cast_type(sql_type); end + + # Quotes the column value to help prevent + # {SQL injection attacks}[https://en.wikipedia.org/wiki/SQL_injection]. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/quoting.rb#72 + def quote(value); end + + # Quotes the column name. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/quoting.rb#124 + def quote_column_name(column_name); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/quoting.rb#145 + def quote_default_expression(value, column); end + + # Quotes a string, escaping any ' (single quote) and \ (backslash) + # characters. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/quoting.rb#119 + def quote_string(s); end + + # Quotes the table name. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/quoting.rb#129 + def quote_table_name(table_name); end + + # Override to return the quoted table name for assignment. Defaults to + # table quoting. + # + # This works for MySQL where table.column can be used to + # resolve ambiguity. + # + # We override this in the sqlite3 and postgresql adapters to use only + # the column name (as per syntax requirements). + # + # source://activerecord//lib/active_record/connection_adapters/abstract/quoting.rb#141 + def quote_table_name_for_assignment(table, attr); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/quoting.rb#196 + def quoted_binary(value); end + + # Quote date/time values for use in SQL input. Includes microseconds + # if the value is a Time responding to usec. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/quoting.rb#174 + def quoted_date(value); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/quoting.rb#164 + def quoted_false; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/quoting.rb#191 + def quoted_time(value); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/quoting.rb#156 + def quoted_true; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/quoting.rb#200 + def sanitize_as_sql_comment(value); end + + # Cast a +value+ to a type that the database understands. For example, + # SQLite does not understand dates, so this method will convert a Date + # to a String. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/quoting.rb#94 + def type_cast(value); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/quoting.rb#168 + def unquoted_false; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/quoting.rb#160 + def unquoted_true; end + + private + + # source://activerecord//lib/active_record/connection_adapters/abstract/quoting.rb#219 + def type_casted_binds(binds); end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/quoting.rb#11 +module ActiveRecord::ConnectionAdapters::Quoting::ClassMethods + # Regexp for column names (with or without a table name prefix). + # Matches the following: + # + # "#{table_name}.#{column_name}" + # "#{column_name}" + # + # source://activerecord//lib/active_record/connection_adapters/abstract/quoting.rb#17 + def column_name_matcher; end + + # Regexp for column names with order (with or without a table name prefix, + # with or without various order modifiers). Matches the following: + # + # "#{table_name}.#{column_name}" + # "#{table_name}.#{column_name} #{direction}" + # "#{table_name}.#{column_name} #{direction} NULLS FIRST" + # "#{table_name}.#{column_name} NULLS LAST" + # "#{column_name}" + # "#{column_name} #{direction}" + # "#{column_name} #{direction} NULLS FIRST" + # "#{column_name} NULLS LAST" + # + # source://activerecord//lib/active_record/connection_adapters/abstract/quoting.rb#43 + def column_name_with_order_matcher; end + + # Quotes the column name. Must be implemented by subclasses + # + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/quoting.rb#60 + def quote_column_name(column_name); end + + # Quotes the table name. Defaults to column name quoting. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/quoting.rb#65 + def quote_table_name(table_name); end +end + +# = Active Record Real \Transaction +# +# source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#470 +class ActiveRecord::ConnectionAdapters::RealTransaction < ::ActiveRecord::ConnectionAdapters::Transaction + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#508 + def commit; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#471 + def materialize!; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#485 + def restart; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#499 + def rollback; end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#202 +class ActiveRecord::ConnectionAdapters::ReferenceDefinition + # @return [ReferenceDefinition] a new instance of ReferenceDefinition + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#203 + def initialize(name, polymorphic: T.unsafe(nil), index: T.unsafe(nil), foreign_key: T.unsafe(nil), type: T.unsafe(nil), **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#223 + def add(table_name, connection); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#237 + def add_to(table); end + + private + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#254 + def as_options(value); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#292 + def column_name; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#296 + def column_names; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#284 + def columns; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#258 + def conditional_options; end + + # Returns the value of attribute foreign_key. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#252 + def foreign_key; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#280 + def foreign_key_options; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#300 + def foreign_table_name; end + + # Returns the value of attribute index. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#252 + def index; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#270 + def index_options(table_name); end + + # Returns the value of attribute name. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#252 + def name; end + + # Returns the value of attribute options. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#252 + def options; end + + # Returns the value of attribute polymorphic. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#252 + def polymorphic; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#266 + def polymorphic_index_name(table_name); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#262 + def polymorphic_options; end + + # Returns the value of attribute type. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#252 + def type; end +end + +# = Active Record Restart Parent \Transaction +# +# source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#387 +class ActiveRecord::ConnectionAdapters::RestartParentTransaction < ::ActiveRecord::ConnectionAdapters::Transaction + # @return [RestartParentTransaction] a new instance of RestartParentTransaction + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#388 + def initialize(connection, parent_transaction, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#407 + def commit; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#411 + def full_rollback?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#400 + def isolation(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#400 + def materialize!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#400 + def materialized?(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#400 + def restart(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#402 + def rollback; end +end + +# = Active Record Savepoint \Transaction +# +# source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#415 +class ActiveRecord::ConnectionAdapters::SavepointTransaction < ::ActiveRecord::ConnectionAdapters::Transaction + # @return [SavepointTransaction] a new instance of SavepointTransaction + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#416 + def initialize(connection, savepoint_name, parent_transaction, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#460 + def commit; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#466 + def full_rollback?; end + + # Delegates to parent transaction's isolation level + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#430 + def isolation; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#434 + def isolation=(isolation); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#438 + def materialize!; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#443 + def restart; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#452 + def rollback; end +end + +# = Active Record Connection Adapters \Savepoints +# +# source://activerecord//lib/active_record/connection_adapters/abstract/savepoints.rb#6 +module ActiveRecord::ConnectionAdapters::Savepoints + # source://activerecord//lib/active_record/connection_adapters/abstract/savepoints.rb#11 + def create_savepoint(name = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/savepoints.rb#7 + def current_savepoint_name; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/savepoints.rb#15 + def exec_rollback_to_savepoint(name = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/savepoints.rb#19 + def release_savepoint(name = T.unsafe(nil)); end +end + +# = Active Record Connection Adapters Schema Cache +# +# source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#227 +class ActiveRecord::ConnectionAdapters::SchemaCache + # @return [SchemaCache] a new instance of SchemaCache + # + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#255 + def initialize; end + + # Add internal cache for table with +table_name+. + # + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#326 + def add(pool, table_name); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#396 + def add_all(pool); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#294 + def cached?(table_name); end + + # Clear out internal caches for the data source +name+. + # + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#388 + def clear_data_source_cache!(_connection, name); end + + # Get the columns for a table + # + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#338 + def columns(pool, table_name); end + + # Get the columns for a table as a hash, key is the column name + # value is the column object. + # + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#352 + def columns_hash(pool, table_name); end + + # Checks whether the columns hash is already cached for a table. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#359 + def columns_hash?(_pool, table_name); end + + # A cached lookup for table existence. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#309 + def data_source_exists?(pool, name); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#406 + def dump_to(filename); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#273 + def encode_with(coder); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#363 + def indexes(pool, table_name); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#281 + def init_with(coder); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#416 + def marshal_dump; end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#420 + def marshal_load(array); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#298 + def primary_keys(pool, table_name); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#379 + def schema_version; end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#383 + def size; end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#375 + def version(pool); end + + private + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#448 + def deep_deduplicate(value); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#440 + def derive_columns_hash_and_deduplicate_values; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#436 + def ignored_table?(table_name); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#264 + def initialize_dup(other); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#461 + def open(filename); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#428 + def tables_to_cache(pool); end + + class << self + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#228 + def _load_from(filename); end + + private + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#244 + def read(filename, &block); end + end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#5 +class ActiveRecord::ConnectionAdapters::SchemaCreation + # @return [SchemaCreation] a new instance of SchemaCreation + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#6 + def initialize(conn); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#11 + def accept(o); end + + private + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#180 + def action_sql(action, dependency); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#150 + def add_column_options!(sql, options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#141 + def add_table_options!(create_sql, o); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#146 + def column_options(o); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#16 + def lookup_cast_type(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#16 + def options_include_default?(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#16 + def quote_column_name(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#16 + def quote_default_expression(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#165 + def quote_default_expression_for_column_definition(default, column_definition); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#16 + def quote_table_name(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#133 + def quoted_columns(o); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#16 + def quoted_columns_for_index(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#16 + def supports_check_constraints?(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#16 + def supports_exclusion_constraints?(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#16 + def supports_index_include?(*_arg0, **_arg1, &_arg2); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#137 + def supports_index_using?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#16 + def supports_indexes_in_create?(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#16 + def supports_nulls_not_distinct?(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#16 + def supports_partial_index?(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#16 + def supports_unique_constraints?(*_arg0, **_arg1, &_arg2); end + + # Returns any SQL string to go between CREATE and TABLE. May be nil. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#176 + def table_modifier_in_create(o); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#170 + def to_sql(sql); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#16 + def type_to_sql(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#16 + def use_foreign_keys?(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#129 + def visit_AddCheckConstraint(o); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#41 + def visit_AddColumnDefinition(o); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#96 + def visit_AddForeignKey(o); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#24 + def visit_AlterTable(o); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#125 + def visit_CheckConstraintDefinition(o); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#34 + def visit_ColumnDefinition(o); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#106 + def visit_CreateIndexDefinition(o); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#104 + def visit_DropCheckConstraint(name); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#100 + def visit_DropConstraint(name); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#103 + def visit_DropForeignKey(name); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#83 + def visit_ForeignKeyDefinition(o); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#79 + def visit_PrimaryKeyDefinition(o); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_creation.rb#45 + def visit_TableDefinition(o); end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/schema_dumper.rb#5 +class ActiveRecord::ConnectionAdapters::SchemaDumper < ::ActiveRecord::SchemaDumper + private + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_dumper.rb#13 + def column_spec(column); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_dumper.rb#17 + def column_spec_for_primary_key(column); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_dumper.rb#38 + def default_primary_key?(column); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_dumper.rb#42 + def explicit_primary_key_default?(column); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_dumper.rb#25 + def prepare_column_options(column); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_dumper.rb#102 + def schema_collation(column); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_dumper.rb#86 + def schema_default(column); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_dumper.rb#98 + def schema_expression(column); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_dumper.rb#62 + def schema_limit(column); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_dumper.rb#67 + def schema_precision(column); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_dumper.rb#82 + def schema_scale(column); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_dumper.rb#54 + def schema_type(column); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_dumper.rb#46 + def schema_type_with_virtual(column); end + + class << self + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_dumper.rb#8 + def create(connection, options); end + end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/schema_dumper.rb#6 +ActiveRecord::ConnectionAdapters::SchemaDumper::DEFAULT_DATETIME_PRECISION = T.let(T.unsafe(nil), Integer) + +# source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#7 +class ActiveRecord::ConnectionAdapters::SchemaReflection + # @return [SchemaReflection] a new instance of SchemaReflection + # + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#16 + def initialize(cache_path, cache = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#41 + def add(pool, name); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#79 + def cached?(table_name); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#21 + def clear!; end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#73 + def clear_data_source_cache!(pool, name); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#49 + def columns(pool, table_name); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#53 + def columns_hash(pool, table_name); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#57 + def columns_hash?(pool, table_name); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#37 + def data_source_exists?(pool, name); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#45 + def data_sources(pool, name); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#91 + def dump_to(pool, filename); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#61 + def indexes(pool, table_name); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#27 + def load!(pool); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#33 + def primary_keys(pool, table_name); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#69 + def size(pool); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#65 + def version(pool); end + + private + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#106 + def cache(pool); end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#100 + def empty_cache; end + + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#116 + def load_cache(pool); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#110 + def possible_cache_available?; end + + class << self + # Returns the value of attribute check_schema_cache_dump_version. + # + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#10 + def check_schema_cache_dump_version; end + + # Sets the attribute check_schema_cache_dump_version + # + # @param value the value to set the attribute check_schema_cache_dump_version to. + # + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#10 + def check_schema_cache_dump_version=(_arg0); end + + # Returns the value of attribute use_schema_cache_dump. + # + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#9 + def use_schema_cache_dump; end + + # Sets the attribute use_schema_cache_dump + # + # @param value the value to set the attribute use_schema_cache_dump to. + # + # source://activerecord//lib/active_record/connection_adapters/schema_cache.rb#9 + def use_schema_cache_dump=(_arg0); end + end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#9 +module ActiveRecord::ConnectionAdapters::SchemaStatements + include ::ActiveRecord::Migration::JoinTable + + # Adds a reference. The reference column is a bigint by default, + # the :type option can be used to specify a different type. + # Optionally adds a +_type+ column, if :polymorphic option is provided. + # + # The +options+ hash can include the following keys: + # [:type] + # The reference column type. Defaults to +:bigint+. + # [:index] + # Add an appropriate index. Defaults to true. + # See #add_index for usage of this option. + # [:foreign_key] + # Add an appropriate foreign key constraint. Defaults to false, pass true + # to add. In case the join table can't be inferred from the association + # pass :to_table with the appropriate table name. + # [:polymorphic] + # Whether an additional +_type+ column should be added. Defaults to false. + # [:null] + # Whether the column allows nulls. Defaults to true. + # + # ====== Create a user_id bigint column without an index + # + # add_reference(:products, :user, index: false) + # + # ====== Create a user_id string column + # + # add_reference(:products, :user, type: :string) + # + # ====== Create supplier_id, supplier_type columns + # + # add_reference(:products, :supplier, polymorphic: true) + # + # ====== Create a supplier_id column with a unique index + # + # add_reference(:products, :supplier, index: { unique: true }) + # + # ====== Create a supplier_id column with a named index + # + # add_reference(:products, :supplier, index: { name: "my_supplier_index" }) + # + # ====== Create a supplier_id column and appropriate foreign key + # + # add_reference(:products, :supplier, foreign_key: true) + # + # ====== Create a supplier_id column and a foreign key to the firms table + # + # add_reference(:products, :supplier, foreign_key: { to_table: :firms }) + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1098 + def add_belongs_to(table_name, ref_name, **options); end + + # Adds a new check constraint to the table. +expression+ is a String + # representation of verifiable boolean condition. + # + # add_check_constraint :products, "price > 0", name: "price_check" + # + # generates: + # + # ALTER TABLE "products" ADD CONSTRAINT price_check CHECK (price > 0) + # + # The +options+ hash can include the following keys: + # [:name] + # The constraint name. Defaults to chk_rails_. + # [:if_not_exists] + # Silently ignore if the constraint already exists, rather than raise an error. + # [:validate] + # (PostgreSQL only) Specify whether or not the constraint should be validated. Defaults to +true+. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1326 + def add_check_constraint(table_name, expression, if_not_exists: T.unsafe(nil), **options); end + + # Add a new +type+ column named +column_name+ to +table_name+. + # + # See {ActiveRecord::ConnectionAdapters::TableDefinition.column}[rdoc-ref:ActiveRecord::ConnectionAdapters::TableDefinition#column]. + # + # The +type+ parameter is normally one of the migration's native types, + # which is one of the following: + # :primary_key, :string, :text, + # :integer, :bigint, :float, :decimal, :numeric, + # :datetime, :time, :date, + # :binary, :blob, :boolean. + # + # You may use a type not in this list as long as it is supported by your + # database (for example, "polygon" in MySQL), but this will not be database + # agnostic and should usually be avoided. + # + # Available options are (none of these exists by default): + # * :comment - + # Specifies the comment for the column. This option is ignored by some backends. + # * :collation - + # Specifies the collation for a :string or :text column. + # If not specified, the column will have the same collation as the table. + # * :default - + # The column's default value. Use +nil+ for +NULL+. + # * :limit - + # Requests a maximum column length. This is the number of characters for a :string column + # and number of bytes for :text, :binary, :blob, and :integer columns. + # This option is ignored by some backends. + # * :null - + # Allows or disallows +NULL+ values in the column. + # * :precision - + # Specifies the precision for the :decimal, :numeric, + # :datetime, and :time columns. + # * :scale - + # Specifies the scale for the :decimal and :numeric columns. + # * :if_not_exists - + # Specifies if the column already exists to not try to re-add it. This will avoid + # duplicate column errors. + # + # Note: The precision is the total number of significant digits, + # and the scale is the number of digits that can be stored following + # the decimal point. For example, the number 123.45 has a precision of 5 + # and a scale of 2. A decimal with a precision of 5 and a scale of 2 can + # range from -999.99 to 999.99. + # + # Please be aware of different RDBMS implementations behavior with + # :decimal columns: + # * The SQL standard says the default scale should be 0, :scale <= + # :precision, and makes no comments about the requirements of + # :precision. + # * MySQL: :precision [1..65], :scale [0..30]. + # Default is (10,0). + # * PostgreSQL: :precision [1..infinity], + # :scale [0..infinity]. No default. + # * SQLite3: No restrictions on :precision and :scale, + # but the maximum supported :precision is 16. No default. + # * Oracle: :precision [1..38], :scale [-84..127]. + # Default is (38,0). + # * SqlServer: :precision [1..38], :scale [0..38]. + # Default (38,0). + # + # == Examples + # + # add_column(:users, :picture, :binary, limit: 2.megabytes) + # # ALTER TABLE "users" ADD "picture" blob(2097152) + # + # add_column(:articles, :status, :string, limit: 20, default: 'draft', null: false) + # # ALTER TABLE "articles" ADD "status" varchar(20) DEFAULT 'draft' NOT NULL + # + # add_column(:answers, :bill_gates_money, :decimal, precision: 15, scale: 2) + # # ALTER TABLE "answers" ADD "bill_gates_money" decimal(15,2) + # + # add_column(:measurements, :sensor_reading, :decimal, precision: 30, scale: 20) + # # ALTER TABLE "measurements" ADD "sensor_reading" decimal(30,20) + # + # # While :scale defaults to zero on most databases, it + # # probably wouldn't hurt to include it. + # add_column(:measurements, :huge_integer, :decimal, precision: 30) + # # ALTER TABLE "measurements" ADD "huge_integer" decimal(30) + # + # # Defines a column that stores an array of a type. + # add_column(:users, :skills, :text, array: true) + # # ALTER TABLE "users" ADD "skills" text[] + # + # # Defines a column with a database-specific type. + # add_column(:shapes, :triangle, 'polygon') + # # ALTER TABLE "shapes" ADD "triangle" polygon + # + # # Ignores the method call if the column exists + # add_column(:shapes, :triangle, 'polygon', if_not_exists: true) + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#655 + def add_column(table_name, column_name, type, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#662 + def add_columns(table_name, *column_names, type:, **options); end + + # Adds a new foreign key. +from_table+ is the table with the key column, + # +to_table+ contains the referenced primary key. + # + # The foreign key will be named after the following pattern: fk_rails_. + # +identifier+ is a 10 character long string which is deterministically generated from the + # +from_table+ and +column+. A custom name can be specified with the :name option. + # + # ====== Creating a simple foreign key + # + # add_foreign_key :articles, :authors + # + # generates: + # + # ALTER TABLE "articles" ADD CONSTRAINT fk_rails_e74ce85cbc FOREIGN KEY ("author_id") REFERENCES "authors" ("id") + # + # ====== Creating a foreign key, ignoring method call if the foreign key exists + # + # add_foreign_key(:articles, :authors, if_not_exists: true) + # + # ====== Creating a foreign key on a specific column + # + # add_foreign_key :articles, :users, column: :author_id, primary_key: "lng_id" + # + # generates: + # + # ALTER TABLE "articles" ADD CONSTRAINT fk_rails_58ca3d3a82 FOREIGN KEY ("author_id") REFERENCES "users" ("lng_id") + # + # ====== Creating a composite foreign key + # + # Assuming "carts" table has "(shop_id, user_id)" as a primary key. + # + # add_foreign_key :orders, :carts, primary_key: [:shop_id, :user_id] + # + # generates: + # + # ALTER TABLE "orders" ADD CONSTRAINT fk_rails_6f5e4cb3a4 FOREIGN KEY ("cart_shop_id", "cart_user_id") REFERENCES "carts" ("shop_id", "user_id") + # + # ====== Creating a cascading foreign key + # + # add_foreign_key :articles, :authors, on_delete: :cascade + # + # generates: + # + # ALTER TABLE "articles" ADD CONSTRAINT fk_rails_e74ce85cbc FOREIGN KEY ("author_id") REFERENCES "authors" ("id") ON DELETE CASCADE + # + # The +options+ hash can include the following keys: + # [:column] + # The foreign key column name on +from_table+. Defaults to to_table.singularize + "_id". + # Pass an array to create a composite foreign key. + # [:primary_key] + # The primary key column name on +to_table+. Defaults to +id+. + # Pass an array to create a composite foreign key. + # [:name] + # The constraint name. Defaults to fk_rails_. + # [:on_delete] + # Action that happens ON DELETE. Valid values are +:nullify+, +:cascade+, and +:restrict+ + # [:on_update] + # Action that happens ON UPDATE. Valid values are +:nullify+, +:cascade+, and +:restrict+ + # [:if_not_exists] + # Specifies if the foreign key already exists to not try to re-add it. This will avoid + # duplicate column errors. + # [:validate] + # (PostgreSQL only) Specify whether or not the constraint should be validated. Defaults to +true+. + # [:deferrable] + # (PostgreSQL only) Specify whether or not the foreign key should be deferrable. Valid values are booleans or + # +:deferred+ or +:immediate+ to specify the default behavior. Defaults to +false+. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1205 + def add_foreign_key(from_table, to_table, **options); end + + # Adds a new index to the table. +column_name+ can be a single Symbol, or + # an Array of Symbols. + # + # The index will be named after the table and the column name(s), unless + # you pass :name as an option. + # + # ====== Creating a simple index + # + # add_index(:suppliers, :name) + # + # generates: + # + # CREATE INDEX index_suppliers_on_name ON suppliers(name) + # + # ====== Creating a index which already exists + # + # add_index(:suppliers, :name, if_not_exists: true) + # + # generates: + # + # CREATE INDEX IF NOT EXISTS index_suppliers_on_name ON suppliers(name) + # + # Note: Not supported by MySQL. + # + # ====== Creating a unique index + # + # add_index(:accounts, [:branch_id, :party_id], unique: true) + # + # generates: + # + # CREATE UNIQUE INDEX index_accounts_on_branch_id_and_party_id ON accounts(branch_id, party_id) + # + # ====== Creating a named index + # + # add_index(:accounts, [:branch_id, :party_id], unique: true, name: 'by_branch_party') + # + # generates: + # + # CREATE UNIQUE INDEX by_branch_party ON accounts(branch_id, party_id) + # + # ====== Creating an index with specific key length + # + # add_index(:accounts, :name, name: 'by_name', length: 10) + # + # generates: + # + # CREATE INDEX by_name ON accounts(name(10)) + # + # ====== Creating an index with specific key lengths for multiple keys + # + # add_index(:accounts, [:name, :surname], name: 'by_name_surname', length: {name: 10, surname: 15}) + # + # generates: + # + # CREATE INDEX by_name_surname ON accounts(name(10), surname(15)) + # + # Note: only supported by MySQL + # + # ====== Creating an index with a sort order (desc or asc, asc is the default) + # + # add_index(:accounts, [:branch_id, :party_id, :surname], name: 'by_branch_desc_party', order: {branch_id: :desc, party_id: :asc}) + # + # generates: + # + # CREATE INDEX by_branch_desc_party ON accounts(branch_id DESC, party_id ASC, surname) + # + # Note: MySQL only supports index order from 8.0.1 onwards (earlier versions accepted the syntax but ignored it). + # + # ====== Creating a partial index + # + # add_index(:accounts, [:branch_id, :party_id], unique: true, where: "active") + # + # generates: + # + # CREATE UNIQUE INDEX index_accounts_on_branch_id_and_party_id ON accounts(branch_id, party_id) WHERE active + # + # Note: Partial indexes are only supported for PostgreSQL and SQLite. + # + # ====== Creating an index that includes additional columns + # + # add_index(:accounts, :branch_id, include: :party_id) + # + # generates: + # + # CREATE INDEX index_accounts_on_branch_id ON accounts USING btree(branch_id) INCLUDE (party_id) + # + # Note: only supported by PostgreSQL. + # + # ====== Creating an index where NULLs are treated equally + # + # add_index(:people, :last_name, nulls_not_distinct: true) + # + # generates: + # + # CREATE INDEX index_people_on_last_name ON people (last_name) NULLS NOT DISTINCT + # + # Note: only supported by PostgreSQL version 15.0.0 and greater. + # + # ====== Creating an index with a specific method + # + # add_index(:developers, :name, using: 'btree') + # + # generates: + # + # CREATE INDEX index_developers_on_name ON developers USING btree (name) -- PostgreSQL + # CREATE INDEX index_developers_on_name USING btree ON developers (name) -- MySQL + # + # Note: only supported by PostgreSQL and MySQL + # + # ====== Creating an index with a specific operator class + # + # add_index(:developers, :name, using: 'gist', opclass: :gist_trgm_ops) + # # CREATE INDEX developers_on_name ON developers USING gist (name gist_trgm_ops) -- PostgreSQL + # + # add_index(:developers, [:name, :city], using: 'gist', opclass: { city: :gist_trgm_ops }) + # # CREATE INDEX developers_on_name_and_city ON developers USING gist (name, city gist_trgm_ops) -- PostgreSQL + # + # add_index(:developers, [:name, :city], using: 'gist', opclass: :gist_trgm_ops) + # # CREATE INDEX developers_on_name_and_city ON developers USING gist (name gist_trgm_ops, city gist_trgm_ops) -- PostgreSQL + # + # Note: only supported by PostgreSQL + # + # ====== Creating an index with a specific type + # + # add_index(:developers, :name, type: :fulltext) + # + # generates: + # + # CREATE FULLTEXT INDEX index_developers_on_name ON developers (name) -- MySQL + # + # Note: only supported by MySQL. + # + # ====== Creating an index with a specific algorithm + # + # add_index(:developers, :name, algorithm: :concurrently) + # # CREATE INDEX CONCURRENTLY developers_on_name on developers (name) -- PostgreSQL + # + # add_index(:developers, :name, algorithm: :inplace) + # # CREATE INDEX `index_developers_on_name` ON `developers` (`name`) ALGORITHM = INPLACE -- MySQL + # + # Note: only supported by PostgreSQL and MySQL. + # + # Concurrently adding an index is not supported in a transaction. + # + # For more information see the {"Transactional Migrations" section}[rdoc-ref:Migration]. + # + # ====== Creating an index that is not used by queries + # + # add_index(:developers, :name, enabled: false) + # + # generates: + # + # CREATE INDEX index_developers_on_name ON developers (name) INVISIBLE -- MySQL + # + # CREATE INDEX index_developers_on_name ON developers (name) IGNORED -- MariaDB + # + # Note: only supported by MySQL version 8.0.0 and greater, and MariaDB version 10.6.0 and greater. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#947 + def add_index(table_name, column_name, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1509 + def add_index_options(table_name, column_name, name: T.unsafe(nil), if_not_exists: T.unsafe(nil), internal: T.unsafe(nil), **options); end + + # Adds a reference. The reference column is a bigint by default, + # the :type option can be used to specify a different type. + # Optionally adds a +_type+ column, if :polymorphic option is provided. + # + # The +options+ hash can include the following keys: + # [:type] + # The reference column type. Defaults to +:bigint+. + # [:index] + # Add an appropriate index. Defaults to true. + # See #add_index for usage of this option. + # [:foreign_key] + # Add an appropriate foreign key constraint. Defaults to false, pass true + # to add. In case the join table can't be inferred from the association + # pass :to_table with the appropriate table name. + # [:polymorphic] + # Whether an additional +_type+ column should be added. Defaults to false. + # [:null] + # Whether the column allows nulls. Defaults to true. + # + # ====== Create a user_id bigint column without an index + # + # add_reference(:products, :user, index: false) + # + # ====== Create a user_id string column + # + # add_reference(:products, :user, type: :string) + # + # ====== Create supplier_id, supplier_type columns + # + # add_reference(:products, :supplier, polymorphic: true) + # + # ====== Create a supplier_id column with a unique index + # + # add_reference(:products, :supplier, index: { unique: true }) + # + # ====== Create a supplier_id column with a named index + # + # add_reference(:products, :supplier, index: { name: "my_supplier_index" }) + # + # ====== Create a supplier_id column and appropriate foreign key + # + # add_reference(:products, :supplier, foreign_key: true) + # + # ====== Create a supplier_id column and a foreign key to the firms table + # + # add_reference(:products, :supplier, foreign_key: { to_table: :firms }) + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1095 + def add_reference(table_name, ref_name, **options); end + + # Adds timestamps (+created_at+ and +updated_at+) columns to +table_name+. + # Additional options (like +:null+) are forwarded to #add_column. + # + # add_timestamps(:suppliers, null: true) + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1492 + def add_timestamps(table_name, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1397 + def assume_migrated_upto_version(version); end + + # Builds an AlterTable object for adding a column to a table. + # + # This definition object contains information about the column that would be created + # if the same arguments were passed to #add_column. See #add_column for information about + # passing a +table_name+, +column_name+, +type+ and other options that can be passed. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#673 + def build_add_column_definition(table_name, column_name, type, **options); end + + # Builds a ChangeColumnDefaultDefinition object. + # + # This definition object contains information about the column change that would occur + # if the same arguments were passed to #change_column_default. See #change_column_default for + # information about passing a +table_name+, +column_name+, +type+ and other options that can be passed. + # + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#757 + def build_change_column_default_definition(table_name, column_name, default_or_changes); end + + # Builds a CreateIndexDefinition object. + # + # This definition object contains information about the index that would be created + # if the same arguments were passed to #add_index. See #add_index for information about + # passing a +table_name+, +column_name+, and other additional options that can be passed. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#957 + def build_create_index_definition(table_name, column_name, **options); end + + # Builds a TableDefinition object for a join table. + # + # This definition object contains information about the table that would be created + # if the same arguments were passed to #create_join_table. See #create_join_table for + # information about what arguments should be passed. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#427 + def build_create_join_table_definition(table_1, table_2, column_options: T.unsafe(nil), **options); end + + # Returns a TableDefinition object containing information about the table that would be created + # if the same arguments were passed to #create_table. See #create_table for information about + # passing a +table_name+, and other additional options that can be passed. + # + # @yield [table_definition] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#337 + def build_create_table_definition(table_name, id: T.unsafe(nil), primary_key: T.unsafe(nil), force: T.unsafe(nil), **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1602 + def bulk_change_table(table_name, operations); end + + # Changes the column's definition according to the new options. + # See TableDefinition#column for details of the options you can use. + # + # change_column(:suppliers, :name, :string, limit: 80) + # change_column(:accounts, :description, :text) + # + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#730 + def change_column(table_name, column_name, type, **options); end + + # Changes the comment for a column or removes it if +nil+. + # + # Passing a hash containing +:from+ and +:to+ will make this change + # reversible in migration: + # + # change_column_comment(:posts, :state, from: "old_comment", to: "new_comment") + # + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1570 + def change_column_comment(table_name, column_name, comment_or_changes); end + + # Sets a new default value for a column: + # + # change_column_default(:suppliers, :qualification, 'new') + # change_column_default(:accounts, :authorized, 1) + # + # Setting the default to +nil+ effectively drops the default: + # + # change_column_default(:users, :email, nil) + # + # Passing a hash containing +:from+ and +:to+ will make this change + # reversible in migration: + # + # change_column_default(:posts, :state, from: nil, to: "draft") + # + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#748 + def change_column_default(table_name, column_name, default_or_changes); end + + # Sets or removes a NOT NULL constraint on a column. The +null+ flag + # indicates whether the value can be +NULL+. For example + # + # change_column_null(:users, :nickname, false) + # + # says nicknames cannot be +NULL+ (adds the constraint), whereas + # + # change_column_null(:users, :nickname, true) + # + # allows them to be +NULL+ (drops the constraint). + # + # The method accepts an optional fourth argument to replace existing + # NULLs with some other value. Use that one when enabling the + # constraint if needed, since otherwise those rows would not be valid. + # + # Please note the fourth argument does not set a column's default. + # + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#777 + def change_column_null(table_name, column_name, null, default = T.unsafe(nil)); end + + # A block for changing columns in +table+. + # + # # change_table() yields a Table instance + # change_table(:suppliers) do |t| + # t.column :name, :string, limit: 60 + # # Other column alterations here + # end + # + # The +options+ hash can include the following keys: + # [:bulk] + # Set this to true to make this a bulk alter query, such as + # + # ALTER TABLE `users` ADD COLUMN age INT, ADD COLUMN birthdate DATETIME ... + # + # Defaults to false. + # + # Only supported on the MySQL and PostgreSQL adapter, ignored elsewhere. + # + # ====== Add a column + # + # change_table(:suppliers) do |t| + # t.column :name, :string, limit: 60 + # end + # + # ====== Change type of a column + # + # change_table(:suppliers) do |t| + # t.change :metadata, :json + # end + # + # ====== Add 2 integer columns + # + # change_table(:suppliers) do |t| + # t.integer :width, :height, null: false, default: 0 + # end + # + # ====== Add created_at/updated_at columns + # + # change_table(:suppliers) do |t| + # t.timestamps + # end + # + # ====== Add a foreign key column + # + # change_table(:suppliers) do |t| + # t.references :company + # end + # + # Creates a company_id(bigint) column. + # + # ====== Add a polymorphic foreign key column + # + # change_table(:suppliers) do |t| + # t.belongs_to :company, polymorphic: true + # end + # + # Creates company_type(varchar) and company_id(bigint) columns. + # + # ====== Remove a column + # + # change_table(:suppliers) do |t| + # t.remove :company + # end + # + # ====== Remove several columns + # + # change_table(:suppliers) do |t| + # t.remove :company_id + # t.remove :width, :height + # end + # + # ====== Remove an index + # + # change_table(:suppliers) do |t| + # t.remove_index :company_id + # end + # + # See also Table for details on all of the various column transformations. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#529 + def change_table(table_name, base = T.unsafe(nil), **options); end + + # Changes the comment for a table or removes it if +nil+. + # + # Passing a hash containing +:from+ and +:to+ will make this change + # reversible in migration: + # + # change_table_comment(:posts, from: "old_comment", to: "new_comment") + # + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1560 + def change_table_comment(table_name, comment_or_changes); end + + # Checks to see if a check constraint exists on a table for a given check constraint definition. + # + # check_constraint_exists?(:products, name: "price_check") + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1374 + def check_constraint_exists?(table_name, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1338 + def check_constraint_options(table_name, expression, options); end + + # Returns an array of check constraints for the given table. + # The check constraints are represented as CheckConstraintDefinition objects. + # + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1306 + def check_constraints(table_name); end + + # Checks to see if a column exists in a given table. + # + # # Check a column exists + # column_exists?(:suppliers, :name) + # + # # Check a column exists of a particular type + # # + # # This works for standard non-casted types (eg. string) but is unreliable + # # for types that may get cast to something else (eg. char, bigint). + # column_exists?(:suppliers, :name, :string) + # + # # Check a column exists with a specific definition + # column_exists?(:suppliers, :name, :string, limit: 100) + # column_exists?(:suppliers, :name, :string, default: 'default') + # column_exists?(:suppliers, :name, :string, null: false) + # column_exists?(:suppliers, :tax, :decimal, precision: 8, scale: 2) + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#133 + def column_exists?(table_name, column_name, type = T.unsafe(nil), **options); end + + # Returns an array of +Column+ objects for the table specified by +table_name+. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#108 + def columns(table_name); end + + # Given a set of columns and an ORDER BY clause, returns the columns for a SELECT DISTINCT. + # PostgreSQL, MySQL, and Oracle override this for custom DISTINCT syntax - they + # require the order columns appear in the SELECT. + # + # columns_for_distinct("posts.id", ["posts.created_at desc"]) + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1458 + def columns_for_distinct(columns, orders); end + + # Creates a new join table with the name created using the lexical order of the first two + # arguments. These arguments can be a String or a Symbol. + # + # # Creates a table called 'assemblies_parts' with no id. + # create_join_table(:assemblies, :parts) + # + # # Creates a table called 'paper_boxes_papers' with no id. + # create_join_table('papers', 'paper_boxes') + # + # A duplicate prefix is combined into a single prefix. This is useful for + # namespaced models like Music::Artist and Music::Record: + # + # # Creates a table called 'music_artists_records' with no id. + # create_join_table('music_artists', 'music_records') + # + # See {connection.add_reference}[rdoc-ref:SchemaStatements#add_reference] + # for details of the options you can use in +column_options+. +column_options+ + # will be applied to both columns. + # + # You can pass an +options+ hash which can include the following keys: + # [:table_name] + # Sets the table name, overriding the default. + # [:options] + # Any extra options you want appended to the table definition. + # [:temporary] + # Make a temporary table. + # [:force] + # Set to true to drop the table before creating it. + # Defaults to false. + # + # Note that #create_join_table does not create any indices by default; you can use + # its block form to do so yourself: + # + # create_join_table :products, :categories do |t| + # t.index :product_id + # t.index :category_id + # end + # + # ====== Add foreign keys with delete cascade + # + # create_join_table(:assemblies, :parts, column_options: { foreign_key: { on_delete: :cascade } }) + # + # generates: + # + # CREATE TABLE assemblies_parts ( + # assembly_id bigint NOT NULL, + # part_id bigint NOT NULL, + # CONSTRAINT fk_rails_0d8a572d89 FOREIGN KEY ("assembly_id") REFERENCES "assemblies" ("id") ON DELETE CASCADE, + # CONSTRAINT fk_rails_ec7b48402b FOREIGN KEY ("part_id") REFERENCES "parts" ("id") ON DELETE CASCADE + # ) + # + # ====== Add a backend specific option to the generated SQL (MySQL) + # + # create_join_table(:assemblies, :parts, options: 'ENGINE=InnoDB DEFAULT CHARSET=utf8') + # + # generates: + # + # CREATE TABLE assemblies_parts ( + # assembly_id bigint NOT NULL, + # part_id bigint NOT NULL, + # ) ENGINE=InnoDB DEFAULT CHARSET=utf8 + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#408 + def create_join_table(table_1, table_2, column_options: T.unsafe(nil), **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1588 + def create_schema_dumper(options); end + + # Creates a new table with the name +table_name+. +table_name+ may either + # be a String or a Symbol. + # + # There are two ways to work with #create_table. You can use the block + # form or the regular form, like this: + # + # === Block form + # + # # create_table() passes a TableDefinition object to the block. + # # This form will not only create the table, but also columns for the + # # table. + # + # create_table(:suppliers) do |t| + # t.column :name, :string, limit: 60 + # # Other fields here + # end + # + # === Block form, with shorthand + # + # # You can also use the column types as method calls, rather than calling the column method. + # create_table(:suppliers) do |t| + # t.string :name, limit: 60 + # # Other fields here + # end + # + # === Regular form + # + # # Creates a table called 'suppliers' with no columns. + # create_table(:suppliers) + # # Add a column to 'suppliers'. + # add_column(:suppliers, :name, :string, {limit: 60}) + # + # The +options+ hash can include the following keys: + # [:id] + # Whether to automatically add a primary key column. Defaults to true. + # Join tables for {ActiveRecord::Base.has_and_belongs_to_many}[rdoc-ref:Associations::ClassMethods#has_and_belongs_to_many] should set it to false. + # + # A Symbol can be used to specify the type of the generated primary key column. + # + # A Hash can be used to specify the generated primary key column creation options. + # See {add_column}[rdoc-ref:ConnectionAdapters::SchemaStatements#add_column] for available options. + # [:primary_key] + # The name of the primary key, if one is to be added automatically. + # Defaults to +id+. If :id is false, then this option is ignored. + # + # If an array is passed, a composite primary key will be created. + # + # Note that Active Record models will automatically detect their + # primary key. This can be avoided by using + # {self.primary_key=}[rdoc-ref:AttributeMethods::PrimaryKey::ClassMethods#primary_key=] on the model + # to define the key explicitly. + # + # [:options] + # Any extra options you want appended to the table definition. + # [:temporary] + # Make a temporary table. + # [:force] + # Set to true to drop the table before creating it. + # Set to +:cascade+ to drop dependent objects as well. + # Defaults to false. + # [:if_not_exists] + # Set to true to avoid raising an error when the table already exists. + # Defaults to false. + # [:as] + # SQL to use to generate the table. When this option is used, the block is + # ignored, as are the :id and :primary_key options. + # + # ====== Add a backend specific option to the generated SQL (MySQL) + # + # create_table(:suppliers, options: 'ENGINE=InnoDB DEFAULT CHARSET=utf8mb4') + # + # generates: + # + # CREATE TABLE suppliers ( + # id bigint auto_increment PRIMARY KEY + # ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 + # + # ====== Rename the primary key column + # + # create_table(:objects, primary_key: 'guid') do |t| + # t.column :name, :string, limit: 80 + # end + # + # generates: + # + # CREATE TABLE objects ( + # guid bigint auto_increment PRIMARY KEY, + # name varchar(80) + # ) + # + # ====== Change the primary key column type + # + # create_table(:tags, id: :string) do |t| + # t.column :label, :string + # end + # + # generates: + # + # CREATE TABLE tags ( + # id varchar PRIMARY KEY, + # label varchar + # ) + # + # ====== Create a composite primary key + # + # create_table(:orders, primary_key: [:product_id, :client_id]) do |t| + # t.belongs_to :product + # t.belongs_to :client + # end + # + # generates: + # + # CREATE TABLE orders ( + # product_id bigint NOT NULL, + # client_id bigint NOT NULL + # ); + # + # ALTER TABLE ONLY "orders" + # ADD CONSTRAINT orders_pkey PRIMARY KEY (product_id, client_id); + # + # ====== Do not add a primary key column + # + # create_table(:categories_suppliers, id: false) do |t| + # t.column :category_id, :bigint + # t.column :supplier_id, :bigint + # end + # + # generates: + # + # CREATE TABLE categories_suppliers ( + # category_id bigint, + # supplier_id bigint + # ) + # + # ====== Create a temporary table based on a query + # + # create_table(:long_query, temporary: true, + # as: "SELECT * FROM orders INNER JOIN line_items ON order_id=orders.id") + # + # generates: + # + # CREATE TEMPORARY TABLE long_query AS + # SELECT * FROM orders INNER JOIN line_items ON order_id=orders.id + # + # See also TableDefinition#column for details on how to create columns. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#297 + def create_table(table_name, id: T.unsafe(nil), primary_key: T.unsafe(nil), force: T.unsafe(nil), **options, &block); end + + # Checks to see if the data source +name+ exists on the database. + # + # data_source_exists?(:ebooks) + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#45 + def data_source_exists?(name); end + + # Returns the relation names usable to back Active Record models. + # For most adapters this means all #tables and #views. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#35 + def data_sources; end + + # Prevents an index from being used by queries. + # + # disable_index(:users, :email) + # + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1584 + def disable_index(table_name, index_name); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1462 + def distinct_relation_for_primary_key(relation); end + + # Drops the join table specified by the given arguments. + # See #create_join_table and #drop_table for details. + # + # Although this command ignores the block if one is given, it can be helpful + # to provide one in a migration's +change+ method so it can be reverted. + # In that case, the block will be used by #create_join_table. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#446 + def drop_join_table(table_1, table_2, **options); end + + # Drops a table or tables from the database. + # + # [:force] + # Set to +:cascade+ to drop dependent objects as well. + # Defaults to false. + # [:if_exists] + # Set to +true+ to only drop the table if it exists. + # Defaults to false. + # + # Although this command ignores most +options+ and the block if one is given, + # it can be helpful to provide these in a migration's +change+ method so it can be reverted. + # In that case, +options+ and the block will be used by #create_table except if you provide more than one table which is not supported. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#559 + def drop_table(*table_names, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1388 + def dump_schema_versions; end + + # Enables an index to be used by queries. + # + # enable_index(:users, :email) + # + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1577 + def enable_index(table_name, index_name); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1274 + def foreign_key_column_for(table_name, column_name); end + + # Checks to see if a foreign key exists on a table for a given foreign key definition. + # + # # Checks to see if a foreign key exists. + # foreign_key_exists?(:accounts, :branches) + # + # # Checks to see if a foreign key on a specified column exists. + # foreign_key_exists?(:accounts, column: :owner_id) + # + # # Checks to see if a foreign key with a custom name exists. + # foreign_key_exists?(:accounts, name: "special_fk_name") + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1270 + def foreign_key_exists?(from_table, to_table = T.unsafe(nil), **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1279 + def foreign_key_options(from_table, to_table, options); end + + # Returns an array of foreign keys for the given table. + # The foreign keys are represented as ForeignKeyDefinition objects. + # + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1135 + def foreign_keys(table_name); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1537 + def index_algorithm(algorithm); end + + # Checks to see if an index exists on a table for a given index definition. + # + # # Check an index exists + # index_exists?(:suppliers, :company_id) + # + # # Check an index on multiple columns exists + # index_exists?(:suppliers, [:company_id, :company_type]) + # + # # Check a unique index exists + # index_exists?(:suppliers, :company_id, unique: true) + # + # # Check an index with a custom name exists + # index_exists?(:suppliers, :company_id, name: "idx_company_id") + # + # # Check a valid index exists (PostgreSQL only) + # index_exists?(:suppliers, :company_id, valid: true) + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#103 + def index_exists?(table_name, column_name = T.unsafe(nil), **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1024 + def index_name(table_name, options); end + + # Verifies the existence of an index with a given name. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1043 + def index_name_exists?(table_name, index_name); end + + # Returns an array of indexes for the given table. + # + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#82 + def indexes(table_name); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1393 + def internal_string_options_for_primary_key; end + + # Returns the maximum length of an index name in bytes. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1640 + def max_index_name_size; end + + # Returns a hash of mappings from the abstract data types to the native + # database types. See TableDefinition#column for details on the recognized + # abstract data types. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#15 + def native_database_types; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1550 + def options_include_default?(options); end + + # Returns just a table's primary key + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#146 + def primary_key(table_name); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1543 + def quoted_columns_for_index(column_names, options); end + + # Removes the reference(s). Also removes a +type+ column if one exists. + # + # ====== Remove the reference + # + # remove_reference(:products, :user, index: false) + # + # ====== Remove polymorphic reference + # + # remove_reference(:products, :supplier, polymorphic: true) + # + # ====== Remove the reference with a foreign key + # + # remove_reference(:products, :user, foreign_key: true) + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1131 + def remove_belongs_to(table_name, ref_name, foreign_key: T.unsafe(nil), polymorphic: T.unsafe(nil), **options); end + + # Removes the given check constraint from the table. Removing a check constraint + # that does not exist will raise an error. + # + # remove_check_constraint :products, name: "price_check" + # + # To silently ignore a non-existent check constraint rather than raise an error, + # use the +if_exists+ option. + # + # remove_check_constraint :products, name: "price_check", if_exists: true + # + # The +expression+ parameter will be ignored if present. It can be helpful + # to provide this in a migration's +change+ method so it can be reverted. + # In that case, +expression+ will be used by #add_check_constraint. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1357 + def remove_check_constraint(table_name, expression = T.unsafe(nil), if_exists: T.unsafe(nil), **options); end + + # Removes the column from the table definition. + # + # remove_column(:suppliers, :qualification) + # + # The +type+ and +options+ parameters will be ignored if present. It can be helpful + # to provide these in a migration's +change+ method so it can be reverted. + # In that case, +type+ and +options+ will be used by #add_column. + # Depending on the database you're using, indexes using this column may be + # automatically removed or modified to remove this column from the index. + # + # If the options provided include an +if_exists+ key, it will be used to check if the + # column does not exist. This will silently ignore the migration rather than raising + # if the column was already removed. + # + # remove_column(:suppliers, :qualification, if_exists: true) + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#718 + def remove_column(table_name, column_name, type = T.unsafe(nil), **options); end + + # Removes the given columns from the table definition. + # + # remove_columns(:suppliers, :qualification, :experience) + # + # +type+ and other column options can be passed to make migration reversible. + # + # remove_columns(:suppliers, :qualification, :experience, type: :string, null: false) + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#694 + def remove_columns(table_name, *column_names, type: T.unsafe(nil), **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1381 + def remove_constraint(table_name, constraint_name); end + + # Removes the given foreign key from the table. Any option parameters provided + # will be used to re-add the foreign key in case of a migration rollback. + # It is recommended that you provide any options used when creating the foreign + # key so that the migration can be reverted properly. + # + # Removes the foreign key on +accounts.branch_id+. + # + # remove_foreign_key :accounts, :branches + # + # Removes the foreign key on +accounts.owner_id+. + # + # remove_foreign_key :accounts, column: :owner_id + # + # Removes the foreign key on +accounts.owner_id+. + # + # remove_foreign_key :accounts, to_table: :owners + # + # Removes the foreign key named +special_fk_name+ on the +accounts+ table. + # + # remove_foreign_key :accounts, name: :special_fk_name + # + # Checks if the foreign key exists before trying to remove it. Will silently ignore indexes that + # don't exist. + # + # remove_foreign_key :accounts, :branches, if_exists: true + # + # The +options+ hash accepts the same keys as SchemaStatements#add_foreign_key + # with an addition of + # [:to_table] + # The name of the table that contains the referenced primary key. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1247 + def remove_foreign_key(from_table, to_table = T.unsafe(nil), **options); end + + # Removes the given index from the table. + # + # Removes the index on +branch_id+ in the +accounts+ table if exactly one such index exists. + # + # remove_index :accounts, :branch_id + # + # Removes the index on +branch_id+ in the +accounts+ table if exactly one such index exists. + # + # remove_index :accounts, column: :branch_id + # + # Removes the index on +branch_id+ and +party_id+ in the +accounts+ table if exactly one such index exists. + # + # remove_index :accounts, column: [:branch_id, :party_id] + # + # Removes the index named +by_branch_party+ in the +accounts+ table. + # + # remove_index :accounts, name: :by_branch_party + # + # Removes the index on +branch_id+ named +by_branch_party+ in the +accounts+ table. + # + # remove_index :accounts, :branch_id, name: :by_branch_party + # + # Checks if the index exists before trying to remove it. Will silently ignore indexes that + # don't exist. + # + # remove_index :accounts, if_exists: true + # + # Removes the index named +by_branch_party+ in the +accounts+ table +concurrently+. + # + # remove_index :accounts, name: :by_branch_party, algorithm: :concurrently + # + # Note: only supported by PostgreSQL. + # + # Concurrently removing an index is not supported in a transaction. + # + # For more information see the {"Transactional Migrations" section}[rdoc-ref:Migration]. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#998 + def remove_index(table_name, column_name = T.unsafe(nil), **options); end + + # Removes the reference(s). Also removes a +type+ column if one exists. + # + # ====== Remove the reference + # + # remove_reference(:products, :user, index: false) + # + # ====== Remove polymorphic reference + # + # remove_reference(:products, :supplier, polymorphic: true) + # + # ====== Remove the reference with a foreign key + # + # remove_reference(:products, :user, foreign_key: true) + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1114 + def remove_reference(table_name, ref_name, foreign_key: T.unsafe(nil), polymorphic: T.unsafe(nil), **options); end + + # Removes the timestamp columns (+created_at+ and +updated_at+) from the table definition. + # + # remove_timestamps(:suppliers) + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1501 + def remove_timestamps(table_name, **options); end + + # Renames a column. + # + # rename_column(:suppliers, :description, :name) + # + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#785 + def rename_column(table_name, column_name, new_column_name); end + + # Renames an index. + # + # Rename the +index_people_on_last_name+ index to +index_users_on_last_name+: + # + # rename_index :people, 'index_people_on_last_name', 'index_users_on_last_name' + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1012 + def rename_index(table_name, old_name, new_name); end + + # Renames a table. + # + # rename_table('octopuses', 'octopi') + # + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#543 + def rename_table(table_name, new_name, **_arg2); end + + # Returns an instance of SchemaCreation, which can be used to visit a schema definition + # object and return DDL. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1598 + def schema_creation; end + + # Truncates a table alias according to the limits of the current adapter. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#29 + def table_alias_for(table_name); end + + # Returns the table comment that's stored in database metadata. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#24 + def table_comment(table_name); end + + # Checks to see if the table +table_name+ exists on the database. + # + # table_exists?(:developers) + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#60 + def table_exists?(table_name); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#19 + def table_options(table_name); end + + # Returns an array of table names defined in the database. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#52 + def tables; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1418 + def type_to_sql(type, limit: T.unsafe(nil), precision: T.unsafe(nil), scale: T.unsafe(nil), **_arg4); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1505 + def update_table_definition(table_name, base); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1592 + def use_foreign_keys?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1631 + def valid_column_definition_options; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1635 + def valid_primary_key_options; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1627 + def valid_table_definition_options; end + + # Checks to see if the view +view_name+ exists on the database. + # + # view_exists?(:ebooks) + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#75 + def view_exists?(view_name); end + + # Returns an array of view names defined in the database. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#67 + def views; end + + private + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1911 + def add_column_for_alter(table_name, column_name, type, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1669 + def add_index_sort_order(quoted_columns, **options); end + + # Overridden by the MySQL adapter for supporting index lengths and by + # the PostgreSQL adapter for supporting operator classes. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1690 + def add_options_for_index_columns(quoted_columns, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1934 + def add_timestamps_for_alter(table_name, **options); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1903 + def can_remove_index_by_name?(column_name, options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1917 + def change_column_default_for_alter(table_name, column_name, default_or_changes); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1865 + def check_constraint_for(table_name, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1871 + def check_constraint_for!(table_name, expression: T.unsafe(nil), **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1855 + def check_constraint_name(table_name, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1665 + def column_options_keys; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1760 + def create_alter_table(name); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1756 + def create_index_definition(table_name, name, unique, columns, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1752 + def create_table_definition(name, **options); end + + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1956 + def data_source_sql(name = T.unsafe(nil), type: T.unsafe(nil)); end + + # Try to identify whether the given column name is an expression + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1800 + def expression_column_name?(column_name); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1843 + def extract_foreign_key_action(specifier); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1901 + def extract_new_comment_value(default_or_changes); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1894 + def extract_new_default_value(default_or_changes); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1772 + def fetch_type_metadata(sql_type); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1820 + def foreign_key_for(from_table, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1838 + def foreign_key_for!(from_table, to_table: T.unsafe(nil), **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1810 + def foreign_key_name(table_name, options); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1851 + def foreign_keys_enabled?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1645 + def generate_index_name(table_name, column); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1783 + def index_column_names(column_names); end + + # @raise [ArgumentError] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1698 + def index_name_for_remove(table_name, column_name, options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1791 + def index_name_options(column_names); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1951 + def insert_versions_sql(versions); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1680 + def options_for_index_columns(options); end + + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1960 + def quoted_scope(name = T.unsafe(nil), type: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1907 + def reference_name_for_table(table_name); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1926 + def remove_column_for_alter(table_name, column_name, type = T.unsafe(nil), **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1930 + def remove_columns_for_alter(table_name, *column_names, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1947 + def remove_timestamps_for_alter(table_name, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1739 + def rename_column_indexes(table_name, column_name, new_column_name); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1922 + def rename_column_sql(table_name, column_name, new_column_name); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1730 + def rename_table_indexes(table_name, new_name, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1804 + def strip_table_name_prefix_and_suffix(table_name); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1676 + def valid_index_options; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1659 + def validate_change_column_null_argument!(value); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1764 + def validate_create_table_options!(options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1876 + def validate_index_length!(table_name, new_name, internal = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_statements.rb#1885 + def validate_table_length!(table_name); end +end + +# source://activerecord//lib/active_record/connection_adapters/sql_type_metadata.rb#6 +class ActiveRecord::ConnectionAdapters::SqlTypeMetadata + include ::ActiveRecord::ConnectionAdapters::Deduplicable + extend ::ActiveRecord::ConnectionAdapters::Deduplicable::ClassMethods + + # @return [SqlTypeMetadata] a new instance of SqlTypeMetadata + # + # source://activerecord//lib/active_record/connection_adapters/sql_type_metadata.rb#11 + def initialize(sql_type: T.unsafe(nil), type: T.unsafe(nil), limit: T.unsafe(nil), precision: T.unsafe(nil), scale: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/sql_type_metadata.rb#19 + def ==(other); end + + # source://activerecord//lib/active_record/connection_adapters/sql_type_metadata.rb#27 + def eql?(other); end + + # source://activerecord//lib/active_record/connection_adapters/sql_type_metadata.rb#29 + def hash; end + + # Returns the value of attribute limit. + # + # source://activerecord//lib/active_record/connection_adapters/sql_type_metadata.rb#9 + def limit; end + + # Returns the value of attribute precision. + # + # source://activerecord//lib/active_record/connection_adapters/sql_type_metadata.rb#9 + def precision; end + + # Returns the value of attribute scale. + # + # source://activerecord//lib/active_record/connection_adapters/sql_type_metadata.rb#9 + def scale; end + + # Returns the value of attribute sql_type. + # + # source://activerecord//lib/active_record/connection_adapters/sql_type_metadata.rb#9 + def sql_type; end + + # Returns the value of attribute type. + # + # source://activerecord//lib/active_record/connection_adapters/sql_type_metadata.rb#9 + def type; end + + private + + # source://activerecord//lib/active_record/connection_adapters/sql_type_metadata.rb#39 + def deduplicated; end +end + +# = Active Record Connection Adapters \Table +# +# Represents an SQL table in an abstract way for updating a table. +# Also see TableDefinition and {connection.create_table}[rdoc-ref:SchemaStatements#create_table] +# +# Available transformations are: +# +# change_table :table do |t| +# t.primary_key +# t.column +# t.index +# t.rename_index +# t.timestamps +# t.change +# t.change_default +# t.change_null +# t.rename +# t.references +# t.belongs_to +# t.check_constraint +# t.string +# t.text +# t.integer +# t.bigint +# t.float +# t.decimal +# t.numeric +# t.datetime +# t.timestamp +# t.time +# t.date +# t.binary +# t.blob +# t.boolean +# t.foreign_key +# t.json +# t.virtual +# t.remove +# t.remove_foreign_key +# t.remove_references +# t.remove_belongs_to +# t.remove_index +# t.remove_check_constraint +# t.remove_timestamps +# end +# +# source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#707 +class ActiveRecord::ConnectionAdapters::Table + include ::ActiveRecord::ConnectionAdapters::ColumnMethods + extend ::ActiveRecord::ConnectionAdapters::ColumnMethods::ClassMethods + + # @return [Table] a new instance of Table + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#712 + def initialize(table_name, base); end + + # Adds a reference. + # + # t.references(:user) + # t.belongs_to(:supplier, foreign_key: true) + # + # See {connection.add_reference}[rdoc-ref:SchemaStatements#add_reference] for details of the options you can use. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#869 + def belongs_to(*args, **options); end + + # Changes the column's definition according to the new options. + # + # t.change(:name, :string, limit: 80) + # t.change(:description, :text) + # + # See TableDefinition#column for details of the options you can use. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#789 + def change(column_name, type, **options); end + + # Sets a new default value for a column. + # + # t.change_default(:qualification, 'new') + # t.change_default(:authorized, 1) + # t.change_default(:status, from: nil, to: "draft") + # + # See {connection.change_column_default}[rdoc-ref:SchemaStatements#change_column_default] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#801 + def change_default(column_name, default_or_changes); end + + # Sets or removes a NOT NULL constraint on a column. + # + # t.change_null(:qualification, true) + # t.change_null(:qualification, false, 0) + # + # See {connection.change_column_null}[rdoc-ref:SchemaStatements#change_column_null] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#811 + def change_null(column_name, null, default = T.unsafe(nil)); end + + # Adds a check constraint. + # + # t.check_constraint("price > 0", name: "price_check") + # + # See {connection.add_check_constraint}[rdoc-ref:SchemaStatements#add_check_constraint] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#921 + def check_constraint(*args, **options); end + + # Checks if a check_constraint exists on a table. + # + # unless t.check_constraint_exists?(name: "price_check") + # t.check_constraint("price > 0", name: "price_check") + # end + # + # See {connection.check_constraint_exists?}[rdoc-ref:SchemaStatements#check_constraint_exists?] + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#941 + def check_constraint_exists?(*args, **options); end + + # Adds a new column to the named table. + # + # t.column(:name, :string) + # + # See TableDefinition#column for details of the options you can use. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#722 + def column(column_name, type, index: T.unsafe(nil), **options); end + + # Checks to see if a column exists. + # + # t.string(:name) unless t.column_exists?(:name, :string) + # + # See {connection.column_exists?}[rdoc-ref:SchemaStatements#column_exists?] + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#736 + def column_exists?(column_name, type = T.unsafe(nil), **options); end + + # Adds a foreign key to the table using a supplied table name. + # + # t.foreign_key(:authors) + # t.foreign_key(:authors, column: :author_id, primary_key: "id") + # + # See {connection.add_foreign_key}[rdoc-ref:SchemaStatements#add_foreign_key] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#891 + def foreign_key(*args, **options); end + + # Checks to see if a foreign key exists. + # + # t.foreign_key(:authors) unless t.foreign_key_exists?(:authors) + # + # See {connection.foreign_key_exists?}[rdoc-ref:SchemaStatements#foreign_key_exists?] + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#912 + def foreign_key_exists?(*args, **options); end + + # Adds a new index to the table. +column_name+ can be a single Symbol, or + # an Array of Symbols. + # + # t.index(:name) + # t.index([:branch_id, :party_id], unique: true) + # t.index([:branch_id, :party_id], unique: true, name: 'by_branch_party') + # + # See {connection.add_index}[rdoc-ref:SchemaStatements#add_index] for details of the options you can use. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#748 + def index(column_name, **options); end + + # Checks to see if an index exists. + # + # unless t.index_exists?(:branch_id) + # t.index(:branch_id) + # end + # + # See {connection.index_exists?}[rdoc-ref:SchemaStatements#index_exists?] + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#760 + def index_exists?(column_name = T.unsafe(nil), **options); end + + # Returns the value of attribute name. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#710 + def name; end + + # Adds a reference. + # + # t.references(:user) + # t.belongs_to(:supplier, foreign_key: true) + # + # See {connection.add_reference}[rdoc-ref:SchemaStatements#add_reference] for details of the options you can use. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#863 + def references(*args, **options); end + + # Removes the column(s) from the table definition. + # + # t.remove(:qualification) + # t.remove(:qualification, :experience) + # + # See {connection.remove_columns}[rdoc-ref:SchemaStatements#remove_columns] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#821 + def remove(*column_names, **options); end + + # Removes a reference. Optionally removes a +type+ column. + # + # t.remove_references(:user) + # t.remove_belongs_to(:supplier, polymorphic: true) + # + # See {connection.remove_reference}[rdoc-ref:SchemaStatements#remove_reference] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#883 + def remove_belongs_to(*args, **options); end + + # Removes the given check constraint from the table. + # + # t.remove_check_constraint(name: "price_check") + # + # See {connection.remove_check_constraint}[rdoc-ref:SchemaStatements#remove_check_constraint] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#930 + def remove_check_constraint(*args, **options); end + + # Removes the given foreign key from the table. + # + # t.remove_foreign_key(:authors) + # t.remove_foreign_key(column: :author_id) + # + # See {connection.remove_foreign_key}[rdoc-ref:SchemaStatements#remove_foreign_key] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#902 + def remove_foreign_key(*args, **options); end + + # Removes the given index from the table. + # + # t.remove_index(:branch_id) + # t.remove_index(column: [:branch_id, :party_id]) + # t.remove_index(name: :by_branch_party) + # t.remove_index(:branch_id, name: :by_branch_party) + # + # See {connection.remove_index}[rdoc-ref:SchemaStatements#remove_index] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#834 + def remove_index(column_name = T.unsafe(nil), **options); end + + # Removes a reference. Optionally removes a +type+ column. + # + # t.remove_references(:user) + # t.remove_belongs_to(:supplier, polymorphic: true) + # + # See {connection.remove_reference}[rdoc-ref:SchemaStatements#remove_reference] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#877 + def remove_references(*args, **options); end + + # Removes the timestamp columns (+created_at+ and +updated_at+) from the table. + # + # t.remove_timestamps + # + # See {connection.remove_timestamps}[rdoc-ref:SchemaStatements#remove_timestamps] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#844 + def remove_timestamps(**options); end + + # Renames a column. + # + # t.rename(:description, :name) + # + # See {connection.rename_column}[rdoc-ref:SchemaStatements#rename_column] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#853 + def rename(column_name, new_column_name); end + + # Renames the given index on the table. + # + # t.rename_index(:user_id, :account_id) + # + # See {connection.rename_index}[rdoc-ref:SchemaStatements#rename_index] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#769 + def rename_index(index_name, new_index_name); end + + # Adds timestamps (+created_at+ and +updated_at+) columns to the table. + # + # t.timestamps(null: false) + # + # See {connection.add_timestamps}[rdoc-ref:SchemaStatements#add_timestamps] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#778 + def timestamps(**options); end + + private + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#946 + def raise_on_if_exist_options(options); end +end + +# = Active Record Connection Adapters \Table \Definition +# +# Represents the schema of an SQL table in an abstract way. This class +# provides methods for manipulating the schema representation. +# +# Inside migration files, the +t+ object in {create_table}[rdoc-ref:SchemaStatements#create_table] +# is actually of this type: +# +# class SomeMigration < ActiveRecord::Migration[8.1] +# def up +# create_table :foo do |t| +# puts t.class # => "ActiveRecord::ConnectionAdapters::TableDefinition" +# end +# end +# +# def down +# ... +# end +# end +# +# source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#358 +class ActiveRecord::ConnectionAdapters::TableDefinition + include ::ActiveRecord::ConnectionAdapters::ColumnMethods + extend ::ActiveRecord::ConnectionAdapters::ColumnMethods::ClassMethods + + # @return [TableDefinition] a new instance of TableDefinition + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#363 + def initialize(conn, name, temporary: T.unsafe(nil), if_not_exists: T.unsafe(nil), options: T.unsafe(nil), as: T.unsafe(nil), comment: T.unsafe(nil), **_arg7); end + + # Returns a ColumnDefinition for the column with name +name+. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#413 + def [](name); end + + # Returns the value of attribute as. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#361 + def as; end + + # Adds a reference. + # + # t.references(:user) + # t.belongs_to(:supplier, foreign_key: true) + # t.belongs_to(:supplier, foreign_key: true, type: :integer) + # + # See {connection.add_reference}[rdoc-ref:SchemaStatements#add_reference] for details of the options you can use. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#548 + def belongs_to(*args, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#517 + def check_constraint(expression, **options); end + + # Returns the value of attribute check_constraints. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#361 + def check_constraints; end + + # Instantiates a new column for the table. + # See {connection.add_column}[rdoc-ref:ConnectionAdapters::SchemaStatements#add_column] + # for available options. + # + # Additional options are: + # * :index - + # Create an index for the column. Can be either true or an options hash. + # + # This method returns self. + # + # == Examples + # + # # Assuming `td` is an instance of TableDefinition + # td.column(:granted, :boolean, index: true) + # + # == Short-hand examples + # + # Instead of calling #column directly, you can also work with the short-hand definitions for the default types. + # They use the type as the method name instead of as a parameter and allow for multiple columns to be defined + # in a single statement. + # + # What can be written like this with the regular calls to column: + # + # create_table :products do |t| + # t.column :shop_id, :integer + # t.column :creator_id, :integer + # t.column :item_number, :string + # t.column :name, :string, default: "Untitled" + # t.column :value, :string, default: "Untitled" + # t.column :created_at, :datetime + # t.column :updated_at, :datetime + # end + # add_index :products, :item_number + # + # can also be written as follows using the short-hand: + # + # create_table :products do |t| + # t.integer :shop_id, :creator_id + # t.string :item_number, index: true + # t.string :name, :value, default: "Untitled" + # t.timestamps null: false + # end + # + # There's a short-hand method for each of the type values declared at the top. And then there's + # TableDefinition#timestamps that'll add +created_at+ and +updated_at+ as datetimes. + # + # TableDefinition#references will add an appropriately-named _id column, plus a corresponding _type + # column if the :polymorphic option is supplied. If :polymorphic is a hash of + # options, these will be used when creating the _type column. The :index option + # will also create an index, similar to calling {add_index}[rdoc-ref:ConnectionAdapters::SchemaStatements#add_index]. + # So what can be written like this: + # + # create_table :taggings do |t| + # t.integer :tag_id, :tagger_id, :taggable_id + # t.string :tagger_type + # t.string :taggable_type, default: 'Photo' + # end + # add_index :taggings, :tag_id, name: 'index_taggings_on_tag_id' + # add_index :taggings, [:tagger_id, :tagger_type] + # + # Can also be written as follows using references: + # + # create_table :taggings do |t| + # t.references :tag, index: { name: 'index_taggings_on_tag_id' } + # t.references :tagger, polymorphic: true + # t.references :taggable, polymorphic: { default: 'Photo' }, index: false + # end + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#484 + def column(name, type, index: T.unsafe(nil), **options); end + + # Returns an array of ColumnDefinition objects for the columns of the table. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#410 + def columns; end + + # Returns the value of attribute comment. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#361 + def comment; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#513 + def foreign_key(to_table, **options); end + + # Returns the value of attribute foreign_keys. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#361 + def foreign_keys; end + + # Returns the value of attribute if_not_exists. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#361 + def if_not_exists; end + + # Adds index options to the indexes hash, keyed by column name + # This is primarily used to track indexes that need to be created after the table + # + # index(:account_id, name: 'index_projects_on_account_id') + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#509 + def index(column_name, **options); end + + # Returns the value of attribute indexes. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#361 + def indexes; end + + # Returns the value of attribute name. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#361 + def name; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#575 + def new_check_constraint_definition(expression, options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#550 + def new_column_definition(name, type, **options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#567 + def new_foreign_key_definition(to_table, options); end + + # Returns the value of attribute options. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#361 + def options; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#404 + def primary_keys(name = T.unsafe(nil)); end + + # Adds a reference. + # + # t.references(:user) + # t.belongs_to(:supplier, foreign_key: true) + # t.belongs_to(:supplier, foreign_key: true, type: :integer) + # + # See {connection.add_reference}[rdoc-ref:SchemaStatements#add_reference] for details of the options you can use. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#543 + def references(*args, **options); end + + # remove the column +name+ from the table. + # remove_column(:account_id) + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#501 + def remove_column(name); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#387 + def set_primary_key(table_name, id, primary_key, **options); end + + # Returns the value of attribute temporary. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#361 + def temporary; end + + # Appends :datetime columns :created_at and + # :updated_at to the table. See {connection.add_timestamps}[rdoc-ref:SchemaStatements#add_timestamps] + # + # t.timestamps null: false + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#525 + def timestamps(**options); end + + private + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#593 + def aliased_types(name, fallback); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#585 + def create_column_definition(name, type, options); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#597 + def integer_like_primary_key?(type, options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#601 + def integer_like_primary_key_type(type, options); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#605 + def raise_on_duplicate_column(name); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/schema_definitions.rb#581 + def valid_column_definition_options; end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#130 +class ActiveRecord::ConnectionAdapters::Transaction + # @return [Transaction] a new instance of Transaction + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#164 + def initialize(connection, isolation: T.unsafe(nil), joinable: T.unsafe(nil), run_commit_callbacks: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#196 + def add_record(record, ensure_finalize = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#214 + def after_commit(&block); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#222 + def after_rollback(&block); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#206 + def before_commit(&block); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#285 + def before_commit_records; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#192 + def closed?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#309 + def commit_records; end + + # Returns the value of attribute connection. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#150 + def connection; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#180 + def dirty!; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#184 + def dirty?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#338 + def full_rollback?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#244 + def incomplete!; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#153 + def invalidate!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#153 + def invalidated?(*_arg0, **_arg1, &_arg2); end + + # Returns the isolation level if it was explicitly set, nil otherwise + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#156 + def isolation; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#160 + def isolation=(isolation); end + + # Returns the value of attribute isolation_level. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#150 + def isolation_level; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#339 + def joinable?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#248 + def materialize!; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#253 + def materialized?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#188 + def open?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#230 + def records; end + + # Can this transaction's current state be recreated by + # rollback+begin ? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#240 + def restartable?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#257 + def restore!; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#265 + def rollback_records; end + + # Returns the value of attribute savepoint_name. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#150 + def savepoint_name; end + + # Returns the value of attribute state. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#150 + def state; end + + # Returns the value of attribute user_transaction. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#150 + def user_transaction; end + + # Returns the value of attribute written. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#151 + def written; end + + # Sets the attribute written + # + # @param value the value to set the attribute written to. + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#151 + def written=(_arg0); end + + protected + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#342 + def append_callbacks(callbacks); end + + private + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#359 + def prepare_instances_to_run_callbacks_on(records); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#351 + def run_action_on_records(records, instances_to_run_callbacks_on); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#347 + def unique_records; end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#131 +class ActiveRecord::ConnectionAdapters::Transaction::Callback + # @return [Callback] a new instance of Callback + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#132 + def initialize(event, callback); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#141 + def after_commit; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#145 + def after_rollback; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#137 + def before_commit; end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#79 +class ActiveRecord::ConnectionAdapters::TransactionInstrumenter + # @return [TransactionInstrumenter] a new instance of TransactionInstrumenter + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#80 + def initialize(payload = T.unsafe(nil)); end + + # @raise [InstrumentationNotStartedError] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#101 + def finish(outcome); end + + # @raise [InstrumentationAlreadyStartedError] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#90 + def start; end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#88 +class ActiveRecord::ConnectionAdapters::TransactionInstrumenter::InstrumentationAlreadyStartedError < ::ActiveRecord::ActiveRecordError; end + +# source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#87 +class ActiveRecord::ConnectionAdapters::TransactionInstrumenter::InstrumentationNotStartedError < ::ActiveRecord::ActiveRecordError; end + +# source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#518 +class ActiveRecord::ConnectionAdapters::TransactionManager + # @return [TransactionManager] a new instance of TransactionManager + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#519 + def initialize(connection); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#527 + def begin_transaction(isolation: T.unsafe(nil), joinable: T.unsafe(nil), _lazy: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#614 + def commit_transaction; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#683 + def current_transaction; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#582 + def dirty_current_transaction; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#569 + def disable_lazy_transactions!; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#574 + def enable_lazy_transactions!; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#578 + def lazy_transactions_enabled?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#598 + def materialize_transactions; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#679 + def open_transactions; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#594 + def restorable?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#586 + def restore_transactions; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#631 + def rollback_transaction(transaction = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#643 + def within_new_transaction(isolation: T.unsafe(nil), joinable: T.unsafe(nil)); end + + private + + # Deallocate invalidated prepared statements outside of the transaction + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#691 + def after_failure_actions(transaction, error); end +end + +# source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#688 +ActiveRecord::ConnectionAdapters::TransactionManager::NULL_TRANSACTION = T.let(T.unsafe(nil), ActiveRecord::ConnectionAdapters::NullTransaction) + +# = Active Record Connection Adapters Transaction State +# +# source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#8 +class ActiveRecord::ConnectionAdapters::TransactionState + # @return [TransactionState] a new instance of TransactionState + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#9 + def initialize(state = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#14 + def add_child(state); end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#66 + def commit!; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#23 + def committed?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#47 + def completed?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#19 + def finalized?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#70 + def full_commit!; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#56 + def full_rollback!; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#27 + def fully_committed?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#43 + def fully_completed?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#35 + def fully_rolledback?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#61 + def invalidate!; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#39 + def invalidated?; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#74 + def nullify!; end + + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#51 + def rollback!; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_adapters/abstract/transaction.rb#31 + def rolledback?; end +end + +# ConnectionFailed will be raised when the network connection to the +# database fails while sending a query or waiting for its result. +# +# source://activerecord//lib/active_record/errors.rb#595 +class ActiveRecord::ConnectionFailed < ::ActiveRecord::QueryAborted; end + +# = Active Record Connection Handling +# +# source://activerecord//lib/active_record/connection_handling.rb#5 +module ActiveRecord::ConnectionHandling + # source://activerecord//lib/active_record/connection_handling.rb#341 + def adapter_class; end + + # source://activerecord//lib/active_record/connection_handling.rb#375 + def clear_cache!; end + + # Clears the query cache for all connections associated with the current thread. + # + # source://activerecord//lib/active_record/connection_handling.rb#261 + def clear_query_caches_for_current_thread; end + + # Returns +true+ if Active Record is connected. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_handling.rb#354 + def connected?; end + + # Connects to a role (e.g. writing, reading, or a custom role) and/or + # shard for the duration of the block. At the end of the block the + # connection will be returned to the original role / shard. + # + # If only a role is passed, Active Record will look up the connection + # based on the requested role. If a non-established role is requested + # an +ActiveRecord::ConnectionNotEstablished+ error will be raised: + # + # ActiveRecord::Base.connected_to(role: :writing) do + # Dog.create! # creates dog using dog writing connection + # end + # + # ActiveRecord::Base.connected_to(role: :reading) do + # Dog.create! # throws exception because we're on a replica + # end + # + # When swapping to a shard, the role must be passed as well. If a non-existent + # shard is passed, an +ActiveRecord::ConnectionNotEstablished+ error will be + # raised. + # + # When a shard and role is passed, Active Record will first lookup the role, + # and then look up the connection by shard key. + # + # ActiveRecord::Base.connected_to(role: :reading, shard: :shard_one_replica) do + # Dog.first # finds first Dog record stored on the shard one replica + # end + # + # source://activerecord//lib/active_record/connection_handling.rb#137 + def connected_to(role: T.unsafe(nil), shard: T.unsafe(nil), prevent_writes: T.unsafe(nil), &blk); end + + # Returns true if role is the current connected role and/or + # current connected shard. If no shard is passed, the default will be + # used. + # + # ActiveRecord::Base.connected_to(role: :writing) do + # ActiveRecord::Base.connected_to?(role: :writing) #=> true + # ActiveRecord::Base.connected_to?(role: :reading) #=> false + # end + # + # ActiveRecord::Base.connected_to(role: :reading, shard: :shard_one) do + # ActiveRecord::Base.connected_to?(role: :reading, shard: :shard_one) #=> true + # ActiveRecord::Base.connected_to?(role: :reading, shard: :default) #=> false + # ActiveRecord::Base.connected_to?(role: :writing, shard: :shard_one) #=> true + # end + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_handling.rb#256 + def connected_to?(role:, shard: T.unsafe(nil)); end + + # Passes the block to +connected_to+ for every +shard+ the + # model is configured to connect to (if any), and returns the + # results in an array. + # + # Optionally, +role+ and/or +prevent_writes+ can be passed which + # will be forwarded to each +connected_to+ call. + # + # source://activerecord//lib/active_record/connection_handling.rb#189 + def connected_to_all_shards(role: T.unsafe(nil), prevent_writes: T.unsafe(nil), &blk); end + + # Connects a role and/or shard to the provided connection names. Optionally +prevent_writes+ + # can be passed to block writes on a connection. +reading+ will automatically set + # +prevent_writes+ to true. + # + # +connected_to_many+ is an alternative to deeply nested +connected_to+ blocks. + # + # Usage: + # + # ActiveRecord::Base.connected_to_many(AnimalsRecord, MealsRecord, role: :reading) do + # Dog.first # Read from animals replica + # Dinner.first # Read from meals replica + # Person.first # Read from primary writer + # end + # + # source://activerecord//lib/active_record/connection_handling.rb#166 + def connected_to_many(*classes, role:, shard: T.unsafe(nil), prevent_writes: T.unsafe(nil)); end + + # Use a specified connection. + # + # This method is useful for ensuring that a specific connection is + # being used. For example, when booting a console in readonly mode. + # + # It is not recommended to use this method in a request since it + # does not yield to a block like +connected_to+. + # + # source://activerecord//lib/active_record/connection_handling.rb#202 + def connecting_to(role: T.unsafe(nil), shard: T.unsafe(nil), prevent_writes: T.unsafe(nil)); end + + # Soft deprecated. Use +#with_connection+ or +#lease_connection+ instead. + # + # source://activerecord//lib/active_record/connection_handling.rb#277 + def connection; end + + # Returns the db_config object from the associated connection: + # + # ActiveRecord::Base.connection_db_config + # # + # + # Use only for reading. + # + # source://activerecord//lib/active_record/connection_handling.rb#337 + def connection_db_config; end + + # source://activerecord//lib/active_record/connection_handling.rb#345 + def connection_pool; end + + # Returns the connection specification name from the current class or its parent. + # + # source://activerecord//lib/active_record/connection_handling.rb#319 + def connection_specification_name; end + + # Sets the attribute connection_specification_name + # + # @param value the value to set the attribute connection_specification_name to. + # + # source://activerecord//lib/active_record/connection_handling.rb#316 + def connection_specification_name=(_arg0); end + + # Connects a model to the databases specified. The +database+ keyword + # takes a hash consisting of a +role+ and a +database_key+. + # + # This will look up the database config using the +database_key+ and + # establish a connection to that config. + # + # class AnimalsModel < ApplicationRecord + # self.abstract_class = true + # + # connects_to database: { writing: :primary, reading: :primary_replica } + # end + # + # +connects_to+ also supports horizontal sharding. The horizontal sharding API + # supports read replicas as well. You can connect a model to a list of shards like this: + # + # class AnimalsModel < ApplicationRecord + # self.abstract_class = true + # + # connects_to shards: { + # default: { writing: :primary, reading: :primary_replica }, + # shard_two: { writing: :primary_shard_two, reading: :primary_shard_replica_two } + # } + # end + # + # Returns an array of database connections. + # + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/connection_handling.rb#81 + def connects_to(database: T.unsafe(nil), shards: T.unsafe(nil)); end + + # Establishes the connection to the database. Accepts a hash as input where + # the :adapter key must be specified with the name of a database adapter (in lower-case) + # example for regular databases (MySQL, PostgreSQL, etc): + # + # ActiveRecord::Base.establish_connection( + # adapter: "mysql2", + # host: "localhost", + # username: "myuser", + # password: "mypass", + # database: "somedatabase" + # ) + # + # Example for SQLite database: + # + # ActiveRecord::Base.establish_connection( + # adapter: "sqlite3", + # database: "path/to/dbfile" + # ) + # + # Also accepts keys as strings (for parsing from YAML for example): + # + # ActiveRecord::Base.establish_connection( + # "adapter" => "sqlite3", + # "database" => "path/to/dbfile" + # ) + # + # Or a URL: + # + # ActiveRecord::Base.establish_connection( + # "postgres://myuser:mypass@localhost/somedatabase" + # ) + # + # In case {ActiveRecord::Base.configurations}[rdoc-ref:Core.configurations] + # is set (\Rails automatically loads the contents of config/database.yml into it), + # a symbol can also be given as argument, representing a key in the + # configuration hash: + # + # ActiveRecord::Base.establish_connection(:production) + # + # The exceptions AdapterNotSpecified, AdapterNotFound, and +ArgumentError+ + # may be returned on an error. + # + # source://activerecord//lib/active_record/connection_handling.rb#50 + def establish_connection(config_or_env = T.unsafe(nil)); end + + # Returns the connection currently associated with the class. This can + # also be used to "borrow" the connection to do database work unrelated + # to any of the specific Active Records. + # The connection will remain leased for the entire duration of the request + # or job, or until +#release_connection+ is called. + # + # source://activerecord//lib/active_record/connection_handling.rb#272 + def lease_connection; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_handling.rb#326 + def primary_class?; end + + # Prohibit swapping shards while inside of the passed block. + # + # In some cases you may want to be able to swap shards but not allow a + # nested call to connected_to or connected_to_many to swap again. This + # is useful in cases you're using sharding to provide per-request + # database isolation. + # + # source://activerecord//lib/active_record/connection_handling.rb#214 + def prohibit_shard_swapping(enabled = T.unsafe(nil)); end + + # Return the currently leased connection into the pool + # + # source://activerecord//lib/active_record/connection_handling.rb#301 + def release_connection; end + + # source://activerecord//lib/active_record/connection_handling.rb#358 + def remove_connection; end + + # source://activerecord//lib/active_record/connection_handling.rb#349 + def retrieve_connection; end + + # source://activerecord//lib/active_record/connection_handling.rb#371 + def schema_cache; end + + # source://activerecord//lib/active_record/connection_handling.rb#379 + def shard_keys; end + + # Determine whether or not shard swapping is currently prohibited + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_handling.rb#223 + def shard_swapping_prohibited?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/connection_handling.rb#383 + def sharded?; end + + # Prevent writing to the database regardless of role. + # + # In some cases you may want to prevent writes to the database + # even if you are on a database that can write. +while_preventing_writes+ + # will prevent writes to the database for the duration of the block. + # + # This method does not provide the same protection as a readonly + # user and is meant to be a safeguard against accidental writes. + # + # See +READ_QUERY+ for the queries that are blocked by this + # method. + # + # source://activerecord//lib/active_record/connection_handling.rb#238 + def while_preventing_writes(enabled = T.unsafe(nil), &block); end + + # Checkouts a connection from the pool, yield it and then check it back in. + # If a connection was already leased via #lease_connection or a parent call to + # #with_connection, that same connection is yielded. + # If #lease_connection is called inside the block, the connection won't be checked + # back in. + # If #connection is called inside the block, the connection won't be checked back in + # unless the +prevent_permanent_checkout+ argument is set to +true+. + # + # source://activerecord//lib/active_record/connection_handling.rb#312 + def with_connection(prevent_permanent_checkout: T.unsafe(nil), &block); end + + private + + # source://activerecord//lib/active_record/connection_handling.rb#410 + def append_to_connected_to_stack(entry); end + + # source://activerecord//lib/active_record/connection_handling.rb#388 + def resolve_config_for_connection(config_or_env); end + + # source://activerecord//lib/active_record/connection_handling.rb#397 + def with_role_and_shard(role, shard, prevent_writes); end +end + +# source://activerecord//lib/active_record/connection_handling.rb#7 +ActiveRecord::ConnectionHandling::DEFAULT_ENV = T.let(T.unsafe(nil), Proc) + +# source://activerecord//lib/active_record/connection_handling.rb#6 +ActiveRecord::ConnectionHandling::RAILS_ENV = T.let(T.unsafe(nil), Proc) + +# Raised when a database connection pool is requested but +# has not been defined. +# +# source://activerecord//lib/active_record/errors.rb#88 +class ActiveRecord::ConnectionNotDefined < ::ActiveRecord::ConnectionNotEstablished + # @return [ConnectionNotDefined] a new instance of ConnectionNotDefined + # + # source://activerecord//lib/active_record/errors.rb#89 + def initialize(message = T.unsafe(nil), connection_name: T.unsafe(nil), role: T.unsafe(nil), shard: T.unsafe(nil)); end + + # Returns the value of attribute connection_name. + # + # source://activerecord//lib/active_record/errors.rb#96 + def connection_name; end + + # Returns the value of attribute role. + # + # source://activerecord//lib/active_record/errors.rb#96 + def role; end + + # Returns the value of attribute shard. + # + # source://activerecord//lib/active_record/errors.rb#96 + def shard; end +end + +# Raised when connection to the database could not been established (for example when +# {ActiveRecord::Base.lease_connection=}[rdoc-ref:ConnectionHandling#lease_connection] +# is given a +nil+ object). +# +# source://activerecord//lib/active_record/errors.rb#66 +class ActiveRecord::ConnectionNotEstablished < ::ActiveRecord::AdapterError + # @return [ConnectionNotEstablished] a new instance of ConnectionNotEstablished + # + # source://activerecord//lib/active_record/errors.rb#67 + def initialize(message = T.unsafe(nil), connection_pool: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/errors.rb#71 + def set_pool(connection_pool); end +end + +# Raised when a connection could not be obtained within the connection +# acquisition timeout period: because max connections in pool +# are in use. +# +# source://activerecord//lib/active_record/errors.rb#83 +class ActiveRecord::ConnectionTimeoutError < ::ActiveRecord::ConnectionNotEstablished; end + +# = Active Record \Core +# +# source://activerecord//lib/active_record/core.rb#9 +module ActiveRecord::Core + include ::ActiveModel::Access + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveRecord::Core::ClassMethods + + # New objects can be instantiated as either empty (pass no construction parameter) or pre-set with + # attributes but not yet saved (pass a hash with key names matching the associated table column names). + # In both instances, valid attribute keys are determined by the column names of the associated table -- + # hence you can't have attributes that aren't part of the table columns. + # + # ==== Example + # # Instantiates a single new object + # User.new(first_name: 'Jamie') + # + # @yield [_self] + # @yieldparam _self [ActiveRecord::Core] the object that the method was called on + # + # source://activerecord//lib/active_record/core.rb#472 + def initialize(attributes = T.unsafe(nil)); end + + # Allows sort on objects + # + # source://activerecord//lib/active_record/core.rb#666 + def <=>(other_object); end + + # Returns true if +comparison_object+ is the same exact object, or +comparison_object+ + # is of the same type and +self+ has an ID and it is equal to +comparison_object.id+. + # + # Note that new records are different from any other record by definition, unless the + # other record is the receiver itself. Besides, if you fetch existing records with + # +select+ and leave the ID out, you're on your own, this predicate will return false. + # + # Note also that destroying a record preserves its ID in the model instance, so deleted + # models are still comparable. + # + # source://activerecord//lib/active_record/core.rb#632 + def ==(comparison_object); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/core.rb#678 + def blank?; end + + # source://activerecord//lib/active_record/core.rb#771 + def connection_handler; end + + # Populate +coder+ with attributes about this record that should be + # serialized. The structure of +coder+ defined in this method is + # guaranteed to match the structure of +coder+ passed to the #init_with + # method. + # + # Example: + # + # class Post < ActiveRecord::Base + # end + # coder = {} + # Post.new.encode_with(coder) + # coder # => {"attributes" => {"id" => nil, ... }} + # + # source://activerecord//lib/active_record/core.rb#588 + def encode_with(coder); end + + # Returns true if +comparison_object+ is the same exact object, or +comparison_object+ + # is of the same type and +self+ has an ID and it is equal to +comparison_object.id+. + # + # Note that new records are different from any other record by definition, unless the + # other record is the receiver itself. Besides, if you fetch existing records with + # +select+ and leave the ID out, you're on your own, this predicate will return false. + # + # Note also that destroying a record preserves its ID in the model instance, so deleted + # models are still comparable. + # + # source://activerecord//lib/active_record/core.rb#638 + def eql?(comparison_object); end + + # Clone and freeze the attributes hash such that associations are still + # accessible, even on destroyed records, but cloned models will not be + # frozen. + # + # source://activerecord//lib/active_record/core.rb#655 + def freeze; end + + # Returns +true+ if the attributes hash has been frozen. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/core.rb#661 + def frozen?; end + + # Returns all attributes of the record as a nicely formatted string, + # ignoring .attributes_for_inspect. + # + # Post.first.full_inspect + # #=> "#" + # + # source://activerecord//lib/active_record/core.rb#795 + def full_inspect; end + + # Delegates to id in order to allow two records of the same type and id to work with something like: + # [ Person.find(1), Person.find(2), Person.find(3) ] & [ Person.find(1), Person.find(4) ] # => [ Person.find(1) ] + # + # source://activerecord//lib/active_record/core.rb#642 + def hash; end + + # source://activerecord//lib/active_record/core.rb#564 + def init_attributes(_); end + + # Initialize an empty model object from +coder+. +coder+ should be + # the result of previously encoding an Active Record model, using + # #encode_with. + # + # class Post < ActiveRecord::Base + # end + # + # old_post = Post.new(title: "hello world") + # coder = {} + # old_post.encode_with(coder) + # + # post = Post.allocate + # post.init_with(coder) + # post.title # => 'hello world' + # + # source://activerecord//lib/active_record/core.rb#499 + def init_with(coder, &block); end + + # Initialize an empty model object from +attributes+. + # +attributes+ should be an attributes object, and unlike the + # `initialize` method, no assignment calls are made per attribute. + # + # @yield [_self] + # @yieldparam _self [ActiveRecord::Core] the object that the method was called on + # + # source://activerecord//lib/active_record/core.rb#509 + def init_with_attributes(attributes, new_record = T.unsafe(nil)); end + + # Returns the attributes of the record as a nicely formatted string. + # + # Post.first.inspect + # #=> "#" + # + # The attributes can be limited by setting .attributes_for_inspect. + # + # Post.attributes_for_inspect = [:id, :title] + # Post.first.inspect + # #=> "#" + # + # source://activerecord//lib/active_record/core.rb#785 + def inspect; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/core.rb#674 + def present?; end + + # Takes a PP and prettily prints this record to it, allowing you to get a nice result from pp record + # when pp is required. + # + # source://activerecord//lib/active_record/core.rb#801 + def pretty_print(pp); end + + # Prevents records from being written to the database: + # + # customer = Customer.new + # customer.readonly! + # customer.save # raises ActiveRecord::ReadOnlyRecord + # + # customer = Customer.first + # customer.readonly! + # customer.update(name: 'New Name') # raises ActiveRecord::ReadOnlyRecord + # + # Read-only records cannot be deleted from the database either: + # + # customer = Customer.first + # customer.readonly! + # customer.destroy # raises ActiveRecord::ReadOnlyRecord + # + # Please, note that the objects themselves are still mutable in memory: + # + # customer = Customer.new + # customer.readonly! + # customer.name = 'New Name' # OK + # + # but you won't be able to persist the changes. + # + # source://activerecord//lib/active_record/core.rb#767 + def readonly!; end + + # Returns +true+ if the record is read only. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/core.rb#683 + def readonly?; end + + # Sets the record to strict_loading mode. This will raise an error + # if the record tries to lazily load an association. + # + # NOTE: Strict loading is disabled during validation in order to let the record validate its association. + # + # user = User.first + # user.strict_loading! # => true + # user.address.city + # # => ActiveRecord::StrictLoadingViolationError + # user.comments.to_a + # # => ActiveRecord::StrictLoadingViolationError + # + # ==== Parameters + # + # * +value+ - Boolean specifying whether to enable or disable strict loading. + # * :mode - Symbol specifying strict loading mode. Defaults to :all. Using + # :n_plus_one_only mode will only raise an error if an association that + # will lead to an n plus one query is lazily loaded. + # + # ==== Examples + # + # user = User.first + # user.strict_loading!(false) # => false + # user.address.city # => "Tatooine" + # user.comments.to_a # => [# "Tatooine" + # user.comments.to_a # => [# ActiveRecord::StrictLoadingViolationError + # + # source://activerecord//lib/active_record/core.rb#723 + def strict_loading!(value = T.unsafe(nil), mode: T.unsafe(nil)); end + + # Returns +true+ if the record is in strict_loading mode. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/core.rb#688 + def strict_loading?; end + + # Returns +true+ if the record uses strict_loading with +:all+ mode enabled. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/core.rb#740 + def strict_loading_all?; end + + # Returns the value of attribute strict_loading_mode. + # + # source://activerecord//lib/active_record/core.rb#732 + def strict_loading_mode; end + + # Returns +true+ if the record uses strict_loading with +:n_plus_one_only+ mode enabled. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/core.rb#735 + def strict_loading_n_plus_one_only?; end + + private + + # source://activerecord//lib/active_record/core.rb#891 + def all_attributes_for_inspect; end + + # source://activerecord//lib/active_record/core.rb#887 + def attributes_for_inspect; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/core.rb#857 + def custom_inspect_method_defined?; end + + # source://activerecord//lib/active_record/core.rb#837 + def init_internals; end + + # source://activerecord//lib/active_record/core.rb#551 + def initialize_dup(other); end + + # source://activerecord//lib/active_record/core.rb#854 + def initialize_internals_callback; end + + # source://activerecord//lib/active_record/core.rb#872 + def inspect_with_attributes(attributes_to_list); end + + # source://activerecord//lib/active_record/core.rb#868 + def inspection_filter; end + + # +Array#flatten+ will call +#to_ary+ (recursively) on each of the elements of + # the array, and then rescues from the possible +NoMethodError+. If those elements are + # +ActiveRecord::Base+'s, then this triggers the various +method_missing+'s that we have, + # which significantly impacts upon performance. + # + # So we can avoid the +method_missing+ hit by explicitly defining +#to_ary+ as +nil+ here. + # + # See also https://tenderlovemaking.com/2011/06/28/til-its-ok-to-return-nil-from-to_ary.html + # + # source://activerecord//lib/active_record/core.rb#833 + def to_ary; end + + module GeneratedClassMethods + def _destroy_association_async_job; end + def _destroy_association_async_job=(value); end + def _destroy_association_async_job?; end + def attributes_for_inspect; end + def attributes_for_inspect=(value); end + def attributes_for_inspect?; end + def belongs_to_required_by_default; end + def belongs_to_required_by_default=(value); end + def belongs_to_required_by_default?; end + def default_connection_handler; end + def default_connection_handler=(value); end + def default_connection_handler?; end + def default_role; end + def default_role=(value); end + def default_role?; end + def default_shard; end + def default_shard=(value); end + def default_shard?; end + def destroy_association_async_batch_size; end + def destroy_association_async_batch_size=(value); end + def enumerate_columns_in_select_statements; end + def enumerate_columns_in_select_statements=(value); end + def enumerate_columns_in_select_statements?; end + def has_many_inversing; end + def has_many_inversing=(value); end + def has_many_inversing?; end + def logger; end + def logger=(value); end + def logger?; end + def run_commit_callbacks_on_first_saved_instances_in_transaction; end + def run_commit_callbacks_on_first_saved_instances_in_transaction=(value); end + def run_commit_callbacks_on_first_saved_instances_in_transaction?; end + def shard_selector; end + def shard_selector=(value); end + def shard_selector?; end + def strict_loading_by_default; end + def strict_loading_by_default=(value); end + def strict_loading_by_default?; end + def strict_loading_mode; end + def strict_loading_mode=(value); end + def strict_loading_mode?; end + end + + module GeneratedInstanceMethods + def default_connection_handler; end + def default_connection_handler?; end + def default_role; end + def default_role?; end + def default_shard; end + def default_shard?; end + def destroy_association_async_batch_size; end + def logger; end + def logger?; end + end +end + +# source://activerecord//lib/active_record/core.rb#264 +module ActiveRecord::Core::ClassMethods + # Returns an instance of +Arel::Table+ loaded with the current table name. + # + # source://activerecord//lib/active_record/core.rb#392 + def arel_table; end + + # source://activerecord//lib/active_record/core.rb#404 + def cached_find_by_statement(connection, key, &block); end + + # Returns columns which shouldn't be exposed while calling +#inspect+. + # + # source://activerecord//lib/active_record/core.rb#348 + def filter_attributes; end + + # Specifies columns which shouldn't be exposed while calling +#inspect+. + # + # source://activerecord//lib/active_record/core.rb#357 + def filter_attributes=(filter_attributes); end + + # source://activerecord//lib/active_record/core.rb#269 + def find(*ids); end + + # source://activerecord//lib/active_record/core.rb#282 + def find_by(*args); end + + # source://activerecord//lib/active_record/core.rb#329 + def find_by!(*args); end + + # source://activerecord//lib/active_record/core.rb#337 + def generated_association_methods; end + + # source://activerecord//lib/active_record/core.rb#265 + def initialize_find_by_cache; end + + # source://activerecord//lib/active_record/core.rb#333 + def initialize_generated_modules; end + + # Returns a string like 'Post(id:integer, title:string, body:text)' + # + # source://activerecord//lib/active_record/core.rb#376 + def inspect; end + + # source://activerecord//lib/active_record/core.rb#364 + def inspection_filter; end + + # source://activerecord//lib/active_record/core.rb#396 + def predicate_builder; end + + # source://activerecord//lib/active_record/core.rb#400 + def type_caster; end + + private + + # source://activerecord//lib/active_record/core.rb#442 + def cached_find_by(keys, values); end + + # source://activerecord//lib/active_record/core.rb#410 + def inherited(subclass); end + + # source://activerecord//lib/active_record/core.rb#432 + def relation; end +end + +# source://activerecord//lib/active_record/core.rb#861 +class ActiveRecord::Core::InspectionMask + # source://activerecord//lib/active_record/core.rb#862 + def pretty_print(pp); end +end + +# = Active Record Counter Cache +# +# source://activerecord//lib/active_record/counter_cache.rb#5 +module ActiveRecord::CounterCache + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveRecord::CounterCache::ClassMethods + + private + + # source://activerecord//lib/active_record/counter_cache.rb#225 + def _create_record(attribute_names = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/counter_cache.rb#251 + def _foreign_keys_equal?(fkey1, fkey2); end + + # source://activerecord//lib/active_record/counter_cache.rb#235 + def destroy_row; end + + module GeneratedClassMethods + def _counter_cache_columns; end + def _counter_cache_columns=(value); end + def _counter_cache_columns?; end + def counter_cached_association_names; end + def counter_cached_association_names=(value); end + def counter_cached_association_names?; end + end + + module GeneratedInstanceMethods + def counter_cached_association_names; end + def counter_cached_association_names?; end + end +end + +# source://activerecord//lib/active_record/counter_cache.rb#13 +module ActiveRecord::CounterCache::ClassMethods + # @return [Boolean] + # + # source://activerecord//lib/active_record/counter_cache.rb#207 + def counter_cache_column?(name); end + + # Decrement a numeric field by one, via a direct SQL update. + # + # This works the same as #increment_counter but reduces the column value by + # 1 instead of increasing it. + # + # ==== Parameters + # + # * +counter_name+ - The name of the field that should be decremented. + # * +id+ - The id of the object that should be decremented or an array of ids. + # * :by - The amount by which to decrement the value. Defaults to +1+. + # * :touch - Touch timestamp columns when updating. + # Pass +true+ to touch +updated_at+ and/or +updated_on+. Pass a symbol to + # touch that column or an array of symbols to touch just those ones. + # + # ==== Examples + # + # # Decrement the posts_count column for the record with an id of 5 + # DiscussionBoard.decrement_counter(:posts_count, 5) + # + # # Decrement the posts_count column for the record with an id of 5 + # by a specific amount. + # DiscussionBoard.decrement_counter(:posts_count, 5, by: 3) + # + # # Decrement the posts_count column for the record with an id of 5 + # # and update the updated_at value. + # DiscussionBoard.decrement_counter(:posts_count, 5, touch: true) + # + # source://activerecord//lib/active_record/counter_cache.rb#203 + def decrement_counter(counter_name, id, by: T.unsafe(nil), touch: T.unsafe(nil)); end + + # Increment a numeric field by one, via a direct SQL update. + # + # This method is used primarily for maintaining counter_cache columns that are + # used to store aggregate values. For example, a +DiscussionBoard+ may cache + # posts_count and comments_count to avoid running an SQL query to calculate the + # number of posts and comments there are, each time it is displayed. + # + # ==== Parameters + # + # * +counter_name+ - The name of the field that should be incremented. + # * +id+ - The id of the object that should be incremented or an array of ids. + # * :by - The amount by which to increment the value. Defaults to +1+. + # * :touch - Touch timestamp columns when updating. + # Pass +true+ to touch +updated_at+ and/or +updated_on+. Pass a symbol to + # touch that column or an array of symbols to touch just those ones. + # + # ==== Examples + # + # # Increment the posts_count column for the record with an id of 5 + # DiscussionBoard.increment_counter(:posts_count, 5) + # + # # Increment the posts_count column for the record with an id of 5 + # # by a specific amount. + # DiscussionBoard.increment_counter(:posts_count, 5, by: 3) + # + # # Increment the posts_count column for the record with an id of 5 + # # and update the updated_at value. + # DiscussionBoard.increment_counter(:posts_count, 5, touch: true) + # + # source://activerecord//lib/active_record/counter_cache.rb#173 + def increment_counter(counter_name, id, by: T.unsafe(nil), touch: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/counter_cache.rb#211 + def load_schema!; end + + # Resets one or more counter caches to their correct value using an SQL + # count query. This is useful when adding new counter caches, or if the + # counter has been corrupted or modified directly by SQL. + # + # ==== Parameters + # + # * +id+ - The id of the object you wish to reset a counter on or an array of ids. + # * +counters+ - One or more association counters to reset. Association name or counter name can be given. + # * :touch - Touch timestamp columns when updating. + # Pass +true+ to touch +updated_at+ and/or +updated_on+. Pass a symbol to + # touch that column or an array of symbols to touch just those ones. + # + # ==== Examples + # + # # For the Post with id #1, reset the comments_count + # Post.reset_counters(1, :comments) + # + # # For posts with ids #1 and #2, reset the comments_count + # Post.reset_counters([1, 2], :comments) + # + # # Like above, but also touch the updated_at and/or updated_on + # # attributes. + # Post.reset_counters(1, :comments, touch: true) + # + # source://activerecord//lib/active_record/counter_cache.rb#37 + def reset_counters(id, *counters, touch: T.unsafe(nil)); end + + # A generic "counter updater" implementation, intended primarily to be + # used by #increment_counter and #decrement_counter, but which may also + # be useful on its own. It simply does a direct SQL update for the record + # with the given ID, altering the given hash of counters by the amount + # given by the corresponding value: + # + # ==== Parameters + # + # * +id+ - The id of the object you wish to update a counter on or an array of ids. + # * +counters+ - A Hash containing the names of the fields + # to update as keys and the amount to update the field by as values. + # * :touch option - Touch timestamp columns when updating. + # If attribute names are passed, they are updated along with updated_at/on + # attributes. + # + # ==== Examples + # + # # For the Post with id of 5, decrement the comments_count by 1, and + # # increment the actions_count by 1 + # Post.update_counters 5, comments_count: -1, actions_count: 1 + # # Executes the following SQL: + # # UPDATE posts + # # SET comments_count = COALESCE(comments_count, 0) - 1, + # # actions_count = COALESCE(actions_count, 0) + 1 + # # WHERE id = 5 + # + # # For the Posts with id of 10 and 15, increment the comments_count by 1 + # Post.update_counters [10, 15], comments_count: 1 + # # Executes the following SQL: + # # UPDATE posts + # # SET comments_count = COALESCE(comments_count, 0) + 1 + # # WHERE id IN (10, 15) + # + # # For the Posts with id of 10 and 15, increment the comments_count by 1 + # # and update the updated_at value for each counter. + # Post.update_counters [10, 15], comments_count: 1, touch: true + # # Executes the following SQL: + # # UPDATE posts + # # SET comments_count = COALESCE(comments_count, 0) + 1, + # # `updated_at` = '2016-10-13T09:59:23-05:00' + # # WHERE id IN (10, 15) + # + # source://activerecord//lib/active_record/counter_cache.rb#140 + def update_counters(id, counters); end +end + +# Raised when attribute has a name reserved by Active Record (when attribute +# has name of one of Active Record instance methods). +# +# source://activerecord//lib/active_record/errors.rb#447 +class ActiveRecord::DangerousAttributeError < ::ActiveRecord::ActiveRecordError; end + +# Raised when creating a database if it exists. +# +# source://activerecord//lib/active_record/errors.rb#364 +class ActiveRecord::DatabaseAlreadyExists < ::ActiveRecord::StatementInvalid; end + +# = Active Record Database Configurations +# +# +ActiveRecord::DatabaseConfigurations+ returns an array of +DatabaseConfig+ +# objects that are constructed from the application's database +# configuration hash or URL string. +# +# The array of +DatabaseConfig+ objects in an application default to either a +# HashConfig or UrlConfig. You can retrieve your application's config by using +# ActiveRecord::Base.configurations. +# +# If you register a custom handler, objects will be created according to the +# conditions of the handler. See ::register_db_config_handler for more on +# registering custom handlers. +# +# source://activerecord//lib/active_record/database_configurations/database_config.rb#4 +class ActiveRecord::DatabaseConfigurations + # @return [DatabaseConfigurations] a new instance of DatabaseConfigurations + # + # source://activerecord//lib/active_record/database_configurations.rb#75 + def initialize(configurations = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/database_configurations.rb#27 + def any?(*_arg0, **_arg1, &_arg2); end + + # Checks if the application's configurations are empty. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/database_configurations.rb#155 + def blank?; end + + # Collects the configs for the environment and optionally the specification + # name passed in. To include replica configurations pass include_hidden: true. + # + # If a name is provided a single +DatabaseConfig+ object will be + # returned, otherwise an array of +DatabaseConfig+ objects will be + # returned that corresponds with the environment and type requested. + # + # ==== Options + # + # * env_name: The environment name. Defaults to +nil+ which will collect + # configs for all environments. + # * name: The db config name (i.e. primary, animals, etc.). Defaults + # to +nil+. If no +env_name+ is specified the config for the default env and the + # passed +name+ will be returned. + # * config_key: Selects configs that contain a particular key in the configuration + # hash. Useful for selecting configs that use a custom db config handler or finding + # configs with hashes that contain a particular key. + # * include_hidden: Determines whether to include replicas and configurations + # hidden by database_tasks: false in the returned list. Most of the time we're only + # iterating over the primary connections (i.e. migrations don't need to run for the + # write and read connection). Defaults to +false+. + # + # source://activerecord//lib/active_record/database_configurations.rb#100 + def configs_for(env_name: T.unsafe(nil), name: T.unsafe(nil), config_key: T.unsafe(nil), include_hidden: T.unsafe(nil)); end + + # Returns the value of attribute configurations. + # + # source://activerecord//lib/active_record/database_configurations.rb#26 + def configurations; end + + # Checks if the application's configurations are empty. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/database_configurations.rb#152 + def empty?; end + + # Returns a single +DatabaseConfig+ object based on the requested environment. + # + # If the application has multiple databases +find_db_config+ will return + # the first +DatabaseConfig+ for the environment. + # + # source://activerecord//lib/active_record/database_configurations.rb#129 + def find_db_config(env); end + + # A primary configuration is one that is named primary or if there is + # no primary, the first configuration for an environment will be treated + # as primary. This is used as the "default" configuration and is used + # when the application needs to treat one configuration differently. For + # example, when Rails dumps the schema, the primary configuration's schema + # file will be named `schema.rb` instead of `primary_schema.rb`. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/database_configurations.rb#144 + def primary?(name); end + + # Returns fully resolved connection, accepts hash, string or symbol. + # Always returns a DatabaseConfiguration::DatabaseConfig + # + # == Examples + # + # Symbol representing current environment. + # + # DatabaseConfigurations.new("production" => {}).resolve(:production) + # # => DatabaseConfigurations::HashConfig.new(env_name: "production", config: {}) + # + # One layer deep hash of connection values. + # + # DatabaseConfigurations.new({}).resolve("adapter" => "sqlite3") + # # => DatabaseConfigurations::HashConfig.new(config: {"adapter" => "sqlite3"}) + # + # Connection URL. + # + # DatabaseConfigurations.new({}).resolve("postgresql://localhost/foo") + # # => DatabaseConfigurations::UrlConfig.new(config: {"adapter" => "postgresql", "host" => "localhost", "database" => "foo"}) + # + # source://activerecord//lib/active_record/database_configurations.rb#176 + def resolve(config); end + + private + + # source://activerecord//lib/active_record/database_configurations.rb#202 + def build_configs(configs); end + + # source://activerecord//lib/active_record/database_configurations.rb#241 + def build_configuration_sentence; end + + # source://activerecord//lib/active_record/database_configurations.rb#275 + def build_db_config_from_hash(env_name, name, config); end + + # source://activerecord//lib/active_record/database_configurations.rb#254 + def build_db_config_from_raw_config(env_name, name, config); end + + # source://activerecord//lib/active_record/database_configurations.rb#265 + def build_db_config_from_string(env_name, name, config); end + + # source://activerecord//lib/active_record/database_configurations.rb#190 + def default_env; end + + # source://activerecord//lib/active_record/database_configurations.rb#194 + def env_with_configs(env = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/database_configurations.rb#297 + def environment_url_config(env, name, config); end + + # source://activerecord//lib/active_record/database_configurations.rb#304 + def environment_value_for(name); end + + # source://activerecord//lib/active_record/database_configurations.rb#288 + def merge_db_environment_variables(current_env, configs); end + + # source://activerecord//lib/active_record/database_configurations.rb#227 + def resolve_symbol_connection(name); end + + # source://activerecord//lib/active_record/database_configurations.rb#221 + def walk_configs(env_name, config); end + + class << self + # source://activerecord//lib/active_record/database_configurations.rb#29 + def db_config_handlers; end + + # source://activerecord//lib/active_record/database_configurations.rb#29 + def db_config_handlers=(_arg0); end + + # Allows an application to register a custom handler for database configuration + # objects. This is useful for creating a custom handler that responds to + # methods your application needs but Active Record doesn't implement. For + # example if you are using Vitess, you may want your Vitess configurations + # to respond to `sharded?`. To implement this define the following in an + # initializer: + # + # ActiveSupport.on_load(:active_record_database_configurations) do + # ActiveRecord::DatabaseConfigurations.register_db_config_handler do |env_name, name, url, config| + # next unless config.key?(:vitess) + # VitessConfig.new(env_name, name, config) + # end + # end + # + # Note: applications must handle the condition in which custom config should be + # created in your handler registration otherwise all objects will use the custom + # handler. + # + # Then define your +VitessConfig+ to respond to the methods your application + # needs. It is recommended that you inherit from one of the existing + # database config classes to avoid having to reimplement all methods. Custom + # config handlers should only implement methods Active Record does not. + # + # class VitessConfig < ActiveRecord::DatabaseConfigurations::UrlConfig + # def sharded? + # configuration_hash.fetch("sharded", false) + # end + # end + # + # For configs that have a +:vitess+ key, a +VitessConfig+ object will be + # created instead of a +UrlConfig+. + # + # source://activerecord//lib/active_record/database_configurations.rb#63 + def register_db_config_handler(&block); end + end +end + +# Expands a connection string into a hash. +# +# source://activerecord//lib/active_record/database_configurations/connection_url_resolver.rb#10 +class ActiveRecord::DatabaseConfigurations::ConnectionUrlResolver + # == Example + # + # url = "postgresql://foo:bar@localhost:9000/foo_test?pool=5&timeout=3000" + # ConnectionUrlResolver.new(url).to_hash + # # => { + # adapter: "postgresql", + # host: "localhost", + # port: 9000, + # database: "foo_test", + # username: "foo", + # password: "bar", + # pool: "5", + # timeout: "3000" + # } + # + # @return [ConnectionUrlResolver] a new instance of ConnectionUrlResolver + # + # source://activerecord//lib/active_record/database_configurations/connection_url_resolver.rb#25 + def initialize(url); end + + # Converts the given URL to a full connection hash. + # + # source://activerecord//lib/active_record/database_configurations/connection_url_resolver.rb#38 + def to_hash; end + + private + + # Returns name of the database. + # + # source://activerecord//lib/active_record/database_configurations/connection_url_resolver.rb#91 + def database_from_path; end + + # Converts the query parameters of the URI into a hash. + # + # "localhost?pool=5&reaping_frequency=2" + # # => { pool: "5", reaping_frequency: "2" } + # + # returns empty hash if no query present. + # + # "localhost" + # # => {} + # + # source://activerecord//lib/active_record/database_configurations/connection_url_resolver.rb#60 + def query_hash; end + + # source://activerecord//lib/active_record/database_configurations/connection_url_resolver.rb#64 + def raw_config; end + + # source://activerecord//lib/active_record/database_configurations/connection_url_resolver.rb#82 + def resolved_adapter; end + + # Returns the value of attribute uri. + # + # source://activerecord//lib/active_record/database_configurations/connection_url_resolver.rb#45 + def uri; end + + # source://activerecord//lib/active_record/database_configurations/connection_url_resolver.rb#47 + def uri_parser; end +end + +# ActiveRecord::Base.configurations will return either a HashConfig or +# UrlConfig respectively. It will never return a +DatabaseConfig+ object, +# as this is the parent class for the types of database configuration objects. +# +# source://activerecord//lib/active_record/database_configurations/database_config.rb#8 +class ActiveRecord::DatabaseConfigurations::DatabaseConfig + # @return [DatabaseConfig] a new instance of DatabaseConfig + # + # source://activerecord//lib/active_record/database_configurations/database_config.rb#11 + def initialize(env_name, name); end + + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/database_configurations/database_config.rb#43 + def _database=(database); end + + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/database_configurations/database_config.rb#47 + def adapter; end + + # source://activerecord//lib/active_record/database_configurations/database_config.rb#17 + def adapter_class; end + + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/database_configurations/database_config.rb#75 + def checkout_timeout; end + + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/database_configurations/database_config.rb#39 + def database; end + + # source://activerecord//lib/active_record/database_configurations/database_config.rb#9 + def env_name; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/database_configurations/database_config.rb#95 + def for_current_env?; end + + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/database_configurations/database_config.rb#35 + def host; end + + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/database_configurations/database_config.rb#83 + def idle_timeout; end + + # source://activerecord//lib/active_record/database_configurations/database_config.rb#21 + def inspect; end + + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/database_configurations/database_config.rb#55 + def max_connections; end + + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/database_configurations/database_config.rb#67 + def max_queue; end + + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/database_configurations/database_config.rb#63 + def max_threads; end + + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/database_configurations/database_config.rb#91 + def migrations_paths; end + + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/database_configurations/database_config.rb#51 + def min_connections; end + + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/database_configurations/database_config.rb#59 + def min_threads; end + + # source://activerecord//lib/active_record/database_configurations/database_config.rb#9 + def name; end + + # source://activerecord//lib/active_record/database_configurations/database_config.rb#25 + def new_connection; end + + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/database_configurations/database_config.rb#71 + def query_cache; end + + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/database_configurations/database_config.rb#79 + def reaping_frequency; end + + # @raise [NotImplementedError] + # @return [Boolean] + # + # source://activerecord//lib/active_record/database_configurations/database_config.rb#87 + def replica?; end + + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/database_configurations/database_config.rb#99 + def schema_cache_path; end + + # @raise [NotImplementedError] + # @return [Boolean] + # + # source://activerecord//lib/active_record/database_configurations/database_config.rb#107 + def seeds?; end + + # @raise [NotImplementedError] + # @return [Boolean] + # + # source://activerecord//lib/active_record/database_configurations/database_config.rb#103 + def use_metadata_table?; end + + # source://activerecord//lib/active_record/database_configurations/database_config.rb#29 + def validate!; end +end + +# # Active Record Database Hash Config +# +# A `HashConfig` object is created for each database configuration entry that is +# created from a hash. +# +# A hash config: +# +# { "development" => { "database" => "db_name" } } +# +# Becomes: +# +# # +# +# See ActiveRecord::DatabaseConfigurations for more info. +# +# source://activerecord//lib/active_record/database_configurations/hash_config.rb#22 +class ActiveRecord::DatabaseConfigurations::HashConfig < ::ActiveRecord::DatabaseConfigurations::DatabaseConfig + # Initialize a new `HashConfig` object + # + # #### Parameters + # + # * `env_name` - The Rails environment, i.e. "development". + # * `name` - The db config name. In a standard two-tier database configuration + # this will default to "primary". In a multiple database three-tier database + # configuration this corresponds to the name used in the second tier, for + # example "primary_readonly". + # * `configuration_hash` - The config hash. This is the hash that contains the + # database adapter, name, and other important information for database + # connections. + # + # @return [HashConfig] a new instance of HashConfig + # + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#38 + def initialize(env_name, name, configuration_hash); end + + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#69 + def _database=(database); end + + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#130 + def adapter; end + + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#112 + def checkout_timeout; end + + # Returns the value of attribute configuration_hash. + # + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#23 + def configuration_hash; end + + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#65 + def database; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#190 + def database_tasks?; end + + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#140 + def default_schema_cache_path(db_dir = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#57 + def host; end + + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#120 + def idle_timeout; end + + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#125 + def keepalive; end + + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#148 + def lazy_schema_cache_path; end + + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#95 + def max_age; end + + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#73 + def max_connections; end + + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#108 + def max_queue; end + + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#91 + def max_threads; end + + # The migrations paths for a database configuration. If the `migrations_paths` + # key is present in the config, `migrations_paths` will return its value. + # + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#53 + def migrations_paths; end + + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#80 + def min_connections; end + + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#87 + def min_threads; end + + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#84 + def pool(*args, **_arg1, &block); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#152 + def primary?; end + + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#104 + def query_cache; end + + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#116 + def reaping_frequency; end + + # Determines whether a database configuration is for a replica / readonly + # connection. If the `replica` key is present in the config, `replica?` will + # return `true`. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#47 + def replica?; end + + # The path to the schema cache dump file for a database. If omitted, the + # filename will be read from ENV or a default will be derived. + # + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#136 + def schema_cache_path; end + + # Determines whether to dump the schema/structure files and the filename that + # should be used. + # + # If `configuration_hash[:schema_dump]` is set to `false` or `nil` the schema + # will not be dumped. + # + # If the config option is set that will be used. Otherwise Rails will generate + # the filename from the database config name. + # + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#172 + def schema_dump(format = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#184 + def schema_format; end + + # Determines whether the db:prepare task should seed the database from db/seeds.rb. + # + # If the `seeds` key is present in the config, `seeds?` will return its value. Otherwise, it + # will return `true` for the primary database and `false` for all other configs. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#160 + def seeds?; end + + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#61 + def socket; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#194 + def use_metadata_table?; end + + private + + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#208 + def default_reaping_frequency; end + + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#199 + def schema_file_type(format); end + + # source://activerecord//lib/active_record/database_configurations/hash_config.rb#214 + def validate_configuration!; end +end + +# source://activerecord//lib/active_record/database_configurations.rb#24 +class ActiveRecord::DatabaseConfigurations::InvalidConfigurationError < ::StandardError; end + +# = Active Record Database Url Config +# +# A +UrlConfig+ object is created for each database configuration +# entry that is created from a URL. This can either be a URL string +# or a hash with a URL in place of the config hash. +# +# A URL config: +# +# postgres://localhost/foo +# +# Becomes: +# +# # +# +# See ActiveRecord::DatabaseConfigurations for more info. +# +# source://activerecord//lib/active_record/database_configurations/url_config.rb#24 +class ActiveRecord::DatabaseConfigurations::UrlConfig < ::ActiveRecord::DatabaseConfigurations::HashConfig + # Initialize a new +UrlConfig+ object + # + # ==== Options + # + # * :env_name - The \Rails environment, i.e. "development". + # * :name - The db config name. In a standard two-tier + # database configuration this will default to "primary". In a multiple + # database three-tier database configuration this corresponds to the name + # used in the second tier, for example "primary_readonly". + # * :url - The database URL. + # * :config - The config hash. This is the hash that contains the + # database adapter, name, and other important information for database + # connections. + # + # @return [UrlConfig] a new instance of UrlConfig + # + # source://activerecord//lib/active_record/database_configurations/url_config.rb#40 + def initialize(env_name, name, url, configuration_hash = T.unsafe(nil)); end + + # Returns the value of attribute url. + # + # source://activerecord//lib/active_record/database_configurations/url_config.rb#25 + def url; end + + private + + # Return a Hash that can be merged into the main config that represents + # the passed in url + # + # source://activerecord//lib/active_record/database_configurations/url_config.rb#79 + def build_url_hash; end + + # source://activerecord//lib/active_record/database_configurations/url_config.rb#60 + def parse_query_cache; end + + # source://activerecord//lib/active_record/database_configurations/url_config.rb#71 + def to_boolean!(configuration_hash, key); end +end + +# Raised when connection to the database could not been established because it was not +# able to connect to the host or when the authorization failed. +# +# source://activerecord//lib/active_record/errors.rb#101 +class ActiveRecord::DatabaseConnectionError < ::ActiveRecord::ConnectionNotEstablished + # @return [DatabaseConnectionError] a new instance of DatabaseConnectionError + # + # source://activerecord//lib/active_record/errors.rb#102 + def initialize(message = T.unsafe(nil)); end + + class << self + # source://activerecord//lib/active_record/errors.rb#107 + def hostname_error(hostname); end + + # source://activerecord//lib/active_record/errors.rb#114 + def username_error(username); end + end +end + +# DatabaseVersionError will be raised when the database version is not supported, or when +# the database version cannot be determined. +# +# source://activerecord//lib/active_record/errors.rb#623 +class ActiveRecord::DatabaseVersionError < ::ActiveRecord::ActiveRecordError; end + +# Deadlocked will be raised when a transaction is rolled +# back by the database when a deadlock is encountered. +# +# This is a subclass of TransactionRollbackError, please make sure to check +# its documentation to be aware of its caveats. +# +# source://activerecord//lib/active_record/errors.rb#560 +class ActiveRecord::Deadlocked < ::ActiveRecord::TransactionRollbackError; end + +# = Delegated types +# +# Class hierarchies can map to relational database tables in many ways. Active Record, for example, offers +# purely abstract classes, where the superclass doesn't persist any attributes, and single-table inheritance, +# where all attributes from all levels of the hierarchy are represented in a single table. Both have their +# places, but neither are without their drawbacks. +# +# The problem with purely abstract classes is that all concrete subclasses must persist all the shared +# attributes themselves in their own tables (also known as class-table inheritance). This makes it hard to +# do queries across the hierarchy. For example, imagine you have the following hierarchy: +# +# Entry < ApplicationRecord +# Message < Entry +# Comment < Entry +# +# How do you show a feed that has both +Message+ and +Comment+ records, which can be easily paginated? +# Well, you can't! Messages are backed by a messages table and comments by a comments table. You can't +# pull from both tables at once and use a consistent OFFSET/LIMIT scheme. +# +# You can get around the pagination problem by using single-table inheritance, but now you're forced into +# a single mega table with all the attributes from all subclasses. No matter how divergent. If a Message +# has a subject, but the comment does not, well, now the comment does anyway! So STI works best when there's +# little divergence between the subclasses and their attributes. +# +# But there's a third way: Delegated types. With this approach, the "superclass" is a concrete class +# that is represented by its own table, where all the superclass attributes that are shared amongst all the +# "subclasses" are stored. And then each of the subclasses have their own individual tables for additional +# attributes that are particular to their implementation. This is similar to what's called multi-table +# inheritance in Django, but instead of actual inheritance, this approach uses delegation to form the +# hierarchy and share responsibilities. +# +# Let's look at that entry/message/comment example using delegated types: +# +# # Schema: entries[ id, account_id, creator_id, entryable_type, entryable_id, created_at, updated_at ] +# class Entry < ApplicationRecord +# belongs_to :account +# belongs_to :creator +# delegated_type :entryable, types: %w[ Message Comment ] +# end +# +# module Entryable +# extend ActiveSupport::Concern +# +# included do +# has_one :entry, as: :entryable, touch: true +# end +# end +# +# # Schema: messages[ id, subject, body, created_at, updated_at ] +# class Message < ApplicationRecord +# include Entryable +# end +# +# # Schema: comments[ id, content, created_at, updated_at ] +# class Comment < ApplicationRecord +# include Entryable +# end +# +# As you can see, neither +Message+ nor +Comment+ are meant to stand alone. Crucial metadata for both classes +# resides in the +Entry+ "superclass". But the +Entry+ absolutely can stand alone in terms of querying capacity +# in particular. You can now easily do things like: +# +# Account.find(1).entries.order(created_at: :desc).limit(50) +# +# Which is exactly what you want when displaying both comments and messages together. The entry itself can +# be rendered as its delegated type easily, like so: +# +# # entries/_entry.html.erb +# <%= render "entries/entryables/#{entry.entryable_name}", entry: entry %> +# +# # entries/entryables/_message.html.erb +#
    +#
    <%= entry.message.subject %>
    +#

    <%= entry.message.body %>

    +# Posted on <%= entry.created_at %> by <%= entry.creator.name %> +#
    +# +# # entries/entryables/_comment.html.erb +#
    +# <%= entry.creator.name %> said: <%= entry.comment.content %> +#
    +# +# == Sharing behavior with concerns and controllers +# +# The entry "superclass" also serves as a perfect place to put all that shared logic that applies to both +# messages and comments, and which acts primarily on the shared attributes. Imagine: +# +# class Entry < ApplicationRecord +# include Eventable, Forwardable, Redeliverable +# end +# +# Which allows you to have controllers for things like +ForwardsController+ and +RedeliverableController+ +# that both act on entries, and thus provide the shared functionality to both messages and comments. +# +# == Creating new records +# +# You create a new record that uses delegated typing by creating the delegator and delegatee at the same time, +# like so: +# +# Entry.create! entryable: Comment.new(content: "Hello!"), creator: Current.user, account: Current.account +# +# If you need more complicated composition, or you need to perform dependent validation, you should build a factory +# method or class to take care of the complicated needs. This could be as simple as: +# +# class Entry < ApplicationRecord +# def self.create_with_comment(content, creator: Current.user, account: Current.account) +# create! entryable: Comment.new(content: content), creator: creator, account: account +# end +# end +# +# == Querying across records +# +# A consequence of delegated types is that querying attributes spread across multiple classes becomes slightly more +# tricky, but not impossible. +# +# The simplest method is to join the "superclass" to the "subclass" and apply the query parameters (i.e. #where) +# in appropriate places: +# +# Comment.joins(:entry).where(comments: { content: 'Hello!' }, entry: { creator: Current.user } ) +# +# For convenience, add a scope on the concern. Now all classes that implement the concern will automatically include +# the method: +# +# # app/models/concerns/entryable.rb +# scope :with_entry, ->(attrs) { joins(:entry).where(entry: attrs) } +# +# Now the query can be shortened significantly: +# +# Comment.where(content: 'Hello!').with_entry(creator: Current.user) +# +# == Adding further delegation +# +# The delegated type shouldn't just answer the question of what the underlying class is called. In fact, that's +# an anti-pattern most of the time. The reason you're building this hierarchy is to take advantage of polymorphism. +# So here's a simple example of that: +# +# class Entry < ApplicationRecord +# delegated_type :entryable, types: %w[ Message Comment ] +# delegate :title, to: :entryable +# end +# +# class Message < ApplicationRecord +# def title +# subject +# end +# end +# +# class Comment < ApplicationRecord +# def title +# content.truncate(20) +# end +# end +# +# Now you can list a bunch of entries, call Entry#title, and polymorphism will provide you with the answer. +# +# == Nested \Attributes +# +# Enabling nested attributes on a delegated_type association allows you to +# create the entry and message in one go: +# +# class Entry < ApplicationRecord +# delegated_type :entryable, types: %w[ Message Comment ] +# accepts_nested_attributes_for :entryable +# end +# +# params = { entry: { entryable_type: 'Message', entryable_attributes: { subject: 'Smiling' } } } +# entry = Entry.create(params[:entry]) +# entry.entryable.id # => 2 +# entry.entryable.subject # => 'Smiling' +# +# source://activerecord//lib/active_record/delegated_type.rb#175 +module ActiveRecord::DelegatedType + # Defines this as a class that'll delegate its type for the passed +role+ to the class references in +types+. + # That'll create a polymorphic +belongs_to+ relationship to that +role+, and it'll add all the delegated + # type convenience methods: + # + # class Entry < ApplicationRecord + # delegated_type :entryable, types: %w[ Message Comment ], dependent: :destroy + # end + # + # @entry.entryable_class # => Message or Comment + # @entry.entryable_name # => "message" or "comment" + # Entry.messages # => Entry.where(entryable_type: "Message") + # @entry.message? # => true when entryable_type == "Message" + # @entry.message # => returns the message record, when entryable_type == "Message", otherwise nil + # @entry.message_id # => returns entryable_id, when entryable_type == "Message", otherwise nil + # Entry.comments # => Entry.where(entryable_type: "Comment") + # @entry.comment? # => true when entryable_type == "Comment" + # @entry.comment # => returns the comment record, when entryable_type == "Comment", otherwise nil + # @entry.comment_id # => returns entryable_id, when entryable_type == "Comment", otherwise nil + # + # You can also declare namespaced types: + # + # class Entry < ApplicationRecord + # delegated_type :entryable, types: %w[ Message Comment Access::NoticeMessage ], dependent: :destroy + # end + # + # Entry.access_notice_messages + # @entry.access_notice_message + # @entry.access_notice_message? + # + # ==== Options + # + # The +options+ are passed directly to the +belongs_to+ call, so this is where you declare +dependent+ etc. + # The following options can be included to specialize the behavior of the delegated type convenience methods. + # + # [+:foreign_key+] + # Specify the foreign key used for the convenience methods. By default this is guessed to be the passed + # +role+ with an "_id" suffix. So a class that defines a + # delegated_type :entryable, types: %w[ Message Comment ] association will use "entryable_id" as + # the default :foreign_key. + # [+:foreign_type+] + # Specify the column used to store the associated object's type. By default this is inferred to be the passed + # +role+ with a "_type" suffix. A class that defines a + # delegated_type :entryable, types: %w[ Message Comment ] association will use "entryable_type" as + # the default :foreign_type. + # [+:primary_key+] + # Specify the method that returns the primary key of associated object used for the convenience methods. + # By default this is +id+. + # + # Option examples: + # class Entry < ApplicationRecord + # delegated_type :entryable, types: %w[ Message Comment ], primary_key: :uuid, foreign_key: :entryable_uuid + # end + # + # @entry.message_uuid # => returns entryable_uuid, when entryable_type == "Message", otherwise nil + # @entry.comment_uuid # => returns entryable_uuid, when entryable_type == "Comment", otherwise nil + # + # source://activerecord//lib/active_record/delegated_type.rb#231 + def delegated_type(role, types:, **options); end + + private + + # source://activerecord//lib/active_record/delegated_type.rb#237 + def define_delegated_type_methods(role, types:, options:); end +end + +# source://activerecord//lib/active_record/relation/delegation.rb#5 +module ActiveRecord::Delegation + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::Delegation::ClassMethods + + # source://activerecord//lib/active_record/relation/delegation.rb#100 + def &(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#100 + def +(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#100 + def -(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#100 + def [](*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#100 + def as_json(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#100 + def compact(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#105 + def connection(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#100 + def each(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#100 + def encode_with(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#100 + def in_groups(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#100 + def in_groups_of(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#100 + def index(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#100 + def intersect?(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#100 + def join(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#100 + def length(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#105 + def name(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#105 + def primary_key(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#100 + def reverse(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#100 + def rindex(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#100 + def rotate(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#100 + def sample(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#105 + def sanitize_sql_like(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#100 + def shuffle(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#100 + def slice(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#100 + def split(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#105 + def table_name(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#100 + def to_formatted_s(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#100 + def to_fs(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#100 + def to_sentence(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#100 + def to_xml(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#105 + def transaction(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#105 + def unscoped(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#105 + def with_connection(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/delegation.rb#100 + def |(*_arg0, **_arg1, &_arg2); end + + private + + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation/delegation.rb#149 + def respond_to_missing?(method, _); end + + class << self + # source://activerecord//lib/active_record/relation/delegation.rb#7 + def delegated_classes; end + + # source://activerecord//lib/active_record/relation/delegation.rb#16 + def uncacheable_methods; end + end +end + +# source://activerecord//lib/active_record/relation/delegation.rb#137 +module ActiveRecord::Delegation::ClassMethods + # source://activerecord//lib/active_record/relation/delegation.rb#138 + def create(model, *_arg1, **_arg2, &_arg3); end + + private + + # source://activerecord//lib/active_record/relation/delegation.rb#143 + def relation_class_for(model); end +end + +# source://activerecord//lib/active_record/relation/delegation.rb#107 +module ActiveRecord::Delegation::ClassSpecificRelation + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::Delegation::ClassSpecificRelation::ClassMethods + + private + + # source://activerecord//lib/active_record/relation/delegation.rb#117 + def method_missing(method, *_arg1, **_arg2, &_arg3); end +end + +# source://activerecord//lib/active_record/relation/delegation.rb#110 +module ActiveRecord::Delegation::ClassSpecificRelation::ClassMethods + # source://activerecord//lib/active_record/relation/delegation.rb#111 + def name; end +end + +# source://activerecord//lib/active_record/relation/delegation.rb#23 +module ActiveRecord::Delegation::DelegateCache + # source://activerecord//lib/active_record/relation/delegation.rb#51 + def generate_relation_method(method); end + + # source://activerecord//lib/active_record/relation/delegation.rb#46 + def inherited(child_class); end + + # source://activerecord//lib/active_record/relation/delegation.rb#31 + def initialize_relation_delegate_cache; end + + # source://activerecord//lib/active_record/relation/delegation.rb#27 + def relation_delegate_class(klass); end + + protected + + # source://activerecord//lib/active_record/relation/delegation.rb#56 + def include_relation_methods(delegate); end + + private + + # source://activerecord//lib/active_record/relation/delegation.rb#62 + def generated_relation_methods; end + + class << self + # source://activerecord//lib/active_record/relation/delegation.rb#25 + def delegate_base_methods; end + + # source://activerecord//lib/active_record/relation/delegation.rb#25 + def delegate_base_methods=(_arg0); end + end +end + +# source://activerecord//lib/active_record/relation/delegation.rb#70 +class ActiveRecord::Delegation::GeneratedRelationMethods < ::Module + # source://activerecord//lib/active_record/relation/delegation.rb#73 + def generate_method(method); end +end + +# source://activerecord//lib/active_record/relation/delegation.rb#71 +ActiveRecord::Delegation::GeneratedRelationMethods::MUTEX = T.let(T.unsafe(nil), Thread::Mutex) + +# This error is raised when trying to destroy a parent instance in N:1 or 1:1 associations +# (has_many, has_one) when there is at least 1 child associated instance. +# ex: if @project.tasks.size > 0, DeleteRestrictionError will be raised when trying to destroy @project +# +# source://activerecord//lib/active_record/associations/errors.rb#256 +class ActiveRecord::DeleteRestrictionError < ::ActiveRecord::ActiveRecordError + # @return [DeleteRestrictionError] a new instance of DeleteRestrictionError + # + # source://activerecord//lib/active_record/associations/errors.rb#257 + def initialize(name = T.unsafe(nil)); end +end + +# source://activerecord//lib/active_record/errors.rb#626 +class ActiveRecord::DeprecatedAssociationError < ::ActiveRecord::ActiveRecordError; end + +# source://activerecord//lib/active_record/destroy_association_async_job.rb#4 +class ActiveRecord::DestroyAssociationAsyncError < ::StandardError; end + +# = Active Record Destroy Association Async Job +# +# Job to destroy the records associated with a destroyed record in background. +# +# source://activerecord//lib/active_record/destroy_association_async_job.rb#10 +class ActiveRecord::DestroyAssociationAsyncJob < ::ActiveJob::Base + # source://activerecord//lib/active_record/destroy_association_async_job.rb#15 + def perform(owner_model_name: T.unsafe(nil), owner_id: T.unsafe(nil), association_class: T.unsafe(nil), association_ids: T.unsafe(nil), association_primary_key_column: T.unsafe(nil), ensuring_owner_was_method: T.unsafe(nil)); end + + private + + # @return [Boolean] + # + # source://activerecord//lib/active_record/destroy_association_async_job.rb#34 + def owner_destroyed?(owner, ensuring_owner_was_method); end + + class << self + private + + # source://activerecord//lib/active_record/destroy_association_async_job.rb#11 + def __class_attr_queue_name; end + + # source://activerecord//lib/active_record/destroy_association_async_job.rb#11 + def __class_attr_queue_name=(new_value); end + + # source://activerecord//lib/active_record/destroy_association_async_job.rb#13 + def __class_attr_rescue_handlers; end + + # source://activerecord//lib/active_record/destroy_association_async_job.rb#13 + def __class_attr_rescue_handlers=(new_value); end + end +end + +# source://activerecord//lib/active_record/disable_joins_association_relation.rb#4 +class ActiveRecord::DisableJoinsAssociationRelation < ::ActiveRecord::Relation + # @return [DisableJoinsAssociationRelation] a new instance of DisableJoinsAssociationRelation + # + # source://activerecord//lib/active_record/disable_joins_association_relation.rb#7 + def initialize(klass, key, ids); end + + # source://activerecord//lib/active_record/disable_joins_association_relation.rb#17 + def first(limit = T.unsafe(nil)); end + + # Returns the value of attribute ids. + # + # source://activerecord//lib/active_record/disable_joins_association_relation.rb#5 + def ids; end + + # Returns the value of attribute key. + # + # source://activerecord//lib/active_record/disable_joins_association_relation.rb#5 + def key; end + + # source://activerecord//lib/active_record/disable_joins_association_relation.rb#13 + def limit(value); end + + # source://activerecord//lib/active_record/disable_joins_association_relation.rb#25 + def load; end +end + +# source://activerecord//lib/active_record/migration.rb#101 +class ActiveRecord::DuplicateMigrationNameError < ::ActiveRecord::MigrationError + # @return [DuplicateMigrationNameError] a new instance of DuplicateMigrationNameError + # + # source://activerecord//lib/active_record/migration.rb#102 + def initialize(name = T.unsafe(nil)); end +end + +# source://activerecord//lib/active_record/migration.rb#91 +class ActiveRecord::DuplicateMigrationVersionError < ::ActiveRecord::MigrationError + # @return [DuplicateMigrationVersionError] a new instance of DuplicateMigrationVersionError + # + # source://activerecord//lib/active_record/migration.rb#92 + def initialize(version = T.unsafe(nil)); end +end + +# source://activerecord//lib/active_record/dynamic_matchers.rb#4 +module ActiveRecord::DynamicMatchers + private + + # source://activerecord//lib/active_record/dynamic_matchers.rb#17 + def method_missing(name, *_arg1, **_arg2, &_arg3); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/dynamic_matchers.rb#6 + def respond_to_missing?(name, _); end +end + +# source://activerecord//lib/active_record/dynamic_matchers.rb#74 +class ActiveRecord::DynamicMatchers::FindBy < ::ActiveRecord::DynamicMatchers::Method + class << self + # source://activerecord//lib/active_record/dynamic_matchers.rb#84 + def finder; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/dynamic_matchers.rb#80 + def match?(name); end + + # Returns the value of attribute pattern. + # + # source://activerecord//lib/active_record/dynamic_matchers.rb#78 + def pattern; end + end +end + +# source://activerecord//lib/active_record/dynamic_matchers.rb#90 +class ActiveRecord::DynamicMatchers::FindByBang < ::ActiveRecord::DynamicMatchers::Method + class << self + # source://activerecord//lib/active_record/dynamic_matchers.rb#100 + def finder; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/dynamic_matchers.rb#96 + def match?(name); end + + # Returns the value of attribute pattern. + # + # source://activerecord//lib/active_record/dynamic_matchers.rb#94 + def pattern; end + end +end + +# source://activerecord//lib/active_record/dynamic_matchers.rb#28 +class ActiveRecord::DynamicMatchers::Method + class << self + # source://activerecord//lib/active_record/dynamic_matchers.rb#38 + def define(model, name); end + + # source://activerecord//lib/active_record/dynamic_matchers.rb#30 + def match(name); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/dynamic_matchers.rb#34 + def valid?(model, name); end + + private + + # source://activerecord//lib/active_record/dynamic_matchers.rb#51 + def attribute_names(model, name); end + + # Given that the parameters starts with `_`, the finder needs to use the + # same parameter name. + # + # source://activerecord//lib/active_record/dynamic_matchers.rb#68 + def attributes_hash(model, method_name); end + + # source://activerecord//lib/active_record/dynamic_matchers.rb#56 + def body(model, method_name); end + + # source://activerecord//lib/active_record/dynamic_matchers.rb#47 + def make_pattern(prefix, suffix); end + + # The parameters in the signature may have reserved Ruby words, in order + # to prevent errors, we start each param name with `_`. + # + # source://activerecord//lib/active_record/dynamic_matchers.rb#62 + def signature(model, method_name); end + end +end + +# This error is raised when trying to eager load a polymorphic association using a JOIN. +# Eager loading polymorphic associations is only possible with +# {ActiveRecord::Relation#preload}[rdoc-ref:QueryMethods#preload]. +# +# source://activerecord//lib/active_record/associations/errors.rb#243 +class ActiveRecord::EagerLoadPolymorphicError < ::ActiveRecord::ActiveRecordError + # @return [EagerLoadPolymorphicError] a new instance of EagerLoadPolymorphicError + # + # source://activerecord//lib/active_record/associations/errors.rb#244 + def initialize(reflection = T.unsafe(nil)); end +end + +# source://activerecord//lib/active_record/encryption.rb#7 +module ActiveRecord::Encryption + include ::ActiveRecord::Encryption::Configurable + include ::ActiveRecord::Encryption::Contexts + extend ::ActiveSupport::Autoload + extend ::ActiveRecord::Encryption::Configurable::ClassMethods + extend ::ActiveRecord::Encryption::Contexts::ClassMethods + + # source://activerecord//lib/active_record/encryption.rb#47 + def config; end + + # source://activerecord//lib/active_record/encryption.rb#48 + def custom_contexts; end + + # source://activerecord//lib/active_record/encryption.rb#48 + def custom_contexts=(obj); end + + # source://activerecord//lib/active_record/encryption.rb#48 + def default_context; end + + # source://activerecord//lib/active_record/encryption.rb#48 + def default_context=(val); end + + # source://activerecord//lib/active_record/encryption.rb#47 + def encrypted_attribute_declaration_listeners; end + + # source://activerecord//lib/active_record/encryption.rb#47 + def encrypted_attribute_declaration_listeners=(val); end + + class << self + # source://activerecord//lib/active_record/encryption.rb#47 + def config; end + + # source://activerecord//lib/active_record/encryption.rb#48 + def custom_contexts; end + + # source://activerecord//lib/active_record/encryption.rb#48 + def custom_contexts=(obj); end + + # source://activerecord//lib/active_record/encryption.rb#48 + def default_context; end + + # source://activerecord//lib/active_record/encryption.rb#48 + def default_context=(val); end + + # source://activerecord//lib/active_record/encryption.rb#50 + def eager_load!; end + + # source://activerecord//lib/active_record/encryption.rb#47 + def encrypted_attribute_declaration_listeners; end + + # source://activerecord//lib/active_record/encryption.rb#47 + def encrypted_attribute_declaration_listeners=(val); end + end +end + +# source://activerecord//lib/active_record/encryption/auto_filtered_parameters.rb#5 +class ActiveRecord::Encryption::AutoFilteredParameters + # @return [AutoFilteredParameters] a new instance of AutoFilteredParameters + # + # source://activerecord//lib/active_record/encryption/auto_filtered_parameters.rb#6 + def initialize(app); end + + # source://activerecord//lib/active_record/encryption/auto_filtered_parameters.rb#14 + def enable; end + + private + + # Returns the value of attribute app. + # + # source://activerecord//lib/active_record/encryption/auto_filtered_parameters.rb#20 + def app; end + + # source://activerecord//lib/active_record/encryption/auto_filtered_parameters.rb#36 + def apply_collected_attributes; end + + # source://activerecord//lib/active_record/encryption/auto_filtered_parameters.rb#53 + def apply_filter(klass, attribute); end + + # source://activerecord//lib/active_record/encryption/auto_filtered_parameters.rb#28 + def attribute_was_declared(klass, attribute); end + + # source://activerecord//lib/active_record/encryption/auto_filtered_parameters.rb#48 + def collect_for_later(klass, attribute); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/encryption/auto_filtered_parameters.rb#44 + def collecting?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/encryption/auto_filtered_parameters.rb#61 + def excluded_from_filter_parameters?(filter_parameter); end + + # source://activerecord//lib/active_record/encryption/auto_filtered_parameters.rb#22 + def install_collecting_hook; end +end + +# The algorithm used for encrypting and decrypting +Message+ objects. +# +# It uses AES-256-GCM. It will generate a random IV for non deterministic encryption (default) +# or derive an initialization vector from the encrypted content for deterministic encryption. +# +# See +Cipher::Aes256Gcm+. +# +# source://activerecord//lib/active_record/encryption/cipher.rb#11 +class ActiveRecord::Encryption::Cipher + extend ::ActiveSupport::Autoload + + # Decrypt the provided +Message+. + # + # When +key+ is an Array, it will try all the keys raising a + # +ActiveRecord::Encryption::Errors::Decryption+ if none works. + # + # source://activerecord//lib/active_record/encryption/cipher.rb#25 + def decrypt(encrypted_message, key:); end + + # Encrypts the provided text and return an encrypted +Message+. + # + # source://activerecord//lib/active_record/encryption/cipher.rb#15 + def encrypt(clean_text, key:, deterministic: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/encryption/cipher.rb#35 + def iv_length; end + + # source://activerecord//lib/active_record/encryption/cipher.rb#31 + def key_length; end + + private + + # source://activerecord//lib/active_record/encryption/cipher.rb#48 + def cipher_for(secret, deterministic: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/encryption/cipher.rb#40 + def try_to_decrypt_with_each(encrypted_text, keys:); end +end + +# A 256-GCM cipher. +# +# By default it will use random initialization vectors. For deterministic encryption, it will use a SHA-256 hash of +# the text to encrypt and the secret. +# +# See +Encryptor+ +# +# source://activerecord//lib/active_record/encryption/cipher/aes256_gcm.rb#14 +class ActiveRecord::Encryption::Cipher::Aes256Gcm + # When iv not provided, it will generate a random iv on each encryption operation (default and + # recommended operation) + # + # @return [Aes256Gcm] a new instance of Aes256Gcm + # + # source://activerecord//lib/active_record/encryption/cipher/aes256_gcm.rb#29 + def initialize(secret, deterministic: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/encryption/cipher/aes256_gcm.rb#55 + def decrypt(encrypted_message); end + + # source://activerecord//lib/active_record/encryption/cipher/aes256_gcm.rb#34 + def encrypt(clear_text); end + + # source://activerecord//lib/active_record/encryption/cipher/aes256_gcm.rb#82 + def inspect; end + + private + + # source://activerecord//lib/active_record/encryption/cipher/aes256_gcm.rb#95 + def generate_deterministic_iv(clear_text); end + + # source://activerecord//lib/active_record/encryption/cipher/aes256_gcm.rb#87 + def generate_iv(cipher, clear_text); end + + class << self + # source://activerecord//lib/active_record/encryption/cipher/aes256_gcm.rb#22 + def iv_length; end + + # source://activerecord//lib/active_record/encryption/cipher/aes256_gcm.rb#18 + def key_length; end + end +end + +# source://activerecord//lib/active_record/encryption/cipher/aes256_gcm.rb#15 +ActiveRecord::Encryption::Cipher::Aes256Gcm::CIPHER_TYPE = T.let(T.unsafe(nil), String) + +# source://activerecord//lib/active_record/encryption/cipher.rb#12 +ActiveRecord::Encryption::Cipher::DEFAULT_ENCODING = T.let(T.unsafe(nil), Encoding) + +# Container of configuration options +# +# source://activerecord//lib/active_record/encryption/config.rb#8 +class ActiveRecord::Encryption::Config + # @return [Config] a new instance of Config + # + # source://activerecord//lib/active_record/encryption/config.rb#14 + def initialize; end + + # Returns the value of attribute add_to_filter_parameters. + # + # source://activerecord//lib/active_record/encryption/config.rb#9 + def add_to_filter_parameters; end + + # Sets the attribute add_to_filter_parameters + # + # @param value the value to set the attribute add_to_filter_parameters to. + # + # source://activerecord//lib/active_record/encryption/config.rb#9 + def add_to_filter_parameters=(_arg0); end + + # Returns the value of attribute compressor. + # + # source://activerecord//lib/active_record/encryption/config.rb#9 + def compressor; end + + # Sets the attribute compressor + # + # @param value the value to set the attribute compressor to. + # + # source://activerecord//lib/active_record/encryption/config.rb#9 + def compressor=(_arg0); end + + # Returns the value of attribute deterministic_key. + # + # source://activerecord//lib/active_record/encryption/config.rb#9 + def deterministic_key; end + + # Sets the attribute deterministic_key + # + # @param value the value to set the attribute deterministic_key to. + # + # source://activerecord//lib/active_record/encryption/config.rb#9 + def deterministic_key=(_arg0); end + + # Returns the value of attribute encrypt_fixtures. + # + # source://activerecord//lib/active_record/encryption/config.rb#9 + def encrypt_fixtures; end + + # Sets the attribute encrypt_fixtures + # + # @param value the value to set the attribute encrypt_fixtures to. + # + # source://activerecord//lib/active_record/encryption/config.rb#9 + def encrypt_fixtures=(_arg0); end + + # Returns the value of attribute excluded_from_filter_parameters. + # + # source://activerecord//lib/active_record/encryption/config.rb#9 + def excluded_from_filter_parameters; end + + # Sets the attribute excluded_from_filter_parameters + # + # @param value the value to set the attribute excluded_from_filter_parameters to. + # + # source://activerecord//lib/active_record/encryption/config.rb#9 + def excluded_from_filter_parameters=(_arg0); end + + # Returns the value of attribute extend_queries. + # + # source://activerecord//lib/active_record/encryption/config.rb#9 + def extend_queries; end + + # Sets the attribute extend_queries + # + # @param value the value to set the attribute extend_queries to. + # + # source://activerecord//lib/active_record/encryption/config.rb#9 + def extend_queries=(_arg0); end + + # Returns the value of attribute forced_encoding_for_deterministic_encryption. + # + # source://activerecord//lib/active_record/encryption/config.rb#9 + def forced_encoding_for_deterministic_encryption; end + + # Sets the attribute forced_encoding_for_deterministic_encryption + # + # @param value the value to set the attribute forced_encoding_for_deterministic_encryption to. + # + # source://activerecord//lib/active_record/encryption/config.rb#9 + def forced_encoding_for_deterministic_encryption=(_arg0); end + + # source://activerecord//lib/active_record/encryption/config.rb#37 + def has_deterministic_key?; end + + # source://activerecord//lib/active_record/encryption/config.rb#37 + def has_key_derivation_salt?; end + + # source://activerecord//lib/active_record/encryption/config.rb#37 + def has_primary_key?; end + + # Returns the value of attribute hash_digest_class. + # + # source://activerecord//lib/active_record/encryption/config.rb#9 + def hash_digest_class; end + + # Sets the attribute hash_digest_class + # + # @param value the value to set the attribute hash_digest_class to. + # + # source://activerecord//lib/active_record/encryption/config.rb#9 + def hash_digest_class=(_arg0); end + + # Returns the value of attribute key_derivation_salt. + # + # source://activerecord//lib/active_record/encryption/config.rb#9 + def key_derivation_salt; end + + # Sets the attribute key_derivation_salt + # + # @param value the value to set the attribute key_derivation_salt to. + # + # source://activerecord//lib/active_record/encryption/config.rb#9 + def key_derivation_salt=(_arg0); end + + # Configure previous encryption schemes. + # + # config.active_record.encryption.previous = [ { key_provider: MyOldKeyProvider.new } ] + # + # source://activerecord//lib/active_record/encryption/config.rb#21 + def previous=(previous_schemes_properties); end + + # Returns the value of attribute previous_schemes. + # + # source://activerecord//lib/active_record/encryption/config.rb#9 + def previous_schemes; end + + # Sets the attribute previous_schemes + # + # @param value the value to set the attribute previous_schemes to. + # + # source://activerecord//lib/active_record/encryption/config.rb#9 + def previous_schemes=(_arg0); end + + # Returns the value of attribute primary_key. + # + # source://activerecord//lib/active_record/encryption/config.rb#9 + def primary_key; end + + # Sets the attribute primary_key + # + # @param value the value to set the attribute primary_key to. + # + # source://activerecord//lib/active_record/encryption/config.rb#9 + def primary_key=(_arg0); end + + # Returns the value of attribute store_key_references. + # + # source://activerecord//lib/active_record/encryption/config.rb#9 + def store_key_references; end + + # Sets the attribute store_key_references + # + # @param value the value to set the attribute store_key_references to. + # + # source://activerecord//lib/active_record/encryption/config.rb#9 + def store_key_references=(_arg0); end + + # source://activerecord//lib/active_record/encryption/config.rb#27 + def support_sha1_for_non_deterministic_encryption=(value); end + + # Returns the value of attribute support_unencrypted_data. + # + # source://activerecord//lib/active_record/encryption/config.rb#9 + def support_unencrypted_data; end + + # Sets the attribute support_unencrypted_data + # + # @param value the value to set the attribute support_unencrypted_data to. + # + # source://activerecord//lib/active_record/encryption/config.rb#9 + def support_unencrypted_data=(_arg0); end + + # Returns the value of attribute validate_column_size. + # + # source://activerecord//lib/active_record/encryption/config.rb#9 + def validate_column_size; end + + # Sets the attribute validate_column_size + # + # @param value the value to set the attribute validate_column_size to. + # + # source://activerecord//lib/active_record/encryption/config.rb#9 + def validate_column_size=(_arg0); end + + private + + # source://activerecord//lib/active_record/encryption/config.rb#65 + def add_previous_scheme(**properties); end + + # source://activerecord//lib/active_record/encryption/config.rb#49 + def set_defaults; end +end + +# Configuration API for ActiveRecord::Encryption +# +# source://activerecord//lib/active_record/encryption/configurable.rb#6 +module ActiveRecord::Encryption::Configurable + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::Encryption::Configurable::ClassMethods +end + +# source://activerecord//lib/active_record/encryption/configurable.rb#14 +module ActiveRecord::Encryption::Configurable::ClassMethods + # source://activerecord//lib/active_record/encryption/configurable.rb#17 + def cipher(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/encryption/configurable.rb#20 + def configure(primary_key: T.unsafe(nil), deterministic_key: T.unsafe(nil), key_derivation_salt: T.unsafe(nil), **properties); end + + # source://activerecord//lib/active_record/encryption/configurable.rb#52 + def encrypted_attribute_was_declared(klass, name); end + + # source://activerecord//lib/active_record/encryption/configurable.rb#17 + def encryptor(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/encryption/configurable.rb#17 + def frozen_encryption(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/encryption/configurable.rb#17 + def key_generator(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/encryption/configurable.rb#17 + def key_provider(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/encryption/configurable.rb#17 + def message_serializer(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/encryption/configurable.rb#47 + def on_encrypted_attribute_declared(&block); end +end + +# An encryption context configures the different entities used to perform encryption: +# +# * A key provider +# * A key generator +# * An encryptor, the facade to encrypt data +# * A cipher, the encryption algorithm +# * A message serializer +# +# source://activerecord//lib/active_record/encryption/context.rb#12 +class ActiveRecord::Encryption::Context + # @return [Context] a new instance of Context + # + # source://activerecord//lib/active_record/encryption/context.rb#17 + def initialize; end + + # source://activerecord//lib/active_record/encryption/context.rb#15 + def cipher; end + + # source://activerecord//lib/active_record/encryption/context.rb#15 + def cipher=(_arg0); end + + # source://activerecord//lib/active_record/encryption/context.rb#15 + def encryptor; end + + # source://activerecord//lib/active_record/encryption/context.rb#15 + def encryptor=(_arg0); end + + # source://activerecord//lib/active_record/encryption/context.rb#15 + def frozen_encryption; end + + # source://activerecord//lib/active_record/encryption/context.rb#15 + def frozen_encryption=(_arg0); end + + # source://activerecord//lib/active_record/encryption/context.rb#21 + def frozen_encryption?; end + + # source://activerecord//lib/active_record/encryption/context.rb#15 + def key_generator; end + + # source://activerecord//lib/active_record/encryption/context.rb#15 + def key_generator=(_arg0); end + + # source://activerecord//lib/active_record/encryption/context.rb#15 + def key_provider; end + + # source://activerecord//lib/active_record/encryption/context.rb#15 + def key_provider=(_arg0); end + + # source://activerecord//lib/active_record/encryption/context.rb#15 + def message_serializer; end + + # source://activerecord//lib/active_record/encryption/context.rb#15 + def message_serializer=(_arg0); end + + private + + # source://activerecord//lib/active_record/encryption/context.rb#37 + def build_default_key_provider; end + + # source://activerecord//lib/active_record/encryption/context.rb#29 + def set_defaults; end +end + +# source://activerecord//lib/active_record/encryption/context.rb#13 +ActiveRecord::Encryption::Context::PROPERTIES = T.let(T.unsafe(nil), Array) + +# ActiveRecord::Encryption uses encryption contexts to configure the different entities used to +# encrypt/decrypt at a given moment in time. +# +# By default, the library uses a default encryption context. This is the Context that gets configured +# initially via +config.active_record.encryption+ options. Library users can define nested encryption contexts +# when running blocks of code. +# +# See Context. +# +# source://activerecord//lib/active_record/encryption/contexts.rb#13 +module ActiveRecord::Encryption::Contexts + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::Encryption::Contexts::ClassMethods +end + +# source://activerecord//lib/active_record/encryption/contexts.rb#21 +module ActiveRecord::Encryption::Contexts::ClassMethods + # source://activerecord//lib/active_record/encryption/contexts.rb#62 + def context; end + + # source://activerecord//lib/active_record/encryption/contexts.rb#66 + def current_custom_context; end + + # source://activerecord//lib/active_record/encryption/contexts.rb#57 + def protecting_encrypted_data(&block); end + + # source://activerecord//lib/active_record/encryption/contexts.rb#70 + def reset_default_context; end + + # source://activerecord//lib/active_record/encryption/contexts.rb#33 + def with_encryption_context(properties); end + + # source://activerecord//lib/active_record/encryption/contexts.rb#49 + def without_encryption(&block); end +end + +# A KeyProvider that derives keys from passwords. +# +# source://activerecord//lib/active_record/encryption/derived_secret_key_provider.rb#6 +class ActiveRecord::Encryption::DerivedSecretKeyProvider < ::ActiveRecord::Encryption::KeyProvider + # @return [DerivedSecretKeyProvider] a new instance of DerivedSecretKeyProvider + # + # source://activerecord//lib/active_record/encryption/derived_secret_key_provider.rb#7 + def initialize(passwords, key_generator: T.unsafe(nil)); end + + private + + # source://activerecord//lib/active_record/encryption/derived_secret_key_provider.rb#12 + def derive_key_from(password, using: T.unsafe(nil)); end +end + +# A KeyProvider that derives keys from passwords. +# +# source://activerecord//lib/active_record/encryption/deterministic_key_provider.rb#6 +class ActiveRecord::Encryption::DeterministicKeyProvider < ::ActiveRecord::Encryption::DerivedSecretKeyProvider + # @raise [ActiveRecord::Encryption::Errors::Configuration] + # @return [DeterministicKeyProvider] a new instance of DeterministicKeyProvider + # + # source://activerecord//lib/active_record/encryption/deterministic_key_provider.rb#7 + def initialize(password); end +end + +# This is the concern mixed in Active Record models to make them encryptable. It adds the +encrypts+ +# attribute declaration, as well as the API to encrypt and decrypt records. +# +# source://activerecord//lib/active_record/encryption/encryptable_record.rb#7 +module ActiveRecord::Encryption::EncryptableRecord + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveRecord::Encryption::EncryptableRecord::ClassMethods + + # Returns the ciphertext for +attribute_name+. + # + # source://activerecord//lib/active_record/encryption/encryptable_record.rb#157 + def ciphertext_for(attribute_name); end + + # Decrypts all the encryptable attributes and saves the changes. + # + # source://activerecord//lib/active_record/encryption/encryptable_record.rb#171 + def decrypt; end + + # Encrypts all the encryptable attributes and saves the changes. + # + # source://activerecord//lib/active_record/encryption/encryptable_record.rb#166 + def encrypt; end + + # Returns whether a given attribute is encrypted or not. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/encryption/encryptable_record.rb#146 + def encrypted_attribute?(attribute_name); end + + private + + # source://activerecord//lib/active_record/encryption/encryptable_record.rb#178 + def _create_record(attribute_names = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/encryption/encryptable_record.rb#214 + def build_decrypt_attribute_assignments; end + + # source://activerecord//lib/active_record/encryption/encryptable_record.rb#208 + def build_encrypt_attribute_assignments; end + + # source://activerecord//lib/active_record/encryption/encryptable_record.rb#223 + def cant_modify_encrypted_attributes_when_frozen; end + + # source://activerecord//lib/active_record/encryption/encryptable_record.rb#193 + def decrypt_attributes; end + + # source://activerecord//lib/active_record/encryption/encryptable_record.rb#187 + def encrypt_attributes; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/encryption/encryptable_record.rb#204 + def has_encrypted_attributes?; end + + # @raise [ActiveRecord::Encryption::Errors::Configuration] + # + # source://activerecord//lib/active_record/encryption/encryptable_record.rb#200 + def validate_encryption_allowed; end + + module GeneratedClassMethods + def encrypted_attributes; end + def encrypted_attributes=(value); end + def encrypted_attributes?; end + end + + module GeneratedInstanceMethods + def encrypted_attributes; end + def encrypted_attributes=(value); end + def encrypted_attributes?; end + end +end + +# source://activerecord//lib/active_record/encryption/encryptable_record.rb#16 +module ActiveRecord::Encryption::EncryptableRecord::ClassMethods + # source://activerecord//lib/active_record/encryption/encryptable_record.rb#58 + def deterministic_encrypted_attributes; end + + # source://activerecord//lib/active_record/encryption/encryptable_record.rb#49 + def encrypts(*names, key_provider: T.unsafe(nil), key: T.unsafe(nil), deterministic: T.unsafe(nil), support_unencrypted_data: T.unsafe(nil), downcase: T.unsafe(nil), ignore_case: T.unsafe(nil), previous: T.unsafe(nil), compress: T.unsafe(nil), compressor: T.unsafe(nil), **context_properties); end + + # source://activerecord//lib/active_record/encryption/encryptable_record.rb#65 + def source_attribute_from_preserved_attribute(attribute_name); end + + private + + # source://activerecord//lib/active_record/encryption/encryptable_record.rb#132 + def add_length_validation_for_encrypted_columns; end + + # source://activerecord//lib/active_record/encryption/encryptable_record.rb#84 + def encrypt_attribute(name, key_provider: T.unsafe(nil), key: T.unsafe(nil), deterministic: T.unsafe(nil), support_unencrypted_data: T.unsafe(nil), downcase: T.unsafe(nil), ignore_case: T.unsafe(nil), previous: T.unsafe(nil), compress: T.unsafe(nil), compressor: T.unsafe(nil), **context_properties); end + + # source://activerecord//lib/active_record/encryption/encryptable_record.rb#78 + def global_previous_schemes_for(scheme); end + + # source://activerecord//lib/active_record/encryption/encryptable_record.rb#126 + def load_schema!; end + + # source://activerecord//lib/active_record/encryption/encryptable_record.rb#109 + def override_accessors_to_preserve_original(name, original_attribute_name); end + + # source://activerecord//lib/active_record/encryption/encryptable_record.rb#98 + def preserve_original_encrypted(name); end + + # source://activerecord//lib/active_record/encryption/encryptable_record.rb#70 + def scheme_for(key_provider: T.unsafe(nil), key: T.unsafe(nil), deterministic: T.unsafe(nil), support_unencrypted_data: T.unsafe(nil), downcase: T.unsafe(nil), ignore_case: T.unsafe(nil), previous: T.unsafe(nil), **context_properties); end + + # source://activerecord//lib/active_record/encryption/encryptable_record.rb#138 + def validate_column_size(attribute_name); end +end + +# source://activerecord//lib/active_record/encryption/encryptable_record.rb#176 +ActiveRecord::Encryption::EncryptableRecord::ORIGINAL_ATTRIBUTE_PREFIX = T.let(T.unsafe(nil), String) + +# An ActiveModel::Type::Value that encrypts/decrypts strings of text. +# +# This is the central piece that connects the encryption system with +encrypts+ declarations in the +# model classes. Whenever you declare an attribute as encrypted, it configures an +EncryptedAttributeType+ +# for that attribute. +# +# source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#10 +class ActiveRecord::Encryption::EncryptedAttributeType < ::ActiveModel::Type::Value + include ::ActiveModel::Type::Helpers::Mutable + + # ==== Options + # + # * :scheme - A +Scheme+ with the encryption properties for this attribute. + # * :cast_type - A type that will be used to serialize (before encrypting) and deserialize + # (after decrypting). ActiveModel::Type::String by default. + # + # @return [EncryptedAttributeType] a new instance of EncryptedAttributeType + # + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#23 + def initialize(scheme:, cast_type: T.unsafe(nil), previous_type: T.unsafe(nil), default: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#16 + def accessor(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#31 + def cast(value); end + + # Returns the value of attribute cast_type. + # + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#13 + def cast_type; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#51 + def changed_in_place?(raw_old_value, new_value); end + + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#35 + def deserialize(value); end + + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#15 + def deterministic?(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#15 + def downcase?(*_arg0, **_arg1, &_arg2); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#47 + def encrypted?(value); end + + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#15 + def fixed?(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#15 + def key_provider(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#15 + def previous_schemes(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#56 + def previous_types; end + + # Returns the value of attribute scheme. + # + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#13 + def scheme; end + + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#39 + def serialize(value); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#61 + def support_unencrypted_data?; end + + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#16 + def type(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#15 + def with_context(*_arg0, **_arg1, &_arg2); end + + private + + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#74 + def build_previous_types_for(schemes); end + + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#162 + def clean_text_scheme; end + + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#174 + def database_type_to_text(value); end + + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#102 + def decrypt(value); end + + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#84 + def decrypt_as_text(value); end + + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#158 + def decryption_options; end + + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#146 + def encrypt(value); end + + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#136 + def encrypt_as_text(value); end + + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#154 + def encryption_options; end + + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#150 + def encryptor; end + + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#114 + def handle_deserialize_error(error, value); end + + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#66 + def previous_schemes_including_clean_text; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#80 + def previous_type?; end + + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#70 + def previous_types_without_clean_text; end + + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#130 + def serialize_with_current(value); end + + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#126 + def serialize_with_oldest(value); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#122 + def serialize_with_oldest?; end + + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#166 + def text_to_database_type(value); end + + # source://activerecord//lib/active_record/encryption/encrypted_attribute_type.rb#106 + def try_to_deserialize_with_previous_encrypted_types(value); end +end + +# source://activerecord//lib/active_record/encryption/encrypted_fixtures.rb#5 +module ActiveRecord::Encryption::EncryptedFixtures + # source://activerecord//lib/active_record/encryption/encrypted_fixtures.rb#6 + def initialize(fixture, model_class); end + + private + + # source://activerecord//lib/active_record/encryption/encrypted_fixtures.rb#14 + def encrypt_fixture_data(fixture, model_class); end + + # source://activerecord//lib/active_record/encryption/encrypted_fixtures.rb#26 + def process_preserved_original_columns(fixture, model_class); end +end + +# An encryptor that can encrypt data but can't decrypt it. +# +# source://activerecord//lib/active_record/encryption/encrypting_only_encryptor.rb#6 +class ActiveRecord::Encryption::EncryptingOnlyEncryptor < ::ActiveRecord::Encryption::Encryptor + # source://activerecord//lib/active_record/encryption/encrypting_only_encryptor.rb#7 + def decrypt(encrypted_text, key_provider: T.unsafe(nil), cipher_options: T.unsafe(nil)); end +end + +# An encryptor exposes the encryption API that ActiveRecord::Encryption::EncryptedAttributeType +# uses for encrypting and decrypting attribute values. +# +# It interacts with a KeyProvider for getting the keys, and delegate to +# ActiveRecord::Encryption::Cipher the actual encryption algorithm. +# +# source://activerecord//lib/active_record/encryption/encryptor.rb#13 +class ActiveRecord::Encryption::Encryptor + # ==== Options + # + # [+:compress+] + # Boolean indicating whether records should be compressed before + # encryption. Defaults to +true+. + # + # [+:compressor+] + # The compressor to use. It must respond to +deflate+ and +inflate+. + # If not provided, will default to +ActiveRecord::Encryption.config.compressor+, + # which itself defaults to +Zlib+. + # + # @return [Encryptor] a new instance of Encryptor + # + # source://activerecord//lib/active_record/encryption/encryptor.rb#27 + def initialize(compress: T.unsafe(nil), compressor: T.unsafe(nil)); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/encryption/encryptor.rb#86 + def binary?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/encryption/encryptor.rb#90 + def compress?; end + + # The compressor to use for compressing the payload. + # + # source://activerecord//lib/active_record/encryption/encryptor.rb#15 + def compressor; end + + # Decrypts an +encrypted_text+ and returns the result as clean text. + # + # ==== Options + # + # [+:key_provider+] + # Key provider to use for the encryption operation. It will default to + # +ActiveRecord::Encryption.key_provider+ when not provided. + # + # [+:cipher_options+] + # Cipher-specific options that will be passed to the Cipher configured in + # +ActiveRecord::Encryption.cipher+. + # + # source://activerecord//lib/active_record/encryption/encryptor.rb#69 + def decrypt(encrypted_text, key_provider: T.unsafe(nil), cipher_options: T.unsafe(nil)); end + + # Encrypts +clean_text+ and returns the encrypted result. + # + # Internally, it will: + # + # 1. Create a new ActiveRecord::Encryption::Message. + # 2. Compress and encrypt +clean_text+ as the message payload. + # 3. Serialize it with +ActiveRecord::Encryption.message_serializer+ + # (+ActiveRecord::Encryption::SafeMarshal+ by default). + # 4. Encode the result with Base64. + # + # ==== Options + # + # [+:key_provider+] + # Key provider to use for the encryption operation. It will default to + # +ActiveRecord::Encryption.key_provider+ when not provided. + # + # [+:cipher_options+] + # Cipher-specific options that will be passed to the Cipher configured in + # +ActiveRecord::Encryption.cipher+. + # + # source://activerecord//lib/active_record/encryption/encryptor.rb#51 + def encrypt(clear_text, key_provider: T.unsafe(nil), cipher_options: T.unsafe(nil)); end + + # Returns whether the text is encrypted or not. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/encryption/encryptor.rb#79 + def encrypted?(text); end + + private + + # source://activerecord//lib/active_record/encryption/encryptor.rb#125 + def build_encrypted_message(clear_text, key_provider:, cipher_options:); end + + # source://activerecord//lib/active_record/encryption/encryptor.rb#121 + def cipher; end + + # source://activerecord//lib/active_record/encryption/encryptor.rb#158 + def compress(data); end + + # Under certain threshold, ZIP compression is actually worse that not compressing + # + # source://activerecord//lib/active_record/encryption/encryptor.rb#150 + def compress_if_worth_it(string); end + + # source://activerecord//lib/active_record/encryption/encryptor.rb#111 + def default_key_provider; end + + # source://activerecord//lib/active_record/encryption/encryptor.rb#139 + def deserialize_message(message); end + + # source://activerecord//lib/active_record/encryption/encryptor.rb#178 + def force_encoding_if_needed(value); end + + # source://activerecord//lib/active_record/encryption/encryptor.rb#186 + def forced_encoding_for_deterministic_encryption; end + + # source://activerecord//lib/active_record/encryption/encryptor.rb#135 + def serialize_message(message); end + + # source://activerecord//lib/active_record/encryption/encryptor.rb#145 + def serializer; end + + # source://activerecord//lib/active_record/encryption/encryptor.rb#172 + def uncompress(data); end + + # source://activerecord//lib/active_record/encryption/encryptor.rb#164 + def uncompress_if_needed(data, compressed); end + + # source://activerecord//lib/active_record/encryption/encryptor.rb#115 + def validate_payload_type(clear_text); end +end + +# source://activerecord//lib/active_record/encryption/encryptor.rb#95 +ActiveRecord::Encryption::Encryptor::DECRYPT_ERRORS = T.let(T.unsafe(nil), Array) + +# source://activerecord//lib/active_record/encryption/encryptor.rb#96 +ActiveRecord::Encryption::Encryptor::ENCODING_ERRORS = T.let(T.unsafe(nil), Array) + +# This threshold cannot be changed. +# +# Users can search for attributes encrypted with `deterministic: true`. +# That is possible because we are able to generate the message for the +# given clear text deterministically, and with that perform a regular +# string lookup in SQL. +# +# Problem is, messages may have a "c" header that is present or not +# depending on whether compression was applied on encryption. If this +# threshold was modified, the message generated for lookup could vary +# for the same clear text, and searches on exisiting data could fail. +# +# source://activerecord//lib/active_record/encryption/encryptor.rb#109 +ActiveRecord::Encryption::Encryptor::THRESHOLD_TO_JUSTIFY_COMPRESSION = T.let(T.unsafe(nil), Integer) + +# Implements a simple envelope encryption approach where: +# +# * It generates a random data-encryption key for each encryption operation. +# * It stores the generated key along with the encrypted payload. It encrypts this key +# with the master key provided in the +active_record_encryption.primary_key+ credential. +# +# This provider can work with multiple master keys. It will use the last one for encrypting. +# +# When +config.active_record.encryption.store_key_references+ is true, it will also store a reference to +# the specific master key that was used to encrypt the data-encryption key. When not set, +# it will try all the configured master keys looking for the right one, in order to +# return the right decryption key. +# +# source://activerecord//lib/active_record/encryption/envelope_encryption_key_provider.rb#17 +class ActiveRecord::Encryption::EnvelopeEncryptionKeyProvider + # source://activerecord//lib/active_record/encryption/envelope_encryption_key_provider.rb#31 + def active_primary_key; end + + # source://activerecord//lib/active_record/encryption/envelope_encryption_key_provider.rb#26 + def decryption_keys(encrypted_message); end + + # source://activerecord//lib/active_record/encryption/envelope_encryption_key_provider.rb#18 + def encryption_key; end + + private + + # source://activerecord//lib/active_record/encryption/envelope_encryption_key_provider.rb#40 + def decrypt_data_key(encrypted_message); end + + # source://activerecord//lib/active_record/encryption/envelope_encryption_key_provider.rb#36 + def encrypt_data_key(random_secret); end + + # source://activerecord//lib/active_record/encryption/envelope_encryption_key_provider.rb#50 + def generate_random_secret; end + + # source://activerecord//lib/active_record/encryption/envelope_encryption_key_provider.rb#46 + def primary_key_provider; end +end + +# source://activerecord//lib/active_record/encryption/errors.rb#5 +module ActiveRecord::Encryption::Errors; end + +# source://activerecord//lib/active_record/encryption/errors.rb#6 +class ActiveRecord::Encryption::Errors::Base < ::StandardError; end + +# source://activerecord//lib/active_record/encryption/errors.rb#10 +class ActiveRecord::Encryption::Errors::Configuration < ::ActiveRecord::Encryption::Errors::Base; end + +# source://activerecord//lib/active_record/encryption/errors.rb#8 +class ActiveRecord::Encryption::Errors::Decryption < ::ActiveRecord::Encryption::Errors::Base; end + +# source://activerecord//lib/active_record/encryption/errors.rb#7 +class ActiveRecord::Encryption::Errors::Encoding < ::ActiveRecord::Encryption::Errors::Base; end + +# source://activerecord//lib/active_record/encryption/errors.rb#12 +class ActiveRecord::Encryption::Errors::EncryptedContentIntegrity < ::ActiveRecord::Encryption::Errors::Base; end + +# source://activerecord//lib/active_record/encryption/errors.rb#9 +class ActiveRecord::Encryption::Errors::Encryption < ::ActiveRecord::Encryption::Errors::Base; end + +# source://activerecord//lib/active_record/encryption/errors.rb#11 +class ActiveRecord::Encryption::Errors::ForbiddenClass < ::ActiveRecord::Encryption::Errors::Base; end + +# Automatically expand encrypted arguments to support querying both encrypted and unencrypted data +# +# Active Record \Encryption supports querying the db using deterministic attributes. For example: +# +# Contact.find_by(email_address: "jorge@hey.com") +# +# The value "jorge@hey.com" will get encrypted automatically to perform the query. But there is +# a problem while the data is being encrypted. This won't work. During that time, you need these +# queries to be: +# +# Contact.find_by(email_address: [ "jorge@hey.com", "" ]) +# +# This patches ActiveRecord to support this automatically. It addresses both: +# +# * ActiveRecord::Base - Used in Contact.find_by_email_address(...) +# * ActiveRecord::Relation - Used in Contact.internal.find_by_email_address(...) +# +# This module is included if `config.active_record.encryption.extend_queries` is `true`. +# +# source://activerecord//lib/active_record/encryption/extended_deterministic_queries.rb#23 +module ActiveRecord::Encryption::ExtendedDeterministicQueries + class << self + # source://activerecord//lib/active_record/encryption/extended_deterministic_queries.rb#24 + def install_support; end + end +end + +# source://activerecord//lib/active_record/encryption/extended_deterministic_queries.rb#134 +class ActiveRecord::Encryption::ExtendedDeterministicQueries::AdditionalValue + # @return [AdditionalValue] a new instance of AdditionalValue + # + # source://activerecord//lib/active_record/encryption/extended_deterministic_queries.rb#137 + def initialize(value, type); end + + # Returns the value of attribute type. + # + # source://activerecord//lib/active_record/encryption/extended_deterministic_queries.rb#135 + def type; end + + # Returns the value of attribute value. + # + # source://activerecord//lib/active_record/encryption/extended_deterministic_queries.rb#135 + def value; end + + private + + # source://activerecord//lib/active_record/encryption/extended_deterministic_queries.rb#143 + def process(value); end +end + +# source://activerecord//lib/active_record/encryption/extended_deterministic_queries.rb#124 +module ActiveRecord::Encryption::ExtendedDeterministicQueries::CoreQueries + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::Encryption::ExtendedDeterministicQueries::CoreQueries::ClassMethods +end + +# source://activerecord//lib/active_record/encryption/extended_deterministic_queries.rb#127 +module ActiveRecord::Encryption::ExtendedDeterministicQueries::CoreQueries::ClassMethods + # source://activerecord//lib/active_record/encryption/extended_deterministic_queries.rb#128 + def find_by(*args); end +end + +# When modifying this file run performance tests in +# +activerecord/test/cases/encryption/performance/extended_deterministic_queries_performance_test.rb+ +# to make sure performance overhead is acceptable. +# +# source://activerecord//lib/active_record/encryption/extended_deterministic_queries.rb#41 +module ActiveRecord::Encryption::ExtendedDeterministicQueries::EncryptedQuery + class << self + # source://activerecord//lib/active_record/encryption/extended_deterministic_queries.rb#43 + def process_arguments(owner, args, check_for_additional_values); end + + private + + # source://activerecord//lib/active_record/encryption/extended_deterministic_queries.rb#89 + def additional_values_for(value, type); end + + # source://activerecord//lib/active_record/encryption/extended_deterministic_queries.rb#71 + def process_encrypted_query_argument(value, check_for_additional_values, type); end + end +end + +# source://activerecord//lib/active_record/encryption/extended_deterministic_queries.rb#148 +module ActiveRecord::Encryption::ExtendedDeterministicQueries::ExtendedEncryptableType + # source://activerecord//lib/active_record/encryption/extended_deterministic_queries.rb#149 + def serialize(data); end +end + +# source://activerecord//lib/active_record/encryption/extended_deterministic_queries.rb#97 +module ActiveRecord::Encryption::ExtendedDeterministicQueries::RelationQueries + # @return [Boolean] + # + # source://activerecord//lib/active_record/encryption/extended_deterministic_queries.rb#102 + def exists?(*args); end + + # source://activerecord//lib/active_record/encryption/extended_deterministic_queries.rb#106 + def scope_for_create; end + + # source://activerecord//lib/active_record/encryption/extended_deterministic_queries.rb#98 + def where(*args); end +end + +# source://activerecord//lib/active_record/encryption/extended_deterministic_uniqueness_validator.rb#5 +module ActiveRecord::Encryption::ExtendedDeterministicUniquenessValidator + class << self + # source://activerecord//lib/active_record/encryption/extended_deterministic_uniqueness_validator.rb#6 + def install_support; end + end +end + +# source://activerecord//lib/active_record/encryption/extended_deterministic_uniqueness_validator.rb#10 +module ActiveRecord::Encryption::ExtendedDeterministicUniquenessValidator::EncryptedUniquenessValidator + # source://activerecord//lib/active_record/encryption/extended_deterministic_uniqueness_validator.rb#11 + def validate_each(record, attribute, value); end +end + +# A key is a container for a given +secret+ +# +# Optionally, it can include +public_tags+. These tags are meant to be stored +# in clean (public) and can be used, for example, to include information that +# references the key for a future retrieval operation. +# +# source://activerecord//lib/active_record/encryption/key.rb#10 +class ActiveRecord::Encryption::Key + # @return [Key] a new instance of Key + # + # source://activerecord//lib/active_record/encryption/key.rb#13 + def initialize(secret); end + + # source://activerecord//lib/active_record/encryption/key.rb#23 + def id; end + + # Returns the value of attribute public_tags. + # + # source://activerecord//lib/active_record/encryption/key.rb#11 + def public_tags; end + + # Returns the value of attribute secret. + # + # source://activerecord//lib/active_record/encryption/key.rb#11 + def secret; end + + class << self + # source://activerecord//lib/active_record/encryption/key.rb#18 + def derive_from(password); end + end +end + +# Utility for generating and deriving random keys. +# +# source://activerecord//lib/active_record/encryption/key_generator.rb#8 +class ActiveRecord::Encryption::KeyGenerator + # @return [KeyGenerator] a new instance of KeyGenerator + # + # source://activerecord//lib/active_record/encryption/key_generator.rb#11 + def initialize(hash_digest_class: T.unsafe(nil)); end + + # Derives a key from the given password. The key will have a size in bytes of +:length+ (configured +Cipher+'s length + # by default) + # + # The generated key will be salted with the value of +ActiveRecord::Encryption.key_derivation_salt+ + # + # source://activerecord//lib/active_record/encryption/key_generator.rb#38 + def derive_key_from(password, length: T.unsafe(nil)); end + + # Returns a random key in hexadecimal format. The key will have a size in bytes of +:length+ (configured +Cipher+'s + # length by default) + # + # Hexadecimal format is handy for representing keys as printable text. To maximize the space of characters used, it is + # good practice including not printable characters. Hexadecimal format ensures that generated keys are representable with + # plain text + # + # To convert back to the original string with the desired length: + # + # [ value ].pack("H*") + # + # source://activerecord//lib/active_record/encryption/key_generator.rb#30 + def generate_random_hex_key(length: T.unsafe(nil)); end + + # Returns a random key. The key will have a size in bytes of +:length+ (configured +Cipher+'s length by default) + # + # source://activerecord//lib/active_record/encryption/key_generator.rb#16 + def generate_random_key(length: T.unsafe(nil)); end + + # Returns the value of attribute hash_digest_class. + # + # source://activerecord//lib/active_record/encryption/key_generator.rb#9 + def hash_digest_class; end + + private + + # source://activerecord//lib/active_record/encryption/key_generator.rb#44 + def key_derivation_salt; end + + # source://activerecord//lib/active_record/encryption/key_generator.rb#48 + def key_length; end +end + +# A +KeyProvider+ serves keys: +# +# * An encryption key +# * A list of potential decryption keys. Serving multiple decryption keys supports rotation-schemes +# where new keys are added but old keys need to continue working +# +# source://activerecord//lib/active_record/encryption/key_provider.rb#10 +class ActiveRecord::Encryption::KeyProvider + # @return [KeyProvider] a new instance of KeyProvider + # + # source://activerecord//lib/active_record/encryption/key_provider.rb#11 + def initialize(keys); end + + # Returns the list of decryption keys + # + # When the message holds a reference to its encryption key, it will return an array + # with that key. If not, it will return the list of keys. + # + # source://activerecord//lib/active_record/encryption/key_provider.rb#32 + def decryption_keys(encrypted_message); end + + # Returns the last key in the list as the active key to perform encryptions + # + # When +ActiveRecord::Encryption.config.store_key_references+ is true, the key will include + # a public tag referencing the key itself. That key will be stored in the public + # headers of the encrypted message + # + # source://activerecord//lib/active_record/encryption/key_provider.rb#20 + def encryption_key; end + + private + + # source://activerecord//lib/active_record/encryption/key_provider.rb#41 + def keys_grouped_by_id; end +end + +# A message defines the structure of the data we store in encrypted attributes. It contains: +# +# * An encrypted payload +# * A list of unencrypted headers +# +# See Encryptor#encrypt +# +# source://activerecord//lib/active_record/encryption/message.rb#11 +class ActiveRecord::Encryption::Message + # @return [Message] a new instance of Message + # + # source://activerecord//lib/active_record/encryption/message.rb#14 + def initialize(payload: T.unsafe(nil), headers: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/encryption/message.rb#21 + def ==(other_message); end + + # Returns the value of attribute headers. + # + # source://activerecord//lib/active_record/encryption/message.rb#12 + def headers; end + + # Sets the attribute headers + # + # @param value the value to set the attribute headers to. + # + # source://activerecord//lib/active_record/encryption/message.rb#12 + def headers=(_arg0); end + + # Returns the value of attribute payload. + # + # source://activerecord//lib/active_record/encryption/message.rb#12 + def payload; end + + # Sets the attribute payload + # + # @param value the value to set the attribute payload to. + # + # source://activerecord//lib/active_record/encryption/message.rb#12 + def payload=(_arg0); end + + private + + # source://activerecord//lib/active_record/encryption/message.rb#26 + def validate_payload_type(payload); end +end + +# A message serializer that serializes +Messages+ with JSON. +# +# The generated structure is pretty simple: +# +# { +# p: , +# h: { +# header1: value1, +# header2: value2, +# ... +# } +# } +# +# Both the payload and the header values are encoded with Base64 +# to prevent JSON parsing errors and encoding issues when +# storing the resulting serialized data. +# +# source://activerecord//lib/active_record/encryption/message_serializer.rb#23 +class ActiveRecord::Encryption::MessageSerializer + # @return [Boolean] + # + # source://activerecord//lib/active_record/encryption/message_serializer.rb#36 + def binary?; end + + # @raise [ActiveRecord::Encryption::Errors::ForbiddenClass] + # + # source://activerecord//lib/active_record/encryption/message_serializer.rb#31 + def dump(message); end + + # source://activerecord//lib/active_record/encryption/message_serializer.rb#24 + def load(serialized_content); end + + private + + # source://activerecord//lib/active_record/encryption/message_serializer.rb#85 + def decode_if_needed(value); end + + # source://activerecord//lib/active_record/encryption/message_serializer.rb#77 + def encode_if_needed(value); end + + # source://activerecord//lib/active_record/encryption/message_serializer.rb#71 + def headers_to_json(headers); end + + # source://activerecord//lib/active_record/encryption/message_serializer.rb#64 + def message_to_json(message); end + + # source://activerecord//lib/active_record/encryption/message_serializer.rb#41 + def parse_message(data, level); end + + # source://activerecord//lib/active_record/encryption/message_serializer.rb#56 + def parse_properties(headers, level); end + + # source://activerecord//lib/active_record/encryption/message_serializer.rb#46 + def validate_message_data_format(data, level); end +end + +# An encryptor that won't decrypt or encrypt. It will just return the passed +# values +# +# source://activerecord//lib/active_record/encryption/null_encryptor.rb#7 +class ActiveRecord::Encryption::NullEncryptor + # @return [Boolean] + # + # source://activerecord//lib/active_record/encryption/null_encryptor.rb#20 + def binary?; end + + # source://activerecord//lib/active_record/encryption/null_encryptor.rb#12 + def decrypt(encrypted_text, key_provider: T.unsafe(nil), cipher_options: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/encryption/null_encryptor.rb#8 + def encrypt(clean_text, key_provider: T.unsafe(nil), cipher_options: T.unsafe(nil)); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/encryption/null_encryptor.rb#16 + def encrypted?(text); end +end + +# This is a wrapper for a hash of encryption properties. It is used by +# +Key+ (public tags) and +Message+ (headers). +# +# Since properties are serialized in messages, it is important for storage +# efficiency to keep their keys as short as possible. It defines accessors +# for common properties that will keep these keys very short while exposing +# a readable name. +# +# message.headers.encrypted_data_key # instead of message.headers[:k] +# +# See +Properties::DEFAULT_PROPERTIES+, Key, Message +# +# source://activerecord//lib/active_record/encryption/properties.rb#16 +class ActiveRecord::Encryption::Properties + # @return [Properties] a new instance of Properties + # + # source://activerecord//lib/active_record/encryption/properties.rb#42 + def initialize(initial_properties = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/encryption/properties.rb#20 + def ==(arg); end + + # source://activerecord//lib/active_record/encryption/properties.rb#20 + def [](*_arg0, **_arg1, &_arg2); end + + # Set a value for a given key + # + # It will raise an +EncryptedContentIntegrity+ if the value exists + # + # @raise [Errors::EncryptedContentIntegrity] + # + # source://activerecord//lib/active_record/encryption/properties.rb#50 + def []=(key, value); end + + # source://activerecord//lib/active_record/encryption/properties.rb#62 + def add(other_properties); end + + # source://activerecord//lib/active_record/encryption/properties.rb#33 + def auth_tag; end + + # source://activerecord//lib/active_record/encryption/properties.rb#37 + def auth_tag=(value); end + + # source://activerecord//lib/active_record/encryption/properties.rb#33 + def compressed; end + + # source://activerecord//lib/active_record/encryption/properties.rb#37 + def compressed=(value); end + + # source://activerecord//lib/active_record/encryption/properties.rb#20 + def each(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/encryption/properties.rb#33 + def encoding; end + + # source://activerecord//lib/active_record/encryption/properties.rb#37 + def encoding=(value); end + + # source://activerecord//lib/active_record/encryption/properties.rb#33 + def encrypted_data_key; end + + # source://activerecord//lib/active_record/encryption/properties.rb#37 + def encrypted_data_key=(value); end + + # source://activerecord//lib/active_record/encryption/properties.rb#33 + def encrypted_data_key_id; end + + # source://activerecord//lib/active_record/encryption/properties.rb#37 + def encrypted_data_key_id=(value); end + + # source://activerecord//lib/active_record/encryption/properties.rb#33 + def iv; end + + # source://activerecord//lib/active_record/encryption/properties.rb#37 + def iv=(value); end + + # source://activerecord//lib/active_record/encryption/properties.rb#20 + def key?(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/encryption/properties.rb#19 + def method_missing(method, *_arg1, **_arg2, &_arg3); end + + # source://activerecord//lib/active_record/encryption/properties.rb#68 + def to_h; end + + # source://activerecord//lib/active_record/encryption/properties.rb#56 + def validate_value_type(value); end + + private + + # Returns the value of attribute data. + # + # source://activerecord//lib/active_record/encryption/properties.rb#73 + def data; end + + # source://activerecord//lib/active_record/encryption/properties.rb#19 + def respond_to_missing?(name, include_private = T.unsafe(nil)); end +end + +# source://activerecord//lib/active_record/encryption/properties.rb#17 +ActiveRecord::Encryption::Properties::ALLOWED_VALUE_CLASSES = T.let(T.unsafe(nil), Array) + +# For each entry it generates an accessor exposing the full name +# +# source://activerecord//lib/active_record/encryption/properties.rb#23 +ActiveRecord::Encryption::Properties::DEFAULT_PROPERTIES = T.let(T.unsafe(nil), Hash) + +# A +NullEncryptor+ that will raise an error when trying to encrypt data +# +# This is useful when you want to reveal ciphertexts for debugging purposes +# and you want to make sure you won't overwrite any encryptable attribute with +# the wrong content. +# +# source://activerecord//lib/active_record/encryption/read_only_null_encryptor.rb#10 +class ActiveRecord::Encryption::ReadOnlyNullEncryptor + # @return [Boolean] + # + # source://activerecord//lib/active_record/encryption/read_only_null_encryptor.rb#23 + def binary?; end + + # source://activerecord//lib/active_record/encryption/read_only_null_encryptor.rb#15 + def decrypt(encrypted_text, key_provider: T.unsafe(nil), cipher_options: T.unsafe(nil)); end + + # @raise [Errors::Encryption] + # + # source://activerecord//lib/active_record/encryption/read_only_null_encryptor.rb#11 + def encrypt(clean_text, key_provider: T.unsafe(nil), cipher_options: T.unsafe(nil)); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/encryption/read_only_null_encryptor.rb#19 + def encrypted?(text); end +end + +# A container of attribute encryption options. +# +# It validates and serves attribute encryption options. +# +# See EncryptedAttributeType, Context +# +# source://activerecord//lib/active_record/encryption/scheme.rb#10 +class ActiveRecord::Encryption::Scheme + # @return [Scheme] a new instance of Scheme + # + # source://activerecord//lib/active_record/encryption/scheme.rb#13 + def initialize(key_provider: T.unsafe(nil), key: T.unsafe(nil), deterministic: T.unsafe(nil), support_unencrypted_data: T.unsafe(nil), downcase: T.unsafe(nil), ignore_case: T.unsafe(nil), previous_schemes: T.unsafe(nil), compress: T.unsafe(nil), compressor: T.unsafe(nil), **context_properties); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/encryption/scheme.rb#78 + def compatible_with?(other_scheme); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/encryption/scheme.rb#44 + def deterministic?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/encryption/scheme.rb#40 + def downcase?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/encryption/scheme.rb#52 + def fixed?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/encryption/scheme.rb#36 + def ignore_case?; end + + # source://activerecord//lib/active_record/encryption/scheme.rb#57 + def key_provider; end + + # source://activerecord//lib/active_record/encryption/scheme.rb#61 + def merge(other_scheme); end + + # Returns the value of attribute previous_schemes. + # + # source://activerecord//lib/active_record/encryption/scheme.rb#11 + def previous_schemes; end + + # Sets the attribute previous_schemes + # + # @param value the value to set the attribute previous_schemes to. + # + # source://activerecord//lib/active_record/encryption/scheme.rb#11 + def previous_schemes=(_arg0); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/encryption/scheme.rb#48 + def support_unencrypted_data?; end + + # source://activerecord//lib/active_record/encryption/scheme.rb#65 + def to_h; end + + # source://activerecord//lib/active_record/encryption/scheme.rb#70 + def with_context(&block); end + + private + + # source://activerecord//lib/active_record/encryption/scheme.rb#102 + def default_key_provider; end + + # source://activerecord//lib/active_record/encryption/scheme.rb#96 + def deterministic_key_provider; end + + # source://activerecord//lib/active_record/encryption/scheme.rb#90 + def key_provider_from_key; end + + # @raise [Errors::Configuration] + # + # source://activerecord//lib/active_record/encryption/scheme.rb#83 + def validate_config!; end +end + +# Declare an enum attribute where the values map to integers in the database, +# but can be queried by name. Example: +# +# class Conversation < ActiveRecord::Base +# enum :status, [ :active, :archived ] +# end +# +# # conversation.update! status: 0 +# conversation.active! +# conversation.active? # => true +# conversation.status # => "active" +# +# # conversation.update! status: 1 +# conversation.archived! +# conversation.archived? # => true +# conversation.status # => "archived" +# +# # conversation.status = 1 +# conversation.status = "archived" +# +# conversation.status = nil +# conversation.status.nil? # => true +# conversation.status # => nil +# +# Scopes based on the allowed values of the enum field will be provided +# as well. With the above example: +# +# Conversation.active +# Conversation.not_active +# Conversation.archived +# Conversation.not_archived +# +# Of course, you can also query them directly if the scopes don't fit your +# needs: +# +# Conversation.where(status: [:active, :archived]) +# Conversation.where.not(status: :active) +# +# Defining scopes can be disabled by setting +:scopes+ to +false+. +# +# class Conversation < ActiveRecord::Base +# enum :status, [ :active, :archived ], scopes: false +# end +# +# You can set the default enum value by setting +:default+, like: +# +# class Conversation < ActiveRecord::Base +# enum :status, [ :active, :archived ], default: :active +# end +# +# conversation = Conversation.new +# conversation.status # => "active" +# +# It's possible to explicitly map the relation between attribute and +# database integer with a hash: +# +# class Conversation < ActiveRecord::Base +# enum :status, active: 0, archived: 1 +# end +# +# Finally it's also possible to use a string column to persist the enumerated value. +# Note that this will likely lead to slower database queries: +# +# class Conversation < ActiveRecord::Base +# enum :status, active: "active", archived: "archived" +# end +# +# Note that when an array is used, the implicit mapping from the values to database +# integers is derived from the order the values appear in the array. In the example, +# :active is mapped to +0+ as it's the first element, and :archived +# is mapped to +1+. In general, the +i+-th element is mapped to i-1 in the +# database. +# +# Therefore, once a value is added to the enum array, its position in the array must +# be maintained, and new values should only be added to the end of the array. To +# remove unused values, the explicit hash syntax should be used. +# +# In rare circumstances you might need to access the mapping directly. +# The mappings are exposed through a class method with the pluralized attribute +# name, which return the mapping in a ActiveSupport::HashWithIndifferentAccess : +# +# Conversation.statuses[:active] # => 0 +# Conversation.statuses["archived"] # => 1 +# +# Use that class method when you need to know the ordinal value of an enum. +# For example, you can use that when manually building SQL strings: +# +# Conversation.where("status <> ?", Conversation.statuses[:archived]) +# +# You can use the +:prefix+ or +:suffix+ options when you need to define +# multiple enums with same values. If the passed value is +true+, the methods +# are prefixed/suffixed with the name of the enum. It is also possible to +# supply a custom value: +# +# class Conversation < ActiveRecord::Base +# enum :status, [ :active, :archived ], suffix: true +# enum :comments_status, [ :active, :inactive ], prefix: :comments +# end +# +# With the above example, the bang and predicate methods along with the +# associated scopes are now prefixed and/or suffixed accordingly: +# +# conversation.active_status! +# conversation.archived_status? # => false +# +# conversation.comments_inactive! +# conversation.comments_active? # => false +# +# If you want to disable the auto-generated methods on the model, you can do +# so by setting the +:instance_methods+ option to false: +# +# class Conversation < ActiveRecord::Base +# enum :status, [ :active, :archived ], instance_methods: false +# end +# +# By default, an +ArgumentError+ will be raised when assigning an invalid value: +# +# class Conversation < ActiveRecord::Base +# enum :status, [ :active, :archived ] +# end +# +# conversation = Conversation.new +# +# conversation.status = :unknown # 'unknown' is not a valid status (ArgumentError) +# +# If, instead, you want the enum value to be validated before saving, use the +# +:validate+ option: +# +# class Conversation < ActiveRecord::Base +# enum :status, [ :active, :archived ], validate: true +# end +# +# conversation = Conversation.new +# +# conversation.status = :unknown +# conversation.valid? # => false +# +# conversation.status = nil +# conversation.valid? # => false +# +# conversation.status = :active +# conversation.valid? # => true +# +# You may also pass additional validation options: +# +# class Conversation < ActiveRecord::Base +# enum :status, [ :active, :archived ], validate: { allow_nil: true } +# end +# +# conversation = Conversation.new +# +# conversation.status = :unknown +# conversation.valid? # => false +# +# conversation.status = nil +# conversation.valid? # => true +# +# conversation.status = :active +# conversation.valid? # => true +# +# source://activerecord//lib/active_record/enum.rb#166 +module ActiveRecord::Enum + # source://activerecord//lib/active_record/enum.rb#217 + def enum(name, values = T.unsafe(nil), **options); end + + private + + # source://activerecord//lib/active_record/enum.rb#223 + def _enum(name, values, prefix: T.unsafe(nil), suffix: T.unsafe(nil), scopes: T.unsafe(nil), instance_methods: T.unsafe(nil), validate: T.unsafe(nil), **options); end + + # source://activerecord//lib/active_record/enum.rb#327 + def _enum_methods_module; end + + # source://activerecord//lib/active_record/enum.rb#335 + def assert_valid_enum_definition_values(values); end + + # source://activerecord//lib/active_record/enum.rb#378 + def assert_valid_enum_options(options); end + + # source://activerecord//lib/active_record/enum.rb#391 + def detect_enum_conflict!(enum_name, method_name, klass_method = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/enum.rb#415 + def detect_negative_enum_conditions!(method_names); end + + # source://activerecord//lib/active_record/enum.rb#290 + def inherited(base); end + + # @raise [ArgumentError] + # + # source://activerecord//lib/active_record/enum.rb#405 + def raise_conflict_error(enum_name, method_name, type, source: T.unsafe(nil)); end + + class << self + # source://activerecord//lib/active_record/enum.rb#167 + def extended(base); end + end +end + +# source://activerecord//lib/active_record/enum.rb#385 +ActiveRecord::Enum::ENUM_CONFLICT_MESSAGE = T.let(T.unsafe(nil), String) + +# source://activerecord//lib/active_record/enum.rb#295 +class ActiveRecord::Enum::EnumMethods < ::Module + # @return [EnumMethods] a new instance of EnumMethods + # + # source://activerecord//lib/active_record/enum.rb#296 + def initialize(klass); end + + private + + # source://activerecord//lib/active_record/enum.rb#303 + def define_enum_methods(name, value_method_name, value, scopes, instance_methods); end + + # Returns the value of attribute klass. + # + # source://activerecord//lib/active_record/enum.rb#301 + def klass; end +end + +# source://activerecord//lib/active_record/enum.rb#171 +class ActiveRecord::Enum::EnumType < ::ActiveModel::Type::Value + # @return [EnumType] a new instance of EnumType + # + # source://activerecord//lib/active_record/enum.rb#174 + def initialize(name, mapping, subtype, raise_on_invalid_values: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/enum.rb#203 + def assert_valid_value(value); end + + # source://activerecord//lib/active_record/enum.rb#181 + def cast(value); end + + # source://activerecord//lib/active_record/enum.rb#191 + def deserialize(value); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/enum.rb#199 + def serializable?(value, &block); end + + # source://activerecord//lib/active_record/enum.rb#195 + def serialize(value); end + + # Returns the value of attribute subtype. + # + # source://activerecord//lib/active_record/enum.rb#211 + def subtype; end + + # source://activerecord//lib/active_record/enum.rb#172 + def type(*_arg0, **_arg1, &_arg2); end + + private + + # Returns the value of attribute mapping. + # + # source://activerecord//lib/active_record/enum.rb#214 + def mapping; end + + # Returns the value of attribute name. + # + # source://activerecord//lib/active_record/enum.rb#214 + def name; end +end + +# source://activerecord//lib/active_record/migration.rb#215 +class ActiveRecord::EnvironmentMismatchError < ::ActiveRecord::ActiveRecordError + # @return [EnvironmentMismatchError] a new instance of EnvironmentMismatchError + # + # source://activerecord//lib/active_record/migration.rb#216 + def initialize(current: T.unsafe(nil), stored: T.unsafe(nil)); end +end + +# source://activerecord//lib/active_record/migration.rb#229 +class ActiveRecord::EnvironmentStorageError < ::ActiveRecord::ActiveRecordError + # @return [EnvironmentStorageError] a new instance of EnvironmentStorageError + # + # source://activerecord//lib/active_record/migration.rb#230 + def initialize; end +end + +# Raised when a record cannot be inserted or updated because it would violate an exclusion constraint. +# +# source://activerecord//lib/active_record/errors.rb#300 +class ActiveRecord::ExclusionViolation < ::ActiveRecord::StatementInvalid; end + +# Raised when a pool was unable to get ahold of all its connections +# to perform a "group" action such as +# {ActiveRecord::Base.connection_pool.disconnect!}[rdoc-ref:ConnectionAdapters::ConnectionPool#disconnect!] +# or {ActiveRecord::Base.connection_handler.clear_reloadable_connections!}[rdoc-ref:ConnectionAdapters::ConnectionHandler#clear_reloadable_connections!]. +# +# source://activerecord//lib/active_record/errors.rb#127 +class ActiveRecord::ExclusiveConnectionTimeoutError < ::ActiveRecord::ConnectionTimeoutError; end + +# source://activerecord//lib/active_record/explain.rb#6 +module ActiveRecord::Explain + # Executes the block with the collect flag enabled. Queries are collected + # asynchronously by the subscriber and returned. + # + # source://activerecord//lib/active_record/explain.rb#9 + def collecting_queries_for_explain; end + + # Makes the adapter execute EXPLAIN for the tuples of queries and bindings. + # Returns a formatted string ready to be logged. + # + # source://activerecord//lib/active_record/explain.rb#19 + def exec_explain(queries, options = T.unsafe(nil)); end + + private + + # source://activerecord//lib/active_record/explain.rb#55 + def build_explain_clause(connection, options = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/explain.rb#40 + def render_bind(connection, attr); end +end + +# This is a thread locals registry for EXPLAIN. For example +# +# ActiveRecord::ExplainRegistry.queries +# +# returns the collected queries local to the current thread. +# +# source://activerecord//lib/active_record/explain_registry.rb#10 +class ActiveRecord::ExplainRegistry + # @return [ExplainRegistry] a new instance of ExplainRegistry + # + # source://activerecord//lib/active_record/explain_registry.rb#68 + def initialize; end + + # Returns the value of attribute collect. + # + # source://activerecord//lib/active_record/explain_registry.rb#65 + def collect; end + + # Sets the attribute collect + # + # @param value the value to set the attribute collect to. + # + # source://activerecord//lib/active_record/explain_registry.rb#65 + def collect=(_arg0); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/explain_registry.rb#77 + def collect?; end + + # Returns the value of attribute queries. + # + # source://activerecord//lib/active_record/explain_registry.rb#66 + def queries; end + + # source://activerecord//lib/active_record/explain_registry.rb#81 + def reset; end + + # source://activerecord//lib/active_record/explain_registry.rb#72 + def start; end + + class << self + # source://activerecord//lib/active_record/explain_registry.rb#57 + def collect(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/explain_registry.rb#57 + def collect=(arg); end + + # source://activerecord//lib/active_record/explain_registry.rb#57 + def collect?(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/explain_registry.rb#57 + def queries(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/explain_registry.rb#57 + def reset(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/explain_registry.rb#57 + def start(*_arg0, **_arg1, &_arg2); end + + private + + # source://activerecord//lib/active_record/explain_registry.rb#60 + def instance; end + end +end + +# source://activerecord//lib/active_record/explain_registry.rb#11 +class ActiveRecord::ExplainRegistry::Subscriber + # source://activerecord//lib/active_record/explain_registry.rb#31 + def finish(name, id, payload); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/explain_registry.rb#48 + def ignore_payload?(payload); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/explain_registry.rb#37 + def silenced?(_name); end + + # source://activerecord//lib/active_record/explain_registry.rb#27 + def start(name, id, payload); end + + class << self + # source://activerecord//lib/active_record/explain_registry.rb#16 + def ensure_subscribed; end + end +end + +# source://activerecord//lib/active_record/explain_registry.rb#47 +ActiveRecord::ExplainRegistry::Subscriber::EXPLAINED_SQLS = T.let(T.unsafe(nil), Regexp) + +# SCHEMA queries cannot be EXPLAINed, also we do not want to run EXPLAIN on +# our own EXPLAINs no matter how loopingly beautiful that would be. +# +# On the other hand, we want to monitor the performance of our real database +# queries, not the performance of the access to the query cache. +# +# source://activerecord//lib/active_record/explain_registry.rb#46 +ActiveRecord::ExplainRegistry::Subscriber::IGNORED_PAYLOADS = T.let(T.unsafe(nil), Array) + +# source://activerecord//lib/active_record/explain_registry.rb#12 +ActiveRecord::ExplainRegistry::Subscriber::MUTEX = T.let(T.unsafe(nil), Thread::Mutex) + +# source://activerecord//lib/active_record/filter_attribute_handler.rb#4 +class ActiveRecord::FilterAttributeHandler + # @return [FilterAttributeHandler] a new instance of FilterAttributeHandler + # + # source://activerecord//lib/active_record/filter_attribute_handler.rb#18 + def initialize(app); end + + # source://activerecord//lib/active_record/filter_attribute_handler.rb#24 + def enable; end + + private + + # Returns the value of attribute app. + # + # source://activerecord//lib/active_record/filter_attribute_handler.rb#32 + def app; end + + # source://activerecord//lib/active_record/filter_attribute_handler.rb#48 + def apply_collected_attributes; end + + # source://activerecord//lib/active_record/filter_attribute_handler.rb#63 + def apply_filter(klass, list); end + + # source://activerecord//lib/active_record/filter_attribute_handler.rb#40 + def attribute_was_declared(klass, list); end + + # source://activerecord//lib/active_record/filter_attribute_handler.rb#58 + def collect_for_later(klass, list); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/filter_attribute_handler.rb#54 + def collecting?; end + + # source://activerecord//lib/active_record/filter_attribute_handler.rb#34 + def install_collecting_hook; end + + class << self + # source://activerecord//lib/active_record/filter_attribute_handler.rb#6 + def on_sensitive_attribute_declared(&block); end + + # source://activerecord//lib/active_record/filter_attribute_handler.rb#11 + def sensitive_attribute_was_declared(klass, list); end + end +end + +# source://activerecord//lib/active_record/relation/finder_methods.rb#6 +module ActiveRecord::FinderMethods + # Returns true if a record exists in the table that matches the +id+ or + # conditions given, or false otherwise. The argument can take six forms: + # + # * Integer - Finds the record with this primary key. + # * String - Finds the record with a primary key corresponding to this + # string (such as '5'). + # * Array - Finds the record that matches these +where+-style conditions + # (such as ['name LIKE ?', "%#{query}%"]). + # * Hash - Finds the record that matches these +where+-style conditions + # (such as {name: 'David'}). + # * +false+ - Returns always +false+. + # * No args - Returns +false+ if the relation is empty, +true+ otherwise. + # + # For more information about specifying conditions as a hash or array, + # see the Conditions section in the introduction to ActiveRecord::Base. + # + # Note: You can't pass in a condition as a string (like name = + # 'Jamie'), since it would be sanitized and then queried against + # the primary key column, like id = 'name = \'Jamie\''. + # + # Person.exists?(5) + # Person.exists?('5') + # Person.exists?(['name LIKE ?', "%#{query}%"]) + # Person.exists?(id: [1, 4, 8]) + # Person.exists?(name: 'David') + # Person.exists?(false) + # Person.exists? + # Person.where(name: 'Spartacus', rating: 4).exists? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation/finder_methods.rb#357 + def exists?(conditions = T.unsafe(nil)); end + + # Find the fifth record. + # If no order is defined it will order by primary key. + # + # Person.fifth # returns the fifth object fetched by SELECT * FROM people + # Person.offset(3).fifth # returns the fifth object from OFFSET 3 (which is OFFSET 7) + # Person.where(["user_name = :u", { u: user_name }]).fifth + # + # source://activerecord//lib/active_record/relation/finder_methods.rb#271 + def fifth; end + + # Same as #fifth but raises ActiveRecord::RecordNotFound if no record + # is found. + # + # source://activerecord//lib/active_record/relation/finder_methods.rb#277 + def fifth!; end + + # Find by id - This can either be a specific id (ID), a list of ids (ID, ID, ID), or an array of ids ([ID, ID, ID]). + # `ID` refers to an "identifier". For models with a single-column primary key, `ID` will be a single value, + # and for models with a composite primary key, it will be an array of values. + # If one or more records cannot be found for the requested ids, then ActiveRecord::RecordNotFound will be raised. + # If the primary key is an integer, find by id coerces its arguments by using +to_i+. + # + # Person.find(1) # returns the object for ID = 1 + # Person.find("1") # returns the object for ID = 1 + # Person.find("31-sarah") # returns the object for ID = 31 + # Person.find(1, 2, 6) # returns an array for objects with IDs in (1, 2, 6) + # Person.find([7, 17]) # returns an array for objects with IDs in (7, 17), or with composite primary key [7, 17] + # Person.find([1]) # returns an array for the object with ID = 1 + # Person.where("administrator = 1").order("created_on DESC").find(1) + # + # ==== Find a record for a composite primary key model + # TravelRoute.primary_key = [:origin, :destination] + # + # TravelRoute.find(["Ottawa", "London"]) + # # => # + # + # TravelRoute.find([["Paris", "Montreal"]]) + # # => [#] + # + # TravelRoute.find(["New York", "Las Vegas"], ["New York", "Portland"]) + # # => [ + # # #, + # # # + # # ] + # + # TravelRoute.find([["Berlin", "London"], ["Barcelona", "Lisbon"]]) + # # => [ + # # #, + # # # + # # ] + # + # NOTE: The returned records are in the same order as the ids you provide. + # If you want the results to be sorted by database, you can use ActiveRecord::QueryMethods#where + # method and provide an explicit ActiveRecord::QueryMethods#order option. + # But ActiveRecord::QueryMethods#where method doesn't raise ActiveRecord::RecordNotFound. + # + # ==== Find with lock + # + # Example for find with a lock: Imagine two concurrent transactions: + # each will read person.visits == 2, add 1 to it, and save, resulting + # in two saves of person.visits = 3. By locking the row, the second + # transaction has to wait until the first is finished; we get the + # expected person.visits == 4. + # + # Person.transaction do + # person = Person.lock(true).find(1) + # person.visits += 1 + # person.save! + # end + # + # ==== Variations of #find + # + # Person.where(name: 'Spartacus', rating: 4) + # # returns a chainable list (which can be empty). + # + # Person.find_by(name: 'Spartacus', rating: 4) + # # returns the first item or nil. + # + # Person.find_or_initialize_by(name: 'Spartacus', rating: 4) + # # returns the first item or returns a new instance (requires you call .save to persist against the database). + # + # Person.find_or_create_by(name: 'Spartacus', rating: 4) + # # returns the first item or creates it and returns it. + # + # ==== Alternatives for #find + # + # Person.where(name: 'Spartacus', rating: 4).exists?(conditions = :none) + # # returns a boolean indicating if any record with the given conditions exist. + # + # Person.where(name: 'Spartacus', rating: 4).select("field1, field2, field3") + # # returns a chainable list of instances with only the mentioned fields. + # + # Person.where(name: 'Spartacus', rating: 4).ids + # # returns an Array of ids. + # + # Person.where(name: 'Spartacus', rating: 4).pluck(:field1, :field2) + # # returns an Array of the required fields. + # + # ==== Edge Cases + # + # Person.find(37) # raises ActiveRecord::RecordNotFound exception if the record with the given ID does not exist. + # Person.find([37]) # raises ActiveRecord::RecordNotFound exception if the record with the given ID in the input array does not exist. + # Person.find(nil) # raises ActiveRecord::RecordNotFound exception if the argument is nil. + # Person.find([]) # returns an empty array if the argument is an empty array. + # Person.find # raises ActiveRecord::RecordNotFound exception if the argument is not provided. + # + # source://activerecord//lib/active_record/relation/finder_methods.rb#98 + def find(*args); end + + # Finds the first record matching the specified conditions. There + # is no implied ordering so if order matters, you should specify it + # yourself. + # + # If no record is found, returns nil. + # + # Post.find_by name: 'Spartacus', rating: 4 + # Post.find_by "published_at < ?", 2.weeks.ago + # + # source://activerecord//lib/active_record/relation/finder_methods.rb#111 + def find_by(arg, *args); end + + # Like #find_by, except that if no record is found, raises + # an ActiveRecord::RecordNotFound error. + # + # source://activerecord//lib/active_record/relation/finder_methods.rb#117 + def find_by!(arg, *args); end + + # Finds the sole matching record. Raises ActiveRecord::RecordNotFound if no + # record is found. Raises ActiveRecord::SoleRecordExceeded if more than one + # record is found. + # + # Product.find_sole_by(["price = %?", price]) + # + # source://activerecord//lib/active_record/relation/finder_methods.rb#160 + def find_sole_by(arg, *args); end + + # Find the first record (or first N records if a parameter is supplied). + # If no order is defined it will order by primary key. + # + # Person.first # returns the first object fetched by SELECT * FROM people ORDER BY people.id LIMIT 1 + # Person.where(["user_name = ?", user_name]).first + # Person.where(["user_name = :u", { u: user_name }]).first + # Person.order("created_on DESC").offset(5).first + # Person.first(3) # returns the first three objects fetched by SELECT * FROM people ORDER BY people.id LIMIT 3 + # + # source://activerecord//lib/active_record/relation/finder_methods.rb#173 + def first(limit = T.unsafe(nil)); end + + # Same as #first but raises ActiveRecord::RecordNotFound if no record + # is found. Note that #first! accepts no arguments. + # + # source://activerecord//lib/active_record/relation/finder_methods.rb#183 + def first!; end + + # Find the forty-second record. Also known as accessing "the reddit". + # If no order is defined it will order by primary key. + # + # Person.forty_two # returns the forty-second object fetched by SELECT * FROM people + # Person.offset(3).forty_two # returns the forty-second object from OFFSET 3 (which is OFFSET 44) + # Person.where(["user_name = :u", { u: user_name }]).forty_two + # + # source://activerecord//lib/active_record/relation/finder_methods.rb#287 + def forty_two; end + + # Same as #forty_two but raises ActiveRecord::RecordNotFound if no record + # is found. + # + # source://activerecord//lib/active_record/relation/finder_methods.rb#293 + def forty_two!; end + + # Find the fourth record. + # If no order is defined it will order by primary key. + # + # Person.fourth # returns the fourth object fetched by SELECT * FROM people + # Person.offset(3).fourth # returns the fourth object from OFFSET 3 (which is OFFSET 6) + # Person.where(["user_name = :u", { u: user_name }]).fourth + # + # source://activerecord//lib/active_record/relation/finder_methods.rb#255 + def fourth; end + + # Same as #fourth but raises ActiveRecord::RecordNotFound if no record + # is found. + # + # source://activerecord//lib/active_record/relation/finder_methods.rb#261 + def fourth!; end + + # Returns true if the relation contains the given record or false otherwise. + # + # No query is performed if the relation is loaded; the given record is + # compared to the records in memory. If the relation is unloaded, an + # efficient existence query is performed, as in #exists?. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation/finder_methods.rb#389 + def include?(record); end + + # Find the last record (or last N records if a parameter is supplied). + # If no order is defined it will order by primary key. + # + # Person.last # returns the last object fetched by SELECT * FROM people + # Person.where(["user_name = ?", user_name]).last + # Person.order("created_on DESC").offset(5).last + # Person.last(3) # returns the last three objects fetched by SELECT * FROM people. + # + # Take note that in that last case, the results are sorted in ascending order: + # + # [#, #, #] + # + # and not: + # + # [#, #, #] + # + # source://activerecord//lib/active_record/relation/finder_methods.rb#202 + def last(limit = T.unsafe(nil)); end + + # Same as #last but raises ActiveRecord::RecordNotFound if no record + # is found. Note that #last! accepts no arguments. + # + # source://activerecord//lib/active_record/relation/finder_methods.rb#213 + def last!; end + + # Returns true if the relation contains the given record or false otherwise. + # + # No query is performed if the relation is loaded; the given record is + # compared to the records in memory. If the relation is unloaded, an + # efficient existence query is performed, as in #exists?. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation/finder_methods.rb#407 + def member?(record); end + + # This method is called whenever no records are found with either a single + # id or multiple ids and raises an ActiveRecord::RecordNotFound exception. + # + # The error message is different depending on whether a single id or + # multiple ids are provided. If multiple ids are provided, then the number + # of results obtained should be provided in the +result_size+ argument and + # the expected number of results should be provided in the +expected_size+ + # argument. + # + # source://activerecord//lib/active_record/relation/finder_methods.rb#417 + def raise_record_not_found_exception!(ids = T.unsafe(nil), result_size = T.unsafe(nil), expected_size = T.unsafe(nil), key = T.unsafe(nil), not_found_ids = T.unsafe(nil)); end + + # Find the second record. + # If no order is defined it will order by primary key. + # + # Person.second # returns the second object fetched by SELECT * FROM people + # Person.offset(3).second # returns the second object from OFFSET 3 (which is OFFSET 4) + # Person.where(["user_name = :u", { u: user_name }]).second + # + # source://activerecord//lib/active_record/relation/finder_methods.rb#223 + def second; end + + # Same as #second but raises ActiveRecord::RecordNotFound if no record + # is found. + # + # source://activerecord//lib/active_record/relation/finder_methods.rb#229 + def second!; end + + # Find the second-to-last record. + # If no order is defined it will order by primary key. + # + # Person.second_to_last # returns the second-to-last object fetched by SELECT * FROM people + # Person.offset(3).second_to_last # returns the second-to-last object from OFFSET 3 + # Person.where(["user_name = :u", { u: user_name }]).second_to_last + # + # source://activerecord//lib/active_record/relation/finder_methods.rb#319 + def second_to_last; end + + # Same as #second_to_last but raises ActiveRecord::RecordNotFound if no record + # is found. + # + # source://activerecord//lib/active_record/relation/finder_methods.rb#325 + def second_to_last!; end + + # Finds the sole matching record. Raises ActiveRecord::RecordNotFound if no + # record is found. Raises ActiveRecord::SoleRecordExceeded if more than one + # record is found. + # + # Product.where(["price = %?", price]).sole + # + # source://activerecord//lib/active_record/relation/finder_methods.rb#143 + def sole; end + + # Gives a record (or N records if a parameter is supplied) without any implied + # order. The order will depend on the database implementation. + # If an order is supplied it will be respected. + # + # Person.take # returns an object fetched by SELECT * FROM people LIMIT 1 + # Person.take(5) # returns 5 objects fetched by SELECT * FROM people LIMIT 5 + # Person.where(["name LIKE '%?'", name]).take + # + # source://activerecord//lib/active_record/relation/finder_methods.rb#128 + def take(limit = T.unsafe(nil)); end + + # Same as #take but raises ActiveRecord::RecordNotFound if no record + # is found. Note that #take! accepts no arguments. + # + # source://activerecord//lib/active_record/relation/finder_methods.rb#134 + def take!; end + + # Find the third record. + # If no order is defined it will order by primary key. + # + # Person.third # returns the third object fetched by SELECT * FROM people + # Person.offset(3).third # returns the third object from OFFSET 3 (which is OFFSET 5) + # Person.where(["user_name = :u", { u: user_name }]).third + # + # source://activerecord//lib/active_record/relation/finder_methods.rb#239 + def third; end + + # Same as #third but raises ActiveRecord::RecordNotFound if no record + # is found. + # + # source://activerecord//lib/active_record/relation/finder_methods.rb#245 + def third!; end + + # Find the third-to-last record. + # If no order is defined it will order by primary key. + # + # Person.third_to_last # returns the third-to-last object fetched by SELECT * FROM people + # Person.offset(3).third_to_last # returns the third-to-last object from OFFSET 3 + # Person.where(["user_name = :u", { u: user_name }]).third_to_last + # + # source://activerecord//lib/active_record/relation/finder_methods.rb#303 + def third_to_last; end + + # Same as #third_to_last but raises ActiveRecord::RecordNotFound if no record + # is found. + # + # source://activerecord//lib/active_record/relation/finder_methods.rb#309 + def third_to_last!; end + + private + + # source://activerecord//lib/active_record/relation/finder_methods.rb#668 + def _order_columns; end + + # source://activerecord//lib/active_record/relation/finder_methods.rb#458 + def apply_join_dependency(eager_loading: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation/finder_methods.rb#439 + def construct_relation_for_exists(conditions); end + + # source://activerecord//lib/active_record/relation/finder_methods.rb#637 + def find_last(limit); end + + # source://activerecord//lib/active_record/relation/finder_methods.rb#599 + def find_nth(index); end + + # source://activerecord//lib/active_record/relation/finder_methods.rb#623 + def find_nth_from_last(index); end + + # source://activerecord//lib/active_record/relation/finder_methods.rb#604 + def find_nth_with_limit(index, limit); end + + # source://activerecord//lib/active_record/relation/finder_methods.rb#521 + def find_one(id); end + + # source://activerecord//lib/active_record/relation/finder_methods.rb#542 + def find_some(ids); end + + # source://activerecord//lib/active_record/relation/finder_methods.rb#568 + def find_some_ordered(ids); end + + # source://activerecord//lib/active_record/relation/finder_methods.rb#583 + def find_take; end + + # source://activerecord//lib/active_record/relation/finder_methods.rb#591 + def find_take_with_limit(limit); end + + # @raise [UnknownPrimaryKey] + # + # source://activerecord//lib/active_record/relation/finder_methods.rb#492 + def find_with_ids(*ids); end + + # source://activerecord//lib/active_record/relation/finder_methods.rb#641 + def ordered_relation; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation/finder_methods.rb#488 + def using_limitable_reflections?(reflections); end +end + +# source://activerecord//lib/active_record/relation/finder_methods.rb#7 +ActiveRecord::FinderMethods::ONE_AS_ONE = T.let(T.unsafe(nil), String) + +# source://activerecord//lib/active_record/fixtures.rb#806 +class ActiveRecord::Fixture + include ::Enumerable + + # @return [Fixture] a new instance of Fixture + # + # source://activerecord//lib/active_record/fixtures.rb#817 + def initialize(fixture, model_class); end + + # source://activerecord//lib/active_record/fixtures.rb#830 + def [](key); end + + # source://activerecord//lib/active_record/fixtures.rb#822 + def class_name; end + + # source://activerecord//lib/active_record/fixtures.rb#826 + def each(&block); end + + # @raise [FixtureClassNotFound] + # + # source://activerecord//lib/active_record/fixtures.rb#836 + def find; end + + # Returns the value of attribute fixture. + # + # source://activerecord//lib/active_record/fixtures.rb#815 + def fixture; end + + # Returns the value of attribute model_class. + # + # source://activerecord//lib/active_record/fixtures.rb#815 + def model_class; end + + # Returns the value of attribute fixture. + # + # source://activerecord//lib/active_record/fixtures.rb#834 + def to_hash; end +end + +# source://activerecord//lib/active_record/fixtures.rb#809 +class ActiveRecord::Fixture::FixtureError < ::StandardError; end + +# source://activerecord//lib/active_record/fixtures.rb#812 +class ActiveRecord::Fixture::FormatError < ::ActiveRecord::Fixture::FixtureError; end + +# source://activerecord//lib/active_record/fixtures.rb#10 +class ActiveRecord::FixtureClassNotFound < ::ActiveRecord::ActiveRecordError; end + +# = Active Record \Fixtures +# +# \Fixtures are a way of organizing data that you want to test against; in short, sample data. +# +# They are stored in YAML files, one file per model, which are by default placed in either +# /test/fixtures/ or in the test/fixtures +# folder under any of your application's engines. +# +# The location can also be changed with ActiveSupport::TestCase.fixture_paths=, +# once you have require "rails/test_help" in your +test_helper.rb+. +# +# The fixture file ends with the +.yml+ file extension, for example: +# /test/fixtures/web_sites.yml). +# +# The format of a fixture file looks like this: +# +# rubyonrails: +# id: 1 +# name: Ruby on Rails +# url: http://www.rubyonrails.org +# +# google: +# id: 2 +# name: Google +# url: http://www.google.com +# +# This fixture file includes two fixtures. Each YAML fixture (i.e. record) is given a name and +# is followed by an indented list of key/value pairs in the "key: value" format. Records are +# separated by a blank line for your viewing pleasure. +# +# == Ordering +# +# Fixtures by default are unordered. This is because the maps in YAML are unordered. +# +# If you want ordered fixtures, use the omap YAML type. +# See https://yaml.org/type/omap.html for the specification. +# +# You will need ordered fixtures when you have foreign key constraints +# on keys in the same table. This is commonly needed for tree structures. +# +# For example: +# +# --- !omap +# - parent: +# id: 1 +# parent_id: NULL +# title: Parent +# - child: +# id: 2 +# parent_id: 1 +# title: Child +# +# == Using Fixtures in Test Cases +# +# Since fixtures are a testing construct, we use them in our unit and functional tests. There +# are two ways to use the fixtures, but first let's take a look at a sample unit test: +# +# require "test_helper" +# +# class WebSiteTest < ActiveSupport::TestCase +# test "web_site_count" do +# assert_equal 2, WebSite.count +# end +# end +# +# By default, +test_helper.rb+ will load all of your fixtures into your test +# database, so this test will succeed. +# +# The testing environment will automatically load all the fixtures into the database before each +# test. To ensure consistent data, the environment deletes the fixtures before running the load. +# +# In addition to being available in the database, the fixture's data may also be accessed by +# using a special dynamic method, which has the same name as the model. +# +# Passing in a fixture name to this dynamic method returns the fixture matching this name: +# +# test "find one" do +# assert_equal "Ruby on Rails", web_sites(:rubyonrails).name +# end +# +# Passing in multiple fixture names returns all fixtures matching these names: +# +# test "find all by name" do +# assert_equal 2, web_sites(:rubyonrails, :google).length +# end +# +# Passing in no arguments returns all fixtures: +# +# test "find all" do +# assert_equal 2, web_sites.length +# end +# +# Passing in any fixture name that does not exist will raise StandardError: +# +# test "find by name that does not exist" do +# assert_raise(StandardError) { web_sites(:reddit) } +# end +# +# If the model names conflicts with a +TestCase+ methods, you can use the generic +fixture+ accessor +# +# test "generic find" do +# assert_equal "Ruby on Rails", fixture(:web_sites, :rubyonrails).name +# end +# +# Alternatively, you may enable auto-instantiation of the fixture data. For instance, take the +# following tests: +# +# test "find_alt_method_1" do +# assert_equal "Ruby on Rails", @web_sites['rubyonrails']['name'] +# end +# +# test "find_alt_method_2" do +# assert_equal "Ruby on Rails", @rubyonrails.name +# end +# +# In order to use these methods to access fixtured data within your test cases, you must specify one of the +# following in your ActiveSupport::TestCase-derived class: +# +# - to fully enable instantiated fixtures (enable alternate methods #1 and #2 above) +# self.use_instantiated_fixtures = true +# +# - create only the hash for the fixtures, do not 'find' each instance (enable alternate method #1 only) +# self.use_instantiated_fixtures = :no_instances +# +# Using either of these alternate methods incurs a performance hit, as the fixtured data must be fully +# traversed in the database to create the fixture hash and/or instance variables. This is expensive for +# large sets of fixtured data. +# +# == Dynamic fixtures with \ERB +# +# Sometimes you don't care about the content of the fixtures as much as you care about the volume. +# In these cases, you can mix ERB in with your YAML fixtures to create a bunch of fixtures for load +# testing, like: +# +# <% 1.upto(1000) do |i| %> +# fix_<%= i %>: +# id: <%= i %> +# name: guy_<%= i %> +# <% end %> +# +# This will create 1000 very simple fixtures. +# +# Using ERB, you can also inject dynamic values into your fixtures with inserts like +# <%= Date.today.strftime("%Y-%m-%d") %>. +# This is however a feature to be used with some caution. The point of fixtures are that they're +# stable units of predictable sample data. If you feel that you need to inject dynamic values, then +# perhaps you should reexamine whether your application is properly testable. Hence, dynamic values +# in fixtures are to be considered a code smell. +# +# Helper methods defined in a fixture will not be available in other fixtures, to prevent against +# unwanted inter-test dependencies. Methods used by multiple fixtures should be defined in a module +# that is included in ActiveRecord::FixtureSet.context_class. +# +# - define a helper method in test_helper.rb +# module FixtureFileHelpers +# def file_sha(path) +# OpenSSL::Digest::SHA256.hexdigest(File.read(Rails.root.join('test/fixtures', path))) +# end +# end +# ActiveRecord::FixtureSet.context_class.include FixtureFileHelpers +# +# - use the helper method in a fixture +# photo: +# name: kitten.png +# sha: <%= file_sha 'files/kitten.png' %> +# +# == Transactional Tests +# +# Test cases can use begin+rollback to isolate their changes to the database instead of having to +# delete+insert for every test case. +# +# class FooTest < ActiveSupport::TestCase +# self.use_transactional_tests = true +# +# test "godzilla" do +# assert_not_empty Foo.all +# Foo.destroy_all +# assert_empty Foo.all +# end +# +# test "godzilla aftermath" do +# assert_not_empty Foo.all +# end +# end +# +# If you preload your test database with all fixture data (probably by running bin/rails db:fixtures:load) +# and use transactional tests, then you may omit all fixtures declarations in your test cases since +# all the data's already there and every case rolls back its changes. +# +# In order to use instantiated fixtures with preloaded data, set +self.pre_loaded_fixtures+ to +# true. This will provide access to fixture data for every table that has been loaded through +# fixtures (depending on the value of +use_instantiated_fixtures+). +# +# When *not* to use transactional tests: +# +# 1. You're testing whether a transaction works correctly. Nested transactions don't commit until +# all parent transactions commit, particularly, the fixtures transaction which is begun in setup +# and rolled back in teardown. Thus, you won't be able to verify +# the results of your transaction until Active Record supports nested transactions or savepoints (in progress). +# 2. Your database does not support transactions. Every Active Record database supports transactions except MySQL MyISAM. +# Use InnoDB, MaxDB, or NDB instead. +# +# == Advanced Fixtures +# +# Fixtures that don't specify an ID get some extra features: +# +# * Stable, autogenerated IDs +# * Label references for associations (belongs_to, has_one, has_many) +# * HABTM associations as inline lists +# +# There are some more advanced features available even if the id is specified: +# +# * Autofilled timestamp columns +# * Fixture label interpolation +# * Support for YAML defaults +# +# === Stable, Autogenerated IDs +# +# Here, have a monkey fixture: +# +# george: +# id: 1 +# name: George the Monkey +# +# reginald: +# id: 2 +# name: Reginald the Pirate +# +# Each of these fixtures has two unique identifiers: one for the database +# and one for the humans. Why don't we generate the primary key instead? +# Hashing each fixture's label yields a consistent ID: +# +# george: # generated id: 380982691 +# name: George the Monkey +# +# reginald: # generated id: 41001176 +# name: Reginald the Pirate +# +# Active Record looks at the fixture's model class, discovers the correct +# primary key, and generates it right before inserting the fixture +# into the database. +# +# The generated ID for a given label is constant, so we can discover +# any fixture's ID without loading anything, as long as we know the label. +# +# === Label references for associations (+belongs_to+, +has_one+, +has_many+) +# +# Specifying foreign keys in fixtures can be very fragile, not to +# mention difficult to read. Since Active Record can figure out the ID of +# any fixture from its label, you can specify FK's by label instead of ID. +# +# ==== +belongs_to+ +# +# Let's break out some more monkeys and pirates. +# +# ### in pirates.yml +# +# reginald: +# id: 1 +# name: Reginald the Pirate +# monkey_id: 1 +# +# +# +# ### in monkeys.yml +# +# george: +# id: 1 +# name: George the Monkey +# pirate_id: 1 +# +# Add a few more monkeys and pirates and break this into multiple files, +# and it gets pretty hard to keep track of what's going on. Let's +# use labels instead of IDs: +# +# ### in pirates.yml +# +# reginald: +# name: Reginald the Pirate +# monkey: george +# +# +# +# ### in monkeys.yml +# +# george: +# name: George the Monkey +# pirate: reginald +# +# Pow! All is made clear. Active Record reflects on the fixture's model class, +# finds all the +belongs_to+ associations, and allows you to specify +# a target *label* for the *association* (monkey: george) rather than +# a target *id* for the *FK* (monkey_id: 1). +# +# ==== Polymorphic +belongs_to+ +# +# Supporting polymorphic relationships is a little bit more complicated, since +# Active Record needs to know what type your association is pointing at. Something +# like this should look familiar: +# +# ### in fruit.rb +# +# belongs_to :eater, polymorphic: true +# +# +# +# ### in fruits.yml +# +# apple: +# id: 1 +# name: apple +# eater_id: 1 +# eater_type: Monkey +# +# Can we do better? You bet! +# +# apple: +# eater: george (Monkey) +# +# Just provide the polymorphic target type and Active Record will take care of the rest. +# +# ==== +has_and_belongs_to_many+ or has_many :through +# +# \Time to give our monkey some fruit. +# +# ### in monkeys.yml +# +# george: +# id: 1 +# name: George the Monkey +# +# +# +# ### in fruits.yml +# +# apple: +# id: 1 +# name: apple +# +# orange: +# id: 2 +# name: orange +# +# grape: +# id: 3 +# name: grape +# +# +# +# ### in fruits_monkeys.yml +# +# apple_george: +# fruit_id: 1 +# monkey_id: 1 +# +# orange_george: +# fruit_id: 2 +# monkey_id: 1 +# +# grape_george: +# fruit_id: 3 +# monkey_id: 1 +# +# Let's make the HABTM fixture go away. +# +# ### in monkeys.yml +# +# george: +# id: 1 +# name: George the Monkey +# fruits: apple, orange, grape +# +# +# +# ### in fruits.yml +# +# apple: +# name: apple +# +# orange: +# name: orange +# +# grape: +# name: grape +# +# Zap! No more fruits_monkeys.yml file. We've specified the list of fruits +# on George's fixture, but we could've just as easily specified a list +# of monkeys on each fruit. As with +belongs_to+, Active Record reflects on +# the fixture's model class and discovers the +has_and_belongs_to_many+ +# associations. +# +# === Autofilled \Timestamp Columns +# +# If your table/model specifies any of Active Record's +# standard timestamp columns (+created_at+, +created_on+, +updated_at+, +updated_on+), +# they will automatically be set to Time.now. +# +# If you've set specific values, they'll be left alone. +# +# === Fixture label interpolation +# +# The label of the current fixture is always available as a column value: +# +# geeksomnia: +# name: Geeksomnia's Account +# subdomain: $LABEL +# email: $LABEL@email.com +# +# Also, sometimes (like when porting older join table fixtures) you'll need +# to be able to get a hold of the identifier for a given label. ERB +# to the rescue: +# +# george_reginald: +# monkey_id: <%= ActiveRecord::FixtureSet.identify(:reginald) %> +# pirate_id: <%= ActiveRecord::FixtureSet.identify(:george) %> +# +# If the model uses UUID values for identifiers, add the +:uuid+ argument: +# +# ActiveRecord::FixtureSet.identify(:boaty_mcboatface, :uuid) +# +# === Support for YAML defaults +# +# You can set and reuse defaults in your fixtures YAML file. +# This is the same technique used in the +database.yml+ file to specify +# defaults: +# +# DEFAULTS: &DEFAULTS +# created_on: <%= 3.weeks.ago.to_fs(:db) %> +# +# first: +# name: Smurf +# <<: *DEFAULTS +# +# second: +# name: Fraggle +# <<: *DEFAULTS +# +# Any fixture labeled "DEFAULTS" is safely ignored. +# +# Besides using "DEFAULTS", you can also specify what fixtures will +# be ignored by setting "ignore" in "_fixture" section. +# +# # users.yml +# _fixture: +# ignore: +# - base +# # or use "ignore: base" when there is only one fixture that needs to be ignored. +# +# base: &base +# admin: false +# introduction: "This is a default description" +# +# admin: +# <<: *base +# admin: true +# +# visitor: +# <<: *base +# +# In the above example, 'base' will be ignored when creating fixtures. +# This can be used for common attributes inheriting. +# +# == Composite Primary Key Fixtures +# +# Fixtures for composite primary key tables are fairly similar to normal tables. +# When using an id column, the column may be omitted as usual: +# +# # app/models/book.rb +# class Book < ApplicationRecord +# self.primary_key = [:author_id, :id] +# belongs_to :author +# end +# +# +# +# # books.yml +# alices_adventure_in_wonderland: +# author_id: <%= ActiveRecord::FixtureSet.identify(:lewis_carroll) %> +# title: "Alice's Adventures in Wonderland" +# +# However, in order to support composite primary key relationships, +# you must use the `composite_identify` method: +# +# # app/models/book_orders.rb +# class BookOrder < ApplicationRecord +# self.primary_key = [:shop_id, :id] +# belongs_to :order, foreign_key: [:shop_id, :order_id] +# belongs_to :book, foreign_key: [:author_id, :book_id] +# end +# +# +# +# # book_orders.yml +# alices_adventure_in_wonderland_in_books: +# author: lewis_carroll +# book_id: <%= ActiveRecord::FixtureSet.composite_identify( +# :alices_adventure_in_wonderland, Book.primary_key)[:id] %> +# shop: book_store +# order_id: <%= ActiveRecord::FixtureSet.composite_identify( +# :books, Order.primary_key)[:id] %> +# +# == Configure the fixture model class +# +# It's possible to set the fixture's model class directly in the YAML file. +# This is helpful when fixtures are loaded outside tests and +# +set_fixture_class+ is not available (e.g. +# when running bin/rails db:fixtures:load). +# +# _fixture: +# model_class: User +# david: +# name: David +# +# Any fixtures labeled "_fixture" are safely ignored. +# +# source://activerecord//lib/active_record/fixtures.rb#527 +class ActiveRecord::FixtureSet + # @return [FixtureSet] a new instance of FixtureSet + # + # source://activerecord//lib/active_record/fixtures.rb#713 + def initialize(_, name, class_name, path, config = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/fixtures.rb#724 + def [](x); end + + # source://activerecord//lib/active_record/fixtures.rb#728 + def []=(k, v); end + + # source://activerecord//lib/active_record/fixtures.rb#541 + def all_loaded_fixtures; end + + # source://activerecord//lib/active_record/fixtures.rb#541 + def all_loaded_fixtures=(val); end + + # Returns the value of attribute config. + # + # source://activerecord//lib/active_record/fixtures.rb#711 + def config; end + + # source://activerecord//lib/active_record/fixtures.rb#732 + def each(&block); end + + # Returns the value of attribute fixtures. + # + # source://activerecord//lib/active_record/fixtures.rb#711 + def fixtures; end + + # Returns the value of attribute ignored_fixtures. + # + # source://activerecord//lib/active_record/fixtures.rb#711 + def ignored_fixtures; end + + # Returns the value of attribute model_class. + # + # source://activerecord//lib/active_record/fixtures.rb#711 + def model_class; end + + # Returns the value of attribute name. + # + # source://activerecord//lib/active_record/fixtures.rb#711 + def name; end + + # source://activerecord//lib/active_record/fixtures.rb#736 + def size; end + + # Returns the value of attribute table_name. + # + # source://activerecord//lib/active_record/fixtures.rb#711 + def table_name; end + + # Returns a hash of rows to be inserted. The key is the table, the value is + # a list of rows to insert to that table. + # + # source://activerecord//lib/active_record/fixtures.rb#742 + def table_rows; end + + private + + # source://activerecord//lib/active_record/fixtures.rb#800 + def default_fixture_model_class; end + + # source://activerecord//lib/active_record/fixtures.rb#762 + def ignored_fixtures=(base); end + + # source://activerecord//lib/active_record/fixtures.rb#754 + def model_class=(class_name); end + + # Loads the fixtures from the YAML file at +path+. + # If the file sets the +model_class+ and current instance value is not set, + # it uses the file value. + # + # @raise [ArgumentError] + # + # source://activerecord//lib/active_record/fixtures.rb#781 + def read_fixture_files(path); end + + class << self + # source://activerecord//lib/active_record/fixtures.rb#541 + def all_loaded_fixtures; end + + # source://activerecord//lib/active_record/fixtures.rb#541 + def all_loaded_fixtures=(val); end + + # source://activerecord//lib/active_record/fixtures.rb#576 + def cache_fixtures(connection_pool, fixtures_map); end + + # source://activerecord//lib/active_record/fixtures.rb#560 + def cache_for_connection_pool(connection_pool); end + + # source://activerecord//lib/active_record/fixtures.rb#568 + def cached_fixtures(connection_pool, keys_to_fetch = T.unsafe(nil)); end + + # Returns a consistent, platform-independent hash representing a mapping + # between the label and the subcomponents of the provided composite key. + # + # Example: + # + # composite_identify("label", [:a, :b, :c]) # => { a: hash_1, b: hash_2, c: hash_3 } + # + # source://activerecord//lib/active_record/fixtures.rb#633 + def composite_identify(label, key); end + + # Superclass for the evaluation contexts used by \ERB fixtures. + # + # source://activerecord//lib/active_record/fixtures.rb#641 + def context_class; end + + # source://activerecord//lib/active_record/fixtures.rb#595 + def create_fixtures(fixtures_directories, fixture_set_names, class_names = T.unsafe(nil), config = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/fixtures.rb#544 + def default_fixture_model_name(fixture_set_name, config = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/fixtures.rb#550 + def default_fixture_table_name(fixture_set_name, config = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/fixtures.rb#564 + def fixture_is_cached?(connection_pool, table_name); end + + # Returns a consistent, platform-independent identifier for +label+. + # + # \Integer identifiers are values less than 2^30. UUIDs are RFC 4122 version 5 SHA-1 hashes. + # + # source://activerecord//lib/active_record/fixtures.rb#619 + def identify(label, column_type = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/fixtures.rb#589 + def instantiate_all_loaded_fixtures(object, load_instances = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/fixtures.rb#580 + def instantiate_fixtures(object, fixture_set, load_instances = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/fixtures.rb#556 + def reset_cache; end + + private + + # source://activerecord//lib/active_record/fixtures.rb#696 + def check_all_foreign_keys_valid!(conn); end + + # source://activerecord//lib/active_record/fixtures.rb#665 + def insert(fixture_sets, connection_pool); end + + # source://activerecord//lib/active_record/fixtures.rb#646 + def read_and_insert(fixtures_directories, fixture_files, class_names, connection_pool); end + + # source://activerecord//lib/active_record/fixtures.rb#706 + def update_all_loaded_fixtures(fixtures_map); end + end +end + +# source://activerecord//lib/active_record/fixture_set/file.rb#7 +class ActiveRecord::FixtureSet::File + include ::Enumerable + + # @return [File] a new instance of File + # + # source://activerecord//lib/active_record/fixture_set/file.rb#19 + def initialize(file); end + + # source://activerecord//lib/active_record/fixture_set/file.rb#23 + def each(&block); end + + # source://activerecord//lib/active_record/fixture_set/file.rb#31 + def ignored_fixtures; end + + # source://activerecord//lib/active_record/fixture_set/file.rb#27 + def model_class; end + + private + + # source://activerecord//lib/active_record/fixture_set/file.rb#40 + def config_row; end + + # source://activerecord//lib/active_record/fixture_set/file.rb#51 + def raw_rows; end + + # source://activerecord//lib/active_record/fixture_set/file.rb#36 + def rows; end + + # Validate our unmarshalled data. + # + # source://activerecord//lib/active_record/fixture_set/file.rb#76 + def validate(data); end + + # source://activerecord//lib/active_record/fixture_set/file.rb#61 + def validate_config_row(data); end + + class << self + # Open a fixture file named +file+. When called with a block, the block + # is called with the filehandle and the filehandle is automatically closed + # when the block finishes. + # + # source://activerecord//lib/active_record/fixture_set/file.rb#14 + def open(file); end + end +end + +# -- +# An instance of FixtureSet is normally stored in a single YAML file and +# possibly in a folder with the same name. +# ++ +# +# source://activerecord//lib/active_record/fixtures.rb#537 +ActiveRecord::FixtureSet::MAX_ID = T.let(T.unsafe(nil), Integer) + +# source://activerecord//lib/active_record/fixture_set/model_metadata.rb#5 +class ActiveRecord::FixtureSet::ModelMetadata + # @return [ModelMetadata] a new instance of ModelMetadata + # + # source://activerecord//lib/active_record/fixture_set/model_metadata.rb#6 + def initialize(model_class); end + + # source://activerecord//lib/active_record/fixture_set/model_metadata.rb#29 + def column_names; end + + # source://activerecord//lib/active_record/fixture_set/model_metadata.rb#18 + def column_type(column_name); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/fixture_set/model_metadata.rb#25 + def has_column?(column_name); end + + # source://activerecord//lib/active_record/fixture_set/model_metadata.rb#37 + def inheritance_column_name; end + + # source://activerecord//lib/active_record/fixture_set/model_metadata.rb#10 + def primary_key_name; end + + # source://activerecord//lib/active_record/fixture_set/model_metadata.rb#14 + def primary_key_type; end + + # source://activerecord//lib/active_record/fixture_set/model_metadata.rb#33 + def timestamp_column_names; end +end + +# NOTE: This class has to be defined in compact style in +# order for rendering context subclassing to work correctly. +# +# source://activerecord//lib/active_record/fixture_set/render_context.rb#7 +class ActiveRecord::FixtureSet::RenderContext + class << self + # source://activerecord//lib/active_record/fixture_set/render_context.rb#8 + def create_subclass; end + end +end + +# source://activerecord//lib/active_record/fixture_set/table_row.rb#5 +class ActiveRecord::FixtureSet::TableRow + # @return [TableRow] a new instance of TableRow + # + # source://activerecord//lib/active_record/fixture_set/table_row.rb#65 + def initialize(fixture, table_rows:, label:, now:); end + + # source://activerecord//lib/active_record/fixture_set/table_row.rb#73 + def to_hash; end + + private + + # source://activerecord//lib/active_record/fixture_set/table_row.rb#186 + def add_join_records(association); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/fixture_set/table_row.rb#136 + def column_defined?(col); end + + # source://activerecord//lib/active_record/fixture_set/table_row.rb#86 + def fill_row_model_attributes; end + + # source://activerecord//lib/active_record/fixture_set/table_row.rb#103 + def fill_timestamps; end + + # source://activerecord//lib/active_record/fixture_set/table_row.rb#127 + def generate_composite_primary_key; end + + # source://activerecord//lib/active_record/fixture_set/table_row.rb#119 + def generate_primary_key; end + + # source://activerecord//lib/active_record/fixture_set/table_row.rb#112 + def interpolate_label; end + + # source://activerecord//lib/active_record/fixture_set/table_row.rb#82 + def model_class; end + + # source://activerecord//lib/active_record/fixture_set/table_row.rb#78 + def model_metadata; end + + # source://activerecord//lib/active_record/fixture_set/table_row.rb#95 + def reflection_class; end + + # source://activerecord//lib/active_record/fixture_set/table_row.rb#140 + def resolve_enums; end + + # source://activerecord//lib/active_record/fixture_set/table_row.rb#148 + def resolve_sti_reflections; end +end + +# source://activerecord//lib/active_record/fixture_set/table_row.rb#24 +class ActiveRecord::FixtureSet::TableRow::HasManyThroughProxy < ::ActiveRecord::FixtureSet::TableRow::ReflectionProxy + # source://activerecord//lib/active_record/fixture_set/table_row.rb#33 + def join_table; end + + # source://activerecord//lib/active_record/fixture_set/table_row.rb#29 + def lhs_key; end + + # source://activerecord//lib/active_record/fixture_set/table_row.rb#25 + def rhs_key; end + + # source://activerecord//lib/active_record/fixture_set/table_row.rb#37 + def timestamp_column_names; end +end + +# source://activerecord//lib/active_record/fixture_set/table_row.rb#42 +class ActiveRecord::FixtureSet::TableRow::PrimaryKeyError < ::StandardError + # @return [PrimaryKeyError] a new instance of PrimaryKeyError + # + # source://activerecord//lib/active_record/fixture_set/table_row.rb#43 + def initialize(label, association, value); end +end + +# source://activerecord//lib/active_record/fixture_set/table_row.rb#6 +class ActiveRecord::FixtureSet::TableRow::ReflectionProxy + # @return [ReflectionProxy] a new instance of ReflectionProxy + # + # source://activerecord//lib/active_record/fixture_set/table_row.rb#7 + def initialize(association); end + + # source://activerecord//lib/active_record/fixture_set/table_row.rb#11 + def join_table; end + + # source://activerecord//lib/active_record/fixture_set/table_row.rb#15 + def name; end + + # source://activerecord//lib/active_record/fixture_set/table_row.rb#19 + def primary_key_type; end +end + +# source://activerecord//lib/active_record/fixture_set/table_rows.rb#8 +class ActiveRecord::FixtureSet::TableRows + # @return [TableRows] a new instance of TableRows + # + # source://activerecord//lib/active_record/fixture_set/table_rows.rb#9 + def initialize(table_name, model_class:, fixtures:); end + + # Returns the value of attribute model_class. + # + # source://activerecord//lib/active_record/fixture_set/table_rows.rb#21 + def model_class; end + + # source://activerecord//lib/active_record/fixture_set/table_rows.rb#27 + def model_metadata; end + + # Returns the value of attribute tables. + # + # source://activerecord//lib/active_record/fixture_set/table_rows.rb#21 + def tables; end + + # source://activerecord//lib/active_record/fixture_set/table_rows.rb#23 + def to_hash; end + + private + + # source://activerecord//lib/active_record/fixture_set/table_rows.rb#32 + def build_table_rows_from(table_name, fixtures); end +end + +# source://activerecord//lib/active_record/future_result.rb#4 +class ActiveRecord::FutureResult + # @return [FutureResult] a new instance of FutureResult + # + # source://activerecord//lib/active_record/future_result.rb#66 + def initialize(pool, *args, **kwargs); end + + # source://activerecord//lib/active_record/future_result.rb#94 + def cancel; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/future_result.rb#139 + def canceled?; end + + # source://activerecord//lib/active_record/future_result.rb#62 + def empty?(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/future_result.rb#90 + def execute!(connection); end + + # source://activerecord//lib/active_record/future_result.rb#100 + def execute_or_skip; end + + # Returns the value of attribute lock_wait. + # + # source://activerecord//lib/active_record/future_result.rb#64 + def lock_wait; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/future_result.rb#135 + def pending?; end + + # source://activerecord//lib/active_record/future_result.rb#122 + def result; end + + # source://activerecord//lib/active_record/future_result.rb#85 + def schedule!(session); end + + # source://activerecord//lib/active_record/future_result.rb#81 + def then(&block); end + + # source://activerecord//lib/active_record/future_result.rb#62 + def to_a(*_arg0, **_arg1, &_arg2); end + + private + + # source://activerecord//lib/active_record/future_result.rb#169 + def exec_query(connection, *args, **kwargs); end + + # source://activerecord//lib/active_record/future_result.rb#144 + def execute_or_wait; end + + # source://activerecord//lib/active_record/future_result.rb#161 + def execute_query(connection, async: T.unsafe(nil)); end + + class << self + # source://activerecord//lib/active_record/future_result.rb#53 + def wrap(result); end + end +end + +# source://activerecord//lib/active_record/future_result.rb#51 +class ActiveRecord::FutureResult::Canceled < ::ActiveRecord::ActiveRecordError; end + +# source://activerecord//lib/active_record/future_result.rb#5 +class ActiveRecord::FutureResult::Complete + # @return [Complete] a new instance of Complete + # + # source://activerecord//lib/active_record/future_result.rb#9 + def initialize(result); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/future_result.rb#17 + def canceled?; end + + # source://activerecord//lib/active_record/future_result.rb#7 + def empty?(*_arg0, **_arg1, &_arg2); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/future_result.rb#13 + def pending?; end + + # Returns the value of attribute result. + # + # source://activerecord//lib/active_record/future_result.rb#6 + def result; end + + # source://activerecord//lib/active_record/future_result.rb#21 + def then(&block); end + + # source://activerecord//lib/active_record/future_result.rb#7 + def to_a(*_arg0, **_arg1, &_arg2); end +end + +# source://activerecord//lib/active_record/future_result.rb#26 +class ActiveRecord::FutureResult::EventBuffer + # @return [EventBuffer] a new instance of EventBuffer + # + # source://activerecord//lib/active_record/future_result.rb#27 + def initialize(future_result, instrumenter); end + + # source://activerecord//lib/active_record/future_result.rb#42 + def flush; end + + # source://activerecord//lib/active_record/future_result.rb#33 + def instrument(name, payload = T.unsafe(nil), &block); end +end + +# source://activerecord//lib/active_record/future_result.rb#173 +class ActiveRecord::FutureResult::SelectAll < ::ActiveRecord::FutureResult + private + + # source://activerecord//lib/active_record/future_result.rb#175 + def exec_query(*_arg0, **_arg1); end +end + +# source://activerecord//lib/active_record/associations/errors.rb#74 +class ActiveRecord::HasManyThroughAssociationNotFoundError < ::ActiveRecord::ActiveRecordError + include ::DidYouMean::Correctable + + # @return [HasManyThroughAssociationNotFoundError] a new instance of HasManyThroughAssociationNotFoundError + # + # source://activerecord//lib/active_record/associations/errors.rb#77 + def initialize(owner_class = T.unsafe(nil), reflection = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/associations/errors.rb#90 + def corrections; end + + # Returns the value of attribute owner_class. + # + # source://activerecord//lib/active_record/associations/errors.rb#75 + def owner_class; end + + # Returns the value of attribute reflection. + # + # source://activerecord//lib/active_record/associations/errors.rb#75 + def reflection; end +end + +# source://activerecord//lib/active_record/associations/errors.rb#124 +class ActiveRecord::HasManyThroughAssociationPointlessSourceTypeError < ::ActiveRecord::ActiveRecordError + # @return [HasManyThroughAssociationPointlessSourceTypeError] a new instance of HasManyThroughAssociationPointlessSourceTypeError + # + # source://activerecord//lib/active_record/associations/errors.rb#125 + def initialize(owner_class_name = T.unsafe(nil), reflection = T.unsafe(nil), source_reflection = T.unsafe(nil)); end +end + +# source://activerecord//lib/active_record/associations/errors.rb#104 +class ActiveRecord::HasManyThroughAssociationPolymorphicSourceError < ::ActiveRecord::ActiveRecordError + # @return [HasManyThroughAssociationPolymorphicSourceError] a new instance of HasManyThroughAssociationPolymorphicSourceError + # + # source://activerecord//lib/active_record/associations/errors.rb#105 + def initialize(owner_class_name = T.unsafe(nil), reflection = T.unsafe(nil), source_reflection = T.unsafe(nil)); end +end + +# source://activerecord//lib/active_record/associations/errors.rb#114 +class ActiveRecord::HasManyThroughAssociationPolymorphicThroughError < ::ActiveRecord::ActiveRecordError + # @return [HasManyThroughAssociationPolymorphicThroughError] a new instance of HasManyThroughAssociationPolymorphicThroughError + # + # source://activerecord//lib/active_record/associations/errors.rb#115 + def initialize(owner_class_name = T.unsafe(nil), reflection = T.unsafe(nil)); end +end + +# source://activerecord//lib/active_record/associations/errors.rb#218 +class ActiveRecord::HasManyThroughCantAssociateThroughHasOneOrManyReflection < ::ActiveRecord::ThroughCantAssociateThroughHasOneOrManyReflection; end + +# source://activerecord//lib/active_record/associations/errors.rb#234 +class ActiveRecord::HasManyThroughNestedAssociationsAreReadonly < ::ActiveRecord::ThroughNestedAssociationsAreReadonly; end + +# source://activerecord//lib/active_record/associations/errors.rb#167 +class ActiveRecord::HasManyThroughOrderError < ::ActiveRecord::ActiveRecordError + # @return [HasManyThroughOrderError] a new instance of HasManyThroughOrderError + # + # source://activerecord//lib/active_record/associations/errors.rb#168 + def initialize(owner_class_name = T.unsafe(nil), reflection = T.unsafe(nil), through_reflection = T.unsafe(nil)); end +end + +# source://activerecord//lib/active_record/associations/errors.rb#154 +class ActiveRecord::HasManyThroughSourceAssociationNotFoundError < ::ActiveRecord::ActiveRecordError + # @return [HasManyThroughSourceAssociationNotFoundError] a new instance of HasManyThroughSourceAssociationNotFoundError + # + # source://activerecord//lib/active_record/associations/errors.rb#155 + def initialize(reflection = T.unsafe(nil)); end +end + +# source://activerecord//lib/active_record/associations/errors.rb#144 +class ActiveRecord::HasOneAssociationPolymorphicThroughError < ::ActiveRecord::ActiveRecordError + # @return [HasOneAssociationPolymorphicThroughError] a new instance of HasOneAssociationPolymorphicThroughError + # + # source://activerecord//lib/active_record/associations/errors.rb#145 + def initialize(owner_class_name = T.unsafe(nil), reflection = T.unsafe(nil)); end +end + +# source://activerecord//lib/active_record/associations/errors.rb#134 +class ActiveRecord::HasOneThroughCantAssociateThroughCollection < ::ActiveRecord::ActiveRecordError + # @return [HasOneThroughCantAssociateThroughCollection] a new instance of HasOneThroughCantAssociateThroughCollection + # + # source://activerecord//lib/active_record/associations/errors.rb#135 + def initialize(owner_class_name = T.unsafe(nil), reflection = T.unsafe(nil), through_reflection = T.unsafe(nil)); end +end + +# source://activerecord//lib/active_record/associations/errors.rb#221 +class ActiveRecord::HasOneThroughCantAssociateThroughHasOneOrManyReflection < ::ActiveRecord::ThroughCantAssociateThroughHasOneOrManyReflection; end + +# source://activerecord//lib/active_record/associations/errors.rb#237 +class ActiveRecord::HasOneThroughNestedAssociationsAreReadonly < ::ActiveRecord::ThroughNestedAssociationsAreReadonly; end + +# source://activerecord//lib/active_record/migration.rb#121 +class ActiveRecord::IllegalMigrationNameError < ::ActiveRecord::MigrationError + # @return [IllegalMigrationNameError] a new instance of IllegalMigrationNameError + # + # source://activerecord//lib/active_record/migration.rb#122 + def initialize(name = T.unsafe(nil)); end +end + +# = Single table inheritance +# +# Active Record allows inheritance by storing the name of the class in a column that by +# default is named "type" (can be changed by overwriting Base.inheritance_column). +# This means that an inheritance looking like this: +# +# class Company < ActiveRecord::Base; end +# class Firm < Company; end +# class Client < Company; end +# class PriorityClient < Client; end +# +# When you do Firm.create(name: "37signals"), this record will be saved in +# the companies table with type = "Firm". You can then fetch this row again using +# Company.where(name: '37signals').first and it will return a Firm object. +# +# Be aware that because the type column is an attribute on the record every new +# subclass will instantly be marked as dirty and the type column will be included +# in the list of changed attributes on the record. This is different from non +# Single Table Inheritance(STI) classes: +# +# Company.new.changed? # => false +# Firm.new.changed? # => true +# Firm.new.changes # => {"type"=>["","Firm"]} +# +# If you don't have a type column defined in your table, single-table inheritance won't +# be triggered. In that case, it'll work just like normal subclasses with no special magic +# for differentiating between them or reloading the right type with find. +# +# Note, all the attributes for all the cases are kept in the same table. +# Read more: +# * https://www.martinfowler.com/eaaCatalog/singleTableInheritance.html +# +# source://activerecord//lib/active_record/inheritance.rb#39 +module ActiveRecord::Inheritance + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + private + + # Sets the attribute used for single table inheritance to this class name if this is not the + # ActiveRecord::Base descendant. + # Considering the hierarchy Reply < Message < ActiveRecord::Base, this makes it possible to + # do Reply.new without having to set Reply[Reply.inheritance_column] = "Reply" yourself. + # No such attribute would be set for objects of the Message class in that example. + # + # source://activerecord//lib/active_record/inheritance.rb#359 + def ensure_proper_type; end + + # source://activerecord//lib/active_record/inheritance.rb#343 + def initialize_dup(other); end + + # source://activerecord//lib/active_record/inheritance.rb#349 + def initialize_internals_callback; end + + module GeneratedClassMethods + def store_full_class_name; end + def store_full_class_name=(value); end + def store_full_class_name?; end + def store_full_sti_class; end + def store_full_sti_class=(value); end + def store_full_sti_class?; end + end + + module GeneratedInstanceMethods + def store_full_class_name; end + def store_full_class_name?; end + def store_full_sti_class; end + def store_full_sti_class?; end + end +end + +# source://activerecord//lib/active_record/inheritance.rb#52 +module ActiveRecord::Inheritance::ClassMethods + # Set this to +true+ if this is an abstract class (see + # abstract_class?). + # If you are using inheritance with Active Record and don't want a class + # to be considered as part of the STI hierarchy, you must set this to + # true. + # +ApplicationRecord+, for example, is generated as an abstract class. + # + # Consider the following default behavior: + # + # Shape = Class.new(ActiveRecord::Base) + # Polygon = Class.new(Shape) + # Square = Class.new(Polygon) + # + # Shape.table_name # => "shapes" + # Polygon.table_name # => "shapes" + # Square.table_name # => "shapes" + # Shape.create! # => # + # Polygon.create! # => # + # Square.create! # => # + # + # However, when using abstract_class, +Shape+ is omitted from + # the hierarchy: + # + # class Shape < ActiveRecord::Base + # self.abstract_class = true + # end + # Polygon = Class.new(Shape) + # Square = Class.new(Polygon) + # + # Shape.table_name # => nil + # Polygon.table_name # => "polygons" + # Square.table_name # => "polygons" + # Shape.create! # => NotImplementedError: Shape is an abstract class and cannot be instantiated. + # Polygon.create! # => # + # Square.create! # => # + # + # Note that in the above example, to disallow the creation of a plain + # +Polygon+, you should use validates :type, presence: true, + # instead of setting it as an abstract class. This way, +Polygon+ will + # stay in the hierarchy, and Active Record will continue to correctly + # derive the table name. + # + # source://activerecord//lib/active_record/inheritance.rb#164 + def abstract_class; end + + # Set this to +true+ if this is an abstract class (see + # abstract_class?). + # If you are using inheritance with Active Record and don't want a class + # to be considered as part of the STI hierarchy, you must set this to + # true. + # +ApplicationRecord+, for example, is generated as an abstract class. + # + # Consider the following default behavior: + # + # Shape = Class.new(ActiveRecord::Base) + # Polygon = Class.new(Shape) + # Square = Class.new(Polygon) + # + # Shape.table_name # => "shapes" + # Polygon.table_name # => "shapes" + # Square.table_name # => "shapes" + # Shape.create! # => # + # Polygon.create! # => # + # Square.create! # => # + # + # However, when using abstract_class, +Shape+ is omitted from + # the hierarchy: + # + # class Shape < ActiveRecord::Base + # self.abstract_class = true + # end + # Polygon = Class.new(Shape) + # Square = Class.new(Polygon) + # + # Shape.table_name # => nil + # Polygon.table_name # => "polygons" + # Square.table_name # => "polygons" + # Shape.create! # => NotImplementedError: Shape is an abstract class and cannot be instantiated. + # Polygon.create! # => # + # Square.create! # => # + # + # Note that in the above example, to disallow the creation of a plain + # +Polygon+, you should use validates :type, presence: true, + # instead of setting it as an abstract class. This way, +Polygon+ will + # stay in the hierarchy, and Active Record will continue to correctly + # derive the table name. + # + # source://activerecord//lib/active_record/inheritance.rb#164 + def abstract_class=(_arg0); end + + # Returns whether this class is an abstract class or not. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/inheritance.rb#167 + def abstract_class?; end + + # Returns the first class in the inheritance hierarchy that descends from either an + # abstract class or from ActiveRecord::Base. + # + # Consider the following behavior: + # + # class ApplicationRecord < ActiveRecord::Base + # self.abstract_class = true + # end + # class Shape < ApplicationRecord + # self.abstract_class = true + # end + # Polygon = Class.new(Shape) + # Square = Class.new(Polygon) + # + # ApplicationRecord.base_class # => ApplicationRecord + # Shape.base_class # => Shape + # Polygon.base_class # => Polygon + # Square.base_class # => Polygon + # + # source://activerecord//lib/active_record/inheritance.rb#115 + def base_class; end + + # Returns whether the class is a base class. + # See #base_class for more information. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/inheritance.rb#119 + def base_class?; end + + # Returns +true+ if this does not need STI type condition. Returns + # +false+ if STI type condition needs to be applied. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/inheritance.rb#82 + def descends_from_active_record?; end + + # source://activerecord//lib/active_record/inheritance.rb#226 + def dup; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/inheritance.rb#92 + def finder_needs_type_condition?; end + + # Determines if one of the attributes passed in is the inheritance column, + # and if the inheritance column is attr accessible, it initializes an + # instance of the given subclass instead of the base class. + # + # source://activerecord//lib/active_record/inheritance.rb#56 + def new(attributes = T.unsafe(nil), &block); end + + # Returns the class for the provided +name+. + # + # It is used to find the class correspondent to the value stored in the polymorphic type column. + # + # source://activerecord//lib/active_record/inheritance.rb#218 + def polymorphic_class_for(name); end + + # Returns the value to be stored in the polymorphic type column for Polymorphic Associations. + # + # source://activerecord//lib/active_record/inheritance.rb#211 + def polymorphic_name; end + + # Sets the application record class for Active Record + # + # This is useful if your application uses a different class than + # ApplicationRecord for your primary abstract class. This class + # will share a database connection with Active Record. It is the class + # that connects to your primary database. + # + # source://activerecord//lib/active_record/inheritance.rb#177 + def primary_abstract_class; end + + # Returns the class for the provided +type_name+. + # + # It is used to find the class correspondent to the value stored in the inheritance column. + # + # source://activerecord//lib/active_record/inheritance.rb#194 + def sti_class_for(type_name); end + + # Returns the value to be stored in the inheritance column for STI. + # + # source://activerecord//lib/active_record/inheritance.rb#187 + def sti_name; end + + protected + + # Returns the class type of the record using the current module as a prefix. So descendants of + # MyApp::Business::Account would appear as MyApp::Business::AccountSubclass. + # + # source://activerecord//lib/active_record/inheritance.rb#242 + def compute_type(type_name); end + + # source://activerecord//lib/active_record/inheritance.rb#270 + def set_base_class; end + + private + + # Called by +instantiate+ to decide which class to use for a new + # record instance. For single-table inheritance, we check the record + # for a +type+ column and return the corresponding class. + # + # source://activerecord//lib/active_record/inheritance.rb#299 + def discriminate_class_for_record(record); end + + # source://activerecord//lib/active_record/inheritance.rb#311 + def find_sti_class(type_name); end + + # source://activerecord//lib/active_record/inheritance.rb#287 + def inherited(subclass); end + + # source://activerecord//lib/active_record/inheritance.rb#234 + def initialize_clone(other); end + + # Detect the subclass from the inheritance column of attrs. If the inheritance column value + # is not self or a valid subclass, raises ActiveRecord::SubclassNotFound + # + # source://activerecord//lib/active_record/inheritance.rb#331 + def subclass_from_attributes(attrs); end + + # source://activerecord//lib/active_record/inheritance.rb#322 + def type_condition(table = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/inheritance.rb#307 + def using_single_table_inheritance?(record); end +end + +# source://activerecord//lib/active_record/insert_all.rb#6 +class ActiveRecord::InsertAll + # @return [InsertAll] a new instance of InsertAll + # + # source://activerecord//lib/active_record/insert_all.rb#18 + def initialize(relation, connection, inserts, on_duplicate:, update_only: T.unsafe(nil), returning: T.unsafe(nil), unique_by: T.unsafe(nil), record_timestamps: T.unsafe(nil)); end + + # Returns the value of attribute connection. + # + # source://activerecord//lib/active_record/insert_all.rb#7 + def connection; end + + # source://activerecord//lib/active_record/insert_all.rb#48 + def execute; end + + # Returns the value of attribute inserts. + # + # source://activerecord//lib/active_record/insert_all.rb#7 + def inserts; end + + # Returns the value of attribute keys. + # + # source://activerecord//lib/active_record/insert_all.rb#7 + def keys; end + + # TODO: Consider renaming this method, as it only conditionally extends keys, not always + # + # source://activerecord//lib/active_record/insert_all.rb#92 + def keys_including_timestamps; end + + # source://activerecord//lib/active_record/insert_all.rb#73 + def map_key_with_value; end + + # Returns the value of attribute model. + # + # source://activerecord//lib/active_record/insert_all.rb#7 + def model; end + + # Returns the value of attribute on_duplicate. + # + # source://activerecord//lib/active_record/insert_all.rb#8 + def on_duplicate; end + + # source://activerecord//lib/active_record/insert_all.rb#61 + def primary_keys; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/insert_all.rb#87 + def record_timestamps?; end + + # Returns the value of attribute returning. + # + # source://activerecord//lib/active_record/insert_all.rb#8 + def returning; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/insert_all.rb#65 + def skip_duplicates?; end + + # Returns the value of attribute unique_by. + # + # source://activerecord//lib/active_record/insert_all.rb#8 + def unique_by; end + + # source://activerecord//lib/active_record/insert_all.rb#57 + def updatable_columns; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/insert_all.rb#69 + def update_duplicates?; end + + # Returns the value of attribute update_only. + # + # source://activerecord//lib/active_record/insert_all.rb#8 + def update_only; end + + # Returns the value of attribute update_sql. + # + # source://activerecord//lib/active_record/insert_all.rb#8 + def update_sql; end + + private + + # source://activerecord//lib/active_record/insert_all.rb#129 + def configure_on_duplicate_update_logic; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/insert_all.rb#145 + def custom_update_sql_provided?; end + + # @raise [ArgumentError] + # + # source://activerecord//lib/active_record/insert_all.rb#212 + def disallow_raw_sql!(value); end + + # source://activerecord//lib/active_record/insert_all.rb#173 + def ensure_valid_options_for_connection!; end + + # source://activerecord//lib/active_record/insert_all.rb#149 + def find_unique_index_for(unique_by); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/insert_all.rb#101 + def has_attribute_aliases?(attributes); end + + # source://activerecord//lib/active_record/insert_all.rb#197 + def readonly_columns; end + + # source://activerecord//lib/active_record/insert_all.rb#125 + def resolve_attribute_alias(attribute); end + + # source://activerecord//lib/active_record/insert_all.rb#114 + def resolve_attribute_aliases; end + + # source://activerecord//lib/active_record/insert_all.rb#105 + def resolve_sti; end + + # source://activerecord//lib/active_record/insert_all.rb#221 + def timestamps_for_create; end + + # source://activerecord//lib/active_record/insert_all.rb#192 + def to_sql; end + + # source://activerecord//lib/active_record/insert_all.rb#201 + def unique_by_columns; end + + # source://activerecord//lib/active_record/insert_all.rb#169 + def unique_indexes; end + + # source://activerecord//lib/active_record/insert_all.rb#206 + def verify_attributes(attributes); end + + class << self + # source://activerecord//lib/active_record/insert_all.rb#11 + def execute(relation, *_arg1, **_arg2, &_arg3); end + end +end + +# source://activerecord//lib/active_record/insert_all.rb#225 +class ActiveRecord::InsertAll::Builder + # @return [Builder] a new instance of Builder + # + # source://activerecord//lib/active_record/insert_all.rb#230 + def initialize(insert_all); end + + # source://activerecord//lib/active_record/insert_all.rb#270 + def conflict_target; end + + # source://activerecord//lib/active_record/insert_all.rb#234 + def into; end + + # source://activerecord//lib/active_record/insert_all.rb#228 + def keys(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/insert_all.rb#228 + def keys_including_timestamps(*_arg0, **_arg1, &_arg2); end + + # Returns the value of attribute model. + # + # source://activerecord//lib/active_record/insert_all.rb#226 + def model; end + + # source://activerecord//lib/active_record/insert_all.rb#228 + def primary_keys(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/insert_all.rb#294 + def raw_update_sql; end + + # source://activerecord//lib/active_record/insert_all.rb#298 + def raw_update_sql?; end + + # source://activerecord//lib/active_record/insert_all.rb#228 + def record_timestamps?(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/insert_all.rb#254 + def returning; end + + # source://activerecord//lib/active_record/insert_all.rb#228 + def skip_duplicates?(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/insert_all.rb#284 + def touch_model_timestamps_unless(&block); end + + # source://activerecord//lib/active_record/insert_all.rb#280 + def updatable_columns; end + + # source://activerecord//lib/active_record/insert_all.rb#228 + def update_duplicates?(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/insert_all.rb#238 + def values_list; end + + private + + # source://activerecord//lib/active_record/insert_all.rb#307 + def columns_list; end + + # Returns the value of attribute connection. + # + # source://activerecord//lib/active_record/insert_all.rb#301 + def connection; end + + # @raise [UnknownAttributeError] + # + # source://activerecord//lib/active_record/insert_all.rb#311 + def extract_types_for(keys); end + + # source://activerecord//lib/active_record/insert_all.rb#320 + def format_columns(columns); end + + # Returns the value of attribute insert_all. + # + # source://activerecord//lib/active_record/insert_all.rb#301 + def insert_all; end + + # source://activerecord//lib/active_record/insert_all.rb#328 + def quote_column(column); end + + # source://activerecord//lib/active_record/insert_all.rb#324 + def quote_columns(columns); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/insert_all.rb#303 + def touch_timestamp_attribute?(column_name); end +end + +# source://activerecord//lib/active_record/integration.rb#6 +module ActiveRecord::Integration + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveRecord::Integration::ClassMethods + + # Returns a stable cache key that can be used to identify this record. + # + # Product.new.cache_key # => "products/new" + # Product.find(5).cache_key # => "products/5" + # + # If ActiveRecord::Base.cache_versioning is turned off, as it was in \Rails 5.1 and earlier, + # the cache key will also include a version. + # + # Product.cache_versioning = false + # Product.find(5).cache_key # => "products/5-20071224150000" (updated_at available) + # + # source://activerecord//lib/active_record/integration.rb#72 + def cache_key; end + + # Returns a cache key along with the version. + # + # source://activerecord//lib/active_record/integration.rb#114 + def cache_key_with_version; end + + # Returns a cache version that can be used together with the cache key to form + # a recyclable caching scheme. By default, the #updated_at column is used for the + # cache_version, but this method can be overwritten to return something else. + # + # Note, this method will return nil if ActiveRecord::Base.cache_versioning is set to + # +false+. + # + # source://activerecord//lib/active_record/integration.rb#97 + def cache_version; end + + # Returns a +String+, which Action Pack uses for constructing a URL to this + # object. The default implementation returns this record's id as a +String+, + # or +nil+ if this record's unsaved. + # + # For example, suppose that you have a User model, and that you have a + # resources :users route. Normally, +user_path+ will + # construct a path with the user object's 'id' in it: + # + # user = User.find_by(name: 'Phusion') + # user_path(user) # => "/users/1" + # + # You can override +to_param+ in your model to make +user_path+ construct + # a path using the user's name instead of the user's id: + # + # class User < ActiveRecord::Base + # def to_param # overridden + # name + # end + # end + # + # user = User.find_by(name: 'Phusion') + # user_path(user) # => "/users/Phusion" + # + # source://activerecord//lib/active_record/integration.rb#57 + def to_param; end + + private + + # Detects if the value before type cast + # can be used to generate a cache_version. + # + # The fast cache version only works with a + # string value directly from the database. + # + # We also must check if the timestamp format has been changed + # or if the timezone is not set to UTC then + # we cannot apply our transformations correctly. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/integration.rb#178 + def can_use_fast_cache_version?(timestamp); end + + # Converts a raw database string to `:usec` + # format. + # + # Example: + # + # timestamp = "2018-10-15 20:02:15.266505" + # raw_timestamp_to_cache_version(timestamp) + # # => "20181015200215266505" + # + # PostgreSQL truncates trailing zeros, + # https://github.com/postgres/postgres/commit/3e1beda2cde3495f41290e1ece5d544525810214 + # to account for this we pad the output with zeros + # + # source://activerecord//lib/active_record/integration.rb#200 + def raw_timestamp_to_cache_version(timestamp); end + + module GeneratedClassMethods + def cache_timestamp_format; end + def cache_timestamp_format=(value); end + def cache_timestamp_format?; end + def cache_versioning; end + def cache_versioning=(value); end + def cache_versioning?; end + def collection_cache_versioning; end + def collection_cache_versioning=(value); end + def collection_cache_versioning?; end + end + + module GeneratedInstanceMethods + def cache_timestamp_format; end + def cache_timestamp_format?; end + def cache_versioning; end + def cache_versioning?; end + def collection_cache_versioning; end + def collection_cache_versioning?; end + end +end + +# source://activerecord//lib/active_record/integration.rb#122 +module ActiveRecord::Integration::ClassMethods + # source://activerecord//lib/active_record/integration.rb#163 + def collection_cache_key(collection = T.unsafe(nil), timestamp_column = T.unsafe(nil)); end + + # Defines your model's +to_param+ method to generate "pretty" URLs + # using +method_name+, which can be any attribute or method that + # responds to +to_s+. + # + # class User < ActiveRecord::Base + # to_param :name + # end + # + # user = User.find_by(name: 'Fancy Pants') + # user.id # => 123 + # user_path(user) # => "/users/123-fancy-pants" + # + # Values longer than 20 characters will be truncated. The value + # is truncated word by word. + # + # user = User.find_by(name: 'David Heinemeier Hansson') + # user.id # => 125 + # user_path(user) # => "/users/125-david-heinemeier" + # + # Because the generated param begins with the record's +id+, it is + # suitable for passing to +find+. In a controller, for example: + # + # params[:id] # => "123-fancy-pants" + # User.find(params[:id]).id # => 123 + # + # source://activerecord//lib/active_record/integration.rb#147 + def to_param(method_name = T.unsafe(nil)); end +end + +# This class is used to create a table that keeps track of values and keys such +# as which environment migrations were run in. +# +# This is enabled by default. To disable this functionality set +# `use_metadata_table` to false in your database configuration. +# +# source://activerecord//lib/active_record/internal_metadata.rb#12 +class ActiveRecord::InternalMetadata + # @return [InternalMetadata] a new instance of InternalMetadata + # + # source://activerecord//lib/active_record/internal_metadata.rb#18 + def initialize(pool); end + + # source://activerecord//lib/active_record/internal_metadata.rb#47 + def [](key); end + + # source://activerecord//lib/active_record/internal_metadata.rb#39 + def []=(key, value); end + + # Returns the value of attribute arel_table. + # + # source://activerecord//lib/active_record/internal_metadata.rb#16 + def arel_table; end + + # source://activerecord//lib/active_record/internal_metadata.rb#65 + def count; end + + # Creates an internal metadata table with columns +key+ and +value+ + # + # source://activerecord//lib/active_record/internal_metadata.rb#85 + def create_table; end + + # source://activerecord//lib/active_record/internal_metadata.rb#74 + def create_table_and_set_flags(environment, schema_sha1 = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/internal_metadata.rb#57 + def delete_all_entries; end + + # source://activerecord//lib/active_record/internal_metadata.rb#99 + def drop_table; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/internal_metadata.rb#35 + def enabled?; end + + # source://activerecord//lib/active_record/internal_metadata.rb#23 + def primary_key; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/internal_metadata.rb#107 + def table_exists?; end + + # source://activerecord//lib/active_record/internal_metadata.rb#31 + def table_name; end + + # source://activerecord//lib/active_record/internal_metadata.rb#27 + def value_key; end + + private + + # source://activerecord//lib/active_record/internal_metadata.rb#130 + def create_entry(connection, key, value); end + + # source://activerecord//lib/active_record/internal_metadata.rb#126 + def current_time(connection); end + + # source://activerecord//lib/active_record/internal_metadata.rb#154 + def select_entry(connection, key); end + + # source://activerecord//lib/active_record/internal_metadata.rb#142 + def update_entry(connection, key, new_value); end + + # source://activerecord//lib/active_record/internal_metadata.rb#112 + def update_or_create_entry(connection, key, value); end +end + +# source://activerecord//lib/active_record/internal_metadata.rb#13 +class ActiveRecord::InternalMetadata::NullInternalMetadata; end + +# Raised when a record cannot be inserted or updated because it references a non-existent record, +# or when a record cannot be deleted because a parent record references it. +# +# source://activerecord//lib/active_record/errors.rb#233 +class ActiveRecord::InvalidForeignKey < ::ActiveRecord::WrappedDatabaseException; end + +# source://activerecord//lib/active_record/migration.rb#131 +class ActiveRecord::InvalidMigrationTimestampError < ::ActiveRecord::MigrationError + # @return [InvalidMigrationTimestampError] a new instance of InvalidMigrationTimestampError + # + # source://activerecord//lib/active_record/migration.rb#132 + def initialize(version = T.unsafe(nil), name = T.unsafe(nil)); end +end + +# source://activerecord//lib/active_record/associations/errors.rb#33 +class ActiveRecord::InverseOfAssociationNotFoundError < ::ActiveRecord::ActiveRecordError + include ::DidYouMean::Correctable + + # @return [InverseOfAssociationNotFoundError] a new instance of InverseOfAssociationNotFoundError + # + # source://activerecord//lib/active_record/associations/errors.rb#36 + def initialize(reflection = T.unsafe(nil), associated_class = T.unsafe(nil)); end + + # Returns the value of attribute associated_class. + # + # source://activerecord//lib/active_record/associations/errors.rb#34 + def associated_class; end + + # source://activerecord//lib/active_record/associations/errors.rb#49 + def corrections; end + + # Returns the value of attribute reflection. + # + # source://activerecord//lib/active_record/associations/errors.rb#34 + def reflection; end +end + +# source://activerecord//lib/active_record/associations/errors.rb#62 +class ActiveRecord::InverseOfAssociationRecursiveError < ::ActiveRecord::ActiveRecordError + # @return [InverseOfAssociationRecursiveError] a new instance of InverseOfAssociationRecursiveError + # + # source://activerecord//lib/active_record/associations/errors.rb#64 + def initialize(reflection = T.unsafe(nil)); end + + # Returns the value of attribute reflection. + # + # source://activerecord//lib/active_record/associations/errors.rb#63 + def reflection; end +end + +# Exception that can be raised to stop migrations from being rolled back. +# For example the following migration is not reversible. +# Rolling back this migration will raise an ActiveRecord::IrreversibleMigration error. +# +# class IrreversibleMigrationExample < ActiveRecord::Migration[8.1] +# def change +# create_table :distributors do |t| +# t.string :zipcode +# end +# +# execute <<~SQL +# ALTER TABLE distributors +# ADD CONSTRAINT zipchk +# CHECK (char_length(zipcode) = 5) NO INHERIT; +# SQL +# end +# end +# +# There are two ways to mitigate this problem. +# +# 1. Define #up and #down methods instead of #change: +# +# class ReversibleMigrationExample < ActiveRecord::Migration[8.1] +# def up +# create_table :distributors do |t| +# t.string :zipcode +# end +# +# execute <<~SQL +# ALTER TABLE distributors +# ADD CONSTRAINT zipchk +# CHECK (char_length(zipcode) = 5) NO INHERIT; +# SQL +# end +# +# def down +# execute <<~SQL +# ALTER TABLE distributors +# DROP CONSTRAINT zipchk +# SQL +# +# drop_table :distributors +# end +# end +# +# 2. Use the #reversible method in #change method: +# +# class ReversibleMigrationExample < ActiveRecord::Migration[8.1] +# def change +# create_table :distributors do |t| +# t.string :zipcode +# end +# +# reversible do |dir| +# dir.up do +# execute <<~SQL +# ALTER TABLE distributors +# ADD CONSTRAINT zipchk +# CHECK (char_length(zipcode) = 5) NO INHERIT; +# SQL +# end +# +# dir.down do +# execute <<~SQL +# ALTER TABLE distributors +# DROP CONSTRAINT zipchk +# SQL +# end +# end +# end +# end +# +# source://activerecord//lib/active_record/migration.rb#88 +class ActiveRecord::IrreversibleMigration < ::ActiveRecord::MigrationError; end + +# IrreversibleOrderError is raised when a relation's order is too complex for +# +reverse_order+ to automatically reverse. +# +# source://activerecord//lib/active_record/errors.rb#570 +class ActiveRecord::IrreversibleOrderError < ::ActiveRecord::ActiveRecordError; end + +# source://activerecord//lib/active_record/legacy_yaml_adapter.rb#4 +module ActiveRecord::LegacyYamlAdapter + class << self + # source://activerecord//lib/active_record/legacy_yaml_adapter.rb#5 + def convert(coder); end + end +end + +# LockWaitTimeout will be raised when lock wait timeout exceeded. +# +# source://activerecord//lib/active_record/errors.rb#578 +class ActiveRecord::LockWaitTimeout < ::ActiveRecord::StatementInvalid; end + +# source://activerecord//lib/active_record.rb#149 +module ActiveRecord::Locking + extend ::ActiveSupport::Autoload +end + +# In de/serialize we change `nil` to 0, so that we can allow passing +# `nil` values to `lock_version`, and not result in `ActiveRecord::StaleObjectError` +# during update record. +# +# source://activerecord//lib/active_record/locking/optimistic.rb#213 +class ActiveRecord::Locking::LockingType + # source://activerecord//lib/active_record/locking/optimistic.rb#218 + def deserialize(value); end + + # source://activerecord//lib/active_record/locking/optimistic.rb#230 + def encode_with(coder); end + + # source://activerecord//lib/active_record/locking/optimistic.rb#226 + def init_with(coder); end + + # source://activerecord//lib/active_record/locking/optimistic.rb#222 + def serialize(value); end + + class << self + # source://activerecord//lib/active_record/locking/optimistic.rb#214 + def new(subtype); end + end +end + +# == What is \Optimistic \Locking +# +# Optimistic locking allows multiple users to access the same record for edits, and assumes a minimum of +# conflicts with the data. It does this by checking whether another process has made changes to a record since +# it was opened, an ActiveRecord::StaleObjectError exception is thrown if that has occurred +# and the update is ignored. +# +# Check out ActiveRecord::Locking::Pessimistic for an alternative. +# +# == Usage +# +# Active Record supports optimistic locking if the +lock_version+ field is present. Each update to the +# record increments the integer column +lock_version+ and the locking facilities ensure that records instantiated twice +# will let the last one saved raise a +StaleObjectError+ if the first was also updated. Example: +# +# p1 = Person.find(1) +# p2 = Person.find(1) +# +# p1.first_name = "Michael" +# p1.save +# +# p2.first_name = "should fail" +# p2.save # Raises an ActiveRecord::StaleObjectError +# +# Optimistic locking will also check for stale data when objects are destroyed. Example: +# +# p1 = Person.find(1) +# p2 = Person.find(1) +# +# p1.first_name = "Michael" +# p1.save +# +# p2.destroy # Raises an ActiveRecord::StaleObjectError +# +# You're then responsible for dealing with the conflict by rescuing the exception and either rolling back, merging, +# or otherwise apply the business logic needed to resolve the conflict. +# +# This locking mechanism will function inside a single Ruby process. To make it work across all +# web requests, the recommended approach is to add +lock_version+ as a hidden field to your form. +# +# This behavior can be turned off by setting ActiveRecord::Base.lock_optimistically = false. +# To override the name of the +lock_version+ column, set the locking_column class attribute: +# +# class Person < ActiveRecord::Base +# self.locking_column = :lock_person +# end +# +# source://activerecord//lib/active_record/locking/optimistic.rb#52 +module ActiveRecord::Locking::Optimistic + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveRecord::Locking::Optimistic::ClassMethods + + # source://activerecord//lib/active_record/locking/optimistic.rb#63 + def increment!(*_arg0, **_arg1); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/locking/optimistic.rb#59 + def locking_enabled?; end + + private + + # source://activerecord//lib/active_record/locking/optimistic.rb#149 + def _clear_locking_column; end + + # source://activerecord//lib/active_record/locking/optimistic.rb#78 + def _create_record(attribute_names = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/locking/optimistic.rb#141 + def _lock_value_for_database(locking_column); end + + # source://activerecord//lib/active_record/locking/optimistic.rb#154 + def _query_constraints_hash; end + + # source://activerecord//lib/active_record/locking/optimistic.rb#87 + def _touch_row(attribute_names, time); end + + # source://activerecord//lib/active_record/locking/optimistic.rb#92 + def _update_row(attribute_names, attempted_action = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/locking/optimistic.rb#131 + def destroy_row; end + + # source://activerecord//lib/active_record/locking/optimistic.rb#72 + def initialize_dup(other); end + + module GeneratedClassMethods + def lock_optimistically; end + def lock_optimistically=(value); end + def lock_optimistically?; end + end + + module GeneratedInstanceMethods + def lock_optimistically; end + def lock_optimistically?; end + end +end + +# source://activerecord//lib/active_record/locking/optimistic.rb#161 +module ActiveRecord::Locking::Optimistic::ClassMethods + # The version column used for optimistic locking. Defaults to +lock_version+. + # + # source://activerecord//lib/active_record/locking/optimistic.rb#178 + def locking_column; end + + # Set the column to use for optimistic locking. Defaults to +lock_version+. + # + # source://activerecord//lib/active_record/locking/optimistic.rb#172 + def locking_column=(value); end + + # Returns true if the +lock_optimistically+ flag is set to true + # (which it is, by default) and the table includes the + # +locking_column+ column (defaults to +lock_version+). + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/locking/optimistic.rb#167 + def locking_enabled?; end + + # Reset the column used for optimistic locking back to the +lock_version+ default. + # + # source://activerecord//lib/active_record/locking/optimistic.rb#181 + def reset_locking_column; end + + # Make sure the lock version column gets updated when counters are + # updated. + # + # source://activerecord//lib/active_record/locking/optimistic.rb#187 + def update_counters(id, counters); end + + private + + # source://activerecord//lib/active_record/locking/optimistic.rb#193 + def hook_attribute_type(name, cast_type); end + + # source://activerecord//lib/active_record/locking/optimistic.rb#201 + def inherited(base); end +end + +# source://activerecord//lib/active_record/locking/optimistic.rb#162 +ActiveRecord::Locking::Optimistic::ClassMethods::DEFAULT_LOCKING_COLUMN = T.let(T.unsafe(nil), String) + +# = \Pessimistic \Locking +# +# Locking::Pessimistic provides support for row-level locking using +# SELECT ... FOR UPDATE and other lock types. +# +# Chain ActiveRecord::Base#find to ActiveRecord::QueryMethods#lock to obtain an exclusive +# lock on the selected rows: +# # select * from accounts where id=1 for update +# Account.lock.find(1) +# +# Call lock('some locking clause') to use a database-specific locking clause +# of your own such as 'LOCK IN SHARE MODE' or 'FOR UPDATE NOWAIT'. Example: +# +# Account.transaction do +# # select * from accounts where name = 'shugo' limit 1 for update nowait +# shugo = Account.lock("FOR UPDATE NOWAIT").find_by(name: "shugo") +# yuko = Account.lock("FOR UPDATE NOWAIT").find_by(name: "yuko") +# shugo.balance -= 100 +# shugo.save! +# yuko.balance += 100 +# yuko.save! +# end +# +# You can also use ActiveRecord::Base#lock! method to lock one record by id. +# This may be better if you don't need to lock every row. Example: +# +# Account.transaction do +# # select * from accounts where ... +# accounts = Account.where(...) +# account1 = accounts.detect { |account| ... } +# account2 = accounts.detect { |account| ... } +# # select * from accounts where id=? for update +# account1.lock! +# account2.lock! +# account1.balance -= 100 +# account1.save! +# account2.balance += 100 +# account2.save! +# end +# +# You can start a transaction and acquire the lock in one go by calling +# with_lock with a block. The block is called from within +# a transaction, the object is already locked. Example: +# +# account = Account.first +# account.with_lock do +# # This block is called within a transaction, +# # account is already locked. +# account.balance -= 100 +# account.save! +# end +# +# Database-specific information on row locking: +# +# [MySQL] +# https://dev.mysql.com/doc/refman/en/innodb-locking-reads.html +# +# [PostgreSQL] +# https://www.postgresql.org/docs/current/interactive/sql-select.html#SQL-FOR-UPDATE-SHARE +# +# source://activerecord//lib/active_record/locking/pessimistic.rb#64 +module ActiveRecord::Locking::Pessimistic + # Obtain a row lock on this record. Reloads the record to obtain the requested + # lock. Pass an SQL locking clause to append the end of the SELECT statement + # or pass true for "FOR UPDATE" (the default, an exclusive row lock). Returns + # the locked record. + # + # source://activerecord//lib/active_record/locking/pessimistic.rb#69 + def lock!(lock = T.unsafe(nil)); end + + # Wraps the passed block in a transaction, reloading the object with a + # lock before yielding. You can pass the SQL locking clause + # as an optional argument (see #lock!). + # + # You can also pass options like requires_new:, isolation:, + # and joinable: to the wrapping transaction (see + # ActiveRecord::ConnectionAdapters::DatabaseStatements#transaction). + # + # source://activerecord//lib/active_record/locking/pessimistic.rb#97 + def with_lock(*args); end +end + +# source://activerecord//lib/active_record/log_subscriber.rb#4 +class ActiveRecord::LogSubscriber < ::ActiveSupport::LogSubscriber + # source://activerecord//lib/active_record/log_subscriber.rb#7 + def backtrace_cleaner; end + + # source://activerecord//lib/active_record/log_subscriber.rb#7 + def backtrace_cleaner=(_arg0); end + + # source://activerecord//lib/active_record/log_subscriber.rb#7 + def backtrace_cleaner?; end + + # source://activerecord//lib/active_record/log_subscriber.rb#18 + def sql(event); end + + # source://activerecord//lib/active_record/log_subscriber.rb#9 + def strict_loading_violation(event); end + + private + + # source://activerecord//lib/active_record/log_subscriber.rb#80 + def colorize_payload_name(name, payload_name); end + + # source://activerecord//lib/active_record/log_subscriber.rb#113 + def debug(progname = T.unsafe(nil), &block); end + + # source://activerecord//lib/active_record/log_subscriber.rb#133 + def filter(name, value); end + + # source://activerecord//lib/active_record/log_subscriber.rb#121 + def log_query_source; end + + # source://activerecord//lib/active_record/log_subscriber.rb#109 + def logger; end + + # source://activerecord//lib/active_record/log_subscriber.rb#129 + def query_source_location; end + + # source://activerecord//lib/active_record/log_subscriber.rb#65 + def render_bind(attr, value); end + + # source://activerecord//lib/active_record/log_subscriber.rb#88 + def sql_color(sql); end + + # source://activerecord//lib/active_record/log_subscriber.rb#61 + def type_casted_binds(casted_binds); end + + class << self + # source://activerecord//lib/active_record/log_subscriber.rb#7 + def backtrace_cleaner; end + + # source://activerecord//lib/active_record/log_subscriber.rb#7 + def backtrace_cleaner=(value); end + + # source://activerecord//lib/active_record/log_subscriber.rb#7 + def backtrace_cleaner?; end + + private + + # source://activerecord//lib/active_record/log_subscriber.rb#7 + def __class_attr_backtrace_cleaner; end + + # source://activerecord//lib/active_record/log_subscriber.rb#7 + def __class_attr_backtrace_cleaner=(new_value); end + + # source://activerecord//lib/active_record/log_subscriber.rb#16 + def __class_attr_log_levels; end + + # source://activerecord//lib/active_record/log_subscriber.rb#16 + def __class_attr_log_levels=(new_value); end + end +end + +# source://activerecord//lib/active_record/log_subscriber.rb#5 +ActiveRecord::LogSubscriber::IGNORE_PAYLOAD_NAMES = T.let(T.unsafe(nil), Array) + +# source://activerecord//lib/active_record/marshalling.rb#4 +module ActiveRecord::Marshalling + class << self + # Returns the value of attribute format_version. + # + # source://activerecord//lib/active_record/marshalling.rb#8 + def format_version; end + + # source://activerecord//lib/active_record/marshalling.rb#10 + def format_version=(version); end + end +end + +# source://activerecord//lib/active_record/marshalling.rb#23 +module ActiveRecord::Marshalling::Methods + # source://activerecord//lib/active_record/marshalling.rb#24 + def _marshal_dump_7_1; end + + # source://activerecord//lib/active_record/marshalling.rb#43 + def marshal_load(state); end +end + +# source://activerecord//lib/active_record.rb#167 +module ActiveRecord::Middleware + extend ::ActiveSupport::Autoload +end + +# = Database Selector \Middleware +# +# The DatabaseSelector Middleware provides a framework for automatically +# swapping from the primary to the replica database connection. \Rails +# provides a basic framework to determine when to swap and allows for +# applications to write custom strategy classes to override the default +# behavior. +# +# The resolver class defines when the application should switch (i.e. read +# from the primary if a write occurred less than 2 seconds ago) and a +# resolver context class that sets a value that helps the resolver class +# decide when to switch. +# +# \Rails default middleware uses the request's session to set a timestamp +# that informs the application when to read from a primary or read from a +# replica. +# +# To use the DatabaseSelector in your application with default settings, +# run the provided generator. +# +# $ bin/rails g active_record:multi_db +# +# This will create a file named +config/initializers/multi_db.rb+ with the +# following contents: +# +# Rails.application.configure do +# config.active_record.database_selector = { delay: 2.seconds } +# config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver +# config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session +# end +# +# Alternatively you can set the options in your environment config or +# any other config file loaded on boot. +# +# The default behavior can be changed by setting the config options to a +# custom class: +# +# config.active_record.database_selector = { delay: 2.seconds } +# config.active_record.database_resolver = MyResolver +# config.active_record.database_resolver_context = MyResolver::MySession +# +# Note: If you are using rails new my_app --minimal you will need +# to call require "active_support/core_ext/integer/time" to load +# the core extension in order to use +2.seconds+ +# +# source://activerecord//lib/active_record/middleware/database_selector/resolver/session.rb#5 +class ActiveRecord::Middleware::DatabaseSelector + # @return [DatabaseSelector] a new instance of DatabaseSelector + # + # source://activerecord//lib/active_record/middleware/database_selector.rb#52 + def initialize(app, resolver_klass = T.unsafe(nil), context_klass = T.unsafe(nil), options = T.unsafe(nil)); end + + # Middleware that determines which database connection to use in a multiple + # database application. + # + # source://activerecord//lib/active_record/middleware/database_selector.rb#63 + def call(env); end + + # Returns the value of attribute context_klass. + # + # source://activerecord//lib/active_record/middleware/database_selector.rb#59 + def context_klass; end + + # Returns the value of attribute options. + # + # source://activerecord//lib/active_record/middleware/database_selector.rb#59 + def options; end + + # Returns the value of attribute resolver_klass. + # + # source://activerecord//lib/active_record/middleware/database_selector.rb#59 + def resolver_klass; end + + private + + # source://activerecord//lib/active_record/middleware/database_selector.rb#72 + def select_database(request, &blk); end +end + +# The Resolver class is used by the DatabaseSelector middleware to +# determine which database the request should use. +# +# To change the behavior of the Resolver class in your application, +# create a custom resolver class that inherits from +# DatabaseSelector::Resolver and implements the methods that need to +# be changed. +# +# By default the Resolver class will send read traffic to the replica +# if it's been 2 seconds since the last write. +# +# source://activerecord//lib/active_record/middleware/database_selector/resolver/session.rb#6 +class ActiveRecord::Middleware::DatabaseSelector::Resolver + # @return [Resolver] a new instance of Resolver + # + # source://activerecord//lib/active_record/middleware/database_selector/resolver.rb#26 + def initialize(context, options = T.unsafe(nil)); end + + # Returns the value of attribute context. + # + # source://activerecord//lib/active_record/middleware/database_selector/resolver.rb#33 + def context; end + + # Returns the value of attribute delay. + # + # source://activerecord//lib/active_record/middleware/database_selector/resolver.rb#33 + def delay; end + + # Returns the value of attribute instrumenter. + # + # source://activerecord//lib/active_record/middleware/database_selector/resolver.rb#33 + def instrumenter; end + + # source://activerecord//lib/active_record/middleware/database_selector/resolver.rb#35 + def read(&blk); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/middleware/database_selector/resolver.rb#51 + def reading_request?(request); end + + # source://activerecord//lib/active_record/middleware/database_selector/resolver.rb#47 + def update_context(response); end + + # source://activerecord//lib/active_record/middleware/database_selector/resolver.rb#43 + def write(&blk); end + + private + + # source://activerecord//lib/active_record/middleware/database_selector/resolver.rb#56 + def read_from_primary(&blk); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/middleware/database_selector/resolver.rb#78 + def read_from_primary?; end + + # source://activerecord//lib/active_record/middleware/database_selector/resolver.rb#62 + def read_from_replica(&blk); end + + # source://activerecord//lib/active_record/middleware/database_selector/resolver.rb#82 + def send_to_replica_delay; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/middleware/database_selector/resolver.rb#86 + def time_since_last_write_ok?; end + + # source://activerecord//lib/active_record/middleware/database_selector/resolver.rb#68 + def write_to_primary; end + + class << self + # source://activerecord//lib/active_record/middleware/database_selector/resolver.rb#22 + def call(context, options = T.unsafe(nil)); end + end +end + +# source://activerecord//lib/active_record/middleware/database_selector/resolver.rb#20 +ActiveRecord::Middleware::DatabaseSelector::Resolver::SEND_TO_REPLICA_DELAY = T.let(T.unsafe(nil), ActiveSupport::Duration) + +# The session class is used by the DatabaseSelector::Resolver to save +# timestamps of the last write in the session. +# +# The last_write is used to determine whether it's safe to read +# from the replica or the request needs to be sent to the primary. +# +# source://activerecord//lib/active_record/middleware/database_selector/resolver/session.rb#12 +class ActiveRecord::Middleware::DatabaseSelector::Resolver::Session + # @return [Session] a new instance of Session + # + # source://activerecord//lib/active_record/middleware/database_selector/resolver/session.rb#28 + def initialize(session); end + + # source://activerecord//lib/active_record/middleware/database_selector/resolver/session.rb#34 + def last_write_timestamp; end + + # source://activerecord//lib/active_record/middleware/database_selector/resolver/session.rb#42 + def save(response); end + + # Returns the value of attribute session. + # + # source://activerecord//lib/active_record/middleware/database_selector/resolver/session.rb#32 + def session; end + + # source://activerecord//lib/active_record/middleware/database_selector/resolver/session.rb#38 + def update_last_write_timestamp; end + + class << self + # source://activerecord//lib/active_record/middleware/database_selector/resolver/session.rb#13 + def call(request); end + + # Converts time to a timestamp that represents milliseconds since + # epoch. + # + # source://activerecord//lib/active_record/middleware/database_selector/resolver/session.rb#19 + def convert_time_to_timestamp(time); end + + # Converts milliseconds since epoch timestamp into a time object. + # + # source://activerecord//lib/active_record/middleware/database_selector/resolver/session.rb#24 + def convert_timestamp_to_time(timestamp); end + end +end + +# = Shard Selector \Middleware +# +# The ShardSelector Middleware provides a framework for automatically +# swapping shards. \Rails provides a basic framework to determine which +# shard to switch to and allows for applications to write custom strategies +# for swapping if needed. +# +# == Setup +# +# Applications must provide a resolver that will provide application-specific logic for +# selecting the appropriate shard. Setting +config.active_record.shard_resolver+ will cause +# Rails to add ShardSelector to the default middleware stack. +# +# The resolver, along with any configuration options, can be set in the application +# configuration using an initializer like so: +# +# Rails.application.configure do +# config.active_record.shard_selector = { lock: false, class_name: "AnimalsRecord" } +# config.active_record.shard_resolver = ->(request) { +# subdomain = request.subdomain +# tenant = Tenant.find_by_subdomain!(subdomain) +# tenant.shard +# } +# end +# +# == Configuration +# +# The behavior of ShardSelector can be altered through some configuration options. +# +# [+lock:+] +# +lock+ is true by default and will prohibit the request from switching shards once inside +# the block. If +lock+ is false, then shard switching will be allowed. For tenant based +# sharding, +lock+ should always be true to prevent application code from mistakenly switching +# between tenants. +# +# [+class_name:+] +# +class_name+ is the name of the abstract connection class to switch. By +# default, the ShardSelector will use ActiveRecord::Base, but if the +# application has multiple databases, then this option should be set to +# the name of the sharded database's abstract connection class. +# +# source://activerecord//lib/active_record/middleware/shard_selector.rb#46 +class ActiveRecord::Middleware::ShardSelector + # @return [ShardSelector] a new instance of ShardSelector + # + # source://activerecord//lib/active_record/middleware/shard_selector.rb#47 + def initialize(app, resolver, options = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/middleware/shard_selector.rb#55 + def call(env); end + + # Returns the value of attribute options. + # + # source://activerecord//lib/active_record/middleware/shard_selector.rb#53 + def options; end + + # Returns the value of attribute resolver. + # + # source://activerecord//lib/active_record/middleware/shard_selector.rb#53 + def resolver; end + + private + + # source://activerecord//lib/active_record/middleware/shard_selector.rb#66 + def selected_shard(request); end + + # source://activerecord//lib/active_record/middleware/shard_selector.rb#70 + def set_shard(shard, &block); end +end + +# = Active Record Migrations +# +# Migrations can manage the evolution of a schema used by several physical +# databases. It's a solution to the common problem of adding a field to make +# a new feature work in your local database, but being unsure of how to +# push that change to other developers and to the production server. With +# migrations, you can describe the transformations in self-contained classes +# that can be checked into version control systems and executed against +# another database that might be one, two, or five versions behind. +# +# Example of a simple migration: +# +# class AddSsl < ActiveRecord::Migration[8.1] +# def up +# add_column :accounts, :ssl_enabled, :boolean, default: true +# end +# +# def down +# remove_column :accounts, :ssl_enabled +# end +# end +# +# This migration will add a boolean flag to the accounts table and remove it +# if you're backing out of the migration. It shows how all migrations have +# two methods +up+ and +down+ that describes the transformations +# required to implement or remove the migration. These methods can consist +# of both the migration specific methods like +add_column+ and +remove_column+, +# but may also contain regular Ruby code for generating data needed for the +# transformations. +# +# Example of a more complex migration that also needs to initialize data: +# +# class AddSystemSettings < ActiveRecord::Migration[8.1] +# def up +# create_table :system_settings do |t| +# t.string :name +# t.string :label +# t.text :value +# t.string :type +# t.integer :position +# end +# +# SystemSetting.create name: 'notice', +# label: 'Use notice?', +# value: 1 +# end +# +# def down +# drop_table :system_settings +# end +# end +# +# This migration first adds the +system_settings+ table, then creates the very +# first row in it using the Active Record model that relies on the table. It +# also uses the more advanced +create_table+ syntax where you can specify a +# complete table schema in one block call. +# +# == Available transformations +# +# === Creation +# +# * create_join_table(table_1, table_2, options): Creates a join +# table having its name as the lexical order of the first two +# arguments. See +# ActiveRecord::ConnectionAdapters::SchemaStatements#create_join_table for +# details. +# * create_table(name, options): Creates a table called +name+ and +# makes the table object available to a block that can then add columns to it, +# following the same format as +add_column+. See example above. The options hash +# is for fragments like "DEFAULT CHARSET=UTF-8" that are appended to the create +# table definition. +# * add_column(table_name, column_name, type, options): Adds a new column +# to the table called +table_name+ +# named +column_name+ specified to be one of the following types: +# :string, :text, :integer, :float, +# :decimal, :datetime, :timestamp, :time, +# :date, :binary, :boolean. A default value can be +# specified by passing an +options+ hash like { default: 11 }. +# Other options include :limit and :null (e.g. +# { limit: 50, null: false }) -- see +# ActiveRecord::ConnectionAdapters::TableDefinition#column for details. +# * add_foreign_key(from_table, to_table, options): Adds a new +# foreign key. +from_table+ is the table with the key column, +to_table+ contains +# the referenced primary key. +# * add_index(table_name, column_names, options): Adds a new index +# with the name of the column. Other options include +# :name, :unique (e.g. +# { name: 'users_name_index', unique: true }) and :order +# (e.g. { order: { name: :desc } }). +# * add_reference(:table_name, :reference_name): Adds a new column +# +reference_name_id+ by default an integer. See +# ActiveRecord::ConnectionAdapters::SchemaStatements#add_reference for details. +# * add_timestamps(table_name, options): Adds timestamps (+created_at+ +# and +updated_at+) columns to +table_name+. +# +# === Modification +# +# * change_column(table_name, column_name, type, options): Changes +# the column to a different type using the same parameters as add_column. +# * change_column_default(table_name, column_name, default_or_changes): +# Sets a default value for +column_name+ defined by +default_or_changes+ on +# +table_name+. Passing a hash containing :from and :to +# as +default_or_changes+ will make this change reversible in the migration. +# * change_column_null(table_name, column_name, null, default = nil): +# Sets or removes a NOT NULL constraint on +column_name+. The +null+ flag +# indicates whether the value can be +NULL+. See +# ActiveRecord::ConnectionAdapters::SchemaStatements#change_column_null for +# details. +# * change_table(name, options): Allows to make column alterations to +# the table called +name+. It makes the table object available to a block that +# can then add/remove columns, indexes, or foreign keys to it. +# * rename_column(table_name, column_name, new_column_name): Renames +# a column but keeps the type and content. +# * rename_index(table_name, old_name, new_name): Renames an index. +# * rename_table(old_name, new_name): Renames the table called +old_name+ +# to +new_name+. +# +# === Deletion +# +# * drop_table(*names): Drops the given tables. +# * drop_join_table(table_1, table_2, options): Drops the join table +# specified by the given arguments. +# * remove_column(table_name, column_name, type, options): Removes the column +# named +column_name+ from the table called +table_name+. +# * remove_columns(table_name, *column_names): Removes the given +# columns from the table definition. +# * remove_foreign_key(from_table, to_table = nil, **options): Removes the +# given foreign key from the table called +table_name+. +# * remove_index(table_name, column: column_names): Removes the index +# specified by +column_names+. +# * remove_index(table_name, name: index_name): Removes the index +# specified by +index_name+. +# * remove_reference(table_name, ref_name, options): Removes the +# reference(s) on +table_name+ specified by +ref_name+. +# * remove_timestamps(table_name, options): Removes the timestamp +# columns (+created_at+ and +updated_at+) from the table definition. +# +# == Irreversible transformations +# +# Some transformations are destructive in a manner that cannot be reversed. +# Migrations of that kind should raise an ActiveRecord::IrreversibleMigration +# exception in their +down+ method. +# +# == Running migrations from within \Rails +# +# The \Rails package has several tools to help create and apply migrations. +# +# To generate a new migration, you can use +# +# $ bin/rails generate migration MyNewMigration +# +# where MyNewMigration is the name of your migration. The generator will +# create an empty migration file timestamp_my_new_migration.rb +# in the db/migrate/ directory where timestamp is the +# UTC formatted date and time that the migration was generated. +# +# There is a special syntactic shortcut to generate migrations that add fields to a table. +# +# $ bin/rails generate migration add_fieldname_to_tablename fieldname:string +# +# This will generate the file timestamp_add_fieldname_to_tablename.rb, which will look like this: +# class AddFieldnameToTablename < ActiveRecord::Migration[8.1] +# def change +# add_column :tablenames, :fieldname, :string +# end +# end +# +# To run migrations against the currently configured database, use +# bin/rails db:migrate. This will update the database by running all of the +# pending migrations, creating the schema_migrations table +# (see "About the schema_migrations table" section below) if missing. It will also +# invoke the db:schema:dump command, which will update your db/schema.rb file +# to match the structure of your database. +# +# To roll the database back to a previous migration version, use +# bin/rails db:rollback VERSION=X where X is the version to which +# you wish to downgrade. Alternatively, you can also use the STEP option if you +# wish to rollback last few migrations. bin/rails db:rollback STEP=2 will rollback +# the latest two migrations. +# +# If any of the migrations throw an ActiveRecord::IrreversibleMigration exception, +# that step will fail and you'll have some manual work to do. +# +# == More examples +# +# Not all migrations change the schema. Some just fix the data: +# +# class RemoveEmptyTags < ActiveRecord::Migration[8.1] +# def up +# Tag.all.each { |tag| tag.destroy if tag.pages.empty? } +# end +# +# def down +# # not much we can do to restore deleted data +# raise ActiveRecord::IrreversibleMigration, "Can't recover the deleted tags" +# end +# end +# +# Others remove columns when they migrate up instead of down: +# +# class RemoveUnnecessaryItemAttributes < ActiveRecord::Migration[8.1] +# def up +# remove_column :items, :incomplete_items_count +# remove_column :items, :completed_items_count +# end +# +# def down +# add_column :items, :incomplete_items_count +# add_column :items, :completed_items_count +# end +# end +# +# And sometimes you need to do something in SQL not abstracted directly by migrations: +# +# class MakeJoinUnique < ActiveRecord::Migration[8.1] +# def up +# execute "ALTER TABLE `pages_linked_pages` ADD UNIQUE `page_id_linked_page_id` (`page_id`,`linked_page_id`)" +# end +# +# def down +# execute "ALTER TABLE `pages_linked_pages` DROP INDEX `page_id_linked_page_id`" +# end +# end +# +# == Using a model after changing its table +# +# Sometimes you'll want to add a column in a migration and populate it +# immediately after. In that case, you'll need to make a call to +# Base#reset_column_information in order to ensure that the model has the +# latest column data from after the new column was added. Example: +# +# class AddPeopleSalary < ActiveRecord::Migration[8.1] +# def up +# add_column :people, :salary, :integer +# Person.reset_column_information +# Person.all.each do |p| +# p.update_attribute :salary, SalaryCalculator.compute(p) +# end +# end +# end +# +# == Controlling verbosity +# +# By default, migrations will describe the actions they are taking, writing +# them to the console as they happen, along with benchmarks describing how +# long each step took. +# +# You can quiet them down by setting ActiveRecord::Migration.verbose = false. +# +# You can also insert your own messages and benchmarks by using the +say_with_time+ +# method: +# +# def up +# ... +# say_with_time "Updating salaries..." do +# Person.all.each do |p| +# p.update_attribute :salary, SalaryCalculator.compute(p) +# end +# end +# ... +# end +# +# The phrase "Updating salaries..." would then be printed, along with the +# benchmark for the block when the block completes. +# +# == Timestamped Migrations +# +# By default, \Rails generates migrations that look like: +# +# 20080717013526_your_migration_name.rb +# +# The prefix is a generation timestamp (in UTC). Timestamps should not be +# modified manually. To validate that migration timestamps adhere to the +# format Active Record expects, you can use the following configuration option: +# +# config.active_record.validate_migration_timestamps = true +# +# If you'd prefer to use numeric prefixes, you can turn timestamped migrations +# off by setting: +# +# config.active_record.timestamped_migrations = false +# +# In application.rb. +# +# == Reversible Migrations +# +# Reversible migrations are migrations that know how to go +down+ for you. +# You simply supply the +up+ logic, and the Migration system figures out +# how to execute the down commands for you. +# +# To define a reversible migration, define the +change+ method in your +# migration like this: +# +# class TenderloveMigration < ActiveRecord::Migration[8.1] +# def change +# create_table(:horses) do |t| +# t.column :content, :text +# t.column :remind_at, :datetime +# end +# end +# end +# +# This migration will create the horses table for you on the way up, and +# automatically figure out how to drop the table on the way down. +# +# Some commands cannot be reversed. If you care to define how to move up +# and down in these cases, you should define the +up+ and +down+ methods +# as before. +# +# If a command cannot be reversed, an +# ActiveRecord::IrreversibleMigration exception will be raised when +# the migration is moving down. +# +# For a list of commands that are reversible, please see +# +ActiveRecord::Migration::CommandRecorder+. +# +# == Transactional Migrations +# +# If the database adapter supports DDL transactions, all migrations will +# automatically be wrapped in a transaction. There are queries that you +# can't execute inside a transaction though, and for these situations +# you can turn the automatic transactions off. +# +# class ChangeEnum < ActiveRecord::Migration[8.1] +# disable_ddl_transaction! +# +# def up +# execute "ALTER TYPE model_size ADD VALUE 'new_value'" +# end +# end +# +# Remember that you can still open your own transactions, even if you +# are in a Migration with self.disable_ddl_transaction!. +# +# source://activerecord//lib/active_record/migration.rb#570 +class ActiveRecord::Migration + # @return [Migration] a new instance of Migration + # + # source://activerecord//lib/active_record/migration.rb#805 + def initialize(name = T.unsafe(nil), version = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/migration.rb#1010 + def announce(message); end + + # source://activerecord//lib/active_record/migration.rb#1041 + def connection; end + + # source://activerecord//lib/active_record/migration.rb#1045 + def connection_pool; end + + # source://activerecord//lib/active_record/migration.rb#1066 + def copy(destination, sources, options = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/migration.rb#792 + def disable_ddl_transaction; end + + # source://activerecord//lib/active_record/migration.rb#962 + def down; end + + # source://activerecord//lib/active_record/migration.rb#990 + def exec_migration(conn, direction); end + + # source://activerecord//lib/active_record/migration.rb#812 + def execution_strategy; end + + # source://activerecord//lib/active_record/migration.rb#1049 + def method_missing(method, *arguments, **_arg2, &block); end + + # Execute this migration in the named direction + # + # source://activerecord//lib/active_record/migration.rb#969 + def migrate(direction); end + + # Returns the value of attribute name. + # + # source://activerecord//lib/active_record/migration.rb#803 + def name; end + + # Sets the attribute name + # + # @param value the value to set the attribute name to. + # + # source://activerecord//lib/active_record/migration.rb#803 + def name=(_arg0); end + + # Determines the version number of the next migration. + # + # source://activerecord//lib/active_record/migration.rb#1133 + def next_migration_number(number); end + + # Finds the correct table name given an Active Record object. + # Uses the Active Record object's own table_name, or pre/suffix from the + # options passed in. + # + # source://activerecord//lib/active_record/migration.rb#1124 + def proper_table_name(name, options = T.unsafe(nil)); end + + # Used to specify an operation that can be run in one direction or another. + # Call the methods +up+ and +down+ of the yielded object to run a block + # only in one given direction. + # The whole block will be called in the right order within the migration. + # + # In the following example, the looping on users will always be done + # when the three columns 'first_name', 'last_name' and 'full_name' exist, + # even when migrating down: + # + # class SplitNameMigration < ActiveRecord::Migration[8.1] + # def change + # add_column :users, :first_name, :string + # add_column :users, :last_name, :string + # + # reversible do |dir| + # User.reset_column_information + # User.all.each do |u| + # dir.up { u.first_name, u.last_name = u.full_name.split(' ') } + # dir.down { u.full_name = "#{u.first_name} #{u.last_name}" } + # u.save + # end + # end + # + # revert { add_column :users, :full_name, :string } + # end + # end + # + # source://activerecord//lib/active_record/migration.rb#914 + def reversible; end + + # Reverses the migration commands for the given block and + # the given migrations. + # + # The following migration will remove the table 'horses' + # and create the table 'apples' on the way up, and the reverse + # on the way down. + # + # class FixTLMigration < ActiveRecord::Migration[8.1] + # def change + # revert do + # create_table(:horses) do |t| + # t.text :content + # t.datetime :remind_at + # end + # end + # create_table(:apples) do |t| + # t.string :variety + # end + # end + # end + # + # Or equivalently, if +TenderloveMigration+ is defined as in the + # documentation for Migration: + # + # require_relative "20121212123456_tenderlove_migration" + # + # class FixupTLMigration < ActiveRecord::Migration[8.1] + # def change + # revert TenderloveMigration + # + # create_table(:apples) do |t| + # t.string :variety + # end + # end + # end + # + # This command can be nested. + # + # source://activerecord//lib/active_record/migration.rb#857 + def revert(*migration_classes, &block); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/migration.rb#874 + def reverting?; end + + # Runs the given migration classes. + # Last argument can specify options: + # + # - +:direction+ - Default is +:up+. + # - +:revert+ - Default is +false+. + # + # source://activerecord//lib/active_record/migration.rb#942 + def run(*migration_classes); end + + # Takes a message argument and outputs it as is. + # A second boolean argument can be passed to specify whether to indent or not. + # + # source://activerecord//lib/active_record/migration.rb#1018 + def say(message, subitem = T.unsafe(nil)); end + + # Outputs text along with how long it took to run its block. + # If the block returns an integer it assumes it is the number of rows affected. + # + # source://activerecord//lib/active_record/migration.rb#1024 + def say_with_time(message); end + + # Takes a block as an argument and suppresses any output generated by the block. + # + # source://activerecord//lib/active_record/migration.rb#1034 + def suppress_messages; end + + # Builds a hash for use in ActiveRecord::Migration#proper_table_name using + # the Active Record object's table_name prefix and suffix + # + # source://activerecord//lib/active_record/migration.rb#1143 + def table_name_options(config = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/migration.rb#956 + def up; end + + # Used to specify an operation that is only run when migrating up + # (for example, populating a new column with its initial values). + # + # In the following example, the new column +published+ will be given + # the value +true+ for all existing records. + # + # class AddPublishedToPosts < ActiveRecord::Migration[8.1] + # def change + # add_column :posts, :published, :boolean, default: false + # up_only do + # execute "update posts set published = 'true'" + # end + # end + # end + # + # source://activerecord//lib/active_record/migration.rb#933 + def up_only(&block); end + + # :singleton-method: verbose + # + # Specifies if migrations will write the actions they are taking to the console as they + # happen, along with benchmarks describing how long each step took. Defaults to + # true. + # + # source://activerecord//lib/active_record/migration.rb#802 + def verbose; end + + # source://activerecord//lib/active_record/migration.rb#802 + def verbose=(val); end + + # Returns the value of attribute version. + # + # source://activerecord//lib/active_record/migration.rb#803 + def version; end + + # Sets the attribute version + # + # @param value the value to set the attribute version to. + # + # source://activerecord//lib/active_record/migration.rb#803 + def version=(_arg0); end + + # source://activerecord//lib/active_record/migration.rb#1006 + def write(text = T.unsafe(nil)); end + + private + + # source://activerecord//lib/active_record/migration.rb#1175 + def command_recorder; end + + # source://activerecord//lib/active_record/migration.rb#1151 + def execute_block; end + + # source://activerecord//lib/active_record/migration.rb#1159 + def format_arguments(arguments); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/migration.rb#1171 + def internal_option?(option_name); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/migration.rb#1179 + def respond_to_missing?(method, include_private = T.unsafe(nil)); end + + class << self + # source://activerecord//lib/active_record/migration.rb#629 + def [](version); end + + # Raises ActiveRecord::PendingMigrationError error if any migrations are pending + # for all database configurations in an environment. + # + # source://activerecord//lib/active_record/migration.rb#693 + def check_all_pending!; end + + # source://activerecord//lib/active_record/migration.rb#739 + def check_pending_migrations; end + + # source://activerecord//lib/active_record/migration.rb#633 + def current_version; end + + # source://activerecord//lib/active_record/migration.rb#684 + def delegate; end + + # source://activerecord//lib/active_record/migration.rb#684 + def delegate=(_arg0); end + + # source://activerecord//lib/active_record/migration.rb#685 + def disable_ddl_transaction; end + + # Disable the transaction wrapping this migration. + # You can still create your own transactions even after calling #disable_ddl_transaction! + # + # For more details read the {"Transactional Migrations" section above}[rdoc-ref:Migration]. + # + # source://activerecord//lib/active_record/migration.rb#735 + def disable_ddl_transaction!; end + + # source://activerecord//lib/active_record/migration.rb#685 + def disable_ddl_transaction=(_arg0); end + + # source://activerecord//lib/active_record/migration.rb#617 + def inherited(subclass); end + + # source://activerecord//lib/active_record/migration.rb#709 + def load_schema_if_pending!; end + + # source://activerecord//lib/active_record/migration.rb#717 + def maintain_test_schema!; end + + # source://activerecord//lib/active_record/migration.rb#723 + def method_missing(name, *_arg1, **_arg2, &_arg3); end + + # source://activerecord//lib/active_record/migration.rb#727 + def migrate(direction); end + + # source://activerecord//lib/active_record/migration.rb#687 + def nearest_delegate; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/migration.rb#639 + def valid_version_format?(version_string); end + + # source://activerecord//lib/active_record/migration.rb#802 + def verbose; end + + # source://activerecord//lib/active_record/migration.rb#802 + def verbose=(val); end + + private + + # @return [Boolean] + # + # source://activerecord//lib/active_record/migration.rb#748 + def any_schema_needs_update?; end + + # source://activerecord//lib/active_record/migration.rb#754 + def db_configs_in_current_env; end + + # source://activerecord//lib/active_record/migration.rb#772 + def env; end + + # source://activerecord//lib/active_record/migration.rb#776 + def load_schema!; end + + # source://activerecord//lib/active_record/migration.rb#758 + def pending_migrations; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/migration.rb#786 + def respond_to_missing?(method, include_private = T.unsafe(nil)); end + end +end + +# This class is used to verify that all migrations have been run before +# loading a web page if config.active_record.migration_error is set to +:page_load+. +# +# source://activerecord//lib/active_record/migration.rb#648 +class ActiveRecord::Migration::CheckPending + # @return [CheckPending] a new instance of CheckPending + # + # source://activerecord//lib/active_record/migration.rb#649 + def initialize(app, file_watcher: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/migration.rb#656 + def call(env); end + + private + + # source://activerecord//lib/active_record/migration.rb#675 + def build_watcher(&block); end +end + +# = \Migration Command Recorder +# +# +ActiveRecord::Migration::CommandRecorder+ records commands done during +# a migration and knows how to reverse those commands. The CommandRecorder +# knows how to invert the following commands: +# +# * add_column +# * add_foreign_key +# * add_check_constraint +# * add_exclusion_constraint +# * add_unique_constraint +# * add_index +# * add_reference +# * add_timestamps +# * change_column_default (must supply a +:from+ and +:to+ option) +# * change_column_null +# * change_column_comment (must supply a +:from+ and +:to+ option) +# * change_table_comment (must supply a +:from+ and +:to+ option) +# * create_enum +# * create_join_table +# * create_virtual_table +# * create_table +# * disable_extension +# * drop_enum (must supply a list of values) +# * drop_join_table +# * drop_virtual_table (must supply options) +# * drop_table (must supply a block) +# * enable_extension +# * remove_column (must supply a type) +# * remove_columns (must supply a +:type+ option) +# * remove_foreign_key (must supply a second table) +# * remove_check_constraint +# * remove_exclusion_constraint +# * remove_unique_constraint +# * remove_index +# * remove_reference +# * remove_timestamps +# * rename_column +# * rename_enum +# * rename_enum_value (must supply a +:from+ and +:to+ option) +# * rename_index +# * rename_table +# * enable_index +# * disable_index +# +# source://activerecord//lib/active_record/migration/command_recorder.rb#49 +class ActiveRecord::Migration::CommandRecorder + include ::ActiveRecord::Migration::JoinTable + include ::ActiveRecord::Migration::CommandRecorder::StraightReversions + + # @return [CommandRecorder] a new instance of CommandRecorder + # + # source://activerecord//lib/active_record/migration/command_recorder.rb#70 + def initialize(delegate = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#136 + def add_belongs_to(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def add_check_constraint(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def add_column(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def add_enum_value(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def add_exclusion_constraint(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def add_foreign_key(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def add_index(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def add_reference(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def add_timestamps(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def add_unique_constraint(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def change_column(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def change_column_comment(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def change_column_default(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def change_column_null(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#139 + def change_table(table_name, **options); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def change_table_comment(*args, **_arg1, &block); end + + # Returns the value of attribute commands. + # + # source://activerecord//lib/active_record/migration/command_recorder.rb#68 + def commands; end + + # Sets the attribute commands + # + # @param value the value to set the attribute commands to. + # + # source://activerecord//lib/active_record/migration/command_recorder.rb#68 + def commands=(_arg0); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def create_enum(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def create_join_table(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def create_schema(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def create_table(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def create_virtual_table(*args, **_arg1, &block); end + + # Returns the value of attribute delegate. + # + # source://activerecord//lib/active_record/migration/command_recorder.rb#68 + def delegate; end + + # Sets the attribute delegate + # + # @param value the value to set the attribute delegate to. + # + # source://activerecord//lib/active_record/migration/command_recorder.rb#68 + def delegate=(_arg0); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def disable_extension(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def disable_index(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def drop_enum(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def drop_join_table(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def drop_schema(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def drop_table(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def drop_virtual_table(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def enable_extension(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def enable_index(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def execute(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def execute_block(*args, **_arg1, &block); end + + # Returns the inverse of the given command. For example: + # + # recorder.inverse_of(:rename_table, [:old, :new]) + # # => [:rename_table, [:new, :old]] + # + # If the inverse of a command requires several commands, returns array of commands. + # + # recorder.inverse_of(:remove_columns, [:some_table, :foo, :bar, type: :string]) + # # => [[:add_column, :some_table, :foo, :string], [:add_column, :some_table, :bar, :string]] + # + # This method will raise an +IrreversibleMigration+ exception if it cannot + # invert the +command+. + # + # @raise [IrreversibleMigration] + # + # source://activerecord//lib/active_record/migration/command_recorder.rb#117 + def inverse_of(command, args, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#282 + def invert_add_belongs_to(args, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#283 + def invert_remove_belongs_to(args, &block); end + + # Record +command+. +command+ should be a method name and arguments. + # For example: + # + # recorder.record(:method_name, [:arg1, :arg2]) + # + # source://activerecord//lib/active_record/migration/command_recorder.rb#97 + def record(*command, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#137 + def remove_belongs_to(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def remove_check_constraint(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def remove_column(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def remove_columns(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def remove_exclusion_constraint(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def remove_foreign_key(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def remove_index(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def remove_reference(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def remove_timestamps(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def remove_unique_constraint(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def rename_column(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def rename_enum(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def rename_enum_value(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def rename_index(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def rename_table(*args, **_arg1, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#151 + def replay(migration); end + + # While executing the given block, the recorded will be in reverting mode. + # All commands recorded will end up being recorded reverted + # and in reverse order. + # For example: + # + # recorder.revert{ recorder.record(:rename_table, [:old, :new]) } + # # same effect as recorder.record(:rename_table, [:new, :old]) + # + # source://activerecord//lib/active_record/migration/command_recorder.rb#83 + def revert; end + + # Returns the value of attribute reverting. + # + # source://activerecord//lib/active_record/migration/command_recorder.rb#68 + def reverting; end + + # Sets the attribute reverting + # + # @param value the value to set the attribute reverting to. + # + # source://activerecord//lib/active_record/migration/command_recorder.rb#68 + def reverting=(_arg0); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#129 + def transaction(*args, **_arg1, &block); end + + private + + # source://activerecord//lib/active_record/migration/command_recorder.rb#339 + def invert_add_check_constraint(args); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#300 + def invert_add_foreign_key(args); end + + # @raise [ActiveRecord::IrreversibleMigration] + # + # source://activerecord//lib/active_record/migration/command_recorder.rb#361 + def invert_add_unique_constraint(args); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#319 + def invert_change_column_comment(args); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#285 + def invert_change_column_default(args); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#295 + def invert_change_column_null(args); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#329 + def invert_change_table_comment(args); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#210 + def invert_create_table(args, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#194 + def invert_disable_index(args); end + + # @raise [ActiveRecord::IrreversibleMigration] + # + # source://activerecord//lib/active_record/migration/command_recorder.rb#375 + def invert_drop_enum(args); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#217 + def invert_drop_table(args, &block); end + + # @raise [ActiveRecord::IrreversibleMigration] + # + # source://activerecord//lib/active_record/migration/command_recorder.rb#402 + def invert_drop_virtual_table(args); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#189 + def invert_enable_index(args); end + + # @raise [ActiveRecord::IrreversibleMigration] + # + # source://activerecord//lib/active_record/migration/command_recorder.rb#347 + def invert_remove_check_constraint(args); end + + # @raise [ActiveRecord::IrreversibleMigration] + # + # source://activerecord//lib/active_record/migration/command_recorder.rb#241 + def invert_remove_column(args); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#246 + def invert_remove_columns(args); end + + # @raise [ActiveRecord::IrreversibleMigration] + # + # source://activerecord//lib/active_record/migration/command_recorder.rb#356 + def invert_remove_exclusion_constraint(args); end + + # @raise [ActiveRecord::IrreversibleMigration] + # + # source://activerecord//lib/active_record/migration/command_recorder.rb#305 + def invert_remove_foreign_key(args); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#264 + def invert_remove_index(args); end + + # @raise [ActiveRecord::IrreversibleMigration] + # + # source://activerecord//lib/active_record/migration/command_recorder.rb#368 + def invert_remove_unique_constraint(args); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#259 + def invert_rename_column(args); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#381 + def invert_rename_enum(args); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#391 + def invert_rename_enum_value(args); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#254 + def invert_rename_index(args); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#234 + def invert_rename_table(args); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#199 + def invert_transaction(args, &block); end + + # Forwards any missing method call to the \target. + # + # source://activerecord//lib/active_record/migration/command_recorder.rb#413 + def method_missing(method, *_arg1, **_arg2, &_arg3); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/migration/command_recorder.rb#408 + def respond_to_missing?(method, _); end +end + +# source://activerecord//lib/active_record/migration/command_recorder.rb#50 +ActiveRecord::Migration::CommandRecorder::ReversibleAndIrreversibleMethods = T.let(T.unsafe(nil), Array) + +# source://activerecord//lib/active_record/migration/command_recorder.rb#158 +module ActiveRecord::Migration::CommandRecorder::StraightReversions + # source://activerecord//lib/active_record/migration/command_recorder.rb#178 + def invert_add_check_constraint(args, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#178 + def invert_add_column(args, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#178 + def invert_add_exclusion_constraint(args, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#178 + def invert_add_foreign_key(args, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#178 + def invert_add_index(args, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#178 + def invert_add_reference(args, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#178 + def invert_add_timestamps(args, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#178 + def invert_add_unique_constraint(args, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#178 + def invert_create_enum(args, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#178 + def invert_create_join_table(args, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#178 + def invert_create_schema(args, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#178 + def invert_create_table(args, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#178 + def invert_create_virtual_table(args, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#178 + def invert_disable_extension(args, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#178 + def invert_drop_enum(args, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#178 + def invert_drop_join_table(args, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#178 + def invert_drop_schema(args, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#178 + def invert_drop_table(args, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#178 + def invert_drop_virtual_table(args, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#178 + def invert_enable_extension(args, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#178 + def invert_execute_block(args, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#178 + def invert_remove_check_constraint(args, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#178 + def invert_remove_column(args, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#178 + def invert_remove_exclusion_constraint(args, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#178 + def invert_remove_foreign_key(args, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#178 + def invert_remove_index(args, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#178 + def invert_remove_reference(args, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#178 + def invert_remove_timestamps(args, &block); end + + # source://activerecord//lib/active_record/migration/command_recorder.rb#178 + def invert_remove_unique_constraint(args, &block); end +end + +# source://activerecord//lib/active_record/migration/compatibility.rb#5 +module ActiveRecord::Migration::Compatibility + class << self + # source://activerecord//lib/active_record/migration/compatibility.rb#6 + def find(version); end + end +end + +# source://activerecord//lib/active_record/migration/compatibility.rb#428 +class ActiveRecord::Migration::Compatibility::V4_2 < ::ActiveRecord::Migration::Compatibility::V5_0 + # source://activerecord//lib/active_record/migration/compatibility.rb#450 + def add_belongs_to(table_name, ref_name, **options); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#446 + def add_reference(table_name, ref_name, **options); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#452 + def add_timestamps(table_name, **options); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/migration/compatibility.rb#457 + def index_exists?(table_name, column_name = T.unsafe(nil), **options); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#468 + def remove_index(table_name, column_name = T.unsafe(nil), **options); end + + private + + # source://activerecord//lib/active_record/migration/compatibility.rb#474 + def compatible_table_definition(t); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#479 + def index_name_for_remove(table_name, column_name, options); end +end + +# source://activerecord//lib/active_record/migration/compatibility.rb#429 +module ActiveRecord::Migration::Compatibility::V4_2::TableDefinition + # source://activerecord//lib/active_record/migration/compatibility.rb#434 + def belongs_to(*_arg0, **options); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#430 + def references(*_arg0, **options); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#436 + def timestamps(**options); end + + private + + # source://activerecord//lib/active_record/migration/compatibility.rb#442 + def raise_on_if_exist_options(options); end +end + +# source://activerecord//lib/active_record/migration/compatibility.rb#361 +class ActiveRecord::Migration::Compatibility::V5_0 < ::ActiveRecord::Migration::Compatibility::V5_1 + # source://activerecord//lib/active_record/migration/compatibility.rb#419 + def add_belongs_to(table_name, ref_name, **options); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#406 + def add_column(table_name, column_name, type, **options); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#416 + def add_reference(table_name, ref_name, **options); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#401 + def create_join_table(table_1, table_2, column_options: T.unsafe(nil), **options); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#378 + def create_table(table_name, **options); end + + private + + # source://activerecord//lib/active_record/migration/compatibility.rb#422 + def compatible_table_definition(t); end +end + +# source://activerecord//lib/active_record/migration/compatibility.rb#362 +module ActiveRecord::Migration::Compatibility::V5_0::TableDefinition + # source://activerecord//lib/active_record/migration/compatibility.rb#371 + def belongs_to(*args, **options); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#363 + def primary_key(name, type = T.unsafe(nil), **options); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#368 + def references(*args, **options); end + + private + + # source://activerecord//lib/active_record/migration/compatibility.rb#374 + def raise_on_if_exist_options(options); end +end + +# source://activerecord//lib/active_record/migration/compatibility.rb#340 +class ActiveRecord::Migration::Compatibility::V5_1 < ::ActiveRecord::Migration::Compatibility::V5_2 + # source://activerecord//lib/active_record/migration/compatibility.rb#341 + def change_column(table_name, column_name, type, **options); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#352 + def create_table(table_name, **options); end +end + +# source://activerecord//lib/active_record/migration/compatibility.rb#288 +class ActiveRecord::Migration::Compatibility::V5_2 < ::ActiveRecord::Migration::Compatibility::V6_0 + # source://activerecord//lib/active_record/migration/compatibility.rb#322 + def add_timestamps(table_name, **options); end + + private + + # source://activerecord//lib/active_record/migration/compatibility.rb#333 + def command_recorder; end + + # source://activerecord//lib/active_record/migration/compatibility.rb#328 + def compatible_table_definition(t); end +end + +# source://activerecord//lib/active_record/migration/compatibility.rb#308 +module ActiveRecord::Migration::Compatibility::V5_2::CommandRecorder + # source://activerecord//lib/active_record/migration/compatibility.rb#313 + def invert_change_column_comment(args); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#317 + def invert_change_table_comment(args); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#309 + def invert_transaction(args, &block); end +end + +# source://activerecord//lib/active_record/migration/compatibility.rb#289 +module ActiveRecord::Migration::Compatibility::V5_2::TableDefinition + # source://activerecord//lib/active_record/migration/compatibility.rb#295 + def column(name, type, index: T.unsafe(nil), **options); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#290 + def timestamps(**options); end + + private + + # source://activerecord//lib/active_record/migration/compatibility.rb#304 + def raise_on_duplicate_column(name); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#301 + def raise_on_if_exist_options(options); end +end + +# source://activerecord//lib/active_record/migration/compatibility.rb#247 +class ActiveRecord::Migration::Compatibility::V6_0 < ::ActiveRecord::Migration::Compatibility::V6_1 + # source://activerecord//lib/active_record/migration/compatibility.rb#279 + def add_belongs_to(table_name, ref_name, **options); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#271 + def add_reference(table_name, ref_name, **options); end + + private + + # source://activerecord//lib/active_record/migration/compatibility.rb#282 + def compatible_table_definition(t); end +end + +# source://activerecord//lib/active_record/migration/compatibility.rb#248 +class ActiveRecord::Migration::Compatibility::V6_0::ReferenceDefinition < ::ActiveRecord::ConnectionAdapters::ReferenceDefinition + # source://activerecord//lib/active_record/migration/compatibility.rb#249 + def index_options(table_name); end +end + +# source://activerecord//lib/active_record/migration/compatibility.rb#254 +module ActiveRecord::Migration::Compatibility::V6_0::TableDefinition + # source://activerecord//lib/active_record/migration/compatibility.rb#259 + def belongs_to(*args, **options); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#261 + def column(name, type, index: T.unsafe(nil), **options); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#255 + def references(*args, **options); end + + private + + # source://activerecord//lib/active_record/migration/compatibility.rb#267 + def raise_on_if_exist_options(options); end +end + +# source://activerecord//lib/active_record/migration/compatibility.rb#186 +class ActiveRecord::Migration::Compatibility::V6_1 < ::ActiveRecord::Migration::Compatibility::V7_0 + # source://activerecord//lib/active_record/migration/compatibility.rb#201 + def add_column(table_name, column_name, type, **options); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#210 + def change_column(table_name, column_name, type, **options); end + + private + + # source://activerecord//lib/active_record/migration/compatibility.rb#241 + def compatible_table_definition(t); end +end + +# source://activerecord//lib/active_record/migration/compatibility.rb#187 +class ActiveRecord::Migration::Compatibility::V6_1::PostgreSQLCompat + class << self + # source://activerecord//lib/active_record/migration/compatibility.rb#188 + def compatible_timestamp_type(type, connection); end + end +end + +# source://activerecord//lib/active_record/migration/compatibility.rb#219 +module ActiveRecord::Migration::Compatibility::V6_1::TableDefinition + # source://activerecord//lib/active_record/migration/compatibility.rb#225 + def change(name, type, index: T.unsafe(nil), **options); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#230 + def column(name, type, index: T.unsafe(nil), **options); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#220 + def new_column_definition(name, type, **options); end + + private + + # source://activerecord//lib/active_record/migration/compatibility.rb#236 + def raise_on_if_exist_options(options); end +end + +# source://activerecord//lib/active_record/migration/compatibility.rb#64 +class ActiveRecord::Migration::Compatibility::V7_0 < ::ActiveRecord::Migration::Compatibility::V7_1 + include ::ActiveRecord::Migration::Compatibility::V7_0::LegacyIndexName + + # source://activerecord//lib/active_record/migration/compatibility.rb#138 + def add_belongs_to(table_name, ref_name, **options); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#124 + def add_column(table_name, column_name, type, **options); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#172 + def add_foreign_key(from_table, to_table, **options); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#129 + def add_index(table_name, column_name, **options); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#134 + def add_reference(table_name, ref_name, **options); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#153 + def change_column(table_name, column_name, type, **options); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#161 + def change_column_null(table_name, column_name, null, default = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#140 + def create_table(table_name, **options); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#165 + def disable_extension(name, **options); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#147 + def rename_table(table_name, new_name, **options); end + + private + + # source://activerecord//lib/active_record/migration/compatibility.rb#180 + def compatible_table_definition(t); end +end + +# source://activerecord//lib/active_record/migration/compatibility.rb#65 +module ActiveRecord::Migration::Compatibility::V7_0::LegacyIndexName + private + + # @return [Boolean] + # + # source://activerecord//lib/active_record/migration/compatibility.rb#89 + def expression_column_name?(column_name); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#81 + def index_name_options(column_names); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#67 + def legacy_index_name(table_name, options); end +end + +# source://activerecord//lib/active_record/migration/compatibility.rb#94 +module ActiveRecord::Migration::Compatibility::V7_0::TableDefinition + include ::ActiveRecord::Migration::Compatibility::V7_0::LegacyIndexName + + # source://activerecord//lib/active_record/migration/compatibility.rb#102 + def change(name, type, **options); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#97 + def column(name, type, **options); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#107 + def index(column_name, **options); end + + # source://activerecord//lib/active_record/migration/compatibility.rb#112 + def references(*args, **options); end + + private + + # source://activerecord//lib/active_record/migration/compatibility.rb#118 + def raise_on_if_exist_options(options); end +end + +# source://activerecord//lib/active_record/migration/compatibility.rb#61 +class ActiveRecord::Migration::Compatibility::V7_1 < ::ActiveRecord::Migration::Compatibility::V7_2; end + +# source://activerecord//lib/active_record/migration/compatibility.rb#58 +class ActiveRecord::Migration::Compatibility::V7_2 < ::ActiveRecord::Migration::Compatibility::V8_0; end + +# source://activerecord//lib/active_record/migration/compatibility.rb#34 +class ActiveRecord::Migration::Compatibility::V8_0 < ::ActiveRecord::Migration::Current + include ::ActiveRecord::Migration::Compatibility::V8_0::RemoveForeignKeyColumnMatch + + private + + # source://activerecord//lib/active_record/migration/compatibility.rb#52 + def compatible_table_definition(t); end +end + +# source://activerecord//lib/active_record/migration/compatibility.rb#35 +module ActiveRecord::Migration::Compatibility::V8_0::RemoveForeignKeyColumnMatch + # source://activerecord//lib/active_record/migration/compatibility.rb#36 + def remove_foreign_key(*args, **options); end +end + +# source://activerecord//lib/active_record/migration/compatibility.rb#42 +module ActiveRecord::Migration::Compatibility::V8_0::TableDefinition + # source://activerecord//lib/active_record/migration/compatibility.rb#43 + def remove_foreign_key(to_table = T.unsafe(nil), **options); end +end + +# This file exists to ensure that old migrations run the same way they did before a Rails upgrade. +# e.g. if you write a migration on Rails 6.1, then upgrade to Rails 7, the migration should do the same thing to your +# database as it did when you were running Rails 6.1 +# +# "Current" is an alias for `ActiveRecord::Migration`, it represents the current Rails version. +# New migration functionality that will never be backward compatible should be added directly to `ActiveRecord::Migration`. +# +# There are classes for each prior Rails version. Each class descends from the *next* Rails version, so: +# 5.2 < 6.0 < 6.1 < 7.0 < 7.1 < 7.2 < 8.0 < 8.1 +# +# If you are introducing new migration functionality that should only apply from Rails 7 onward, then you should +# find the class that immediately precedes it (6.1), and override the relevant migration methods to undo your changes. +# +# For example, Rails 6 added a default value for the `precision` option on datetime columns. So in this file, the `V5_2` +# class sets the value of `precision` to `nil` if it's not explicitly provided. This way, the default value will not apply +# for migrations written for 5.2, but will for migrations written for 6.0. +# +# source://activerecord//lib/active_record/migration/compatibility.rb#32 +ActiveRecord::Migration::Compatibility::V8_1 = ActiveRecord::Migration::Current + +# This must be defined before the inherited hook, below +# +# source://activerecord//lib/active_record/migration.rb#579 +class ActiveRecord::Migration::Current < ::ActiveRecord::Migration + # source://activerecord//lib/active_record/migration.rb#588 + def change_table(table_name, **options); end + + # source://activerecord//lib/active_record/migration.rb#612 + def compatible_table_definition(t); end + + # source://activerecord//lib/active_record/migration.rb#596 + def create_join_table(table_1, table_2, **options); end + + # source://activerecord//lib/active_record/migration.rb#580 + def create_table(table_name, **options); end + + # source://activerecord//lib/active_record/migration.rb#604 + def drop_table(*table_names, **options); end +end + +# This class is used by the schema dumper to format versions information. +# +# The class receives the current +connection+ when initialized. +# +# source://activerecord//lib/active_record/migration/default_schema_versions_formatter.rb#8 +class ActiveRecord::Migration::DefaultSchemaVersionsFormatter + # @return [DefaultSchemaVersionsFormatter] a new instance of DefaultSchemaVersionsFormatter + # + # source://activerecord//lib/active_record/migration/default_schema_versions_formatter.rb#9 + def initialize(connection); end + + # source://activerecord//lib/active_record/migration/default_schema_versions_formatter.rb#13 + def format(versions); end + + private + + # Returns the value of attribute connection. + # + # source://activerecord//lib/active_record/migration/default_schema_versions_formatter.rb#27 + def connection; end +end + +# The default strategy for executing migrations. Delegates method calls +# to the connection adapter. +# +# source://activerecord//lib/active_record/migration/default_strategy.rb#7 +class ActiveRecord::Migration::DefaultStrategy < ::ActiveRecord::Migration::ExecutionStrategy + private + + # source://activerecord//lib/active_record/migration/default_strategy.rb#17 + def connection; end + + # source://activerecord//lib/active_record/migration/default_strategy.rb#9 + def method_missing(method, *_arg1, **_arg2, &_arg3); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/migration/default_strategy.rb#13 + def respond_to_missing?(method, include_private = T.unsafe(nil)); end +end + +# ExecutionStrategy is used by the migration to respond to any method calls +# that the migration class does not implement directly. This is the base strategy. +# All strategies should inherit from this class. +# +# The ExecutionStrategy receives the current +migration+ when initialized. +# +# source://activerecord//lib/active_record/migration/execution_strategy.rb#10 +class ActiveRecord::Migration::ExecutionStrategy + # @return [ExecutionStrategy] a new instance of ExecutionStrategy + # + # source://activerecord//lib/active_record/migration/execution_strategy.rb#11 + def initialize(migration); end + + private + + # Returns the value of attribute migration. + # + # source://activerecord//lib/active_record/migration/execution_strategy.rb#16 + def migration; end +end + +# source://activerecord//lib/active_record/migration/join_table.rb#5 +module ActiveRecord::Migration::JoinTable + private + + # source://activerecord//lib/active_record/migration/join_table.rb#7 + def find_join_table_name(table_1, table_2, options = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/migration/join_table.rb#11 + def join_table_name(table_1, table_2); end +end + +# source://activerecord//lib/active_record/migration.rb#637 +ActiveRecord::Migration::MigrationFilenameRegexp = T.let(T.unsafe(nil), Regexp) + +# source://activerecord//lib/active_record/migration.rb#878 +class ActiveRecord::Migration::ReversibleBlockHelper < ::Struct + # source://activerecord//lib/active_record/migration.rb#883 + def down; end + + # Returns the value of attribute reverting + # + # @return [Object] the current value of reverting + # + # source://activerecord//lib/active_record/migration.rb#878 + def reverting; end + + # Sets the attribute reverting + # + # @param value [Object] the value to set the attribute reverting to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/migration.rb#878 + def reverting=(_); end + + # source://activerecord//lib/active_record/migration.rb#879 + def up; end + + class << self + # source://activerecord//lib/active_record/migration.rb#878 + def [](*_arg0); end + + # source://activerecord//lib/active_record/migration.rb#878 + def inspect; end + + # source://activerecord//lib/active_record/migration.rb#878 + def keyword_init?; end + + # source://activerecord//lib/active_record/migration.rb#878 + def members; end + + # source://activerecord//lib/active_record/migration.rb#878 + def new(*_arg0); end + end +end + +# = \Migration \Context +# +# MigrationContext sets the context in which a migration is run. +# +# A migration context requires the path to the migrations is set +# in the +migrations_paths+ parameter. Optionally a +schema_migration+ +# class can be provided. Multiple database applications will instantiate +# a +SchemaMigration+ object per database. From the Rake tasks, \Rails will +# handle this for you. +# +# source://activerecord//lib/active_record/migration.rb#1220 +class ActiveRecord::MigrationContext + # @return [MigrationContext] a new instance of MigrationContext + # + # source://activerecord//lib/active_record/migration.rb#1223 + def initialize(migrations_paths, schema_migration = T.unsafe(nil), internal_metadata = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/migration.rb#1349 + def current_environment; end + + # source://activerecord//lib/active_record/migration.rb#1299 + def current_version; end + + # source://activerecord//lib/active_record/migration.rb#1273 + def down(target_version = T.unsafe(nil), &block); end + + # source://activerecord//lib/active_record/migration.rb#1259 + def forward(steps = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/migration.rb#1291 + def get_all_versions; end + + # Returns the value of attribute internal_metadata. + # + # source://activerecord//lib/active_record/migration.rb#1221 + def internal_metadata; end + + # @raise [NoEnvironmentInSchemaError] + # + # source://activerecord//lib/active_record/migration.rb#1357 + def last_stored_environment; end + + # Runs the migrations in the +migrations_path+. + # + # If +target_version+ is +nil+, +migrate+ will run +up+. + # + # If the +current_version+ and +target_version+ are both + # 0 then an empty array will be returned and no migrations + # will be run. + # + # If the +current_version+ in the schema is greater than + # the +target_version+, then +down+ will be run. + # + # If none of the conditions are met, +up+ will be run with + # the +target_version+. + # + # source://activerecord//lib/active_record/migration.rb#1242 + def migrate(target_version = T.unsafe(nil), &block); end + + # source://activerecord//lib/active_record/migration.rb#1312 + def migrations; end + + # Returns the value of attribute migrations_paths. + # + # source://activerecord//lib/active_record/migration.rb#1221 + def migrations_paths; end + + # source://activerecord//lib/active_record/migration.rb#1328 + def migrations_status; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/migration.rb#1304 + def needs_migration?; end + + # source://activerecord//lib/active_record/migration.rb#1287 + def open; end + + # source://activerecord//lib/active_record/migration.rb#1308 + def pending_migration_versions; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/migration.rb#1353 + def protected_environment?; end + + # source://activerecord//lib/active_record/migration.rb#1255 + def rollback(steps = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/migration.rb#1283 + def run(direction, target_version); end + + # Returns the value of attribute schema_migration. + # + # source://activerecord//lib/active_record/migration.rb#1221 + def schema_migration; end + + # source://activerecord//lib/active_record/migration.rb#1263 + def up(target_version = T.unsafe(nil), &block); end + + private + + # source://activerecord//lib/active_record/migration.rb#1369 + def connection; end + + # source://activerecord//lib/active_record/migration.rb#1373 + def connection_pool; end + + # source://activerecord//lib/active_record/migration.rb#1377 + def migration_files; end + + # source://activerecord//lib/active_record/migration.rb#1394 + def move(direction, steps); end + + # source://activerecord//lib/active_record/migration.rb#1382 + def parse_migration_filename(filename); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/migration.rb#1390 + def valid_migration_timestamp?(version); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/migration.rb#1386 + def validate_timestamp?; end +end + +# source://activerecord//lib/active_record/migration.rb#10 +class ActiveRecord::MigrationError < ::ActiveRecord::ActiveRecordError + # @return [MigrationError] a new instance of MigrationError + # + # source://activerecord//lib/active_record/migration.rb#11 + def initialize(message = T.unsafe(nil)); end +end + +# MigrationProxy is used to defer loading of the actual migration classes +# until they are needed +# +# source://activerecord//lib/active_record/migration.rb#1186 +class ActiveRecord::MigrationProxy < ::Struct + # @return [MigrationProxy] a new instance of MigrationProxy + # + # source://activerecord//lib/active_record/migration.rb#1187 + def initialize(name, version, filename, scope); end + + # source://activerecord//lib/active_record/migration.rb#1196 + def announce(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/migration.rb#1192 + def basename; end + + # source://activerecord//lib/active_record/migration.rb#1196 + def disable_ddl_transaction(*_arg0, **_arg1, &_arg2); end + + # Returns the value of attribute filename + # + # @return [Object] the current value of filename + # + # source://activerecord//lib/active_record/migration.rb#1186 + def filename; end + + # Sets the attribute filename + # + # @param value [Object] the value to set the attribute filename to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/migration.rb#1186 + def filename=(_); end + + # source://activerecord//lib/active_record/migration.rb#1196 + def migrate(*_arg0, **_arg1, &_arg2); end + + # Returns the value of attribute name + # + # @return [Object] the current value of name + # + # source://activerecord//lib/active_record/migration.rb#1186 + def name; end + + # Sets the attribute name + # + # @param value [Object] the value to set the attribute name to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/migration.rb#1186 + def name=(_); end + + # Returns the value of attribute scope + # + # @return [Object] the current value of scope + # + # source://activerecord//lib/active_record/migration.rb#1186 + def scope; end + + # Sets the attribute scope + # + # @param value [Object] the value to set the attribute scope to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/migration.rb#1186 + def scope=(_); end + + # Returns the value of attribute version + # + # @return [Object] the current value of version + # + # source://activerecord//lib/active_record/migration.rb#1186 + def version; end + + # Sets the attribute version + # + # @param value [Object] the value to set the attribute version to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/migration.rb#1186 + def version=(_); end + + # source://activerecord//lib/active_record/migration.rb#1196 + def write(*_arg0, **_arg1, &_arg2); end + + private + + # source://activerecord//lib/active_record/migration.rb#1203 + def load_migration; end + + # source://activerecord//lib/active_record/migration.rb#1199 + def migration; end + + class << self + # source://activerecord//lib/active_record/migration.rb#1186 + def [](*_arg0); end + + # source://activerecord//lib/active_record/migration.rb#1186 + def inspect; end + + # source://activerecord//lib/active_record/migration.rb#1186 + def keyword_init?; end + + # source://activerecord//lib/active_record/migration.rb#1186 + def members; end + + # source://activerecord//lib/active_record/migration.rb#1186 + def new(*_arg0); end + end +end + +# source://activerecord//lib/active_record/migration.rb#1414 +class ActiveRecord::Migrator + # @return [Migrator] a new instance of Migrator + # + # source://activerecord//lib/active_record/migration.rb#1430 + def initialize(direction, migrations, schema_migration, internal_metadata, target_version = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/migration.rb#1451 + def current; end + + # source://activerecord//lib/active_record/migration.rb#1448 + def current_migration; end + + # source://activerecord//lib/active_record/migration.rb#1444 + def current_version; end + + # source://activerecord//lib/active_record/migration.rb#1493 + def load_migrated; end + + # source://activerecord//lib/active_record/migration.rb#1461 + def migrate; end + + # source://activerecord//lib/active_record/migration.rb#1489 + def migrated; end + + # source://activerecord//lib/active_record/migration.rb#1480 + def migrations; end + + # source://activerecord//lib/active_record/migration.rb#1484 + def pending_migrations; end + + # source://activerecord//lib/active_record/migration.rb#1453 + def run; end + + # source://activerecord//lib/active_record/migration.rb#1469 + def runnable; end + + private + + # source://activerecord//lib/active_record/migration.rb#1498 + def connection; end + + # Wrap the migration in a transaction only if supported by the adapter. + # + # source://activerecord//lib/active_record/migration.rb#1594 + def ddl_transaction(migration, &block); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/migration.rb#1589 + def down?; end + + # source://activerecord//lib/active_record/migration.rb#1537 + def execute_migration_in_transaction(migration); end + + # source://activerecord//lib/active_record/migration.rb#1559 + def finish; end + + # source://activerecord//lib/active_record/migration.rb#1626 + def generate_migrator_advisory_lock_id; end + + # Return true if a valid version is not provided. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/migration.rb#1533 + def invalid_target?; end + + # Used for running multiple migrations up to or down to a certain value. + # + # source://activerecord//lib/active_record/migration.rb#1512 + def migrate_without_lock; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/migration.rb#1528 + def ran?(migration); end + + # Stores the current environment in the database. + # + # source://activerecord//lib/active_record/migration.rb#1522 + def record_environment; end + + # source://activerecord//lib/active_record/migration.rb#1575 + def record_version_state_after_migrating(version); end + + # Used for running a specific migration. + # + # @raise [UnknownMigrationVersionError] + # + # source://activerecord//lib/active_record/migration.rb#1503 + def run_without_lock; end + + # source://activerecord//lib/active_record/migration.rb#1563 + def start; end + + # source://activerecord//lib/active_record/migration.rb#1555 + def target; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/migration.rb#1585 + def up?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/migration.rb#1606 + def use_advisory_lock?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/migration.rb#1602 + def use_transaction?(migration); end + + # @raise [DuplicateMigrationNameError] + # + # source://activerecord//lib/active_record/migration.rb#1567 + def validate(migrations); end + + # source://activerecord//lib/active_record/migration.rb#1610 + def with_advisory_lock; end + + class << self + # For cases where a table doesn't exist like loading from schema cache + # + # source://activerecord//lib/active_record/migration.rb#1419 + def current_version; end + + # Returns the value of attribute migrations_paths. + # + # source://activerecord//lib/active_record/migration.rb#1416 + def migrations_paths; end + + # Sets the attribute migrations_paths + # + # @param value the value to set the attribute migrations_paths to. + # + # source://activerecord//lib/active_record/migration.rb#1416 + def migrations_paths=(_arg0); end + end +end + +# source://activerecord//lib/active_record/migration.rb#1625 +ActiveRecord::Migrator::MIGRATOR_SALT = T.let(T.unsafe(nil), Integer) + +# Raised when a foreign key constraint cannot be added because the column type does not match the referenced column type. +# +# source://activerecord//lib/active_record/errors.rb#237 +class ActiveRecord::MismatchedForeignKey < ::ActiveRecord::StatementInvalid + # @return [MismatchedForeignKey] a new instance of MismatchedForeignKey + # + # source://activerecord//lib/active_record/errors.rb#238 + def initialize(message: T.unsafe(nil), sql: T.unsafe(nil), binds: T.unsafe(nil), table: T.unsafe(nil), foreign_key: T.unsafe(nil), target_table: T.unsafe(nil), primary_key: T.unsafe(nil), primary_key_column: T.unsafe(nil), query_parser: T.unsafe(nil), connection_pool: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/errors.rb#274 + def set_query(sql, binds); end +end + +# MissingRequiredOrderError is raised when a relation requires ordering but +# lacks any +order+ values in scope or any model order columns to use. +# +# source://activerecord//lib/active_record/errors.rb#565 +class ActiveRecord::MissingRequiredOrderError < ::ActiveRecord::ActiveRecordError; end + +# source://activerecord//lib/active_record/model_schema.rb#6 +module ActiveRecord::ModelSchema + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveRecord::ModelSchema::ClassMethods + + class << self + # Derives the join table name for +first_table+ and +second_table+. The + # table names appear in alphabetical order. A common prefix is removed + # (useful for namespaced models like Music::Artist and Music::Record): + # + # artists, records => artists_records + # records, artists => artists_records + # music_artists, music_records => music_artists_records + # music.artists, music.records => music.artists_records + # + # source://activerecord//lib/active_record/model_schema.rb#199 + def derive_join_table_name(first_table, second_table); end + end + + module GeneratedClassMethods + def immutable_strings_by_default; end + def immutable_strings_by_default=(value); end + def immutable_strings_by_default?; end + def implicit_order_column; end + def implicit_order_column=(value); end + def implicit_order_column?; end + def inheritance_column; end + def inheritance_column=(value); end + def inheritance_column?; end + def internal_metadata_table_name; end + def internal_metadata_table_name=(value); end + def internal_metadata_table_name?; end + def pluralize_table_names; end + def pluralize_table_names=(value); end + def pluralize_table_names?; end + def primary_key_prefix_type; end + def primary_key_prefix_type=(value); end + def primary_key_prefix_type?; end + def schema_migrations_table_name; end + def schema_migrations_table_name=(value); end + def schema_migrations_table_name?; end + def table_name_prefix; end + def table_name_prefix=(value); end + def table_name_prefix?; end + def table_name_suffix; end + def table_name_suffix=(value); end + def table_name_suffix?; end + end + + module GeneratedInstanceMethods + def pluralize_table_names; end + def pluralize_table_names?; end + def primary_key_prefix_type; end + def primary_key_prefix_type?; end + def table_name_prefix; end + def table_name_prefix?; end + def table_name_suffix; end + def table_name_suffix?; end + end +end + +# source://activerecord//lib/active_record/model_schema.rb#203 +module ActiveRecord::ModelSchema::ClassMethods + # source://activerecord//lib/active_record/model_schema.rb#452 + def _returning_columns_for_insert(connection); end + + # source://activerecord//lib/active_record/model_schema.rb#436 + def attributes_builder; end + + # Returns a hash where the keys are column names and the values are + # default values when instantiating the Active Record object for this table. + # + # source://activerecord//lib/active_record/model_schema.rb#488 + def column_defaults; end + + # Returns the column object for the named attribute. + # Returns an ActiveRecord::ConnectionAdapters::NullColumn if the + # named attribute does not exist. + # + # class Person < ActiveRecord::Base + # end + # + # person = Person.new + # person.column_for_attribute(:name) # the result depends on the ConnectionAdapter + # # => # + # + # person.column_for_attribute(:nothing) + # # => #, ...> + # + # source://activerecord//lib/active_record/model_schema.rb#479 + def column_for_attribute(name); end + + # Returns an array of column names as strings. + # + # source://activerecord//lib/active_record/model_schema.rb#494 + def column_names; end + + # source://activerecord//lib/active_record/model_schema.rb#448 + def columns; end + + # source://activerecord//lib/active_record/model_schema.rb#443 + def columns_hash; end + + # Returns an array of column objects where the primary id, all columns ending in "_id" or "_count", + # and columns used for single table inheritance have been removed. + # + # source://activerecord//lib/active_record/model_schema.rb#505 + def content_columns; end + + # source://activerecord//lib/active_record/model_schema.rb#305 + def full_table_name_prefix; end + + # source://activerecord//lib/active_record/model_schema.rb#309 + def full_table_name_suffix; end + + # The list of columns names the model should ignore. Ignored columns won't have attribute + # accessors defined, and won't be referenced in SQL queries. + # + # source://activerecord//lib/active_record/model_schema.rb#334 + def ignored_columns; end + + # Sets the columns names the model should ignore. Ignored columns won't have attribute + # accessors defined, and won't be referenced in SQL queries. + # + # A common usage pattern for this method is to ensure all references to an attribute + # have been removed and deployed, before a migration to drop the column from the database + # has been deployed and run. Using this two step approach to dropping columns ensures there + # is no code that raises errors due to having a cached schema in memory at the time the + # schema migration is run. + # + # For example, given a model where you want to drop the "category" attribute, first mark it + # as ignored: + # + # class Project < ActiveRecord::Base + # # schema: + # # id :bigint + # # name :string, limit: 255 + # # category :string, limit: 255 + # + # self.ignored_columns += [:category] + # end + # + # The schema still contains "category", but now the model omits it, so any meta-driven code or + # schema caching will not attempt to use the column: + # + # Project.columns_hash["category"] => nil + # + # You will get an error if accessing that attribute directly, so ensure all usages of the + # column are removed (automated tests can help you find any usages). + # + # user = Project.create!(name: "First Project") + # user.category # => raises NoMethodError + # + # source://activerecord//lib/active_record/model_schema.rb#375 + def ignored_columns=(columns); end + + # Load the model's schema information either from the schema cache + # or directly from the database. + # + # source://activerecord//lib/active_record/model_schema.rb#550 + def load_schema; end + + # Returns the next value that will be used as the primary key on + # an insert statement. + # + # source://activerecord//lib/active_record/model_schema.rb#427 + def next_sequence_value; end + + # The list of columns names the model should allow. Only columns are used to define + # attribute accessors, and are referenced in SQL queries. + # + # source://activerecord//lib/active_record/model_schema.rb#340 + def only_columns; end + + # source://activerecord//lib/active_record/model_schema.rb#381 + def only_columns=(columns); end + + # Determines if the primary key values should be selected from their + # corresponding sequence before the insert statement. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/model_schema.rb#421 + def prefetch_primary_key?; end + + # The array of names of environments where destructive actions should be prohibited. By default, + # the value is ["production"]. + # + # source://activerecord//lib/active_record/model_schema.rb#315 + def protected_environments; end + + # Sets an array of names of environments where destructive actions should be prohibited. + # + # source://activerecord//lib/active_record/model_schema.rb#324 + def protected_environments=(environments); end + + # Returns a quoted version of the table name. + # + # source://activerecord//lib/active_record/model_schema.rb#288 + def quoted_table_name; end + + # source://activerecord//lib/active_record/model_schema.rb#328 + def real_inheritance_column=(value); end + + # Resets all the cached information about columns, which will cause them + # to be reloaded on the next request. + # + # The most common usage pattern for this method is probably in a migration, + # when just after creating a table you want to populate it with some default + # values, e.g.: + # + # class CreateJobLevels < ActiveRecord::Migration[8.1] + # def up + # create_table :job_levels do |t| + # t.integer :id + # t.string :name + # + # t.timestamps + # end + # + # JobLevel.reset_column_information + # %w{assistant executive manager director}.each do |type| + # JobLevel.create(name: type) + # end + # end + # + # def down + # drop_table :job_levels + # end + # end + # + # source://activerecord//lib/active_record/model_schema.rb#539 + def reset_column_information; end + + # source://activerecord//lib/active_record/model_schema.rb#395 + def reset_sequence_name; end + + # Computes the table name, (re)sets it internally, and returns it. + # + # source://activerecord//lib/active_record/model_schema.rb#293 + def reset_table_name; end + + # source://activerecord//lib/active_record/model_schema.rb#387 + def sequence_name; end + + # Sets the name of the sequence to use when generating ids to the given + # value, or (if the value is +nil+ or +false+) to the value returned by the + # given block. This is required for Oracle and is useful for any + # database which relies on sequences for primary key generation. + # + # If a sequence name is not explicitly set when using Oracle, + # it will default to the commonly used pattern of: #{table_name}_seq + # + # If a sequence name is not explicitly set when using PostgreSQL, it + # will discover the sequence corresponding to your primary key for you. + # + # class Project < ActiveRecord::Base + # self.sequence_name = "projectseq" # default would have been "project_seq" + # end + # + # source://activerecord//lib/active_record/model_schema.rb#414 + def sequence_name=(value); end + + # source://activerecord//lib/active_record/model_schema.rb#498 + def symbol_column_to_string(name_symbol); end + + # Indicates whether the table associated with this class exists + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/model_schema.rb#432 + def table_exists?; end + + # Guesses the table name (in forced lower-case) based on the name of the class in the + # inheritance hierarchy descending directly from ActiveRecord::Base. So if the hierarchy + # looks like: Reply < Message < ActiveRecord::Base, then Message is used + # to guess the table name even when called on Reply. The rules used to do the guess + # are handled by the Inflector class in Active Support, which knows almost all common + # English inflections. You can add new inflections in config/initializers/inflections.rb. + # + # Nested classes are given table names prefixed by the singular form of + # the parent's table name. Enclosing modules are not considered. + # + # ==== Examples + # + # class Invoice < ActiveRecord::Base + # end + # + # file class table_name + # invoice.rb Invoice invoices + # + # class Invoice < ActiveRecord::Base + # class Lineitem < ActiveRecord::Base + # end + # end + # + # file class table_name + # invoice.rb Invoice::Lineitem invoice_lineitems + # + # module Invoice + # class Lineitem < ActiveRecord::Base + # end + # end + # + # file class table_name + # invoice/lineitem.rb Invoice::Lineitem lineitems + # + # Additionally, the class-level +table_name_prefix+ is prepended and the + # +table_name_suffix+ is appended. So if you have "myapp_" as a prefix, + # the table name guess for an Invoice class becomes "myapp_invoices". + # Invoice::Lineitem becomes "myapp_invoice_lineitems". + # + # Active Model Naming's +model_name+ is the base name used to guess the + # table name. In case a custom Active Model Name is defined, it will be + # used for the table name as well: + # + # class PostRecord < ActiveRecord::Base + # class << self + # def model_name + # ActiveModel::Name.new(self, nil, "Post") + # end + # end + # end + # + # PostRecord.table_name + # # => "posts" + # + # You can also set your own table name explicitly: + # + # class Mouse < ActiveRecord::Base + # self.table_name = "mice" + # end + # + # source://activerecord//lib/active_record/model_schema.rb#263 + def table_name; end + + # Sets the table name explicitly. Example: + # + # class Project < ActiveRecord::Base + # self.table_name = "project" + # end + # + # source://activerecord//lib/active_record/model_schema.rb#273 + def table_name=(value); end + + # source://activerecord//lib/active_record/model_schema.rb#462 + def yaml_encoder; end + + protected + + # source://activerecord//lib/active_record/model_schema.rb#565 + def initialize_load_schema_monitor; end + + # source://activerecord//lib/active_record/model_schema.rb#569 + def reload_schema_from_cache(recursive = T.unsafe(nil)); end + + private + + # @raise [ArgumentError] + # + # source://activerecord//lib/active_record/model_schema.rb#654 + def check_model_columns(columns_present); end + + # Computes and returns a table name according to default conventions. + # + # source://activerecord//lib/active_record/model_schema.rb#627 + def compute_table_name; end + + # source://activerecord//lib/active_record/model_schema.rb#590 + def inherited(child_class); end + + # source://activerecord//lib/active_record/model_schema.rb#604 + def load_schema!; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/model_schema.rb#600 + def schema_loaded?; end + + # source://activerecord//lib/active_record/model_schema.rb#643 + def type_for_column(connection, column); end + + # Guesses the table name, but does not decorate it with prefix and suffix information. + # + # source://activerecord//lib/active_record/model_schema.rb#621 + def undecorated_table_name(model_name); end +end + +# Raised when there are multiple errors while doing a mass assignment through the +# {ActiveRecord::Base#attributes=}[rdoc-ref:ActiveModel::AttributeAssignment#attributes=] +# method. The exception has an +errors+ property that contains an array of AttributeAssignmentError +# objects, each corresponding to the error while assigning to an attribute. +# +# source://activerecord//lib/active_record/errors.rb#470 +class ActiveRecord::MultiparameterAssignmentErrors < ::ActiveRecord::ActiveRecordError + # @return [MultiparameterAssignmentErrors] a new instance of MultiparameterAssignmentErrors + # + # source://activerecord//lib/active_record/errors.rb#473 + def initialize(errors = T.unsafe(nil)); end + + # Returns the value of attribute errors. + # + # source://activerecord//lib/active_record/errors.rb#471 + def errors; end +end + +# source://activerecord//lib/active_record/nested_attributes.rb#8 +module ActiveRecord::NestedAttributes + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveRecord::NestedAttributes::ClassMethods + + # Returns ActiveRecord::AutosaveAssociation#marked_for_destruction? It's + # used in conjunction with fields_for to build a form element for the + # destruction of this association. + # + # See ActionView::Helpers::FormHelper#fields_for for more info. + # + # source://activerecord//lib/active_record/nested_attributes.rb#403 + def _destroy; end + + private + + # @return [Boolean] + # + # source://activerecord//lib/active_record/nested_attributes.rb#616 + def allow_destroy?(association_name); end + + # Assigns the given attributes to the collection association. + # + # Hashes with an :id value matching an existing associated record + # will update that record. Hashes without an :id value will build + # a new record for the association. Hashes with a matching :id + # value and a :_destroy key set to a truthy value will mark the + # matched record for destruction. + # + # For example: + # + # assign_nested_attributes_for_collection_association(:people, { + # '1' => { id: '1', name: 'Peter' }, + # '2' => { name: 'John' }, + # '3' => { id: '2', _destroy: true } + # }) + # + # Will update the name of the Person with ID 1, build a new associated + # person with the name 'John', and mark the associated Person with ID 2 + # for destruction. + # + # Also accepts an Array of attribute hashes: + # + # assign_nested_attributes_for_collection_association(:people, [ + # { id: '1', name: 'Peter' }, + # { name: 'John' }, + # { id: '2', _destroy: true } + # ]) + # + # source://activerecord//lib/active_record/nested_attributes.rb#489 + def assign_nested_attributes_for_collection_association(association_name, attributes_collection); end + + # Assigns the given attributes to the association. + # + # If an associated record does not yet exist, one will be instantiated. If + # an associated record already exists, the method's behavior depends on + # the value of the update_only option. If update_only is +false+ and the + # given attributes include an :id that matches the existing record's + # id, then the existing record will be modified. If no :id is provided + # it will be replaced with a new record. If update_only is +true+ the existing + # record will be modified regardless of whether an :id is provided. + # + # If the given attributes include a matching :id attribute, or + # update_only is true, and a :_destroy key set to a truthy value, + # then the existing record will be marked for destruction. + # + # source://activerecord//lib/active_record/nested_attributes.rb#425 + def assign_nested_attributes_for_one_to_one_association(association_name, attributes); end + + # Updates a record with the +attributes+ or marks it for destruction if + # +allow_destroy+ is +true+ and has_destroy_flag? returns +true+. + # + # source://activerecord//lib/active_record/nested_attributes.rb#578 + def assign_to_or_mark_for_destruction(record, attributes, allow_destroy); end + + # Determines if a record with the particular +attributes+ should be + # rejected by calling the reject_if Symbol or Proc (if defined). + # The reject_if option is defined by +accepts_nested_attributes_for+. + # + # Returns false if there is a +destroy_flag+ on the attributes. + # + # source://activerecord//lib/active_record/nested_attributes.rb#600 + def call_reject_if(association_name, attributes); end + + # Takes in a limit and checks if the attributes_collection has too many + # records. It accepts limit in the form of symbol, proc, or + # number-like object (anything that can be compared with an integer). + # + # Raises TooManyRecords error if the attributes_collection is + # larger than the limit. + # + # source://activerecord//lib/active_record/nested_attributes.rb#558 + def check_record_limit!(limit, attributes_collection); end + + # source://activerecord//lib/active_record/nested_attributes.rb#626 + def find_record_by_id(klass, records, id); end + + # Determines if a hash contains a truthy _destroy key. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/nested_attributes.rb#584 + def has_destroy_flag?(hash); end + + # @raise [RecordNotFound] + # + # source://activerecord//lib/active_record/nested_attributes.rb#620 + def raise_nested_attributes_record_not_found!(association_name, record_id); end + + # Determines if a new record should be rejected by checking + # has_destroy_flag? or if a :reject_if proc exists for this + # association and evaluates to +true+. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/nested_attributes.rb#591 + def reject_new_record?(association_name, attributes); end + + # Only take into account the destroy flag if :allow_destroy is true + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/nested_attributes.rb#612 + def will_be_destroyed?(association_name, attributes); end + + module GeneratedClassMethods + def nested_attributes_options; end + def nested_attributes_options=(value); end + def nested_attributes_options?; end + end + + module GeneratedInstanceMethods + def nested_attributes_options; end + def nested_attributes_options?; end + end +end + +# = Active Record Nested \Attributes +# +# Nested attributes allow you to save attributes on associated records +# through the parent. By default nested attribute updating is turned off +# and you can enable it using the accepts_nested_attributes_for class +# method. When you enable nested attributes an attribute writer is +# defined on the model. +# +# The attribute writer is named after the association, which means that +# in the following example, two new methods are added to your model: +# +# author_attributes=(attributes) and +# pages_attributes=(attributes). +# +# class Book < ActiveRecord::Base +# has_one :author +# has_many :pages +# +# accepts_nested_attributes_for :author, :pages +# end +# +# Note that the :autosave option is automatically enabled on every +# association that accepts_nested_attributes_for is used for. +# +# === One-to-one +# +# Consider a Member model that has one Avatar: +# +# class Member < ActiveRecord::Base +# has_one :avatar +# accepts_nested_attributes_for :avatar +# end +# +# Enabling nested attributes on a one-to-one association allows you to +# create the member and avatar in one go: +# +# params = { member: { name: 'Jack', avatar_attributes: { icon: 'smiling' } } } +# member = Member.create(params[:member]) +# member.avatar.id # => 2 +# member.avatar.icon # => 'smiling' +# +# It also allows you to update the avatar through the member: +# +# params = { member: { avatar_attributes: { id: '2', icon: 'sad' } } } +# member.update params[:member] +# member.avatar.icon # => 'sad' +# +# If you want to update the current avatar without providing the id, you must add :update_only option. +# +# class Member < ActiveRecord::Base +# has_one :avatar +# accepts_nested_attributes_for :avatar, update_only: true +# end +# +# params = { member: { avatar_attributes: { icon: 'sad' } } } +# member.update params[:member] +# member.avatar.id # => 2 +# member.avatar.icon # => 'sad' +# +# By default you will only be able to set and update attributes on the +# associated model. If you want to destroy the associated model through the +# attributes hash, you have to enable it first using the +# :allow_destroy option. +# +# class Member < ActiveRecord::Base +# has_one :avatar +# accepts_nested_attributes_for :avatar, allow_destroy: true +# end +# +# Now, when you add the _destroy key to the attributes hash, with a +# value that evaluates to +true+, you will destroy the associated model: +# +# member.avatar_attributes = { id: '2', _destroy: '1' } +# member.avatar.marked_for_destruction? # => true +# member.save +# member.reload.avatar # => nil +# +# Note that the model will _not_ be destroyed until the parent is saved. +# +# Also note that the model will not be destroyed unless you also specify +# its id in the updated hash. +# +# === One-to-many +# +# Consider a member that has a number of posts: +# +# class Member < ActiveRecord::Base +# has_many :posts +# accepts_nested_attributes_for :posts +# end +# +# You can now set or update attributes on the associated posts through +# an attribute hash for a member: include the key +:posts_attributes+ +# with an array of hashes of post attributes as a value. +# +# For each hash that does _not_ have an id key a new record will +# be instantiated, unless the hash also contains a _destroy key +# that evaluates to +true+. +# +# params = { member: { +# name: 'joe', posts_attributes: [ +# { title: 'Kari, the awesome Ruby documentation browser!' }, +# { title: 'The egalitarian assumption of the modern citizen' }, +# { title: '', _destroy: '1' } # this will be ignored +# ] +# }} +# +# member = Member.create(params[:member]) +# member.posts.length # => 2 +# member.posts.first.title # => 'Kari, the awesome Ruby documentation browser!' +# member.posts.second.title # => 'The egalitarian assumption of the modern citizen' +# +# You may also set a +:reject_if+ proc to silently ignore any new record +# hashes if they fail to pass your criteria. For example, the previous +# example could be rewritten as: +# +# class Member < ActiveRecord::Base +# has_many :posts +# accepts_nested_attributes_for :posts, reject_if: proc { |attributes| attributes['title'].blank? } +# end +# +# params = { member: { +# name: 'joe', posts_attributes: [ +# { title: 'Kari, the awesome Ruby documentation browser!' }, +# { title: 'The egalitarian assumption of the modern citizen' }, +# { title: '' } # this will be ignored because of the :reject_if proc +# ] +# }} +# +# member = Member.create(params[:member]) +# member.posts.length # => 2 +# member.posts.first.title # => 'Kari, the awesome Ruby documentation browser!' +# member.posts.second.title # => 'The egalitarian assumption of the modern citizen' +# +# Alternatively, +:reject_if+ also accepts a symbol for using methods: +# +# class Member < ActiveRecord::Base +# has_many :posts +# accepts_nested_attributes_for :posts, reject_if: :new_record? +# end +# +# class Member < ActiveRecord::Base +# has_many :posts +# accepts_nested_attributes_for :posts, reject_if: :reject_posts +# +# def reject_posts(attributes) +# attributes['title'].blank? +# end +# end +# +# If the hash contains an id key that matches an already +# associated record, the matching record will be modified: +# +# member.attributes = { +# name: 'Joe', +# posts_attributes: [ +# { id: 1, title: '[UPDATED] An, as of yet, undisclosed awesome Ruby documentation browser!' }, +# { id: 2, title: '[UPDATED] other post' } +# ] +# } +# +# member.posts.first.title # => '[UPDATED] An, as of yet, undisclosed awesome Ruby documentation browser!' +# member.posts.second.title # => '[UPDATED] other post' +# +# However, the above applies if the parent model is being updated as well. +# For example, if you wanted to create a +member+ named _joe_ and wanted to +# update the +posts+ at the same time, that would give an +# ActiveRecord::RecordNotFound error. +# +# By default the associated records are protected from being destroyed. If +# you want to destroy any of the associated records through the attributes +# hash, you have to enable it first using the :allow_destroy +# option. This will allow you to also use the _destroy key to +# destroy existing records: +# +# class Member < ActiveRecord::Base +# has_many :posts +# accepts_nested_attributes_for :posts, allow_destroy: true +# end +# +# params = { member: { +# posts_attributes: [{ id: '2', _destroy: '1' }] +# }} +# +# member.attributes = params[:member] +# member.posts.detect { |p| p.id == 2 }.marked_for_destruction? # => true +# member.posts.length # => 2 +# member.save +# member.reload.posts.length # => 1 +# +# Nested attributes for an associated collection can also be passed in +# the form of a hash of hashes instead of an array of hashes: +# +# Member.create( +# name: 'joe', +# posts_attributes: { +# first: { title: 'Foo' }, +# second: { title: 'Bar' } +# } +# ) +# +# has the same effect as +# +# Member.create( +# name: 'joe', +# posts_attributes: [ +# { title: 'Foo' }, +# { title: 'Bar' } +# ] +# ) +# +# The keys of the hash which is the value for +:posts_attributes+ are +# ignored in this case. +# However, it is not allowed to use 'id' or :id for one of +# such keys, otherwise the hash will be wrapped in an array and +# interpreted as an attribute hash for a single post. +# +# Passing attributes for an associated collection in the form of a hash +# of hashes can be used with hashes generated from HTTP/HTML parameters, +# where there may be no natural way to submit an array of hashes. +# +# === Saving +# +# All changes to models, including the destruction of those marked for +# destruction, are saved and destroyed automatically and atomically when +# the parent model is saved. This happens inside the transaction initiated +# by the parent's save method. See ActiveRecord::AutosaveAssociation. +# +# === Validating the presence of a parent model +# +# The +belongs_to+ association validates the presence of the parent model +# by default. You can disable this behavior by specifying optional: true. +# This can be used, for example, when conditionally validating the presence +# of the parent model: +# +# class Veterinarian < ActiveRecord::Base +# has_many :patients, inverse_of: :veterinarian +# accepts_nested_attributes_for :patients +# end +# +# class Patient < ActiveRecord::Base +# belongs_to :veterinarian, inverse_of: :patients, optional: true +# validates :veterinarian, presence: true, unless: -> { awaiting_intake } +# end +# +# Note that if you do not specify the +:inverse_of+ option, then +# Active Record will try to automatically guess the inverse association +# based on heuristics. +# +# For one-to-one nested associations, if you build the new (in-memory) +# child object yourself before assignment, then this module will not +# overwrite it, e.g.: +# +# class Member < ActiveRecord::Base +# has_one :avatar +# accepts_nested_attributes_for :avatar +# +# def avatar +# super || build_avatar(width: 200) +# end +# end +# +# member = Member.new +# member.avatar_attributes = {icon: 'sad'} +# member.avatar.width # => 200 +# +# === Creating forms with nested attributes +# +# Use ActionView::Helpers::FormHelper#fields_for to create form elements for +# nested attributes. +# +# Integration test params should reflect the structure of the form. For +# example: +# +# post members_path, params: { +# member: { +# name: 'joe', +# posts_attributes: { +# '0' => { title: 'Foo' }, +# '1' => { title: 'Bar' } +# } +# } +# } +# +# source://activerecord//lib/active_record/nested_attributes.rb#301 +module ActiveRecord::NestedAttributes::ClassMethods + # Defines an attributes writer for the specified association(s). + # + # Supported options: + # [:allow_destroy] + # If true, destroys any members from the attributes hash with a + # _destroy key and a value that evaluates to +true+ + # (e.g. 1, '1', true, or 'true'). This option is false by default. + # [:reject_if] + # Allows you to specify a Proc or a Symbol pointing to a method + # that checks whether a record should be built for a certain attribute + # hash. The hash is passed to the supplied Proc or the method + # and it should return either +true+ or +false+. When no +:reject_if+ + # is specified, a record will be built for all attribute hashes that + # do not have a _destroy value that evaluates to true. + # Passing :all_blank instead of a Proc will create a proc + # that will reject a record where all the attributes are blank excluding + # any value for +_destroy+. + # [:limit] + # Allows you to specify the maximum number of associated records that + # can be processed with the nested attributes. Limit also can be specified + # as a Proc or a Symbol pointing to a method that should return a number. + # If the size of the nested attributes array exceeds the specified limit, + # NestedAttributes::TooManyRecords exception is raised. If omitted, any + # number of associations can be processed. + # Note that the +:limit+ option is only applicable to one-to-many + # associations. + # [:update_only] + # For a one-to-one association, this option allows you to specify how + # nested attributes are going to be used when an associated record already + # exists. In general, an existing record may either be updated with the + # new set of attribute values or be replaced by a wholly new record + # containing those values. By default the +:update_only+ option is false + # and the nested attributes are used to update the existing record only + # if they include the record's :id value. Otherwise a new + # record will be instantiated and used to replace the existing one. + # However if the +:update_only+ option is true, the nested attributes + # are used to update the record's attributes always, regardless of + # whether the :id is present. The option is ignored for collection + # associations. + # + # Examples: + # # creates avatar_attributes= + # accepts_nested_attributes_for :avatar, reject_if: proc { |attributes| attributes['name'].blank? } + # # creates avatar_attributes= + # accepts_nested_attributes_for :avatar, reject_if: :all_blank + # # creates avatar_attributes= and posts_attributes= + # accepts_nested_attributes_for :avatar, :posts, allow_destroy: true + # + # source://activerecord//lib/active_record/nested_attributes.rb#351 + def accepts_nested_attributes_for(*attr_names); end + + private + + # Generates a writer method for this association. Serves as a point for + # accessing the objects in the association. For example, this method + # could generate the following: + # + # def pirate_attributes=(attributes) + # assign_nested_attributes_for_one_to_one_association(:pirate, attributes) + # end + # + # This redirects the attempts to write objects in an association through + # the helper methods defined below. Makes it seem like the nested + # associations are just regular associations. + # + # source://activerecord//lib/active_record/nested_attributes.rb#386 + def generate_association_writer(association_name, type); end +end + +# source://activerecord//lib/active_record/nested_attributes.rb#302 +ActiveRecord::NestedAttributes::ClassMethods::REJECT_ALL_BLANK_PROC = T.let(T.unsafe(nil), Proc) + +# source://activerecord//lib/active_record/nested_attributes.rb#9 +class ActiveRecord::NestedAttributes::TooManyRecords < ::ActiveRecord::ActiveRecordError; end + +# Attribute hash keys that should not be assigned as normal attributes. +# These hash keys are nested attributes implementation details. +# +# source://activerecord//lib/active_record/nested_attributes.rb#410 +ActiveRecord::NestedAttributes::UNASSIGNABLE_KEYS = T.let(T.unsafe(nil), Array) + +# Raised when a given database does not exist. +# +# source://activerecord//lib/active_record/errors.rb#335 +class ActiveRecord::NoDatabaseError < ::ActiveRecord::StatementInvalid + include ::ActiveSupport::ActionableError + extend ::ActiveSupport::ActionableError::ClassMethods + + # @return [NoDatabaseError] a new instance of NoDatabaseError + # + # source://activerecord//lib/active_record/errors.rb#342 + def initialize(message = T.unsafe(nil), connection_pool: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/errors.rb#336 + def _actions; end + + # source://activerecord//lib/active_record/errors.rb#336 + def _actions=(_arg0); end + + # source://activerecord//lib/active_record/errors.rb#336 + def _actions?; end + + class << self + # source://activerecord//lib/active_record/errors.rb#336 + def _actions; end + + # source://activerecord//lib/active_record/errors.rb#336 + def _actions=(value); end + + # source://activerecord//lib/active_record/errors.rb#336 + def _actions?; end + + # source://activerecord//lib/active_record/errors.rb#347 + def db_error(db_name); end + + private + + # source://activerecord//lib/active_record/errors.rb#336 + def __class_attr__actions; end + + # source://activerecord//lib/active_record/errors.rb#336 + def __class_attr__actions=(new_value); end + end +end + +# source://activerecord//lib/active_record/migration.rb#195 +class ActiveRecord::NoEnvironmentInSchemaError < ::ActiveRecord::MigrationError + # @return [NoEnvironmentInSchemaError] a new instance of NoEnvironmentInSchemaError + # + # source://activerecord//lib/active_record/migration.rb#196 + def initialize; end +end + +# = Active Record No Touching +# +# source://activerecord//lib/active_record/no_touching.rb#5 +module ActiveRecord::NoTouching + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::NoTouching::ClassMethods + + # Returns +true+ if the class has +no_touching+ set, +false+ otherwise. + # + # Project.no_touching do + # Project.first.no_touching? # true + # Message.first.no_touching? # false + # end + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/no_touching.rb#53 + def no_touching?; end + + # source://activerecord//lib/active_record/no_touching.rb#61 + def touch(*_arg0, **_arg1); end + + # source://activerecord//lib/active_record/no_touching.rb#57 + def touch_later(*_arg0); end + + class << self + # @return [Boolean] + # + # source://activerecord//lib/active_record/no_touching.rb#36 + def applied_to?(klass); end + + # source://activerecord//lib/active_record/no_touching.rb#29 + def apply_to(klass); end + + private + + # source://activerecord//lib/active_record/no_touching.rb#41 + def klasses; end + end +end + +# source://activerecord//lib/active_record/no_touching.rb#8 +module ActiveRecord::NoTouching::ClassMethods + # Lets you selectively disable calls to +touch+ for the + # duration of a block. + # + # ==== Examples + # ActiveRecord::Base.no_touching do + # Project.first.touch # does nothing + # Message.first.touch # does nothing + # end + # + # Project.no_touching do + # Project.first.touch # does nothing + # Message.first.touch # works, but does not touch the associated project + # end + # + # source://activerecord//lib/active_record/no_touching.rb#23 + def no_touching(&block); end +end + +# Raised when a record cannot be inserted or updated because it would violate a not null constraint. +# +# source://activerecord//lib/active_record/errors.rb#292 +class ActiveRecord::NotNullViolation < ::ActiveRecord::StatementInvalid; end + +# source://activerecord//lib/active_record/migration/pending_migration_connection.rb#4 +class ActiveRecord::PendingMigrationConnection + class << self + # source://activerecord//lib/active_record/migration/pending_migration_connection.rb#17 + def current_preventing_writes; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/migration/pending_migration_connection.rb#13 + def primary_class?; end + + # source://activerecord//lib/active_record/migration/pending_migration_connection.rb#5 + def with_temporary_pool(db_config, &block); end + end +end + +# source://activerecord//lib/active_record/migration.rb#147 +class ActiveRecord::PendingMigrationError < ::ActiveRecord::MigrationError + include ::ActiveSupport::ActionableError + extend ::ActiveSupport::ActionableError::ClassMethods + + # @return [PendingMigrationError] a new instance of PendingMigrationError + # + # source://activerecord//lib/active_record/migration.rb#158 + def initialize(message = T.unsafe(nil), pending_migrations: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/migration.rb#148 + def _actions; end + + # source://activerecord//lib/active_record/migration.rb#148 + def _actions=(_arg0); end + + # source://activerecord//lib/active_record/migration.rb#148 + def _actions?; end + + private + + # source://activerecord//lib/active_record/migration.rb#181 + def connection_pool; end + + # source://activerecord//lib/active_record/migration.rb#167 + def detailed_migration_message(pending_migrations); end + + class << self + # source://activerecord//lib/active_record/migration.rb#148 + def _actions; end + + # source://activerecord//lib/active_record/migration.rb#148 + def _actions=(value); end + + # source://activerecord//lib/active_record/migration.rb#148 + def _actions?; end + + private + + # source://activerecord//lib/active_record/migration.rb#148 + def __class_attr__actions; end + + # source://activerecord//lib/active_record/migration.rb#148 + def __class_attr__actions=(new_value); end + end +end + +# = Active Record \Persistence +# +# source://activerecord//lib/active_record/persistence.rb#7 +module ActiveRecord::Persistence + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::Persistence::ClassMethods + + # Returns an instance of the specified +klass+ with the attributes of the + # current record. This is mostly useful in relation to single table + # inheritance (STI) structures where you want a subclass to appear as the + # superclass. This can be used along with record identification in + # Action Pack to allow, say, Client < Company to do something + # like render partial: @client.becomes(Company) to render that + # instance using the companies/company partial instead of clients/client. + # + # Note: The new instance will share a link to the same attributes as the original class. + # Therefore the STI column value will still be the same. + # Any change to the attributes on either instance will affect both instances. + # This includes any attribute initialization done by the new instance. + # + # If you want to change the STI column as well, use #becomes! instead. + # + # source://activerecord//lib/active_record/persistence.rb#487 + def becomes(klass); end + + # Wrapper around #becomes that also changes the instance's STI column value. + # This is especially useful if you want to persist the changed class in your + # database. + # + # Note: The old instance's STI column value will be changed too, as both objects + # share the same set of attributes. + # + # source://activerecord//lib/active_record/persistence.rb#509 + def becomes!(klass); end + + # Initializes +attribute+ to zero if +nil+ and subtracts the value passed as +by+ (default is 1). + # The decrement is performed directly on the underlying attribute, no setter is invoked. + # Only makes sense for number-based attributes. Returns +self+. + # + # source://activerecord//lib/active_record/persistence.rb#686 + def decrement(attribute, by = T.unsafe(nil)); end + + # Wrapper around #decrement that writes the update to the database. + # Only +attribute+ is updated; the record itself is not saved. + # This means that any other modified attributes will still be dirty. + # Validations and callbacks are skipped. Supports the +touch+ option from + # +update_counters+, see that for more. + # Returns +self+. + # + # source://activerecord//lib/active_record/persistence.rb#696 + def decrement!(attribute, by = T.unsafe(nil), touch: T.unsafe(nil)); end + + # Deletes the record in the database and freezes this instance to + # reflect that no changes should be made (since they can't be + # persisted). Returns the frozen instance. + # + # The row is simply removed with an SQL +DELETE+ statement on the + # record's primary key, and no callbacks are executed. + # + # Note that this will also delete records marked as {#readonly?}[rdoc-ref:Core#readonly?]. + # + # To enforce the object's +before_destroy+ and +after_destroy+ + # callbacks or any :dependent association + # options, use #destroy. + # + # source://activerecord//lib/active_record/persistence.rb#439 + def delete; end + + # Deletes the record in the database and freezes this instance to reflect + # that no changes should be made (since they can't be persisted). + # + # There's a series of callbacks associated with #destroy. If the + # before_destroy callback throws +:abort+ the action is cancelled + # and #destroy returns +false+. + # See ActiveRecord::Callbacks for further details. + # + # source://activerecord//lib/active_record/persistence.rb#453 + def destroy; end + + # Deletes the record in the database and freezes this instance to reflect + # that no changes should be made (since they can't be persisted). + # + # There's a series of callbacks associated with #destroy!. If the + # before_destroy callback throws +:abort+ the action is cancelled + # and #destroy! raises ActiveRecord::RecordNotDestroyed. + # See ActiveRecord::Callbacks for further details. + # + # source://activerecord//lib/active_record/persistence.rb#469 + def destroy!; end + + # Returns true if this object has been destroyed, otherwise returns false. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/persistence.rb#355 + def destroyed?; end + + # Initializes +attribute+ to zero if +nil+ and adds the value passed as +by+ (default is 1). + # The increment is performed directly on the underlying attribute, no setter is invoked. + # Only makes sense for number-based attributes. Returns +self+. + # + # source://activerecord//lib/active_record/persistence.rb#656 + def increment(attribute, by = T.unsafe(nil)); end + + # Wrapper around #increment that writes the update to the database. + # Only +attribute+ is updated; the record itself is not saved. + # This means that any other modified attributes will still be dirty. + # Validations and callbacks are skipped. Supports the +touch+ option from + # +update_counters+, see that for more. + # + # This method raises an ActiveRecord::ActiveRecordError when called on new + # objects, or when at least one of the attributes is marked as readonly. + # + # Returns +self+. + # + # @raise [ActiveRecordError] + # + # source://activerecord//lib/active_record/persistence.rb#672 + def increment!(attribute, by = T.unsafe(nil), touch: T.unsafe(nil)); end + + # Returns true if this object hasn't been saved yet -- that is, a record + # for the object doesn't exist in the database yet; otherwise, returns false. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/persistence.rb#338 + def new_record?; end + + # Returns true if the record is persisted, i.e. it's not a new record and it was + # not destroyed, otherwise returns false. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/persistence.rb#361 + def persisted?; end + + # Returns true if this object was just created -- that is, prior to the last + # update or delete, the object didn't exist in the database and new_record? would have + # returned true. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/persistence.rb#345 + def previously_new_record?; end + + # Returns true if this object was previously persisted but now it has been deleted. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/persistence.rb#350 + def previously_persisted?; end + + # Reloads the record from the database. + # + # This method finds the record by its primary key (which could be assigned + # manually) and modifies the receiver in-place: + # + # account = Account.new + # # => # + # account.id = 1 + # account.reload + # # Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 1]] + # # => # + # + # Attributes are reloaded from the database, and caches busted, in + # particular the associations cache and the QueryCache. + # + # If the record no longer exists in the database ActiveRecord::RecordNotFound + # is raised. Otherwise, in addition to the in-place modification the method + # returns +self+ for convenience. + # + # The optional :lock flag option allows you to lock the reloaded record: + # + # reload(lock: true) # reload with pessimistic locking + # + # Reloading is commonly used in test suites to test something is actually + # written to the database, or when some action modifies the corresponding + # row in the database but not the object in memory: + # + # assert account.deposit!(25) + # assert_equal 25, account.credit # check it is updated in memory + # assert_equal 25, account.reload.credit # check it is also persisted + # + # Another common use case is optimistic locking handling: + # + # def with_optimistic_retry + # begin + # yield + # rescue ActiveRecord::StaleObjectError + # begin + # # Reload lock_version in particular. + # reload + # rescue ActiveRecord::RecordNotFound + # # If the record is gone there is nothing to do. + # else + # retry + # end + # end + # end + # + # source://activerecord//lib/active_record/persistence.rb#773 + def reload(options = T.unsafe(nil)); end + + # :call-seq: + # save(**options) + # + # Saves the model. + # + # If the model is new, a record gets created in the database, otherwise + # the existing record gets updated. + # + # By default, save always runs validations. If any of them fail the action + # is cancelled and #save returns +false+, and the record won't be saved. However, if you supply + # validate: false, validations are bypassed altogether. See + # ActiveRecord::Validations for more information. + # + # By default, #save also sets the +updated_at+/+updated_on+ attributes to + # the current time. However, if you supply touch: false, these + # timestamps will not be updated. + # + # There's a series of callbacks associated with #save. If any of the + # before_* callbacks throws +:abort+ the action is cancelled and + # #save returns +false+. See ActiveRecord::Callbacks for further + # details. + # + # Attributes marked as readonly are silently ignored if the record is + # being updated. + # + # source://activerecord//lib/active_record/persistence.rb#390 + def save(**options, &block); end + + # :call-seq: + # save!(**options) + # + # Saves the model. + # + # If the model is new, a record gets created in the database, otherwise + # the existing record gets updated. + # + # By default, #save! always runs validations. If any of them fail + # ActiveRecord::RecordInvalid gets raised, and the record won't be saved. However, if you supply + # validate: false, validations are bypassed altogether. See + # ActiveRecord::Validations for more information. + # + # By default, #save! also sets the +updated_at+/+updated_on+ attributes to + # the current time. However, if you supply touch: false, these + # timestamps will not be updated. + # + # There's a series of callbacks associated with #save!. If any of + # the before_* callbacks throws +:abort+ the action is cancelled + # and #save! raises ActiveRecord::RecordNotSaved. See + # ActiveRecord::Callbacks for further details. + # + # Attributes marked as readonly are silently ignored if the record is + # being updated. + # + # Unless an error is raised, returns true. + # + # source://activerecord//lib/active_record/persistence.rb#423 + def save!(**options, &block); end + + # Assigns to +attribute+ the boolean opposite of attribute?. So + # if the predicate returns +true+ the attribute will become +false+. This + # method toggles directly the underlying value without calling any setter. + # Returns +self+. + # + # Example: + # + # user = User.first + # user.banned? # => false + # user.toggle(:banned) + # user.banned? # => true + # + # source://activerecord//lib/active_record/persistence.rb#712 + def toggle(attribute); end + + # Wrapper around #toggle that saves the record. This method differs from + # its non-bang version in the sense that it passes through the attribute setter. + # Saving is not subjected to validation checks. Returns +true+ if the + # record could be saved. + # + # source://activerecord//lib/active_record/persistence.rb#721 + def toggle!(attribute); end + + # Saves the record with the updated_at/on attributes set to the current time + # or the time specified. + # Please note that no validation is performed and only the +after_touch+, + # +after_commit+ and +after_rollback+ callbacks are executed. + # + # This method can be passed attribute names and an optional time argument. + # If attribute names are passed, they are updated along with updated_at/on + # attributes. If no time argument is passed, the current time is used as default. + # + # product.touch # updates updated_at/on with current time + # product.touch(time: Time.new(2015, 2, 16, 0, 0, 0)) # updates updated_at/on with specified time + # product.touch(:designed_at) # updates the designed_at attribute and updated_at/on + # product.touch(:started_at, :ended_at) # updates started_at, ended_at and updated_at/on attributes + # + # If used along with {belongs_to}[rdoc-ref:Associations::ClassMethods#belongs_to] + # then +touch+ will invoke +touch+ method on associated object. + # + # class Brake < ActiveRecord::Base + # belongs_to :car, touch: true + # end + # + # class Car < ActiveRecord::Base + # belongs_to :corporation, touch: true + # end + # + # # triggers @brake.car.touch and @brake.car.corporation.touch + # @brake.touch + # + # Note that +touch+ must be used on a persisted object, or else an + # ActiveRecordError will be thrown. For example: + # + # ball = Ball.new + # ball.touch(:updated_at) # => raises ActiveRecordError + # + # source://activerecord//lib/active_record/persistence.rb#824 + def touch(*names, time: T.unsafe(nil)); end + + # Updates the attributes of the model from the passed-in hash and saves the + # record, all wrapped in a transaction. If the object is invalid, the saving + # will fail and false will be returned. + # + # source://activerecord//lib/active_record/persistence.rb#564 + def update(attributes); end + + # Updates its receiver just like #update but calls #save! instead + # of +save+, so an exception is raised if the record is invalid and saving will fail. + # + # source://activerecord//lib/active_record/persistence.rb#575 + def update!(attributes); end + + # Updates a single attribute and saves the record. + # This is especially useful for boolean flags on existing records. Also note that + # + # * Validation is skipped. + # * \Callbacks are invoked. + # * updated_at/updated_on column is updated if that column is available. + # * Updates all the attributes that are dirty in this object. + # + # This method raises an ActiveRecord::ActiveRecordError if the + # attribute is marked as readonly. + # + # Also see #update_column. + # + # source://activerecord//lib/active_record/persistence.rb#531 + def update_attribute(name, value); end + + # Updates a single attribute and saves the record. + # This is especially useful for boolean flags on existing records. Also note that + # + # * Validation is skipped. + # * \Callbacks are invoked. + # * updated_at/updated_on column is updated if that column is available. + # * Updates all the attributes that are dirty in this object. + # + # This method raises an ActiveRecord::ActiveRecordError if the + # attribute is marked as readonly. + # + # If any of the before_* callbacks throws +:abort+ the action is cancelled + # and #update_attribute! raises ActiveRecord::RecordNotSaved. See + # ActiveRecord::Callbacks for further details. + # + # source://activerecord//lib/active_record/persistence.rb#553 + def update_attribute!(name, value); end + + # Equivalent to update_columns(name => value). + # + # source://activerecord//lib/active_record/persistence.rb#585 + def update_column(name, value, touch: T.unsafe(nil)); end + + # Updates the attributes directly in the database issuing an UPDATE SQL + # statement and sets them in the receiver: + # + # user.update_columns(last_request_at: Time.current) + # + # This is the fastest way to update attributes because it goes straight to + # the database, but take into account that in consequence the regular update + # procedures are totally bypassed. In particular: + # + # * \Validations are skipped. + # * \Callbacks are skipped. + # * +updated_at+/+updated_on+ are updated if the +touch+ option is set to +true+. + # * However, attributes are serialized with the same rules as ActiveRecord::Relation#update_all + # + # This method raises an ActiveRecord::ActiveRecordError when called on new + # objects, or when at least one of the attributes is marked as readonly. + # + # ==== Parameters + # + # * :touch option - Touch the timestamp columns when updating. + # * If attribute names are passed, they are updated along with +updated_at+/+updated_on+ attributes. + # + # ==== Examples + # + # # Update a single attribute. + # user.update_columns(last_request_at: Time.current) + # + # # Update with touch option. + # user.update_columns(last_request_at: Time.current, touch: true) + # + # @raise [ActiveRecordError] + # + # source://activerecord//lib/active_record/persistence.rb#619 + def update_columns(attributes); end + + private + + # Creates a record with values matching those of the instance attributes + # and returns its id. + # + # @yield [_self] + # @yieldparam _self [ActiveRecord::Persistence] the object that the method was called on + # + # source://activerecord//lib/active_record/persistence.rb#951 + def _create_record(attribute_names = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/persistence.rb#901 + def _delete_row; end + + # source://activerecord//lib/active_record/persistence.rb#857 + def _find_record(options); end + + # source://activerecord//lib/active_record/persistence.rb#868 + def _in_memory_query_constraints_hash; end + + # source://activerecord//lib/active_record/persistence.rb#883 + def _query_constraints_hash; end + + # @raise [ReadOnlyRecord] + # + # source://activerecord//lib/active_record/persistence.rb#988 + def _raise_readonly_record_error; end + + # source://activerecord//lib/active_record/persistence.rb#980 + def _raise_record_not_destroyed; end + + # @raise [ActiveRecordError] + # + # source://activerecord//lib/active_record/persistence.rb#992 + def _raise_record_not_touched_error; end + + # source://activerecord//lib/active_record/persistence.rb#905 + def _touch_row(attribute_names, time); end + + # Updates the associated record with values matching those of the instance attributes. + # Returns the number of affected rows. + # + # @yield [_self] + # @yieldparam _self [ActiveRecord::Persistence] the object that the method was called on + # + # source://activerecord//lib/active_record/persistence.rb#931 + def _update_record(attribute_names = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/persistence.rb#915 + def _update_row(attribute_names, attempted_action = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/persistence.rb#878 + def apply_scoping?(options); end + + # source://activerecord//lib/active_record/persistence.rb#922 + def create_or_update(**_arg0, &block); end + + # A hook to be overridden by association modules. + # + # source://activerecord//lib/active_record/persistence.rb#894 + def destroy_associations; end + + # source://activerecord//lib/active_record/persistence.rb#897 + def destroy_row; end + + # source://activerecord//lib/active_record/persistence.rb#845 + def init_internals; end + + # source://activerecord//lib/active_record/persistence.rb#851 + def strict_loaded_associations; end + + # @raise [ActiveRecordError] + # + # source://activerecord//lib/active_record/persistence.rb#976 + def verify_readonly_attribute(name); end +end + +# source://activerecord//lib/active_record/persistence.rb#10 +module ActiveRecord::Persistence::ClassMethods + # source://activerecord//lib/active_record/persistence.rb#282 + def _delete_record(constraints); end + + # source://activerecord//lib/active_record/persistence.rb#238 + def _insert_record(connection, values, returning); end + + # source://activerecord//lib/active_record/persistence.rb#263 + def _update_record(values, constraints); end + + # Builds an object (or multiple objects) and returns either the built object or a list of built + # objects. + # + # The +attributes+ parameter can be either a Hash or an Array of Hashes. These Hashes describe the + # attributes on the objects that are to be built. + # + # ==== Examples + # # Build a single new object + # User.build(first_name: 'Jamie') + # + # # Build an Array of new objects + # User.build([{ first_name: 'Jamie' }, { first_name: 'Jeremy' }]) + # + # # Build a single object and pass it into a block to set other attributes. + # User.build(first_name: 'Jamie') do |u| + # u.is_admin = false + # end + # + # # Building an Array of new objects using a block, where the block is executed for each object: + # User.build([{ first_name: 'Jamie' }, { first_name: 'Jeremy' }]) do |u| + # u.is_admin = false + # end + # + # source://activerecord//lib/active_record/persistence.rb#82 + def build(attributes = T.unsafe(nil), &block); end + + # Returns an array of column names to be used in queries. The source of column + # names is derived from +query_constraints_list+ or +primary_key+. This method + # is for internal use when the primary key is to be treated as an array. + # + # source://activerecord//lib/active_record/persistence.rb#234 + def composite_query_constraints_list; end + + # Creates an object (or multiple objects) and saves it to the database, if validations pass. + # The resulting object is returned whether the object was saved successfully to the database or not. + # + # The +attributes+ parameter can be either a Hash or an Array of Hashes. These Hashes describe the + # attributes on the objects that are to be created. + # + # ==== Examples + # # Create a single new object + # User.create(first_name: 'Jamie') + # + # # Create an Array of new objects + # User.create([{ first_name: 'Jamie' }, { first_name: 'Jeremy' }]) + # + # # Create a single object and pass it into a block to set other attributes. + # User.create(first_name: 'Jamie') do |u| + # u.is_admin = false + # end + # + # # Creating an Array of new objects using a block, where the block is executed for each object: + # User.create([{ first_name: 'Jamie' }, { first_name: 'Jeremy' }]) do |u| + # u.is_admin = false + # end + # + # source://activerecord//lib/active_record/persistence.rb#33 + def create(attributes = T.unsafe(nil), &block); end + + # Creates an object (or multiple objects) and saves it to the database, + # if validations pass. Raises a RecordInvalid error if validations fail, + # unlike Base#create. + # + # The +attributes+ parameter can be either a Hash or an Array of Hashes. + # These describe which attributes to be created on the object, or + # multiple objects when given an Array of Hashes. + # + # source://activerecord//lib/active_record/persistence.rb#50 + def create!(attributes = T.unsafe(nil), &block); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/persistence.rb#219 + def has_query_constraints?; end + + # Given an attributes hash, +instantiate+ returns a new instance of + # the appropriate class. Accepts only keys as strings. + # + # For example, +Post.all+ may return Comments, Messages, and Emails + # by storing the record's subclass in a +type+ attribute. By calling + # +instantiate+ instead of +new+, finder methods ensure they get new + # instances of the appropriate class for each record. + # + # See ActiveRecord::Inheritance#discriminate_class_for_record to see + # how this "single-table" inheritance mapping is implemented. + # + # source://activerecord//lib/active_record/persistence.rb#100 + def instantiate(attributes, column_types = T.unsafe(nil), &block); end + + # Accepts a list of attribute names to be used in the WHERE clause + # of SELECT / UPDATE / DELETE queries and in the ORDER BY clause for +#first+ and +#last+ finder methods. + # + # class Developer < ActiveRecord::Base + # query_constraints :company_id, :id + # end + # + # developer = Developer.first + # # SELECT "developers".* FROM "developers" ORDER BY "developers"."company_id" ASC, "developers"."id" ASC LIMIT 1 + # developer.inspect # => # + # + # developer.update!(name: "Nikita") + # # UPDATE "developers" SET "name" = 'Nikita' WHERE "developers"."company_id" = 1 AND "developers"."id" = 1 + # + # # It is possible to update an attribute used in the query_constraints clause: + # developer.update!(company_id: 2) + # # UPDATE "developers" SET "company_id" = 2 WHERE "developers"."company_id" = 1 AND "developers"."id" = 1 + # + # developer.name = "Bob" + # developer.save! + # # UPDATE "developers" SET "name" = 'Bob' WHERE "developers"."company_id" = 1 AND "developers"."id" = 1 + # + # developer.destroy! + # # DELETE FROM "developers" WHERE "developers"."company_id" = 1 AND "developers"."id" = 1 + # + # developer.delete + # # DELETE FROM "developers" WHERE "developers"."company_id" = 1 AND "developers"."id" = 1 + # + # developer.reload + # # SELECT "developers".* FROM "developers" WHERE "developers"."company_id" = 1 AND "developers"."id" = 1 LIMIT 1 + # + # @raise [ArgumentError] + # + # source://activerecord//lib/active_record/persistence.rb#212 + def query_constraints(*columns_list); end + + # source://activerecord//lib/active_record/persistence.rb#223 + def query_constraints_list; end + + # Updates an object (or multiple objects) and saves it to the database, if validations pass. + # The resulting object is returned whether the object was saved successfully to the database or not. + # + # ==== Parameters + # + # * +id+ - This should be the id or an array of ids to be updated. + # Optional argument, defaults to all records in the relation. + # * +attributes+ - This should be a hash of attributes or an array of hashes. + # + # ==== Examples + # + # # Updates one record + # Person.update(15, user_name: "Samuel", group: "expert") + # + # # Updates multiple records + # people = { 1 => { "first_name" => "David" }, 2 => { "first_name" => "Jeremy" } } + # Person.update(people.keys, people.values) + # + # # Updates multiple records from the result of a relation + # people = Person.where(group: "expert") + # people.update(group: "masters") + # + # Note: Updating a large number of records will run an UPDATE + # query for each record, which may cause a performance issue. + # When running callbacks is not needed for each record update, + # it is preferred to use {update_all}[rdoc-ref:Relation#update_all] + # for updating all records in a single query. + # + # source://activerecord//lib/active_record/persistence.rb#132 + def update(id = T.unsafe(nil), attributes); end + + # Updates the object (or multiple objects) just like #update but calls #update! instead + # of +update+, so an exception is raised if the record is invalid and saving will fail. + # + # source://activerecord//lib/active_record/persistence.rb#158 + def update!(id = T.unsafe(nil), attributes); end + + private + + # Called by +_update_record+ and +_delete_record+ + # to build `where` clause from default scopes. + # Skips empty scopes. + # + # source://activerecord//lib/active_record/persistence.rb#328 + def build_default_constraint; end + + # Called by +instantiate+ to decide which class to use for a new + # record instance. + # + # See +ActiveRecord::Inheritance#discriminate_class_for_record+ for + # the single-table inheritance discriminator. + # + # source://activerecord//lib/active_record/persistence.rb#321 + def discriminate_class_for_record(record); end + + # source://activerecord//lib/active_record/persistence.rb#301 + def inherited(subclass); end + + # Given a class, an attributes hash, +instantiate_instance_of+ returns a + # new instance of the class. Accepts only keys as strings. + # + # source://activerecord//lib/active_record/persistence.rb#311 + def instantiate_instance_of(klass, attributes, column_types = T.unsafe(nil), &block); end +end + +# source://activerecord//lib/active_record/relation/predicate_builder.rb#4 +class ActiveRecord::PredicateBuilder + # @return [PredicateBuilder] a new instance of PredicateBuilder + # + # source://activerecord//lib/active_record/relation/predicate_builder.rb#12 + def initialize(table); end + + # source://activerecord//lib/active_record/relation/predicate_builder.rb#53 + def [](attr_name, value, operator = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation/predicate_builder.rb#57 + def build(attribute, value, operator = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation/predicate_builder.rb#67 + def build_bind_attribute(column_name, value); end + + # source://activerecord//lib/active_record/relation/predicate_builder.rb#23 + def build_from_hash(attributes, &block); end + + # Define how a class is converted to Arel nodes when passed to +where+. + # The handler can be any object that responds to +call+, and will be used + # for any value that === the class given. For example: + # + # MyCustomDateRange = Struct.new(:start, :end) + # handler = proc do |column, range| + # Arel::Nodes::Between.new(column, + # Arel::Nodes::And.new([range.start, range.end]) + # ) + # end + # ActiveRecord::PredicateBuilder.new("users").register_handler(MyCustomDateRange, handler) + # + # source://activerecord//lib/active_record/relation/predicate_builder.rb#49 + def register_handler(klass, handler); end + + # source://activerecord//lib/active_record/relation/predicate_builder.rb#71 + def resolve_arel_attribute(table_name, column_name, &block); end + + # source://activerecord//lib/active_record/relation/predicate_builder.rb#75 + def with(table); end + + protected + + # source://activerecord//lib/active_record/relation/predicate_builder.rb#84 + def expand_from_hash(attributes, &block); end + + # Sets the attribute table + # + # @param value the value to set the attribute table to. + # + # source://activerecord//lib/active_record/relation/predicate_builder.rb#82 + def table=(_arg0); end + + private + + # source://activerecord//lib/active_record/relation/predicate_builder.rb#165 + def convert_dot_notation_to_hash(attributes); end + + # source://activerecord//lib/active_record/relation/predicate_builder.rb#155 + def grouping_queries(queries); end + + # source://activerecord//lib/active_record/relation/predicate_builder.rb#187 + def handler_for(object); end + + # Returns the value of attribute table. + # + # source://activerecord//lib/active_record/relation/predicate_builder.rb#153 + def table; end + + class << self + # source://activerecord//lib/active_record/relation/predicate_builder.rb#28 + def references(attributes); end + end +end + +# source://activerecord//lib/active_record/relation/predicate_builder/array_handler.rb#7 +class ActiveRecord::PredicateBuilder::ArrayHandler + # @return [ArrayHandler] a new instance of ArrayHandler + # + # source://activerecord//lib/active_record/relation/predicate_builder/array_handler.rb#8 + def initialize(predicate_builder); end + + # source://activerecord//lib/active_record/relation/predicate_builder/array_handler.rb#12 + def call(attribute, value); end + + private + + # Returns the value of attribute predicate_builder. + # + # source://activerecord//lib/active_record/relation/predicate_builder/array_handler.rb#39 + def predicate_builder; end +end + +# source://activerecord//lib/active_record/relation/predicate_builder/array_handler.rb#41 +module ActiveRecord::PredicateBuilder::ArrayHandler::NullPredicate + class << self + # source://activerecord//lib/active_record/relation/predicate_builder/array_handler.rb#42 + def or(other); end + end +end + +# source://activerecord//lib/active_record/relation/predicate_builder/association_query_value.rb#5 +class ActiveRecord::PredicateBuilder::AssociationQueryValue + # @return [AssociationQueryValue] a new instance of AssociationQueryValue + # + # source://activerecord//lib/active_record/relation/predicate_builder/association_query_value.rb#6 + def initialize(reflection, value); end + + # source://activerecord//lib/active_record/relation/predicate_builder/association_query_value.rb#11 + def queries; end + + private + + # source://activerecord//lib/active_record/relation/predicate_builder/association_query_value.rb#59 + def convert_to_id(value); end + + # source://activerecord//lib/active_record/relation/predicate_builder/association_query_value.rb#25 + def ids; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation/predicate_builder/association_query_value.rb#55 + def polymorphic_clause?; end + + # source://activerecord//lib/active_record/relation/predicate_builder/association_query_value.rb#47 + def polymorphic_name; end + + # source://activerecord//lib/active_record/relation/predicate_builder/association_query_value.rb#39 + def primary_key; end + + # source://activerecord//lib/active_record/relation/predicate_builder/association_query_value.rb#43 + def primary_type; end + + # Returns the value of attribute reflection. + # + # source://activerecord//lib/active_record/relation/predicate_builder/association_query_value.rb#23 + def reflection; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation/predicate_builder/association_query_value.rb#51 + def select_clause?; end + + # Returns the value of attribute value. + # + # source://activerecord//lib/active_record/relation/predicate_builder/association_query_value.rb#23 + def value; end +end + +# source://activerecord//lib/active_record/relation/predicate_builder/basic_object_handler.rb#5 +class ActiveRecord::PredicateBuilder::BasicObjectHandler + # @return [BasicObjectHandler] a new instance of BasicObjectHandler + # + # source://activerecord//lib/active_record/relation/predicate_builder/basic_object_handler.rb#6 + def initialize(predicate_builder); end + + # source://activerecord//lib/active_record/relation/predicate_builder/basic_object_handler.rb#10 + def call(attribute, value); end + + private + + # Returns the value of attribute predicate_builder. + # + # source://activerecord//lib/active_record/relation/predicate_builder/basic_object_handler.rb#16 + def predicate_builder; end +end + +# source://activerecord//lib/active_record/relation/predicate_builder/polymorphic_array_value.rb#5 +class ActiveRecord::PredicateBuilder::PolymorphicArrayValue + # @return [PolymorphicArrayValue] a new instance of PolymorphicArrayValue + # + # source://activerecord//lib/active_record/relation/predicate_builder/polymorphic_array_value.rb#6 + def initialize(reflection, values); end + + # source://activerecord//lib/active_record/relation/predicate_builder/polymorphic_array_value.rb#11 + def queries; end + + private + + # source://activerecord//lib/active_record/relation/predicate_builder/polymorphic_array_value.rb#44 + def convert_to_id(value); end + + # source://activerecord//lib/active_record/relation/predicate_builder/polymorphic_array_value.rb#36 + def klass(value); end + + # source://activerecord//lib/active_record/relation/predicate_builder/polymorphic_array_value.rb#32 + def primary_key(value); end + + # Returns the value of attribute reflection. + # + # source://activerecord//lib/active_record/relation/predicate_builder/polymorphic_array_value.rb#23 + def reflection; end + + # source://activerecord//lib/active_record/relation/predicate_builder/polymorphic_array_value.rb#25 + def type_to_ids_mapping; end + + # Returns the value of attribute values. + # + # source://activerecord//lib/active_record/relation/predicate_builder/polymorphic_array_value.rb#23 + def values; end +end + +# source://activerecord//lib/active_record/relation/predicate_builder/range_handler.rb#5 +class ActiveRecord::PredicateBuilder::RangeHandler + # @return [RangeHandler] a new instance of RangeHandler + # + # source://activerecord//lib/active_record/relation/predicate_builder/range_handler.rb#8 + def initialize(predicate_builder); end + + # source://activerecord//lib/active_record/relation/predicate_builder/range_handler.rb#12 + def call(attribute, value); end + + private + + # Returns the value of attribute predicate_builder. + # + # source://activerecord//lib/active_record/relation/predicate_builder/range_handler.rb#19 + def predicate_builder; end +end + +# source://activerecord//lib/active_record/relation/predicate_builder/range_handler.rb#6 +class ActiveRecord::PredicateBuilder::RangeHandler::RangeWithBinds < ::Struct + # Returns the value of attribute begin + # + # @return [Object] the current value of begin + # + # source://activerecord//lib/active_record/relation/predicate_builder/range_handler.rb#6 + def begin; end + + # Sets the attribute begin + # + # @param value [Object] the value to set the attribute begin to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/relation/predicate_builder/range_handler.rb#6 + def begin=(_); end + + # Returns the value of attribute end + # + # @return [Object] the current value of end + # + # source://activerecord//lib/active_record/relation/predicate_builder/range_handler.rb#6 + def end; end + + # Sets the attribute end + # + # @param value [Object] the value to set the attribute end to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/relation/predicate_builder/range_handler.rb#6 + def end=(_); end + + # Returns the value of attribute exclude_end? + # + # @return [Object] the current value of exclude_end? + # + # source://activerecord//lib/active_record/relation/predicate_builder/range_handler.rb#6 + def exclude_end?; end + + class << self + # source://activerecord//lib/active_record/relation/predicate_builder/range_handler.rb#6 + def [](*_arg0); end + + # source://activerecord//lib/active_record/relation/predicate_builder/range_handler.rb#6 + def inspect; end + + # source://activerecord//lib/active_record/relation/predicate_builder/range_handler.rb#6 + def keyword_init?; end + + # source://activerecord//lib/active_record/relation/predicate_builder/range_handler.rb#6 + def members; end + + # source://activerecord//lib/active_record/relation/predicate_builder/range_handler.rb#6 + def new(*_arg0); end + end +end + +# source://activerecord//lib/active_record/relation/predicate_builder/relation_handler.rb#5 +class ActiveRecord::PredicateBuilder::RelationHandler + # source://activerecord//lib/active_record/relation/predicate_builder/relation_handler.rb#6 + def call(attribute, value); end +end + +# Raised when PostgreSQL returns 'cached plan must not change result type' and +# we cannot retry gracefully (e.g. inside a transaction) +# +# source://activerecord//lib/active_record/errors.rb#369 +class ActiveRecord::PreparedStatementCacheExpired < ::ActiveRecord::StatementInvalid; end + +# Raised when the number of placeholders in an SQL fragment passed to +# {ActiveRecord::Base.where}[rdoc-ref:QueryMethods#where] +# does not match the number of values supplied. +# +# For example, when there are two placeholders with only one value supplied: +# +# Location.where("lat = ? AND lng = ?", 53.7362) +# +# source://activerecord//lib/active_record/errors.rb#331 +class ActiveRecord::PreparedStatementInvalid < ::ActiveRecord::ActiveRecordError; end + +# source://activerecord//lib/active_record/promise.rb#4 +class ActiveRecord::Promise < ::BasicObject + # @return [Promise] a new instance of Promise + # + # source://activerecord//lib/active_record/promise.rb#7 + def initialize(future_result, block); end + + # source://activerecord//lib/active_record/promise.rb#41 + def class; end + + # source://activerecord//lib/active_record/promise.rb#44 + def inspect; end + + # source://activerecord//lib/active_record/promise.rb#41 + def is_a?(_arg0); end + + # Returns whether the associated query is still being executed or not. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/promise.rb#13 + def pending?; end + + # source://activerecord//lib/active_record/promise.rb#48 + def pretty_print(q); end + + # source://activerecord//lib/active_record/promise.rb#41 + def respond_to?(*_arg0); end + + # Returns a new +ActiveRecord::Promise+ that will apply the passed block + # when the value is accessed: + # + # Post.async_pick(:title).then { |title| title.upcase }.value + # # => "POST TITLE" + # + # source://activerecord//lib/active_record/promise.rb#36 + def then(&block); end + + # Returns the query result. + # If the query wasn't completed yet, accessing +#value+ will block until the query completes. + # If the query failed, +#value+ will raise the corresponding error. + # + # source://activerecord//lib/active_record/promise.rb#20 + def value; end + + private + + # source://activerecord//lib/active_record/promise.rb#53 + def status; end +end + +# source://activerecord//lib/active_record/promise.rb#63 +class ActiveRecord::Promise::Complete < ::ActiveRecord::Promise + # @return [Complete] a new instance of Complete + # + # source://activerecord//lib/active_record/promise.rb#66 + def initialize(value); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/promise.rb#74 + def pending?; end + + # source://activerecord//lib/active_record/promise.rb#70 + def then; end + + # Returns the value of attribute value. + # + # source://activerecord//lib/active_record/promise.rb#64 + def value; end + + private + + # source://activerecord//lib/active_record/promise.rb#79 + def status; end +end + +# source://activerecord//lib/active_record/migration.rb#206 +class ActiveRecord::ProtectedEnvironmentError < ::ActiveRecord::ActiveRecordError + # @return [ProtectedEnvironmentError] a new instance of ProtectedEnvironmentError + # + # source://activerecord//lib/active_record/migration.rb#207 + def initialize(env = T.unsafe(nil)); end +end + +# Superclass for errors that have been aborted (either by client or server). +# +# source://activerecord//lib/active_record/errors.rb#574 +class ActiveRecord::QueryAborted < ::ActiveRecord::StatementInvalid; end + +# = Active Record Query Cache +# +# source://activerecord//lib/active_record/query_cache.rb#5 +class ActiveRecord::QueryCache + class << self + # source://activerecord//lib/active_record/query_cache.rb#58 + def install_executor_hooks(executor = T.unsafe(nil)); end + end +end + +# ActiveRecord::Base extends this module, so these methods are available in models. +# +# source://activerecord//lib/active_record/query_cache.rb#7 +module ActiveRecord::QueryCache::ClassMethods + # Enable the query cache within the block if Active Record is configured. + # If it's not, it will execute the given block. + # + # source://activerecord//lib/active_record/query_cache.rb#10 + def cache(&block); end + + # Runs the block with the query cache disabled. + # + # If the query cache was enabled before the block was executed, it is + # enabled again after it. + # + # Set dirties: false to prevent query caches on all connections + # from being cleared by write operations. (By default, write operations + # dirty all connections' query caches in case they are replicas whose + # cache would now be outdated.) + # + # source://activerecord//lib/active_record/query_cache.rb#33 + def uncached(dirties: T.unsafe(nil), &block); end +end + +# source://activerecord//lib/active_record/query_cache.rb#42 +module ActiveRecord::QueryCache::ExecutorHooks + class << self + # source://activerecord//lib/active_record/query_cache.rb#50 + def complete(pools); end + + # source://activerecord//lib/active_record/query_cache.rb#43 + def run; end + end +end + +# QueryCanceled will be raised when canceling statement due to user request. +# +# source://activerecord//lib/active_record/errors.rb#586 +class ActiveRecord::QueryCanceled < ::ActiveRecord::QueryAborted; end + +# = Active Record Query Logs +# +# Automatically append comments to SQL queries with runtime information tags. This can be used to trace troublesome +# SQL statements back to the application code that generated these statements. +# +# Query logs can be enabled via \Rails configuration in config/application.rb or an initializer: +# +# config.active_record.query_log_tags_enabled = true +# +# By default the name of the application, the name and action of the controller, or the name of the job are logged. +# The default format is {SQLCommenter}[https://open-telemetry.github.io/opentelemetry-sqlcommenter/]. +# The tags shown in a query comment can be configured via \Rails configuration: +# +# config.active_record.query_log_tags = [ :application, :controller, :action, :job ] +# +# Active Record defines default tags available for use: +# +# * +application+ +# * +pid+ +# * +socket+ +# * +db_host+ +# * +database+ +# * +source_location+ +# +# WARNING: Calculating the +source_location+ of a query can be slow, so you should consider its impact if using it in a production environment. +# +# Also see {config.active_record.verbose_query_logs}[https://guides.rubyonrails.org/debugging_rails_applications.html#verbose-query-logs]. +# +# Action Controller adds default tags when loaded: +# +# * +controller+ +# * +action+ +# * +namespaced_controller+ +# +# Active Job adds default tags when loaded: +# +# * +job+ +# +# New comment tags can be defined by adding them in a +Hash+ to the tags +Array+. Tags can have dynamic content by +# setting a +Proc+ or lambda value in the +Hash+, and can reference any value stored by \Rails in the +context+ object. +# ActiveSupport::CurrentAttributes can be used to store application values. Tags with +nil+ values are +# omitted from the query comment. +# +# Escaping is performed on the string returned, however untrusted user input should not be used. +# +# Example: +# +# config.active_record.query_log_tags = [ +# :namespaced_controller, +# :action, +# :job, +# { +# request_id: ->(context) { context[:controller]&.request&.request_id }, +# job_id: ->(context) { context[:job]&.job_id }, +# tenant_id: -> { Current.tenant&.id }, +# static: "value", +# }, +# ] +# +# By default the name of the application, the name and action of the controller, or the name of the job are logged +# using the {SQLCommenter}[https://open-telemetry.github.io/opentelemetry-sqlcommenter/] format. This can be changed +# via {config.active_record.query_log_tags_format}[https://guides.rubyonrails.org/configuring.html#config-active-record-query-log-tags-format] +# +# Tag comments can be prepended to the query: +# +# config.active_record.query_log_tags_prepend_comment = true +# +# For applications where the content will not change during the lifetime of +# the request or job execution, the tags can be cached for reuse in every query: +# +# config.active_record.cache_query_log_tags = true +# +# source://activerecord//lib/active_record/query_logs_formatter.rb#4 +module ActiveRecord::QueryLogs + class << self + # source://activerecord//lib/active_record/query_logs.rb#119 + def cache_query_log_tags; end + + # source://activerecord//lib/active_record/query_logs.rb#119 + def cache_query_log_tags=(_arg0); end + + # source://activerecord//lib/active_record/query_logs.rb#115 + def cached_comment; end + + # source://activerecord//lib/active_record/query_logs.rb#115 + def cached_comment=(obj); end + + # source://activerecord//lib/active_record/query_logs.rb#143 + def call(sql, connection); end + + # source://activerecord//lib/active_record/query_logs.rb#155 + def clear_cache; end + + # source://activerecord//lib/active_record/query_logs.rb#119 + def prepend_comment; end + + # source://activerecord//lib/active_record/query_logs.rb#119 + def prepend_comment=(_arg0); end + + # source://activerecord//lib/active_record/query_logs.rb#159 + def query_source_location; end + + # source://activerecord//lib/active_record/query_logs.rb#118 + def taggings; end + + # source://activerecord//lib/active_record/query_logs.rb#121 + def taggings=(taggings); end + + # source://activerecord//lib/active_record/query_logs.rb#118 + def tags; end + + # source://activerecord//lib/active_record/query_logs.rb#126 + def tags=(tags); end + + # source://activerecord//lib/active_record/query_logs.rb#118 + def tags_formatter; end + + # source://activerecord//lib/active_record/query_logs.rb#131 + def tags_formatter=(format); end + + private + + # source://activerecord//lib/active_record/query_logs.rb#180 + def build_handler(name, handler = T.unsafe(nil)); end + + # Returns an SQL comment +String+ containing the query log tags. + # Sets and returns a cached comment if cache_query_log_tags is +true+. + # + # source://activerecord//lib/active_record/query_logs.rb#197 + def comment(connection); end + + # source://activerecord//lib/active_record/query_logs.rb#213 + def escape_sql_comment(content); end + + # source://activerecord//lib/active_record/query_logs.rb#166 + def rebuild_handlers; end + + # source://activerecord//lib/active_record/query_logs.rb#226 + def tag_content(connection); end + + # source://activerecord//lib/active_record/query_logs.rb#205 + def uncached_comment(connection); end + end +end + +# source://activerecord//lib/active_record/query_logs.rb#79 +class ActiveRecord::QueryLogs::GetKeyHandler + # @return [GetKeyHandler] a new instance of GetKeyHandler + # + # source://activerecord//lib/active_record/query_logs.rb#80 + def initialize(name); end + + # source://activerecord//lib/active_record/query_logs.rb#84 + def call(context); end +end + +# source://activerecord//lib/active_record/query_logs.rb#89 +class ActiveRecord::QueryLogs::IdentityHandler + # @return [IdentityHandler] a new instance of IdentityHandler + # + # source://activerecord//lib/active_record/query_logs.rb#90 + def initialize(value); end + + # source://activerecord//lib/active_record/query_logs.rb#94 + def call(_context); end +end + +# source://activerecord//lib/active_record/query_logs_formatter.rb#5 +module ActiveRecord::QueryLogs::LegacyFormatter + class << self + # Formats the key value pairs into a string. + # + # source://activerecord//lib/active_record/query_logs_formatter.rb#8 + def format(key, value); end + + # source://activerecord//lib/active_record/query_logs_formatter.rb#12 + def join(pairs); end + end +end + +# source://activerecord//lib/active_record/query_logs_formatter.rb#18 +class ActiveRecord::QueryLogs::SQLCommenter + class << self + # source://activerecord//lib/active_record/query_logs_formatter.rb#20 + def format(key, value); end + + # source://activerecord//lib/active_record/query_logs_formatter.rb#24 + def join(pairs); end + end +end + +# source://activerecord//lib/active_record/query_logs.rb#99 +class ActiveRecord::QueryLogs::ZeroArityHandler + # @return [ZeroArityHandler] a new instance of ZeroArityHandler + # + # source://activerecord//lib/active_record/query_logs.rb#100 + def initialize(proc); end + + # source://activerecord//lib/active_record/query_logs.rb#104 + def call(_context); end +end + +# source://activerecord//lib/active_record/relation/query_methods.rb#9 +module ActiveRecord::QueryMethods + include ::ActiveModel::ForbiddenAttributesProtection + + # source://activerecord//lib/active_record/relation/query_methods.rb#428 + def _select!(*fields); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#260 + def all; end + + # Returns a new relation, which is the logical intersection of this relation and the one passed + # as an argument. + # + # The two relations must be structurally compatible: they must be scoping the same model, and + # they must differ only by #where (if no #group has been defined) or #having (if a #group is + # present). + # + # Post.where(id: [1, 2]).and(Post.where(id: [2, 3])) + # # SELECT `posts`.* FROM `posts` WHERE `posts`.`id` IN (1, 2) AND `posts`.`id` IN (2, 3) + # + # source://activerecord//lib/active_record/relation/query_methods.rb#1135 + def and(other); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1143 + def and!(other); end + + # Adds an SQL comment to queries generated from this relation. For example: + # + # User.annotate("selecting user names").select(:name) + # # SELECT "users"."name" FROM "users" /* selecting user names */ + # + # User.annotate("selecting", "user", "names").select(:name) + # # SELECT "users"."name" FROM "users" /* selecting */ /* user */ /* names */ + # + # The SQL block comment delimiters, "/*" and "*/", will be added automatically. + # + # Some escaping is performed, however untrusted user input should not be used. + # + # source://activerecord//lib/active_record/relation/query_methods.rb#1530 + def annotate(*args); end + + # Like #annotate, but modifies relation in place. + # + # source://activerecord//lib/active_record/relation/query_methods.rb#1536 + def annotate!(*args); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def annotate_values; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def annotate_values=(value); end + + # Returns the Arel object associated with the relation. + # + # source://activerecord//lib/active_record/relation/query_methods.rb#1595 + def arel(aliases = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1599 + def construct_join_dependency(associations, join_type); end + + # Sets attributes to be used when creating new records from a + # relation object. + # + # users = User.where(name: 'Oscar') + # users.new.name # => 'Oscar' + # + # users = users.create_with(name: 'DHH') + # users.new.name # => 'DHH' + # + # You can pass +nil+ to #create_with to reset attributes: + # + # users = users.create_with(nil) + # users.new.name # => 'Oscar' + # + # source://activerecord//lib/active_record/relation/query_methods.rb#1347 + def create_with(value); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1351 + def create_with!(value); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def create_with_value; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def create_with_value=(value); end + + # Specifies whether the records should be unique or not. For example: + # + # User.select(:name) + # # Might return two records with the same name + # + # User.select(:name).distinct + # # Returns 1 record per distinct name + # + # User.select(:name).distinct.distinct(false) + # # You can also remove the uniqueness + # + # source://activerecord//lib/active_record/relation/query_methods.rb#1411 + def distinct(value = T.unsafe(nil)); end + + # Like #distinct, but modifies relation in place. + # + # source://activerecord//lib/active_record/relation/query_methods.rb#1416 + def distinct!(value = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def distinct_value; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def distinct_value=(value); end + + # Specify associations +args+ to be eager loaded using a LEFT OUTER JOIN. + # Performs a single query joining all specified associations. For example: + # + # users = User.eager_load(:address).limit(5) + # users.each do |user| + # user.address.city + # end + # + # # SELECT "users"."id" AS t0_r0, "users"."name" AS t0_r1, ... FROM "users" + # # LEFT OUTER JOIN "addresses" ON "addresses"."id" = "users"."address_id" + # # LIMIT 5 + # + # Instead of loading the 5 addresses with 5 separate queries, all addresses + # are loaded with a single joined query. + # + # Loading multiple and nested associations is possible using Hashes and Arrays, + # similar to #includes: + # + # User.eager_load(:address, friends: [:address, :followers]) + # # SELECT "users"."id" AS t0_r0, "users"."name" AS t0_r1, ... FROM "users" + # # LEFT OUTER JOIN "addresses" ON "addresses"."id" = "users"."address_id" + # # LEFT OUTER JOIN "friends" ON "friends"."user_id" = "users"."id" + # # ... + # + # NOTE: Loading the associations in a join can result in many rows that + # contain redundant data and it performs poorly at scale. + # + # source://activerecord//lib/active_record/relation/query_methods.rb#290 + def eager_load(*args); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#295 + def eager_load!(*args); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def eager_load_values; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def eager_load_values=(value); end + + # Excludes the specified record (or collection of records) from the resulting + # relation. For example: + # + # Post.excluding(post) + # # SELECT "posts".* FROM "posts" WHERE "posts"."id" != 1 + # + # Post.excluding(post_one, post_two) + # # SELECT "posts".* FROM "posts" WHERE "posts"."id" NOT IN (1, 2) + # + # Post.excluding(Post.drafts) + # # SELECT "posts".* FROM "posts" WHERE "posts"."id" NOT IN (3, 4, 5) + # + # This can also be called on associations. As with the above example, either + # a single record of collection thereof may be specified: + # + # post = Post.find(1) + # comment = Comment.find(2) + # post.comments.excluding(comment) + # # SELECT "comments".* FROM "comments" WHERE "comments"."post_id" = 1 AND "comments"."id" != 2 + # + # This is short-hand for .where.not(id: post.id) and .where.not(id: [post_one.id, post_two.id]). + # + # An ArgumentError will be raised if either no records are + # specified, or if any of the records in the collection (if a collection + # is passed in) are not instances of the same model that the relation is + # scoping. + # + # source://activerecord//lib/active_record/relation/query_methods.rb#1575 + def excluding(*records); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1588 + def excluding!(records); end + + # Used to extend a scope with additional methods, either through + # a module or through a block provided. + # + # The object returned is a relation, which can be further extended. + # + # === Using a \Module + # + # module Pagination + # def page(number) + # # pagination code goes here + # end + # end + # + # scope = Model.all.extending(Pagination) + # scope.page(params[:page]) + # + # You can also pass a list of modules: + # + # scope = Model.all.extending(Pagination, SomethingElse) + # + # === Using a Block + # + # scope = Model.all.extending do + # def page(number) + # # pagination code goes here + # end + # end + # scope.page(params[:page]) + # + # You can also use a block and a module list: + # + # scope = Model.all.extending(Pagination) do + # def per_page(number) + # # pagination code goes here + # end + # end + # + # source://activerecord//lib/active_record/relation/query_methods.rb#1457 + def extending(*modules, &block); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1465 + def extending!(*modules, &block); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def extending_values; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def extending_values=(value); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#185 + def extensions; end + + # Extracts a named +association+ from the relation. The named association is first preloaded, + # then the individual association records are collected from the relation. Like so: + # + # account.memberships.extract_associated(:user) + # # => Returns collection of User records + # + # This is short-hand for: + # + # account.memberships.preload(:user).collect(&:user) + # + # source://activerecord//lib/active_record/relation/query_methods.rb#341 + def extract_associated(association); end + + # Specifies the table from which the records will be fetched. For example: + # + # Topic.select('title').from('posts') + # # SELECT title FROM posts + # + # Can accept other relation objects. For example: + # + # Topic.select('title').from(Topic.approved) + # # SELECT title FROM (SELECT * FROM topics WHERE approved = 't') subquery + # + # Passing a second argument (string or symbol), creates the alias for the SQL from clause. Otherwise the alias "subquery" is used: + # + # Topic.select('a.title').from(Topic.approved, :a) + # # SELECT a.title FROM (SELECT * FROM topics WHERE approved = 't') a + # + # It does not add multiple arguments to the SQL from clause. The last +from+ chained is the one used: + # + # Topic.select('title').from(Topic.approved).from(Topic.inactive) + # # SELECT title FROM (SELECT topics.* FROM topics WHERE topics.active = 'f') subquery + # + # For multiple arguments for the SQL from clause, you can pass a string with the exact elements in the SQL from list: + # + # color = "red" + # Color + # .from("colors c, JSONB_ARRAY_ELEMENTS(colored_things) AS colorvalues(colorvalue)") + # .where("colorvalue->>'color' = ?", color) + # .select("c.*").to_a + # # SELECT c.* + # # FROM colors c, JSONB_ARRAY_ELEMENTS(colored_things) AS colorvalues(colorvalue) + # # WHERE (colorvalue->>'color' = 'red') + # + # source://activerecord//lib/active_record/relation/query_methods.rb#1392 + def from(value, subquery_name = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1396 + def from!(value, subquery_name = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def from_clause; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def from_clause=(value); end + + # Allows to specify a group attribute: + # + # User.group(:name) + # # SELECT "users".* FROM "users" GROUP BY name + # + # Returns an array with distinct records based on the +group+ attribute: + # + # User.select([:id, :name]) + # # => [#, #, #] + # + # User.group(:name) + # # => [#, #] + # + # User.group('name AS grouped_name, age') + # # => [#, #, #] + # + # Passing in an array of attributes to group by is also supported. + # + # User.select([:id, :first_name]).group(:id, :first_name).first(3) + # # => [#, #, #] + # + # source://activerecord//lib/active_record/relation/query_methods.rb#573 + def group(*args); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#578 + def group!(*args); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def group_values; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def group_values=(value); end + + # Allows to specify a HAVING clause. Note that you can't use HAVING + # without also specifying a GROUP clause. + # + # Order.having('SUM(price) > 30').group('user_id') + # + # source://activerecord//lib/active_record/relation/query_methods.rb#1197 + def having(opts, *rest); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1201 + def having!(opts, *rest); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def having_clause; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def having_clause=(value); end + + # Applies an ORDER BY clause based on a given +column+, + # ordered and filtered by a specific set of +values+. + # + # User.in_order_of(:id, [1, 5, 3]) + # # SELECT "users".* FROM "users" + # # WHERE "users"."id" IN (1, 5, 3) + # # ORDER BY CASE + # # WHEN "users"."id" = 1 THEN 1 + # # WHEN "users"."id" = 5 THEN 2 + # # WHEN "users"."id" = 3 THEN 3 + # # END ASC + # + # +column+ can point to an enum column; the actual query generated may be different depending + # on the database adapter and the column definition. + # + # class Conversation < ActiveRecord::Base + # enum :status, [ :active, :archived ] + # end + # + # Conversation.in_order_of(:status, [:archived, :active]) + # # SELECT "conversations".* FROM "conversations" + # # WHERE "conversations"."status" IN (1, 0) + # # ORDER BY CASE + # # WHEN "conversations"."status" = 1 THEN 1 + # # WHEN "conversations"."status" = 0 THEN 2 + # # END ASC + # + # +values+ can also include +nil+. + # + # Conversation.in_order_of(:status, [nil, :archived, :active]) + # # SELECT "conversations".* FROM "conversations" + # # WHERE ("conversations"."status" IN (1, 0) OR "conversations"."status" IS NULL) + # # ORDER BY CASE + # # WHEN "conversations"."status" IS NULL THEN 1 + # # WHEN "conversations"."status" = 1 THEN 2 + # # WHEN "conversations"."status" = 0 THEN 3 + # # END ASC + # + # +filter+ can be set to +false+ to include all results instead of only the ones specified in +values+. + # + # Conversation.in_order_of(:status, [:archived, :active], filter: false) + # # SELECT "conversations".* FROM "conversations" + # # ORDER BY CASE + # # WHEN "conversations"."status" = 1 THEN 1 + # # WHEN "conversations"."status" = 0 THEN 2 + # # ELSE 3 + # # END ASC + # + # source://activerecord//lib/active_record/relation/query_methods.rb#717 + def in_order_of(column, values, filter: T.unsafe(nil)); end + + # Specify associations +args+ to be eager loaded to prevent N + 1 queries. + # A separate query is performed for each association, unless a join is + # required by conditions. + # + # For example: + # + # users = User.includes(:address).limit(5) + # users.each do |user| + # user.address.city + # end + # + # # SELECT "users".* FROM "users" LIMIT 5 + # # SELECT "addresses".* FROM "addresses" WHERE "addresses"."id" IN (1,2,3,4,5) + # + # Instead of loading the 5 addresses with 5 separate queries, all addresses + # are loaded with a single query. + # + # Loading the associations in a separate query will often result in a + # performance improvement over a simple join, as a join can result in many + # rows that contain redundant data and it performs poorly at scale. + # + # You can also specify multiple associations. Each association will result + # in an additional query: + # + # User.includes(:address, :friends).to_a + # # SELECT "users".* FROM "users" + # # SELECT "addresses".* FROM "addresses" WHERE "addresses"."id" IN (1,2,3,4,5) + # # SELECT "friends".* FROM "friends" WHERE "friends"."user_id" IN (1,2,3,4,5) + # + # Loading nested associations is possible using a Hash: + # + # User.includes(:address, friends: [:address, :followers]) + # + # === Conditions + # + # If you want to add string conditions to your included models, you'll have + # to explicitly reference them. For example: + # + # User.includes(:posts).where('posts.name = ?', 'example').to_a + # + # Will throw an error, but this will work: + # + # User.includes(:posts).where('posts.name = ?', 'example').references(:posts).to_a + # # SELECT "users"."id" AS t0_r0, ... FROM "users" + # # LEFT OUTER JOIN "posts" ON "posts"."user_id" = "users"."id" + # # WHERE "posts"."name" = ? [["name", "example"]] + # + # As the LEFT OUTER JOIN already contains the posts, the second query for + # the posts is no longer performed. + # + # Note that #includes works with association names while #references needs + # the actual table name. + # + # If you pass the conditions via a Hash, you don't need to call #references + # explicitly, as #where references the tables for you. For example, this + # will work correctly: + # + # User.includes(:posts).where(posts: { name: 'example' }) + # + # NOTE: Conditions affect both sides of an association. For example, the + # above code will return only users that have a post named "example", + # and will only include posts named "example", even when a + # matching user has other additional posts. + # + # source://activerecord//lib/active_record/relation/query_methods.rb#250 + def includes(*args); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#255 + def includes!(*args); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def includes_values; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def includes_values=(value); end + + # Allows you to invert an entire where clause instead of manually applying conditions. + # + # class User + # scope :active, -> { where(accepted: true, locked: false) } + # end + # + # User.where(accepted: true) + # # WHERE `accepted` = 1 + # + # User.where(accepted: true).invert_where + # # WHERE `accepted` != 1 + # + # User.active + # # WHERE `accepted` = 1 AND `locked` = 0 + # + # User.active.invert_where + # # WHERE NOT (`accepted` = 1 AND `locked` = 0) + # + # Be careful because this inverts all conditions before +invert_where+ call. + # + # class User + # scope :active, -> { where(accepted: true, locked: false) } + # scope :inactive, -> { active.invert_where } # Do not attempt it + # end + # + # # It also inverts `where(role: 'admin')` unexpectedly. + # User.where(role: 'admin').inactive + # # WHERE NOT (`role` = 'admin' AND `accepted` = 1 AND `locked` = 0) + # + # source://activerecord//lib/active_record/relation/query_methods.rb#1101 + def invert_where; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1105 + def invert_where!; end + + # Performs JOINs on +args+. The given symbol(s) should match the name of + # the association(s). + # + # User.joins(:posts) + # # SELECT "users".* + # # FROM "users" + # # INNER JOIN "posts" ON "posts"."user_id" = "users"."id" + # + # Multiple joins: + # + # User.joins(:posts, :account) + # # SELECT "users".* + # # FROM "users" + # # INNER JOIN "posts" ON "posts"."user_id" = "users"."id" + # # INNER JOIN "accounts" ON "accounts"."id" = "users"."account_id" + # + # Nested joins: + # + # User.joins(posts: [:comments]) + # # SELECT "users".* + # # FROM "users" + # # INNER JOIN "posts" ON "posts"."user_id" = "users"."id" + # # INNER JOIN "comments" ON "comments"."post_id" = "posts"."id" + # + # You can use strings in order to customize your joins: + # + # User.joins("LEFT JOIN bookmarks ON bookmarks.bookmarkable_type = 'Post' AND bookmarks.user_id = users.id") + # # SELECT "users".* FROM "users" LEFT JOIN bookmarks ON bookmarks.bookmarkable_type = 'Post' AND bookmarks.user_id = users.id + # + # source://activerecord//lib/active_record/relation/query_methods.rb#868 + def joins(*args); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#873 + def joins!(*args); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def joins_values; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def joins_values=(value); end + + # Performs LEFT OUTER JOINs on +args+: + # + # User.left_outer_joins(:posts) + # # SELECT "users".* FROM "users" LEFT OUTER JOIN "posts" ON "posts"."user_id" = "users"."id" + # + # source://activerecord//lib/active_record/relation/query_methods.rb#887 + def left_joins(*args); end + + # Performs LEFT OUTER JOINs on +args+: + # + # User.left_outer_joins(:posts) + # # SELECT "users".* FROM "users" LEFT OUTER JOIN "posts" ON "posts"."user_id" = "users"."id" + # + # source://activerecord//lib/active_record/relation/query_methods.rb#883 + def left_outer_joins(*args); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#889 + def left_outer_joins!(*args); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def left_outer_joins_values; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def left_outer_joins_values=(value); end + + # Specifies a limit for the number of records to retrieve. + # + # User.limit(10) # generated SQL has 'LIMIT 10' + # + # User.limit(10).limit(20) # generated SQL has 'LIMIT 20' + # + # source://activerecord//lib/active_record/relation/query_methods.rb#1211 + def limit(value); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1215 + def limit!(value); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def limit_value; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def limit_value=(value); end + + # Specifies locking settings (default to +true+). For more information + # on locking, please see ActiveRecord::Locking. + # + # source://activerecord//lib/active_record/relation/query_methods.rb#1239 + def lock(locks = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1243 + def lock!(locks = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def lock_value; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def lock_value=(value); end + + # Returns a chainable relation with zero records. + # + # The returned relation implements the Null Object pattern. It is an + # object with defined null behavior and always returns an empty array of + # records without querying the database. + # + # Any subsequent condition chained to the returned relation will continue + # generating an empty relation and will not fire any query to the database. + # + # Used in cases where a method or scope could return zero records but the + # result needs to be chainable. + # + # For example: + # + # @posts = current_user.visible_posts.where(name: params[:name]) + # # the visible_posts method is expected to return a chainable Relation + # + # def visible_posts + # case role + # when 'Country Manager' + # Post.where(country: country) + # when 'Reviewer' + # Post.published + # when 'Bad User' + # Post.none # It can't be chained if [] is returned. + # end + # end + # + # source://activerecord//lib/active_record/relation/query_methods.rb#1282 + def none; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1286 + def none!; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation/query_methods.rb#1294 + def null_relation?; end + + # Specifies the number of rows to skip before returning rows. + # + # User.offset(10) # generated SQL has "OFFSET 10" + # + # Should be used with order. + # + # User.offset(10).order("name ASC") + # + # source://activerecord//lib/active_record/relation/query_methods.rb#1228 + def offset(value); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1232 + def offset!(value); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def offset_value; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def offset_value=(value); end + + # Specify optimizer hints to be used in the SELECT statement. + # + # Example (for MySQL): + # + # Topic.optimizer_hints("MAX_EXECUTION_TIME(50000)", "NO_INDEX_MERGE(topics)") + # # SELECT /*+ MAX_EXECUTION_TIME(50000) NO_INDEX_MERGE(topics) */ `topics`.* FROM `topics` + # + # Example (for PostgreSQL with pg_hint_plan): + # + # Topic.optimizer_hints("SeqScan(topics)", "Parallel(topics 8)") + # # SELECT /*+ SeqScan(topics) Parallel(topics 8) */ "topics".* FROM "topics" + # + # source://activerecord//lib/active_record/relation/query_methods.rb#1486 + def optimizer_hints(*args); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1491 + def optimizer_hints!(*args); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def optimizer_hints_values; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def optimizer_hints_values=(value); end + + # Returns a new relation, which is the logical union of this relation and the one passed as an + # argument. + # + # The two relations must be structurally compatible: they must be scoping the same model, and + # they must differ only by #where (if no #group has been defined) or #having (if a #group is + # present). + # + # Post.where("id = 1").or(Post.where("author_id = 3")) + # # SELECT `posts`.* FROM `posts` WHERE ((id = 1) OR (author_id = 3)) + # + # source://activerecord//lib/active_record/relation/query_methods.rb#1167 + def or(other); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1179 + def or!(other); end + + # Applies an ORDER BY clause to a query. + # + # #order accepts arguments in one of several formats. + # + # === symbols + # + # The symbol represents the name of the column you want to order the results by. + # + # User.order(:name) + # # SELECT "users".* FROM "users" ORDER BY "users"."name" ASC + # + # By default, the order is ascending. If you want descending order, you can + # map the column name symbol to +:desc+. + # + # User.order(email: :desc) + # # SELECT "users".* FROM "users" ORDER BY "users"."email" DESC + # + # Multiple columns can be passed this way, and they will be applied in the order specified. + # + # User.order(:name, email: :desc) + # # SELECT "users".* FROM "users" ORDER BY "users"."name" ASC, "users"."email" DESC + # + # === strings + # + # Strings are passed directly to the database, allowing you to specify + # simple SQL expressions. + # + # This could be a source of SQL injection, so only strings composed of plain + # column names and simple function(column_name) expressions + # with optional +ASC+/+DESC+ modifiers are allowed. + # + # User.order('name') + # # SELECT "users".* FROM "users" ORDER BY name + # + # User.order('name DESC') + # # SELECT "users".* FROM "users" ORDER BY name DESC + # + # User.order('name DESC, email') + # # SELECT "users".* FROM "users" ORDER BY name DESC, email + # + # === Arel + # + # If you need to pass in complicated expressions that you have verified + # are safe for the database, you can use Arel. + # + # User.order(Arel.sql('end_date - start_date')) + # # SELECT "users".* FROM "users" ORDER BY end_date - start_date + # + # Custom query syntax, like JSON columns for PostgreSQL, is supported in this way. + # + # User.order(Arel.sql("payload->>'kind'")) + # # SELECT "users".* FROM "users" ORDER BY payload->>'kind' + # + # source://activerecord//lib/active_record/relation/query_methods.rb#656 + def order(*args); end + + # Same as #order but operates on relation in-place instead of copying. + # + # source://activerecord//lib/active_record/relation/query_methods.rb#664 + def order!(*args); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def order_values; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def order_values=(value); end + + # Specify associations +args+ to be eager loaded using separate queries. + # A separate query is performed for each association. + # + # users = User.preload(:address).limit(5) + # users.each do |user| + # user.address.city + # end + # + # # SELECT "users".* FROM "users" LIMIT 5 + # # SELECT "addresses".* FROM "addresses" WHERE "addresses"."id" IN (1,2,3,4,5) + # + # Instead of loading the 5 addresses with 5 separate queries, all addresses + # are loaded with a separate query. + # + # Loading multiple and nested associations is possible using Hashes and Arrays, + # similar to #includes: + # + # User.preload(:address, friends: [:address, :followers]) + # # SELECT "users".* FROM "users" + # # SELECT "addresses".* FROM "addresses" WHERE "addresses"."id" IN (1,2,3,4,5) + # # SELECT "friends".* FROM "friends" WHERE "friends"."user_id" IN (1,2,3,4,5) + # # SELECT ... + # + # source://activerecord//lib/active_record/relation/query_methods.rb#322 + def preload(*args); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#327 + def preload!(*args); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def preload_values; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def preload_values=(value); end + + # Mark a relation as readonly. Attempting to update a record will result in + # an error. + # + # users = User.readonly + # users.first.save + # # => ActiveRecord::ReadOnlyRecord: User is marked as readonly + # + # To make a readonly relation writable, pass +false+. + # + # users.readonly(false) + # users.first.save + # # => true + # + # source://activerecord//lib/active_record/relation/query_methods.rb#1310 + def readonly(value = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1314 + def readonly!(value = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def readonly_value; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def readonly_value=(value); end + + # Use to indicate that the given +table_names+ are referenced by an SQL string, + # and should therefore be +JOIN+ed in any query rather than loaded separately. + # This method only works in conjunction with #includes. + # See #includes for more details. + # + # User.includes(:posts).where("posts.name = 'foo'") + # # Doesn't JOIN the posts table, resulting in an error. + # + # User.includes(:posts).where("posts.name = 'foo'").references(:posts) + # # Query now knows the string references posts, so adds a JOIN + # + # source://activerecord//lib/active_record/relation/query_methods.rb#355 + def references(*table_names); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#360 + def references!(*table_names); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def references_values; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def references_values=(value); end + + # Allows you to change a previously set group statement. + # + # Post.group(:title, :body) + # # SELECT `posts`.`*` FROM `posts` GROUP BY `posts`.`title`, `posts`.`body` + # + # Post.group(:title, :body).regroup(:title) + # # SELECT `posts`.`*` FROM `posts` GROUP BY `posts`.`title` + # + # This is short-hand for unscope(:group).group(fields). + # Note that we're unscoping the entire group statement. + # + # source://activerecord//lib/active_record/relation/query_methods.rb#593 + def regroup(*args); end + + # Same as #regroup but operates on relation in-place instead of copying. + # + # source://activerecord//lib/active_record/relation/query_methods.rb#599 + def regroup!(*args); end + + # Replaces any existing order defined on the relation with the specified order. + # + # User.order('email DESC').reorder('id ASC') # generated SQL has 'ORDER BY id ASC' + # + # Subsequent calls to order on the same relation will be appended. For example: + # + # User.order('email DESC').reorder('id ASC').order('name ASC') + # + # generates a query with ORDER BY id ASC, name ASC. + # + # source://activerecord//lib/active_record/relation/query_methods.rb#752 + def reorder(*args); end + + # Same as #reorder but operates on relation in-place instead of copying. + # + # source://activerecord//lib/active_record/relation/query_methods.rb#760 + def reorder!(*args); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def reordering_value; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def reordering_value=(value); end + + # Allows you to change a previously set select statement. + # + # Post.select(:title, :body) + # # SELECT `posts`.`title`, `posts`.`body` FROM `posts` + # + # Post.select(:title, :body).reselect(:created_at) + # # SELECT `posts`.`created_at` FROM `posts` + # + # This is short-hand for unscope(:select).select(fields). + # Note that we're unscoping the entire select statement. + # + # source://activerecord//lib/active_record/relation/query_methods.rb#541 + def reselect(*args); end + + # Same as #reselect but operates on relation in-place instead of copying. + # + # source://activerecord//lib/active_record/relation/query_methods.rb#548 + def reselect!(*args); end + + # Reverse the existing order clause on the relation. + # + # User.order('name ASC').reverse_order # generated SQL has 'ORDER BY name DESC' + # + # source://activerecord//lib/active_record/relation/query_methods.rb#1499 + def reverse_order; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1503 + def reverse_order!; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def reverse_order_value; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def reverse_order_value=(value); end + + # Allows you to change a previously set where condition for a given attribute, instead of appending to that condition. + # + # Post.where(trashed: true).where(trashed: false) + # # WHERE `trashed` = 1 AND `trashed` = 0 + # + # Post.where(trashed: true).rewhere(trashed: false) + # # WHERE `trashed` = 0 + # + # Post.where(active: true).where(trashed: true).rewhere(trashed: false) + # # WHERE `active` = 1 AND `trashed` = 0 + # + # This is short-hand for unscope(where: conditions.keys).where(conditions). + # Note that unlike reorder, we're only unscoping the named conditions -- not the entire where statement. + # + # source://activerecord//lib/active_record/relation/query_methods.rb#1061 + def rewhere(conditions); end + + # Works in two unique ways. + # + # First: takes a block so it can be used just like Array#select. + # + # Model.all.select { |m| m.field == value } + # + # This will build an array of objects from the database for the scope, + # converting them into an array and iterating through them using + # Array#select. + # + # Second: Modifies the SELECT statement for the query so that only certain + # fields are retrieved: + # + # Model.select(:field) + # # => [#] + # + # Although in the above example it looks as though this method returns an + # array, it actually returns a relation object and can have other query + # methods appended to it, such as the other methods in ActiveRecord::QueryMethods. + # + # The argument to the method can also be an array of fields. + # + # Model.select(:field, :other_field, :and_one_more) + # # => [#] + # + # The argument also can be a hash of fields and aliases. + # + # Model.select(models: { field: :alias, other_field: :other_alias }) + # # => [#] + # + # Model.select(models: [:field, :other_field]) + # # => [#] + # + # You can also use one or more strings, which will be used unchanged as SELECT fields. + # + # Model.select('field AS field_one', 'other_field AS field_two') + # # => [#] + # + # If an alias was specified, it will be accessible from the resulting objects: + # + # Model.select('field AS field_one').first.field_one + # # => "value" + # + # Accessing attributes of an object that do not have fields retrieved by a select + # except +id+ will throw ActiveModel::MissingAttributeError: + # + # Model.select(:field).first.other_field + # # => ActiveModel::MissingAttributeError: missing attribute 'other_field' for Model + # + # source://activerecord//lib/active_record/relation/query_methods.rb#413 + def select(*fields); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def select_values; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def select_values=(value); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1514 + def skip_preloading!; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1509 + def skip_query_cache!(value = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def skip_query_cache_value; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def skip_query_cache_value=(value); end + + # Sets the returned relation to strict_loading mode. This will raise an error + # if the record tries to lazily load an association. + # + # user = User.strict_loading.first + # user.comments.to_a + # # => ActiveRecord::StrictLoadingViolationError + # + # source://activerecord//lib/active_record/relation/query_methods.rb#1325 + def strict_loading(value = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1329 + def strict_loading!(value = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def strict_loading_value; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def strict_loading_value=(value); end + + # Checks whether the given relation is structurally compatible with this relation, to determine + # if it's possible to use the #and and #or methods without raising an error. Structurally + # compatible is defined as: they must be scoping the same model, and they must differ only by + # #where (if no #group has been defined) or #having (if a #group is present). + # + # Post.where("id = 1").structurally_compatible?(Post.where("author_id = 3")) + # # => true + # + # Post.joins(:comments).structurally_compatible?(Post.where("id = 1")) + # # => false + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation/query_methods.rb#1121 + def structurally_compatible?(other); end + + # Deduplicate multiple values. + # + # source://activerecord//lib/active_record/relation/query_methods.rb#1542 + def uniq!(name); end + + # Removes an unwanted relation that is already defined on a chain of relations. + # This is useful when passing around chains of relations and would like to + # modify the relations without reconstructing the entire chain. + # + # User.order('email DESC').unscope(:order) == User.all + # + # The method arguments are symbols which correspond to the names of the methods + # which should be unscoped. The valid arguments are given in VALID_UNSCOPING_VALUES. + # The method can also be called with multiple arguments. For example: + # + # User.order('email DESC').select('id').where(name: "John") + # .unscope(:order, :select, :where) == User.all + # + # One can additionally pass a hash as an argument to unscope specific +:where+ values. + # This is done by passing a hash with a single key-value pair. The key should be + # +:where+ and the value should be the where value to unscope. For example: + # + # User.where(name: "John", active: true).unscope(where: :name) + # == User.where(active: true) + # + # This method is similar to #except, but unlike + # #except, it persists across merges: + # + # User.order('email').merge(User.except(:order)) + # == User.order('email') + # + # User.order('email').merge(User.unscope(:order)) + # == User.all + # + # This means it can be used in association definitions: + # + # has_many :comments, -> { unscope(where: :trashed) } + # + # source://activerecord//lib/active_record/relation/query_methods.rb#806 + def unscope(*args); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#811 + def unscope!(*args); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def unscope_values; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def unscope_values=(value); end + + # Returns a new relation, which is the result of filtering the current relation + # according to the conditions in the arguments. + # + # #where accepts conditions in one of several formats. In the examples below, the resulting + # SQL is given as an illustration; the actual query generated may be different depending + # on the database adapter. + # + # === \String + # + # A single string, without additional arguments, is passed to the query + # constructor as an SQL fragment, and used in the where clause of the query. + # + # Client.where("orders_count = '2'") + # # SELECT * from clients where orders_count = '2'; + # + # Note that building your own string from user input may expose your application + # to injection attacks if not done properly. As an alternative, it is recommended + # to use one of the following methods. + # + # === \Array + # + # If an array is passed, then the first element of the array is treated as a template, and + # the remaining elements are inserted into the template to generate the condition. + # Active Record takes care of building the query to avoid injection attacks, and will + # convert from the ruby type to the database type where needed. Elements are inserted + # into the string in the order in which they appear. + # + # User.where(["name = ? and email = ?", "Joe", "joe@example.com"]) + # # SELECT * FROM users WHERE name = 'Joe' AND email = 'joe@example.com'; + # + # Alternatively, you can use named placeholders in the template, and pass a hash as the + # second element of the array. The names in the template are replaced with the corresponding + # values from the hash. + # + # User.where(["name = :name and email = :email", { name: "Joe", email: "joe@example.com" }]) + # # SELECT * FROM users WHERE name = 'Joe' AND email = 'joe@example.com'; + # + # This can make for more readable code in complex queries. + # + # Lastly, you can use sprintf-style % escapes in the template. This works slightly differently + # than the previous methods; you are responsible for ensuring that the values in the template + # are properly quoted. The values are passed to the connector for quoting, but the caller + # is responsible for ensuring they are enclosed in quotes in the resulting SQL. After quoting, + # the values are inserted using the same escapes as the Ruby core method +Kernel::sprintf+. + # + # User.where(["name = '%s' and email = '%s'", "Joe", "joe@example.com"]) + # # SELECT * FROM users WHERE name = 'Joe' AND email = 'joe@example.com'; + # + # If #where is called with multiple arguments, these are treated as if they were passed as + # the elements of a single array. + # + # User.where("name = :name and email = :email", { name: "Joe", email: "joe@example.com" }) + # # SELECT * FROM users WHERE name = 'Joe' AND email = 'joe@example.com'; + # + # When using strings to specify conditions, you can use any operator available from + # the database. While this provides the most flexibility, you can also unintentionally introduce + # dependencies on the underlying database. If your code is intended for general consumption, + # test with multiple database backends. + # + # === \Hash + # + # #where will also accept a hash condition, in which the keys are fields and the values + # are values to be searched for. + # + # Fields can be symbols or strings. Values can be single values, arrays, or ranges. + # + # User.where(name: "Joe", email: "joe@example.com") + # # SELECT * FROM users WHERE name = 'Joe' AND email = 'joe@example.com' + # + # User.where(name: ["Alice", "Bob"]) + # # SELECT * FROM users WHERE name IN ('Alice', 'Bob') + # + # User.where(created_at: (Time.now.midnight - 1.day)..Time.now.midnight) + # # SELECT * FROM users WHERE (created_at BETWEEN '2012-06-09 07:00:00.000000' AND '2012-06-10 07:00:00.000000') + # + # In the case of a belongs_to relationship, an association key can be used + # to specify the model if an ActiveRecord object is used as the value. + # + # author = Author.find(1) + # + # # The following queries will be equivalent: + # Post.where(author: author) + # Post.where(author_id: author) + # + # This also works with polymorphic belongs_to relationships: + # + # treasure = Treasure.create(name: 'gold coins') + # treasure.price_estimates << PriceEstimate.create(price: 125) + # + # # The following queries will be equivalent: + # PriceEstimate.where(estimate_of: treasure) + # PriceEstimate.where(estimate_of_type: 'Treasure', estimate_of_id: treasure) + # + # Hash conditions may also be specified in a tuple-like syntax. Hash keys may be + # an array of columns with an array of tuples as values. + # + # Article.where([:author_id, :id] => [[15, 1], [15, 2]]) + # # SELECT * FROM articles WHERE author_id = 15 AND id = 1 OR author_id = 15 AND id = 2 + # + # === Joins + # + # If the relation is the result of a join, you may create a condition which uses any of the + # tables in the join. For string and array conditions, use the table name in the condition. + # + # User.joins(:posts).where("posts.created_at < ?", Time.now) + # + # For hash conditions, you can either use the table name in the key, or use a sub-hash. + # + # User.joins(:posts).where("posts.published" => true) + # User.joins(:posts).where(posts: { published: true }) + # + # === No Argument + # + # If no argument is passed, #where returns a new instance of WhereChain, that + # can be chained with WhereChain#not, WhereChain#missing, or WhereChain#associated. + # + # Chaining with WhereChain#not: + # + # User.where.not(name: "Jon") + # # SELECT * FROM users WHERE name != 'Jon' + # + # Chaining with WhereChain#associated: + # + # Post.where.associated(:author) + # # SELECT "posts".* FROM "posts" + # # INNER JOIN "authors" ON "authors"."id" = "posts"."author_id" + # # WHERE "authors"."id" IS NOT NULL + # + # Chaining with WhereChain#missing: + # + # Post.where.missing(:author) + # # SELECT "posts".* FROM "posts" + # # LEFT OUTER JOIN "authors" ON "authors"."id" = "posts"."author_id" + # # WHERE "authors"."id" IS NULL + # + # === Blank Condition + # + # If the condition is any blank-ish object, then #where is a no-op and returns + # the current relation. + # + # source://activerecord//lib/active_record/relation/query_methods.rb#1033 + def where(*args); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1043 + def where!(opts, *rest); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def where_clause; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def where_clause=(value); end + + # Add a Common Table Expression (CTE) that you can then reference within another SELECT statement. + # + # Note: CTE's are only supported in MySQL for versions 8.0 and above. You will not be able to + # use CTE's with MySQL 5.7. + # + # Post.with(posts_with_tags: Post.where("tags_count > ?", 0)) + # # => ActiveRecord::Relation + # # WITH posts_with_tags AS ( + # # SELECT * FROM posts WHERE (tags_count > 0) + # # ) + # # SELECT * FROM posts + # + # You can also pass an array of sub-queries to be joined in a +UNION ALL+. + # + # Post.with(posts_with_tags_or_comments: [Post.where("tags_count > ?", 0), Post.where("comments_count > ?", 0)]) + # # => ActiveRecord::Relation + # # WITH posts_with_tags_or_comments AS ( + # # (SELECT * FROM posts WHERE (tags_count > 0)) + # # UNION ALL + # # (SELECT * FROM posts WHERE (comments_count > 0)) + # # ) + # # SELECT * FROM posts + # + # Once you define Common Table Expression you can use custom +FROM+ value or +JOIN+ to reference it. + # + # Post.with(posts_with_tags: Post.where("tags_count > ?", 0)).from("posts_with_tags AS posts") + # # => ActiveRecord::Relation + # # WITH posts_with_tags AS ( + # # SELECT * FROM posts WHERE (tags_count > 0) + # # ) + # # SELECT * FROM posts_with_tags AS posts + # + # Post.with(posts_with_tags: Post.where("tags_count > ?", 0)).joins("JOIN posts_with_tags ON posts_with_tags.id = posts.id") + # # => ActiveRecord::Relation + # # WITH posts_with_tags AS ( + # # SELECT * FROM posts WHERE (tags_count > 0) + # # ) + # # SELECT * FROM posts JOIN posts_with_tags ON posts_with_tags.id = posts.id + # + # It is recommended to pass a query as ActiveRecord::Relation. If that is not possible + # and you have verified it is safe for the database, you can pass it as SQL literal + # using +Arel+. + # + # Post.with(popular_posts: Arel.sql("... complex sql to calculate posts popularity ...")) + # + # Great caution should be taken to avoid SQL injection vulnerabilities. This method should not + # be used with unsafe values that include unsanitized input. + # + # To add multiple CTEs just pass multiple key-value pairs + # + # Post.with( + # posts_with_comments: Post.where("comments_count > ?", 0), + # posts_with_tags: Post.where("tags_count > ?", 0) + # ) + # + # or chain multiple +.with+ calls + # + # Post + # .with(posts_with_comments: Post.where("comments_count > ?", 0)) + # .with(posts_with_tags: Post.where("tags_count > ?", 0)) + # + # @raise [ArgumentError] + # + # source://activerecord//lib/active_record/relation/query_methods.rb#493 + def with(*args); end + + # Like #with, but modifies relation in place. + # + # source://activerecord//lib/active_record/relation/query_methods.rb#500 + def with!(*args); end + + # Add a recursive Common Table Expression (CTE) that you can then reference within another SELECT statement. + # + # Post.with_recursive(post_and_replies: [Post.where(id: 42), Post.joins('JOIN post_and_replies ON posts.in_reply_to_id = post_and_replies.id')]) + # # => ActiveRecord::Relation + # # WITH RECURSIVE post_and_replies AS ( + # # (SELECT * FROM posts WHERE id = 42) + # # UNION ALL + # # (SELECT * FROM posts JOIN post_and_replies ON posts.in_reply_to_id = post_and_replies.id) + # # ) + # # SELECT * FROM posts + # + # See `#with` for more information. + # + # source://activerecord//lib/active_record/relation/query_methods.rb#518 + def with_recursive(*args); end + + # Like #with_recursive but modifies the relation in place. + # + # source://activerecord//lib/active_record/relation/query_methods.rb#524 + def with_recursive!(*args); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def with_values; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#173 + def with_values=(value); end + + # Excludes the specified record (or collection of records) from the resulting + # relation. For example: + # + # Post.excluding(post) + # # SELECT "posts".* FROM "posts" WHERE "posts"."id" != 1 + # + # Post.excluding(post_one, post_two) + # # SELECT "posts".* FROM "posts" WHERE "posts"."id" NOT IN (1, 2) + # + # Post.excluding(Post.drafts) + # # SELECT "posts".* FROM "posts" WHERE "posts"."id" NOT IN (3, 4, 5) + # + # This can also be called on associations. As with the above example, either + # a single record of collection thereof may be specified: + # + # post = Post.find(1) + # comment = Comment.find(2) + # post.comments.excluding(comment) + # # SELECT "comments".* FROM "comments" WHERE "comments"."post_id" = 1 AND "comments"."id" != 2 + # + # This is short-hand for .where.not(id: post.id) and .where.not(id: [post_one.id, post_two.id]). + # + # An ArgumentError will be raised if either no records are + # specified, or if any of the records in the collection (if a collection + # is passed in) are not instances of the same model that the relation is + # scoping. + # + # source://activerecord//lib/active_record/relation/query_methods.rb#1586 + def without(*records); end + + protected + + # source://activerecord//lib/active_record/relation/query_methods.rb#1662 + def arel_columns(columns); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1657 + def async!; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1655 + def build_having_clause(opts, rest = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1606 + def build_subquery(subquery_alias, select_value); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1614 + def build_where_clause(opts, rest = T.unsafe(nil)); end + + private + + # source://activerecord//lib/active_record/relation/query_methods.rb#2048 + def _reverse_order_columns; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1986 + def arel_column(field); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#2245 + def arel_column_aliases_from_hash(fields); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1974 + def arel_column_with_table(table_name, column_name); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1958 + def arel_columns_from_hash(fields); end + + # @raise [UnmodifiableRelation] + # + # source://activerecord//lib/active_record/relation/query_methods.rb#1746 + def assert_modifiable!; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1678 + def async; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1750 + def build_arel(aliases); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1702 + def build_bound_sql_literal(statement, values); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#2174 + def build_case_for_value_position(column, values, filter: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1774 + def build_cast_value(name, value); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1778 + def build_from; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1820 + def build_join_buckets; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1735 + def build_join_dependencies; end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1876 + def build_joins(join_sources, aliases = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1682 + def build_named_bound_sql_literal(statement, values); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#2066 + def build_order(arel); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1898 + def build_select(arel); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1908 + def build_with(arel); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1924 + def build_with_expression_from_value(value, nested = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1950 + def build_with_join_node(name, kind = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1918 + def build_with_value_from_hash(hash); end + + # Checks to make sure that the arguments are not blank. Note that if some + # blank-like object were initially passed into the query method, then this + # method will not raise an error. + # + # Example: + # + # Post.references() # raises an error + # Post.references([]) # does not raise an error + # + # This particular method should be called with a method_name (__callee__) and the args + # passed into that method as an input. For example: + # + # def references(*args) + # check_if_method_has_arguments!(__callee__, args) + # ... + # end + # + # source://activerecord//lib/active_record/relation/query_methods.rb#2224 + def check_if_method_has_arguments!(method_name, args, message = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#2135 + def column_references(order_args); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation/query_methods.rb#2055 + def does_not_support_reverse?(order); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1729 + def each_join_dependencies(join_dependencies = T.unsafe(nil), &block); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#2160 + def extract_table_name_from(string); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#2088 + def flattened_args(args); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1722 + def lookup_table_klass_from_join_dependencies(table_name); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#2164 + def order_column(field); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#2092 + def preprocess_order_args(order_args); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#2235 + def process_select_args(fields); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#2265 + def process_with_args(args); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#2184 + def resolve_arel_attributes(attrs); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#2013 + def reverse_sql_order(order_query); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#2129 + def sanitize_order_arguments(order_args); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1805 + def select_association_list(associations, stashed_joins = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#1793 + def select_named_joins(join_names, stashed_joins = T.unsafe(nil), &block); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#2277 + def structurally_incompatible_values_for(other); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation/query_methods.rb#2007 + def table_name_matches?(from); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#2074 + def validate_order_args(args); end +end + +# A wrapper to distinguish CTE joins from other nodes. +# +# source://activerecord//lib/active_record/relation/query_methods.rb#151 +class ActiveRecord::QueryMethods::CTEJoin + # @return [CTEJoin] a new instance of CTEJoin + # + # source://activerecord//lib/active_record/relation/query_methods.rb#154 + def initialize(name); end + + # source://activerecord//lib/active_record/relation/query_methods.rb#152 + def name; end +end + +# source://activerecord//lib/active_record/relation/query_methods.rb#159 +ActiveRecord::QueryMethods::FROZEN_EMPTY_ARRAY = T.let(T.unsafe(nil), Array) + +# source://activerecord//lib/active_record/relation/query_methods.rb#160 +ActiveRecord::QueryMethods::FROZEN_EMPTY_HASH = T.let(T.unsafe(nil), Hash) + +# source://activerecord//lib/active_record/relation/query_methods.rb#2272 +ActiveRecord::QueryMethods::STRUCTURAL_VALUE_METHODS = T.let(T.unsafe(nil), Array) + +# source://activerecord//lib/active_record/relation/query_methods.rb#2071 +ActiveRecord::QueryMethods::VALID_DIRECTIONS = T.let(T.unsafe(nil), Set) + +# source://activerecord//lib/active_record/relation/query_methods.rb#768 +ActiveRecord::QueryMethods::VALID_UNSCOPING_VALUES = T.let(T.unsafe(nil), Set) + +# +WhereChain+ objects act as placeholder for queries in which +where+ does not have any parameter. +# In this case, +where+ can be chained to return a new relation. +# +# source://activerecord//lib/active_record/relation/query_methods.rb#14 +class ActiveRecord::QueryMethods::WhereChain + # @return [WhereChain] a new instance of WhereChain + # + # source://activerecord//lib/active_record/relation/query_methods.rb#15 + def initialize(scope); end + + # Returns a new relation with joins and where clause to identify + # associated relations. + # + # For example, posts that are associated to a related author: + # + # Post.where.associated(:author) + # # SELECT "posts".* FROM "posts" + # # INNER JOIN "authors" ON "authors"."id" = "posts"."author_id" + # # WHERE "authors"."id" IS NOT NULL + # + # Additionally, multiple relations can be combined. This will return posts + # associated to both an author and any comments: + # + # Post.where.associated(:author, :comments) + # # SELECT "posts".* FROM "posts" + # # INNER JOIN "authors" ON "authors"."id" = "posts"."author_id" + # # INNER JOIN "comments" ON "comments"."post_id" = "posts"."id" + # # WHERE "authors"."id" IS NOT NULL AND "comments"."id" IS NOT NULL + # + # You can define join type in the scope and +associated+ will not use `JOIN` by default. + # + # Post.left_joins(:author).where.associated(:author) + # # SELECT "posts".* FROM "posts" + # # LEFT OUTER JOIN "authors" "authors"."id" = "posts"."author_id" + # # WHERE "authors"."id" IS NOT NULL + # + # Post.left_joins(:comments).where.associated(:author) + # # SELECT "posts".* FROM "posts" + # # INNER JOIN "authors" ON "authors"."id" = "posts"."author_id" + # # LEFT OUTER JOIN "comments" ON "comments"."post_id" = "posts"."id" + # # WHERE "author"."id" IS NOT NULL + # + # source://activerecord//lib/active_record/relation/query_methods.rb#88 + def associated(*associations); end + + # Returns a new relation with left outer joins and where clause to identify + # missing relations. + # + # For example, posts that are missing a related author: + # + # Post.where.missing(:author) + # # SELECT "posts".* FROM "posts" + # # LEFT OUTER JOIN "authors" ON "authors"."id" = "posts"."author_id" + # # WHERE "authors"."id" IS NULL + # + # Additionally, multiple relations can be combined. This will return posts + # that are missing both an author and any comments: + # + # Post.where.missing(:author, :comments) + # # SELECT "posts".* FROM "posts" + # # LEFT OUTER JOIN "authors" ON "authors"."id" = "posts"."author_id" + # # LEFT OUTER JOIN "comments" ON "comments"."post_id" = "posts"."id" + # # WHERE "authors"."id" IS NULL AND "comments"."id" IS NULL + # + # source://activerecord//lib/active_record/relation/query_methods.rb#124 + def missing(*associations); end + + # Returns a new relation expressing WHERE + NOT condition according to + # the conditions in the arguments. + # + # #not accepts conditions as a string, array, or hash. See QueryMethods#where for + # more details on each format. + # + # User.where.not("name = 'Jon'") + # # SELECT * FROM users WHERE NOT (name = 'Jon') + # + # User.where.not(["name = ?", "Jon"]) + # # SELECT * FROM users WHERE NOT (name = 'Jon') + # + # User.where.not(name: "Jon") + # # SELECT * FROM users WHERE name != 'Jon' + # + # User.where.not(name: nil) + # # SELECT * FROM users WHERE name IS NOT NULL + # + # User.where.not(name: %w(Ko1 Nobu)) + # # SELECT * FROM users WHERE name NOT IN ('Ko1', 'Nobu') + # + # User.where.not(name: "Jon", role: "admin") + # # SELECT * FROM users WHERE NOT (name = 'Jon' AND role = 'admin') + # + # If there is a non-nil condition on a nullable column in the hash condition, the records that have + # nil values on the nullable column won't be returned. + # User.create!(nullable_country: nil) + # User.where.not(nullable_country: "UK") + # # SELECT * FROM users WHERE NOT (nullable_country = 'UK') + # # => [] + # + # source://activerecord//lib/active_record/relation/query_methods.rb#49 + def not(opts, *rest); end + + private + + # source://activerecord//lib/active_record/relation/query_methods.rb#140 + def scope_association_reflection(association); end +end + +# source://activerecord//lib/active_record/querying.rb#4 +module ActiveRecord::Querying + # source://activerecord//lib/active_record/querying.rb#71 + def _load_from_sql(result_set, &block); end + + # source://activerecord//lib/active_record/querying.rb#67 + def _query_by_sql(connection, sql, binds = T.unsafe(nil), preparable: T.unsafe(nil), async: T.unsafe(nil), allow_retry: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/querying.rb#24 + def and(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def annotate(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def any?(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def async_average(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def async_count(*_arg0, **_arg1, &_arg2); end + + # Same as #count_by_sql but perform the query asynchronously and returns an ActiveRecord::Promise. + # + # source://activerecord//lib/active_record/querying.rb#116 + def async_count_by_sql(sql); end + + # Same as #find_by_sql but perform the query asynchronously and returns an ActiveRecord::Promise. + # + # source://activerecord//lib/active_record/querying.rb#59 + def async_find_by_sql(sql, binds = T.unsafe(nil), preparable: T.unsafe(nil), allow_retry: T.unsafe(nil), &block); end + + # source://activerecord//lib/active_record/querying.rb#24 + def async_ids(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def async_maximum(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def async_minimum(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def async_pick(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def async_pluck(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def async_sum(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def average(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def calculate(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def count(*_arg0, **_arg1, &_arg2); end + + # Returns the result of an SQL statement that should only include a COUNT(*) in the SELECT part. + # The use of this method should be restricted to complicated SQL queries that can't be executed + # using the ActiveRecord::Calculations class methods. Look into those before using this method, + # as it could lock you into a specific database engine or require a code change to switch + # database engines. + # + # Product.count_by_sql "SELECT COUNT(*) FROM sales s, customers c WHERE s.customer_id = c.id" + # # => 12 + # + # ==== Parameters + # + # * +sql+ - An SQL statement which should return a count query from the database, see the example above. + # + # source://activerecord//lib/active_record/querying.rb#109 + def count_by_sql(sql); end + + # source://activerecord//lib/active_record/querying.rb#24 + def create_or_find_by(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def create_or_find_by!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def create_with(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def delete(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def delete_all(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def delete_by(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def destroy(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def destroy_all(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def destroy_by(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def distinct(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def eager_load(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def except(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def excluding(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def exists?(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def extending(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def extract_associated(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def fifth(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def fifth!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def find(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def find_by(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def find_by!(*_arg0, **_arg1, &_arg2); end + + # Executes a custom SQL query against your database and returns all the results. The results will + # be returned as an array, with the requested columns encapsulated as attributes of the model you call + # this method from. For example, if you call Product.find_by_sql, then the results will be returned in + # a +Product+ object with the attributes you specified in the SQL query. + # + # If you call a complicated SQL query which spans multiple tables, the columns specified by the + # SELECT will be attributes of the model, whether or not they are columns of the corresponding + # table. + # + # The +sql+ parameter is a full SQL query as a string. It will be called as is; there will be + # no database agnostic conversions performed. This should be a last resort because using + # database-specific terms will lock you into using that particular database engine, or require you to + # change your call if you switch engines. + # + # # A simple SQL query spanning multiple tables + # Post.find_by_sql "SELECT p.title, c.author FROM posts p, comments c WHERE p.id = c.post_id" + # # => [#"Ruby Meetup", "author"=>"Quentin"}>, ...] + # + # You can use the same string replacement techniques as you can with ActiveRecord::QueryMethods#where : + # + # Post.find_by_sql ["SELECT title FROM posts WHERE author = ? AND created > ?", author_id, start_date] + # Post.find_by_sql ["SELECT body FROM comments WHERE author = :user_id OR approved_by = :user_id", { :user_id => user_id }] + # + # Note that building your own SQL query string from user input {may expose your application to + # injection attacks}[https://guides.rubyonrails.org/security.html#sql-injection]. + # + # source://activerecord//lib/active_record/querying.rb#51 + def find_by_sql(sql, binds = T.unsafe(nil), preparable: T.unsafe(nil), allow_retry: T.unsafe(nil), &block); end + + # source://activerecord//lib/active_record/querying.rb#24 + def find_each(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def find_in_batches(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def find_or_create_by(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def find_or_create_by!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def find_or_initialize_by(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def find_sole_by(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def first(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def first!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def first_or_create(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def first_or_create!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def first_or_initialize(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def forty_two(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def forty_two!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def fourth(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def fourth!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def from(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def group(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def having(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def ids(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def in_batches(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def in_order_of(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def includes(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def insert(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def insert!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def insert_all(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def insert_all!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def invert_where(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def joins(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def last(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def last!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def left_joins(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def left_outer_joins(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def limit(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def lock(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def many?(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def maximum(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def merge(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def minimum(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def none(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def none?(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def offset(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def one?(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def only(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def optimizer_hints(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def or(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def order(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def pick(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def pluck(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def preload(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def readonly(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def references(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def regroup(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def reorder(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def reselect(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def rewhere(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def second(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def second!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def second_to_last(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def second_to_last!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def select(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def sole(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def strict_loading(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def sum(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def take(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def take!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def third(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def third!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def third_to_last(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def third_to_last!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def touch_all(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def unscope(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def update_all(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def upsert(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def upsert_all(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def where(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def with(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def with_recursive(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/querying.rb#24 + def without(*_arg0, **_arg1, &_arg2); end +end + +# source://activerecord//lib/active_record/querying.rb#5 +ActiveRecord::Querying::QUERYING_METHODS = T.let(T.unsafe(nil), Array) + +# = Active Record Railtie +# +# source://activerecord//lib/active_record/railtie.rb#16 +class ActiveRecord::Railtie < ::Rails::Railtie; end + +# Raised when values that executed are out of range. +# +# source://activerecord//lib/active_record/errors.rb#308 +class ActiveRecord::RangeError < ::ActiveRecord::StatementInvalid; end + +# Raised when a write to the database is attempted on a read only connection. +# +# source://activerecord//lib/active_record/errors.rb#131 +class ActiveRecord::ReadOnlyError < ::ActiveRecord::ActiveRecordError; end + +# Raised on attempt to update record that is instantiated as read only. +# +# source://activerecord//lib/active_record/errors.rb#401 +class ActiveRecord::ReadOnlyRecord < ::ActiveRecord::ActiveRecordError; end + +# source://activerecord//lib/active_record/readonly_attributes.rb#4 +class ActiveRecord::ReadonlyAttributeError < ::ActiveRecord::ActiveRecordError; end + +# source://activerecord//lib/active_record/readonly_attributes.rb#7 +module ActiveRecord::ReadonlyAttributes + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveRecord::ReadonlyAttributes::ClassMethods + + module GeneratedClassMethods + def _attr_readonly; end + def _attr_readonly=(value); end + def _attr_readonly?; end + end + + module GeneratedInstanceMethods; end +end + +# source://activerecord//lib/active_record/readonly_attributes.rb#14 +module ActiveRecord::ReadonlyAttributes::ClassMethods + # Attributes listed as readonly will be used to create a new record. + # Assigning a new value to a readonly attribute on a persisted record raises an error. + # + # By setting +config.active_record.raise_on_assign_to_attr_readonly+ to +false+, it will + # not raise. The value will change in memory, but will not be persisted on +save+. + # + # ==== Examples + # + # class Post < ActiveRecord::Base + # attr_readonly :title + # end + # + # post = Post.create!(title: "Introducing Ruby on Rails!") + # post.title = "a different title" # raises ActiveRecord::ReadonlyAttributeError + # post.update(title: "a different title") # raises ActiveRecord::ReadonlyAttributeError + # + # source://activerecord//lib/active_record/readonly_attributes.rb#30 + def attr_readonly(*attributes); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/readonly_attributes.rb#43 + def readonly_attribute?(name); end + + # Returns an array of all the attributes that have been specified as readonly. + # + # source://activerecord//lib/active_record/readonly_attributes.rb#39 + def readonly_attributes; end +end + +# source://activerecord//lib/active_record/readonly_attributes.rb#48 +module ActiveRecord::ReadonlyAttributes::HasReadonlyAttributes + # source://activerecord//lib/active_record/readonly_attributes.rb#57 + def _write_attribute(attr_name, value); end + + # source://activerecord//lib/active_record/readonly_attributes.rb#49 + def write_attribute(attr_name, value); end +end + +# = Active Record \RecordInvalid +# +# Raised by {ActiveRecord::Base#save!}[rdoc-ref:Persistence#save!] and +# {ActiveRecord::Base#create!}[rdoc-ref:Persistence::ClassMethods#create!] when the record is invalid. +# Use the #record method to retrieve the record which did not validate. +# +# begin +# complex_operation_that_internally_calls_save! +# rescue ActiveRecord::RecordInvalid => invalid +# puts invalid.record.errors +# end +# +# source://activerecord//lib/active_record/validations.rb#15 +class ActiveRecord::RecordInvalid < ::ActiveRecord::ActiveRecordError + # @return [RecordInvalid] a new instance of RecordInvalid + # + # source://activerecord//lib/active_record/validations.rb#18 + def initialize(record = T.unsafe(nil)); end + + # Returns the value of attribute record. + # + # source://activerecord//lib/active_record/validations.rb#16 + def record; end +end + +# Raised by {ActiveRecord::Base#destroy!}[rdoc-ref:Persistence#destroy!] +# when a record cannot be destroyed due to any of the +# before_destroy callbacks throwing +:abort+. See +# ActiveRecord::Callbacks for further details. +# +# class User < ActiveRecord::Base +# before_destroy do +# throw :abort if still_active? +# end +# end +# +# User.first.destroy! # => raises an ActiveRecord::RecordNotDestroyed +# +# source://activerecord//lib/active_record/errors.rb#181 +class ActiveRecord::RecordNotDestroyed < ::ActiveRecord::ActiveRecordError + # @return [RecordNotDestroyed] a new instance of RecordNotDestroyed + # + # source://activerecord//lib/active_record/errors.rb#184 + def initialize(message = T.unsafe(nil), record = T.unsafe(nil)); end + + # Returns the value of attribute record. + # + # source://activerecord//lib/active_record/errors.rb#182 + def record; end +end + +# Raised when Active Record cannot find a record by given id or set of ids. +# +# source://activerecord//lib/active_record/errors.rb#135 +class ActiveRecord::RecordNotFound < ::ActiveRecord::ActiveRecordError + # @return [RecordNotFound] a new instance of RecordNotFound + # + # source://activerecord//lib/active_record/errors.rb#138 + def initialize(message = T.unsafe(nil), model = T.unsafe(nil), primary_key = T.unsafe(nil), id = T.unsafe(nil)); end + + # Returns the value of attribute id. + # + # source://activerecord//lib/active_record/errors.rb#136 + def id; end + + # Returns the value of attribute model. + # + # source://activerecord//lib/active_record/errors.rb#136 + def model; end + + # Returns the value of attribute primary_key. + # + # source://activerecord//lib/active_record/errors.rb#136 + def primary_key; end +end + +# Raised by {ActiveRecord::Base#save!}[rdoc-ref:Persistence#save!] and +# {ActiveRecord::Base.update_attribute!}[rdoc-ref:Persistence#update_attribute!] +# methods when a record failed to validate or cannot be saved due to any of the +# before_* callbacks throwing +:abort+. See +# ActiveRecord::Callbacks for further details. +# +# class Product < ActiveRecord::Base +# before_save do +# throw :abort if price < 0 +# end +# end +# +# Product.create! # => raises an ActiveRecord::RecordNotSaved +# +# source://activerecord//lib/active_record/errors.rb#160 +class ActiveRecord::RecordNotSaved < ::ActiveRecord::ActiveRecordError + # @return [RecordNotSaved] a new instance of RecordNotSaved + # + # source://activerecord//lib/active_record/errors.rb#163 + def initialize(message = T.unsafe(nil), record = T.unsafe(nil)); end + + # Returns the value of attribute record. + # + # source://activerecord//lib/active_record/errors.rb#161 + def record; end +end + +# Raised when a record cannot be inserted or updated because it would violate a uniqueness constraint. +# +# source://activerecord//lib/active_record/errors.rb#228 +class ActiveRecord::RecordNotUnique < ::ActiveRecord::WrappedDatabaseException; end + +# = Active Record Reflection +# +# source://activerecord//lib/active_record/reflection.rb#7 +module ActiveRecord::Reflection + extend ::ActiveSupport::Concern + extend ::ActiveStorage::Reflection::ReflectionExtension + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveRecord::Reflection::ClassMethods + + class << self + # source://activerecord//lib/active_record/reflection.rb#29 + def add_aggregate_reflection(ar, name, reflection); end + + # source://activerecord//lib/active_record/reflection.rb#23 + def add_reflection(ar, name, reflection); end + + # source://activerecord//lib/active_record/reflection.rb#18 + def create(macro, name, scope, options, ar); end + + private + + # source://activerecord//lib/active_record/reflection.rb#34 + def reflection_class_for(macro); end + end + + module GeneratedClassMethods + def _reflections; end + def _reflections=(value); end + def _reflections?; end + def aggregate_reflections; end + def aggregate_reflections=(value); end + def aggregate_reflections?; end + def automatic_scope_inversing; end + def automatic_scope_inversing=(value); end + def automatic_scope_inversing?; end + def automatically_invert_plural_associations; end + def automatically_invert_plural_associations=(value); end + def automatically_invert_plural_associations?; end + end + + module GeneratedInstanceMethods + def _reflections; end + def _reflections?; end + def aggregate_reflections; end + def aggregate_reflections?; end + def automatic_scope_inversing; end + def automatic_scope_inversing?; end + def automatically_invert_plural_associations; end + def automatically_invert_plural_associations?; end + end +end + +# Holds all the methods that are shared between MacroReflection and ThroughReflection. +# +# AbstractReflection +# MacroReflection +# AggregateReflection +# AssociationReflection +# HasManyReflection +# HasOneReflection +# BelongsToReflection +# HasAndBelongsToManyReflection +# ThroughReflection +# PolymorphicReflection +# RuntimeReflection +# +# source://activerecord//lib/active_record/reflection.rb#163 +class ActiveRecord::Reflection::AbstractReflection + # @return [AbstractReflection] a new instance of AbstractReflection + # + # source://activerecord//lib/active_record/reflection.rb#164 + def initialize; end + + # source://activerecord//lib/active_record/reflection.rb#328 + def alias_candidate(name); end + + # Returns a new, unsaved instance of the associated class. +attributes+ will + # be passed to the class's constructor. + # + # source://activerecord//lib/active_record/reflection.rb#182 + def build_association(attributes, &block); end + + # source://activerecord//lib/active_record/reflection.rb#336 + def build_scope(table, predicate_builder = T.unsafe(nil), klass = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/reflection.rb#332 + def chain; end + + # source://activerecord//lib/active_record/reflection.rb#264 + def check_validity_of_inverse!; end + + # Returns the class name for the macro. + # + # composed_of :balance, class_name: 'Money' returns 'Money' + # has_many :clients returns 'Client' + # + # source://activerecord//lib/active_record/reflection.rb#190 + def class_name; end + + # source://activerecord//lib/active_record/reflection.rb#240 + def constraints; end + + # source://activerecord//lib/active_record/reflection.rb#244 + def counter_cache_column; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/reflection.rb#324 + def counter_must_be_updated_by_has_many?; end + + # Returns whether this association has a counter cache and its column values were backfilled + # (and so it is used internally by methods like +size+/+any?+/etc). + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/reflection.rb#315 + def has_active_cached_counter?; end + + # Returns whether this association has a counter cache. + # + # The counter_cache option must be given on either the owner or inverse + # association, and the column must be present on the owner. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/reflection.rb#307 + def has_cached_counter?; end + + # source://activerecord//lib/active_record/reflection.rb#258 + def inverse_of; end + + # We need to avoid the following situation: + # + # * An associated record is deleted via record.destroy + # * Hence the callbacks run, and they find a belongs_to on the record with a + # :counter_cache options which points back at our owner. So they update the + # counter cache. + # * In which case, we must make sure to *not* update the counter cache, or else + # it will be decremented twice. + # + # Hence this method. + # + # source://activerecord//lib/active_record/reflection.rb#297 + def inverse_updates_counter_cache?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/reflection.rb#299 + def inverse_updates_counter_in_memory?; end + + # We need to avoid the following situation: + # + # * An associated record is deleted via record.destroy + # * Hence the callbacks run, and they find a belongs_to on the record with a + # :counter_cache options which points back at our owner. So they update the + # counter cache. + # * In which case, we must make sure to *not* update the counter cache, or else + # it will be decremented twice. + # + # Hence this method. + # + # source://activerecord//lib/active_record/reflection.rb#285 + def inverse_which_updates_counter_cache; end + + # source://activerecord//lib/active_record/reflection.rb#200 + def join_scope(table, foreign_table, foreign_klass); end + + # source://activerecord//lib/active_record/reflection.rb#227 + def join_scopes(table, predicate_builder = T.unsafe(nil), klass = T.unsafe(nil), record = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/reflection.rb#235 + def klass_join_scope(table, predicate_builder = T.unsafe(nil)); end + + # Returns a list of scopes that should be applied for this Reflection + # object when querying the database. + # + # source://activerecord//lib/active_record/reflection.rb#196 + def scopes; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/reflection.rb#340 + def strict_loading?; end + + # source://activerecord//lib/active_record/reflection.rb#344 + def strict_loading_violation_message(owner); end + + # source://activerecord//lib/active_record/reflection.rb#176 + def table_name; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/reflection.rb#172 + def through_reflection?; end + + protected + + # FIXME: this is a horrible name + # + # source://activerecord//lib/active_record/reflection.rb#351 + def actual_source_reflection; end + + private + + # source://activerecord//lib/active_record/reflection.rb#360 + def ensure_option_not_given_as_class!(option_name); end + + # source://activerecord//lib/active_record/reflection.rb#356 + def primary_key(klass); end +end + +# Holds all the metadata about an aggregation as it was specified in the +# Active Record class. +# +# source://activerecord//lib/active_record/reflection.rb#480 +class ActiveRecord::Reflection::AggregateReflection < ::ActiveRecord::Reflection::MacroReflection + # source://activerecord//lib/active_record/reflection.rb#481 + def mapping; end +end + +# Holds all the metadata about an association as it was specified in the +# Active Record class. +# +# source://activerecord//lib/active_record/reflection.rb#489 +class ActiveRecord::Reflection::AssociationReflection < ::ActiveRecord::Reflection::MacroReflection + # @return [AssociationReflection] a new instance of AssociationReflection + # + # source://activerecord//lib/active_record/reflection.rb#517 + def initialize(name, scope, options, active_record); end + + # source://activerecord//lib/active_record/reflection.rb#591 + def active_record_primary_key; end + + # source://activerecord//lib/active_record/reflection.rb#741 + def add_as_polymorphic_through(reflection, seed); end + + # source://activerecord//lib/active_record/reflection.rb#737 + def add_as_source(seed); end + + # source://activerecord//lib/active_record/reflection.rb#745 + def add_as_through(seed); end + + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/reflection.rb#727 + def association_class; end + + # source://activerecord//lib/active_record/reflection.rb#583 + def association_foreign_key; end + + # source://activerecord//lib/active_record/reflection.rb#587 + def association_primary_key(klass = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/reflection.rb#544 + def association_scope_cache(klass, owner, &block); end + + # Returns +true+ if +self+ is a +belongs_to+ reflection. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/reflection.rb#722 + def belongs_to?; end + + # source://activerecord//lib/active_record/reflection.rb#638 + def check_eager_loadable!; end + + # source://activerecord//lib/active_record/reflection.rb#622 + def check_validity!; end + + # This is for clearing cache on the reflection. Useful for tests that need to compare + # SQL queries on associations. + # + # source://activerecord//lib/active_record/reflection.rb#670 + def clear_association_scope_cache; end + + # A chain of reflections from this one back to the owner. For more see the explanation in + # ThroughReflection. + # + # source://activerecord//lib/active_record/reflection.rb#664 + def collect_join_chain; end + + # Returns whether or not this association reflection is for a collection + # association. Returns +true+ if the +macro+ is either +has_many+ or + # +has_and_belongs_to_many+, +false+ otherwise. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/reflection.rb#704 + def collection?; end + + # source://activerecord//lib/active_record/reflection.rb#490 + def compute_class(name); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/reflection.rb#753 + def deprecated?; end + + # source://activerecord//lib/active_record/reflection.rb#749 + def extensions; end + + # source://activerecord//lib/active_record/reflection.rb#558 + def foreign_key(infer_from_inverse_of: T.unsafe(nil)); end + + # Returns the value of attribute foreign_type. + # + # source://activerecord//lib/active_record/reflection.rb#514 + def foreign_type; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/reflection.rb#682 + def has_inverse?; end + + # Returns +true+ if +self+ is a +has_one+ reflection. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/reflection.rb#725 + def has_one?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/reflection.rb#678 + def has_scope?; end + + # source://activerecord//lib/active_record/reflection.rb#618 + def join_foreign_key; end + + # source://activerecord//lib/active_record/reflection.rb#650 + def join_id_for(owner); end + + # source://activerecord//lib/active_record/reflection.rb#610 + def join_primary_key(klass = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/reflection.rb#614 + def join_primary_type; end + + # source://activerecord//lib/active_record/reflection.rb#554 + def join_table; end + + # Returns the macro type. + # + # has_many :clients returns :has_many + # + # @raise [NotImplementedError] + # + # source://activerecord//lib/active_record/reflection.rb#699 + def macro; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/reflection.rb#674 + def nested?; end + + # Reflection + # + # source://activerecord//lib/active_record/reflection.rb#515 + def parent_reflection; end + + # Reflection + # + # source://activerecord//lib/active_record/reflection.rb#515 + def parent_reflection=(_arg0); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/reflection.rb#729 + def polymorphic?; end + + # source://activerecord//lib/active_record/reflection.rb#686 + def polymorphic_inverse_of(associated_class); end + + # source://activerecord//lib/active_record/reflection.rb#733 + def polymorphic_name; end + + # source://activerecord//lib/active_record/reflection.rb#658 + def source_reflection; end + + # source://activerecord//lib/active_record/reflection.rb#654 + def through_reflection; end + + # Returns the value of attribute type. + # + # source://activerecord//lib/active_record/reflection.rb#514 + def type; end + + # Returns whether or not the association should be validated as part of + # the parent's validation. + # + # Unless you explicitly disable validation with + # validate: false, validation will take place when: + # + # * you explicitly enable validation; validate: true + # * you use autosave; autosave: true + # * the association is a +has_many+ association + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/reflection.rb#717 + def validate?; end + + private + + # returns either +nil+ or the inverse association name that it finds. + # + # source://activerecord//lib/active_record/reflection.rb#770 + def automatic_inverse_of; end + + # Checks to see if the reflection doesn't have any options that prevent + # us from being able to guess the inverse automatically. First, the + # inverse_of option cannot be set to false. Second, we must + # have has_many, has_one, belongs_to associations. + # Third, we must not have options such as :foreign_key + # which prevent us from correctly guessing the inverse association. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/reflection.rb#812 + def can_find_inverse_of_automatically?(reflection, inverse_reflection = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/reflection.rb#833 + def derive_class_name; end + + # source://activerecord//lib/active_record/reflection.rb#851 + def derive_fk_query_constraints(foreign_key); end + + # source://activerecord//lib/active_record/reflection.rb#839 + def derive_foreign_key(infer_from_inverse_of: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/reflection.rb#891 + def derive_join_table; end + + # Attempts to find the inverse association name automatically. + # If it cannot find a suitable inverse association name, it returns + # +nil+. + # + # source://activerecord//lib/active_record/reflection.rb#761 + def inverse_name; end + + # Scopes on the potential inverse reflection prevent automatic + # inverse_of, since the scope could exclude the owner record + # we would inverse from. Scopes on the reflection itself allow for + # automatic inverse_of as long as + # config.active_record.automatic_scope_inversing is set to + # +true+ (the default for new applications). + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/reflection.rb#825 + def scope_allows_automatic_inverse_of?(reflection, inverse_reflection); end + + # Checks if the inverse reflection that is returned from the + # +automatic_inverse_of+ method is a valid reflection. We must + # make sure that the reflection's active_record name matches up + # with the current reflection's klass name. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/reflection.rb#798 + def valid_inverse_reflection?(reflection); end +end + +# source://activerecord//lib/active_record/reflection.rb#924 +class ActiveRecord::Reflection::BelongsToReflection < ::ActiveRecord::Reflection::AssociationReflection + # source://activerecord//lib/active_record/reflection.rb#929 + def association_class; end + + # klass option is necessary to support loading polymorphic associations + # + # source://activerecord//lib/active_record/reflection.rb#938 + def association_primary_key(klass = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/reflection.rb#927 + def belongs_to?; end + + # source://activerecord//lib/active_record/reflection.rb#960 + def join_foreign_key; end + + # source://activerecord//lib/active_record/reflection.rb#964 + def join_foreign_type; end + + # source://activerecord//lib/active_record/reflection.rb#956 + def join_primary_key(klass = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/reflection.rb#925 + def macro; end + + private + + # @return [Boolean] + # + # source://activerecord//lib/active_record/reflection.rb#969 + def can_find_inverse_of_automatically?(*_arg0); end +end + +# = Active Record Reflection +# +# \Reflection enables the ability to examine the associations and aggregations of +# Active Record classes and objects. This information, for example, +# can be used in a form builder that takes an Active Record object +# and creates input fields for all of the attributes depending on their type +# and displays the associations to other objects. +# +# MacroReflection class has info for AggregateReflection and AssociationReflection +# classes. +# +# source://activerecord//lib/active_record/reflection.rb#60 +module ActiveRecord::Reflection::ClassMethods + # source://activerecord//lib/active_record/reflection.rb#126 + def _reflect_on_association(association); end + + # source://activerecord//lib/active_record/reflection.rb#137 + def clear_reflections_cache; end + + # source://activerecord//lib/active_record/reflection.rb#82 + def normalized_reflections; end + + # Returns the AggregateReflection object for the named +aggregation+ (use the symbol). + # + # Account.reflect_on_aggregation(:balance) # => the balance AggregateReflection + # + # source://activerecord//lib/active_record/reflection.rb#70 + def reflect_on_aggregation(aggregation); end + + # Returns an array of AggregateReflection objects for all the aggregations in the class. + # + # source://activerecord//lib/active_record/reflection.rb#62 + def reflect_on_all_aggregations; end + + # Returns an array of AssociationReflection objects for all the + # associations in the class. If you only want to reflect on a certain + # association type, pass in the symbol (:has_many, :has_one, + # :belongs_to) as the first parameter. + # + # Example: + # + # Account.reflect_on_all_associations # returns an array of all associations + # Account.reflect_on_all_associations(:has_many) # returns an array of all has_many associations + # + # source://activerecord//lib/active_record/reflection.rb#111 + def reflect_on_all_associations(macro = T.unsafe(nil)); end + + # Returns an array of AssociationReflection objects for all associations which have :autosave enabled. + # + # source://activerecord//lib/active_record/reflection.rb#131 + def reflect_on_all_autosave_associations; end + + # Returns the AssociationReflection object for the +association+ (use the symbol). + # + # Account.reflect_on_association(:owner) # returns the owner AssociationReflection + # Invoice.reflect_on_association(:line_items).macro # returns :has_many + # + # source://activerecord//lib/active_record/reflection.rb#122 + def reflect_on_association(association); end + + # Returns a Hash of name of the reflection as the key and an AssociationReflection as the value. + # + # Account.reflections # => {"balance" => AggregateReflection} + # + # source://activerecord//lib/active_record/reflection.rb#78 + def reflections; end + + private + + # source://activerecord//lib/active_record/reflection.rb#142 + def inherited(subclass); end +end + +# source://activerecord//lib/active_record/reflection.rb#974 +class ActiveRecord::Reflection::HasAndBelongsToManyReflection < ::ActiveRecord::Reflection::AssociationReflection + # @return [Boolean] + # + # source://activerecord//lib/active_record/reflection.rb#977 + def collection?; end + + # source://activerecord//lib/active_record/reflection.rb#975 + def macro; end +end + +# source://activerecord//lib/active_record/reflection.rb#896 +class ActiveRecord::Reflection::HasManyReflection < ::ActiveRecord::Reflection::AssociationReflection + # source://activerecord//lib/active_record/reflection.rb#901 + def association_class; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/reflection.rb#899 + def collection?; end + + # source://activerecord//lib/active_record/reflection.rb#897 + def macro; end +end + +# source://activerecord//lib/active_record/reflection.rb#910 +class ActiveRecord::Reflection::HasOneReflection < ::ActiveRecord::Reflection::AssociationReflection + # source://activerecord//lib/active_record/reflection.rb#915 + def association_class; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/reflection.rb#913 + def has_one?; end + + # source://activerecord//lib/active_record/reflection.rb#911 + def macro; end +end + +# Base class for AggregateReflection and AssociationReflection. Objects of +# AggregateReflection and AssociationReflection are returned by the Reflection::ClassMethods. +# +# source://activerecord//lib/active_record/reflection.rb#369 +class ActiveRecord::Reflection::MacroReflection < ::ActiveRecord::Reflection::AbstractReflection + # @return [MacroReflection] a new instance of MacroReflection + # + # source://activerecord//lib/active_record/reflection.rb#388 + def initialize(name, scope, options, active_record); end + + # Returns +true+ if +self+ and +other_aggregation+ have the same +name+ attribute, +active_record+ attribute, + # and +other_aggregation+ has an options hash assigned to it. + # + # source://activerecord//lib/active_record/reflection.rb#440 + def ==(other_aggregation); end + + # source://activerecord//lib/active_record/reflection.rb#426 + def _klass(class_name); end + + # Returns the value of attribute active_record. + # + # source://activerecord//lib/active_record/reflection.rb#384 + def active_record; end + + # source://activerecord//lib/active_record/reflection.rb#399 + def autosave=(autosave); end + + # source://activerecord//lib/active_record/reflection.rb#434 + def compute_class(name); end + + # Returns the class for the macro. + # + # composed_of :balance, class_name: 'Money' returns the Money class + # has_many :clients returns the Client class + # + # class Company < ActiveRecord::Base + # has_many :clients + # end + # + # Company.reflect_on_association(:clients).klass + # # => Client + # + # Note: Do not call +klass.new+ or +klass.create+ to instantiate + # a new association object. Use +build_association+ or +create_association+ + # instead. This allows plugins to hook into association object creation. + # + # source://activerecord//lib/active_record/reflection.rb#422 + def klass; end + + # Returns the name of the macro. + # + # composed_of :balance, class_name: 'Money' returns :balance + # has_many :clients returns :clients + # + # source://activerecord//lib/active_record/reflection.rb#374 + def name; end + + # Returns the hash of options used for the macro. + # + # composed_of :balance, class_name: 'Money' returns { class_name: "Money" } + # has_many :clients returns {} + # + # source://activerecord//lib/active_record/reflection.rb#382 + def options; end + + # source://activerecord//lib/active_record/reflection.rb#386 + def plural_name; end + + # Returns the value of attribute scope. + # + # source://activerecord//lib/active_record/reflection.rb#376 + def scope; end + + # source://activerecord//lib/active_record/reflection.rb#448 + def scope_for(relation, owner = T.unsafe(nil)); end + + private + + # source://activerecord//lib/active_record/reflection.rb#453 + def derive_class_name; end + + # source://activerecord//lib/active_record/reflection.rb#457 + def normalize_options(options); end +end + +# source://activerecord//lib/active_record/reflection.rb#1263 +class ActiveRecord::Reflection::PolymorphicReflection < ::ActiveRecord::Reflection::AbstractReflection + # @return [PolymorphicReflection] a new instance of PolymorphicReflection + # + # source://activerecord//lib/active_record/reflection.rb#1267 + def initialize(reflection, previous_reflection); end + + # source://activerecord//lib/active_record/reflection.rb#1281 + def constraints; end + + # source://activerecord//lib/active_record/reflection.rb#1264 + def join_foreign_key(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1264 + def join_primary_key(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1273 + def join_scopes(table, predicate_builder = T.unsafe(nil), klass = T.unsafe(nil), record = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/reflection.rb#1264 + def klass(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1264 + def name(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1264 + def plural_name(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1264 + def scope(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1264 + def scope_for(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1264 + def type(*_arg0, **_arg1, &_arg2); end + + private + + # source://activerecord//lib/active_record/reflection.rb#1286 + def source_type_scope; end +end + +# source://activerecord//lib/active_record/reflection.rb#1293 +class ActiveRecord::Reflection::RuntimeReflection < ::ActiveRecord::Reflection::AbstractReflection + # @return [RuntimeReflection] a new instance of RuntimeReflection + # + # source://activerecord//lib/active_record/reflection.rb#1296 + def initialize(reflection, association); end + + # source://activerecord//lib/active_record/reflection.rb#1306 + def aliased_table; end + + # source://activerecord//lib/active_record/reflection.rb#1314 + def all_includes; end + + # source://activerecord//lib/active_record/reflection.rb#1294 + def constraints(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1294 + def join_foreign_key(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1310 + def join_primary_key(klass = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/reflection.rb#1302 + def klass; end + + # source://activerecord//lib/active_record/reflection.rb#1294 + def scope(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1294 + def type(*_arg0, **_arg1, &_arg2); end +end + +# Holds all the metadata about a :through association as it was specified +# in the Active Record class. +# +# source://activerecord//lib/active_record/reflection.rb#984 +class ActiveRecord::Reflection::ThroughReflection < ::ActiveRecord::Reflection::AbstractReflection + # @return [ThroughReflection] a new instance of ThroughReflection + # + # source://activerecord//lib/active_record/reflection.rb#988 + def initialize(delegate_reflection); end + + # source://activerecord//lib/active_record/reflection.rb#1260 + def _klass(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1260 + def active_record(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#985 + def active_record_primary_key(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1208 + def add_as_polymorphic_through(reflection, seed); end + + # source://activerecord//lib/active_record/reflection.rb#1204 + def add_as_source(seed); end + + # source://activerecord//lib/active_record/reflection.rb#1212 + def add_as_through(seed); end + + # source://activerecord//lib/active_record/reflection.rb#1260 + def association_class(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#985 + def association_foreign_key(*_arg0, **_arg1, &_arg2); end + + # We want to use the klass from this reflection, rather than just delegate straight to + # the source_reflection, because the source_reflection may be polymorphic. We still + # need to respect the source_reflection's :primary_key option, though. + # + # source://activerecord//lib/active_record/reflection.rb#1097 + def association_primary_key(klass = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/reflection.rb#1260 + def association_scope_cache(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1260 + def autosave=(arg); end + + # source://activerecord//lib/active_record/reflection.rb#1260 + def belongs_to?(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1260 + def check_eager_loadable!(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1154 + def check_validity!; end + + # This is for clearing cache on the reflection. Useful for tests that need to compare + # SQL queries on associations. + # + # source://activerecord//lib/active_record/reflection.rb#1069 + def clear_association_scope_cache; end + + # Returns an array of reflections which are involved in this association. Each item in the + # array corresponds to a table which will be part of the query for this association. + # + # The chain is built by recursively calling #chain on the source reflection and the through + # reflection. The base case for the recursion is a normal association, which just returns + # [self] as its #chain. + # + # class Post < ActiveRecord::Base + # has_many :taggings + # has_many :tags, through: :taggings + # end + # + # tags_reflection = Post.reflect_on_association(:tags) + # tags_reflection.chain + # # => [, + # ] + # + # source://activerecord//lib/active_record/reflection.rb#1063 + def collect_join_chain; end + + # source://activerecord//lib/active_record/reflection.rb#1260 + def collection?(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1260 + def compute_class(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1198 + def constraints; end + + # source://activerecord//lib/active_record/reflection.rb#1260 + def deprecated?(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1216 + def deprecated_nested_reflections; end + + # source://activerecord//lib/active_record/reflection.rb#1260 + def extensions(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#985 + def foreign_key(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#985 + def foreign_type(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1260 + def has_inverse?(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1260 + def has_one?(*_arg0, **_arg1, &_arg2); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/reflection.rb#1083 + def has_scope?; end + + # source://activerecord//lib/active_record/reflection.rb#985 + def join_foreign_key(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#985 + def join_id_for(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1107 + def join_primary_key(klass = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/reflection.rb#1260 + def join_primary_type(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1079 + def join_scopes(table, predicate_builder = T.unsafe(nil), klass = T.unsafe(nil), record = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/reflection.rb#1260 + def join_table(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1003 + def klass; end + + # source://activerecord//lib/active_record/reflection.rb#1260 + def macro(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1260 + def name(*_arg0, **_arg1, &_arg2); end + + # A through association is nested if there would be more than one join table + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/reflection.rb#1090 + def nested?; end + + # source://activerecord//lib/active_record/reflection.rb#1260 + def options(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1260 + def parent_reflection(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1260 + def parent_reflection=(arg); end + + # source://activerecord//lib/active_record/reflection.rb#1260 + def plural_name(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1260 + def polymorphic?(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1260 + def polymorphic_inverse_of(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1260 + def polymorphic_name(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1260 + def scope(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1260 + def scope_for(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1075 + def scopes; end + + # source://activerecord//lib/active_record/reflection.rb#1146 + def source_options; end + + # Returns the source of the through reflection. It checks both a singularized + # and pluralized form for :belongs_to or :has_many. + # + # class Post < ActiveRecord::Base + # has_many :taggings + # has_many :tags, through: :taggings + # end + # + # class Tagging < ActiveRecord::Base + # belongs_to :post + # belongs_to :tag + # end + # + # tags_reflection = Post.reflect_on_association(:tags) + # tags_reflection.source_reflection + # # => + # + # source://activerecord//lib/active_record/reflection.rb#1024 + def source_reflection; end + + # source://activerecord//lib/active_record/reflection.rb#1126 + def source_reflection_name; end + + # Gets an array of possible :through source reflection names in both singular and plural form. + # + # class Post < ActiveRecord::Base + # has_many :taggings + # has_many :tags, through: :taggings + # end + # + # tags_reflection = Post.reflect_on_association(:tags) + # tags_reflection.source_reflection_names + # # => [:tag, :tags] + # + # source://activerecord//lib/active_record/reflection.rb#1122 + def source_reflection_names; end + + # source://activerecord//lib/active_record/reflection.rb#1150 + def through_options; end + + # Returns the AssociationReflection object specified in the :through option + # of a HasManyThrough or HasOneThrough association. + # + # class Post < ActiveRecord::Base + # has_many :taggings + # has_many :tags, through: :taggings + # end + # + # tags_reflection = Post.reflect_on_association(:tags) + # tags_reflection.through_reflection + # # => + # + # source://activerecord//lib/active_record/reflection.rb#1042 + def through_reflection; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/reflection.rb#999 + def through_reflection?; end + + # source://activerecord//lib/active_record/reflection.rb#985 + def type(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/reflection.rb#1260 + def validate?(*_arg0, **_arg1, &_arg2); end + + protected + + # FIXME: this is a horrible name + # + # source://activerecord//lib/active_record/reflection.rb#1221 + def actual_source_reflection; end + + private + + # source://activerecord//lib/active_record/reflection.rb#1244 + def collect_deprecated_nested_reflections; end + + # source://activerecord//lib/active_record/reflection.rb#1228 + def collect_join_reflections(seed); end + + # Returns the value of attribute delegate_reflection. + # + # source://activerecord//lib/active_record/reflection.rb#1226 + def delegate_reflection; end + + # source://activerecord//lib/active_record/reflection.rb#1239 + def derive_class_name; end + + # source://activerecord//lib/active_record/reflection.rb#1237 + def inverse_name; end +end + +# = Active Record \Relation +# +# source://activerecord//lib/active_record/relation.rb#5 +class ActiveRecord::Relation + include ::Enumerable + include ::ActiveRecord::Delegation + include ::ActiveRecord::Explain + include ::ActiveRecord::Batches + include ::ActiveModel::ForbiddenAttributesProtection + include ::ActiveRecord::QueryMethods + include ::ActiveRecord::SpawnMethods + include ::ActiveRecord::Calculations + include ::ActiveRecord::FinderMethods + include ::ActiveRecord::TokenFor::RelationMethods + include ::ActiveRecord::SignedId::RelationMethods + extend ::ActiveRecord::Delegation::ClassMethods + + # @return [Relation] a new instance of Relation + # + # source://activerecord//lib/active_record/relation.rb#77 + def initialize(model, table: T.unsafe(nil), predicate_builder: T.unsafe(nil), values: T.unsafe(nil)); end + + # Compares two relations for equality. + # + # source://activerecord//lib/active_record/relation.rb#1273 + def ==(other); end + + # source://activerecord//lib/active_record/relation.rb#562 + def _exec_scope(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation.rb#1327 + def alias_tracker(joins = T.unsafe(nil), aliases = T.unsafe(nil)); end + + # Returns true if there are any records. + # + # When a pattern argument is given, this method checks whether elements in + # the Enumerable match the pattern via the case-equality operator (===). + # + # posts.any?(Post) # => true or false + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation.rb#401 + def any?(*args); end + + # @yield [attr, bind] + # + # source://activerecord//lib/active_record/relation.rb#102 + def bind_attribute(name, value); end + + # Returns true if relation is blank. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation.rb#1294 + def blank?; end + + # Initializes new record from relation while maintaining the current + # scope. + # + # Expects arguments in the same format as {ActiveRecord::Base.new}[rdoc-ref:Core.new]. + # + # users = User.where(name: 'DHH') + # user = users.new # => # + # + # You can also pass a block to new with the new record as argument: + # + # user = users.new { |user| user.name = 'Oscar' } + # user.name # => Oscar + # + # source://activerecord//lib/active_record/relation.rb#133 + def build(attributes = T.unsafe(nil), &block); end + + # Returns a stable cache key that can be used to identify this query. + # The cache key is built with a fingerprint of the SQL query. + # + # Product.where("name like ?", "%Cosmic Encounter%").cache_key + # # => "products/query-1850ab3d302391b85b8693e941286659" + # + # If ActiveRecord::Base.collection_cache_versioning is turned off, as it was + # in \Rails 6.0 and earlier, the cache key will also include a version. + # + # ActiveRecord::Base.collection_cache_versioning = false + # Product.where("name like ?", "%Cosmic Encounter%").cache_key + # # => "products/query-1850ab3d302391b85b8693e941286659-1-20150714212553907087000" + # + # You can also pass a custom timestamp column to fetch the timestamp of the + # last updated record. + # + # Product.where("name like ?", "%Game%").cache_key(:last_reviewed_at) + # + # source://activerecord//lib/active_record/relation.rb#448 + def cache_key(timestamp_column = T.unsafe(nil)); end + + # Returns a cache key along with the version. + # + # source://activerecord//lib/active_record/relation.rb#529 + def cache_key_with_version; end + + # Returns a cache version that can be used together with the cache key to form + # a recyclable caching scheme. The cache version is built with the number of records + # matching the query, and the timestamp of the last updated record. When a new record + # comes to match the query, or any of the existing records is updated or deleted, + # the cache version changes. + # + # If the collection is loaded, the method will iterate through the records + # to generate the timestamp, otherwise it will trigger one SQL query like: + # + # SELECT COUNT(*), MAX("products"."updated_at") FROM "products" WHERE (name like '%Cosmic Encounter%') + # + # source://activerecord//lib/active_record/relation.rb#475 + def cache_version(timestamp_column = T.unsafe(nil)); end + + # Tries to create a new record with the same scoped attributes + # defined in the relation. Returns the initialized object if validation fails. + # + # Expects arguments in the same format as + # {ActiveRecord::Base.create}[rdoc-ref:Persistence::ClassMethods#create]. + # + # ==== Examples + # + # users = User.where(name: 'Oscar') + # users.create # => # + # + # users.create(name: 'fxn') + # users.create # => # + # + # users.create { |user| user.name = 'tenderlove' } + # # => # + # + # users.create(name: nil) # validation on name + # # => # + # + # source://activerecord//lib/active_record/relation.rb#154 + def create(attributes = T.unsafe(nil), &block); end + + # Similar to #create, but calls + # {create!}[rdoc-ref:Persistence::ClassMethods#create!] + # on the base class. Raises an exception if a validation error occurs. + # + # Expects arguments in the same format as + # {ActiveRecord::Base.create!}[rdoc-ref:Persistence::ClassMethods#create!]. + # + # source://activerecord//lib/active_record/relation.rb#169 + def create!(attributes = T.unsafe(nil), &block); end + + # Attempts to create a record with the given attributes in a table that has a unique database constraint + # on one or several of its columns. If a row already exists with one or several of these + # unique constraints, the exception such an insertion would normally raise is caught, + # and the existing record with those attributes is found using #find_by!. + # + # This is similar to #find_or_create_by, but tries to create the record first. As such it is + # better suited for cases where the record is most likely not to exist yet. + # + # There are several drawbacks to #create_or_find_by, though: + # + # * The underlying table must have the relevant columns defined with unique database constraints. + # * A unique constraint violation may be triggered by only one, or at least less than all, + # of the given attributes. This means that the subsequent #find_by! may fail to find a + # matching record, which will then raise an ActiveRecord::RecordNotFound exception, + # rather than a record with the given attributes. + # * While we avoid the race condition between SELECT -> INSERT from #find_or_create_by, + # we actually have another race condition between INSERT -> SELECT, which can be triggered + # if a DELETE between those two statements is run by another client. But for most applications, + # that's a significantly less likely condition to hit. + # * It relies on exception handling to handle control flow, which may be marginally slower. + # * The primary key may auto-increment on each create, even if it fails. This can accelerate + # the problem of running out of integers, if the underlying table is still stuck on a primary + # key of type int (note: All \Rails apps since 5.1+ have defaulted to bigint, which is not liable + # to this problem). + # * Columns with unique database constraints should not have uniqueness validations defined, + # otherwise #create will fail due to validation errors and #find_by will never be called. + # + # This method will return a record if all given attributes are covered by unique constraints + # (unless the INSERT -> DELETE -> SELECT race condition is triggered), but if creation was attempted + # and failed due to validation errors it won't be persisted, you get what #create returns in + # such situation. + # + # source://activerecord//lib/active_record/relation.rb#273 + def create_or_find_by(attributes, &block); end + + # Like #create_or_find_by, but calls + # {create!}[rdoc-ref:Persistence::ClassMethods#create!] so an exception + # is raised if the created record is invalid. + # + # source://activerecord//lib/active_record/relation.rb#293 + def create_or_find_by!(attributes, &block); end + + # Deletes the row with a primary key matching the +id+ argument, using an + # SQL +DELETE+ statement, and returns the number of rows deleted. Active + # Record objects are not instantiated, so the object's callbacks are not + # executed, including any :dependent association options. + # + # You can delete multiple rows at once by passing an Array of ids. + # + # Note: Although it is often much faster than the alternative, #destroy, + # skipping callbacks might bypass business logic in your application + # that ensures referential integrity or performs other essential jobs. + # + # ==== Examples + # + # # Delete a single row + # Todo.delete(1) + # + # # Delete multiple rows + # Todo.delete([2,3,4]) + # + # source://activerecord//lib/active_record/relation.rb#1077 + def delete(id_or_array); end + + # Deletes the records without instantiating the records + # first, and hence not calling the {#destroy}[rdoc-ref:Persistence#destroy] + # method nor invoking callbacks. + # This is a single SQL DELETE statement that goes straight to the database, much more + # efficient than #destroy_all. Be careful with relations though, in particular + # :dependent rules defined on associations are not honored. Returns the + # number of rows affected. + # + # Post.where(person_id: 5).where(category: ['Something', 'Else']).delete_all + # + # Both calls delete the affected posts all at once with a single DELETE statement. + # If you need to destroy dependent associations or call your before_* or + # +after_destroy+ callbacks, use the #destroy_all method instead. + # + # If an invalid method is supplied, #delete_all raises an ActiveRecordError: + # + # Post.distinct.delete_all + # # => ActiveRecord::ActiveRecordError: delete_all doesn't support distinct + # + # source://activerecord//lib/active_record/relation.rb#1033 + def delete_all; end + + # Finds and deletes all records matching the specified conditions. + # This is short-hand for relation.where(condition).delete_all. + # Returns the number of rows affected. + # + # If no record is found, returns 0 as zero rows were affected. + # + # Person.delete_by(id: 13) + # Person.delete_by(name: 'Spartacus', rating: 4) + # Person.delete_by("published_at < ?", 2.weeks.ago) + # + # source://activerecord//lib/active_record/relation.rb#1139 + def delete_by(*args); end + + # Destroy an object (or multiple objects) that has the given id. The object is instantiated first, + # therefore all callbacks and filters are fired off before the object is deleted. This method is + # less efficient than #delete but allows cleanup methods and other actions to be run. + # + # This essentially finds the object (or multiple objects) with the given id, creates a new object + # from the attributes, and then calls destroy on it. + # + # ==== Parameters + # + # * +id+ - This should be the id or an array of ids to be destroyed. + # + # ==== Examples + # + # # Destroy a single object + # Todo.destroy(1) + # + # # Destroy multiple objects + # todos = [1,2,3] + # Todo.destroy(todos) + # + # source://activerecord//lib/active_record/relation.rb#1103 + def destroy(id); end + + # Destroys the records by instantiating each + # record and calling its {#destroy}[rdoc-ref:Persistence#destroy] method. + # Each object's callbacks are executed (including :dependent association options). + # Returns the collection of objects that were destroyed; each will be frozen, to + # reflect that no changes should be made (since they can't be persisted). + # + # Note: Instantiation, callback execution, and deletion of each + # record can be time consuming when you're removing many records at + # once. It generates at least one SQL +DELETE+ query per record (or + # possibly more, to enforce your callbacks). If you want to delete many + # rows quickly, without concern for their associations or callbacks, use + # #delete_all instead. + # + # ==== Examples + # + # Person.where(age: 0..18).destroy_all + # + # source://activerecord//lib/active_record/relation.rb#1011 + def destroy_all; end + + # Finds and destroys all records matching the specified conditions. + # This is short-hand for relation.where(condition).destroy_all. + # Returns the collection of objects that were destroyed. + # + # If no record is found, returns empty array. + # + # Person.destroy_by(id: 13) + # Person.destroy_by(name: 'Spartacus', rating: 4) + # Person.destroy_by("published_at < ?", 2.weeks.ago) + # + # source://activerecord//lib/active_record/relation.rb#1126 + def destroy_by(*args); end + + # Returns true if relation needs eager loading. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation.rb#1258 + def eager_loading?; end + + # Returns true if there are no records. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation.rb#372 + def empty?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation.rb#1319 + def empty_scope?; end + + # Serializes the relation objects Array. + # + # source://activerecord//lib/active_record/relation.rb#358 + def encode_with(coder); end + + # Runs EXPLAIN on the query or queries triggered by this relation and + # returns the result as a string. The string is formatted imitating the + # ones printed by the database shell. + # + # User.all.explain + # # EXPLAIN SELECT `users`.* FROM `users` + # # ... + # + # Note that this method actually runs the queries, since the results of some + # are needed by the next ones when eager loading is going on. + # + # To run EXPLAIN on queries created by +first+, +pluck+ and +count+, call + # these methods on +explain+: + # + # User.all.explain.count + # # EXPLAIN SELECT COUNT(*) FROM `users` + # # ... + # + # The column name can be passed if required: + # + # User.all.explain.maximum(:id) + # # EXPLAIN SELECT MAX(`users`.`id`) FROM `users` + # # ... + # + # Please see further details in the + # {Active Record Query Interface guide}[https://guides.rubyonrails.org/active_record_querying.html#running-explain]. + # + # source://activerecord//lib/active_record/relation.rb#342 + def explain(*options); end + + # Finds the first record with the given attributes, or creates a record + # with the attributes if one is not found: + # + # # Find the first user named "Penélope" or create a new one. + # User.find_or_create_by(first_name: 'Penélope') + # # => # + # + # # Find the first user named "Penélope" or create a new one. + # # We already have one so the existing record will be returned. + # User.find_or_create_by(first_name: 'Penélope') + # # => # + # + # # Find the first user named "Scarlett" or create a new one with + # # a particular last name. + # User.create_with(last_name: 'Johansson').find_or_create_by(first_name: 'Scarlett') + # # => # + # + # This method accepts a block, which is passed down to #create. The last example + # above can be alternatively written this way: + # + # # Find the first user named "Scarlett" or create a new one with a + # # particular last name. + # User.find_or_create_by(first_name: 'Scarlett') do |user| + # user.last_name = 'Johansson' + # end + # # => # + # + # This method always returns a record, but if creation was attempted and + # failed due to validation errors it won't be persisted, you get what + # #create returns in such situation. + # + # If creation failed because of a unique constraint, this method will + # assume it encountered a race condition and will try finding the record + # once more. If somehow the second find still does not find a record + # because a concurrent DELETE happened, it will then raise an + # ActiveRecord::RecordNotFound exception. + # + # Please note this method is not atomic, it runs first a SELECT, + # and if there are no results an INSERT is attempted. So if the table + # doesn't have a relevant unique constraint it could be the case that + # you end up with two or more similar records. + # + # source://activerecord//lib/active_record/relation.rb#231 + def find_or_create_by(attributes, &block); end + + # Like #find_or_create_by, but calls + # {create!}[rdoc-ref:Persistence::ClassMethods#create!] so an exception + # is raised if the created record is invalid. + # + # source://activerecord//lib/active_record/relation.rb#238 + def find_or_create_by!(attributes, &block); end + + # Like #find_or_create_by, but calls {new}[rdoc-ref:Core.new] + # instead of {create}[rdoc-ref:Persistence::ClassMethods#create]. + # + # source://activerecord//lib/active_record/relation.rb#312 + def find_or_initialize_by(attributes, &block); end + + # source://activerecord//lib/active_record/relation.rb#178 + def first_or_create(attributes = T.unsafe(nil), &block); end + + # source://activerecord//lib/active_record/relation.rb#182 + def first_or_create!(attributes = T.unsafe(nil), &block); end + + # source://activerecord//lib/active_record/relation.rb#186 + def first_or_initialize(attributes = T.unsafe(nil), &block); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation.rb#1323 + def has_limit_or_offset?; end + + # Inserts a single record into the database in a single SQL INSERT + # statement. It does not instantiate any models nor does it trigger + # Active Record callbacks or validations. Though passed values + # go through Active Record's type casting and serialization. + # + # See #insert_all for documentation. + # + # source://activerecord//lib/active_record/relation.rb#664 + def insert(attributes, returning: T.unsafe(nil), unique_by: T.unsafe(nil), record_timestamps: T.unsafe(nil)); end + + # Inserts a single record into the database in a single SQL INSERT + # statement. It does not instantiate any models nor does it trigger + # Active Record callbacks or validations. Though passed values + # go through Active Record's type casting and serialization. + # + # See #insert_all! for more. + # + # source://activerecord//lib/active_record/relation.rb#753 + def insert!(attributes, returning: T.unsafe(nil), record_timestamps: T.unsafe(nil)); end + + # Inserts multiple records into the database in a single SQL INSERT + # statement. It does not instantiate any models nor does it trigger + # Active Record callbacks or validations. Though passed values + # go through Active Record's type casting and serialization. + # + # The +attributes+ parameter is an Array of Hashes. Every Hash determines + # the attributes for a single row and must have the same keys. + # + # Rows are considered to be unique by every unique index on the table. Any + # duplicate rows are skipped. + # Override with :unique_by (see below). + # + # Returns an ActiveRecord::Result with its contents based on + # :returning (see below). + # + # ==== Options + # + # [:returning] + # (PostgreSQL, SQLite3, and MariaDB only) An array of attributes to return for all successfully + # inserted records, which by default is the primary key. + # Pass returning: %w[ id name ] for both id and name + # or returning: false to omit the underlying RETURNING SQL + # clause entirely. + # + # You can also pass an SQL string if you need more control on the return values + # (for example, returning: Arel.sql("id, name as new_name")). + # + # [:unique_by] + # (PostgreSQL and SQLite only) By default rows are considered to be unique + # by every unique index on the table. Any duplicate rows are skipped. + # + # To skip rows according to just one unique index pass :unique_by. + # + # Consider a Book model where no duplicate ISBNs make sense, but if any + # row has an existing id, or is not unique by another unique index, + # ActiveRecord::RecordNotUnique is raised. + # + # Unique indexes can be identified by columns or name: + # + # unique_by: :isbn + # unique_by: %i[ author_id name ] + # unique_by: :index_books_on_isbn + # + # [:record_timestamps] + # By default, automatic setting of timestamp columns is controlled by + # the model's record_timestamps config, matching typical + # behavior. + # + # To override this and force automatic setting of timestamp columns one + # way or the other, pass :record_timestamps: + # + # record_timestamps: true # Always set timestamps automatically + # record_timestamps: false # Never set timestamps automatically + # + # Because it relies on the index information from the database + # :unique_by is recommended to be paired with + # Active Record's schema_cache. + # + # ==== Example + # + # # Insert records and skip inserting any duplicates. + # # Here "Eloquent Ruby" is skipped because its id is not unique. + # + # Book.insert_all([ + # { id: 1, title: "Rework", author: "David" }, + # { id: 1, title: "Eloquent Ruby", author: "Russ" } + # ]) + # + # # insert_all works on chained scopes, and you can use create_with + # # to set default attributes for all inserted records. + # + # author.books.create_with(created_at: Time.now).insert_all([ + # { id: 1, title: "Rework" }, + # { id: 2, title: "Eloquent Ruby" } + # ]) + # + # source://activerecord//lib/active_record/relation.rb#743 + def insert_all(attributes, returning: T.unsafe(nil), unique_by: T.unsafe(nil), record_timestamps: T.unsafe(nil)); end + + # Inserts multiple records into the database in a single SQL INSERT + # statement. It does not instantiate any models nor does it trigger + # Active Record callbacks or validations. Though passed values + # go through Active Record's type casting and serialization. + # + # The +attributes+ parameter is an Array of Hashes. Every Hash determines + # the attributes for a single row and must have the same keys. + # + # Raises ActiveRecord::RecordNotUnique if any rows violate a + # unique index on the table. In that case, no rows are inserted. + # + # To skip duplicate rows, see #insert_all. To replace them, see #upsert_all. + # + # Returns an ActiveRecord::Result with its contents based on + # :returning (see below). + # + # ==== Options + # + # [:returning] + # (PostgreSQL, SQLite3, and MariaDB only) An array of attributes to return for all successfully + # inserted records, which by default is the primary key. + # Pass returning: %w[ id name ] for both id and name + # or returning: false to omit the underlying RETURNING SQL + # clause entirely. + # + # You can also pass an SQL string if you need more control on the return values + # (for example, returning: Arel.sql("id, name as new_name")). + # + # [:record_timestamps] + # By default, automatic setting of timestamp columns is controlled by + # the model's record_timestamps config, matching typical + # behavior. + # + # To override this and force automatic setting of timestamp columns one + # way or the other, pass :record_timestamps: + # + # record_timestamps: true # Always set timestamps automatically + # record_timestamps: false # Never set timestamps automatically + # + # ==== Examples + # + # # Insert multiple records + # Book.insert_all!([ + # { title: "Rework", author: "David" }, + # { title: "Eloquent Ruby", author: "Russ" } + # ]) + # + # # Raises ActiveRecord::RecordNotUnique because "Eloquent Ruby" + # # does not have a unique id. + # Book.insert_all!([ + # { id: 1, title: "Rework", author: "David" }, + # { id: 1, title: "Eloquent Ruby", author: "Russ" } + # ]) + # + # source://activerecord//lib/active_record/relation.rb#810 + def insert_all!(attributes, returning: T.unsafe(nil), record_timestamps: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation.rb#1310 + def inspect; end + + # Joins that are also marked for preloading. In which case we should just eager load them. + # Note that this is a naive implementation because we could have strings and symbols which + # represent the same association, but that aren't matched by this. Also, we could have + # nested hashes which partially match, e.g. { a: :b } & { a: [:b, :c] } + # + # source://activerecord//lib/active_record/relation.rb#1268 + def joined_includes_values; end + + # Returns the value of attribute model. + # + # source://activerecord//lib/active_record/relation.rb#73 + def klass; end + + # Causes the records to be loaded from the database if they have not + # been loaded already. You can use this if for some reason you need + # to explicitly load some records before actually using them. The + # return value is the relation itself, not the records. + # + # Post.where(published: true).load # => # + # + # source://activerecord//lib/active_record/relation.rb#1199 + def load(&block); end + + # Schedule the query to be performed from a background thread pool. + # + # Post.where(published: true).load_async # => # + # + # When the +Relation+ is iterated, if the background query wasn't executed yet, + # it will be performed by the foreground thread. + # + # Note that {config.active_record.async_query_executor}[https://guides.rubyonrails.org/configuring.html#config-active-record-async-query-executor] must be configured + # for queries to actually be executed concurrently. Otherwise it defaults to + # executing them in the foreground. + # + # If the query was actually executed in the background, the Active Record logs will show + # it by prefixing the log line with ASYNC: + # + # ASYNC Post Load (0.0ms) (db time 2ms) SELECT "posts".* FROM "posts" LIMIT 100 + # + # source://activerecord//lib/active_record/relation.rb#1158 + def load_async; end + + # Returns the value of attribute loaded. + # + # source://activerecord//lib/active_record/relation.rb#71 + def loaded; end + + # Returns the value of attribute loaded. + # + # source://activerecord//lib/active_record/relation.rb#74 + def loaded?; end + + # source://activerecord//lib/active_record/relation.rb#75 + def locked?; end + + # Returns true if there is more than one record. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation.rb#423 + def many?; end + + # Returns the value of attribute model. + # + # source://activerecord//lib/active_record/relation.rb#71 + def model; end + + # Initializes new record from relation while maintaining the current + # scope. + # + # Expects arguments in the same format as {ActiveRecord::Base.new}[rdoc-ref:Core.new]. + # + # users = User.where(name: 'DHH') + # user = users.new # => # + # + # You can also pass a block to new with the new record as argument: + # + # user = users.new { |user| user.name = 'Oscar' } + # user.name # => Oscar + # + # source://activerecord//lib/active_record/relation.rb#125 + def new(attributes = T.unsafe(nil), &block); end + + # Returns true if there are no records. + # + # When a pattern argument is given, this method checks whether elements in + # the Enumerable match the pattern via the case-equality operator (===). + # + # posts.none?(Comment) # => true or false + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation.rb#388 + def none?(*args); end + + # Returns true if there is exactly one record. + # + # When a pattern argument is given, this method checks whether elements in + # the Enumerable match the pattern via the case-equality operator (===). + # + # posts.one?(Post) # => true or false + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation.rb#414 + def one?(*args); end + + # Returns the value of attribute predicate_builder. + # + # source://activerecord//lib/active_record/relation.rb#71 + def predicate_builder; end + + # source://activerecord//lib/active_record/relation.rb#1341 + def preload_associations(records); end + + # source://activerecord//lib/active_record/relation.rb#1284 + def pretty_print(pp); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation.rb#1298 + def readonly?; end + + # source://activerecord//lib/active_record/relation.rb#352 + def records; end + + # Forces reloading of relation. + # + # source://activerecord//lib/active_record/relation.rb#1209 + def reload; end + + # source://activerecord//lib/active_record/relation.rb#1214 + def reset; end + + # Returns true if the relation was scheduled on the background + # thread pool. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation.rb#1189 + def scheduled?; end + + # source://activerecord//lib/active_record/relation.rb#1251 + def scope_for_create; end + + # Scope all queries to the current scope. + # + # Comment.where(post_id: 1).scoping do + # Comment.first + # end + # # SELECT "comments".* FROM "comments" WHERE "comments"."post_id" = 1 ORDER BY "comments"."id" ASC LIMIT 1 + # + # If all_queries: true is passed, scoping will apply to all queries + # for the relation including +update+ and +delete+ on instances. + # Once +all_queries+ is set to true it cannot be set to false in a + # nested block. + # + # Please check unscoped if you want to remove all previous scopes (including + # the default_scope) during the execution of a block. + # + # source://activerecord//lib/active_record/relation.rb#551 + def scoping(all_queries: T.unsafe(nil), &block); end + + # Returns size of the records. + # + # source://activerecord//lib/active_record/relation.rb#363 + def size; end + + # Returns the value of attribute skip_preloading_value. + # + # source://activerecord//lib/active_record/relation.rb#72 + def skip_preloading_value; end + + # Sets the attribute skip_preloading_value + # + # @param value the value to set the attribute skip_preloading_value to. + # + # source://activerecord//lib/active_record/relation.rb#72 + def skip_preloading_value=(_arg0); end + + # Returns the value of attribute table. + # + # source://activerecord//lib/active_record/relation.rb#71 + def table; end + + # source://activerecord//lib/active_record/relation.rb#1177 + def then(&block); end + + # Converts relation objects to Array. + # + # source://activerecord//lib/active_record/relation.rb#350 + def to_a; end + + # Converts relation objects to Array. + # + # source://activerecord//lib/active_record/relation.rb#347 + def to_ary; end + + # Returns sql statement for the relation. + # + # User.where(name: 'Oscar').to_sql + # # SELECT "users".* FROM "users" WHERE "users"."name" = 'Oscar' + # + # source://activerecord//lib/active_record/relation.rb#1230 + def to_sql; end + + # Touches all records in the current relation, setting the +updated_at+/+updated_on+ attributes to the current time or the time specified. + # It does not instantiate the involved models, and it does not trigger Active Record callbacks or validations. + # This method can be passed attribute names and an optional time argument. + # If attribute names are passed, they are updated along with +updated_at+/+updated_on+ attributes. + # If no time argument is passed, the current time is used as default. + # + # ==== Examples + # + # # Touch all records + # Person.all.touch_all + # # => "UPDATE \"people\" SET \"updated_at\" = '2018-01-04 22:55:23.132670'" + # + # # Touch multiple records with a custom attribute + # Person.all.touch_all(:created_at) + # # => "UPDATE \"people\" SET \"updated_at\" = '2018-01-04 22:55:23.132670', \"created_at\" = '2018-01-04 22:55:23.132670'" + # + # # Touch multiple records with a specified time + # Person.all.touch_all(time: Time.new(2020, 5, 16, 0, 0, 0)) + # # => "UPDATE \"people\" SET \"updated_at\" = '2020-05-16 00:00:00'" + # + # # Touch records with scope + # Person.where(name: 'David').touch_all + # # => "UPDATE \"people\" SET \"updated_at\" = '2018-01-04 22:55:23.132670' WHERE \"people\".\"name\" = 'David'" + # + # source://activerecord//lib/active_record/relation.rb#991 + def touch_all(*names, time: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation.rb#641 + def update(id = T.unsafe(nil), attributes); end + + # source://activerecord//lib/active_record/relation.rb#649 + def update!(id = T.unsafe(nil), attributes); end + + # Updates all records in the current relation with details given. This method constructs a single SQL UPDATE + # statement and sends it straight to the database. It does not instantiate the involved models and it does not + # trigger Active Record callbacks or validations. However, values passed to #update_all will still go through + # Active Record's normal type casting and serialization. Returns the number of rows affected. + # + # Note: As Active Record callbacks are not triggered, this method will not automatically update +updated_at+/+updated_on+ columns. + # + # ==== Parameters + # + # * +updates+ - A string, array, or hash representing the SET part of an SQL statement. Any strings provided will + # be type cast, unless you use +Arel.sql+. (Don't pass user-provided values to +Arel.sql+.) + # + # ==== Examples + # + # # Update all customers with the given attributes + # Customer.update_all wants_email: true + # + # # Update all books with 'Rails' in their title + # Book.where('title LIKE ?', '%Rails%').update_all(author: 'David') + # + # # Update all books that match conditions, but limit it to 5 ordered by date + # Book.where('title LIKE ?', '%Rails%').order(:created_at).limit(5).update_all(author: 'David') + # + # # Update all invoices and set the number column to its id value. + # Invoice.update_all('number = id') + # + # # Update all books with 'Rails' in their title + # Book.where('title LIKE ?', '%Rails%').update_all(title: Arel.sql("title + ' - volume 1'")) + # + # @raise [ArgumentError] + # + # source://activerecord//lib/active_record/relation.rb#598 + def update_all(updates); end + + # Updates the counters of the records in the current relation. + # + # ==== Parameters + # + # * +counter+ - A Hash containing the names of the fields to update as keys and the amount to update as values. + # * :touch option - Touch the timestamp columns when updating. + # * If attributes names are passed, they are updated along with update_at/on attributes. + # + # ==== Examples + # + # # For Posts by a given author increment the comment_count by 1. + # Post.where(author_id: author.id).update_counters(comment_count: 1) + # + # source://activerecord//lib/active_record/relation.rb#948 + def update_counters(counters); end + + # Updates or inserts (upserts) a single record into the database in a + # single SQL INSERT statement. It does not instantiate any models nor does + # it trigger Active Record callbacks or validations. Though passed values + # go through Active Record's type casting and serialization. + # + # See #upsert_all for documentation. + # + # source://activerecord//lib/active_record/relation.rb#820 + def upsert(attributes, **kwargs); end + + # Updates or inserts (upserts) multiple records into the database in a + # single SQL INSERT statement. It does not instantiate any models nor does + # it trigger Active Record callbacks or validations. Though passed values + # go through Active Record's type casting and serialization. + # + # The +attributes+ parameter is an Array of Hashes. Every Hash determines + # the attributes for a single row and must have the same keys. + # + # Returns an ActiveRecord::Result with its contents based on + # :returning (see below). + # + # By default, +upsert_all+ will update all the columns that can be updated when + # there is a conflict. These are all the columns except primary keys, read-only + # columns, and columns covered by the optional +unique_by+. + # + # ==== Options + # + # [:returning] + # (PostgreSQL, SQLite3, and MariaDB only) An array of attributes to return for all successfully + # upserted records, which by default is the primary key. + # Pass returning: %w[ id name ] for both id and name + # or returning: false to omit the underlying RETURNING SQL + # clause entirely. + # + # You can also pass an SQL string if you need more control on the return values + # (for example, returning: Arel.sql("id, name as new_name")). + # + # [:unique_by] + # (PostgreSQL and SQLite only) By default rows are considered to be unique + # by every unique index on the table. Any duplicate rows are skipped. + # + # To skip rows according to just one unique index pass :unique_by. + # + # Consider a Book model where no duplicate ISBNs make sense, but if any + # row has an existing id, or is not unique by another unique index, + # ActiveRecord::RecordNotUnique is raised. + # + # Unique indexes can be identified by columns or name: + # + # unique_by: :isbn + # unique_by: %i[ author_id name ] + # unique_by: :index_books_on_isbn + # + # Because it relies on the index information from the database + # :unique_by is recommended to be paired with + # Active Record's schema_cache. + # + # [:on_duplicate] + # Configure the behavior that will be used in case of conflict. Use `:skip` + # to ignore any conflicts or provide a safe SQL fragment wrapped with + # `Arel.sql`. + # + # NOTE: If you use this option you must provide all the columns you want to update + # by yourself. + # + # Example: + # + # Commodity.upsert_all( + # [ + # { id: 2, name: "Copper", price: 4.84 }, + # { id: 4, name: "Gold", price: 1380.87 }, + # { id: 6, name: "Aluminium", price: 0.35 } + # ], + # on_duplicate: Arel.sql("price = GREATEST(commodities.price, EXCLUDED.price)") + # ) + # + # See the related +:update_only+ option. Both options can't be used at the same time. + # + # [:update_only] + # Provide a list of column names that will be updated in case of conflict. If not provided, + # +upsert_all+ will update all the columns that can be updated. These are all the columns + # except primary keys, read-only columns, and columns covered by the optional +unique_by+ + # + # Example: + # + # Commodity.upsert_all( + # [ + # { id: 2, name: "Copper", price: 4.84 }, + # { id: 4, name: "Gold", price: 1380.87 }, + # { id: 6, name: "Aluminium", price: 0.35 } + # ], + # update_only: [:price] # Only prices will be updated + # ) + # + # See the related +:on_duplicate+ option. Both options can't be used at the same time. + # + # [:record_timestamps] + # By default, automatic setting of timestamp columns is controlled by + # the model's record_timestamps config, matching typical + # behavior. + # + # To override this and force automatic setting of timestamp columns one + # way or the other, pass :record_timestamps: + # + # record_timestamps: true # Always set timestamps automatically + # record_timestamps: false # Never set timestamps automatically + # + # ==== Examples + # + # # Inserts multiple records, performing an upsert when records have duplicate ISBNs. + # # Here "Eloquent Ruby" overwrites "Rework" because its ISBN is duplicate. + # + # Book.upsert_all([ + # { title: "Rework", author: "David", isbn: "1" }, + # { title: "Eloquent Ruby", author: "Russ", isbn: "1" } + # ], unique_by: :isbn) + # + # Book.find_by(isbn: "1").title # => "Eloquent Ruby" + # + # source://activerecord//lib/active_record/relation.rb#932 + def upsert_all(attributes, on_duplicate: T.unsafe(nil), update_only: T.unsafe(nil), returning: T.unsafe(nil), unique_by: T.unsafe(nil), record_timestamps: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation.rb#1302 + def values; end + + # source://activerecord//lib/active_record/relation.rb#1306 + def values_for_queries; end + + # Returns a hash of where conditions. + # + # User.where(name: 'Oscar').where_values_hash + # # => {name: "Oscar"} + # + # source://activerecord//lib/active_record/relation.rb#1247 + def where_values_hash(relation_table_name = T.unsafe(nil)); end + + protected + + # source://activerecord//lib/active_record/relation.rb#1351 + def load_records(records); end + + private + + # source://activerecord//lib/active_record/relation.rb#1377 + def _create(attributes, &block); end + + # source://activerecord//lib/active_record/relation.rb#1381 + def _create!(attributes, &block); end + + # source://activerecord//lib/active_record/relation.rb#1416 + def _increment_attribute(attribute, value = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation.rb#1373 + def _new(attributes, &block); end + + # source://activerecord//lib/active_record/relation.rb#1385 + def _scoping(scope, registry, all_queries = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation.rb#1401 + def _substitute_values(values); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation.rb#1357 + def already_in_scope?(registry); end + + # source://activerecord//lib/active_record/relation.rb#453 + def compute_cache_key(timestamp_column = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation.rb#482 + def compute_cache_version(timestamp_column); end + + # source://activerecord//lib/active_record/relation.rb#1365 + def current_scope_restoring_block(&block); end + + # source://activerecord//lib/active_record/relation.rb#1447 + def exec_main_query(async: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation.rb#1423 + def exec_queries(&block); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation.rb#1361 + def global_scope?(registry); end + + # source://activerecord//lib/active_record/relation.rb#97 + def initialize_copy(other); end + + # source://activerecord//lib/active_record/relation.rb#1479 + def instantiate_records(rows, &block); end + + # source://activerecord//lib/active_record/relation.rb#1522 + def limited_count; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation.rb#1498 + def references_eager_loaded_tables?; end + + # source://activerecord//lib/active_record/relation.rb#1490 + def skip_query_cache_if_necessary(&block); end + + # source://activerecord//lib/active_record/relation.rb#1515 + def tables_in_string(string); end +end + +# source://activerecord//lib/active_record/relation.rb#62 +ActiveRecord::Relation::CLAUSE_METHODS = T.let(T.unsafe(nil), Array) + +# source://activerecord//lib/active_record/relation.rb#6 +class ActiveRecord::Relation::ExplainProxy + # @return [ExplainProxy] a new instance of ExplainProxy + # + # source://activerecord//lib/active_record/relation.rb#7 + def initialize(relation, options); end + + # source://activerecord//lib/active_record/relation.rb#16 + def average(column_name); end + + # source://activerecord//lib/active_record/relation.rb#20 + def count(column_name = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation.rb#24 + def first(limit = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation.rb#12 + def inspect; end + + # source://activerecord//lib/active_record/relation.rb#28 + def last(limit = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation.rb#32 + def maximum(column_name); end + + # source://activerecord//lib/active_record/relation.rb#36 + def minimum(column_name); end + + # source://activerecord//lib/active_record/relation.rb#40 + def pluck(*column_names); end + + # source://activerecord//lib/active_record/relation.rb#44 + def sum(identity_or_column = T.unsafe(nil)); end + + private + + # source://activerecord//lib/active_record/relation.rb#49 + def exec_explain(&block); end +end + +# source://activerecord//lib/active_record/relation/from_clause.rb#5 +class ActiveRecord::Relation::FromClause + # @return [FromClause] a new instance of FromClause + # + # source://activerecord//lib/active_record/relation/from_clause.rb#8 + def initialize(value, name); end + + # source://activerecord//lib/active_record/relation/from_clause.rb#21 + def ==(other); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation/from_clause.rb#17 + def empty?; end + + # source://activerecord//lib/active_record/relation/from_clause.rb#13 + def merge(other); end + + # Returns the value of attribute name. + # + # source://activerecord//lib/active_record/relation/from_clause.rb#6 + def name; end + + # Returns the value of attribute value. + # + # source://activerecord//lib/active_record/relation/from_clause.rb#6 + def value; end + + class << self + # source://activerecord//lib/active_record/relation/from_clause.rb#25 + def empty; end + end +end + +# source://activerecord//lib/active_record/relation/merger.rb#7 +class ActiveRecord::Relation::HashMerger + # @return [HashMerger] a new instance of HashMerger + # + # source://activerecord//lib/active_record/relation/merger.rb#10 + def initialize(relation, hash); end + + # Returns the value of attribute hash. + # + # source://activerecord//lib/active_record/relation/merger.rb#8 + def hash; end + + # source://activerecord//lib/active_record/relation/merger.rb#17 + def merge; end + + # Applying values to a relation has some side effects. E.g. + # interpolation might take place for where values. So we should + # build a relation to merge in rather than directly merging + # the values. + # + # source://activerecord//lib/active_record/relation/merger.rb#25 + def other; end + + # Returns the value of attribute relation. + # + # source://activerecord//lib/active_record/relation/merger.rb#8 + def relation; end +end + +# source://activerecord//lib/active_record/relation.rb#63 +ActiveRecord::Relation::INVALID_METHODS_FOR_UPDATE_AND_DELETE_ALL = T.let(T.unsafe(nil), Array) + +# source://activerecord//lib/active_record/relation.rb#54 +ActiveRecord::Relation::MULTI_VALUE_METHODS = T.let(T.unsafe(nil), Array) + +# source://activerecord//lib/active_record/relation/merger.rb#43 +class ActiveRecord::Relation::Merger + # @return [Merger] a new instance of Merger + # + # source://activerecord//lib/active_record/relation/merger.rb#46 + def initialize(relation, other); end + + # source://activerecord//lib/active_record/relation/merger.rb#58 + def merge; end + + # Returns the value of attribute other. + # + # source://activerecord//lib/active_record/relation/merger.rb#44 + def other; end + + # Returns the value of attribute relation. + # + # source://activerecord//lib/active_record/relation/merger.rb#44 + def relation; end + + # Returns the value of attribute values. + # + # source://activerecord//lib/active_record/relation/merger.rb#44 + def values; end + + private + + # source://activerecord//lib/active_record/relation/merger.rb#176 + def merge_clauses; end + + # source://activerecord//lib/active_record/relation/merger.rb#117 + def merge_joins; end + + # source://activerecord//lib/active_record/relation/merger.rb#155 + def merge_multi_values; end + + # source://activerecord//lib/active_record/relation/merger.rb#136 + def merge_outer_joins; end + + # source://activerecord//lib/active_record/relation/merger.rb#96 + def merge_preloads; end + + # source://activerecord//lib/active_record/relation/merger.rb#84 + def merge_select_values; end + + # source://activerecord//lib/active_record/relation/merger.rb#168 + def merge_single_values; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation/merger.rb#186 + def replace_from_clause?; end +end + +# source://activerecord//lib/active_record/relation/merger.rb#52 +ActiveRecord::Relation::Merger::NORMAL_VALUES = T.let(T.unsafe(nil), Array) + +# source://activerecord//lib/active_record/relation/query_attribute.rb#7 +class ActiveRecord::Relation::QueryAttribute < ::ActiveModel::Attribute + # @return [QueryAttribute] a new instance of QueryAttribute + # + # source://activerecord//lib/active_record/relation/query_attribute.rb#8 + def initialize(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/query_attribute.rb#55 + def ==(other); end + + # source://activerecord//lib/active_record/relation/query_attribute.rb#58 + def eql?(other); end + + # source://activerecord//lib/active_record/relation/query_attribute.rb#60 + def hash; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation/query_attribute.rb#44 + def infinite?; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation/query_attribute.rb#37 + def nil?; end + + # source://activerecord//lib/active_record/relation/query_attribute.rb#24 + def type_cast(value); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation/query_attribute.rb#48 + def unboundable?; end + + # source://activerecord//lib/active_record/relation/query_attribute.rb#28 + def value_for_database; end + + # source://activerecord//lib/active_record/relation/query_attribute.rb#33 + def with_cast_value(value); end + + private + + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation/query_attribute.rb#65 + def infinity?(value); end +end + +# source://activerecord//lib/active_record/relation.rb#59 +ActiveRecord::Relation::SINGLE_VALUE_METHODS = T.let(T.unsafe(nil), Array) + +# source://activerecord//lib/active_record/relation.rb#1331 +class ActiveRecord::Relation::StrictLoadingScope + class << self + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation.rb#1332 + def empty_scope?; end + + # source://activerecord//lib/active_record/relation.rb#1336 + def strict_loading_value; end + end +end + +# source://activerecord//lib/active_record/relation.rb#65 +ActiveRecord::Relation::VALUE_METHODS = T.let(T.unsafe(nil), Array) + +# source://activerecord//lib/active_record/relation/where_clause.rb#7 +class ActiveRecord::Relation::WhereClause + # @return [WhereClause] a new instance of WhereClause + # + # source://activerecord//lib/active_record/relation/where_clause.rb#10 + def initialize(predicates); end + + # source://activerecord//lib/active_record/relation/where_clause.rb#14 + def +(other); end + + # source://activerecord//lib/active_record/relation/where_clause.rb#18 + def -(other); end + + # source://activerecord//lib/active_record/relation/where_clause.rb#75 + def ==(other); end + + # source://activerecord//lib/active_record/relation/where_clause.rb#8 + def any?(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/where_clause.rb#70 + def ast; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation/where_clause.rb#99 + def contradiction?; end + + # source://activerecord//lib/active_record/relation/where_clause.rb#8 + def empty?(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/relation/where_clause.rb#79 + def eql?(other); end + + # source://activerecord//lib/active_record/relation/where_clause.rb#32 + def except(*columns); end + + # source://activerecord//lib/active_record/relation/where_clause.rb#110 + def extract_attributes; end + + # source://activerecord//lib/active_record/relation/where_clause.rb#81 + def hash; end + + # source://activerecord//lib/active_record/relation/where_clause.rb#85 + def invert; end + + # source://activerecord//lib/active_record/relation/where_clause.rb#26 + def merge(other); end + + # source://activerecord//lib/active_record/relation/where_clause.rb#36 + def or(other); end + + # source://activerecord//lib/active_record/relation/where_clause.rb#61 + def to_h(table_name = T.unsafe(nil), equality_only: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/relation/where_clause.rb#22 + def |(other); end + + protected + + # Returns the value of attribute predicates. + # + # source://activerecord//lib/active_record/relation/where_clause.rb#117 + def predicates; end + + # source://activerecord//lib/active_record/relation/where_clause.rb#119 + def referenced_columns; end + + private + + # source://activerecord//lib/active_record/relation/where_clause.rb#126 + def each_attributes; end + + # source://activerecord//lib/active_record/relation/where_clause.rb#149 + def equalities(predicates, equality_only); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/relation/where_clause.rb#163 + def equality_node?(node); end + + # source://activerecord//lib/active_record/relation/where_clause.rb#178 + def except_predicates(columns); end + + # source://activerecord//lib/active_record/relation/where_clause.rb#136 + def extract_attribute(node); end + + # source://activerecord//lib/active_record/relation/where_clause.rb#208 + def extract_node_value(node); end + + # source://activerecord//lib/active_record/relation/where_clause.rb#167 + def invert_predicate(node); end + + # source://activerecord//lib/active_record/relation/where_clause.rb#204 + def non_empty_predicates; end + + # source://activerecord//lib/active_record/relation/where_clause.rb#193 + def predicates_with_wrapped_sql_literals; end + + class << self + # source://activerecord//lib/active_record/relation/where_clause.rb#95 + def empty; end + end +end + +# source://activerecord//lib/active_record/relation/where_clause.rb#203 +ActiveRecord::Relation::WhereClause::ARRAY_WITH_EMPTY_STRING = T.let(T.unsafe(nil), Array) + +# = Active Record \Result +# +# This class encapsulates a result returned from calling +# {#exec_query}[rdoc-ref:ConnectionAdapters::DatabaseStatements#exec_query] +# on any database connection adapter. For example: +# +# result = ActiveRecord::Base.lease_connection.exec_query('SELECT id, title, body FROM posts') +# result # => # +# +# # Get the column names of the result: +# result.columns +# # => ["id", "title", "body"] +# +# # Get the record values of the result: +# result.rows +# # => [[1, "title_1", "body_1"], +# [2, "title_2", "body_2"], +# ... +# ] +# +# # Get an array of hashes representing the result (column => value): +# result.to_a +# # => [{"id" => 1, "title" => "title_1", "body" => "body_1"}, +# {"id" => 2, "title" => "title_2", "body" => "body_2"}, +# ... +# ] +# +# # Get the number of rows affected by the query: +# result = ActiveRecord::Base.lease_connection.exec_query('INSERT INTO posts (title, body) VALUES ("title_3", "body_3"), ("title_4", "body_4")') +# result.affected_rows +# # => 2 +# +# # ActiveRecord::Result also includes Enumerable. +# result.each do |row| +# puts row['title'] + " " + row['body'] +# end +# +# source://activerecord//lib/active_record/result.rb#41 +class ActiveRecord::Result + include ::Enumerable + + # @return [Result] a new instance of Result + # + # source://activerecord//lib/active_record/result.rb#107 + def initialize(columns, rows, column_types = T.unsafe(nil), affected_rows: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/result.rb#155 + def [](idx); end + + # Returns the value of attribute affected_rows. + # + # source://activerecord//lib/active_record/result.rb#97 + def affected_rows; end + + # source://activerecord//lib/active_record/result.rb#186 + def cancel; end + + # source://activerecord//lib/active_record/result.rb#190 + def cast_values(type_overrides = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/result.rb#228 + def column_indexes; end + + # Returns the +ActiveRecord::Type+ type of all columns. + # Note that not all database adapters return the result types, + # so the hash may be empty. + # + # source://activerecord//lib/active_record/result.rb#167 + def column_types; end + + # Returns the value of attribute columns. + # + # source://activerecord//lib/active_record/result.rb#97 + def columns; end + + # Calls the given block once for each element in row collection, passing + # row as parameter. Each row is a Hash-like, read only object. + # + # To get real hashes, use +.to_a.each+. + # + # Returns an +Enumerator+ if no block is given. + # + # source://activerecord//lib/active_record/result.rb#135 + def each(&block); end + + # Returns true if there are no records, otherwise false. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/result.rb#144 + def empty?; end + + # source://activerecord//lib/active_record/result.rb#221 + def freeze; end + + # Returns true if this result set includes the column named +name+ + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/result.rb#120 + def includes_column?(name); end + + # source://activerecord//lib/active_record/result.rb#241 + def indexed_rows; end + + # Returns the last record from the rows collection. + # + # source://activerecord//lib/active_record/result.rb#160 + def last(n = T.unsafe(nil)); end + + # Returns the number of elements in the rows array. + # + # source://activerecord//lib/active_record/result.rb#125 + def length; end + + # source://activerecord//lib/active_record/result.rb#182 + def result; end + + # Returns the value of attribute rows. + # + # source://activerecord//lib/active_record/result.rb#97 + def rows; end + + # Returns an array of hashes representing each row record. + # + # source://activerecord//lib/active_record/result.rb#153 + def to_a; end + + # Returns an array of hashes representing each row record. + # + # source://activerecord//lib/active_record/result.rb#149 + def to_ary; end + + private + + # source://activerecord//lib/active_record/result.rb#249 + def column_type(name, index, type_overrides); end + + # source://activerecord//lib/active_record/result.rb#261 + def hash_rows; end + + # source://activerecord//lib/active_record/result.rb#216 + def initialize_copy(other); end + + class << self + # source://activerecord//lib/active_record/result.rb#99 + def empty(async: T.unsafe(nil), affected_rows: T.unsafe(nil)); end + end +end + +# source://activerecord//lib/active_record/result.rb#269 +ActiveRecord::Result::EMPTY_ARRAY = T.let(T.unsafe(nil), Array) + +# source://activerecord//lib/active_record/result.rb#270 +ActiveRecord::Result::EMPTY_HASH = T.let(T.unsafe(nil), Hash) + +# source://activerecord//lib/active_record/result.rb#44 +class ActiveRecord::Result::IndexedRow + # @return [IndexedRow] a new instance of IndexedRow + # + # source://activerecord//lib/active_record/result.rb#45 + def initialize(column_indexes, row); end + + # source://activerecord//lib/active_record/result.rb#63 + def ==(other); end + + # source://activerecord//lib/active_record/result.rb#85 + def [](column); end + + # source://activerecord//lib/active_record/result.rb#55 + def each_key(&block); end + + # source://activerecord//lib/active_record/result.rb#75 + def fetch(column); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/result.rb#71 + def key?(column); end + + # source://activerecord//lib/active_record/result.rb#59 + def keys; end + + # source://activerecord//lib/active_record/result.rb#53 + def length; end + + # source://activerecord//lib/active_record/result.rb#50 + def size; end + + # source://activerecord//lib/active_record/result.rb#91 + def to_h; end + + # source://activerecord//lib/active_record/result.rb#94 + def to_hash; end +end + +# {ActiveRecord::Base.transaction}[rdoc-ref:Transactions::ClassMethods#transaction] +# uses this exception to distinguish a deliberate rollback from other exceptional situations. +# Normally, raising an exception will cause the +# {.transaction}[rdoc-ref:Transactions::ClassMethods#transaction] method to rollback +# the database transaction *and* pass on the exception. But if you raise an +# ActiveRecord::Rollback exception, then the database transaction will be rolled back, +# without passing on the exception. +# +# For example, you could do this in your controller to rollback a transaction: +# +# class BooksController < ActionController::Base +# def create +# Book.transaction do +# book = Book.new(params[:book]) +# book.save! +# if today_is_friday? +# # The system must fail on Friday so that our support department +# # won't be out of job. We silently rollback this transaction +# # without telling the user. +# raise ActiveRecord::Rollback +# end +# end +# # ActiveRecord::Rollback is the only exception that won't be passed on +# # by ActiveRecord::Base.transaction, so this line will still be reached +# # even on Friday. +# redirect_to root_url +# end +# end +# +# source://activerecord//lib/active_record/errors.rb#442 +class ActiveRecord::Rollback < ::ActiveRecord::ActiveRecordError; end + +# This is a thread locals registry for Active Record. For example: +# +# ActiveRecord::RuntimeRegistry.stats.sql_runtime +# +# returns the connection handler local to the current unit of execution (either thread of fiber). +# +# source://activerecord//lib/active_record/runtime_registry.rb#9 +module ActiveRecord::RuntimeRegistry + extend ::ActiveRecord::RuntimeRegistry + + # source://activerecord//lib/active_record/runtime_registry.rb#32 + def call(name, start, finish, id, payload); end + + # source://activerecord//lib/active_record/runtime_registry.rb#41 + def record(query_name, runtime, cached: T.unsafe(nil), async: T.unsafe(nil), lock_wait: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/runtime_registry.rb#59 + def reset; end + + # source://activerecord//lib/active_record/runtime_registry.rb#55 + def stats; end +end + +# source://activerecord//lib/active_record/runtime_registry.rb#10 +class ActiveRecord::RuntimeRegistry::Stats + # @return [Stats] a new instance of Stats + # + # source://activerecord//lib/active_record/runtime_registry.rb#13 + def initialize; end + + # Returns the value of attribute async_sql_runtime. + # + # source://activerecord//lib/active_record/runtime_registry.rb#11 + def async_sql_runtime; end + + # Sets the attribute async_sql_runtime + # + # @param value the value to set the attribute async_sql_runtime to. + # + # source://activerecord//lib/active_record/runtime_registry.rb#11 + def async_sql_runtime=(_arg0); end + + # Returns the value of attribute cached_queries_count. + # + # source://activerecord//lib/active_record/runtime_registry.rb#11 + def cached_queries_count; end + + # Sets the attribute cached_queries_count + # + # @param value the value to set the attribute cached_queries_count to. + # + # source://activerecord//lib/active_record/runtime_registry.rb#11 + def cached_queries_count=(_arg0); end + + # Returns the value of attribute queries_count. + # + # source://activerecord//lib/active_record/runtime_registry.rb#11 + def queries_count; end + + # Sets the attribute queries_count + # + # @param value the value to set the attribute queries_count to. + # + # source://activerecord//lib/active_record/runtime_registry.rb#11 + def queries_count=(_arg0); end + + # @return [Stats] a new instance of Stats + # + # source://activerecord//lib/active_record/runtime_registry.rb#27 + def reset; end + + # source://activerecord//lib/active_record/runtime_registry.rb#20 + def reset_runtimes; end + + # Returns the value of attribute sql_runtime. + # + # source://activerecord//lib/active_record/runtime_registry.rb#11 + def sql_runtime; end + + # Sets the attribute sql_runtime + # + # @param value the value to set the attribute sql_runtime to. + # + # source://activerecord//lib/active_record/runtime_registry.rb#11 + def sql_runtime=(_arg0); end +end + +# Raised when a statement produces an SQL warning. +# +# source://activerecord//lib/active_record/errors.rb#312 +class ActiveRecord::SQLWarning < ::ActiveRecord::AdapterError + # @return [SQLWarning] a new instance of SQLWarning + # + # source://activerecord//lib/active_record/errors.rb#316 + def initialize(message = T.unsafe(nil), code = T.unsafe(nil), level = T.unsafe(nil), sql = T.unsafe(nil), connection_pool = T.unsafe(nil)); end + + # Returns the value of attribute code. + # + # source://activerecord//lib/active_record/errors.rb#313 + def code; end + + # Returns the value of attribute level. + # + # source://activerecord//lib/active_record/errors.rb#313 + def level; end + + # Returns the value of attribute sql. + # + # source://activerecord//lib/active_record/errors.rb#314 + def sql; end + + # Sets the attribute sql + # + # @param value the value to set the attribute sql to. + # + # source://activerecord//lib/active_record/errors.rb#314 + def sql=(_arg0); end +end + +# source://activerecord//lib/active_record/sanitization.rb#4 +module ActiveRecord::Sanitization + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::Sanitization::ClassMethods +end + +# source://activerecord//lib/active_record/sanitization.rb#7 +module ActiveRecord::Sanitization::ClassMethods + # source://activerecord//lib/active_record/sanitization.rb#185 + def disallow_raw_sql!(args, permit: T.unsafe(nil)); end + + # Accepts an array of SQL conditions and sanitizes them into a valid + # SQL fragment for a WHERE clause. + # + # sanitize_sql_for_conditions(["name=? and group_id=?", "foo'bar", 4]) + # # => "name='foo''bar' and group_id=4" + # + # sanitize_sql_for_conditions(["name=:name and group_id=:group_id", name: "foo'bar", group_id: 4]) + # # => "name='foo''bar' and group_id='4'" + # + # sanitize_sql_for_conditions(["name='%s' and group_id='%s'", "foo'bar", 4]) + # # => "name='foo''bar' and group_id='4'" + # + # This method will NOT sanitize an SQL string since it won't contain + # any conditions in it and will return the string as is. + # + # sanitize_sql_for_conditions("name='foo''bar' and group_id='4'") + # # => "name='foo''bar' and group_id='4'" + # + # Note that this sanitization method is not schema-aware, hence won't do any type casting + # and will directly use the database adapter's +quote+ method. + # For MySQL specifically this means that numeric parameters will be quoted as strings + # to prevent query manipulation attacks. + # + # sanitize_sql_for_conditions(["role = ?", 0]) + # # => "role = '0'" + # + # source://activerecord//lib/active_record/sanitization.rb#41 + def sanitize_sql(condition); end + + # Accepts an array of conditions. The array has each value + # sanitized and interpolated into the SQL statement. If using named bind + # variables in SQL statements where a colon is required verbatim use a + # backslash to escape. + # + # sanitize_sql_array(["name=? and group_id=?", "foo'bar", 4]) + # # => "name='foo''bar' and group_id=4" + # + # sanitize_sql_array(["name=:name and group_id=:group_id", name: "foo'bar", group_id: 4]) + # # => "name='foo''bar' and group_id=4" + # + # sanitize_sql_array(["TO_TIMESTAMP(:date, 'YYYY/MM/DD HH12\\:MI\\:SS')", date: "foo"]) + # # => "TO_TIMESTAMP('foo', 'YYYY/MM/DD HH12:MI:SS')" + # + # sanitize_sql_array(["name='%s' and group_id='%s'", "foo'bar", 4]) + # # => "name='foo''bar' and group_id='4'" + # + # Note that this sanitization method is not schema-aware, hence won't do any type casting + # and will directly use the database adapter's +quote+ method. + # For MySQL specifically this means that numeric parameters will be quoted as strings + # to prevent query manipulation attacks. + # + # sanitize_sql_array(["role = ?", 0]) + # # => "role = '0'" + # + # Before using this method, please consider if Arel.sql would be better for your use-case + # + # source://activerecord//lib/active_record/sanitization.rb#166 + def sanitize_sql_array(ary); end + + # Accepts an array or hash of SQL conditions and sanitizes them into + # a valid SQL fragment for a SET clause. + # + # sanitize_sql_for_assignment(["name=? and group_id=?", nil, 4]) + # # => "name=NULL and group_id=4" + # + # sanitize_sql_for_assignment(["name=:name and group_id=:group_id", name: nil, group_id: 4]) + # # => "name=NULL and group_id=4" + # + # Post.sanitize_sql_for_assignment({ name: nil, group_id: 4 }) + # # => "`posts`.`name` = NULL, `posts`.`group_id` = 4" + # + # This method will NOT sanitize an SQL string since it won't contain + # any conditions in it and will return the string as is. + # + # sanitize_sql_for_assignment("name=NULL and group_id='4'") + # # => "name=NULL and group_id='4'" + # + # Note that this sanitization method is not schema-aware, hence won't do any type casting + # and will directly use the database adapter's +quote+ method. + # For MySQL specifically this means that numeric parameters will be quoted as strings + # to prevent query manipulation attacks. + # + # sanitize_sql_for_assignment(["role = ?", 0]) + # # => "role = '0'" + # + # source://activerecord//lib/active_record/sanitization.rb#68 + def sanitize_sql_for_assignment(assignments, default_table_name = T.unsafe(nil)); end + + # Accepts an array of SQL conditions and sanitizes them into a valid + # SQL fragment for a WHERE clause. + # + # sanitize_sql_for_conditions(["name=? and group_id=?", "foo'bar", 4]) + # # => "name='foo''bar' and group_id=4" + # + # sanitize_sql_for_conditions(["name=:name and group_id=:group_id", name: "foo'bar", group_id: 4]) + # # => "name='foo''bar' and group_id='4'" + # + # sanitize_sql_for_conditions(["name='%s' and group_id='%s'", "foo'bar", 4]) + # # => "name='foo''bar' and group_id='4'" + # + # This method will NOT sanitize an SQL string since it won't contain + # any conditions in it and will return the string as is. + # + # sanitize_sql_for_conditions("name='foo''bar' and group_id='4'") + # # => "name='foo''bar' and group_id='4'" + # + # Note that this sanitization method is not schema-aware, hence won't do any type casting + # and will directly use the database adapter's +quote+ method. + # For MySQL specifically this means that numeric parameters will be quoted as strings + # to prevent query manipulation attacks. + # + # sanitize_sql_for_conditions(["role = ?", 0]) + # # => "role = '0'" + # + # source://activerecord//lib/active_record/sanitization.rb#33 + def sanitize_sql_for_conditions(condition); end + + # Accepts an array, or string of SQL conditions and sanitizes + # them into a valid SQL fragment for an ORDER clause. + # + # sanitize_sql_for_order([Arel.sql("field(id, ?)"), [1,3,2]]) + # # => "field(id, 1,3,2)" + # + # sanitize_sql_for_order("id ASC") + # # => "id ASC" + # + # source://activerecord//lib/active_record/sanitization.rb#84 + def sanitize_sql_for_order(condition); end + + # Sanitizes a hash of attribute/value pairs into SQL conditions for a SET clause. + # + # sanitize_sql_hash_for_assignment({ status: nil, group_id: 1 }, "posts") + # # => "`posts`.`status` = NULL, `posts`.`group_id` = 1" + # + # source://activerecord//lib/active_record/sanitization.rb#107 + def sanitize_sql_hash_for_assignment(attrs, table); end + + # Sanitizes a +string+ so that it is safe to use within an SQL + # LIKE statement. This method uses +escape_character+ to escape all + # occurrences of itself, "_" and "%". + # + # sanitize_sql_like("100% true!") + # # => "100\\% true!" + # + # sanitize_sql_like("snake_cased_string") + # # => "snake\\_cased\\_string" + # + # sanitize_sql_like("100% true!", "!") + # # => "100!% true!!" + # + # sanitize_sql_like("snake_cased_string", "!") + # # => "snake!_cased!_string" + # + # source://activerecord//lib/active_record/sanitization.rb#132 + def sanitize_sql_like(string, escape_character = T.unsafe(nil)); end + + private + + # source://activerecord//lib/active_record/sanitization.rb#235 + def quote_bound_value(connection, value); end + + # source://activerecord//lib/active_record/sanitization.rb#249 + def raise_if_bind_arity_mismatch(statement, expected, provided); end + + # source://activerecord//lib/active_record/sanitization.rb#213 + def replace_bind_variable(connection, value); end + + # source://activerecord//lib/active_record/sanitization.rb#205 + def replace_bind_variables(connection, statement, values); end + + # source://activerecord//lib/active_record/sanitization.rb#221 + def replace_named_bind_variables(connection, statement, bind_vars); end +end + +# = Active Record \Schema +# +# Allows programmers to programmatically define a schema in a portable +# DSL. This means you can define tables, indexes, etc. without using SQL +# directly, so your applications can more easily support multiple +# databases. +# +# Usage: +# +# ActiveRecord::Schema[7.0].define do +# create_table :authors do |t| +# t.string :name, null: false +# end +# +# add_index :authors, :name, :unique +# +# create_table :posts do |t| +# t.integer :author_id, null: false +# t.string :subject +# t.text :body +# t.boolean :private, default: false +# end +# +# add_index :posts, :author_id +# end +# +# ActiveRecord::Schema is only supported by database adapters that also +# support migrations, the two features being very similar. +# +# source://activerecord//lib/active_record/schema.rb#32 +class ActiveRecord::Schema < ::ActiveRecord::Migration::Current + include ::ActiveRecord::Schema::Definition + extend ::ActiveRecord::Schema::Definition::ClassMethods + + class << self + # source://activerecord//lib/active_record/schema.rb#70 + def [](version); end + end +end + +# source://activerecord//lib/active_record/schema.rb#33 +module ActiveRecord::Schema::Definition + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::Schema::Definition::ClassMethods + + # source://activerecord//lib/active_record/schema.rb#54 + def define(info, &block); end +end + +# source://activerecord//lib/active_record/schema.rb#36 +module ActiveRecord::Schema::Definition::ClassMethods + # Eval the given block. All methods available to the current connection + # adapter are available within the block, so you can easily use the + # database definition DSL to build up your schema ( + # {create_table}[rdoc-ref:ConnectionAdapters::SchemaStatements#create_table], + # {add_index}[rdoc-ref:ConnectionAdapters::SchemaStatements#add_index], etc.). + # + # The +info+ hash is optional, and if given is used to define metadata + # about the current schema (currently, only the schema's version): + # + # ActiveRecord::Schema[7.0].define(version: 2038_01_19_000001) do + # ... + # end + # + # source://activerecord//lib/active_record/schema.rb#49 + def define(info = T.unsafe(nil), &block); end +end + +# = Active Record Schema Dumper +# +# This class is used to dump the database schema for some connection to some +# output format (i.e., ActiveRecord::Schema). +# +# source://activerecord//lib/active_record/schema_dumper.rb#10 +class ActiveRecord::SchemaDumper + # @return [SchemaDumper] a new instance of SchemaDumper + # + # source://activerecord//lib/active_record/schema_dumper.rb#74 + def initialize(connection, options = T.unsafe(nil)); end + + # :singleton-method: + # Specify a custom regular expression matching check constraints which name + # should not be dumped to db/schema.rb. + # + # source://activerecord//lib/active_record/schema_dumper.rb#29 + def chk_ignore_pattern; end + + # source://activerecord//lib/active_record/schema_dumper.rb#29 + def chk_ignore_pattern=(val); end + + # source://activerecord//lib/active_record/schema_dumper.rb#60 + def dump(stream); end + + # :singleton-method: + # Specify a custom regular expression matching exclusion constraints which name + # should not be dumped to db/schema.rb. + # + # source://activerecord//lib/active_record/schema_dumper.rb#35 + def excl_ignore_pattern; end + + # source://activerecord//lib/active_record/schema_dumper.rb#35 + def excl_ignore_pattern=(val); end + + # :singleton-method: + # Specify a custom regular expression matching foreign keys which name + # should not be dumped to db/schema.rb. + # + # source://activerecord//lib/active_record/schema_dumper.rb#23 + def fk_ignore_pattern; end + + # source://activerecord//lib/active_record/schema_dumper.rb#23 + def fk_ignore_pattern=(val); end + + # :singleton-method: + # A list of tables which should not be dumped to the schema. + # Acceptable values are strings and regexps. + # + # source://activerecord//lib/active_record/schema_dumper.rb#17 + def ignore_tables; end + + # source://activerecord//lib/active_record/schema_dumper.rb#17 + def ignore_tables=(val); end + + # :singleton-method: + # Specify a custom regular expression matching unique constraints which name + # should not be dumped to db/schema.rb. + # + # source://activerecord//lib/active_record/schema_dumper.rb#41 + def unique_ignore_pattern; end + + # source://activerecord//lib/active_record/schema_dumper.rb#41 + def unique_ignore_pattern=(val); end + + private + + # source://activerecord//lib/active_record/schema_dumper.rb#284 + def check_constraints_in_create(table, stream); end + + # source://activerecord//lib/active_record/schema_dumper.rb#310 + def check_parts(check); end + + # source://activerecord//lib/active_record/schema_dumper.rb#92 + def define_params; end + + # extensions are only supported by PostgreSQL + # + # source://activerecord//lib/active_record/schema_dumper.rb#119 + def extensions(stream); end + + # source://activerecord//lib/active_record/schema_dumper.rb#317 + def foreign_keys(table, stream); end + + # source://activerecord//lib/active_record/schema_dumper.rb#346 + def format_colspec(colspec); end + + # source://activerecord//lib/active_record/schema_dumper.rb#356 + def format_index_parts(options); end + + # source://activerecord//lib/active_record/schema_dumper.rb#352 + def format_options(options); end + + # turns 20170404131909 into "2017_04_04_131909" + # + # source://activerecord//lib/active_record/schema_dumper.rb#86 + def formatted_version; end + + # source://activerecord//lib/active_record/schema_dumper.rb#96 + def header(stream); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/schema_dumper.rb#378 + def ignored?(table_name); end + + # source://activerecord//lib/active_record/schema_dumper.rb#265 + def index_parts(index); end + + # Keep it for indexing materialized views + # + # source://activerecord//lib/active_record/schema_dumper.rb#232 + def indexes(table, stream); end + + # source://activerecord//lib/active_record/schema_dumper.rb#244 + def indexes_in_create(table, stream); end + + # source://activerecord//lib/active_record/schema_dumper.rb#364 + def relation_name(name); end + + # source://activerecord//lib/active_record/schema_dumper.rb#368 + def remove_prefix_and_suffix(table); end + + # schemas are only supported by PostgreSQL + # + # source://activerecord//lib/active_record/schema_dumper.rb#127 + def schemas(stream); end + + # source://activerecord//lib/active_record/schema_dumper.rb#158 + def table(table, stream); end + + # Returns the value of attribute table_name. + # + # source://activerecord//lib/active_record/schema_dumper.rb#72 + def table_name; end + + # Sets the attribute table_name + # + # @param value the value to set the attribute table_name to. + # + # source://activerecord//lib/active_record/schema_dumper.rb#72 + def table_name=(_arg0); end + + # source://activerecord//lib/active_record/schema_dumper.rb#134 + def tables(stream); end + + # source://activerecord//lib/active_record/schema_dumper.rb#114 + def trailer(stream); end + + # (enum) types are only supported by PostgreSQL + # + # source://activerecord//lib/active_record/schema_dumper.rb#123 + def types(stream); end + + # virtual tables are only supported by SQLite + # + # source://activerecord//lib/active_record/schema_dumper.rb#131 + def virtual_tables(stream); end + + class << self + # source://activerecord//lib/active_record/schema_dumper.rb#29 + def chk_ignore_pattern; end + + # source://activerecord//lib/active_record/schema_dumper.rb#29 + def chk_ignore_pattern=(val); end + + # source://activerecord//lib/active_record/schema_dumper.rb#44 + def dump(pool = T.unsafe(nil), stream = T.unsafe(nil), config = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/schema_dumper.rb#35 + def excl_ignore_pattern; end + + # source://activerecord//lib/active_record/schema_dumper.rb#35 + def excl_ignore_pattern=(val); end + + # source://activerecord//lib/active_record/schema_dumper.rb#23 + def fk_ignore_pattern; end + + # source://activerecord//lib/active_record/schema_dumper.rb#23 + def fk_ignore_pattern=(val); end + + # source://activerecord//lib/active_record/schema_dumper.rb#17 + def ignore_tables; end + + # source://activerecord//lib/active_record/schema_dumper.rb#17 + def ignore_tables=(val); end + + # source://activerecord//lib/active_record/schema_dumper.rb#41 + def unique_ignore_pattern; end + + # source://activerecord//lib/active_record/schema_dumper.rb#41 + def unique_ignore_pattern=(val); end + + private + + # source://activerecord//lib/active_record/schema_dumper.rb#52 + def generate_options(config); end + + # source://activerecord//lib/active_record/schema_dumper.rb#11 + def new(*_arg0); end + end +end + +# This class is used to create a table that keeps track of which migrations +# have been applied to a given database. When a migration is run, its schema +# number is inserted in to the schema migrations table so it doesn't need +# to be executed the next time. +# +# source://activerecord//lib/active_record/schema_migration.rb#8 +class ActiveRecord::SchemaMigration + # @return [SchemaMigration] a new instance of SchemaMigration + # + # source://activerecord//lib/active_record/schema_migration.rb#14 + def initialize(pool); end + + # Returns the value of attribute arel_table. + # + # source://activerecord//lib/active_record/schema_migration.rb#12 + def arel_table; end + + # source://activerecord//lib/active_record/schema_migration.rb#91 + def count; end + + # source://activerecord//lib/active_record/schema_migration.rb#53 + def create_table; end + + # source://activerecord//lib/active_record/schema_migration.rb#19 + def create_version(version); end + + # source://activerecord//lib/active_record/schema_migration.rb#36 + def delete_all_versions; end + + # source://activerecord//lib/active_record/schema_migration.rb#27 + def delete_version(version); end + + # source://activerecord//lib/active_record/schema_migration.rb#63 + def drop_table; end + + # source://activerecord//lib/active_record/schema_migration.rb#87 + def integer_versions; end + + # source://activerecord//lib/active_record/schema_migration.rb#69 + def normalize_migration_number(number); end + + # source://activerecord//lib/active_record/schema_migration.rb#73 + def normalized_versions; end + + # source://activerecord//lib/active_record/schema_migration.rb#45 + def primary_key; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/schema_migration.rb#100 + def table_exists?; end + + # source://activerecord//lib/active_record/schema_migration.rb#49 + def table_name; end + + # source://activerecord//lib/active_record/schema_migration.rb#77 + def versions; end +end + +# source://activerecord//lib/active_record/schema_migration.rb#9 +class ActiveRecord::SchemaMigration::NullSchemaMigration; end + +# = Active Record \Named \Scopes +# +# source://activerecord//lib/active_record/scoping.rb#5 +module ActiveRecord::Scoping + extend ::ActiveSupport::Concern + extend ::ActiveSupport::Autoload + include GeneratedInstanceMethods + include ::ActiveRecord::Scoping::Default + include ::ActiveRecord::Scoping::Named + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveRecord::Scoping::ClassMethods + mixes_in_class_methods ::ActiveRecord::Scoping::Default::ClassMethods + mixes_in_class_methods ::ActiveRecord::Scoping::Named::ClassMethods + + # source://activerecord//lib/active_record/scoping.rb#53 + def initialize_internals_callback; end + + # source://activerecord//lib/active_record/scoping.rb#46 + def populate_with_current_scope_attributes; end + + module GeneratedClassMethods + def default_scope_override; end + def default_scope_override=(value); end + def default_scopes; end + def default_scopes=(value); end + end + + module GeneratedInstanceMethods + def default_scope_override; end + def default_scopes; end + end +end + +# source://activerecord//lib/active_record/scoping.rb#13 +module ActiveRecord::Scoping::ClassMethods + # source://activerecord//lib/active_record/scoping.rb#25 + def current_scope(skip_inherited_scope = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/scoping.rb#29 + def current_scope=(scope); end + + # source://activerecord//lib/active_record/scoping.rb#33 + def global_current_scope(skip_inherited_scope = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/scoping.rb#37 + def global_current_scope=(scope); end + + # Collects attributes from scopes that should be applied when creating + # an AR instance for the particular class this is called on. + # + # source://activerecord//lib/active_record/scoping.rb#16 + def scope_attributes; end + + # Are there attributes associated with this scope? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/scoping.rb#21 + def scope_attributes?; end + + # source://activerecord//lib/active_record/scoping.rb#41 + def scope_registry; end +end + +# source://activerecord//lib/active_record/scoping/default.rb#14 +module ActiveRecord::Scoping::Default + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveRecord::Scoping::Default::ClassMethods + + module GeneratedClassMethods + def default_scope_override; end + def default_scope_override=(value); end + def default_scopes; end + def default_scopes=(value); end + end + + module GeneratedInstanceMethods + def default_scope_override; end + def default_scopes; end + end +end + +# source://activerecord//lib/active_record/scoping/default.rb#23 +module ActiveRecord::Scoping::Default::ClassMethods + # Checks if the model has any default scopes. If all_queries + # is set to true, the method will check if there are any + # default_scopes for the model where +all_queries+ is true. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/scoping/default.rb#62 + def default_scopes?(all_queries: T.unsafe(nil)); end + + # Are there attributes associated with this scope? + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/scoping/default.rb#55 + def scope_attributes?; end + + # Returns a scope for the model without the previously set scopes. + # + # class Post < ActiveRecord::Base + # belongs_to :user + # + # def self.default_scope + # where(published: true) + # end + # end + # + # class User < ActiveRecord::Base + # has_many :posts + # end + # + # Post.all # Fires "SELECT * FROM posts WHERE published = true" + # Post.unscoped.all # Fires "SELECT * FROM posts" + # Post.where(published: false).unscoped.all # Fires "SELECT * FROM posts" + # User.find(1).posts # Fires "SELECT * FROM posts WHERE published = true AND posts.user_id = 1" + # User.find(1).posts.unscoped # Fires "SELECT * FROM posts" + # + # This method also accepts a block. All queries inside the block will + # not use the previously set scopes. + # + # Post.unscoped { + # Post.limit(10) # Fires "SELECT * FROM posts LIMIT 10" + # } + # + # source://activerecord//lib/active_record/scoping/default.rb#50 + def unscoped(&block); end + + private + + # source://activerecord//lib/active_record/scoping/default.rb#145 + def build_default_scope(relation = T.unsafe(nil), all_queries: T.unsafe(nil)); end + + # Use this macro in your model to set a default scope for all operations on + # the model. + # + # class Article < ActiveRecord::Base + # default_scope { where(published: true) } + # end + # + # Article.all + # # SELECT * FROM articles WHERE published = true + # + # The #default_scope is also applied while creating/building a record. + # It is not applied while updating or deleting a record. + # + # Article.new.published # => true + # Article.create.published # => true + # + # To apply a #default_scope when updating or deleting a record, add + # all_queries: true: + # + # class Article < ActiveRecord::Base + # default_scope -> { where(blog_id: 1) }, all_queries: true + # end + # + # Applying a default scope to all queries will ensure that records + # are always queried by the additional conditions. Note that only + # where clauses apply, as it does not make sense to add order to + # queries that return a single object by primary key. + # + # Article.find(1).destroy + # # DELETE ... FROM `articles` where ID = 1 AND blog_id = 1; + # + # (You can also pass any object which responds to +call+ to the + # +default_scope+ macro, and it will be called when building the + # default scope.) + # + # If you use multiple #default_scope declarations in your model then + # they will be merged together: + # + # class Article < ActiveRecord::Base + # default_scope { where(published: true) } + # default_scope { where(rating: 'G') } + # end + # + # Article.all + # # SELECT * FROM articles WHERE published = true AND rating = 'G' + # + # This is also the case with inheritance and module includes where the + # parent or module defines a #default_scope and the child or including + # class defines a second one. + # + # If you need to do more complex things with a default scope, you can + # alternatively define it as a class method: + # + # class Article < ActiveRecord::Base + # def self.default_scope + # # Should return a scope, you can call 'super' here etc. + # end + # end + # + # source://activerecord//lib/active_record/scoping/default.rb#129 + def default_scope(scope = T.unsafe(nil), all_queries: T.unsafe(nil), &block); end + + # The ignore_default_scope flag is used to prevent an infinite recursion + # situation where a default scope references a scope which has a default + # scope which references a scope... + # + # source://activerecord//lib/active_record/scoping/default.rb#192 + def evaluate_default_scope; end + + # If all_queries is nil, only execute on select and insert queries. + # + # If all_queries is true, check if the default_scope object has + # all_queries set, then execute on all queries; select, insert, update, + # delete, and reload. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/scoping/default.rb#177 + def execute_scope?(all_queries, default_scope_obj); end + + # source://activerecord//lib/active_record/scoping/default.rb#185 + def ignore_default_scope=(ignore); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/scoping/default.rb#181 + def ignore_default_scope?; end +end + +# source://activerecord//lib/active_record/scoping/default.rb#5 +class ActiveRecord::Scoping::DefaultScope + # @return [DefaultScope] a new instance of DefaultScope + # + # source://activerecord//lib/active_record/scoping/default.rb#8 + def initialize(scope, all_queries = T.unsafe(nil)); end + + # Returns the value of attribute all_queries. + # + # source://activerecord//lib/active_record/scoping/default.rb#6 + def all_queries; end + + # Returns the value of attribute scope. + # + # source://activerecord//lib/active_record/scoping/default.rb#6 + def scope; end +end + +# source://activerecord//lib/active_record/scoping/named.rb#6 +module ActiveRecord::Scoping::Named + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::Scoping::Named::ClassMethods +end + +# source://activerecord//lib/active_record/scoping/named.rb#9 +module ActiveRecord::Scoping::Named::ClassMethods + # Returns an ActiveRecord::Relation scope object. + # + # posts = Post.all + # posts.size # Fires "select count(*) from posts" and returns the count + # posts.each {|p| puts p.name } # Fires "select * from posts" and loads post objects + # + # fruits = Fruit.all + # fruits = fruits.where(color: 'red') if options[:red_only] + # fruits = fruits.limit(10) if limited? + # + # You can define a scope that applies to all finders using + # {default_scope}[rdoc-ref:Scoping::Default::ClassMethods#default_scope]. + # + # source://activerecord//lib/active_record/scoping/named.rb#22 + def all(all_queries: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/scoping/named.rb#49 + def default_extensions; end + + # Returns a scope for the model with default scopes. + # + # source://activerecord//lib/active_record/scoping/named.rb#45 + def default_scoped(scope = T.unsafe(nil), all_queries: T.unsafe(nil)); end + + # Adds a class method for retrieving and querying objects. + # The method is intended to return an ActiveRecord::Relation + # object, which is composable with other scopes. + # If it returns +nil+ or +false+, an + # {all}[rdoc-ref:Scoping::Named::ClassMethods#all] scope is returned instead. + # + # A \scope represents a narrowing of a database query, such as + # where(color: :red).select('shirts.*').includes(:washing_instructions). + # + # class Shirt < ActiveRecord::Base + # scope :red, -> { where(color: 'red') } + # scope :dry_clean_only, -> { joins(:washing_instructions).where('washing_instructions.dry_clean_only = ?', true) } + # end + # + # The above calls to #scope define class methods Shirt.red and + # Shirt.dry_clean_only. Shirt.red, in effect, + # represents the query Shirt.where(color: 'red'). + # + # Note that this is simply 'syntactic sugar' for defining an actual + # class method: + # + # class Shirt < ActiveRecord::Base + # def self.red + # where(color: 'red') + # end + # end + # + # Unlike Shirt.find(...), however, the object returned by + # Shirt.red is not an Array but an ActiveRecord::Relation, + # which is composable with other scopes; it resembles the association object + # constructed by a {has_many}[rdoc-ref:Associations::ClassMethods#has_many] + # declaration. For instance, you can invoke Shirt.red.first, Shirt.red.count, + # Shirt.red.where(size: 'small'). Also, just as with the + # association objects, named \scopes act like an Array, implementing + # Enumerable; Shirt.red.each(&block), Shirt.red.first, + # and Shirt.red.inject(memo, &block) all behave as if + # Shirt.red really was an array. + # + # These named \scopes are composable. For instance, + # Shirt.red.dry_clean_only will produce all shirts that are + # both red and dry clean only. Nested finds and calculations also work + # with these compositions: Shirt.red.dry_clean_only.count + # returns the number of garments for which these criteria obtain. + # Similarly with Shirt.red.dry_clean_only.average(:thread_count). + # + # All scopes are available as class methods on the ActiveRecord::Base + # descendant upon which the \scopes were defined. But they are also + # available to {has_many}[rdoc-ref:Associations::ClassMethods#has_many] + # associations. If, + # + # class Person < ActiveRecord::Base + # has_many :shirts + # end + # + # then elton.shirts.red.dry_clean_only will return all of + # Elton's red, dry clean only shirts. + # + # \Named scopes can also have extensions, just as with + # {has_many}[rdoc-ref:Associations::ClassMethods#has_many] declarations: + # + # class Shirt < ActiveRecord::Base + # scope :red, -> { where(color: 'red') } do + # def dom_id + # 'red_shirts' + # end + # end + # end + # + # Scopes can also be used while creating/building a record. + # + # class Article < ActiveRecord::Base + # scope :published, -> { where(published: true) } + # end + # + # Article.published.new.published # => true + # Article.published.create.published # => true + # + # \Class methods on your model are automatically available + # on scopes. Assuming the following setup: + # + # class Article < ActiveRecord::Base + # scope :published, -> { where(published: true) } + # scope :featured, -> { where(featured: true) } + # + # def self.latest_article + # order('published_at desc').first + # end + # + # def self.titles + # pluck(:title) + # end + # end + # + # We are able to call the methods like this: + # + # Article.published.featured.latest_article + # Article.featured.titles + # + # source://activerecord//lib/active_record/scoping/named.rb#154 + def scope(name, body, &block); end + + # source://activerecord//lib/active_record/scoping/named.rb#36 + def scope_for_association(scope = T.unsafe(nil)); end + + private + + # source://activerecord//lib/active_record/scoping/named.rb#192 + def singleton_method_added(name); end +end + +# This class stores the +:current_scope+ and +:ignore_default_scope+ values +# for different classes. The registry is stored as either a thread or fiber +# local depending on the application configuration. +# +# This class allows you to store and get the scope values on different +# classes and different types of scopes. For example, if you are attempting +# to get the current_scope for the +Board+ model, then you would use the +# following code: +# +# registry = ActiveRecord::Scoping::ScopeRegistry +# registry.set_current_scope(Board, some_new_scope) +# +# Now when you run: +# +# registry.current_scope(Board) +# +# You will obtain whatever was defined in +some_new_scope+. +# +# source://activerecord//lib/active_record/scoping.rb#75 +class ActiveRecord::Scoping::ScopeRegistry + # @return [ScopeRegistry] a new instance of ScopeRegistry + # + # source://activerecord//lib/active_record/scoping.rb#85 + def initialize; end + + # source://activerecord//lib/active_record/scoping.rb#91 + def current_scope(model, skip_inherited_scope = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/scoping.rb#107 + def global_current_scope(model, skip_inherited_scope = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/scoping.rb#99 + def ignore_default_scope(model, skip_inherited_scope = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/scoping.rb#95 + def set_current_scope(model, value); end + + # source://activerecord//lib/active_record/scoping.rb#111 + def set_global_current_scope(model, value); end + + # source://activerecord//lib/active_record/scoping.rb#103 + def set_ignore_default_scope(model, value); end + + private + + # Sets the +value+ for a given +scope_type+ and +model+. + # + # source://activerecord//lib/active_record/scoping.rb#130 + def set_value_for(scope_type, model, value); end + + # Obtains the value for a given +scope_type+ and +model+. + # + # source://activerecord//lib/active_record/scoping.rb#117 + def value_for(scope_type, model, skip_inherited_scope = T.unsafe(nil)); end + + class << self + # source://activerecord//lib/active_record/scoping.rb#77 + def current_scope(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/scoping.rb#77 + def global_current_scope(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/scoping.rb#77 + def ignore_default_scope(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/scoping.rb#80 + def instance; end + + # source://activerecord//lib/active_record/scoping.rb#77 + def set_current_scope(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/scoping.rb#77 + def set_global_current_scope(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/scoping.rb#77 + def set_ignore_default_scope(*_arg0, **_arg1, &_arg2); end + end +end + +# source://activerecord//lib/active_record/secure_password.rb#4 +module ActiveRecord::SecurePassword + extend ::ActiveSupport::Concern + include ::ActiveModel::SecurePassword + + mixes_in_class_methods ::ActiveModel::SecurePassword::ClassMethods + mixes_in_class_methods ::ActiveRecord::SecurePassword::ClassMethods +end + +# source://activerecord//lib/active_record/secure_password.rb#9 +module ActiveRecord::SecurePassword::ClassMethods + # Given a set of attributes, finds a record using the non-password + # attributes, and then authenticates that record using the password + # attributes. Returns the record if authentication succeeds; otherwise, + # returns +nil+. + # + # Regardless of whether a record is found, +authenticate_by+ will + # cryptographically digest the given password attributes. This behavior + # helps mitigate timing-based enumeration attacks, wherein an attacker can + # determine if a passworded record exists even without knowing the + # password. + # + # Raises an ArgumentError if the set of attributes doesn't contain at + # least one password and one non-password attribute. + # + # ==== Examples + # + # class User < ActiveRecord::Base + # has_secure_password + # end + # + # User.create(name: "John Doe", email: "jdoe@example.com", password: "abc123") + # + # User.authenticate_by(email: "jdoe@example.com", password: "abc123").name # => "John Doe" (in 373.4ms) + # User.authenticate_by(email: "jdoe@example.com", password: "wrong") # => nil (in 373.9ms) + # User.authenticate_by(email: "wrong@example.com", password: "abc123") # => nil (in 373.6ms) + # + # User.authenticate_by(email: "jdoe@example.com", password: nil) # => nil (no queries executed) + # User.authenticate_by(email: "jdoe@example.com", password: "") # => nil (no queries executed) + # + # User.authenticate_by(email: "jdoe@example.com") # => ArgumentError + # User.authenticate_by(password: "abc123") # => ArgumentError + # + # @raise [ArgumentError] + # + # source://activerecord//lib/active_record/secure_password.rb#41 + def authenticate_by(attributes); end +end + +# source://activerecord//lib/active_record/secure_token.rb#4 +module ActiveRecord::SecureToken + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::SecureToken::ClassMethods +end + +# source://activerecord//lib/active_record/secure_token.rb#11 +module ActiveRecord::SecureToken::ClassMethods + # source://activerecord//lib/active_record/secure_token.rb#61 + def generate_unique_secure_token(length: T.unsafe(nil)); end + + # Example using #has_secure_token + # + # # Schema: User(token:string, auth_token:string) + # class User < ActiveRecord::Base + # has_secure_token + # has_secure_token :auth_token, length: 36 + # end + # + # user = User.new + # user.save + # user.token # => "pX27zsMN2ViQKta1bGfLmVJE" + # user.auth_token # => "tU9bLuZseefXQ4yQxQo8wjtBvsAfPc78os6R" + # user.regenerate_token # => true + # user.regenerate_auth_token # => true + # + # +SecureRandom::base58+ is used to generate at minimum a 24-character unique token, so collisions are highly unlikely. + # + # Note that it's still possible to generate a race condition in the database in the same way that + # {validates_uniqueness_of}[rdoc-ref:Validations::ClassMethods#validates_uniqueness_of] can. + # You're encouraged to add a unique index in the database to deal with this even more unlikely scenario. + # + # ==== Options + # + # [+:length+] + # Length of the Secure Random, with a minimum of 24 characters. It will + # default to 24. + # + # [+:on+] + # The callback when the value is generated. When called with on: + # :initialize, the value is generated in an + # after_initialize callback, otherwise the value will be used + # in a before_ callback. When not specified, +:on+ will use the value of + # config.active_record.generate_secure_token_on, which defaults to +:initialize+ + # starting in \Rails 7.1. + # + # source://activerecord//lib/active_record/secure_token.rb#46 + def has_secure_token(attribute = T.unsafe(nil), length: T.unsafe(nil), on: T.unsafe(nil)); end +end + +# source://activerecord//lib/active_record/secure_token.rb#7 +ActiveRecord::SecureToken::MINIMUM_TOKEN_LENGTH = T.let(T.unsafe(nil), Integer) + +# source://activerecord//lib/active_record/secure_token.rb#5 +class ActiveRecord::SecureToken::MinimumLengthError < ::StandardError; end + +# = Active Record \Serialization +# +# source://activerecord//lib/active_record/serialization.rb#5 +module ActiveRecord::Serialization + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActiveModel::Serializers::JSON + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveModel::Naming + + # source://activerecord//lib/active_record/serialization.rb#13 + def serializable_hash(options = T.unsafe(nil)); end + + private + + # source://activerecord//lib/active_record/serialization.rb#25 + def attribute_names_for_serialization; end + + module GeneratedClassMethods + def include_root_in_json; end + def include_root_in_json=(value); end + def include_root_in_json?; end + end + + module GeneratedInstanceMethods + def include_root_in_json; end + def include_root_in_json?; end + end +end + +# SerializationFailure will be raised when a transaction is rolled +# back by the database due to a serialization failure. +# +# This is a subclass of TransactionRollbackError, please make sure to check +# its documentation to be aware of its caveats. +# +# source://activerecord//lib/active_record/errors.rb#552 +class ActiveRecord::SerializationFailure < ::ActiveRecord::TransactionRollbackError; end + +# Raised when unserialized object's type mismatches one specified for serializable field. +# +# source://activerecord//lib/active_record/errors.rb#36 +class ActiveRecord::SerializationTypeMismatch < ::ActiveRecord::ActiveRecordError; end + +# = Active Record Signed Id +# +# source://activerecord//lib/active_record/signed_id.rb#5 +module ActiveRecord::SignedId + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveRecord::SignedId::ClassMethods + mixes_in_class_methods ::ActiveRecord::SignedId::DeprecateSignedIdVerifierSecret + + # Returns a signed id that's generated using a preconfigured +ActiveSupport::MessageVerifier+ instance. + # + # This signed id is tamper proof, so it's safe to send in an email or otherwise share with the outside world. + # However, as with any message signed with a +ActiveSupport::MessageVerifier+, + # {the signed id is not encrypted}[link:classes/ActiveSupport/MessageVerifier.html#class-ActiveSupport::MessageVerifier-label-Signing+is+not+encryption]. + # It's just encoded and protected against tampering. + # + # This means that the ID can be decoded by anyone; however, if tampered with (so to point to a different ID), + # the cryptographic signature will no longer match, and the signed id will be considered invalid and return nil + # when passed to +find_signed+ (or raise with +find_signed!+). + # + # It can furthermore be set to expire (the default is not to expire), and scoped down with a specific purpose. + # If the expiration date has been exceeded before +find_signed+ is called, the id won't find the designated + # record. If a purpose is set, this too must match. + # + # If you accidentally let a signed id out in the wild that you wish to retract sooner than its expiration date + # (or maybe you forgot to set an expiration date while meaning to!), you can use the purpose to essentially + # version the signed_id, like so: + # + # user.signed_id purpose: :v2 + # + # And you then change your +find_signed+ calls to require this new purpose. Any old signed ids that were not + # created with the purpose will no longer find the record. + # + # @raise [ArgumentError] + # + # source://activerecord//lib/active_record/signed_id.rb#160 + def signed_id(expires_in: T.unsafe(nil), expires_at: T.unsafe(nil), purpose: T.unsafe(nil)); end + + module GeneratedClassMethods + def _signed_id_verifier; end + def _signed_id_verifier=(value); end + def signed_id_verifier_secret; end + def signed_id_verifier_secret=(value); end + def signed_id_verifier_secret?; end + end + + module GeneratedInstanceMethods + def signed_id_verifier_secret; end + def signed_id_verifier_secret?; end + end +end + +# source://activerecord//lib/active_record/signed_id.rb#42 +module ActiveRecord::SignedId::ClassMethods + # source://activerecord//lib/active_record/signed_id.rb#131 + def combine_signed_id_purposes(purpose); end + + # Lets you find a record based on a signed id that's safe to put into the world without risk of tampering. + # This is particularly useful for things like password reset or email verification, where you want + # the bearer of the signed id to be able to interact with the underlying record, but usually only within + # a certain time period. + # + # You set the time period that the signed id is valid for during generation, using the instance method + # signed_id(expires_in: 15.minutes). If the time has elapsed before a signed find is attempted, + # the signed id will no longer be valid, and nil is returned. + # + # It's possible to further restrict the use of a signed id with a purpose. This helps when you have a + # general base model, like a User, which might have signed ids for several things, like password reset + # or email verification. The purpose that was set during generation must match the purpose set when + # finding. If there's a mismatch, nil is again returned. + # + # ==== Examples + # + # signed_id = User.first.signed_id expires_in: 15.minutes, purpose: :password_reset + # + # User.find_signed signed_id # => nil, since the purpose does not match + # + # travel 16.minutes + # User.find_signed signed_id, purpose: :password_reset # => nil, since the signed id has expired + # + # travel_back + # User.find_signed signed_id, purpose: :password_reset # => User.first + # + # @raise [UnknownPrimaryKey] + # + # source://activerecord//lib/active_record/signed_id.rb#68 + def find_signed(signed_id, purpose: T.unsafe(nil), on_rotation: T.unsafe(nil)); end + + # Works like find_signed, but will raise an ActiveSupport::MessageVerifier::InvalidSignature + # exception if the +signed_id+ has either expired, has a purpose mismatch, is for another record, + # or has been tampered with. It will also raise an ActiveRecord::RecordNotFound exception if + # the valid signed id can't find a record. + # + # ==== Examples + # + # User.find_signed! "bad data" # => ActiveSupport::MessageVerifier::InvalidSignature + # + # signed_id = User.first.signed_id + # User.first.destroy + # User.find_signed! signed_id # => ActiveRecord::RecordNotFound + # + # source://activerecord//lib/active_record/signed_id.rb#89 + def find_signed!(signed_id, purpose: T.unsafe(nil), on_rotation: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/signed_id.rb#96 + def signed_id_verifier; end + + # Allows you to pass in a custom verifier used for the signed ids. This also allows you to use different + # verifiers for different classes. This is also helpful if you need to rotate keys, as you can prepare + # your custom verifier for that in advance. See ActiveSupport::MessageVerifier for details. + # + # source://activerecord//lib/active_record/signed_id.rb#122 + def signed_id_verifier=(verifier); end +end + +# source://activerecord//lib/active_record/base.rb#328 +module ActiveRecord::SignedId::DeprecateSignedIdVerifierSecret + # source://activerecord//lib/active_record/base.rb#328 + def signed_id_verifier_secret=(secret); end +end + +# source://activerecord//lib/active_record/signed_id.rb#32 +module ActiveRecord::SignedId::RelationMethods + # source://activerecord//lib/active_record/signed_id.rb#33 + def find_signed(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/signed_id.rb#37 + def find_signed!(*_arg0, **_arg1, &_arg2); end +end + +# Raised when Active Record finds multiple records but only expected one. +# +# source://activerecord//lib/active_record/errors.rb#191 +class ActiveRecord::SoleRecordExceeded < ::ActiveRecord::ActiveRecordError + # @return [SoleRecordExceeded] a new instance of SoleRecordExceeded + # + # source://activerecord//lib/active_record/errors.rb#194 + def initialize(record = T.unsafe(nil)); end + + # Returns the value of attribute record. + # + # source://activerecord//lib/active_record/errors.rb#192 + def record; end +end + +# source://activerecord//lib/active_record/relation/spawn_methods.rb#8 +module ActiveRecord::SpawnMethods + # Removes the condition(s) specified in +skips+ from the query. + # + # Post.order('id asc').except(:order) # removes the order condition + # Post.where('id > 10').order('id asc').except(:where) # removes the where condition but keeps the order + # + # source://activerecord//lib/active_record/relation/spawn_methods.rb#59 + def except(*skips); end + + # Merges in the conditions from other, if other is an ActiveRecord::Relation. + # Returns an array representing the intersection of the resulting records with other, if other is an array. + # + # Post.where(published: true).joins(:comments).merge( Comment.where(spam: false) ) + # # Performs a single join query with both where conditions. + # + # recent_posts = Post.order('created_at DESC').first(5) + # Post.where(published: true).merge(recent_posts) + # # Returns the intersection of all published posts with the 5 most recently created posts. + # # (This is just an example. You'd probably want to do this with a single query!) + # + # Procs will be evaluated by merge: + # + # Post.where(published: true).merge(-> { joins(:comments) }) + # # => Post.where(published: true).joins(:comments) + # + # This is mainly intended for sharing common conditions between multiple associations. + # + # For conditions that exist in both relations, those from other will take precedence. + # To find the intersection of two relations, use QueryMethods#and. + # + # source://activerecord//lib/active_record/relation/spawn_methods.rb#33 + def merge(other, *rest); end + + # source://activerecord//lib/active_record/relation/spawn_methods.rb#43 + def merge!(other, *rest); end + + # Keeps only the condition(s) specified in +onlies+ in the query, removing all others. + # + # Post.order('id asc').only(:where) # keeps only the where condition, removes the order + # Post.order('id asc').only(:where, :order) # keeps only the where and order conditions + # + # source://activerecord//lib/active_record/relation/spawn_methods.rb#67 + def only(*onlies); end + + # source://activerecord//lib/active_record/relation/spawn_methods.rb#9 + def spawn; end + + private + + # source://activerecord//lib/active_record/relation/spawn_methods.rb#72 + def relation_with(values); end +end + +# Raised on attempt to save stale record. Record is stale when it's being saved in another query after +# instantiation, for example, when two users edit the same wiki page and one starts editing and saves +# the page before the other. +# +# Read more about optimistic locking in ActiveRecord::Locking module +# documentation. +# +# source://activerecord//lib/active_record/errors.rb#378 +class ActiveRecord::StaleObjectError < ::ActiveRecord::ActiveRecordError + # @return [StaleObjectError] a new instance of StaleObjectError + # + # source://activerecord//lib/active_record/errors.rb#381 + def initialize(record = T.unsafe(nil), attempted_action = T.unsafe(nil)); end + + # Returns the value of attribute attempted_action. + # + # source://activerecord//lib/active_record/errors.rb#379 + def attempted_action; end + + # Returns the value of attribute record. + # + # source://activerecord//lib/active_record/errors.rb#379 + def record; end +end + +# Statement cache is used to cache a single statement in order to avoid creating the AST again. +# Initializing the cache is done by passing the statement in the create block: +# +# cache = StatementCache.create(ClothingItem.lease_connection) do |params| +# Book.where(name: "my book").where("author_id > 3") +# end +# +# The cached statement is executed by using the +# {connection.execute}[rdoc-ref:ConnectionAdapters::DatabaseStatements#execute] method: +# +# cache.execute([], ClothingItem.lease_connection) +# +# The relation returned by the block is cached, and for each +# {execute}[rdoc-ref:ConnectionAdapters::DatabaseStatements#execute] +# call the cached relation gets duped. Database is queried when +to_a+ is called on the relation. +# +# If you want to cache the statement without the values you can use the +bind+ method of the +# block parameter. +# +# cache = StatementCache.create(ClothingItem.lease_connection) do |params| +# Book.where(name: params.bind) +# end +# +# And pass the bind values as the first argument of +execute+ call. +# +# cache.execute(["my book"], ClothingItem.lease_connection) +# +# source://activerecord//lib/active_record/statement_cache.rb#30 +class ActiveRecord::StatementCache + # @return [StatementCache] a new instance of StatementCache + # + # source://activerecord//lib/active_record/statement_cache.rb#143 + def initialize(query_builder, bind_map, model); end + + # source://activerecord//lib/active_record/statement_cache.rb#149 + def execute(params, connection, async: T.unsafe(nil), &block); end + + class << self + # source://activerecord//lib/active_record/statement_cache.rb#136 + def create(connection, callable = T.unsafe(nil), &block); end + + # source://activerecord//lib/active_record/statement_cache.rb#105 + def partial_query(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/statement_cache.rb#109 + def partial_query_collector; end + + # source://activerecord//lib/active_record/statement_cache.rb#101 + def query(*_arg0, **_arg1, &_arg2); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/statement_cache.rb#162 + def unsupported_value?(value); end + end +end + +# source://activerecord//lib/active_record/statement_cache.rb#117 +class ActiveRecord::StatementCache::BindMap + # @return [BindMap] a new instance of BindMap + # + # source://activerecord//lib/active_record/statement_cache.rb#118 + def initialize(bound_attributes); end + + # source://activerecord//lib/active_record/statement_cache.rb#129 + def bind(values); end +end + +# source://activerecord//lib/active_record/statement_cache.rb#113 +class ActiveRecord::StatementCache::Params + # source://activerecord//lib/active_record/statement_cache.rb#114 + def bind; end +end + +# source://activerecord//lib/active_record/statement_cache.rb#46 +class ActiveRecord::StatementCache::PartialQuery < ::ActiveRecord::StatementCache::Query + # @return [PartialQuery] a new instance of PartialQuery + # + # source://activerecord//lib/active_record/statement_cache.rb#47 + def initialize(values, retryable:); end + + # source://activerecord//lib/active_record/statement_cache.rb#55 + def sql_for(binds, connection); end +end + +# source://activerecord//lib/active_record/statement_cache.rb#68 +class ActiveRecord::StatementCache::PartialQueryCollector + # @return [PartialQueryCollector] a new instance of PartialQueryCollector + # + # source://activerecord//lib/active_record/statement_cache.rb#71 + def initialize; end + + # source://activerecord//lib/active_record/statement_cache.rb#76 + def <<(str); end + + # source://activerecord//lib/active_record/statement_cache.rb#81 + def add_bind(obj, &_arg1); end + + # source://activerecord//lib/active_record/statement_cache.rb#87 + def add_binds(binds, proc_for_binds = T.unsafe(nil), &_arg2); end + + # Returns the value of attribute preparable. + # + # source://activerecord//lib/active_record/statement_cache.rb#69 + def preparable; end + + # Sets the attribute preparable + # + # @param value the value to set the attribute preparable to. + # + # source://activerecord//lib/active_record/statement_cache.rb#69 + def preparable=(_arg0); end + + # Returns the value of attribute retryable. + # + # source://activerecord//lib/active_record/statement_cache.rb#69 + def retryable; end + + # Sets the attribute retryable + # + # @param value the value to set the attribute retryable to. + # + # source://activerecord//lib/active_record/statement_cache.rb#69 + def retryable=(_arg0); end + + # source://activerecord//lib/active_record/statement_cache.rb#96 + def value; end +end + +# source://activerecord//lib/active_record/statement_cache.rb#33 +class ActiveRecord::StatementCache::Query + # @return [Query] a new instance of Query + # + # source://activerecord//lib/active_record/statement_cache.rb#36 + def initialize(sql, retryable:); end + + # source://activerecord//lib/active_record/statement_cache.rb#34 + def retryable; end + + # source://activerecord//lib/active_record/statement_cache.rb#41 + def sql_for(binds, connection); end +end + +# source://activerecord//lib/active_record/statement_cache.rb#31 +class ActiveRecord::StatementCache::Substitute; end + +# Superclass for all database execution errors. +# +# Wraps the underlying database error as +cause+. +# +# source://activerecord//lib/active_record/errors.rb#203 +class ActiveRecord::StatementInvalid < ::ActiveRecord::AdapterError + # @return [StatementInvalid] a new instance of StatementInvalid + # + # source://activerecord//lib/active_record/errors.rb#204 + def initialize(message = T.unsafe(nil), sql: T.unsafe(nil), binds: T.unsafe(nil), connection_pool: T.unsafe(nil)); end + + # Returns the value of attribute binds. + # + # source://activerecord//lib/active_record/errors.rb#210 + def binds; end + + # source://activerecord//lib/active_record/errors.rb#212 + def set_query(sql, binds); end + + # Returns the value of attribute sql. + # + # source://activerecord//lib/active_record/errors.rb#210 + def sql; end +end + +# StatementTimeout will be raised when statement timeout exceeded. +# +# source://activerecord//lib/active_record/errors.rb#582 +class ActiveRecord::StatementTimeout < ::ActiveRecord::QueryAborted; end + +# = Active Record \Store +# +# Store gives you a thin wrapper around serialize for the purpose of storing hashes in a single column. +# It's like a simple key/value store baked into your record when you don't care about being able to +# query that store outside the context of a single record. +# +# You can then declare accessors to this store that are then accessible just like any other attribute +# of the model. This is very helpful for easily exposing store keys to a form or elsewhere that's +# already built around just accessing attributes on the model. +# +# Every accessor comes with dirty tracking methods (+key_changed?+, +key_was+ and +key_change+) and +# methods to access the changes made during the last save (+saved_change_to_key?+, +saved_change_to_key+ and +# +key_before_last_save+). +# +# NOTE: There is no +key_will_change!+ method for accessors, use +store_will_change!+ instead. +# +# Make sure that you declare the database column used for the serialized store as a text, so there's +# plenty of room. +# +# You can set custom coder to encode/decode your serialized attributes to/from different formats. +# JSON, YAML, Marshal are supported out of the box. Generally it can be any wrapper that provides +load+ and +dump+. +# +# NOTE: If you are using structured database data types (e.g. PostgreSQL +hstore+/+json+, MySQL 5.7+ +# +json+, or SQLite 3.38+ +json+) there is no need for the serialization provided by {.store}[rdoc-ref:rdoc-ref:ClassMethods#store]. +# Simply use {.store_accessor}[rdoc-ref:ClassMethods#store_accessor] instead to generate +# the accessor methods. Be aware that these columns use a string keyed hash and do not allow access +# using a symbol. +# +# NOTE: The default validations with the exception of +uniqueness+ will work. +# For example, if you want to check for +uniqueness+ with +hstore+ you will +# need to use a custom validation to handle it. +# +# Examples: +# +# class User < ActiveRecord::Base +# store :settings, accessors: [ :color, :homepage ], coder: JSON +# store :parent, accessors: [ :name ], coder: JSON, prefix: true +# store :spouse, accessors: [ :name ], coder: JSON, prefix: :partner +# store :settings, accessors: [ :two_factor_auth ], suffix: true +# store :settings, accessors: [ :login_retry ], suffix: :config +# end +# +# u = User.new(color: 'black', homepage: '37signals.com', parent_name: 'Mary', partner_name: 'Lily') +# u.color # Accessor stored attribute +# u.parent_name # Accessor stored attribute with prefix +# u.partner_name # Accessor stored attribute with custom prefix +# u.two_factor_auth_settings # Accessor stored attribute with suffix +# u.login_retry_config # Accessor stored attribute with custom suffix +# u.settings[:country] = 'Denmark' # Any attribute, even if not specified with an accessor +# +# # There is no difference between strings and symbols for accessing custom attributes +# u.settings[:country] # => 'Denmark' +# u.settings['country'] # => 'Denmark' +# +# # Dirty tracking +# u.color = 'green' +# u.color_changed? # => true +# u.color_was # => 'black' +# u.color_change # => ['black', 'green'] +# +# # Add additional accessors to an existing store through store_accessor +# class SuperUser < User +# store_accessor :settings, :privileges, :servants +# store_accessor :parent, :birthday, prefix: true +# store_accessor :settings, :secret_question, suffix: :config +# end +# +# The stored attribute names can be retrieved using {.stored_attributes}[rdoc-ref:rdoc-ref:ClassMethods#stored_attributes]. +# +# User.stored_attributes[:settings] # => [:color, :homepage, :two_factor_auth, :login_retry] +# +# == Overwriting default accessors +# +# All stored values are automatically available through accessors on the Active Record +# object, but sometimes you want to specialize this behavior. This can be done by overwriting +# the default accessors (using the same name as the attribute) and calling super +# to actually change things. +# +# class Song < ActiveRecord::Base +# # Uses a stored integer to hold the volume adjustment of the song +# store :settings, accessors: [:volume_adjustment] +# +# def volume_adjustment=(decibels) +# super(decibels.to_i) +# end +# +# def volume_adjustment +# super.to_i +# end +# end +# +# source://activerecord//lib/active_record/store.rb#96 +module ActiveRecord::Store + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::Store::ClassMethods + + private + + # source://activerecord//lib/active_record/store.rb#215 + def read_store_attribute(store_attribute, key); end + + # source://activerecord//lib/active_record/store.rb#225 + def store_accessor_for(store_attribute); end + + # source://activerecord//lib/active_record/store.rb#220 + def write_store_attribute(store_attribute, key, value); end +end + +# source://activerecord//lib/active_record/store.rb#105 +module ActiveRecord::Store::ClassMethods + # source://activerecord//lib/active_record/store.rb#197 + def _store_accessors_module; end + + # source://activerecord//lib/active_record/store.rb#106 + def store(store_attribute, options = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/store.rb#112 + def store_accessor(store_attribute, *keys, prefix: T.unsafe(nil), suffix: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/store.rb#205 + def stored_attributes; end +end + +# source://activerecord//lib/active_record/store.rb#233 +class ActiveRecord::Store::HashAccessor + class << self + # source://activerecord//lib/active_record/store.rb#234 + def get(store_object, key); end + + # source://activerecord//lib/active_record/store.rb#250 + def prepare(object, attribute); end + + # source://activerecord//lib/active_record/store.rb#240 + def read(object, attribute, key); end + + # source://activerecord//lib/active_record/store.rb#245 + def write(object, attribute, key, value); end + end +end + +# source://activerecord//lib/active_record/store.rb#289 +class ActiveRecord::Store::IndifferentCoder + # @return [IndifferentCoder] a new instance of IndifferentCoder + # + # source://activerecord//lib/active_record/store.rb#290 + def initialize(attr_name, coder_or_class_name); end + + # source://activerecord//lib/active_record/store.rb#299 + def dump(obj); end + + # source://activerecord//lib/active_record/store.rb#303 + def load(yaml); end + + private + + # source://activerecord//lib/active_record/store.rb#319 + def as_regular_hash(obj); end + + class << self + # source://activerecord//lib/active_record/store.rb#307 + def as_indifferent_hash(obj); end + end +end + +# source://activerecord//lib/active_record/store.rb#276 +class ActiveRecord::Store::IndifferentHashAccessor < ::ActiveRecord::Store::HashAccessor + class << self + # source://activerecord//lib/active_record/store.rb#277 + def prepare(object, attribute); end + end +end + +# source://activerecord//lib/active_record/store.rb#262 +class ActiveRecord::Store::StringKeyedHashAccessor < ::ActiveRecord::Store::HashAccessor + class << self + # source://activerecord//lib/active_record/store.rb#263 + def get(store_object, key); end + + # source://activerecord//lib/active_record/store.rb#267 + def read(object, attribute, key); end + + # source://activerecord//lib/active_record/store.rb#271 + def write(object, attribute, key, value); end + end +end + +# Raised on attempt to lazily load records that are marked as strict loading. +# +# You can resolve this error by eager loading marked records before accessing +# them. The +# {Eager Loading Associations}[https://guides.rubyonrails.org/active_record_querying.html#eager-loading-associations] +# guide covers solutions, such as using +# {ActiveRecord::Base.includes}[rdoc-ref:QueryMethods#includes]. +# +# source://activerecord//lib/active_record/errors.rb#411 +class ActiveRecord::StrictLoadingViolationError < ::ActiveRecord::ActiveRecordError; end + +# Raised when the single-table inheritance mechanism fails to locate the subclass +# (for example due to improper usage of column that +# {ActiveRecord::Base.inheritance_column}[rdoc-ref:ModelSchema.inheritance_column] +# points to). +# +# source://activerecord//lib/active_record/errors.rb#17 +class ActiveRecord::SubclassNotFound < ::ActiveRecord::ActiveRecordError; end + +# = Active Record \Suppressor +# +# ActiveRecord::Suppressor prevents the receiver from being saved during +# a given block. +# +# For example, here's a pattern of creating notifications when new comments +# are posted. (The notification may in turn trigger an email, a push +# notification, or just appear in the UI somewhere): +# +# class Comment < ActiveRecord::Base +# belongs_to :commentable, polymorphic: true +# after_create -> { Notification.create! comment: self, +# recipients: commentable.recipients } +# end +# +# That's what you want the bulk of the time. New comment creates a new +# Notification. But there may well be off cases, like copying a commentable +# and its comments, where you don't want that. So you'd have a concern +# something like this: +# +# module Copyable +# def copy_to(destination) +# Notification.suppress do +# # Copy logic that creates new comments that we do not want +# # triggering notifications. +# end +# end +# end +# +# source://activerecord//lib/active_record/suppressor.rb#32 +module ActiveRecord::Suppressor + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::Suppressor::ClassMethods + + # source://activerecord//lib/active_record/suppressor.rb#51 + def save(**_arg0); end + + # source://activerecord//lib/active_record/suppressor.rb#55 + def save!(**_arg0); end + + class << self + # source://activerecord//lib/active_record/suppressor.rb#36 + def registry; end + end +end + +# source://activerecord//lib/active_record/suppressor.rb#41 +module ActiveRecord::Suppressor::ClassMethods + # source://activerecord//lib/active_record/suppressor.rb#42 + def suppress(&block); end +end + +# source://activerecord//lib/active_record/table_metadata.rb#4 +class ActiveRecord::TableMetadata + # @return [TableMetadata] a new instance of TableMetadata + # + # source://activerecord//lib/active_record/table_metadata.rb#5 + def initialize(klass, arel_table); end + + # source://activerecord//lib/active_record/table_metadata.rb#53 + def aggregated_with?(aggregation_name); end + + # Returns the value of attribute arel_table. + # + # source://activerecord//lib/active_record/table_metadata.rb#63 + def arel_table; end + + # source://activerecord//lib/active_record/table_metadata.rb#26 + def associated_table(table_name); end + + # source://activerecord//lib/active_record/table_metadata.rb#22 + def associated_with(table_name); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/table_metadata.rb#18 + def has_column?(column_name); end + + # source://activerecord//lib/active_record/table_metadata.rb#55 + def predicate_builder; end + + # source://activerecord//lib/active_record/table_metadata.rb#10 + def primary_key; end + + # source://activerecord//lib/active_record/table_metadata.rb#50 + def reflect_on_aggregation(aggregation_name); end + + # source://activerecord//lib/active_record/table_metadata.rb#14 + def type(column_name); end + + private + + # Returns the value of attribute klass. + # + # source://activerecord//lib/active_record/table_metadata.rb#66 + def klass; end +end + +# Raised when a model makes a query but it has not specified an associated table. +# +# source://activerecord//lib/active_record/errors.rb#45 +class ActiveRecord::TableNotSpecified < ::ActiveRecord::ActiveRecordError; end + +# source://activerecord//lib/active_record.rb#174 +module ActiveRecord::Tasks + extend ::ActiveSupport::Autoload +end + +# source://activerecord//lib/active_record/tasks/abstract_tasks.rb#5 +class ActiveRecord::Tasks::AbstractTasks + # @return [AbstractTasks] a new instance of AbstractTasks + # + # source://activerecord//lib/active_record/tasks/abstract_tasks.rb#10 + def initialize(db_config); end + + # source://activerecord//lib/active_record/tasks/abstract_tasks.rb#15 + def charset; end + + # source://activerecord//lib/active_record/tasks/abstract_tasks.rb#23 + def check_current_protected_environment!(db_config, migration_class); end + + # source://activerecord//lib/active_record/tasks/abstract_tasks.rb#19 + def collation; end + + private + + # Returns the value of attribute configuration_hash. + # + # source://activerecord//lib/active_record/tasks/abstract_tasks.rb#41 + def configuration_hash; end + + # source://activerecord//lib/active_record/tasks/abstract_tasks.rb#51 + def configuration_hash_without_database; end + + # source://activerecord//lib/active_record/tasks/abstract_tasks.rb#43 + def connection; end + + # Returns the value of attribute db_config. + # + # source://activerecord//lib/active_record/tasks/abstract_tasks.rb#41 + def db_config; end + + # source://activerecord//lib/active_record/tasks/abstract_tasks.rb#47 + def establish_connection(config = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/tasks/abstract_tasks.rb#55 + def run_cmd(cmd, *args, **opts); end + + # source://activerecord//lib/active_record/tasks/abstract_tasks.rb#59 + def run_cmd_error(cmd, args); end + + # source://activerecord//lib/active_record/tasks/abstract_tasks.rb#66 + def with_temporary_pool(db_config, migration_class, clobber: T.unsafe(nil)); end + + class << self + # @return [Boolean] + # + # source://activerecord//lib/active_record/tasks/abstract_tasks.rb#6 + def using_database_configurations?; end + end +end + +# source://activerecord//lib/active_record/tasks/database_tasks.rb#7 +class ActiveRecord::Tasks::DatabaseNotSupported < ::StandardError; end + +# = Active Record \DatabaseTasks +# +# ActiveRecord::Tasks::DatabaseTasks is a utility class, which encapsulates +# logic behind common tasks used to manage database and migrations. +# +# The tasks defined here are used with \Rails commands provided by Active Record. +# +# In order to use DatabaseTasks, a few config values need to be set. All the needed +# config values are set by \Rails already, so it's necessary to do it only if you +# want to change the defaults or when you want to use Active Record outside of \Rails +# (in such case after configuring the database tasks, you can also use the rake tasks +# defined in Active Record). +# +# The possible config values are: +# +# * +env+: current environment (like Rails.env). +# * +database_configuration+: configuration of your databases (as in +config/database.yml+). +# * +db_dir+: your +db+ directory. +# * +fixtures_path+: a path to fixtures directory. +# * +migrations_paths+: a list of paths to directories with migrations. +# * +seed_loader+: an object which will load seeds, it needs to respond to the +load_seed+ method. +# * +root+: a path to the root of the application. +# +# Example usage of DatabaseTasks outside \Rails could look as such: +# +# include ActiveRecord::Tasks +# DatabaseTasks.database_configuration = YAML.load_file('my_database_config.yml') +# DatabaseTasks.db_dir = 'db' +# # other settings... +# +# DatabaseTasks.create_current('production') +# +# source://activerecord//lib/active_record/tasks/database_tasks.rb#40 +module ActiveRecord::Tasks::DatabaseTasks + extend ::ActiveRecord::Tasks::DatabaseTasks + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#484 + def cache_dump_filename(db_config, schema_cache_path: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#330 + def charset(configuration, *arguments); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#325 + def charset_current(env_name = T.unsafe(nil), db_name = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#65 + def check_protected_environments!(environment = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#498 + def check_schema_file(filename); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#315 + def check_target_version; end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#524 + def clear_schema_cache(filename); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#340 + def collation(configuration, *arguments); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#335 + def collation_current(env_name = T.unsafe(nil), db_name = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#115 + def create(configuration, *arguments); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#127 + def create_all; end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#168 + def create_current(environment = T.unsafe(nil), name = T.unsafe(nil)); end + + # Returns the value of attribute database_configuration. + # + # source://activerecord//lib/active_record/tasks/database_tasks.rb#61 + def database_configuration; end + + # Sets the attribute database_configuration + # + # @param value the value to set the attribute database_configuration to. + # + # source://activerecord//lib/active_record/tasks/database_tasks.rb#61 + def database_configuration=(_arg0); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#283 + def db_configs_with_versions(environment = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#83 + def db_dir; end + + # Sets the attribute db_dir + # + # @param value the value to set the attribute db_dir to. + # + # source://activerecord//lib/active_record/tasks/database_tasks.rb#60 + def db_dir=(_arg0); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#208 + def drop(configuration, *arguments); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#220 + def drop_all; end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#224 + def drop_current(environment = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#430 + def dump_all; end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#443 + def dump_schema(db_config, format = T.unsafe(nil)); end + + # Dumps the schema cache in YAML format for the connection into the file + # + # ==== Examples + # ActiveRecord::Tasks::DatabaseTasks.dump_schema_cache(ActiveRecord::Base.lease_connection, "tmp/schema_dump.yaml") + # + # source://activerecord//lib/active_record/tasks/database_tasks.rb#520 + def dump_schema_cache(conn_or_pool, filename); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#103 + def env; end + + # Sets the attribute env + # + # @param value the value to set the attribute env to. + # + # source://activerecord//lib/active_record/tasks/database_tasks.rb#60 + def env=(_arg0); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#91 + def fixtures_path; end + + # Sets the attribute fixtures_path + # + # @param value the value to set the attribute fixtures_path to. + # + # source://activerecord//lib/active_record/tasks/database_tasks.rb#60 + def fixtures_path=(_arg0); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#141 + def for_each(databases); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#374 + def load_schema(db_config, format = T.unsafe(nil), file = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#490 + def load_schema_current(format = T.unsafe(nil), file = T.unsafe(nil), environment = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#506 + def load_seed; end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#260 + def migrate(version = T.unsafe(nil), skip_initialize: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#241 + def migrate_all; end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#300 + def migrate_status; end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#545 + def migration_class; end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#549 + def migration_connection; end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#553 + def migration_connection_pool; end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#87 + def migrations_paths; end + + # Sets the attribute migrations_paths + # + # @param value the value to set the attribute migrations_paths to. + # + # source://activerecord//lib/active_record/tasks/database_tasks.rb#60 + def migrations_paths=(_arg0); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#107 + def name; end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#174 + def prepare_all; end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#345 + def purge(configuration); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#350 + def purge_all; end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#354 + def purge_current(environment = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#154 + def raise_for_multi_db(environment = T.unsafe(nil), command:); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#412 + def reconstruct_from_schema(db_config, file = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#73 + def register_task(pattern, task); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#99 + def root; end + + # Sets the attribute root + # + # @param value the value to set the attribute root to. + # + # source://activerecord//lib/active_record/tasks/database_tasks.rb#60 + def root=(_arg0); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#471 + def schema_dump_path(db_config, format = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/tasks/database_tasks.rb#396 + def schema_up_to_date?(configuration, _ = T.unsafe(nil), file = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#111 + def seed_loader; end + + # Sets the attribute seed_loader + # + # @param value the value to set the attribute seed_loader to. + # + # source://activerecord//lib/active_record/tasks/database_tasks.rb#60 + def seed_loader=(_arg0); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#135 + def setup_initial_database_yaml; end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#360 + def structure_dump(configuration, *arguments); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#367 + def structure_load(configuration, *arguments); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#321 + def target_version; end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#235 + def truncate_all(environment = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#539 + def with_temporary_connection(db_config, clobber: T.unsafe(nil), &block); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#528 + def with_temporary_pool_for_each(env: T.unsafe(nil), name: T.unsafe(nil), clobber: T.unsafe(nil), &block); end + + private + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#590 + def class_for_adapter(adapter); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#567 + def configs_for(**options); end + + # Create a new instance for the specified db configuration object + # For classes that have been converted to use db_config objects, pass a + # `DatabaseConfig`, otherwise pass a `Hash` + # + # source://activerecord//lib/active_record/tasks/database_tasks.rb#582 + def database_adapter_for(db_config, *arguments); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#598 + def each_current_configuration(environment, name = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#608 + def each_current_environment(environment, &block); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#614 + def each_local_configuration; end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#651 + def initialize_database(db_config); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/tasks/database_tasks.rb#626 + def local_database?(db_config); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#571 + def resolve_configuration(configuration); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#631 + def schema_sha1(file); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#635 + def structure_dump_flags_for(adapter); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#643 + def structure_load_flags_for(adapter); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#228 + def truncate_tables(db_config); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/tasks/database_tasks.rb#575 + def verbose?; end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#558 + def with_temporary_pool(db_config, clobber: T.unsafe(nil)); end + + class << self + # source://activerecord//lib/active_record/tasks/database_tasks.rb#50 + def structure_dump_flags; end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#50 + def structure_dump_flags=(val); end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#56 + def structure_load_flags; end + + # source://activerecord//lib/active_record/tasks/database_tasks.rb#56 + def structure_load_flags=(val); end + end +end + +# source://activerecord//lib/active_record/tasks/database_tasks.rb#63 +ActiveRecord::Tasks::DatabaseTasks::LOCAL_HOSTS = T.let(T.unsafe(nil), Array) + +# source://activerecord//lib/active_record/tasks/mysql_database_tasks.rb#5 +class ActiveRecord::Tasks::MySQLDatabaseTasks < ::ActiveRecord::Tasks::AbstractTasks + # source://activerecord//lib/active_record/tasks/mysql_database_tasks.rb#23 + def charset; end + + # source://activerecord//lib/active_record/tasks/mysql_database_tasks.rb#6 + def create; end + + # source://activerecord//lib/active_record/tasks/mysql_database_tasks.rb#12 + def drop; end + + # source://activerecord//lib/active_record/tasks/mysql_database_tasks.rb#17 + def purge; end + + # source://activerecord//lib/active_record/tasks/mysql_database_tasks.rb#27 + def structure_dump(filename, extra_flags); end + + # source://activerecord//lib/active_record/tasks/mysql_database_tasks.rb#46 + def structure_load(filename, extra_flags); end + + private + + # source://activerecord//lib/active_record/tasks/mysql_database_tasks.rb#56 + def creation_options; end + + # source://activerecord//lib/active_record/tasks/mysql_database_tasks.rb#63 + def prepare_command_options; end +end + +# source://activerecord//lib/active_record/tasks/postgresql_database_tasks.rb#7 +class ActiveRecord::Tasks::PostgreSQLDatabaseTasks < ::ActiveRecord::Tasks::AbstractTasks + # source://activerecord//lib/active_record/tasks/postgresql_database_tasks.rb#12 + def create(connection_already_established = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/tasks/postgresql_database_tasks.rb#18 + def drop; end + + # source://activerecord//lib/active_record/tasks/postgresql_database_tasks.rb#23 + def purge; end + + # source://activerecord//lib/active_record/tasks/postgresql_database_tasks.rb#29 + def structure_dump(filename, extra_flags); end + + # source://activerecord//lib/active_record/tasks/postgresql_database_tasks.rb#63 + def structure_load(filename, extra_flags); end + + private + + # source://activerecord//lib/active_record/tasks/postgresql_database_tasks.rb#72 + def encoding; end + + # source://activerecord//lib/active_record/tasks/postgresql_database_tasks.rb#80 + def psql_env; end + + # source://activerecord//lib/active_record/tasks/postgresql_database_tasks.rb#76 + def public_schema_config; end + + # source://activerecord//lib/active_record/tasks/postgresql_database_tasks.rb#97 + def remove_sql_header_comments(filename); end + + # source://activerecord//lib/active_record/tasks/postgresql_database_tasks.rb#93 + def run_cmd(cmd, *args, **opts); end +end + +# source://activerecord//lib/active_record/tasks/postgresql_database_tasks.rb#8 +ActiveRecord::Tasks::PostgreSQLDatabaseTasks::DEFAULT_ENCODING = T.let(T.unsafe(nil), String) + +# source://activerecord//lib/active_record/tasks/postgresql_database_tasks.rb#9 +ActiveRecord::Tasks::PostgreSQLDatabaseTasks::ON_ERROR_STOP_1 = T.let(T.unsafe(nil), String) + +# source://activerecord//lib/active_record/tasks/postgresql_database_tasks.rb#10 +ActiveRecord::Tasks::PostgreSQLDatabaseTasks::SQL_COMMENT_BEGIN = T.let(T.unsafe(nil), String) + +# source://activerecord//lib/active_record/tasks/sqlite_database_tasks.rb#5 +class ActiveRecord::Tasks::SQLiteDatabaseTasks < ::ActiveRecord::Tasks::AbstractTasks + # @return [SQLiteDatabaseTasks] a new instance of SQLiteDatabaseTasks + # + # source://activerecord//lib/active_record/tasks/sqlite_database_tasks.rb#6 + def initialize(db_config, root = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/tasks/sqlite_database_tasks.rb#58 + def check_current_protected_environment!(db_config, migration_class); end + + # @raise [DatabaseAlreadyExists] + # + # source://activerecord//lib/active_record/tasks/sqlite_database_tasks.rb#11 + def create; end + + # source://activerecord//lib/active_record/tasks/sqlite_database_tasks.rb#18 + def drop; end + + # source://activerecord//lib/active_record/tasks/sqlite_database_tasks.rb#27 + def purge; end + + # source://activerecord//lib/active_record/tasks/sqlite_database_tasks.rb#36 + def structure_dump(filename, extra_flags); end + + # source://activerecord//lib/active_record/tasks/sqlite_database_tasks.rb#53 + def structure_load(filename, extra_flags); end + + private + + # source://activerecord//lib/active_record/tasks/sqlite_database_tasks.rb#71 + def establish_connection(config = T.unsafe(nil)); end + + # Returns the value of attribute root. + # + # source://activerecord//lib/active_record/tasks/sqlite_database_tasks.rb#69 + def root; end +end + +# source://activerecord//lib/active_record/test_databases.rb#6 +module ActiveRecord::TestDatabases + class << self + # source://activerecord//lib/active_record/test_databases.rb#19 + def create_and_load_schema(i, env_name:); end + end +end + +# source://activerecord//lib/active_record/test_fixtures.rb#6 +module ActiveRecord::TestFixtures + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveRecord::TestFixtures::ClassMethods + + # source://activerecord//lib/active_record/test_fixtures.rb#14 + def after_teardown; end + + # source://activerecord//lib/active_record/test_fixtures.rb#9 + def before_setup; end + + # Generic fixture accessor for fixture names that may conflict with other methods. + # + # assert_equal "Ruby on Rails", web_sites(:rubyonrails).name + # assert_equal "Ruby on Rails", fixture(:web_sites, :rubyonrails).name + # + # source://activerecord//lib/active_record/test_fixtures.rb#118 + def fixture(fixture_set_name, *fixture_names); end + + private + + # source://activerecord//lib/active_record/test_fixtures.rb#325 + def access_fixture(fs_name, *fixture_names); end + + # source://activerecord//lib/active_record/test_fixtures.rb#317 + def active_record_fixture(fixture_set_name, *fixture_names); end + + # source://activerecord//lib/active_record/test_fixtures.rb#285 + def instantiate_fixtures; end + + # source://activerecord//lib/active_record/test_fixtures.rb#184 + def invalidate_already_loaded_fixtures; end + + # source://activerecord//lib/active_record/test_fixtures.rb#281 + def load_fixtures(config); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/test_fixtures.rb#297 + def load_instances?; end + + # source://activerecord//lib/active_record/test_fixtures.rb#301 + def method_missing(method, *_arg1, **_arg2, &_arg3); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/test_fixtures.rb#309 + def respond_to_missing?(method, include_private = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/test_fixtures.rb#123 + def run_in_transaction?; end + + # source://activerecord//lib/active_record/test_fixtures.rb#176 + def setup_asynchronous_queries_session; end + + # source://activerecord//lib/active_record/test_fixtures.rb#129 + def setup_fixtures(config = T.unsafe(nil)); end + + # Shares the writing connection pool with connections on + # other handlers. + # + # In an application with a primary and replica the test fixtures + # need to share a connection pool so that the reading connection + # can see data in the open transaction on the writing connection. + # + # source://activerecord//lib/active_record/test_fixtures.rb#245 + def setup_shared_connection_pool; end + + # source://activerecord//lib/active_record/test_fixtures.rb#192 + def setup_transactional_fixtures; end + + # source://activerecord//lib/active_record/test_fixtures.rb#180 + def teardown_asynchronous_queries_session; end + + # source://activerecord//lib/active_record/test_fixtures.rb#162 + def teardown_fixtures; end + + # source://activerecord//lib/active_record/test_fixtures.rb#264 + def teardown_shared_connection_pool; end + + # source://activerecord//lib/active_record/test_fixtures.rb#227 + def teardown_transactional_fixtures; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/test_fixtures.rb#188 + def transactional_tests_for_pool?(pool); end + + module GeneratedClassMethods + def database_transactions_config; end + def database_transactions_config=(value); end + def database_transactions_config?; end + def fixture_class_names; end + def fixture_class_names=(value); end + def fixture_class_names?; end + def fixture_paths; end + def fixture_paths=(value); end + def fixture_paths?; end + def fixture_sets; end + def fixture_sets=(value); end + def fixture_sets?; end + def fixture_table_names; end + def fixture_table_names=(value); end + def fixture_table_names?; end + def lock_threads; end + def lock_threads=(value); end + def lock_threads?; end + def pre_loaded_fixtures; end + def pre_loaded_fixtures=(value); end + def pre_loaded_fixtures?; end + def use_instantiated_fixtures; end + def use_instantiated_fixtures=(value); end + def use_instantiated_fixtures?; end + def use_transactional_tests; end + def use_transactional_tests=(value); end + def use_transactional_tests?; end + end + + module GeneratedInstanceMethods + def database_transactions_config; end + def database_transactions_config=(value); end + def database_transactions_config?; end + def fixture_class_names; end + def fixture_class_names=(value); end + def fixture_class_names?; end + def fixture_paths; end + def fixture_paths?; end + def fixture_sets; end + def fixture_sets=(value); end + def fixture_sets?; end + def fixture_table_names; end + def fixture_table_names=(value); end + def fixture_table_names?; end + def lock_threads; end + def lock_threads=(value); end + def lock_threads?; end + def pre_loaded_fixtures; end + def pre_loaded_fixtures=(value); end + def pre_loaded_fixtures?; end + def use_instantiated_fixtures; end + def use_instantiated_fixtures=(value); end + def use_instantiated_fixtures?; end + def use_transactional_tests; end + def use_transactional_tests=(value); end + def use_transactional_tests?; end + end +end + +# source://activerecord//lib/active_record/test_fixtures.rb#44 +module ActiveRecord::TestFixtures::ClassMethods + # source://activerecord//lib/active_record/test_fixtures.rb#71 + def fixtures(*fixture_set_names); end + + # Sets the model class for a fixture when the class name cannot be inferred from the fixture name. + # + # Examples: + # + # set_fixture_class some_fixture: SomeModel, + # 'namespaced/fixture' => Another::Model + # + # The keys must be the fixture names, that coincide with the short paths to the fixture files. + # + # source://activerecord//lib/active_record/test_fixtures.rb#67 + def set_fixture_class(class_names = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/test_fixtures.rb#87 + def setup_fixture_accessors(fixture_set_names = T.unsafe(nil)); end + + # Do not use transactional tests for the given database. This overrides + # the default setting as defined by `use_transactional_tests`, which + # applies to all database connection pools not explicitly configured here. + # + # source://activerecord//lib/active_record/test_fixtures.rb#48 + def skip_transactional_tests_for_database(database_name); end + + # Enable or disable transactions per database. This overrides the default + # setting as defined by `use_transactional_tests`, which applies to all + # database connection pools not explicitly configured here. + # + # source://activerecord//lib/active_record/test_fixtures.rb#55 + def use_transactional_tests_for_database(database_name, enabled = T.unsafe(nil)); end + + # Prevents automatically wrapping each specified test in a transaction, + # to allow application logic transactions to be tested in a top-level + # (non-nested) context. + # + # source://activerecord//lib/active_record/test_fixtures.rb#103 + def uses_transaction(*methods); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/test_fixtures.rb#108 + def uses_transaction?(method); end +end + +# source://activerecord//lib/active_record/associations/errors.rb#177 +class ActiveRecord::ThroughCantAssociateThroughHasOneOrManyReflection < ::ActiveRecord::ActiveRecordError + # @return [ThroughCantAssociateThroughHasOneOrManyReflection] a new instance of ThroughCantAssociateThroughHasOneOrManyReflection + # + # source://activerecord//lib/active_record/associations/errors.rb#178 + def initialize(owner = T.unsafe(nil), reflection = T.unsafe(nil)); end +end + +# source://activerecord//lib/active_record/associations/errors.rb#224 +class ActiveRecord::ThroughNestedAssociationsAreReadonly < ::ActiveRecord::ActiveRecordError + # @return [ThroughNestedAssociationsAreReadonly] a new instance of ThroughNestedAssociationsAreReadonly + # + # source://activerecord//lib/active_record/associations/errors.rb#225 + def initialize(owner = T.unsafe(nil), reflection = T.unsafe(nil)); end +end + +# = Active Record \Timestamp +# +# Active Record automatically timestamps create and update operations if the +# table has fields named created_at/created_on or +# updated_at/updated_on. +# +# Timestamping can be turned off by setting: +# +# config.active_record.record_timestamps = false +# +# Timestamps are in UTC by default but you can use the local timezone by setting: +# +# config.active_record.default_timezone = :local +# +# == Time Zone aware attributes +# +# Active Record keeps all the datetime and time columns +# timezone aware. By default, these values are stored in the database as UTC +# and converted back to the current Time.zone when pulled from the database. +# +# This feature can be turned off completely by setting: +# +# config.active_record.time_zone_aware_attributes = false +# +# You can also specify that only datetime columns should be time-zone +# aware (while time should not) by setting: +# +# ActiveRecord::Base.time_zone_aware_types = [:datetime] +# +# You can also add database-specific timezone aware types. For example, for PostgreSQL: +# +# ActiveRecord::Base.time_zone_aware_types += [:tsrange, :tstzrange] +# +# Finally, you can indicate specific attributes of a model for which time zone +# conversion should not applied, for instance by setting: +# +# class Topic < ActiveRecord::Base +# self.skip_time_zone_conversion_for_attributes = [:written_on] +# end +# +# source://activerecord//lib/active_record/timestamp.rb#43 +module ActiveRecord::Timestamp + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveRecord::Timestamp::ClassMethods + + private + + # source://activerecord//lib/active_record/timestamp.rb#107 + def _create_record; end + + # source://activerecord//lib/active_record/timestamp.rb#119 + def _update_record; end + + # source://activerecord//lib/active_record/timestamp.rb#155 + def all_timestamp_attributes_in_model; end + + # Clear attributes and changed_attributes + # + # source://activerecord//lib/active_record/timestamp.rb#170 + def clear_timestamp_attributes; end + + # source://activerecord//lib/active_record/timestamp.rb#125 + def create_or_update(touch: T.unsafe(nil), **_arg1); end + + # source://activerecord//lib/active_record/timestamp.rb#159 + def current_time_from_proper_timezone; end + + # source://activerecord//lib/active_record/timestamp.rb#102 + def init_internals; end + + # source://activerecord//lib/active_record/timestamp.rb#50 + def initialize_dup(other); end + + # source://activerecord//lib/active_record/timestamp.rb#163 + def max_updated_column_timestamp; end + + # source://activerecord//lib/active_record/timestamp.rb#130 + def record_update_timestamps; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/timestamp.rb#143 + def should_record_timestamps?; end + + # source://activerecord//lib/active_record/timestamp.rb#147 + def timestamp_attributes_for_create_in_model; end + + # source://activerecord//lib/active_record/timestamp.rb#151 + def timestamp_attributes_for_update_in_model; end + + module GeneratedClassMethods + def record_timestamps; end + def record_timestamps=(value); end + def record_timestamps?; end + end + + module GeneratedInstanceMethods + def record_timestamps; end + def record_timestamps=(value); end + def record_timestamps?; end + end +end + +# source://activerecord//lib/active_record/timestamp.rb#55 +module ActiveRecord::Timestamp::ClassMethods + # source://activerecord//lib/active_record/timestamp.rb#74 + def all_timestamp_attributes_in_model; end + + # source://activerecord//lib/active_record/timestamp.rb#79 + def current_time_from_proper_timezone; end + + # source://activerecord//lib/active_record/timestamp.rb#64 + def timestamp_attributes_for_create_in_model; end + + # source://activerecord//lib/active_record/timestamp.rb#69 + def timestamp_attributes_for_update_in_model; end + + # source://activerecord//lib/active_record/timestamp.rb#56 + def touch_attributes_with_time(*names, time: T.unsafe(nil)); end + + protected + + # source://activerecord//lib/active_record/timestamp.rb#84 + def reload_schema_from_cache(recursive = T.unsafe(nil)); end + + private + + # source://activerecord//lib/active_record/timestamp.rb#92 + def timestamp_attributes_for_create; end + + # source://activerecord//lib/active_record/timestamp.rb#96 + def timestamp_attributes_for_update; end +end + +# source://activerecord//lib/active_record/token_for.rb#6 +module ActiveRecord::TokenFor + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveRecord::TokenFor::ClassMethods + + # Generates a token for a predefined +purpose+. + # + # Use ClassMethods#generates_token_for to define a token purpose and + # behavior. + # + # source://activerecord//lib/active_record/token_for.rb#119 + def generate_token_for(purpose); end + + module GeneratedClassMethods + def generated_token_verifier; end + def generated_token_verifier=(value); end + def token_definitions; end + def token_definitions=(value); end + end + + module GeneratedInstanceMethods; end +end + +# source://activerecord//lib/active_record/token_for.rb#56 +module ActiveRecord::TokenFor::ClassMethods + # source://activerecord//lib/active_record/token_for.rb#106 + def find_by_token_for(purpose, token); end + + # source://activerecord//lib/active_record/token_for.rb#110 + def find_by_token_for!(purpose, token); end + + # Defines the behavior of tokens generated for a specific +purpose+. + # A token can be generated by calling TokenFor#generate_token_for on a + # record. Later, that record can be fetched by calling #find_by_token_for + # (or #find_by_token_for!) with the same purpose and token. + # + # Tokens are signed so that they are tamper-proof. Thus they can be + # exposed to outside world as, for example, password reset tokens. + # + # By default, tokens do not expire. They can be configured to expire by + # specifying a duration via the +expires_in+ option. The duration becomes + # part of the token's signature, so changing the value of +expires_in+ + # will automatically invalidate previously generated tokens. + # + # A block may also be specified. When generating a token with + # TokenFor#generate_token_for, the block will be evaluated in the context + # of the record, and its return value will be embedded in the token as + # JSON. Later, when fetching the record with #find_by_token_for, the block + # will be evaluated again in the context of the fetched record. If the two + # JSON values do not match, the token will be treated as invalid. Note + # that the value returned by the block should not contain sensitive + # information because it will be embedded in the token as + # human-readable plaintext JSON. + # + # ==== Examples + # + # class User < ActiveRecord::Base + # has_secure_password + # + # generates_token_for :password_reset, expires_in: 15.minutes do + # # Last 10 characters of password salt, which changes when password is updated: + # password_salt&.last(10) + # end + # end + # + # user = User.first + # + # token = user.generate_token_for(:password_reset) + # User.find_by_token_for(:password_reset, token) # => user + # # 16 minutes later... + # User.find_by_token_for(:password_reset, token) # => nil + # + # token = user.generate_token_for(:password_reset) + # User.find_by_token_for(:password_reset, token) # => user + # user.update!(password: "new password") + # User.find_by_token_for(:password_reset, token) # => nil + # + # source://activerecord//lib/active_record/token_for.rb#102 + def generates_token_for(purpose, expires_in: T.unsafe(nil), &block); end +end + +# source://activerecord//lib/active_record/token_for.rb#38 +module ActiveRecord::TokenFor::RelationMethods + # Finds a record using a given +token+ for a predefined +purpose+. Returns + # +nil+ if the token is invalid or the record was not found. + # + # @raise [UnknownPrimaryKey] + # + # source://activerecord//lib/active_record/token_for.rb#41 + def find_by_token_for(purpose, token); end + + # Finds a record using a given +token+ for a predefined +purpose+. Raises + # ActiveSupport::MessageVerifier::InvalidSignature if the token is invalid + # (e.g. expired, bad format, etc). Raises ActiveRecord::RecordNotFound if + # the token is valid but the record was not found. + # + # source://activerecord//lib/active_record/token_for.rb#50 + def find_by_token_for!(purpose, token); end +end + +# source://activerecord//lib/active_record/token_for.rb#14 +class ActiveRecord::TokenFor::TokenDefinition < ::Struct + # Returns the value of attribute block + # + # @return [Object] the current value of block + # + # source://activerecord//lib/active_record/token_for.rb#14 + def block; end + + # Sets the attribute block + # + # @param value [Object] the value to set the attribute block to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/token_for.rb#14 + def block=(_); end + + # Returns the value of attribute defining_class + # + # @return [Object] the current value of defining_class + # + # source://activerecord//lib/active_record/token_for.rb#14 + def defining_class; end + + # Sets the attribute defining_class + # + # @param value [Object] the value to set the attribute defining_class to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/token_for.rb#14 + def defining_class=(_); end + + # Returns the value of attribute expires_in + # + # @return [Object] the current value of expires_in + # + # source://activerecord//lib/active_record/token_for.rb#14 + def expires_in; end + + # Sets the attribute expires_in + # + # @param value [Object] the value to set the attribute expires_in to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/token_for.rb#14 + def expires_in=(_); end + + # source://activerecord//lib/active_record/token_for.rb#15 + def full_purpose; end + + # source://activerecord//lib/active_record/token_for.rb#27 + def generate_token(model); end + + # source://activerecord//lib/active_record/token_for.rb#19 + def message_verifier; end + + # source://activerecord//lib/active_record/token_for.rb#23 + def payload_for(model); end + + # Returns the value of attribute purpose + # + # @return [Object] the current value of purpose + # + # source://activerecord//lib/active_record/token_for.rb#14 + def purpose; end + + # Sets the attribute purpose + # + # @param value [Object] the value to set the attribute purpose to. + # @return [Object] the newly set value + # + # source://activerecord//lib/active_record/token_for.rb#14 + def purpose=(_); end + + # source://activerecord//lib/active_record/token_for.rb#31 + def resolve_token(token); end + + class << self + # source://activerecord//lib/active_record/token_for.rb#14 + def [](*_arg0); end + + # source://activerecord//lib/active_record/token_for.rb#14 + def inspect; end + + # source://activerecord//lib/active_record/token_for.rb#14 + def keyword_init?; end + + # source://activerecord//lib/active_record/token_for.rb#14 + def members; end + + # source://activerecord//lib/active_record/token_for.rb#14 + def new(*_arg0); end + end +end + +# = Active Record Touch Later +# +# source://activerecord//lib/active_record/touch_later.rb#5 +module ActiveRecord::TouchLater + # source://activerecord//lib/active_record/touch_later.rb#6 + def before_committed!; end + + # source://activerecord//lib/active_record/touch_later.rb#38 + def touch(*names, time: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/touch_later.rb#11 + def touch_later(*names); end + + private + + # @return [Boolean] + # + # source://activerecord//lib/active_record/touch_later.rb#66 + def has_defer_touch_attrs?; end + + # source://activerecord//lib/active_record/touch_later.rb#49 + def init_internals; end + + # source://activerecord//lib/active_record/touch_later.rb#54 + def surreptitiously_touch(attr_names); end + + # source://activerecord//lib/active_record/touch_later.rb#61 + def touch_deferred_attributes; end +end + +# Class specifies the interface to interact with the current transaction state. +# +# It can either map to an actual transaction/savepoint, or represent the +# absence of a transaction. +# +# == State +# +# We say that a transaction is _finalized_ when it wraps a real transaction +# that has been either committed or rolled back. +# +# A transaction is _open_ if it wraps a real transaction that is not finalized. +# +# On the other hand, a transaction is _closed_ when it is not open. That is, +# when it represents absence of transaction, or it wraps a real but finalized +# one. +# +# You can check whether a transaction is open or closed with the +open?+ and +# +closed?+ predicates: +# +# if Article.current_transaction.open? +# # We are inside a real and not finalized transaction. +# end +# +# Closed transactions are +blank?+ too. +# +# == Callbacks +# +# After updating the database state, you may sometimes need to perform some extra work, or reflect these +# changes in a remote system like clearing or updating a cache: +# +# def publish_article(article) +# article.update!(published: true) +# NotificationService.article_published(article) +# end +# +# The above code works but has one important flaw, which is that it no longer works properly if called inside +# a transaction, as it will interact with the remote system before the changes are persisted: +# +# Article.transaction do +# article = create_article(article) +# publish_article(article) +# end +# +# The callbacks offered by ActiveRecord::Transaction allow to rewriting this method in a way that is compatible +# with transactions: +# +# def publish_article(article) +# article.update!(published: true) +# Article.current_transaction.after_commit do +# NotificationService.article_published(article) +# end +# end +# +# In the above example, if +publish_article+ is called inside a transaction, the callback will be invoked +# after the transaction is successfully committed, and if called outside a transaction, the callback will be invoked +# immediately. +# +# == Caveats +# +# When using after_commit callbacks, it is important to note that if the callback raises an error, the transaction +# won't be rolled back as it was already committed. Relying solely on these to synchronize state between multiple +# systems may lead to consistency issues. +# +# source://activerecord//lib/active_record/transaction.rb#68 +class ActiveRecord::Transaction + # @return [Transaction] a new instance of Transaction + # + # source://activerecord//lib/active_record/transaction.rb#69 + def initialize(internal_transaction); end + + # Registers a block to be called after the transaction is fully committed. + # + # If there is no currently open transactions, the block is called + # immediately, unless the transaction is finalized, in which case attempting + # to register the callback raises ActiveRecord::ActiveRecordError. + # + # If the transaction has a parent transaction, the callback is transferred to + # the parent when the current transaction commits, or dropped when the current transaction + # is rolled back. This operation is repeated until the outermost transaction is reached. + # + # If the callback raises an error, the transaction remains committed. + # + # source://activerecord//lib/active_record/transaction.rb#85 + def after_commit(&block); end + + # Registers a block to be called after the transaction is rolled back. + # + # If there is no currently open transactions, the block is not called. But + # if the transaction is finalized, attempting to register the callback + # raises ActiveRecord::ActiveRecordError. + # + # If the transaction is successfully committed but has a parent + # transaction, the callback is automatically added to the parent transaction. + # + # If the entire chain of nested transactions are all successfully committed, + # the block is never called. + # + # source://activerecord//lib/active_record/transaction.rb#104 + def after_rollback(&block); end + + # Returns true if the transaction doesn't exist or is finalized. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/transaction.rb#118 + def blank?; end + + # Returns true if the transaction doesn't exist or is finalized. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/transaction.rb#114 + def closed?; end + + # Returns true if the transaction exists and isn't finalized yet. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/transaction.rb#109 + def open?; end + + # Returns a UUID for this transaction or +nil+ if no transaction is open. + # + # source://activerecord//lib/active_record/transaction.rb#121 + def uuid; end +end + +# source://activerecord//lib/active_record/transaction.rb#127 +ActiveRecord::Transaction::NULL_TRANSACTION = T.let(T.unsafe(nil), ActiveRecord::Transaction) + +# TransactionIsolationError will be raised under the following conditions: +# +# * The adapter does not support setting the isolation level +# * You are joining an existing open transaction +# * You are creating a nested (savepoint) transaction +# +# The mysql2, trilogy, and postgresql adapters support setting the transaction isolation level. +# +# source://activerecord//lib/active_record/errors.rb#516 +class ActiveRecord::TransactionIsolationError < ::ActiveRecord::ActiveRecordError; end + +# TransactionRollbackError will be raised when a transaction is rolled +# back by the database due to a serialization failure or a deadlock. +# +# These exceptions should not be generally rescued in nested transaction +# blocks, because they have side-effects in the actual enclosing transaction +# and internal Active Record state. They can be rescued if you are above the +# root transaction block, though. +# +# In that case, beware of transactional tests, however, because they run test +# cases in their own umbrella transaction. If you absolutely need to handle +# these exceptions in tests please consider disabling transactional tests in +# the affected test class (self.use_transactional_tests = false). +# +# Due to the aforementioned side-effects, this exception should not be raised +# manually by users. +# +# See the following: +# +# * https://www.postgresql.org/docs/current/static/transaction-iso.html +# * https://dev.mysql.com/doc/mysql-errors/en/server-error-reference.html#error_er_lock_deadlock +# +# source://activerecord//lib/active_record/errors.rb#539 +class ActiveRecord::TransactionRollbackError < ::ActiveRecord::StatementInvalid; end + +# See ActiveRecord::Transactions::ClassMethods for documentation. +# +# source://activerecord//lib/active_record/transactions.rb#5 +module ActiveRecord::Transactions + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::Transactions::ClassMethods + + # source://activerecord//lib/active_record/transactions.rb#16 + def _last_transaction_return_status; end + + # source://activerecord//lib/active_record/transactions.rb#16 + def _last_transaction_return_status=(_arg0); end + + # source://activerecord//lib/active_record/transactions.rb#16 + def _new_record_before_last_commit; end + + # source://activerecord//lib/active_record/transactions.rb#16 + def _new_record_before_last_commit=(_arg0); end + + # source://activerecord//lib/active_record/transactions.rb#392 + def before_committed!; end + + # Call the #after_commit callbacks. + # + # Ensure that it is not called if the object was never persisted (failed create), + # but call it after the commit of a destroyed object. + # + # source://activerecord//lib/active_record/transactions.rb#400 + def committed!(should_run_callbacks: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/transactions.rb#376 + def destroy; end + + # Call the #after_rollback callbacks. The +force_restore_state+ argument indicates if the record + # state should be rolled back to the beginning or just to the last savepoint. + # + # source://activerecord//lib/active_record/transactions.rb#412 + def rolledback!(force_restore_state: T.unsafe(nil), should_run_callbacks: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/transactions.rb#380 + def save(**_arg0); end + + # source://activerecord//lib/active_record/transactions.rb#384 + def save!(**_arg0); end + + # source://activerecord//lib/active_record/transactions.rb#388 + def touch(*_arg0, **_arg1); end + + # See ActiveRecord::Transactions::ClassMethods for detailed documentation. + # + # source://activerecord//lib/active_record/transactions.rb#372 + def transaction(**options, &block); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/transactions.rb#447 + def trigger_transactional_callbacks?; end + + # Executes a block within a transaction and captures its return value as a + # status flag. If the status is true, the transaction is committed, + # otherwise a ROLLBACK is issued. In any case, the status flag is returned. + # + # This method is available within the context of an ActiveRecord::Base + # instance. + # + # source://activerecord//lib/active_record/transactions.rb#428 + def with_transaction_returning_status; end + + private + + # Returns the value of attribute _committed_already_called. + # + # source://activerecord//lib/active_record/transactions.rb#453 + def _committed_already_called; end + + # Returns the value of attribute _trigger_destroy_callback. + # + # source://activerecord//lib/active_record/transactions.rb#453 + def _trigger_destroy_callback; end + + # Returns the value of attribute _trigger_update_callback. + # + # source://activerecord//lib/active_record/transactions.rb#453 + def _trigger_update_callback; end + + # Add the record to the current transaction so that the #after_rollback and #after_commit + # callbacks can be called. + # + # source://activerecord//lib/active_record/transactions.rb#536 + def add_to_transaction(ensure_finalize = T.unsafe(nil)); end + + # Clear the new record state and id of a record. + # + # source://activerecord//lib/active_record/transactions.rb#484 + def clear_transaction_record_state; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/transactions.rb#542 + def has_transactional_callbacks?; end + + # source://activerecord//lib/active_record/transactions.rb#455 + def init_internals; end + + # Save the new record state and id of a record so it can be restored later if a transaction fails. + # + # source://activerecord//lib/active_record/transactions.rb#464 + def remember_transaction_record_state; end + + # Restore the new record state and id of a record that was previously saved by a call to save_record_state. + # + # source://activerecord//lib/active_record/transactions.rb#491 + def restore_transaction_record_state(force_restore_state = T.unsafe(nil)); end + + # Determine if a transaction included an action for :create, :update, or :destroy. Used in filtering callbacks. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/transactions.rb#521 + def transaction_include_any_action?(actions); end +end + +# source://activerecord//lib/active_record/transactions.rb#8 +ActiveRecord::Transactions::ACTIONS = T.let(T.unsafe(nil), Array) + +# = Active Record \Transactions +# +# \Transactions are protective blocks where SQL statements are only permanent +# if they can all succeed as one atomic action. The classic example is a +# transfer between two accounts where you can only have a deposit if the +# withdrawal succeeded and vice versa. \Transactions enforce the integrity of +# the database and guard the data against program errors or database +# break-downs. So basically you should use transaction blocks whenever you +# have a number of statements that must be executed together or not at all. +# +# For example: +# +# ActiveRecord::Base.transaction do +# david.withdrawal(100) +# mary.deposit(100) +# end +# +# This example will only take money from David and give it to Mary if neither +# +withdrawal+ nor +deposit+ raise an exception. Exceptions will force a +# ROLLBACK that returns the database to the state before the transaction +# began. Be aware, though, that the objects will _not_ have their instance +# data returned to their pre-transactional state. +# +# == Different Active Record classes in a single transaction +# +# Though the #transaction class method is called on some Active Record class, +# the objects within the transaction block need not all be instances of +# that class. This is because transactions are per-database connection, not +# per-model. +# +# In this example a +balance+ record is transactionally saved even +# though #transaction is called on the +Account+ class: +# +# Account.transaction do +# balance.save! +# account.save! +# end +# +# The #transaction method is also available as a model instance method. +# For example, you can also do this: +# +# balance.transaction do +# balance.save! +# account.save! +# end +# +# == Transactions are not distributed across database connections +# +# A transaction acts on a single database connection. If you have +# multiple class-specific databases, the transaction will not protect +# interaction among them. One workaround is to begin a transaction +# on each class whose models you alter: +# +# Student.transaction do +# Course.transaction do +# course.enroll(student) +# student.units += course.units +# end +# end +# +# This is a poor solution, but fully distributed transactions are beyond +# the scope of Active Record. +# +# == +save+ and +destroy+ are automatically wrapped in a transaction +# +# Both {#save}[rdoc-ref:Persistence#save] and +# {#destroy}[rdoc-ref:Persistence#destroy] come wrapped in a transaction that ensures +# that whatever you do in validations or callbacks will happen under its +# protected cover. So you can use validations to check for values that +# the transaction depends on or you can raise exceptions in the callbacks +# to rollback, including after_* callbacks. +# +# As a consequence changes to the database are not seen outside your connection +# until the operation is complete. For example, if you try to update the index +# of a search engine in +after_save+ the indexer won't see the updated record. +# The #after_commit callback is the only one that is triggered once the update +# is committed. See below. +# +# == Exception handling and rolling back +# +# Also have in mind that exceptions thrown within a transaction block will +# be propagated (after triggering the ROLLBACK), so you should be ready to +# catch those in your application code. +# +# One exception is the ActiveRecord::Rollback exception, which will trigger +# a ROLLBACK when raised, but not be re-raised by the transaction block. Any +# other exception will be re-raised. +# +# *Warning*: one should not catch ActiveRecord::StatementInvalid exceptions +# inside a transaction block. ActiveRecord::StatementInvalid exceptions indicate that an +# error occurred at the database level, for example when a unique constraint +# is violated. On some database systems, such as PostgreSQL, database errors +# inside a transaction cause the entire transaction to become unusable +# until it's restarted from the beginning. Here is an example which +# demonstrates the problem: +# +# # Suppose that we have a Number model with a unique column called 'i'. +# Number.transaction do +# Number.create(i: 0) +# begin +# # This will raise a unique constraint error... +# Number.create(i: 0) +# rescue ActiveRecord::StatementInvalid +# # ...which we ignore. +# end +# +# # On PostgreSQL, the transaction is now unusable. The following +# # statement will cause a PostgreSQL error, even though the unique +# # constraint is no longer violated: +# Number.create(i: 1) +# # => "PG::Error: ERROR: current transaction is aborted, commands +# # ignored until end of transaction block" +# end +# +# One should restart the entire transaction if an +# ActiveRecord::StatementInvalid occurred. +# +# == Nested transactions +# +# #transaction calls can be nested. By default, this makes all database +# statements in the nested transaction block become part of the parent +# transaction. For example, the following behavior may be surprising: +# +# User.transaction do +# User.create(username: 'Kotori') +# User.transaction do +# User.create(username: 'Nemu') +# raise ActiveRecord::Rollback +# end +# end +# +# creates both "Kotori" and "Nemu". Reason is the ActiveRecord::Rollback +# exception in the nested block does not issue a ROLLBACK. Since these exceptions +# are captured in transaction blocks, the parent block does not see it and the +# real transaction is committed. +# +# In order to get a ROLLBACK for the nested transaction you may ask for a real +# sub-transaction by passing requires_new: true. If anything goes wrong, +# the database rolls back to the beginning of the sub-transaction without rolling +# back the parent transaction. If we add it to the previous example: +# +# User.transaction do +# User.create(username: 'Kotori') +# User.transaction(requires_new: true) do +# User.create(username: 'Nemu') +# raise ActiveRecord::Rollback +# end +# end +# +# only "Kotori" is created. +# +# Most databases don't support true nested transactions. At the time of +# writing, the only database that we're aware of that supports true nested +# transactions, is MS-SQL. Because of this, Active Record emulates nested +# transactions by using savepoints. See +# https://dev.mysql.com/doc/refman/en/savepoint.html +# for more information about savepoints. +# +# === \Callbacks +# +# There are two types of callbacks associated with committing and rolling back transactions: +# #after_commit and #after_rollback. +# +# #after_commit callbacks are called on every record saved or destroyed within a +# transaction immediately after the transaction is committed. #after_rollback callbacks +# are called on every record saved or destroyed within a transaction immediately after the +# transaction or savepoint is rolled back. +# +# These callbacks are useful for interacting with other systems since you will be guaranteed +# that the callback is only executed when the database is in a permanent state. For example, +# #after_commit is a good spot to put in a hook to clearing a cache since clearing it from +# within a transaction could trigger the cache to be regenerated before the database is updated. +# +# ==== NOTE: Callbacks are deduplicated per callback by filter. +# +# Trying to define multiple callbacks with the same filter will result in a single callback being run. +# +# For example: +# +# after_commit :do_something +# after_commit :do_something # only the last one will be called +# +# This applies to all variations of after_*_commit callbacks as well. +# +# after_commit :do_something +# after_create_commit :do_something +# after_save_commit :do_something +# +# It is recommended to use the +on:+ option to specify when the callback should be run. +# +# after_commit :do_something, on: [:create, :update] +# +# This is equivalent to using +after_create_commit+ and +after_update_commit+, but will not be deduplicated. +# +# === Caveats +# +# If you're on MySQL, then do not use Data Definition Language (DDL) operations in nested +# transactions blocks that are emulated with savepoints. That is, do not execute statements +# like 'CREATE TABLE' inside such blocks. This is because MySQL automatically +# releases all savepoints upon executing a DDL operation. When +transaction+ +# is finished and tries to release the savepoint it created earlier, a +# database error will occur because the savepoint has already been +# automatically released. The following example demonstrates the problem: +# +# Model.transaction do # BEGIN +# Model.transaction(requires_new: true) do # CREATE SAVEPOINT active_record_1 +# Model.lease_connection.create_table(...) # active_record_1 now automatically released +# end # RELEASE SAVEPOINT active_record_1 +# end # ^^^^ BOOM! database error! +# +# Note that "TRUNCATE" is also a MySQL DDL statement! +# +# source://activerecord//lib/active_record/transactions.rb#229 +module ActiveRecord::Transactions::ClassMethods + # This callback is called after a record has been created, updated, or destroyed. + # + # You can specify that the callback should only be fired by a certain action with + # the +:on+ option: + # + # after_commit :do_foo, on: :create + # after_commit :do_bar, on: :update + # after_commit :do_baz, on: :destroy + # + # after_commit :do_foo_bar, on: [:create, :update] + # after_commit :do_bar_baz, on: [:update, :destroy] + # + # source://activerecord//lib/active_record/transactions.rb#285 + def after_commit(*args, &block); end + + # Shortcut for after_commit :hook, on: :create. + # + # source://activerecord//lib/active_record/transactions.rb#297 + def after_create_commit(*args, &block); end + + # Shortcut for after_commit :hook, on: :destroy. + # + # source://activerecord//lib/active_record/transactions.rb#309 + def after_destroy_commit(*args, &block); end + + # This callback is called after a create, update, or destroy are rolled back. + # + # Please check the documentation of #after_commit for options. + # + # source://activerecord//lib/active_record/transactions.rb#317 + def after_rollback(*args, &block); end + + # Shortcut for after_commit :hook, on: [ :create, :update ]. + # + # source://activerecord//lib/active_record/transactions.rb#291 + def after_save_commit(*args, &block); end + + # Shortcut for after_commit :hook, on: :update. + # + # source://activerecord//lib/active_record/transactions.rb#303 + def after_update_commit(*args, &block); end + + # source://activerecord//lib/active_record/transactions.rb#268 + def before_commit(*args, &block); end + + # Returns a representation of the current transaction state, + # which can be a top level transaction, a savepoint, or the absence of a transaction. + # + # An object is always returned, whether or not a transaction is currently active. + # To check if a transaction was opened, use current_transaction.open?. + # + # See the ActiveRecord::Transaction documentation for detailed behavior. + # + # source://activerecord//lib/active_record/transactions.rb#264 + def current_transaction; end + + # Returns the default isolation level for the connection pool, set earlier by #with_pool_transaction_isolation_level. + # + # source://activerecord//lib/active_record/transactions.rb#253 + def pool_transaction_isolation_level; end + + # Similar to ActiveSupport::Callbacks::ClassMethods#set_callback, but with + # support for options available on #after_commit and #after_rollback callbacks. + # + # source://activerecord//lib/active_record/transactions.rb#324 + def set_callback(name, *filter_list, &block); end + + # See the ConnectionAdapters::DatabaseStatements#transaction API docs. + # + # source://activerecord//lib/active_record/transactions.rb#231 + def transaction(**options, &block); end + + # Makes all transactions the current pool use the isolation level initiated within the block. + # + # source://activerecord//lib/active_record/transactions.rb#240 + def with_pool_transaction_isolation_level(isolation_level, &block); end + + private + + # source://activerecord//lib/active_record/transactions.rb#364 + def assert_valid_transaction_action(actions); end + + # source://activerecord//lib/active_record/transactions.rb#342 + def prepend_option; end + + # source://activerecord//lib/active_record/transactions.rb#350 + def set_options_for_callbacks!(args, enforced_options = T.unsafe(nil)); end +end + +# source://activerecord//lib/active_record/translation.rb#4 +module ActiveRecord::Translation + # Set the i18n scope to override ActiveModel. + # + # source://activerecord//lib/active_record/translation.rb#18 + def i18n_scope; end + + # Set the lookup ancestors for ActiveModel. + # + # source://activerecord//lib/active_record/translation.rb#6 + def lookup_ancestors; end +end + +# :stopdoc: +# +# source://activerecord//lib/active_record/type/internal/timezone.rb#4 +module ActiveRecord::Type + class << self + # source://activerecord//lib/active_record/type.rb#49 + def adapter_name_from(model); end + + # source://activerecord//lib/active_record/type.rb#27 + def add_modifier(*_arg0, **_arg1, &_arg2); end + + # source://activerecord//lib/active_record/type.rb#45 + def default_value; end + + # source://activerecord//lib/active_record/type.rb#41 + def lookup(*args, adapter: T.unsafe(nil), **kwargs); end + + # Add a new type to the registry, allowing it to be referenced as a + # symbol by {ActiveRecord::Base.attribute}[rdoc-ref:Attributes::ClassMethods#attribute]. + # If your type is only meant to be used with a specific database adapter, you can + # do so by passing adapter: :postgresql. If your type has the same + # name as a native type for the current adapter, an exception will be + # raised unless you specify an +:override+ option. override: true will + # cause your type to be used instead of the native type. override: + # false will cause the native type to be used over yours if one exists. + # + # source://activerecord//lib/active_record/type.rb#37 + def register(type_name, klass = T.unsafe(nil), **options, &block); end + + # source://activerecord//lib/active_record/type.rb#26 + def registry; end + + # source://activerecord//lib/active_record/type.rb#26 + def registry=(_arg0); end + + private + + # source://activerecord//lib/active_record/type.rb#54 + def current_adapter_name; end + end +end + +# source://activerecord//lib/active_record/type/adapter_specific_registry.rb#6 +class ActiveRecord::Type::AdapterSpecificRegistry + # @return [AdapterSpecificRegistry] a new instance of AdapterSpecificRegistry + # + # source://activerecord//lib/active_record/type/adapter_specific_registry.rb#7 + def initialize; end + + # source://activerecord//lib/active_record/type/adapter_specific_registry.rb#15 + def add_modifier(options, klass, **args); end + + # source://activerecord//lib/active_record/type/adapter_specific_registry.rb#27 + def lookup(symbol, *args, **kwargs); end + + # source://activerecord//lib/active_record/type/adapter_specific_registry.rb#19 + def register(type_name, klass = T.unsafe(nil), **options, &block); end + + private + + # source://activerecord//lib/active_record/type/adapter_specific_registry.rb#40 + def find_registration(symbol, *args, **kwargs); end + + # source://activerecord//lib/active_record/type/adapter_specific_registry.rb#11 + def initialize_copy(other); end + + # Returns the value of attribute registrations. + # + # source://activerecord//lib/active_record/type/adapter_specific_registry.rb#38 + def registrations; end +end + +# source://activerecord//lib/active_record/type.rb#59 +ActiveRecord::Type::BigInteger = ActiveModel::Type::BigInteger + +# source://activerecord//lib/active_record/type.rb#60 +ActiveRecord::Type::Binary = ActiveModel::Type::Binary + +# source://activerecord//lib/active_record/type.rb#61 +ActiveRecord::Type::Boolean = ActiveModel::Type::Boolean + +# source://activerecord//lib/active_record/type/date.rb#5 +class ActiveRecord::Type::Date < ::ActiveModel::Type::Date + include ::ActiveRecord::Type::Internal::Timezone +end + +# source://activerecord//lib/active_record/type/date_time.rb#5 +class ActiveRecord::Type::DateTime < ::ActiveModel::Type::DateTime + include ::ActiveRecord::Type::Internal::Timezone +end + +# source://activerecord//lib/active_record/type.rb#62 +ActiveRecord::Type::Decimal = ActiveModel::Type::Decimal + +# source://activerecord//lib/active_record/type/decimal_without_scale.rb#5 +class ActiveRecord::Type::DecimalWithoutScale < ::ActiveModel::Type::BigInteger + # source://activerecord//lib/active_record/type/decimal_without_scale.rb#6 + def type; end + + # source://activerecord//lib/active_record/type/decimal_without_scale.rb#10 + def type_cast_for_schema(value); end +end + +# source://activerecord//lib/active_record/type/adapter_specific_registry.rb#110 +class ActiveRecord::Type::DecorationRegistration < ::ActiveRecord::Type::Registration + # @return [DecorationRegistration] a new instance of DecorationRegistration + # + # source://activerecord//lib/active_record/type/adapter_specific_registry.rb#111 + def initialize(options, klass, adapter: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/type/adapter_specific_registry.rb#117 + def call(registry, *args, **kwargs); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/type/adapter_specific_registry.rb#122 + def matches?(*args, **kwargs); end + + # source://activerecord//lib/active_record/type/adapter_specific_registry.rb#126 + def priority; end + + private + + # Returns the value of attribute klass. + # + # source://activerecord//lib/active_record/type/adapter_specific_registry.rb#131 + def klass; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/type/adapter_specific_registry.rb#133 + def matches_options?(**kwargs); end + + # Returns the value of attribute options. + # + # source://activerecord//lib/active_record/type/adapter_specific_registry.rb#131 + def options; end +end + +# source://activerecord//lib/active_record/type.rb#63 +ActiveRecord::Type::Float = ActiveModel::Type::Float + +# source://activerecord//lib/active_record/type/hash_lookup_type_map.rb#5 +class ActiveRecord::Type::HashLookupTypeMap + # @return [HashLookupTypeMap] a new instance of HashLookupTypeMap + # + # source://activerecord//lib/active_record/type/hash_lookup_type_map.rb#6 + def initialize(parent = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/type/hash_lookup_type_map.rb#40 + def alias_type(type, alias_type); end + + # source://activerecord//lib/active_record/type/hash_lookup_type_map.rb#35 + def clear; end + + # source://activerecord//lib/active_record/type/hash_lookup_type_map.rb#17 + def fetch(lookup_key, *args, &block); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/type/hash_lookup_type_map.rb#44 + def key?(key); end + + # source://activerecord//lib/active_record/type/hash_lookup_type_map.rb#48 + def keys; end + + # source://activerecord//lib/active_record/type/hash_lookup_type_map.rb#13 + def lookup(lookup_key, *args); end + + # @raise [::ArgumentError] + # + # source://activerecord//lib/active_record/type/hash_lookup_type_map.rb#23 + def register_type(key, value = T.unsafe(nil), &block); end + + private + + # source://activerecord//lib/active_record/type/hash_lookup_type_map.rb#53 + def perform_fetch(type, *args, &block); end +end + +# source://activerecord//lib/active_record/type.rb#65 +ActiveRecord::Type::ImmutableString = ActiveModel::Type::ImmutableString + +# source://activerecord//lib/active_record/type.rb#64 +ActiveRecord::Type::Integer = ActiveModel::Type::Integer + +# source://activerecord//lib/active_record/type/internal/timezone.rb#5 +module ActiveRecord::Type::Internal; end + +# source://activerecord//lib/active_record/type/internal/timezone.rb#6 +module ActiveRecord::Type::Internal::Timezone + # source://activerecord//lib/active_record/type/internal/timezone.rb#7 + def initialize(timezone: T.unsafe(nil), **kwargs); end + + # source://activerecord//lib/active_record/type/internal/timezone.rb#20 + def ==(other); end + + # source://activerecord//lib/active_record/type/internal/timezone.rb#16 + def default_timezone; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/type/internal/timezone.rb#12 + def is_utc?; end + + protected + + # Returns the value of attribute timezone. + # + # source://activerecord//lib/active_record/type/internal/timezone.rb#25 + def timezone; end +end + +# source://activerecord//lib/active_record/type/json.rb#7 +class ActiveRecord::Type::Json < ::ActiveModel::Type::Value + include ::ActiveModel::Type::Helpers::Mutable + + # source://activerecord//lib/active_record/type/json.rb#38 + def accessor; end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/type/json.rb#34 + def changed_in_place?(raw_old_value, new_value); end + + # source://activerecord//lib/active_record/type/json.rb#14 + def deserialize(value); end + + # source://activerecord//lib/active_record/type/json.rb#30 + def serialize(value); end + + # source://activerecord//lib/active_record/type/json.rb#10 + def type; end +end + +# source://activerecord//lib/active_record/type/json.rb#28 +ActiveRecord::Type::Json::JSON_ENCODER = T.let(T.unsafe(nil), ActiveSupport::JSON::Encoding::JSONGemCoderEncoder) + +# source://activerecord//lib/active_record/type/adapter_specific_registry.rb#47 +class ActiveRecord::Type::Registration + # @return [Registration] a new instance of Registration + # + # source://activerecord//lib/active_record/type/adapter_specific_registry.rb#48 + def initialize(name, block, adapter: T.unsafe(nil), override: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/type/adapter_specific_registry.rb#63 + def <=>(other); end + + # source://activerecord//lib/active_record/type/adapter_specific_registry.rb#55 + def call(_registry, *args, adapter: T.unsafe(nil), **kwargs); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/type/adapter_specific_registry.rb#59 + def matches?(type_name, *args, **kwargs); end + + protected + + # Returns the value of attribute adapter. + # + # source://activerecord//lib/active_record/type/adapter_specific_registry.rb#73 + def adapter; end + + # Returns the value of attribute block. + # + # source://activerecord//lib/active_record/type/adapter_specific_registry.rb#73 + def block; end + + # Returns the value of attribute name. + # + # source://activerecord//lib/active_record/type/adapter_specific_registry.rb#73 + def name; end + + # Returns the value of attribute override. + # + # source://activerecord//lib/active_record/type/adapter_specific_registry.rb#73 + def override; end + + # source://activerecord//lib/active_record/type/adapter_specific_registry.rb#75 + def priority; end + + # source://activerecord//lib/active_record/type/adapter_specific_registry.rb#86 + def priority_except_adapter; end + + private + + # @return [Boolean] + # + # source://activerecord//lib/active_record/type/adapter_specific_registry.rb#95 + def conflicts_with?(other); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/type/adapter_specific_registry.rb#104 + def has_adapter_conflict?(other); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/type/adapter_specific_registry.rb#91 + def matches_adapter?(adapter: T.unsafe(nil), **_arg1); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/type/adapter_specific_registry.rb#100 + def same_priority_except_adapter?(other); end +end + +# source://activerecord//lib/active_record/type/serialized.rb#5 +class ActiveRecord::Type::Serialized + include ::ActiveModel::Type::Helpers::Mutable + + # @return [Serialized] a new instance of Serialized + # + # source://activerecord//lib/active_record/type/serialized.rb#12 + def initialize(subtype, coder, comparable: T.unsafe(nil)); end + + # source://activerecord//lib/active_record/type/serialized.rb#49 + def accessor; end + + # source://activerecord//lib/active_record/type/serialized.rb#53 + def assert_valid_value(value); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/type/serialized.rb#36 + def changed_in_place?(raw_old_value, value); end + + # Returns the value of attribute coder. + # + # source://activerecord//lib/active_record/type/serialized.rb#10 + def coder; end + + # source://activerecord//lib/active_record/type/serialized.rb#19 + def deserialize(value); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/type/serialized.rb#59 + def force_equality?(value); end + + # source://activerecord//lib/active_record/type/serialized.rb#34 + def inspect; end + + # source://activerecord//lib/active_record/type/serialized.rb#27 + def serialize(value); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/type/serialized.rb#63 + def serialized?; end + + # Returns the value of attribute subtype. + # + # source://activerecord//lib/active_record/type/serialized.rb#10 + def subtype; end + + private + + # @return [Boolean] + # + # source://activerecord//lib/active_record/type/serialized.rb#68 + def default_value?(value); end + + # source://activerecord//lib/active_record/type/serialized.rb#72 + def encoded(value); end +end + +# source://activerecord//lib/active_record/type.rb#66 +ActiveRecord::Type::String = ActiveModel::Type::String + +# source://activerecord//lib/active_record/type/text.rb#5 +class ActiveRecord::Type::Text < ::ActiveModel::Type::String + # source://activerecord//lib/active_record/type/text.rb#6 + def type; end +end + +# source://activerecord//lib/active_record/type/time.rb#5 +class ActiveRecord::Type::Time < ::ActiveModel::Type::Time + include ::ActiveRecord::Type::Internal::Timezone + + # source://activerecord//lib/active_record/type/time.rb#11 + def serialize(value); end + + # source://activerecord//lib/active_record/type/time.rb#20 + def serialize_cast_value(value); end + + private + + # source://activerecord//lib/active_record/type/time.rb#25 + def cast_value(value); end +end + +# source://activerecord//lib/active_record/type/time.rb#8 +class ActiveRecord::Type::Time::Value; end + +# source://activerecord//lib/active_record/type/type_map.rb#7 +class ActiveRecord::Type::TypeMap + # @return [TypeMap] a new instance of TypeMap + # + # source://activerecord//lib/active_record/type/type_map.rb#8 + def initialize(parent = T.unsafe(nil)); end + + # source://activerecord//lib/active_record/type/type_map.rb#35 + def alias_type(key, target_key); end + + # source://activerecord//lib/active_record/type/type_map.rb#18 + def fetch(lookup_key, &block); end + + # source://activerecord//lib/active_record/type/type_map.rb#14 + def lookup(lookup_key); end + + # @raise [::ArgumentError] + # + # source://activerecord//lib/active_record/type/type_map.rb#24 + def register_type(key, value = T.unsafe(nil), &block); end + + protected + + # source://activerecord//lib/active_record/type/type_map.rb#43 + def perform_fetch(lookup_key, &block); end +end + +# source://activerecord//lib/active_record/type/unsigned_integer.rb#5 +class ActiveRecord::Type::UnsignedInteger < ::ActiveModel::Type::Integer + private + + # source://activerecord//lib/active_record/type/unsigned_integer.rb#7 + def max_value; end + + # source://activerecord//lib/active_record/type/unsigned_integer.rb#11 + def min_value; end +end + +# source://activerecord//lib/active_record/type.rb#67 +ActiveRecord::Type::Value = ActiveModel::Type::Value + +# source://activerecord//lib/active_record/type_caster/map.rb#4 +module ActiveRecord::TypeCaster; end + +# source://activerecord//lib/active_record/type_caster/connection.rb#5 +class ActiveRecord::TypeCaster::Connection + # @return [Connection] a new instance of Connection + # + # source://activerecord//lib/active_record/type_caster/connection.rb#6 + def initialize(klass, table_name); end + + # source://activerecord//lib/active_record/type_caster/connection.rb#11 + def type_cast_for_database(attr_name, value); end + + # source://activerecord//lib/active_record/type_caster/connection.rb#16 + def type_for_attribute(attr_name); end + + private + + # Returns the value of attribute table_name. + # + # source://activerecord//lib/active_record/type_caster/connection.rb#31 + def table_name; end +end + +# source://activerecord//lib/active_record/type_caster/map.rb#5 +class ActiveRecord::TypeCaster::Map + # @return [Map] a new instance of Map + # + # source://activerecord//lib/active_record/type_caster/map.rb#6 + def initialize(klass); end + + # source://activerecord//lib/active_record/type_caster/map.rb#10 + def type_cast_for_database(attr_name, value); end + + # source://activerecord//lib/active_record/type_caster/map.rb#15 + def type_for_attribute(name); end + + private + + # Returns the value of attribute klass. + # + # source://activerecord//lib/active_record/type_caster/map.rb#20 + def klass; end +end + +# source://activerecord//lib/active_record/type/adapter_specific_registry.rb#141 +class ActiveRecord::TypeConflictError < ::StandardError; end + +# Raised when unknown attributes are supplied via mass assignment. +# +# source://activerecord//lib/active_record/errors.rb#451 +ActiveRecord::UnknownAttributeError = ActiveModel::UnknownAttributeError + +# UnknownAttributeReference is raised when an unknown and potentially unsafe +# value is passed to a query method. For example, passing a non column name +# value to a relation's #order method might cause this exception. +# +# When working around this exception, caution should be taken to avoid SQL +# injection vulnerabilities when passing user-provided values to query +# methods. Known-safe values can be passed to query methods by wrapping them +# in Arel.sql. +# +# For example, the following code would raise this exception: +# +# Post.order("REPLACE(title, 'misc', 'zzzz') asc").pluck(:id) +# +# The desired result can be accomplished by wrapping the known-safe string +# in Arel.sql: +# +# Post.order(Arel.sql("REPLACE(title, 'misc', 'zzzz') asc")).pluck(:id) +# +# Again, such a workaround should *not* be used when passing user-provided +# values, such as request parameters or model attributes to query methods. +# +# source://activerecord//lib/active_record/errors.rb#618 +class ActiveRecord::UnknownAttributeReference < ::ActiveRecord::ActiveRecordError; end + +# source://activerecord//lib/active_record/migration.rb#111 +class ActiveRecord::UnknownMigrationVersionError < ::ActiveRecord::MigrationError + # @return [UnknownMigrationVersionError] a new instance of UnknownMigrationVersionError + # + # source://activerecord//lib/active_record/migration.rb#112 + def initialize(version = T.unsafe(nil)); end +end + +# Raised when a primary key is needed, but not specified in the schema or model. +# +# source://activerecord//lib/active_record/errors.rb#479 +class ActiveRecord::UnknownPrimaryKey < ::ActiveRecord::ActiveRecordError + # @return [UnknownPrimaryKey] a new instance of UnknownPrimaryKey + # + # source://activerecord//lib/active_record/errors.rb#482 + def initialize(model = T.unsafe(nil), description = T.unsafe(nil)); end + + # Returns the value of attribute model. + # + # source://activerecord//lib/active_record/errors.rb#480 + def model; end +end + +# Raised when a relation cannot be mutated because it's already loaded. +# +# class Task < ActiveRecord::Base +# end +# +# relation = Task.all +# relation.load +# relation.loaded? # => true +# +# # Methods which try to mutate a loaded relation fail. +# relation.where!(title: 'TODO') # => ActiveRecord::UnmodifiableRelation +# relation.limit!(5) # => ActiveRecord::UnmodifiableRelation +# +# source://activerecord//lib/active_record/errors.rb#506 +class ActiveRecord::UnmodifiableRelation < ::ActiveRecord::ActiveRecordError; end + +# source://activerecord//lib/active_record/gem_version.rb#9 +module ActiveRecord::VERSION; end + +# source://activerecord//lib/active_record/gem_version.rb#10 +ActiveRecord::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# source://activerecord//lib/active_record/gem_version.rb#11 +ActiveRecord::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# source://activerecord//lib/active_record/gem_version.rb#13 +ActiveRecord::VERSION::PRE = T.let(T.unsafe(nil), T.untyped) + +# source://activerecord//lib/active_record/gem_version.rb#15 +ActiveRecord::VERSION::STRING = T.let(T.unsafe(nil), String) + +# source://activerecord//lib/active_record/gem_version.rb#12 +ActiveRecord::VERSION::TINY = T.let(T.unsafe(nil), Integer) + +# = Active Record \Validations +# +# Active Record includes the majority of its validations from ActiveModel::Validations. +# +# In Active Record, all validations are performed on save by default. +# Validations accept the :on argument to define the context where +# the validations are active. Active Record will pass either the context of +# :create or :update depending on whether the model is a +# {new_record?}[rdoc-ref:Persistence#new_record?]. +# +# source://activerecord//lib/active_record/validations.rb#40 +module ActiveRecord::Validations + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::Validations::ClassMethods + + # @return [Boolean] + # + # source://activerecord//lib/active_record/validations.rb#77 + def custom_validation_context?; end + + # The validation process on save can be skipped by passing validate: false. + # The validation context can be changed by passing context: context. + # The regular {ActiveRecord::Base#save}[rdoc-ref:Persistence#save] method is replaced + # with this when the validations module is mixed in, which it is by default. + # + # source://activerecord//lib/active_record/validations.rb#47 + def save(**options); end + + # Attempts to save the record just like {ActiveRecord::Base#save}[rdoc-ref:Base#save] but + # will raise an ActiveRecord::RecordInvalid exception instead of returning +false+ if the record is not valid. + # + # source://activerecord//lib/active_record/validations.rb#53 + def save!(**options); end + + # Runs all the validations within the specified context. Returns +true+ if + # no errors are found, +false+ otherwise. + # + # Aliased as #validate. + # + # If the argument is +false+ (default is +nil+), the context is set to :create if + # {new_record?}[rdoc-ref:Persistence#new_record?] is +true+, and to :update if it is not. + # If the argument is an array of contexts, post.valid?([:create, :update]), the validations are + # run within multiple contexts. + # + # \Validations with no :on option will run no matter the context. \Validations with + # some :on option will only run in the specified context. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/validations.rb#69 + def valid?(context = T.unsafe(nil)); end + + # Runs all the validations within the specified context. Returns +true+ if + # no errors are found, +false+ otherwise. + # + # Aliased as #validate. + # + # If the argument is +false+ (default is +nil+), the context is set to :create if + # {new_record?}[rdoc-ref:Persistence#new_record?] is +true+, and to :update if it is not. + # If the argument is an array of contexts, post.valid?([:create, :update]), the validations are + # run within multiple contexts. + # + # \Validations with no :on option will run no matter the context. \Validations with + # some :on option will only run in the specified context. + # + # @return [Boolean] + # + # source://activerecord//lib/active_record/validations.rb#75 + def validate(context = T.unsafe(nil)); end + + private + + # source://activerecord//lib/active_record/validations.rb#82 + def default_validation_context; end + + # source://activerecord//lib/active_record/validations.rb#90 + def perform_validations(options = T.unsafe(nil)); end + + # @raise [RecordInvalid] + # + # source://activerecord//lib/active_record/validations.rb#86 + def raise_validation_error; end +end + +# source://activerecord//lib/active_record/validations/absence.rb#5 +class ActiveRecord::Validations::AbsenceValidator < ::ActiveModel::Validations::AbsenceValidator + # source://activerecord//lib/active_record/validations/absence.rb#6 + def validate_each(record, attribute, association_or_value); end +end + +# source://activerecord//lib/active_record/validations/associated.rb#5 +class ActiveRecord::Validations::AssociatedValidator < ::ActiveModel::EachValidator + # source://activerecord//lib/active_record/validations/associated.rb#6 + def validate_each(record, attribute, value); end + + private + + # source://activerecord//lib/active_record/validations/associated.rb#19 + def record_validation_context_for_association(record); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/validations/associated.rb#15 + def valid_object?(record, context); end +end + +# source://activerecord//lib/active_record/validations/associated.rb#24 +module ActiveRecord::Validations::ClassMethods + # Validates that the specified attributes are not present (as defined by + # Object#present?). If the attribute is an association, the associated object + # is also considered not present if it is marked for destruction. + # + # See ActiveModel::Validations::HelperMethods.validates_absence_of for more information. + # + # source://activerecord//lib/active_record/validations/absence.rb#20 + def validates_absence_of(*attr_names); end + + # Validates whether the associated object or objects are all valid. + # Works with any kind of association. + # + # class Book < ActiveRecord::Base + # has_many :pages + # belongs_to :library + # + # validates_associated :pages, :library + # end + # + # WARNING: This validation must not be used on both ends of an association. + # Doing so will lead to a circular dependency and cause infinite recursion. + # + # NOTE: This validation will not fail if the association hasn't been + # assigned. If you want to ensure that the association is both present and + # guaranteed to be valid, you also need to use + # {validates_presence_of}[rdoc-ref:Validations::ClassMethods#validates_presence_of]. + # + # Configuration options: + # + # * :message - A custom error message (default is: "is invalid"). + # * :on - Specifies the contexts where this validation is active. + # Runs in all validation contexts by default +nil+. You can pass a symbol + # or an array of symbols. (e.g. on: :create or + # on: :custom_validation_context or + # on: [:create, :custom_validation_context]) + # * :if - Specifies a method, proc, or string to call to determine + # if the validation should occur (e.g. if: :allow_validation, + # or if: Proc.new { |user| user.signup_step > 2 }). The method, + # proc or string should return or evaluate to a +true+ or +false+ value. + # * :unless - Specifies a method, proc, or string to call to + # determine if the validation should not occur (e.g. unless: :skip_validation, + # or unless: Proc.new { |user| user.signup_step <= 2 }). The + # method, proc, or string should return or evaluate to a +true+ or +false+ + # value. + # + # source://activerecord//lib/active_record/validations/associated.rb#60 + def validates_associated(*attr_names); end + + # Validates that the specified attributes match the length restrictions supplied. + # If the attribute is an association, records that are marked for destruction are not counted. + # + # See ActiveModel::Validations::HelperMethods.validates_length_of for more information. + # + # source://activerecord//lib/active_record/validations/length.rb#19 + def validates_length_of(*attr_names); end + + # Validates whether the value of the specified attribute is numeric by + # trying to convert it to a float with +Kernel.Float+ (if + # only_integer is +false+) or applying it to the regular + # expression /\A[\+\-]?\d+\z/ (if only_integer is set to + # +true+). +Kernel.Float+ precision defaults to the column's precision + # value or 15. + # + # See ActiveModel::Validations::HelperMethods.validates_numericality_of for more information. + # + # source://activerecord//lib/active_record/validations/numericality.rb#31 + def validates_numericality_of(*attr_names); end + + # Validates that the specified attributes are not blank (as defined by + # Object#blank?). If the attribute is an association, the associated object + # is also considered blank if it is marked for destruction. + # + # class Person < ActiveRecord::Base + # has_one :face + # validates_presence_of :face + # end + # + # The face attribute must be in the object and it cannot be blank or marked + # for destruction. + # + # This validator defers to the Active Model validation for presence, adding the + # check to see that an associated object is not marked for destruction. This + # prevents the parent object from validating successfully and saving, which then + # deletes the associated object, thus putting the parent object into an invalid + # state. + # + # See ActiveModel::Validations::HelperMethods.validates_presence_of for + # more information. + # + # NOTE: This validation will not fail while using it with an association + # if the latter was assigned but not valid. If you want to ensure that + # it is both present and valid, you also need to use + # {validates_associated}[rdoc-ref:Validations::ClassMethods#validates_associated]. + # + # source://activerecord//lib/active_record/validations/presence.rb#40 + def validates_presence_of(*attr_names); end + + # Validates that the specified attributes match the length restrictions supplied. + # If the attribute is an association, records that are marked for destruction are not counted. + # + # See ActiveModel::Validations::HelperMethods.validates_length_of for more information. + # + # source://activerecord//lib/active_record/validations/length.rb#23 + def validates_size_of(*attr_names); end + + # Validates whether the value of the specified attributes are unique + # across the system. Useful for making sure that only one user + # can be named "davidhh". + # + # class Person < ActiveRecord::Base + # validates_uniqueness_of :user_name + # end + # + # It can also validate whether the value of the specified attributes are + # unique based on a :scope parameter: + # + # class Person < ActiveRecord::Base + # validates_uniqueness_of :user_name, scope: :account_id + # end + # + # Or even multiple scope parameters. For example, making sure that a + # teacher can only be on the schedule once per semester for a particular + # class. + # + # class TeacherSchedule < ActiveRecord::Base + # validates_uniqueness_of :teacher_id, scope: [:semester_id, :class_id] + # end + # + # It is also possible to limit the uniqueness constraint to a set of + # records matching certain conditions. In this example archived articles + # are not being taken into consideration when validating uniqueness + # of the title attribute: + # + # class Article < ActiveRecord::Base + # validates_uniqueness_of :title, conditions: -> { where.not(status: 'archived') } + # end + # + # To build conditions based on the record's state, define the conditions + # callable with a parameter, which will be the record itself. This + # example validates the title is unique for the year of publication: + # + # class Article < ActiveRecord::Base + # validates_uniqueness_of :title, conditions: ->(article) { + # published_at = article.published_at + # where(published_at: published_at.beginning_of_year..published_at.end_of_year) + # } + # end + # + # When the record is created, a check is performed to make sure that no + # record exists in the database with the given value for the specified + # attribute (that maps to a column). When the record is updated, + # the same check is made but disregarding the record itself. + # + # Configuration options: + # + # * :message - Specifies a custom error message (default is: + # "has already been taken"). + # * :scope - One or more columns by which to limit the scope of + # the uniqueness constraint. + # * :conditions - Specify the conditions to be included as a + # WHERE SQL fragment to limit the uniqueness constraint lookup + # (e.g. conditions: -> { where(status: 'active') }). + # * :case_sensitive - Looks for an exact match. Ignored by + # non-text columns. The default behavior respects the default database collation. + # * :allow_nil - If set to +true+, skips this validation if the + # attribute is +nil+ (default is +false+). + # * :allow_blank - If set to +true+, skips this validation if the + # attribute is blank (default is +false+). + # * :if - Specifies a method, proc, or string to call to determine + # if the validation should occur (e.g. if: :allow_validation, + # or if: Proc.new { |user| user.signup_step > 2 }). The method, + # proc or string should return or evaluate to a +true+ or +false+ value. + # * :unless - Specifies a method, proc, or string to call to + # determine if the validation should not occur (e.g. unless: :skip_validation, + # or unless: Proc.new { |user| user.signup_step <= 2 }). The + # method, proc, or string should return or evaluate to a +true+ or +false+ + # value. + # + # === Concurrency and integrity + # + # Using this validation method in conjunction with + # {ActiveRecord::Base#save}[rdoc-ref:Persistence#save] + # does not guarantee the absence of duplicate record insertions, because + # uniqueness checks on the application level are inherently prone to race + # conditions. For example, suppose that two users try to post a Comment at + # the same time, and a Comment's title must be unique. At the database-level, + # the actions performed by these users could be interleaved in the following manner: + # + # User 1 | User 2 + # ------------------------------------+-------------------------------------- + # # User 1 checks whether there's | + # # already a comment with the title | + # # 'My Post'. This is not the case. | + # SELECT * FROM comments | + # WHERE title = 'My Post' | + # | + # | # User 2 does the same thing and also + # | # infers that their title is unique. + # | SELECT * FROM comments + # | WHERE title = 'My Post' + # | + # # User 1 inserts their comment. | + # INSERT INTO comments | + # (title, content) VALUES | + # ('My Post', 'hi!') | + # | + # | # User 2 does the same thing. + # | INSERT INTO comments + # | (title, content) VALUES + # | ('My Post', 'hello!') + # | + # | # ^^^^^^ + # | # Boom! We now have a duplicate + # | # title! + # + # The best way to work around this problem is to add a unique index to the database table using + # {connection.add_index}[rdoc-ref:ConnectionAdapters::SchemaStatements#add_index]. + # In the rare case that a race condition occurs, the database will guarantee + # the field's uniqueness. + # + # When the database catches such a duplicate insertion, + # {ActiveRecord::Base#save}[rdoc-ref:Persistence#save] will raise an ActiveRecord::StatementInvalid + # exception. You can either choose to let this error propagate (which + # will result in the default \Rails exception page being shown), or you + # can catch it and restart the transaction (e.g. by telling the user + # that the title already exists, and asking them to re-enter the title). + # This technique is also known as + # {optimistic concurrency control}[https://en.wikipedia.org/wiki/Optimistic_concurrency_control]. + # + # The bundled ActiveRecord::ConnectionAdapters distinguish unique index + # constraint errors from other types of database errors by throwing an + # ActiveRecord::RecordNotUnique exception. For other adapters you will + # have to parse the (database-specific) exception message to detect such + # a case. + # + # The following bundled adapters throw the ActiveRecord::RecordNotUnique exception: + # + # * ActiveRecord::ConnectionAdapters::Mysql2Adapter. + # * ActiveRecord::ConnectionAdapters::TrilogyAdapter. + # * ActiveRecord::ConnectionAdapters::SQLite3Adapter. + # * ActiveRecord::ConnectionAdapters::PostgreSQLAdapter. + # + # source://activerecord//lib/active_record/validations/uniqueness.rb#291 + def validates_uniqueness_of(*attr_names); end +end + +# source://activerecord//lib/active_record/validations/length.rb#5 +class ActiveRecord::Validations::LengthValidator < ::ActiveModel::Validations::LengthValidator + # source://activerecord//lib/active_record/validations/length.rb#6 + def validate_each(record, attribute, association_or_value); end +end + +# source://activerecord//lib/active_record/validations/numericality.rb#5 +class ActiveRecord::Validations::NumericalityValidator < ::ActiveModel::Validations::NumericalityValidator + # source://activerecord//lib/active_record/validations/numericality.rb#6 + def validate_each(record, attribute, value, precision: T.unsafe(nil), scale: T.unsafe(nil)); end + + private + + # source://activerecord//lib/active_record/validations/numericality.rb#13 + def column_precision_for(record, attribute); end + + # source://activerecord//lib/active_record/validations/numericality.rb#17 + def column_scale_for(record, attribute); end +end + +# source://activerecord//lib/active_record/validations/presence.rb#5 +class ActiveRecord::Validations::PresenceValidator < ::ActiveModel::Validations::PresenceValidator + # source://activerecord//lib/active_record/validations/presence.rb#6 + def validate_each(record, attribute, association_or_value); end +end + +# source://activerecord//lib/active_record/validations/uniqueness.rb#5 +class ActiveRecord::Validations::UniquenessValidator < ::ActiveModel::EachValidator + # @return [UniquenessValidator] a new instance of UniquenessValidator + # + # source://activerecord//lib/active_record/validations/uniqueness.rb#6 + def initialize(options); end + + # source://activerecord//lib/active_record/validations/uniqueness.rb#20 + def validate_each(record, attribute, value); end + + private + + # source://activerecord//lib/active_record/validations/uniqueness.rb#112 + def build_relation(klass, attribute, value); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/validations/uniqueness.rb#83 + def covered_by_unique_index?(klass, record, attribute, scope); end + + # The check for an existing value should be run from a class that + # isn't abstract. This means working down from the current class + # (self), to the first non-abstract class. + # + # source://activerecord//lib/active_record/validations/uniqueness.rb#58 + def find_finder_class_for(record); end + + # source://activerecord//lib/active_record/validations/uniqueness.rb#147 + def map_enum_attribute(klass, attribute, value); end + + # source://activerecord//lib/active_record/validations/uniqueness.rb#98 + def resolve_attributes(record, attributes); end + + # source://activerecord//lib/active_record/validations/uniqueness.rb#134 + def scope_relation(record, relation); end + + # @return [Boolean] + # + # source://activerecord//lib/active_record/validations/uniqueness.rb#70 + def validation_needed?(klass, record, attribute); end +end + +# Raised when a record cannot be inserted or updated because a value too long for a column type. +# +# source://activerecord//lib/active_record/errors.rb#304 +class ActiveRecord::ValueTooLong < ::ActiveRecord::StatementInvalid; end + +# Defunct wrapper class kept for compatibility. +# StatementInvalid wraps the original exception now. +# +# source://activerecord//lib/active_record/errors.rb#224 +class ActiveRecord::WrappedDatabaseException < ::ActiveRecord::StatementInvalid; end + +# source://activerecord//lib/arel/errors.rb#3 +module Arel + class << self + # @return [Boolean] + # + # source://activerecord//lib/arel.rb#66 + def arel_node?(value); end + + # source://activerecord//lib/arel.rb#70 + def fetch_attribute(value, &block); end + + # Wrap a known-safe SQL string for passing to query methods, e.g. + # + # Post.order(Arel.sql("REPLACE(title, 'misc', 'zzzz') asc")).pluck(:id) + # + # Great caution should be taken to avoid SQL injection vulnerabilities. + # This method should not be used with unsafe values such as request + # parameters or model attributes. + # + # Take a look at the {security guide}[https://guides.rubyonrails.org/security.html#sql-injection] + # for more information. + # + # To construct a more complex query fragment, including the possible + # use of user-provided values, the +sql_string+ may contain ? and + # +:key+ placeholders, corresponding to the additional arguments. Note + # that this behavior only applies when bind value parameters are + # supplied in the call; without them, the placeholder tokens have no + # special meaning, and will be passed through to the query as-is. + # + # The +:retryable+ option can be used to mark the SQL as safe to retry. + # Use this option only if the SQL is idempotent, as it could be executed + # more than once. + # + # source://activerecord//lib/arel.rb#52 + def sql(sql_string, *positional_binds, retryable: T.unsafe(nil), **named_binds); end + + # source://activerecord//lib/arel.rb#62 + def star; end + end +end + +# source://activerecord//lib/arel/alias_predication.rb#4 +module Arel::AliasPredication + # source://activerecord//lib/arel/alias_predication.rb#5 + def as(other); end +end + +# source://activerecord//lib/arel/errors.rb#4 +class Arel::ArelError < ::StandardError; end + +# source://activerecord//lib/arel/attributes/attribute.rb#32 +Arel::Attribute = Arel::Attributes::Attribute + +# source://activerecord//lib/arel/attributes/attribute.rb#4 +module Arel::Attributes; end + +# source://activerecord//lib/arel/attributes/attribute.rb#5 +class Arel::Attributes::Attribute < ::Struct + include ::Arel::Expressions + include ::Arel::Predications + include ::Arel::AliasPredication + include ::Arel::OrderPredications + include ::Arel::Math + + # @return [Boolean] + # + # source://activerecord//lib/arel/attributes/attribute.rb#26 + def able_to_type_cast?; end + + # Create a node for lowering this attribute + # + # source://activerecord//lib/arel/attributes/attribute.rb#18 + def lower; end + + # source://activerecord//lib/arel/attributes/attribute.rb#22 + def type_cast_for_database(value); end + + # source://activerecord//lib/arel/attributes/attribute.rb#12 + def type_caster; end +end + +# source://activerecord//lib/arel/errors.rb#10 +class Arel::BindError < ::Arel::ArelError + # @return [BindError] a new instance of BindError + # + # source://activerecord//lib/arel/errors.rb#11 + def initialize(message, sql = T.unsafe(nil)); end +end + +# source://activerecord//lib/arel/collectors/plain_string.rb#4 +module Arel::Collectors; end + +# source://activerecord//lib/arel/collectors/bind.rb#5 +class Arel::Collectors::Bind + # @return [Bind] a new instance of Bind + # + # source://activerecord//lib/arel/collectors/bind.rb#8 + def initialize; end + + # source://activerecord//lib/arel/collectors/bind.rb#12 + def <<(str); end + + # source://activerecord//lib/arel/collectors/bind.rb#16 + def add_bind(bind, &_arg1); end + + # source://activerecord//lib/arel/collectors/bind.rb#21 + def add_binds(binds, proc_for_binds = T.unsafe(nil), &_arg2); end + + # Returns the value of attribute retryable. + # + # source://activerecord//lib/arel/collectors/bind.rb#6 + def retryable; end + + # Sets the attribute retryable + # + # @param value the value to set the attribute retryable to. + # + # source://activerecord//lib/arel/collectors/bind.rb#6 + def retryable=(_arg0); end + + # source://activerecord//lib/arel/collectors/bind.rb#26 + def value; end +end + +# source://activerecord//lib/arel/collectors/composite.rb#5 +class Arel::Collectors::Composite + # @return [Composite] a new instance of Composite + # + # source://activerecord//lib/arel/collectors/composite.rb#9 + def initialize(left, right); end + + # source://activerecord//lib/arel/collectors/composite.rb#20 + def <<(str); end + + # source://activerecord//lib/arel/collectors/composite.rb#26 + def add_bind(bind, &block); end + + # source://activerecord//lib/arel/collectors/composite.rb#32 + def add_binds(binds, proc_for_binds = T.unsafe(nil), &block); end + + # Returns the value of attribute preparable. + # + # source://activerecord//lib/arel/collectors/composite.rb#6 + def preparable; end + + # Sets the attribute preparable + # + # @param value the value to set the attribute preparable to. + # + # source://activerecord//lib/arel/collectors/composite.rb#6 + def preparable=(_arg0); end + + # Returns the value of attribute retryable. + # + # source://activerecord//lib/arel/collectors/composite.rb#7 + def retryable; end + + # source://activerecord//lib/arel/collectors/composite.rb#14 + def retryable=(retryable); end + + # source://activerecord//lib/arel/collectors/composite.rb#38 + def value; end + + private + + # Returns the value of attribute left. + # + # source://activerecord//lib/arel/collectors/composite.rb#43 + def left; end + + # Returns the value of attribute right. + # + # source://activerecord//lib/arel/collectors/composite.rb#43 + def right; end +end + +# source://activerecord//lib/arel/collectors/plain_string.rb#5 +class Arel::Collectors::PlainString + # @return [PlainString] a new instance of PlainString + # + # source://activerecord//lib/arel/collectors/plain_string.rb#6 + def initialize; end + + # source://activerecord//lib/arel/collectors/plain_string.rb#14 + def <<(str); end + + # source://activerecord//lib/arel/collectors/plain_string.rb#10 + def value; end +end + +# source://activerecord//lib/arel/collectors/sql_string.rb#7 +class Arel::Collectors::SQLString < ::Arel::Collectors::PlainString + # @return [SQLString] a new instance of SQLString + # + # source://activerecord//lib/arel/collectors/sql_string.rb#10 + def initialize(*_arg0); end + + # source://activerecord//lib/arel/collectors/sql_string.rb#15 + def add_bind(bind, &_arg1); end + + # source://activerecord//lib/arel/collectors/sql_string.rb#21 + def add_binds(binds, proc_for_binds = T.unsafe(nil), &block); end + + # Returns the value of attribute preparable. + # + # source://activerecord//lib/arel/collectors/sql_string.rb#8 + def preparable; end + + # Sets the attribute preparable + # + # @param value the value to set the attribute preparable to. + # + # source://activerecord//lib/arel/collectors/sql_string.rb#8 + def preparable=(_arg0); end + + # Returns the value of attribute retryable. + # + # source://activerecord//lib/arel/collectors/sql_string.rb#8 + def retryable; end + + # Sets the attribute retryable + # + # @param value the value to set the attribute retryable to. + # + # source://activerecord//lib/arel/collectors/sql_string.rb#8 + def retryable=(_arg0); end +end + +# source://activerecord//lib/arel/collectors/substitute_binds.rb#5 +class Arel::Collectors::SubstituteBinds + # @return [SubstituteBinds] a new instance of SubstituteBinds + # + # source://activerecord//lib/arel/collectors/substitute_binds.rb#8 + def initialize(quoter, delegate_collector); end + + # source://activerecord//lib/arel/collectors/substitute_binds.rb#13 + def <<(str); end + + # source://activerecord//lib/arel/collectors/substitute_binds.rb#18 + def add_bind(bind, &_arg1); end + + # source://activerecord//lib/arel/collectors/substitute_binds.rb#23 + def add_binds(binds, proc_for_binds = T.unsafe(nil), &_arg2); end + + # Returns the value of attribute preparable. + # + # source://activerecord//lib/arel/collectors/substitute_binds.rb#6 + def preparable; end + + # Sets the attribute preparable + # + # @param value the value to set the attribute preparable to. + # + # source://activerecord//lib/arel/collectors/substitute_binds.rb#6 + def preparable=(_arg0); end + + # Returns the value of attribute retryable. + # + # source://activerecord//lib/arel/collectors/substitute_binds.rb#6 + def retryable; end + + # Sets the attribute retryable + # + # @param value the value to set the attribute retryable to. + # + # source://activerecord//lib/arel/collectors/substitute_binds.rb#6 + def retryable=(_arg0); end + + # source://activerecord//lib/arel/collectors/substitute_binds.rb#27 + def value; end + + private + + # Returns the value of attribute delegate. + # + # source://activerecord//lib/arel/collectors/substitute_binds.rb#32 + def delegate; end + + # Returns the value of attribute quoter. + # + # source://activerecord//lib/arel/collectors/substitute_binds.rb#32 + def quoter; end +end + +# FIXME hopefully we can remove this +# +# source://activerecord//lib/arel/crud.rb#6 +module Arel::Crud + # source://activerecord//lib/arel/crud.rb#32 + def compile_delete(key = T.unsafe(nil)); end + + # source://activerecord//lib/arel/crud.rb#7 + def compile_insert(values); end + + # source://activerecord//lib/arel/crud.rb#17 + def compile_update(values, key = T.unsafe(nil)); end + + # source://activerecord//lib/arel/crud.rb#13 + def create_insert; end +end + +# source://activerecord//lib/arel/delete_manager.rb#4 +class Arel::DeleteManager < ::Arel::TreeManager + include ::Arel::TreeManager::StatementMethods + + # @return [DeleteManager] a new instance of DeleteManager + # + # source://activerecord//lib/arel/delete_manager.rb#7 + def initialize(table = T.unsafe(nil)); end + + # source://activerecord//lib/arel/delete_manager.rb#32 + def comment(value); end + + # source://activerecord//lib/arel/delete_manager.rb#11 + def from(relation); end + + # source://activerecord//lib/arel/delete_manager.rb#16 + def group(columns); end + + # source://activerecord//lib/arel/delete_manager.rb#27 + def having(expr); end +end + +# source://activerecord//lib/arel/errors.rb#7 +class Arel::EmptyJoinError < ::Arel::ArelError; end + +# source://activerecord//lib/arel/expressions.rb#4 +module Arel::Expressions + # source://activerecord//lib/arel/expressions.rb#21 + def average; end + + # source://activerecord//lib/arel/expressions.rb#5 + def count(distinct = T.unsafe(nil)); end + + # source://activerecord//lib/arel/expressions.rb#25 + def extract(field); end + + # source://activerecord//lib/arel/expressions.rb#13 + def maximum; end + + # source://activerecord//lib/arel/expressions.rb#17 + def minimum; end + + # source://activerecord//lib/arel/expressions.rb#9 + def sum; end +end + +# Methods for creating various nodes +# +# source://activerecord//lib/arel/factory_methods.rb#6 +module Arel::FactoryMethods + # source://activerecord//lib/arel/factory_methods.rb#49 + def cast(name, type); end + + # source://activerecord//lib/arel/factory_methods.rb#45 + def coalesce(*exprs); end + + # source://activerecord//lib/arel/factory_methods.rb#27 + def create_and(clauses); end + + # source://activerecord//lib/arel/factory_methods.rb#11 + def create_false; end + + # source://activerecord//lib/arel/factory_methods.rb#19 + def create_join(to, constraint = T.unsafe(nil), klass = T.unsafe(nil)); end + + # source://activerecord//lib/arel/factory_methods.rb#31 + def create_on(expr); end + + # source://activerecord//lib/arel/factory_methods.rb#23 + def create_string_join(to); end + + # source://activerecord//lib/arel/factory_methods.rb#15 + def create_table_alias(relation, name); end + + # source://activerecord//lib/arel/factory_methods.rb#7 + def create_true; end + + # source://activerecord//lib/arel/factory_methods.rb#35 + def grouping(expr); end + + # Create a LOWER() function + # + # source://activerecord//lib/arel/factory_methods.rb#41 + def lower(column); end +end + +# source://activerecord//lib/arel/filter_predications.rb#4 +module Arel::FilterPredications + # source://activerecord//lib/arel/filter_predications.rb#5 + def filter(expr); end +end + +# source://activerecord//lib/arel/insert_manager.rb#4 +class Arel::InsertManager < ::Arel::TreeManager + # @return [InsertManager] a new instance of InsertManager + # + # source://activerecord//lib/arel/insert_manager.rb#5 + def initialize(table = T.unsafe(nil)); end + + # source://activerecord//lib/arel/insert_manager.rb#14 + def columns; end + + # source://activerecord//lib/arel/insert_manager.rb#40 + def create_values(values); end + + # source://activerecord//lib/arel/insert_manager.rb#44 + def create_values_list(rows); end + + # source://activerecord//lib/arel/insert_manager.rb#21 + def insert(fields); end + + # source://activerecord//lib/arel/insert_manager.rb#9 + def into(table); end + + # source://activerecord//lib/arel/insert_manager.rb#17 + def select(select); end + + # source://activerecord//lib/arel/insert_manager.rb#15 + def values=(val); end +end + +# source://activerecord//lib/arel/math.rb#4 +module Arel::Math + # source://activerecord//lib/arel/math.rb#21 + def &(other); end + + # source://activerecord//lib/arel/math.rb#5 + def *(other); end + + # source://activerecord//lib/arel/math.rb#9 + def +(other); end + + # source://activerecord//lib/arel/math.rb#13 + def -(other); end + + # source://activerecord//lib/arel/math.rb#17 + def /(other); end + + # source://activerecord//lib/arel/math.rb#33 + def <<(other); end + + # source://activerecord//lib/arel/math.rb#37 + def >>(other); end + + # source://activerecord//lib/arel/math.rb#29 + def ^(other); end + + # source://activerecord//lib/arel/math.rb#25 + def |(other); end + + # source://activerecord//lib/arel/math.rb#41 + def ~; end +end + +# source://activerecord//lib/arel/nodes/node.rb#4 +module Arel::Nodes + class << self + # source://activerecord//lib/arel/nodes/casted.rb#48 + def build_quoted(other, attribute = T.unsafe(nil)); end + end +end + +# source://activerecord//lib/arel/nodes/infix_operation.rb#32 +class Arel::Nodes::Addition < ::Arel::Nodes::InfixOperation + # @return [Addition] a new instance of Addition + # + # source://activerecord//lib/arel/nodes/infix_operation.rb#33 + def initialize(left, right); end +end + +# source://activerecord//lib/arel/nodes/nary.rb#36 +class Arel::Nodes::And < ::Arel::Nodes::Nary; end + +# source://activerecord//lib/arel/nodes/binary.rb#42 +class Arel::Nodes::As < ::Arel::Nodes::Binary + # source://activerecord//lib/arel/nodes/binary.rb#43 + def to_cte; end +end + +# source://activerecord//lib/arel/nodes/ascending.rb#5 +class Arel::Nodes::Ascending < ::Arel::Nodes::Ordering + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/ascending.rb#14 + def ascending?; end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/ascending.rb#18 + def descending?; end + + # source://activerecord//lib/arel/nodes/ascending.rb#10 + def direction; end + + # source://activerecord//lib/arel/nodes/ascending.rb#6 + def reverse; end +end + +# source://activerecord//lib/arel/nodes/binary.rb#122 +class Arel::Nodes::Assignment < ::Arel::Nodes::Binary; end + +# source://activerecord//lib/arel/nodes/function.rb#36 +class Arel::Nodes::Avg < ::Arel::Nodes::Function; end + +# source://activerecord//lib/arel/nodes/binary.rb#48 +class Arel::Nodes::Between < ::Arel::Nodes::Binary + include ::Arel::Nodes::FetchAttribute +end + +# source://activerecord//lib/arel/nodes/unary.rb#41 +class Arel::Nodes::Bin < ::Arel::Nodes::Unary; end + +# source://activerecord//lib/arel/nodes/binary.rb#5 +class Arel::Nodes::Binary < ::Arel::Nodes::NodeExpression + # @return [Binary] a new instance of Binary + # + # source://activerecord//lib/arel/nodes/binary.rb#8 + def initialize(left, right); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/binary.rb#29 + def ==(other); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/binary.rb#24 + def eql?(other); end + + # source://activerecord//lib/arel/nodes/binary.rb#20 + def hash; end + + # Returns the value of attribute left. + # + # source://activerecord//lib/arel/nodes/binary.rb#6 + def left; end + + # Sets the attribute left + # + # @param value the value to set the attribute left to. + # + # source://activerecord//lib/arel/nodes/binary.rb#6 + def left=(_arg0); end + + # Returns the value of attribute right. + # + # source://activerecord//lib/arel/nodes/binary.rb#6 + def right; end + + # Sets the attribute right + # + # @param value the value to set the attribute right to. + # + # source://activerecord//lib/arel/nodes/binary.rb#6 + def right=(_arg0); end + + private + + # source://activerecord//lib/arel/nodes/binary.rb#14 + def initialize_copy(other); end +end + +# source://activerecord//lib/arel/nodes/bind_param.rb#5 +class Arel::Nodes::BindParam < ::Arel::Nodes::Node + # @return [BindParam] a new instance of BindParam + # + # source://activerecord//lib/arel/nodes/bind_param.rb#8 + def initialize(value); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/bind_param.rb#21 + def ==(other); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/bind_param.rb#17 + def eql?(other); end + + # source://activerecord//lib/arel/nodes/bind_param.rb#13 + def hash; end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/bind_param.rb#35 + def infinite?; end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/bind_param.rb#23 + def nil?; end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/bind_param.rb#39 + def unboundable?; end + + # Returns the value of attribute value. + # + # source://activerecord//lib/arel/nodes/bind_param.rb#6 + def value; end + + # source://activerecord//lib/arel/nodes/bind_param.rb#27 + def value_before_type_cast; end +end + +# source://activerecord//lib/arel/nodes/infix_operation.rb#62 +class Arel::Nodes::BitwiseAnd < ::Arel::Nodes::InfixOperation + # @return [BitwiseAnd] a new instance of BitwiseAnd + # + # source://activerecord//lib/arel/nodes/infix_operation.rb#63 + def initialize(left, right); end +end + +# source://activerecord//lib/arel/nodes/unary_operation.rb#14 +class Arel::Nodes::BitwiseNot < ::Arel::Nodes::UnaryOperation + # @return [BitwiseNot] a new instance of BitwiseNot + # + # source://activerecord//lib/arel/nodes/unary_operation.rb#15 + def initialize(operand); end +end + +# source://activerecord//lib/arel/nodes/infix_operation.rb#68 +class Arel::Nodes::BitwiseOr < ::Arel::Nodes::InfixOperation + # @return [BitwiseOr] a new instance of BitwiseOr + # + # source://activerecord//lib/arel/nodes/infix_operation.rb#69 + def initialize(left, right); end +end + +# source://activerecord//lib/arel/nodes/infix_operation.rb#80 +class Arel::Nodes::BitwiseShiftLeft < ::Arel::Nodes::InfixOperation + # @return [BitwiseShiftLeft] a new instance of BitwiseShiftLeft + # + # source://activerecord//lib/arel/nodes/infix_operation.rb#81 + def initialize(left, right); end +end + +# source://activerecord//lib/arel/nodes/infix_operation.rb#86 +class Arel::Nodes::BitwiseShiftRight < ::Arel::Nodes::InfixOperation + # @return [BitwiseShiftRight] a new instance of BitwiseShiftRight + # + # source://activerecord//lib/arel/nodes/infix_operation.rb#87 + def initialize(left, right); end +end + +# source://activerecord//lib/arel/nodes/infix_operation.rb#74 +class Arel::Nodes::BitwiseXor < ::Arel::Nodes::InfixOperation + # @return [BitwiseXor] a new instance of BitwiseXor + # + # source://activerecord//lib/arel/nodes/infix_operation.rb#75 + def initialize(left, right); end +end + +# source://activerecord//lib/arel/nodes/bound_sql_literal.rb#5 +class Arel::Nodes::BoundSqlLiteral < ::Arel::Nodes::NodeExpression + # @return [BoundSqlLiteral] a new instance of BoundSqlLiteral + # + # source://activerecord//lib/arel/nodes/bound_sql_literal.rb#8 + def initialize(sql_with_placeholders, positional_binds, named_binds); end + + # @raise [ArgumentError] + # + # source://activerecord//lib/arel/nodes/bound_sql_literal.rb#54 + def +(other); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/bound_sql_literal.rb#52 + def ==(other); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/bound_sql_literal.rb#46 + def eql?(other); end + + # source://activerecord//lib/arel/nodes/bound_sql_literal.rb#42 + def hash; end + + # source://activerecord//lib/arel/nodes/bound_sql_literal.rb#60 + def inspect; end + + # Returns the value of attribute named_binds. + # + # source://activerecord//lib/arel/nodes/bound_sql_literal.rb#6 + def named_binds; end + + # Returns the value of attribute positional_binds. + # + # source://activerecord//lib/arel/nodes/bound_sql_literal.rb#6 + def positional_binds; end + + # Returns the value of attribute sql_with_placeholders. + # + # source://activerecord//lib/arel/nodes/bound_sql_literal.rb#6 + def sql_with_placeholders; end +end + +# source://activerecord//lib/arel/nodes/case.rb#5 +class Arel::Nodes::Case < ::Arel::Nodes::NodeExpression + # @return [Case] a new instance of Case + # + # source://activerecord//lib/arel/nodes/case.rb#8 + def initialize(expression = T.unsafe(nil), default = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/case.rb#46 + def ==(other); end + + # Returns the value of attribute case. + # + # source://activerecord//lib/arel/nodes/case.rb#6 + def case; end + + # Sets the attribute case + # + # @param value the value to set the attribute case to. + # + # source://activerecord//lib/arel/nodes/case.rb#6 + def case=(_arg0); end + + # Returns the value of attribute conditions. + # + # source://activerecord//lib/arel/nodes/case.rb#6 + def conditions; end + + # Sets the attribute conditions + # + # @param value the value to set the attribute conditions to. + # + # source://activerecord//lib/arel/nodes/case.rb#6 + def conditions=(_arg0); end + + # Returns the value of attribute default. + # + # source://activerecord//lib/arel/nodes/case.rb#6 + def default; end + + # Sets the attribute default + # + # @param value the value to set the attribute default to. + # + # source://activerecord//lib/arel/nodes/case.rb#6 + def default=(_arg0); end + + # source://activerecord//lib/arel/nodes/case.rb#24 + def else(expression); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/case.rb#40 + def eql?(other); end + + # source://activerecord//lib/arel/nodes/case.rb#36 + def hash; end + + # source://activerecord//lib/arel/nodes/case.rb#19 + def then(expression); end + + # source://activerecord//lib/arel/nodes/case.rb#14 + def when(condition, expression = T.unsafe(nil)); end + + private + + # source://activerecord//lib/arel/nodes/case.rb#29 + def initialize_copy(other); end +end + +# source://activerecord//lib/arel/nodes/casted.rb#5 +class Arel::Nodes::Casted < ::Arel::Nodes::NodeExpression + # @return [Casted] a new instance of Casted + # + # source://activerecord//lib/arel/nodes/casted.rb#9 + def initialize(value, attribute); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/casted.rb#34 + def ==(other); end + + # Returns the value of attribute attribute. + # + # source://activerecord//lib/arel/nodes/casted.rb#6 + def attribute; end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/casted.rb#29 + def eql?(other); end + + # source://activerecord//lib/arel/nodes/casted.rb#25 + def hash; end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/casted.rb#15 + def nil?; end + + # Returns the value of attribute value. + # + # source://activerecord//lib/arel/nodes/casted.rb#6 + def value; end + + # Returns the value of attribute value. + # + # source://activerecord//lib/arel/nodes/casted.rb#7 + def value_before_type_cast; end + + # source://activerecord//lib/arel/nodes/casted.rb#17 + def value_for_database; end +end + +# source://activerecord//lib/arel/nodes/comment.rb#5 +class Arel::Nodes::Comment < ::Arel::Nodes::Node + # @return [Comment] a new instance of Comment + # + # source://activerecord//lib/arel/nodes/comment.rb#8 + def initialize(values); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/comment.rb#26 + def ==(other); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/comment.rb#22 + def eql?(other); end + + # source://activerecord//lib/arel/nodes/comment.rb#18 + def hash; end + + # Returns the value of attribute values. + # + # source://activerecord//lib/arel/nodes/comment.rb#6 + def values; end + + private + + # source://activerecord//lib/arel/nodes/comment.rb#13 + def initialize_copy(other); end +end + +# source://activerecord//lib/arel/nodes/infix_operation.rb#44 +class Arel::Nodes::Concat < ::Arel::Nodes::InfixOperation + # @return [Concat] a new instance of Concat + # + # source://activerecord//lib/arel/nodes/infix_operation.rb#45 + def initialize(left, right); end +end + +# source://activerecord//lib/arel/nodes/infix_operation.rb#50 +class Arel::Nodes::Contains < ::Arel::Nodes::InfixOperation + # @return [Contains] a new instance of Contains + # + # source://activerecord//lib/arel/nodes/infix_operation.rb#51 + def initialize(left, right); end +end + +# source://activerecord//lib/arel/nodes/count.rb#5 +class Arel::Nodes::Count < ::Arel::Nodes::Function + # @return [Count] a new instance of Count + # + # source://activerecord//lib/arel/nodes/count.rb#6 + def initialize(expr, distinct = T.unsafe(nil)); end +end + +# source://activerecord//lib/arel/nodes/cte.rb#5 +class Arel::Nodes::Cte < ::Arel::Nodes::Binary + # @return [Cte] a new instance of Cte + # + # source://activerecord//lib/arel/nodes/cte.rb#10 + def initialize(name, relation, materialized: T.unsafe(nil)); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/cte.rb#25 + def ==(other); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/cte.rb#19 + def eql?(other); end + + # source://activerecord//lib/arel/nodes/cte.rb#15 + def hash; end + + # Returns the value of attribute materialized. + # + # source://activerecord//lib/arel/nodes/cte.rb#8 + def materialized; end + + # source://activerecord//lib/arel/nodes/cte.rb#6 + def name; end + + # source://activerecord//lib/arel/nodes/cte.rb#7 + def relation; end + + # source://activerecord//lib/arel/nodes/cte.rb#27 + def to_cte; end + + # source://activerecord//lib/arel/nodes/cte.rb#31 + def to_table; end +end + +# source://activerecord//lib/arel/nodes/unary.rb#41 +class Arel::Nodes::Cube < ::Arel::Nodes::Unary; end + +# source://activerecord//lib/arel/nodes/window.rb#103 +class Arel::Nodes::CurrentRow < ::Arel::Nodes::Node + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/window.rb#111 + def ==(other); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/window.rb#108 + def eql?(other); end + + # source://activerecord//lib/arel/nodes/window.rb#104 + def hash; end +end + +# source://activerecord//lib/arel/nodes/delete_statement.rb#5 +class Arel::Nodes::DeleteStatement < ::Arel::Nodes::Node + # @return [DeleteStatement] a new instance of DeleteStatement + # + # source://activerecord//lib/arel/nodes/delete_statement.rb#8 + def initialize(relation = T.unsafe(nil), wheres = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/delete_statement.rb#43 + def ==(other); end + + # Returns the value of attribute comment. + # + # source://activerecord//lib/arel/nodes/delete_statement.rb#6 + def comment; end + + # Sets the attribute comment + # + # @param value the value to set the attribute comment to. + # + # source://activerecord//lib/arel/nodes/delete_statement.rb#6 + def comment=(_arg0); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/delete_statement.rb#31 + def eql?(other); end + + # Returns the value of attribute groups. + # + # source://activerecord//lib/arel/nodes/delete_statement.rb#6 + def groups; end + + # Sets the attribute groups + # + # @param value the value to set the attribute groups to. + # + # source://activerecord//lib/arel/nodes/delete_statement.rb#6 + def groups=(_arg0); end + + # source://activerecord//lib/arel/nodes/delete_statement.rb#27 + def hash; end + + # Returns the value of attribute havings. + # + # source://activerecord//lib/arel/nodes/delete_statement.rb#6 + def havings; end + + # Sets the attribute havings + # + # @param value the value to set the attribute havings to. + # + # source://activerecord//lib/arel/nodes/delete_statement.rb#6 + def havings=(_arg0); end + + # Returns the value of attribute key. + # + # source://activerecord//lib/arel/nodes/delete_statement.rb#6 + def key; end + + # Sets the attribute key + # + # @param value the value to set the attribute key to. + # + # source://activerecord//lib/arel/nodes/delete_statement.rb#6 + def key=(_arg0); end + + # Returns the value of attribute limit. + # + # source://activerecord//lib/arel/nodes/delete_statement.rb#6 + def limit; end + + # Sets the attribute limit + # + # @param value the value to set the attribute limit to. + # + # source://activerecord//lib/arel/nodes/delete_statement.rb#6 + def limit=(_arg0); end + + # Returns the value of attribute offset. + # + # source://activerecord//lib/arel/nodes/delete_statement.rb#6 + def offset; end + + # Sets the attribute offset + # + # @param value the value to set the attribute offset to. + # + # source://activerecord//lib/arel/nodes/delete_statement.rb#6 + def offset=(_arg0); end + + # Returns the value of attribute orders. + # + # source://activerecord//lib/arel/nodes/delete_statement.rb#6 + def orders; end + + # Sets the attribute orders + # + # @param value the value to set the attribute orders to. + # + # source://activerecord//lib/arel/nodes/delete_statement.rb#6 + def orders=(_arg0); end + + # Returns the value of attribute relation. + # + # source://activerecord//lib/arel/nodes/delete_statement.rb#6 + def relation; end + + # Sets the attribute relation + # + # @param value the value to set the attribute relation to. + # + # source://activerecord//lib/arel/nodes/delete_statement.rb#6 + def relation=(_arg0); end + + # Returns the value of attribute wheres. + # + # source://activerecord//lib/arel/nodes/delete_statement.rb#6 + def wheres; end + + # Sets the attribute wheres + # + # @param value the value to set the attribute wheres to. + # + # source://activerecord//lib/arel/nodes/delete_statement.rb#6 + def wheres=(_arg0); end + + private + + # source://activerecord//lib/arel/nodes/delete_statement.rb#21 + def initialize_copy(other); end +end + +# source://activerecord//lib/arel/nodes/descending.rb#5 +class Arel::Nodes::Descending < ::Arel::Nodes::Ordering + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/descending.rb#14 + def ascending?; end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/descending.rb#18 + def descending?; end + + # source://activerecord//lib/arel/nodes/descending.rb#10 + def direction; end + + # source://activerecord//lib/arel/nodes/descending.rb#6 + def reverse; end +end + +# source://activerecord//lib/arel/nodes/terminal.rb#5 +class Arel::Nodes::Distinct < ::Arel::Nodes::NodeExpression + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/terminal.rb#13 + def ==(other); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/terminal.rb#10 + def eql?(other); end + + # source://activerecord//lib/arel/nodes/terminal.rb#6 + def hash; end +end + +# source://activerecord//lib/arel/nodes/unary.rb#41 +class Arel::Nodes::DistinctOn < ::Arel::Nodes::Unary; end + +# source://activerecord//lib/arel/nodes/infix_operation.rb#26 +class Arel::Nodes::Division < ::Arel::Nodes::InfixOperation + # @return [Division] a new instance of Division + # + # source://activerecord//lib/arel/nodes/infix_operation.rb#27 + def initialize(left, right); end +end + +# source://activerecord//lib/arel/nodes/matches.rb#16 +class Arel::Nodes::DoesNotMatch < ::Arel::Nodes::Matches; end + +# source://activerecord//lib/arel/nodes/case.rb#52 +class Arel::Nodes::Else < ::Arel::Nodes::Unary; end + +# source://activerecord//lib/arel/nodes/equality.rb#5 +class Arel::Nodes::Equality < ::Arel::Nodes::Binary + include ::Arel::Nodes::FetchAttribute + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/equality.rb#8 + def equality?; end + + # source://activerecord//lib/arel/nodes/equality.rb#10 + def invert; end +end + +# source://activerecord//lib/arel/nodes/binary.rb#122 +class Arel::Nodes::Except < ::Arel::Nodes::Binary; end + +# source://activerecord//lib/arel/nodes/function.rb#36 +class Arel::Nodes::Exists < ::Arel::Nodes::Function; end + +# source://activerecord//lib/arel/nodes/extract.rb#5 +class Arel::Nodes::Extract < ::Arel::Nodes::Unary + # @return [Extract] a new instance of Extract + # + # source://activerecord//lib/arel/nodes/extract.rb#8 + def initialize(expr, field); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/extract.rb#21 + def ==(other); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/extract.rb#17 + def eql?(other); end + + # Returns the value of attribute field. + # + # source://activerecord//lib/arel/nodes/extract.rb#6 + def field; end + + # Sets the attribute field + # + # @param value the value to set the attribute field to. + # + # source://activerecord//lib/arel/nodes/extract.rb#6 + def field=(_arg0); end + + # source://activerecord//lib/arel/nodes/extract.rb#13 + def hash; end +end + +# source://activerecord//lib/arel/nodes/false.rb#5 +class Arel::Nodes::False < ::Arel::Nodes::NodeExpression + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/false.rb#13 + def ==(other); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/false.rb#10 + def eql?(other); end + + # source://activerecord//lib/arel/nodes/false.rb#6 + def hash; end +end + +# source://activerecord//lib/arel/nodes/binary.rb#32 +module Arel::Nodes::FetchAttribute + # source://activerecord//lib/arel/nodes/binary.rb#33 + def fetch_attribute(&_arg0); end +end + +# source://activerecord//lib/arel/nodes/filter.rb#5 +class Arel::Nodes::Filter < ::Arel::Nodes::Binary + include ::Arel::WindowPredications +end + +# source://activerecord//lib/arel/nodes/window.rb#120 +class Arel::Nodes::Following < ::Arel::Nodes::Unary + # @return [Following] a new instance of Following + # + # source://activerecord//lib/arel/nodes/window.rb#121 + def initialize(expr = T.unsafe(nil)); end +end + +# source://activerecord//lib/arel/nodes/fragments.rb#5 +class Arel::Nodes::Fragments < ::Arel::Nodes::Node + # @return [Fragments] a new instance of Fragments + # + # source://activerecord//lib/arel/nodes/fragments.rb#8 + def initialize(values = T.unsafe(nil)); end + + # @raise [ArgumentError] + # + # source://activerecord//lib/arel/nodes/fragments.rb#22 + def +(other); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/fragments.rb#32 + def ==(other); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/fragments.rb#28 + def eql?(other); end + + # source://activerecord//lib/arel/nodes/fragments.rb#18 + def hash; end + + # Returns the value of attribute values. + # + # source://activerecord//lib/arel/nodes/fragments.rb#6 + def values; end + + private + + # source://activerecord//lib/arel/nodes/fragments.rb#13 + def initialize_copy(other); end +end + +# source://activerecord//lib/arel/nodes/full_outer_join.rb#5 +class Arel::Nodes::FullOuterJoin < ::Arel::Nodes::Join; end + +# source://activerecord//lib/arel/nodes/function.rb#5 +class Arel::Nodes::Function < ::Arel::Nodes::NodeExpression + include ::Arel::WindowPredications + include ::Arel::FilterPredications + + # @return [Function] a new instance of Function + # + # source://activerecord//lib/arel/nodes/function.rb#11 + def initialize(expr); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/function.rb#26 + def ==(other); end + + # Returns the value of attribute distinct. + # + # source://activerecord//lib/arel/nodes/function.rb#9 + def distinct; end + + # Sets the attribute distinct + # + # @param value the value to set the attribute distinct to. + # + # source://activerecord//lib/arel/nodes/function.rb#9 + def distinct=(_arg0); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/function.rb#21 + def eql?(other); end + + # Returns the value of attribute expressions. + # + # source://activerecord//lib/arel/nodes/function.rb#9 + def expressions; end + + # Sets the attribute expressions + # + # @param value the value to set the attribute expressions to. + # + # source://activerecord//lib/arel/nodes/function.rb#9 + def expressions=(_arg0); end + + # source://activerecord//lib/arel/nodes/function.rb#17 + def hash; end +end + +# source://activerecord//lib/arel/nodes/binary.rb#50 +class Arel::Nodes::GreaterThan < ::Arel::Nodes::Binary + include ::Arel::Nodes::FetchAttribute + + # source://activerecord//lib/arel/nodes/binary.rb#53 + def invert; end +end + +# source://activerecord//lib/arel/nodes/binary.rb#58 +class Arel::Nodes::GreaterThanOrEqual < ::Arel::Nodes::Binary + include ::Arel::Nodes::FetchAttribute + + # source://activerecord//lib/arel/nodes/binary.rb#61 + def invert; end +end + +# source://activerecord//lib/arel/nodes/unary.rb#41 +class Arel::Nodes::Group < ::Arel::Nodes::Unary; end + +# source://activerecord//lib/arel/nodes/grouping.rb#5 +class Arel::Nodes::Grouping < ::Arel::Nodes::Unary + # source://activerecord//lib/arel/nodes/grouping.rb#6 + def fetch_attribute(&block); end +end + +# source://activerecord//lib/arel/nodes/unary.rb#41 +class Arel::Nodes::GroupingElement < ::Arel::Nodes::Unary; end + +# source://activerecord//lib/arel/nodes/unary.rb#41 +class Arel::Nodes::GroupingSet < ::Arel::Nodes::Unary; end + +# source://activerecord//lib/arel/nodes/homogeneous_in.rb#5 +class Arel::Nodes::HomogeneousIn < ::Arel::Nodes::Node + # @return [HomogeneousIn] a new instance of HomogeneousIn + # + # source://activerecord//lib/arel/nodes/homogeneous_in.rb#8 + def initialize(values, attribute, type); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/homogeneous_in.rb#21 + def ==(other); end + + # Returns the value of attribute attribute. + # + # source://activerecord//lib/arel/nodes/homogeneous_in.rb#6 + def attribute; end + + # source://activerecord//lib/arel/nodes/homogeneous_in.rb#39 + def casted_values; end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/homogeneous_in.rb#18 + def eql?(other); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/homogeneous_in.rb#23 + def equality?; end + + # source://activerecord//lib/arel/nodes/homogeneous_in.rb#54 + def fetch_attribute(&block); end + + # source://activerecord//lib/arel/nodes/homogeneous_in.rb#14 + def hash; end + + # source://activerecord//lib/arel/nodes/homogeneous_in.rb#27 + def invert; end + + # source://activerecord//lib/arel/nodes/homogeneous_in.rb#31 + def left; end + + # source://activerecord//lib/arel/nodes/homogeneous_in.rb#50 + def proc_for_binds; end + + # source://activerecord//lib/arel/nodes/homogeneous_in.rb#35 + def right; end + + # Returns the value of attribute type. + # + # source://activerecord//lib/arel/nodes/homogeneous_in.rb#6 + def type; end + + # Returns the value of attribute values. + # + # source://activerecord//lib/arel/nodes/homogeneous_in.rb#6 + def values; end + + protected + + # source://activerecord//lib/arel/nodes/homogeneous_in.rb#63 + def ivars; end +end + +# source://activerecord//lib/arel/nodes/in.rb#5 +class Arel::Nodes::In < ::Arel::Nodes::Binary + include ::Arel::Nodes::FetchAttribute + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/in.rb#8 + def equality?; end + + # source://activerecord//lib/arel/nodes/in.rb#10 + def invert; end +end + +# source://activerecord//lib/arel/nodes/infix_operation.rb#5 +class Arel::Nodes::InfixOperation < ::Arel::Nodes::Binary + # @return [InfixOperation] a new instance of InfixOperation + # + # source://activerecord//lib/arel/nodes/infix_operation.rb#14 + def initialize(operator, left, right); end + + # Returns the value of attribute operator. + # + # source://activerecord//lib/arel/nodes/infix_operation.rb#12 + def operator; end +end + +# source://activerecord//lib/arel/nodes/inner_join.rb#5 +class Arel::Nodes::InnerJoin < ::Arel::Nodes::Join; end + +# source://activerecord//lib/arel/nodes/insert_statement.rb#5 +class Arel::Nodes::InsertStatement < ::Arel::Nodes::Node + # @return [InsertStatement] a new instance of InsertStatement + # + # source://activerecord//lib/arel/nodes/insert_statement.rb#8 + def initialize(relation = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/insert_statement.rb#34 + def ==(other); end + + # Returns the value of attribute columns. + # + # source://activerecord//lib/arel/nodes/insert_statement.rb#6 + def columns; end + + # Sets the attribute columns + # + # @param value the value to set the attribute columns to. + # + # source://activerecord//lib/arel/nodes/insert_statement.rb#6 + def columns=(_arg0); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/insert_statement.rb#27 + def eql?(other); end + + # source://activerecord//lib/arel/nodes/insert_statement.rb#23 + def hash; end + + # Returns the value of attribute relation. + # + # source://activerecord//lib/arel/nodes/insert_statement.rb#6 + def relation; end + + # Sets the attribute relation + # + # @param value the value to set the attribute relation to. + # + # source://activerecord//lib/arel/nodes/insert_statement.rb#6 + def relation=(_arg0); end + + # Returns the value of attribute select. + # + # source://activerecord//lib/arel/nodes/insert_statement.rb#6 + def select; end + + # Sets the attribute select + # + # @param value the value to set the attribute select to. + # + # source://activerecord//lib/arel/nodes/insert_statement.rb#6 + def select=(_arg0); end + + # Returns the value of attribute values. + # + # source://activerecord//lib/arel/nodes/insert_statement.rb#6 + def values; end + + # Sets the attribute values + # + # @param value the value to set the attribute values to. + # + # source://activerecord//lib/arel/nodes/insert_statement.rb#6 + def values=(_arg0); end + + private + + # source://activerecord//lib/arel/nodes/insert_statement.rb#16 + def initialize_copy(other); end +end + +# source://activerecord//lib/arel/nodes/binary.rb#122 +class Arel::Nodes::Intersect < ::Arel::Nodes::Binary; end + +# source://activerecord//lib/arel/nodes/binary.rb#82 +class Arel::Nodes::IsDistinctFrom < ::Arel::Nodes::Binary + include ::Arel::Nodes::FetchAttribute + + # source://activerecord//lib/arel/nodes/binary.rb#85 + def invert; end +end + +# source://activerecord//lib/arel/nodes/binary.rb#90 +class Arel::Nodes::IsNotDistinctFrom < ::Arel::Nodes::Binary + include ::Arel::Nodes::FetchAttribute + + # source://activerecord//lib/arel/nodes/binary.rb#93 + def invert; end +end + +# source://activerecord//lib/arel/nodes/binary.rb#122 +class Arel::Nodes::Join < ::Arel::Nodes::Binary; end + +# Class that represents a join source +# +# https://www.sqlite.org/syntaxdiagrams.html#join-source +# +# source://activerecord//lib/arel/nodes/join_source.rb#10 +class Arel::Nodes::JoinSource < ::Arel::Nodes::Binary + # @return [JoinSource] a new instance of JoinSource + # + # source://activerecord//lib/arel/nodes/join_source.rb#11 + def initialize(single_source, joinop = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/join_source.rb#15 + def empty?; end +end + +# source://activerecord//lib/arel/nodes/unary.rb#41 +class Arel::Nodes::Lateral < ::Arel::Nodes::Unary; end + +# source://activerecord//lib/arel/nodes/leading_join.rb#5 +class Arel::Nodes::LeadingJoin < ::Arel::Nodes::InnerJoin; end + +# source://activerecord//lib/arel/nodes/binary.rb#66 +class Arel::Nodes::LessThan < ::Arel::Nodes::Binary + include ::Arel::Nodes::FetchAttribute + + # source://activerecord//lib/arel/nodes/binary.rb#69 + def invert; end +end + +# source://activerecord//lib/arel/nodes/binary.rb#74 +class Arel::Nodes::LessThanOrEqual < ::Arel::Nodes::Binary + include ::Arel::Nodes::FetchAttribute + + # source://activerecord//lib/arel/nodes/binary.rb#77 + def invert; end +end + +# source://activerecord//lib/arel/nodes/unary.rb#41 +class Arel::Nodes::Limit < ::Arel::Nodes::Unary; end + +# source://activerecord//lib/arel/nodes/unary.rb#41 +class Arel::Nodes::Lock < ::Arel::Nodes::Unary; end + +# source://activerecord//lib/arel/nodes/matches.rb#5 +class Arel::Nodes::Matches < ::Arel::Nodes::Binary + # @return [Matches] a new instance of Matches + # + # source://activerecord//lib/arel/nodes/matches.rb#9 + def initialize(left, right, escape = T.unsafe(nil), case_sensitive = T.unsafe(nil)); end + + # Returns the value of attribute case_sensitive. + # + # source://activerecord//lib/arel/nodes/matches.rb#7 + def case_sensitive; end + + # Sets the attribute case_sensitive + # + # @param value the value to set the attribute case_sensitive to. + # + # source://activerecord//lib/arel/nodes/matches.rb#7 + def case_sensitive=(_arg0); end + + # Returns the value of attribute escape. + # + # source://activerecord//lib/arel/nodes/matches.rb#6 + def escape; end +end + +# source://activerecord//lib/arel/nodes/function.rb#36 +class Arel::Nodes::Max < ::Arel::Nodes::Function; end + +# source://activerecord//lib/arel/nodes/function.rb#36 +class Arel::Nodes::Min < ::Arel::Nodes::Function; end + +# source://activerecord//lib/arel/nodes/infix_operation.rb#20 +class Arel::Nodes::Multiplication < ::Arel::Nodes::InfixOperation + # @return [Multiplication] a new instance of Multiplication + # + # source://activerecord//lib/arel/nodes/infix_operation.rb#21 + def initialize(left, right); end +end + +# source://activerecord//lib/arel/nodes/named_function.rb#5 +class Arel::Nodes::NamedFunction < ::Arel::Nodes::Function + # @return [NamedFunction] a new instance of NamedFunction + # + # source://activerecord//lib/arel/nodes/named_function.rb#8 + def initialize(name, expr); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/named_function.rb#20 + def ==(other); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/named_function.rb#17 + def eql?(other); end + + # source://activerecord//lib/arel/nodes/named_function.rb#13 + def hash; end + + # Returns the value of attribute name. + # + # source://activerecord//lib/arel/nodes/named_function.rb#6 + def name; end + + # Sets the attribute name + # + # @param value the value to set the attribute name to. + # + # source://activerecord//lib/arel/nodes/named_function.rb#6 + def name=(_arg0); end +end + +# source://activerecord//lib/arel/nodes/window.rb#68 +class Arel::Nodes::NamedWindow < ::Arel::Nodes::Window + # @return [NamedWindow] a new instance of NamedWindow + # + # source://activerecord//lib/arel/nodes/window.rb#71 + def initialize(name); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/window.rb#88 + def ==(other); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/window.rb#85 + def eql?(other); end + + # source://activerecord//lib/arel/nodes/window.rb#81 + def hash; end + + # Returns the value of attribute name. + # + # source://activerecord//lib/arel/nodes/window.rb#69 + def name; end + + # Sets the attribute name + # + # @param value the value to set the attribute name to. + # + # source://activerecord//lib/arel/nodes/window.rb#69 + def name=(_arg0); end + + private + + # source://activerecord//lib/arel/nodes/window.rb#76 + def initialize_copy(other); end +end + +# source://activerecord//lib/arel/nodes/nary.rb#5 +class Arel::Nodes::Nary < ::Arel::Nodes::NodeExpression + # @return [Nary] a new instance of Nary + # + # source://activerecord//lib/arel/nodes/nary.rb#8 + def initialize(children); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/nary.rb#33 + def ==(other); end + + # Returns the value of attribute children. + # + # source://activerecord//lib/arel/nodes/nary.rb#6 + def children; end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/nary.rb#29 + def eql?(other); end + + # source://activerecord//lib/arel/nodes/nary.rb#21 + def fetch_attribute(&block); end + + # source://activerecord//lib/arel/nodes/nary.rb#25 + def hash; end + + # source://activerecord//lib/arel/nodes/nary.rb#13 + def left; end + + # source://activerecord//lib/arel/nodes/nary.rb#17 + def right; end +end + +# = Using +Arel::Nodes::Node+ +# +# Active Record uses Arel to compose SQL statements. Instead of building SQL strings directly, it's building an +# abstract syntax tree (AST) of the statement using various types of Arel::Nodes::Node. Each node represents a +# fragment of an SQL statement. +# +# The intermediate representation allows Arel to compile the statement into the database's specific SQL dialect +# only before sending it without having to care about the nuances of each database when building the statement. +# It also allows easier composition of statements without having to resort to (brittle and unsafe) string manipulation. +# +# == Building constraints +# +# One of the most common use cases of Arel is generating constraints for +SELECT+ statements. To help with that, +# most nodes include a couple of useful factory methods to create subtree structures for common constraints. For +# a full list of those, please refer to Arel::Predications. +# +# The following example creates an equality constraint where the value of the name column on the users table +# matches the value DHH. +# +# users = Arel::Table.new(:users) +# constraint = users[:name].eq("DHH") +# +# # => Arel::Nodes::Equality.new( +# # Arel::Attributes::Attribute.new(users, "name"), +# # Arel::Nodes::Casted.new( +# # "DHH", +# # Arel::Attributes::Attribute.new(users, "name") +# # ) +# # ) +# +# The resulting SQL fragment will look like this: +# +# "users"."name" = 'DHH' +# +# The constraint fragments can be used with regular ActiveRecord::Relation objects instead of a Hash. The +# following two examples show two ways of creating the same query. +# +# User.where(name: 'DHH') +# +# # SELECT "users".* FROM "users" WHERE "users"."name" = 'DHH' +# +# users = User.arel_table +# +# User.where(users[:name].eq('DHH')) +# +# # SELECT "users".* FROM "users" WHERE "users"."name" = 'DHH' +# +# == Functions +# +# Arel comes with built-in support for SQL functions like +COUNT+, +SUM+, +MIN+, +MAX+, and +AVG+. The +# Arel::Expressions module includes factory methods for the default functions. +# +# employees = Employee.arel_table +# +# Employee.select(employees[:department_id], employees[:salary].average).group(employees[:department_id]) +# +# # SELECT "employees"."department_id", AVG("employees"."salary") +# # FROM "employees" GROUP BY "employees"."department_id" +# +# It’s also possible to use custom functions by using the Arel::Nodes::NamedFunction node type. It accepts a +# function name and an array of parameters. +# +# Arel::Nodes::NamedFunction.new('date_trunc', [Arel::Nodes.build_quoted('day'), User.arel_table[:created_at]]) +# +# # date_trunc('day', "users"."created_at") +# +# == Quoting & bind params +# +# Values that you pass to Arel nodes need to be quoted or wrapped in bind params. This ensures they are properly +# converted into the correct format without introducing a possible SQL injection vulnerability. Most factory +# methods (like +eq+, +gt+, +lteq+, …) quote passed values automatically. When not using a factory method, it’s +# possible to convert a value and wrap it in an Arel::Nodes::Quoted node (if necessary) by calling +Arel::Nodes. +# build_quoted+. +# +# Arel::Nodes.build_quoted("foo") # 'foo' +# Arel::Nodes.build_quoted(12.3) # 12.3 +# +# Instead of quoting values and embedding them directly in the SQL statement, it’s also possible to create bind +# params. This keeps the actual values outside of the statement and allows using the prepared statement feature +# of some databases. +# +# attribute = ActiveRecord::Relation::QueryAttribute.new(:name, "DHH", ActiveRecord::Type::String.new) +# Arel::Nodes::BindParam.new(attribute) +# +# When ActiveRecord runs the query, bind params are replaced by placeholders (like +$1+) and the values are passed +# separately. +# +# == SQL Literals +# +# For cases where there is no way to represent a particular SQL fragment using Arel nodes, you can use an SQL +# literal. SQL literals are strings that Arel will treat “as is”. +# +# Arel.sql('LOWER("users"."name")').eq('dhh') +# +# # LOWER("users"."name") = 'dhh' +# +# Please keep in mind that passing data as raw SQL literals might introduce a possible SQL injection. However, +# `Arel.sql` supports binding parameters which will ensure proper quoting. This can be useful when you need to +# control the exact SQL you run, but you still have potentially user-supplied values. +# +# Arel.sql('LOWER("users"."name") = ?', 'dhh') +# +# # LOWER("users"."name") = 'dhh' +# +# You can also combine SQL literals. +# +# sql = Arel.sql('SELECT * FROM "users" WHERE ') +# sql += Arel.sql('LOWER("users"."name") = :name', name: 'dhh') +# sql += Arel.sql('AND "users"."age" > :age', age: 35) +# +# # SELECT * FROM "users" WHERE LOWER("users"."name") = 'dhh' AND "users"."age" > '35' +# +# source://activerecord//lib/arel/nodes/node.rb#116 +class Arel::Nodes::Node + include ::Arel::FactoryMethods + + # Factory method to create an Nodes::And node. + # + # source://activerecord//lib/arel/nodes/node.rb#135 + def and(right); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/node.rb#158 + def equality?; end + + # source://activerecord//lib/arel/nodes/node.rb#155 + def fetch_attribute(&_arg0); end + + # source://activerecord//lib/arel/nodes/node.rb#139 + def invert; end + + # Factory method to create a Nodes::Not node that has the recipient of + # the caller as a child. + # + # source://activerecord//lib/arel/nodes/node.rb#122 + def not; end + + # Factory method to create a Nodes::Grouping node that has an Nodes::Or + # node as a child. + # + # source://activerecord//lib/arel/nodes/node.rb#129 + def or(right); end + + # FIXME: this method should go away. I don't like people calling + # to_sql on non-head nodes. This forces us to walk the AST until we + # can find a node that has a "relation" member. + # + # Maybe we should just use `Table.engine`? :'( + # + # source://activerecord//lib/arel/nodes/node.rb#148 + def to_sql(engine = T.unsafe(nil)); end +end + +# source://activerecord//lib/arel/nodes/node_expression.rb#5 +class Arel::Nodes::NodeExpression < ::Arel::Nodes::Node + include ::Arel::Expressions + include ::Arel::Predications + include ::Arel::AliasPredication + include ::Arel::OrderPredications + include ::Arel::Math +end + +# source://activerecord//lib/arel/nodes/unary.rb#41 +class Arel::Nodes::Not < ::Arel::Nodes::Unary; end + +# source://activerecord//lib/arel/nodes/binary.rb#98 +class Arel::Nodes::NotEqual < ::Arel::Nodes::Binary + include ::Arel::Nodes::FetchAttribute + + # source://activerecord//lib/arel/nodes/binary.rb#101 + def invert; end +end + +# source://activerecord//lib/arel/nodes/binary.rb#106 +class Arel::Nodes::NotIn < ::Arel::Nodes::Binary + include ::Arel::Nodes::FetchAttribute + + # source://activerecord//lib/arel/nodes/binary.rb#109 + def invert; end +end + +# source://activerecord//lib/arel/nodes/regexp.rb#14 +class Arel::Nodes::NotRegexp < ::Arel::Nodes::Regexp; end + +# source://activerecord//lib/arel/nodes/ordering.rb#15 +class Arel::Nodes::NullsFirst < ::Arel::Nodes::Ordering + # source://activerecord//lib/arel/nodes/ordering.rb#16 + def reverse; end +end + +# source://activerecord//lib/arel/nodes/ordering.rb#21 +class Arel::Nodes::NullsLast < ::Arel::Nodes::Ordering + # source://activerecord//lib/arel/nodes/ordering.rb#22 + def reverse; end +end + +# source://activerecord//lib/arel/nodes/unary.rb#41 +class Arel::Nodes::Offset < ::Arel::Nodes::Unary; end + +# source://activerecord//lib/arel/nodes/unary.rb#41 +class Arel::Nodes::On < ::Arel::Nodes::Unary; end + +# source://activerecord//lib/arel/nodes/unary.rb#41 +class Arel::Nodes::OptimizerHints < ::Arel::Nodes::Unary; end + +# source://activerecord//lib/arel/nodes/nary.rb#37 +class Arel::Nodes::Or < ::Arel::Nodes::Nary; end + +# source://activerecord//lib/arel/nodes/ordering.rb#5 +class Arel::Nodes::Ordering < ::Arel::Nodes::Unary + # source://activerecord//lib/arel/nodes/ordering.rb#6 + def nulls_first; end + + # source://activerecord//lib/arel/nodes/ordering.rb#10 + def nulls_last; end +end + +# source://activerecord//lib/arel/nodes/outer_join.rb#5 +class Arel::Nodes::OuterJoin < ::Arel::Nodes::Join; end + +# source://activerecord//lib/arel/nodes/over.rb#5 +class Arel::Nodes::Over < ::Arel::Nodes::Binary + # @return [Over] a new instance of Over + # + # source://activerecord//lib/arel/nodes/over.rb#8 + def initialize(left, right = T.unsafe(nil)); end + + # source://activerecord//lib/arel/nodes/over.rb#12 + def operator; end +end + +# source://activerecord//lib/arel/nodes/infix_operation.rb#56 +class Arel::Nodes::Overlaps < ::Arel::Nodes::InfixOperation + # @return [Overlaps] a new instance of Overlaps + # + # source://activerecord//lib/arel/nodes/infix_operation.rb#57 + def initialize(left, right); end +end + +# source://activerecord//lib/arel/nodes/window.rb#114 +class Arel::Nodes::Preceding < ::Arel::Nodes::Unary + # @return [Preceding] a new instance of Preceding + # + # source://activerecord//lib/arel/nodes/window.rb#115 + def initialize(expr = T.unsafe(nil)); end +end + +# source://activerecord//lib/arel/nodes/casted.rb#37 +class Arel::Nodes::Quoted < ::Arel::Nodes::Unary + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/casted.rb#43 + def infinite?; end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/casted.rb#41 + def nil?; end + + # source://activerecord//lib/arel/nodes/casted.rb#39 + def value_before_type_cast; end + + # source://activerecord//lib/arel/nodes/casted.rb#38 + def value_for_database; end +end + +# source://activerecord//lib/arel/nodes/window.rb#97 +class Arel::Nodes::Range < ::Arel::Nodes::Unary + # @return [Range] a new instance of Range + # + # source://activerecord//lib/arel/nodes/window.rb#98 + def initialize(expr = T.unsafe(nil)); end +end + +# source://activerecord//lib/arel/nodes/regexp.rb#5 +class Arel::Nodes::Regexp < ::Arel::Nodes::Binary + # @return [Regexp] a new instance of Regexp + # + # source://activerecord//lib/arel/nodes/regexp.rb#8 + def initialize(left, right, case_sensitive = T.unsafe(nil)); end + + # Returns the value of attribute case_sensitive. + # + # source://activerecord//lib/arel/nodes/regexp.rb#6 + def case_sensitive; end + + # Sets the attribute case_sensitive + # + # @param value the value to set the attribute case_sensitive to. + # + # source://activerecord//lib/arel/nodes/regexp.rb#6 + def case_sensitive=(_arg0); end +end + +# source://activerecord//lib/arel/nodes/right_outer_join.rb#5 +class Arel::Nodes::RightOuterJoin < ::Arel::Nodes::Join; end + +# source://activerecord//lib/arel/nodes/unary.rb#41 +class Arel::Nodes::RollUp < ::Arel::Nodes::Unary; end + +# source://activerecord//lib/arel/nodes/window.rb#91 +class Arel::Nodes::Rows < ::Arel::Nodes::Unary + # @return [Rows] a new instance of Rows + # + # source://activerecord//lib/arel/nodes/window.rb#92 + def initialize(expr = T.unsafe(nil)); end +end + +# source://activerecord//lib/arel/nodes/select_core.rb#5 +class Arel::Nodes::SelectCore < ::Arel::Nodes::Node + # @return [SelectCore] a new instance of SelectCore + # + # source://activerecord//lib/arel/nodes/select_core.rb#9 + def initialize(relation = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/select_core.rb#64 + def ==(other); end + + # Returns the value of attribute comment. + # + # source://activerecord//lib/arel/nodes/select_core.rb#6 + def comment; end + + # Sets the attribute comment + # + # @param value the value to set the attribute comment to. + # + # source://activerecord//lib/arel/nodes/select_core.rb#6 + def comment=(_arg0); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/select_core.rb#52 + def eql?(other); end + + # source://activerecord//lib/arel/nodes/select_core.rb#24 + def from; end + + # source://activerecord//lib/arel/nodes/select_core.rb#28 + def from=(value); end + + # source://activerecord//lib/arel/nodes/select_core.rb#33 + def froms; end + + # source://activerecord//lib/arel/nodes/select_core.rb#32 + def froms=(value); end + + # Returns the value of attribute groups. + # + # source://activerecord//lib/arel/nodes/select_core.rb#6 + def groups; end + + # Sets the attribute groups + # + # @param value the value to set the attribute groups to. + # + # source://activerecord//lib/arel/nodes/select_core.rb#6 + def groups=(_arg0); end + + # source://activerecord//lib/arel/nodes/select_core.rb#45 + def hash; end + + # Returns the value of attribute havings. + # + # source://activerecord//lib/arel/nodes/select_core.rb#7 + def havings; end + + # Sets the attribute havings + # + # @param value the value to set the attribute havings to. + # + # source://activerecord//lib/arel/nodes/select_core.rb#7 + def havings=(_arg0); end + + # Returns the value of attribute optimizer_hints. + # + # source://activerecord//lib/arel/nodes/select_core.rb#7 + def optimizer_hints; end + + # Sets the attribute optimizer_hints + # + # @param value the value to set the attribute optimizer_hints to. + # + # source://activerecord//lib/arel/nodes/select_core.rb#7 + def optimizer_hints=(_arg0); end + + # Returns the value of attribute projections. + # + # source://activerecord//lib/arel/nodes/select_core.rb#6 + def projections; end + + # Sets the attribute projections + # + # @param value the value to set the attribute projections to. + # + # source://activerecord//lib/arel/nodes/select_core.rb#6 + def projections=(_arg0); end + + # Returns the value of attribute set_quantifier. + # + # source://activerecord//lib/arel/nodes/select_core.rb#7 + def set_quantifier; end + + # Sets the attribute set_quantifier + # + # @param value the value to set the attribute set_quantifier to. + # + # source://activerecord//lib/arel/nodes/select_core.rb#7 + def set_quantifier=(_arg0); end + + # Returns the value of attribute source. + # + # source://activerecord//lib/arel/nodes/select_core.rb#7 + def source; end + + # Sets the attribute source + # + # @param value the value to set the attribute source to. + # + # source://activerecord//lib/arel/nodes/select_core.rb#7 + def source=(_arg0); end + + # Returns the value of attribute wheres. + # + # source://activerecord//lib/arel/nodes/select_core.rb#6 + def wheres; end + + # Sets the attribute wheres + # + # @param value the value to set the attribute wheres to. + # + # source://activerecord//lib/arel/nodes/select_core.rb#6 + def wheres=(_arg0); end + + # Returns the value of attribute windows. + # + # source://activerecord//lib/arel/nodes/select_core.rb#6 + def windows; end + + # Sets the attribute windows + # + # @param value the value to set the attribute windows to. + # + # source://activerecord//lib/arel/nodes/select_core.rb#6 + def windows=(_arg0); end + + private + + # source://activerecord//lib/arel/nodes/select_core.rb#35 + def initialize_copy(other); end +end + +# source://activerecord//lib/arel/nodes/select_statement.rb#5 +class Arel::Nodes::SelectStatement < ::Arel::Nodes::NodeExpression + # @return [SelectStatement] a new instance of SelectStatement + # + # source://activerecord//lib/arel/nodes/select_statement.rb#9 + def initialize(relation = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/select_statement.rb#38 + def ==(other); end + + # Returns the value of attribute cores. + # + # source://activerecord//lib/arel/nodes/select_statement.rb#6 + def cores; end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/select_statement.rb#29 + def eql?(other); end + + # source://activerecord//lib/arel/nodes/select_statement.rb#25 + def hash; end + + # Returns the value of attribute limit. + # + # source://activerecord//lib/arel/nodes/select_statement.rb#7 + def limit; end + + # Sets the attribute limit + # + # @param value the value to set the attribute limit to. + # + # source://activerecord//lib/arel/nodes/select_statement.rb#7 + def limit=(_arg0); end + + # Returns the value of attribute lock. + # + # source://activerecord//lib/arel/nodes/select_statement.rb#7 + def lock; end + + # Sets the attribute lock + # + # @param value the value to set the attribute lock to. + # + # source://activerecord//lib/arel/nodes/select_statement.rb#7 + def lock=(_arg0); end + + # Returns the value of attribute offset. + # + # source://activerecord//lib/arel/nodes/select_statement.rb#7 + def offset; end + + # Sets the attribute offset + # + # @param value the value to set the attribute offset to. + # + # source://activerecord//lib/arel/nodes/select_statement.rb#7 + def offset=(_arg0); end + + # Returns the value of attribute orders. + # + # source://activerecord//lib/arel/nodes/select_statement.rb#7 + def orders; end + + # Sets the attribute orders + # + # @param value the value to set the attribute orders to. + # + # source://activerecord//lib/arel/nodes/select_statement.rb#7 + def orders=(_arg0); end + + # Returns the value of attribute with. + # + # source://activerecord//lib/arel/nodes/select_statement.rb#7 + def with; end + + # Sets the attribute with + # + # @param value the value to set the attribute with to. + # + # source://activerecord//lib/arel/nodes/select_statement.rb#7 + def with=(_arg0); end + + private + + # source://activerecord//lib/arel/nodes/select_statement.rb#19 + def initialize_copy(other); end +end + +# source://activerecord//lib/arel/nodes/sql_literal.rb#5 +class Arel::Nodes::SqlLiteral < ::String + include ::Arel::Expressions + include ::Arel::Predications + include ::Arel::AliasPredication + include ::Arel::OrderPredications + + # @return [SqlLiteral] a new instance of SqlLiteral + # + # source://activerecord//lib/arel/nodes/sql_literal.rb#13 + def initialize(string, retryable: T.unsafe(nil)); end + + # @raise [ArgumentError] + # + # source://activerecord//lib/arel/nodes/sql_literal.rb#25 + def +(other); end + + # source://activerecord//lib/arel/nodes/sql_literal.rb#18 + def encode_with(coder); end + + # source://activerecord//lib/arel/nodes/sql_literal.rb#22 + def fetch_attribute(&_arg0); end + + # Returns the value of attribute retryable. + # + # source://activerecord//lib/arel/nodes/sql_literal.rb#11 + def retryable; end +end + +# source://activerecord//lib/arel/nodes/string_join.rb#5 +class Arel::Nodes::StringJoin < ::Arel::Nodes::Join + # @return [StringJoin] a new instance of StringJoin + # + # source://activerecord//lib/arel/nodes/string_join.rb#6 + def initialize(left, right = T.unsafe(nil)); end +end + +# source://activerecord//lib/arel/nodes/infix_operation.rb#38 +class Arel::Nodes::Subtraction < ::Arel::Nodes::InfixOperation + # @return [Subtraction] a new instance of Subtraction + # + # source://activerecord//lib/arel/nodes/infix_operation.rb#39 + def initialize(left, right); end +end + +# source://activerecord//lib/arel/nodes/function.rb#36 +class Arel::Nodes::Sum < ::Arel::Nodes::Function; end + +# source://activerecord//lib/arel/nodes/table_alias.rb#5 +class Arel::Nodes::TableAlias < ::Arel::Nodes::Binary + # source://activerecord//lib/arel/nodes/table_alias.rb#10 + def [](name); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/table_alias.rb#26 + def able_to_type_cast?; end + + # source://activerecord//lib/arel/nodes/table_alias.rb#6 + def name; end + + # source://activerecord//lib/arel/nodes/table_alias.rb#7 + def relation; end + + # source://activerecord//lib/arel/nodes/table_alias.rb#8 + def table_alias; end + + # source://activerecord//lib/arel/nodes/table_alias.rb#14 + def table_name; end + + # source://activerecord//lib/arel/nodes/table_alias.rb#30 + def to_cte; end + + # source://activerecord//lib/arel/nodes/table_alias.rb#18 + def type_cast_for_database(attr_name, value); end + + # source://activerecord//lib/arel/nodes/table_alias.rb#22 + def type_for_attribute(name); end +end + +# source://activerecord//lib/arel/nodes/true.rb#5 +class Arel::Nodes::True < ::Arel::Nodes::NodeExpression + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/true.rb#13 + def ==(other); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/true.rb#10 + def eql?(other); end + + # source://activerecord//lib/arel/nodes/true.rb#6 + def hash; end +end + +# source://activerecord//lib/arel/nodes/unary.rb#5 +class Arel::Nodes::Unary < ::Arel::Nodes::NodeExpression + # @return [Unary] a new instance of Unary + # + # source://activerecord//lib/arel/nodes/unary.rb#9 + def initialize(expr); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/unary.rb#22 + def ==(other); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/unary.rb#18 + def eql?(other); end + + # Returns the value of attribute expr. + # + # source://activerecord//lib/arel/nodes/unary.rb#6 + def expr; end + + # Sets the attribute expr + # + # @param value the value to set the attribute expr to. + # + # source://activerecord//lib/arel/nodes/unary.rb#6 + def expr=(_arg0); end + + # source://activerecord//lib/arel/nodes/unary.rb#14 + def hash; end + + # Returns the value of attribute expr. + # + # source://activerecord//lib/arel/nodes/unary.rb#7 + def value; end +end + +# source://activerecord//lib/arel/nodes/unary_operation.rb#5 +class Arel::Nodes::UnaryOperation < ::Arel::Nodes::Unary + # @return [UnaryOperation] a new instance of UnaryOperation + # + # source://activerecord//lib/arel/nodes/unary_operation.rb#8 + def initialize(operator, operand); end + + # Returns the value of attribute operator. + # + # source://activerecord//lib/arel/nodes/unary_operation.rb#6 + def operator; end +end + +# source://activerecord//lib/arel/nodes/binary.rb#122 +class Arel::Nodes::Union < ::Arel::Nodes::Binary; end + +# source://activerecord//lib/arel/nodes/binary.rb#122 +class Arel::Nodes::UnionAll < ::Arel::Nodes::Binary; end + +# source://activerecord//lib/arel/nodes/unqualified_column.rb#5 +class Arel::Nodes::UnqualifiedColumn < ::Arel::Nodes::Unary + # source://activerecord//lib/arel/nodes/unqualified_column.rb#6 + def attribute; end + + # source://activerecord//lib/arel/nodes/unqualified_column.rb#7 + def attribute=(_arg0); end + + # source://activerecord//lib/arel/nodes/unqualified_column.rb#13 + def column; end + + # source://activerecord//lib/arel/nodes/unqualified_column.rb#17 + def name; end + + # source://activerecord//lib/arel/nodes/unqualified_column.rb#9 + def relation; end +end + +# source://activerecord//lib/arel/nodes/update_statement.rb#5 +class Arel::Nodes::UpdateStatement < ::Arel::Nodes::Node + # @return [UpdateStatement] a new instance of UpdateStatement + # + # source://activerecord//lib/arel/nodes/update_statement.rb#8 + def initialize(relation = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/update_statement.rb#45 + def ==(other); end + + # Returns the value of attribute comment. + # + # source://activerecord//lib/arel/nodes/update_statement.rb#6 + def comment; end + + # Sets the attribute comment + # + # @param value the value to set the attribute comment to. + # + # source://activerecord//lib/arel/nodes/update_statement.rb#6 + def comment=(_arg0); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/update_statement.rb#32 + def eql?(other); end + + # Returns the value of attribute groups. + # + # source://activerecord//lib/arel/nodes/update_statement.rb#6 + def groups; end + + # Sets the attribute groups + # + # @param value the value to set the attribute groups to. + # + # source://activerecord//lib/arel/nodes/update_statement.rb#6 + def groups=(_arg0); end + + # source://activerecord//lib/arel/nodes/update_statement.rb#28 + def hash; end + + # Returns the value of attribute havings. + # + # source://activerecord//lib/arel/nodes/update_statement.rb#6 + def havings; end + + # Sets the attribute havings + # + # @param value the value to set the attribute havings to. + # + # source://activerecord//lib/arel/nodes/update_statement.rb#6 + def havings=(_arg0); end + + # Returns the value of attribute key. + # + # source://activerecord//lib/arel/nodes/update_statement.rb#6 + def key; end + + # Sets the attribute key + # + # @param value the value to set the attribute key to. + # + # source://activerecord//lib/arel/nodes/update_statement.rb#6 + def key=(_arg0); end + + # Returns the value of attribute limit. + # + # source://activerecord//lib/arel/nodes/update_statement.rb#6 + def limit; end + + # Sets the attribute limit + # + # @param value the value to set the attribute limit to. + # + # source://activerecord//lib/arel/nodes/update_statement.rb#6 + def limit=(_arg0); end + + # Returns the value of attribute offset. + # + # source://activerecord//lib/arel/nodes/update_statement.rb#6 + def offset; end + + # Sets the attribute offset + # + # @param value the value to set the attribute offset to. + # + # source://activerecord//lib/arel/nodes/update_statement.rb#6 + def offset=(_arg0); end + + # Returns the value of attribute orders. + # + # source://activerecord//lib/arel/nodes/update_statement.rb#6 + def orders; end + + # Sets the attribute orders + # + # @param value the value to set the attribute orders to. + # + # source://activerecord//lib/arel/nodes/update_statement.rb#6 + def orders=(_arg0); end + + # Returns the value of attribute relation. + # + # source://activerecord//lib/arel/nodes/update_statement.rb#6 + def relation; end + + # Sets the attribute relation + # + # @param value the value to set the attribute relation to. + # + # source://activerecord//lib/arel/nodes/update_statement.rb#6 + def relation=(_arg0); end + + # Returns the value of attribute values. + # + # source://activerecord//lib/arel/nodes/update_statement.rb#6 + def values; end + + # Sets the attribute values + # + # @param value the value to set the attribute values to. + # + # source://activerecord//lib/arel/nodes/update_statement.rb#6 + def values=(_arg0); end + + # Returns the value of attribute wheres. + # + # source://activerecord//lib/arel/nodes/update_statement.rb#6 + def wheres; end + + # Sets the attribute wheres + # + # @param value the value to set the attribute wheres to. + # + # source://activerecord//lib/arel/nodes/update_statement.rb#6 + def wheres=(_arg0); end + + private + + # source://activerecord//lib/arel/nodes/update_statement.rb#22 + def initialize_copy(other); end +end + +# source://activerecord//lib/arel/nodes/values_list.rb#5 +class Arel::Nodes::ValuesList < ::Arel::Nodes::Unary + # source://activerecord//lib/arel/nodes/values_list.rb#6 + def rows; end +end + +# source://activerecord//lib/arel/nodes/case.rb#49 +class Arel::Nodes::When < ::Arel::Nodes::Binary; end + +# source://activerecord//lib/arel/nodes/window.rb#5 +class Arel::Nodes::Window < ::Arel::Nodes::Node + # @return [Window] a new instance of Window + # + # source://activerecord//lib/arel/nodes/window.rb#8 + def initialize; end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/window.rb#65 + def ==(other); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/nodes/window.rb#59 + def eql?(other); end + + # source://activerecord//lib/arel/nodes/window.rb#30 + def frame(expr); end + + # Returns the value of attribute framing. + # + # source://activerecord//lib/arel/nodes/window.rb#6 + def framing; end + + # Sets the attribute framing + # + # @param value the value to set the attribute framing to. + # + # source://activerecord//lib/arel/nodes/window.rb#6 + def framing=(_arg0); end + + # source://activerecord//lib/arel/nodes/window.rb#55 + def hash; end + + # source://activerecord//lib/arel/nodes/window.rb#14 + def order(*expr); end + + # Returns the value of attribute orders. + # + # source://activerecord//lib/arel/nodes/window.rb#6 + def orders; end + + # Sets the attribute orders + # + # @param value the value to set the attribute orders to. + # + # source://activerecord//lib/arel/nodes/window.rb#6 + def orders=(_arg0); end + + # source://activerecord//lib/arel/nodes/window.rb#22 + def partition(*expr); end + + # Returns the value of attribute partitions. + # + # source://activerecord//lib/arel/nodes/window.rb#6 + def partitions; end + + # Sets the attribute partitions + # + # @param value the value to set the attribute partitions to. + # + # source://activerecord//lib/arel/nodes/window.rb#6 + def partitions=(_arg0); end + + # source://activerecord//lib/arel/nodes/window.rb#42 + def range(expr = T.unsafe(nil)); end + + # source://activerecord//lib/arel/nodes/window.rb#34 + def rows(expr = T.unsafe(nil)); end + + private + + # source://activerecord//lib/arel/nodes/window.rb#50 + def initialize_copy(other); end +end + +# source://activerecord//lib/arel/nodes/with.rb#5 +class Arel::Nodes::With < ::Arel::Nodes::Unary + # source://activerecord//lib/arel/nodes/with.rb#6 + def children; end +end + +# source://activerecord//lib/arel/nodes/with.rb#9 +class Arel::Nodes::WithRecursive < ::Arel::Nodes::With; end + +# source://activerecord//lib/arel/order_predications.rb#4 +module Arel::OrderPredications + # source://activerecord//lib/arel/order_predications.rb#5 + def asc; end + + # source://activerecord//lib/arel/order_predications.rb#9 + def desc; end +end + +# source://activerecord//lib/arel/predications.rb#4 +module Arel::Predications + # source://activerecord//lib/arel/predications.rb#37 + def between(other); end + + # source://activerecord//lib/arel/predications.rb#215 + def concat(other); end + + # source://activerecord//lib/arel/predications.rb#219 + def contains(other); end + + # source://activerecord//lib/arel/predications.rb#147 + def does_not_match(other, escape = T.unsafe(nil), case_sensitive = T.unsafe(nil)); end + + # source://activerecord//lib/arel/predications.rb#159 + def does_not_match_all(others, escape = T.unsafe(nil)); end + + # source://activerecord//lib/arel/predications.rb#155 + def does_not_match_any(others, escape = T.unsafe(nil)); end + + # source://activerecord//lib/arel/predications.rb#151 + def does_not_match_regexp(other, case_sensitive = T.unsafe(nil)); end + + # source://activerecord//lib/arel/predications.rb#17 + def eq(other); end + + # source://activerecord//lib/arel/predications.rb#33 + def eq_all(others); end + + # source://activerecord//lib/arel/predications.rb#29 + def eq_any(others); end + + # source://activerecord//lib/arel/predications.rb#175 + def gt(right); end + + # source://activerecord//lib/arel/predications.rb#183 + def gt_all(others); end + + # source://activerecord//lib/arel/predications.rb#179 + def gt_any(others); end + + # source://activerecord//lib/arel/predications.rb#163 + def gteq(right); end + + # source://activerecord//lib/arel/predications.rb#171 + def gteq_all(others); end + + # source://activerecord//lib/arel/predications.rb#167 + def gteq_any(others); end + + # source://activerecord//lib/arel/predications.rb#65 + def in(other); end + + # source://activerecord//lib/arel/predications.rb#80 + def in_all(others); end + + # source://activerecord//lib/arel/predications.rb#76 + def in_any(others); end + + # source://activerecord//lib/arel/predications.rb#25 + def is_distinct_from(other); end + + # source://activerecord//lib/arel/predications.rb#21 + def is_not_distinct_from(other); end + + # source://activerecord//lib/arel/predications.rb#187 + def lt(right); end + + # source://activerecord//lib/arel/predications.rb#195 + def lt_all(others); end + + # source://activerecord//lib/arel/predications.rb#191 + def lt_any(others); end + + # source://activerecord//lib/arel/predications.rb#199 + def lteq(right); end + + # source://activerecord//lib/arel/predications.rb#207 + def lteq_all(others); end + + # source://activerecord//lib/arel/predications.rb#203 + def lteq_any(others); end + + # source://activerecord//lib/arel/predications.rb#131 + def matches(other, escape = T.unsafe(nil), case_sensitive = T.unsafe(nil)); end + + # source://activerecord//lib/arel/predications.rb#143 + def matches_all(others, escape = T.unsafe(nil), case_sensitive = T.unsafe(nil)); end + + # source://activerecord//lib/arel/predications.rb#139 + def matches_any(others, escape = T.unsafe(nil), case_sensitive = T.unsafe(nil)); end + + # source://activerecord//lib/arel/predications.rb#135 + def matches_regexp(other, case_sensitive = T.unsafe(nil)); end + + # source://activerecord//lib/arel/predications.rb#84 + def not_between(other); end + + # source://activerecord//lib/arel/predications.rb#5 + def not_eq(other); end + + # source://activerecord//lib/arel/predications.rb#13 + def not_eq_all(others); end + + # source://activerecord//lib/arel/predications.rb#9 + def not_eq_any(others); end + + # source://activerecord//lib/arel/predications.rb#112 + def not_in(other); end + + # source://activerecord//lib/arel/predications.rb#127 + def not_in_all(others); end + + # source://activerecord//lib/arel/predications.rb#123 + def not_in_any(others); end + + # source://activerecord//lib/arel/predications.rb#223 + def overlaps(other); end + + # source://activerecord//lib/arel/predications.rb#227 + def quoted_array(others); end + + # source://activerecord//lib/arel/predications.rb#211 + def when(right); end + + private + + # source://activerecord//lib/arel/predications.rb#239 + def grouping_all(method_id, others, *extras); end + + # source://activerecord//lib/arel/predications.rb#232 + def grouping_any(method_id, others, *extras); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/predications.rb#248 + def infinity?(value); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/predications.rb#256 + def open_ended?(value); end + + # source://activerecord//lib/arel/predications.rb#244 + def quoted_node(other); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/predications.rb#252 + def unboundable?(value); end +end + +# source://activerecord//lib/arel/select_manager.rb#4 +class Arel::SelectManager < ::Arel::TreeManager + include ::Arel::Crud + + # @return [SelectManager] a new instance of SelectManager + # + # source://activerecord//lib/arel/select_manager.rb#9 + def initialize(table = T.unsafe(nil)); end + + # source://activerecord//lib/arel/select_manager.rb#48 + def as(other); end + + # source://activerecord//lib/arel/select_manager.rb#257 + def comment(*values); end + + # source://activerecord//lib/arel/select_manager.rb#24 + def constraints; end + + # source://activerecord//lib/arel/select_manager.rb#159 + def distinct(value = T.unsafe(nil)); end + + # source://activerecord//lib/arel/select_manager.rb#168 + def distinct_on(value); end + + # source://activerecord//lib/arel/select_manager.rb#218 + def except(other); end + + # Produces an Arel::Nodes::Exists node + # + # source://activerecord//lib/arel/select_manager.rb#44 + def exists; end + + # source://activerecord//lib/arel/select_manager.rb#90 + def from(table); end + + # source://activerecord//lib/arel/select_manager.rb#103 + def froms; end + + # source://activerecord//lib/arel/select_manager.rb#74 + def group(*columns); end + + # source://activerecord//lib/arel/select_manager.rb#124 + def having(expr); end + + # source://activerecord//lib/arel/select_manager.rb#214 + def intersect(other); end + + # source://activerecord//lib/arel/select_manager.rb#107 + def join(relation, klass = T.unsafe(nil)); end + + # source://activerecord//lib/arel/select_manager.rb#249 + def join_sources; end + + # source://activerecord//lib/arel/select_manager.rb#223 + def lateral(table_name = T.unsafe(nil)); end + + # source://activerecord//lib/arel/select_manager.rb#19 + def limit; end + + # source://activerecord//lib/arel/select_manager.rb#247 + def limit=(limit); end + + # source://activerecord//lib/arel/select_manager.rb#52 + def lock(locking = T.unsafe(nil)); end + + # source://activerecord//lib/arel/select_manager.rb#65 + def locked; end + + # source://activerecord//lib/arel/select_manager.rb#221 + def minus(other); end + + # source://activerecord//lib/arel/select_manager.rb#28 + def offset; end + + # source://activerecord//lib/arel/select_manager.rb#40 + def offset=(amount); end + + # source://activerecord//lib/arel/select_manager.rb#69 + def on(*exprs); end + + # source://activerecord//lib/arel/select_manager.rb#152 + def optimizer_hints(*hints); end + + # source://activerecord//lib/arel/select_manager.rb#177 + def order(*expr); end + + # source://activerecord//lib/arel/select_manager.rb#185 + def orders; end + + # source://activerecord//lib/arel/select_manager.rb#120 + def outer_join(relation); end + + # source://activerecord//lib/arel/select_manager.rb#135 + def project(*projections); end + + # source://activerecord//lib/arel/select_manager.rb#144 + def projections; end + + # source://activerecord//lib/arel/select_manager.rb#148 + def projections=(projections); end + + # source://activerecord//lib/arel/select_manager.rb#32 + def skip(amount); end + + # source://activerecord//lib/arel/select_manager.rb#253 + def source; end + + # source://activerecord//lib/arel/select_manager.rb#239 + def take(limit); end + + # source://activerecord//lib/arel/select_manager.rb#22 + def taken; end + + # source://activerecord//lib/arel/select_manager.rb#203 + def union(operation, other = T.unsafe(nil)); end + + # source://activerecord//lib/arel/select_manager.rb#189 + def where(expr); end + + # source://activerecord//lib/arel/select_manager.rb#197 + def where_sql(engine = T.unsafe(nil)); end + + # source://activerecord//lib/arel/select_manager.rb#129 + def window(name); end + + # source://activerecord//lib/arel/select_manager.rb#228 + def with(*subqueries); end + + private + + # source://activerecord//lib/arel/select_manager.rb#267 + def collapse(exprs); end + + # source://activerecord//lib/arel/select_manager.rb#14 + def initialize_copy(other); end +end + +# source://activerecord//lib/arel/select_manager.rb#7 +Arel::SelectManager::STRING_OR_SYMBOL_CLASS = T.let(T.unsafe(nil), Array) + +# source://activerecord//lib/arel/table.rb#4 +class Arel::Table + include ::Arel::FactoryMethods + include ::Arel::AliasPredication + + # @return [Table] a new instance of Table + # + # source://activerecord//lib/arel/table.rb#14 + def initialize(name, as: T.unsafe(nil), klass: T.unsafe(nil), type_caster: T.unsafe(nil)); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/table.rb#100 + def ==(other); end + + # source://activerecord//lib/arel/table.rb#82 + def [](name, table = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/table.rb#110 + def able_to_type_cast?; end + + # source://activerecord//lib/arel/table.rb#30 + def alias(name = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/table.rb#95 + def eql?(other); end + + # source://activerecord//lib/arel/table.rb#34 + def from; end + + # source://activerecord//lib/arel/table.rb#54 + def group(*columns); end + + # source://activerecord//lib/arel/table.rb#88 + def hash; end + + # source://activerecord//lib/arel/table.rb#78 + def having(expr); end + + # source://activerecord//lib/arel/table.rb#38 + def join(relation, klass = T.unsafe(nil)); end + + # Returns the value of attribute name. + # + # source://activerecord//lib/arel/table.rb#11 + def name; end + + # Sets the attribute name + # + # @param value the value to set the attribute name to. + # + # source://activerecord//lib/arel/table.rb#11 + def name=(_arg0); end + + # source://activerecord//lib/arel/table.rb#58 + def order(*expr); end + + # source://activerecord//lib/arel/table.rb#50 + def outer_join(relation); end + + # source://activerecord//lib/arel/table.rb#66 + def project(*things); end + + # source://activerecord//lib/arel/table.rb#74 + def skip(amount); end + + # Returns the value of attribute table_alias. + # + # source://activerecord//lib/arel/table.rb#12 + def table_alias; end + + # source://activerecord//lib/arel/table.rb#70 + def take(amount); end + + # source://activerecord//lib/arel/table.rb#102 + def type_cast_for_database(attr_name, value); end + + # source://activerecord//lib/arel/table.rb#106 + def type_for_attribute(name); end + + # source://activerecord//lib/arel/table.rb#62 + def where(condition); end + + private + + # Returns the value of attribute type_caster. + # + # source://activerecord//lib/arel/table.rb#115 + def type_caster; end + + class << self + # Returns the value of attribute engine. + # + # source://activerecord//lib/arel/table.rb#9 + def engine; end + + # Sets the attribute engine + # + # @param value the value to set the attribute engine to. + # + # source://activerecord//lib/arel/table.rb#9 + def engine=(_arg0); end + end +end + +# source://activerecord//lib/arel/tree_manager.rb#4 +class Arel::TreeManager + include ::Arel::FactoryMethods + + # Returns the value of attribute ast. + # + # source://activerecord//lib/arel/tree_manager.rb#45 + def ast; end + + # source://activerecord//lib/arel/tree_manager.rb#47 + def to_dot; end + + # source://activerecord//lib/arel/tree_manager.rb#53 + def to_sql(engine = T.unsafe(nil)); end + + private + + # source://activerecord//lib/arel/tree_manager.rb#60 + def initialize_copy(other); end +end + +# source://activerecord//lib/arel/tree_manager.rb#7 +module Arel::TreeManager::StatementMethods + # source://activerecord//lib/arel/tree_manager.rb#31 + def key; end + + # source://activerecord//lib/arel/tree_manager.rb#23 + def key=(key); end + + # source://activerecord//lib/arel/tree_manager.rb#13 + def offset(offset); end + + # source://activerecord//lib/arel/tree_manager.rb#18 + def order(*expr); end + + # source://activerecord//lib/arel/tree_manager.rb#8 + def take(limit); end + + # source://activerecord//lib/arel/tree_manager.rb#39 + def where(expr); end + + # source://activerecord//lib/arel/tree_manager.rb#35 + def wheres=(exprs); end +end + +# source://activerecord//lib/arel/update_manager.rb#4 +class Arel::UpdateManager < ::Arel::TreeManager + include ::Arel::TreeManager::StatementMethods + + # @return [UpdateManager] a new instance of UpdateManager + # + # source://activerecord//lib/arel/update_manager.rb#7 + def initialize(table = T.unsafe(nil)); end + + # source://activerecord//lib/arel/update_manager.rb#49 + def comment(value); end + + # source://activerecord//lib/arel/update_manager.rb#33 + def group(columns); end + + # source://activerecord//lib/arel/update_manager.rb#44 + def having(expr); end + + # source://activerecord//lib/arel/update_manager.rb#18 + def set(values); end + + # UPDATE +table+ + # + # source://activerecord//lib/arel/update_manager.rb#13 + def table(table); end +end + +# source://activerecord//lib/arel.rb#29 +Arel::VERSION = T.let(T.unsafe(nil), String) + +# source://activerecord//lib/arel/visitors/visitor.rb#4 +module Arel::Visitors; end + +# source://activerecord//lib/arel/visitors/dot.rb#5 +class Arel::Visitors::Dot < ::Arel::Visitors::Visitor + # @return [Dot] a new instance of Dot + # + # source://activerecord//lib/arel/visitors/dot.rb#19 + def initialize; end + + # source://activerecord//lib/arel/visitors/dot.rb#28 + def accept(object, collector); end + + private + + # source://activerecord//lib/arel/visitors/dot.rb#260 + def edge(name); end + + # source://activerecord//lib/arel/visitors/dot.rb#278 + def quote(string); end + + # source://activerecord//lib/arel/visitors/dot.rb#282 + def to_dot; end + + # source://activerecord//lib/arel/visitors/dot.rb#246 + def visit(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#215 + def visit_ActiveModel_Attribute(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#182 + def visit_Arel_Attributes_Attribute(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#192 + def visit_Arel_Nodes_And(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#43 + def visit_Arel_Nodes_Binary(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#211 + def visit_Arel_Nodes_BindParam(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#236 + def visit_Arel_Nodes_Case(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#171 + def visit_Arel_Nodes_Casted(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#232 + def visit_Arel_Nodes_Comment(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#76 + def visit_Arel_Nodes_Count(o); end + + # intentionally left blank + # + # source://activerecord//lib/arel/visitors/dot.rb#105 + def visit_Arel_Nodes_CurrentRow(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#157 + def visit_Arel_Nodes_DeleteStatement(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#106 + def visit_Arel_Nodes_Distinct(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#108 + def visit_Arel_Nodes_Extract(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#34 + def visit_Arel_Nodes_Function(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#176 + def visit_Arel_Nodes_HomogeneousIn(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#53 + def visit_Arel_Nodes_InfixOperation(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#118 + def visit_Arel_Nodes_InsertStatement(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#112 + def visit_Arel_Nodes_NamedFunction(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#95 + def visit_Arel_Nodes_NamedWindow(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#65 + def visit_Arel_Nodes_NotRegexp(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#193 + def visit_Arel_Nodes_Or(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#67 + def visit_Arel_Nodes_Ordering(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#64 + def visit_Arel_Nodes_Regexp(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#125 + def visit_Arel_Nodes_SelectCore(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#137 + def visit_Arel_Nodes_SelectStatement(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#209 + def visit_Arel_Nodes_SqlLiteral(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#85 + def visit_Arel_Nodes_StringJoin(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#71 + def visit_Arel_Nodes_TableAlias(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#39 + def visit_Arel_Nodes_Unary(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#48 + def visit_Arel_Nodes_UnaryOperation(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#146 + def visit_Arel_Nodes_UpdateStatement(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#81 + def visit_Arel_Nodes_ValuesList(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#89 + def visit_Arel_Nodes_Window(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#194 + def visit_Arel_Nodes_With(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#167 + def visit_Arel_Table(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#225 + def visit_Array(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#206 + def visit_BigDecimal(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#200 + def visit_Date(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#201 + def visit_DateTime(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#204 + def visit_FalseClass(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#207 + def visit_Float(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#219 + def visit_Hash(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#205 + def visit_Integer(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#202 + def visit_NilClass(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#230 + def visit_Set(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#196 + def visit_String(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#208 + def visit_Symbol(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#199 + def visit_Time(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#203 + def visit_TrueClass(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#187 + def visit__children(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#102 + def visit__no_edges(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#59 + def visit__regexp(o); end + + # source://activerecord//lib/arel/visitors/dot.rb#242 + def visit_edge(o, method); end + + # source://activerecord//lib/arel/visitors/dot.rb#268 + def with_node(node); end +end + +# source://activerecord//lib/arel/visitors/dot.rb#16 +class Arel::Visitors::Dot::Edge < ::Struct; end + +# source://activerecord//lib/arel/visitors/dot.rb#6 +class Arel::Visitors::Dot::Node + # @return [Node] a new instance of Node + # + # source://activerecord//lib/arel/visitors/dot.rb#9 + def initialize(name, id, fields = T.unsafe(nil)); end + + # Returns the value of attribute fields. + # + # source://activerecord//lib/arel/visitors/dot.rb#7 + def fields; end + + # Sets the attribute fields + # + # @param value the value to set the attribute fields to. + # + # source://activerecord//lib/arel/visitors/dot.rb#7 + def fields=(_arg0); end + + # Returns the value of attribute id. + # + # source://activerecord//lib/arel/visitors/dot.rb#7 + def id; end + + # Sets the attribute id + # + # @param value the value to set the attribute id to. + # + # source://activerecord//lib/arel/visitors/dot.rb#7 + def id=(_arg0); end + + # Returns the value of attribute name. + # + # source://activerecord//lib/arel/visitors/dot.rb#7 + def name; end + + # Sets the attribute name + # + # @param value the value to set the attribute name to. + # + # source://activerecord//lib/arel/visitors/dot.rb#7 + def name=(_arg0); end +end + +# source://activerecord//lib/arel/visitors/mysql.rb#5 +class Arel::Visitors::MySQL < ::Arel::Visitors::ToSql + private + + # MySQL doesn't automatically create a temporary table for use subquery, so we have + # to give it some prompting in the form of a subsubquery. + # + # source://activerecord//lib/arel/visitors/mysql.rb#93 + def build_subselect(key, o); end + + # In the simple case, MySQL allows us to place JOINs directly into the UPDATE + # query. However, this does not allow for LIMIT, OFFSET and ORDER. To support + # these, we must use a subquery. + # + # source://activerecord//lib/arel/visitors/mysql.rb#89 + def prepare_delete_statement(o); end + + # In the simple case, MySQL allows us to place JOINs directly into the UPDATE + # query. However, this does not allow for LIMIT, OFFSET and ORDER. To support + # these, we must use a subquery. + # + # source://activerecord//lib/arel/visitors/mysql.rb#81 + def prepare_update_statement(o); end + + # source://activerecord//lib/arel/visitors/mysql.rb#7 + def visit_Arel_Nodes_Bin(o, collector); end + + # source://activerecord//lib/arel/visitors/mysql.rb#34 + def visit_Arel_Nodes_Concat(o, collector); end + + # source://activerecord//lib/arel/visitors/mysql.rb#72 + def visit_Arel_Nodes_Cte(o, collector); end + + # source://activerecord//lib/arel/visitors/mysql.rb#49 + def visit_Arel_Nodes_IsDistinctFrom(o, collector); end + + # source://activerecord//lib/arel/visitors/mysql.rb#43 + def visit_Arel_Nodes_IsNotDistinctFrom(o, collector); end + + # source://activerecord//lib/arel/visitors/mysql.rb#58 + def visit_Arel_Nodes_NotRegexp(o, collector); end + + # source://activerecord//lib/arel/visitors/mysql.rb#62 + def visit_Arel_Nodes_NullsFirst(o, collector); end + + # source://activerecord//lib/arel/visitors/mysql.rb#67 + def visit_Arel_Nodes_NullsLast(o, collector); end + + # source://activerecord//lib/arel/visitors/mysql.rb#54 + def visit_Arel_Nodes_Regexp(o, collector); end + + # source://activerecord//lib/arel/visitors/mysql.rb#29 + def visit_Arel_Nodes_SelectCore(o, collector); end + + # :'( + # To retrieve all rows from a certain offset up to the end of the result set, + # you can use some large number for the second parameter. + # https://dev.mysql.com/doc/refman/en/select.html + # + # source://activerecord//lib/arel/visitors/mysql.rb#22 + def visit_Arel_Nodes_SelectStatement(o, collector); end + + # source://activerecord//lib/arel/visitors/mysql.rb#13 + def visit_Arel_Nodes_UnqualifiedColumn(o, collector); end +end + +# source://activerecord//lib/arel/visitors/postgresql.rb#5 +class Arel::Visitors::PostgreSQL < ::Arel::Visitors::ToSql + private + + # source://activerecord//lib/arel/visitors/postgresql.rb#139 + def bind_block; end + + # Utilized by GroupingSet, Cube & RollUp visitors to + # handle grouping aggregation semantics + # + # source://activerecord//lib/arel/visitors/postgresql.rb#143 + def grouping_array_or_grouping_element(o, collector); end + + # In the simple case, PostgreSQL allows us to place FROM or JOINs directly into the UPDATE + # query. However, this does not allow for LIMIT, OFFSET and ORDER. To support + # these, we must use a subquery. + # + # source://activerecord//lib/arel/visitors/postgresql.rb#38 + def prepare_update_statement(o); end + + # source://activerecord//lib/arel/visitors/postgresql.rb#98 + def visit_Arel_Nodes_Cube(o, collector); end + + # source://activerecord//lib/arel/visitors/postgresql.rb#88 + def visit_Arel_Nodes_DistinctOn(o, collector); end + + # source://activerecord//lib/arel/visitors/postgresql.rb#67 + def visit_Arel_Nodes_DoesNotMatch(o, collector); end + + # source://activerecord//lib/arel/visitors/postgresql.rb#93 + def visit_Arel_Nodes_GroupingElement(o, collector); end + + # source://activerecord//lib/arel/visitors/postgresql.rb#108 + def visit_Arel_Nodes_GroupingSet(o, collector); end + + # source://activerecord//lib/arel/visitors/postgresql.rb#118 + def visit_Arel_Nodes_InnerJoin(o, collector); end + + # source://activerecord//lib/arel/visitors/postgresql.rb#130 + def visit_Arel_Nodes_IsDistinctFrom(o, collector); end + + # source://activerecord//lib/arel/visitors/postgresql.rb#124 + def visit_Arel_Nodes_IsNotDistinctFrom(o, collector); end + + # source://activerecord//lib/arel/visitors/postgresql.rb#113 + def visit_Arel_Nodes_Lateral(o, collector); end + + # source://activerecord//lib/arel/visitors/postgresql.rb#56 + def visit_Arel_Nodes_Matches(o, collector); end + + # source://activerecord//lib/arel/visitors/postgresql.rb#83 + def visit_Arel_Nodes_NotRegexp(o, collector); end + + # source://activerecord//lib/arel/visitors/postgresql.rb#78 + def visit_Arel_Nodes_Regexp(o, collector); end + + # source://activerecord//lib/arel/visitors/postgresql.rb#103 + def visit_Arel_Nodes_RollUp(o, collector); end + + # source://activerecord//lib/arel/visitors/postgresql.rb#7 + def visit_Arel_Nodes_UpdateStatement(o, collector); end +end + +# source://activerecord//lib/arel/visitors/postgresql.rb#136 +Arel::Visitors::PostgreSQL::BIND_BLOCK = T.let(T.unsafe(nil), Proc) + +# source://activerecord//lib/arel/visitors/sqlite.rb#5 +class Arel::Visitors::SQLite < ::Arel::Visitors::ToSql + private + + # Queries used in UNION should not be wrapped by parentheses, + # because it is an invalid syntax in SQLite. + # + # source://activerecord//lib/arel/visitors/sqlite.rb#86 + def infix_value_with_paren(o, collector, value, suppress_parens = T.unsafe(nil)); end + + # source://activerecord//lib/arel/visitors/sqlite.rb#35 + def prepare_update_statement(o); end + + # source://activerecord//lib/arel/visitors/sqlite.rb#78 + def visit_Arel_Nodes_IsDistinctFrom(o, collector); end + + # source://activerecord//lib/arel/visitors/sqlite.rb#72 + def visit_Arel_Nodes_IsNotDistinctFrom(o, collector); end + + # Locks are not supported in SQLite + # + # source://activerecord//lib/arel/visitors/sqlite.rb#63 + def visit_Arel_Nodes_Lock(o, collector); end + + # source://activerecord//lib/arel/visitors/sqlite.rb#67 + def visit_Arel_Nodes_SelectStatement(o, collector); end + + # source://activerecord//lib/arel/visitors/sqlite.rb#55 + def visit_Arel_Nodes_TableAlias(o, collector); end + + # source://activerecord//lib/arel/visitors/sqlite.rb#7 + def visit_Arel_Nodes_UpdateStatement(o, collector); end +end + +# source://activerecord//lib/arel/visitors/to_sql.rb#11 +class Arel::Visitors::ToSql < ::Arel::Visitors::Visitor + # @return [ToSql] a new instance of ToSql + # + # source://activerecord//lib/arel/visitors/to_sql.rb#12 + def initialize(connection); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#17 + def compile(node, collector = T.unsafe(nil)); end + + private + + # source://activerecord//lib/arel/visitors/to_sql.rb#986 + def aggregate(name, o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#744 + def bind_block; end + + # FIXME: we should probably have a 2-pass visitor for this + # + # source://activerecord//lib/arel/visitors/to_sql.rb#933 + def build_subselect(key, o); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#1007 + def collect_ctes(children, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#175 + def collect_nodes_for(nodes, collector, spacer, connector = T.unsafe(nil)); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#877 + def collect_optimizer_hints(o, collector); end + + # Used by some visitors to enclose select queries in parentheses + # + # source://activerecord//lib/arel/visitors/to_sql.rb#971 + def grouping_parentheses(o, collector, always_wrap_selects = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/visitors/to_sql.rb#907 + def has_group_by_and_having?(o); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/visitors/to_sql.rb#899 + def has_join_sources?(o); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/visitors/to_sql.rb#903 + def has_limit_or_offset_or_orders?(o); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#947 + def infix_value(o, collector, value); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#953 + def infix_value_with_paren(o, collector, value, suppress_parens = T.unsafe(nil)); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#887 + def inject_join(list, collector, join_str); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#994 + def is_distinct_from(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#881 + def maybe_visit(thing, collector); end + + # The default strategy for an UPDATE with joins is to use a subquery. This doesn't work + # on MySQL (even when aliasing the tables), but MySQL allows using JOIN directly in + # an UPDATE statement, so in the MySQL visitor we redefine this to do that. + # + # source://activerecord//lib/arel/visitors/to_sql.rb#930 + def prepare_delete_statement(o); end + + # The default strategy for an UPDATE with joins is to use a subquery. This doesn't work + # on MySQL (even when aliasing the tables), but MySQL allows using JOIN directly in + # an UPDATE statement, so in the MySQL visitor we redefine this to do that. + # + # source://activerecord//lib/arel/visitors/to_sql.rb#914 + def prepare_update_statement(o); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#857 + def quote(value); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#867 + def quote_column_name(name); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#862 + def quote_table_name(name); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/visitors/to_sql.rb#982 + def require_parentheses?(o); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#872 + def sanitize_as_sql_comment(value); end + + # @return [Boolean] + # + # source://activerecord//lib/arel/visitors/to_sql.rb#895 + def unboundable?(value); end + + # @raise [UnsupportedVisitError] + # + # source://activerecord//lib/arel/visitors/to_sql.rb#818 + def unsupported(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#746 + def visit_ActiveModel_Attribute(o, collector); end + + # @raise [UnsupportedVisitError] + # + # source://activerecord//lib/arel/visitors/to_sql.rb#822 + def visit_ActiveSupport_Multibyte_Chars(o, collector); end + + # @raise [UnsupportedVisitError] + # + # source://activerecord//lib/arel/visitors/to_sql.rb#823 + def visit_ActiveSupport_StringInquirer(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#736 + def visit_Arel_Attributes_Attribute(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#612 + def visit_Arel_Nodes_And(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#683 + def visit_Arel_Nodes_As(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#359 + def visit_Arel_Nodes_Ascending(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#620 + def visit_Arel_Nodes_Assignment(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#411 + def visit_Arel_Nodes_Avg(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#421 + def visit_Arel_Nodes_Between(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#182 + def visit_Arel_Nodes_Bin(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#750 + def visit_Arel_Nodes_BindParam(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#760 + def visit_Arel_Nodes_BoundSqlLiteral(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#689 + def visit_Arel_Nodes_Case(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#83 + def visit_Arel_Nodes_Casted(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#171 + def visit_Arel_Nodes_Comment(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#395 + def visit_Arel_Nodes_Count(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#722 + def visit_Arel_Nodes_Cte(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#292 + def visit_Arel_Nodes_CurrentRow(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#22 + def visit_Arel_Nodes_DeleteStatement(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#363 + def visit_Arel_Nodes_Descending(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#186 + def visit_Arel_Nodes_Distinct(o, collector); end + + # @raise [NotImplementedError] + # + # source://activerecord//lib/arel/visitors/to_sql.rb#190 + def visit_Arel_Nodes_DistinctOn(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#487 + def visit_Arel_Nodes_DoesNotMatch(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#713 + def visit_Arel_Nodes_Else(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#633 + def visit_Arel_Nodes_Equality(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#217 + def visit_Arel_Nodes_Except(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#78 + def visit_Arel_Nodes_Exists(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#390 + def visit_Arel_Nodes_Extract(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#92 + def visit_Arel_Nodes_False(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#247 + def visit_Arel_Nodes_Filter(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#282 + def visit_Arel_Nodes_Following(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#853 + def visit_Arel_Nodes_Fragments(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#522 + def visit_Arel_Nodes_FullOuterJoin(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#439 + def visit_Arel_Nodes_GreaterThan(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#427 + def visit_Arel_Nodes_GreaterThanOrEqual(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#378 + def visit_Arel_Nodes_Group(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#323 + def visit_Arel_Nodes_Grouping(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#332 + def visit_Arel_Nodes_HomogeneousIn(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#578 + def visit_Arel_Nodes_In(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#837 + def visit_Arel_Nodes_InfixOperation(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#543 + def visit_Arel_Nodes_InnerJoin(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#55 + def visit_Arel_Nodes_InsertStatement(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#212 + def visit_Arel_Nodes_Intersect(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#658 + def visit_Arel_Nodes_IsDistinctFrom(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#648 + def visit_Arel_Nodes_IsNotDistinctFrom(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#499 + def visit_Arel_Nodes_JoinSource(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#463 + def visit_Arel_Nodes_LessThan(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#451 + def visit_Arel_Nodes_LessThanOrEqual(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#314 + def visit_Arel_Nodes_Limit(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#319 + def visit_Arel_Nodes_Lock(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#475 + def visit_Arel_Nodes_Matches(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#403 + def visit_Arel_Nodes_Max(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#407 + def visit_Arel_Nodes_Min(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#382 + def visit_Arel_Nodes_NamedFunction(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#222 + def visit_Arel_Nodes_NamedWindow(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#559 + def visit_Arel_Nodes_Not(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#668 + def visit_Arel_Nodes_NotEqual(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#595 + def visit_Arel_Nodes_NotIn(o, collector); end + + # @raise [NotImplementedError] + # + # source://activerecord//lib/arel/visitors/to_sql.rb#514 + def visit_Arel_Nodes_NotRegexp(o, collector); end + + # NullsFirst is available on all but MySQL, where it is redefined. + # + # source://activerecord//lib/arel/visitors/to_sql.rb#368 + def visit_Arel_Nodes_NullsFirst(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#373 + def visit_Arel_Nodes_NullsLast(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#309 + def visit_Arel_Nodes_Offset(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#554 + def visit_Arel_Nodes_On(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#166 + def visit_Arel_Nodes_OptimizerHints(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#616 + def visit_Arel_Nodes_Or(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#529 + def visit_Arel_Nodes_OuterJoin(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#296 + def visit_Arel_Nodes_Over(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#272 + def visit_Arel_Nodes_Preceding(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#86 + def visit_Arel_Nodes_Quoted(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#263 + def visit_Arel_Nodes_Range(o, collector); end + + # @raise [NotImplementedError] + # + # source://activerecord//lib/arel/visitors/to_sql.rb#510 + def visit_Arel_Nodes_Regexp(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#536 + def visit_Arel_Nodes_RightOuterJoin(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#254 + def visit_Arel_Nodes_Rows(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#145 + def visit_Arel_Nodes_SelectCore(o, collector); end + + # The Oracle enhanced adapter uses this private method, + # see https://github.com/rsim/oracle-enhanced/issues/2186 + # + # source://activerecord//lib/arel/visitors/to_sql.rb#139 + def visit_Arel_Nodes_SelectOptions(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#116 + def visit_Arel_Nodes_SelectStatement(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#754 + def visit_Arel_Nodes_SqlLiteral(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#518 + def visit_Arel_Nodes_StringJoin(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#399 + def visit_Arel_Nodes_Sum(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#415 + def visit_Arel_Nodes_TableAlias(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#88 + def visit_Arel_Nodes_True(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#843 + def visit_Arel_Nodes_UnaryOperation(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#204 + def visit_Arel_Nodes_Union(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#208 + def visit_Arel_Nodes_UnionAll(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#718 + def visit_Arel_Nodes_UnqualifiedColumn(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#41 + def visit_Arel_Nodes_UpdateStatement(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#96 + def visit_Arel_Nodes_ValuesList(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#706 + def visit_Arel_Nodes_When(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#228 + def visit_Arel_Nodes_Window(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#194 + def visit_Arel_Nodes_With(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#199 + def visit_Arel_Nodes_WithRecursive(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#354 + def visit_Arel_SelectManager(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#564 + def visit_Arel_Table(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#848 + def visit_Array(o, collector); end + + # @raise [UnsupportedVisitError] + # + # source://activerecord//lib/arel/visitors/to_sql.rb#824 + def visit_BigDecimal(o, collector); end + + # @raise [UnsupportedVisitError] + # + # source://activerecord//lib/arel/visitors/to_sql.rb#825 + def visit_Class(o, collector); end + + # @raise [UnsupportedVisitError] + # + # source://activerecord//lib/arel/visitors/to_sql.rb#826 + def visit_Date(o, collector); end + + # @raise [UnsupportedVisitError] + # + # source://activerecord//lib/arel/visitors/to_sql.rb#827 + def visit_DateTime(o, collector); end + + # @raise [UnsupportedVisitError] + # + # source://activerecord//lib/arel/visitors/to_sql.rb#828 + def visit_FalseClass(o, collector); end + + # @raise [UnsupportedVisitError] + # + # source://activerecord//lib/arel/visitors/to_sql.rb#829 + def visit_Float(o, collector); end + + # @raise [UnsupportedVisitError] + # + # source://activerecord//lib/arel/visitors/to_sql.rb#830 + def visit_Hash(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#814 + def visit_Integer(o, collector); end + + # @raise [UnsupportedVisitError] + # + # source://activerecord//lib/arel/visitors/to_sql.rb#831 + def visit_NilClass(o, collector); end + + # source://activerecord//lib/arel/visitors/to_sql.rb#851 + def visit_Set(o, collector); end + + # @raise [UnsupportedVisitError] + # + # source://activerecord//lib/arel/visitors/to_sql.rb#832 + def visit_String(o, collector); end + + # @raise [UnsupportedVisitError] + # + # source://activerecord//lib/arel/visitors/to_sql.rb#833 + def visit_Symbol(o, collector); end + + # @raise [UnsupportedVisitError] + # + # source://activerecord//lib/arel/visitors/to_sql.rb#834 + def visit_Time(o, collector); end + + # @raise [UnsupportedVisitError] + # + # source://activerecord//lib/arel/visitors/to_sql.rb#835 + def visit_TrueClass(o, collector); end +end + +# source://activerecord//lib/arel/visitors/to_sql.rb#741 +Arel::Visitors::ToSql::BIND_BLOCK = T.let(T.unsafe(nil), Proc) + +# source://activerecord//lib/arel/visitors/to_sql.rb#5 +class Arel::Visitors::UnsupportedVisitError < ::StandardError + # @return [UnsupportedVisitError] a new instance of UnsupportedVisitError + # + # source://activerecord//lib/arel/visitors/to_sql.rb#6 + def initialize(object); end +end + +# source://activerecord//lib/arel/visitors/visitor.rb#5 +class Arel::Visitors::Visitor + # @return [Visitor] a new instance of Visitor + # + # source://activerecord//lib/arel/visitors/visitor.rb#6 + def initialize; end + + # source://activerecord//lib/arel/visitors/visitor.rb#10 + def accept(object, collector = T.unsafe(nil)); end + + private + + # Returns the value of attribute dispatch. + # + # source://activerecord//lib/arel/visitors/visitor.rb#15 + def dispatch; end + + # source://activerecord//lib/arel/visitors/visitor.rb#23 + def get_dispatch_cache; end + + # source://activerecord//lib/arel/visitors/visitor.rb#27 + def visit(object, collector = T.unsafe(nil)); end + + class << self + # source://activerecord//lib/arel/visitors/visitor.rb#17 + def dispatch_cache; end + end +end + +# source://activerecord//lib/arel/window_predications.rb#4 +module Arel::WindowPredications + # source://activerecord//lib/arel/window_predications.rb#5 + def over(expr = T.unsafe(nil)); end +end diff --git a/sorbet/rbi/gems/activestorage@8.1.1.rbi b/sorbet/rbi/gems/activestorage@8.1.1.rbi new file mode 100644 index 0000000..62d5bd4 --- /dev/null +++ b/sorbet/rbi/gems/activestorage@8.1.1.rbi @@ -0,0 +1,2517 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `activestorage` gem. +# Please instead update this file by running `bin/tapioca gem activestorage`. + + +class ActiveRecord::Base + include ::ActiveModel::ForbiddenAttributesProtection + include ::ActiveModel::AttributeAssignment + include ::ActiveModel::Access + include ::ActiveModel::Serialization + extend ::ActiveRecord::SignedId::DeprecateSignedIdVerifierSecret +end + +# :markup: markdown +# :include: ../README.md +# +# source://activestorage//lib/active_storage/gem_version.rb#3 +module ActiveStorage + extend ::ActiveSupport::Autoload + + # source://activestorage//lib/active_storage.rb#57 + def analyzers; end + + # source://activestorage//lib/active_storage.rb#57 + def analyzers=(val); end + + # source://activestorage//lib/active_storage.rb#63 + def binary_content_type; end + + # source://activestorage//lib/active_storage.rb#63 + def binary_content_type=(val); end + + # source://activestorage//lib/active_storage.rb#65 + def content_types_allowed_inline; end + + # source://activestorage//lib/active_storage.rb#65 + def content_types_allowed_inline=(val); end + + # source://activestorage//lib/active_storage.rb#64 + def content_types_to_serve_as_binary; end + + # source://activestorage//lib/active_storage.rb#64 + def content_types_to_serve_as_binary=(val); end + + # source://activestorage//lib/active_storage.rb#360 + def draw_routes; end + + # source://activestorage//lib/active_storage.rb#360 + def draw_routes=(val); end + + # source://activestorage//lib/active_storage.rb#48 + def logger; end + + # source://activestorage//lib/active_storage.rb#48 + def logger=(val); end + + # source://activestorage//lib/active_storage.rb#59 + def paths; end + + # source://activestorage//lib/active_storage.rb#59 + def paths=(val); end + + # source://activestorage//lib/active_storage.rb#56 + def previewers; end + + # source://activestorage//lib/active_storage.rb#56 + def previewers=(val); end + + # source://activestorage//lib/active_storage.rb#54 + def queues; end + + # source://activestorage//lib/active_storage.rb#54 + def queues=(val); end + + # source://activestorage//lib/active_storage.rb#361 + def resolve_model_to_route; end + + # source://activestorage//lib/active_storage.rb#361 + def resolve_model_to_route=(val); end + + # source://activestorage//lib/active_storage.rb#359 + def routes_prefix; end + + # source://activestorage//lib/active_storage.rb#359 + def routes_prefix=(val); end + + # source://activestorage//lib/active_storage.rb#355 + def service_urls_expire_in; end + + # source://activestorage//lib/active_storage.rb#355 + def service_urls_expire_in=(val); end + + # source://activestorage//lib/active_storage.rb#67 + def supported_image_processing_methods; end + + # source://activestorage//lib/active_storage.rb#67 + def supported_image_processing_methods=(val); end + + # source://activestorage//lib/active_storage.rb#356 + def touch_attachment_records; end + + # source://activestorage//lib/active_storage.rb#356 + def touch_attachment_records=(val); end + + # source://activestorage//lib/active_storage.rb#363 + def track_variants; end + + # source://activestorage//lib/active_storage.rb#363 + def track_variants=(val); end + + # source://activestorage//lib/active_storage.rb#353 + def unsupported_image_processing_arguments; end + + # source://activestorage//lib/active_storage.rb#353 + def unsupported_image_processing_arguments=(val); end + + # source://activestorage//lib/active_storage.rb#357 + def urls_expire_in; end + + # source://activestorage//lib/active_storage.rb#357 + def urls_expire_in=(val); end + + # source://activestorage//lib/active_storage.rb#61 + def variable_content_types; end + + # source://activestorage//lib/active_storage.rb#61 + def variable_content_types=(val); end + + # source://activestorage//lib/active_storage.rb#50 + def variant_processor; end + + # source://activestorage//lib/active_storage.rb#50 + def variant_processor=(val); end + + # source://activestorage//lib/active_storage.rb#52 + def variant_transformer; end + + # source://activestorage//lib/active_storage.rb#52 + def variant_transformer=(val); end + + # source://activestorage//lib/active_storage.rb#49 + def verifier; end + + # source://activestorage//lib/active_storage.rb#49 + def verifier=(val); end + + # source://activestorage//lib/active_storage.rb#365 + def video_preview_arguments; end + + # source://activestorage//lib/active_storage.rb#365 + def video_preview_arguments=(val); end + + # source://activestorage//lib/active_storage.rb#62 + def web_image_content_types; end + + # source://activestorage//lib/active_storage.rb#62 + def web_image_content_types=(val); end + + class << self + # source://activestorage//lib/active_storage.rb#57 + def analyzers; end + + # source://activestorage//lib/active_storage.rb#57 + def analyzers=(val); end + + # source://activestorage//lib/active_storage.rb#63 + def binary_content_type; end + + # source://activestorage//lib/active_storage.rb#63 + def binary_content_type=(val); end + + # source://activestorage//lib/active_storage.rb#65 + def content_types_allowed_inline; end + + # source://activestorage//lib/active_storage.rb#65 + def content_types_allowed_inline=(val); end + + # source://activestorage//lib/active_storage.rb#64 + def content_types_to_serve_as_binary; end + + # source://activestorage//lib/active_storage.rb#64 + def content_types_to_serve_as_binary=(val); end + + # source://activestorage//lib/active_storage/deprecator.rb#4 + def deprecator; end + + # source://activestorage//lib/active_storage.rb#360 + def draw_routes; end + + # source://activestorage//lib/active_storage.rb#360 + def draw_routes=(val); end + + # Returns the currently loaded version of Active Storage as a +Gem::Version+. + # + # source://activestorage//lib/active_storage/gem_version.rb#5 + def gem_version; end + + # source://activestorage//lib/active_storage.rb#48 + def logger; end + + # source://activestorage//lib/active_storage.rb#48 + def logger=(val); end + + # source://activestorage//lib/active_storage.rb#59 + def paths; end + + # source://activestorage//lib/active_storage.rb#59 + def paths=(val); end + + # source://activestorage//lib/active_storage.rb#56 + def previewers; end + + # source://activestorage//lib/active_storage.rb#56 + def previewers=(val); end + + # source://activestorage//lib/active_storage.rb#54 + def queues; end + + # source://activestorage//lib/active_storage.rb#54 + def queues=(val); end + + # source://activestorage//lib/active_storage/engine.rb#24 + def railtie_helpers_paths; end + + # source://activestorage//lib/active_storage/engine.rb#24 + def railtie_namespace; end + + # source://activestorage//lib/active_storage/engine.rb#24 + def railtie_routes_url_helpers(include_path_helpers = T.unsafe(nil)); end + + # source://activestorage//lib/active_storage.rb#361 + def resolve_model_to_route; end + + # source://activestorage//lib/active_storage.rb#361 + def resolve_model_to_route=(val); end + + # source://activestorage//lib/active_storage.rb#359 + def routes_prefix; end + + # source://activestorage//lib/active_storage.rb#359 + def routes_prefix=(val); end + + # source://activestorage//lib/active_storage.rb#355 + def service_urls_expire_in; end + + # source://activestorage//lib/active_storage.rb#355 + def service_urls_expire_in=(val); end + + # source://activestorage//lib/active_storage.rb#67 + def supported_image_processing_methods; end + + # source://activestorage//lib/active_storage.rb#67 + def supported_image_processing_methods=(val); end + + # source://activestorage//lib/active_storage/engine.rb#24 + def table_name_prefix; end + + # source://activestorage//lib/active_storage.rb#356 + def touch_attachment_records; end + + # source://activestorage//lib/active_storage.rb#356 + def touch_attachment_records=(val); end + + # source://activestorage//lib/active_storage.rb#363 + def track_variants; end + + # source://activestorage//lib/active_storage.rb#363 + def track_variants=(val); end + + # source://activestorage//lib/active_storage.rb#353 + def unsupported_image_processing_arguments; end + + # source://activestorage//lib/active_storage.rb#353 + def unsupported_image_processing_arguments=(val); end + + # source://activestorage//lib/active_storage.rb#357 + def urls_expire_in; end + + # source://activestorage//lib/active_storage.rb#357 + def urls_expire_in=(val); end + + # source://activestorage//lib/active_storage/engine.rb#24 + def use_relative_model_naming?; end + + # source://activestorage//lib/active_storage.rb#61 + def variable_content_types; end + + # source://activestorage//lib/active_storage.rb#61 + def variable_content_types=(val); end + + # source://activestorage//lib/active_storage.rb#50 + def variant_processor; end + + # source://activestorage//lib/active_storage.rb#50 + def variant_processor=(val); end + + # source://activestorage//lib/active_storage.rb#52 + def variant_transformer; end + + # source://activestorage//lib/active_storage.rb#52 + def variant_transformer=(val); end + + # source://activestorage//lib/active_storage.rb#49 + def verifier; end + + # source://activestorage//lib/active_storage.rb#49 + def verifier=(val); end + + # Returns the currently loaded version of Active Storage as a +Gem::Version+. + # + # source://activestorage//lib/active_storage/version.rb#7 + def version; end + + # source://activestorage//lib/active_storage.rb#365 + def video_preview_arguments; end + + # source://activestorage//lib/active_storage.rb#365 + def video_preview_arguments=(val); end + + # source://activestorage//lib/active_storage.rb#62 + def web_image_content_types; end + + # source://activestorage//lib/active_storage.rb#62 + def web_image_content_types=(val); end + end +end + +class ActiveStorage::AnalyzeJob < ::ActiveStorage::BaseJob + def perform(blob); end + + class << self + private + + def __class_attr_queue_name; end + def __class_attr_queue_name=(new_value); end + def __class_attr_rescue_handlers; end + def __class_attr_rescue_handlers=(new_value); end + end +end + +# = Active Storage \Analyzer +# +# This is an abstract base class for analyzers, which extract metadata from blobs. See +# ActiveStorage::Analyzer::VideoAnalyzer for an example of a concrete subclass. +# +# source://activestorage//lib/active_storage/analyzer.rb#8 +class ActiveStorage::Analyzer + # @return [Analyzer] a new instance of Analyzer + # + # source://activestorage//lib/active_storage/analyzer.rb#23 + def initialize(blob); end + + # Returns the value of attribute blob. + # + # source://activestorage//lib/active_storage/analyzer.rb#9 + def blob; end + + # Override this method in a concrete subclass. Have it return a Hash of metadata. + # + # @raise [NotImplementedError] + # + # source://activestorage//lib/active_storage/analyzer.rb#28 + def metadata; end + + private + + # Downloads the blob to a tempfile on disk. Yields the tempfile. + # + # source://activestorage//lib/active_storage/analyzer.rb#34 + def download_blob_to_tempfile(&block); end + + # source://activestorage//lib/active_storage/analyzer.rb#46 + def instrument(analyzer, &block); end + + # source://activestorage//lib/active_storage/analyzer.rb#38 + def logger; end + + # source://activestorage//lib/active_storage/analyzer.rb#42 + def tmpdir; end + + class << self + # Implement this method in a concrete subclass. Have it return true when given a blob from which + # the analyzer can extract metadata. + # + # @return [Boolean] + # + # source://activestorage//lib/active_storage/analyzer.rb#13 + def accept?(blob); end + + # Implement this method in concrete subclasses. It will determine if blob analysis + # should be done in a job or performed inline. By default, analysis is enqueued in a job. + # + # @return [Boolean] + # + # source://activestorage//lib/active_storage/analyzer.rb#19 + def analyze_later?; end + end +end + +# source://activestorage//lib/active_storage/analyzer/audio_analyzer.rb#14 +class ActiveStorage::Analyzer::AudioAnalyzer < ::ActiveStorage::Analyzer + # source://activestorage//lib/active_storage/analyzer/audio_analyzer.rb#19 + def metadata; end + + private + + # source://activestorage//lib/active_storage/analyzer/audio_analyzer.rb#44 + def audio_stream; end + + # source://activestorage//lib/active_storage/analyzer/audio_analyzer.rb#29 + def bit_rate; end + + # source://activestorage//lib/active_storage/analyzer/audio_analyzer.rb#24 + def duration; end + + # source://activestorage//lib/active_storage/analyzer/audio_analyzer.rb#73 + def ffprobe_path; end + + # source://activestorage//lib/active_storage/analyzer/audio_analyzer.rb#52 + def probe; end + + # source://activestorage//lib/active_storage/analyzer/audio_analyzer.rb#56 + def probe_from(file); end + + # source://activestorage//lib/active_storage/analyzer/audio_analyzer.rb#34 + def sample_rate; end + + # source://activestorage//lib/active_storage/analyzer/audio_analyzer.rb#48 + def streams; end + + # source://activestorage//lib/active_storage/analyzer/audio_analyzer.rb#39 + def tags; end + + class << self + # source://activestorage//lib/active_storage/analyzer/audio_analyzer.rb#15 + def accept?(blob); end + end +end + +# source://activestorage//lib/active_storage/analyzer/image_analyzer.rb#14 +class ActiveStorage::Analyzer::ImageAnalyzer < ::ActiveStorage::Analyzer + extend ::ActiveSupport::Autoload + + # source://activestorage//lib/active_storage/analyzer/image_analyzer.rb#24 + def metadata; end + + class << self + # source://activestorage//lib/active_storage/analyzer/image_analyzer.rb#20 + def accept?(blob); end + end +end + +# source://activestorage//lib/active_storage/analyzer/image_analyzer/image_magick.rb#15 +class ActiveStorage::Analyzer::ImageAnalyzer::ImageMagick < ::ActiveStorage::Analyzer::ImageAnalyzer + private + + # source://activestorage//lib/active_storage/analyzer/image_analyzer/image_magick.rb#21 + def read_image; end + + # source://activestorage//lib/active_storage/analyzer/image_analyzer/image_magick.rb#44 + def rotated_image?(image); end + + class << self + # source://activestorage//lib/active_storage/analyzer/image_analyzer/image_magick.rb#16 + def accept?(blob); end + end +end + +# source://activestorage//lib/active_storage/analyzer/image_analyzer/vips.rb#23 +class ActiveStorage::Analyzer::ImageAnalyzer::Vips < ::ActiveStorage::Analyzer::ImageAnalyzer + private + + # source://activestorage//lib/active_storage/analyzer/image_analyzer/vips.rb#29 + def read_image; end + + # source://activestorage//lib/active_storage/analyzer/image_analyzer/vips.rb#59 + def rotated_image?(image); end + + class << self + # source://activestorage//lib/active_storage/analyzer/image_analyzer/vips.rb#24 + def accept?(blob); end + end +end + +# source://activestorage//lib/active_storage/analyzer/image_analyzer/vips.rb#58 +ActiveStorage::Analyzer::ImageAnalyzer::Vips::ROTATIONS = T.let(T.unsafe(nil), Regexp) + +# source://activestorage//lib/active_storage/analyzer/null_analyzer.rb#4 +class ActiveStorage::Analyzer::NullAnalyzer < ::ActiveStorage::Analyzer + # source://activestorage//lib/active_storage/analyzer/null_analyzer.rb#13 + def metadata; end + + class << self + # source://activestorage//lib/active_storage/analyzer/null_analyzer.rb#5 + def accept?(blob); end + + # source://activestorage//lib/active_storage/analyzer/null_analyzer.rb#9 + def analyze_later?; end + end +end + +# source://activestorage//lib/active_storage/analyzer/video_analyzer.rb#24 +class ActiveStorage::Analyzer::VideoAnalyzer < ::ActiveStorage::Analyzer + # source://activestorage//lib/active_storage/analyzer/video_analyzer.rb#29 + def metadata; end + + private + + # source://activestorage//lib/active_storage/analyzer/video_analyzer.rb#55 + def angle; end + + # source://activestorage//lib/active_storage/analyzer/video_analyzer.rb#82 + def audio?; end + + # source://activestorage//lib/active_storage/analyzer/video_analyzer.rb#120 + def audio_stream; end + + # source://activestorage//lib/active_storage/analyzer/video_analyzer.rb#90 + def computed_height; end + + # source://activestorage//lib/active_storage/analyzer/video_analyzer.rb#128 + def container; end + + # source://activestorage//lib/active_storage/analyzer/video_analyzer.rb#67 + def display_aspect_ratio; end + + # source://activestorage//lib/active_storage/analyzer/video_analyzer.rb#104 + def display_height_scale; end + + # source://activestorage//lib/active_storage/analyzer/video_analyzer.rb#63 + def display_matrix; end + + # source://activestorage//lib/active_storage/analyzer/video_analyzer.rb#50 + def duration; end + + # source://activestorage//lib/active_storage/analyzer/video_analyzer.rb#100 + def encoded_height; end + + # source://activestorage//lib/active_storage/analyzer/video_analyzer.rb#96 + def encoded_width; end + + # source://activestorage//lib/active_storage/analyzer/video_analyzer.rb#153 + def ffprobe_path; end + + # source://activestorage//lib/active_storage/analyzer/video_analyzer.rb#42 + def height; end + + # source://activestorage//lib/active_storage/analyzer/video_analyzer.rb#132 + def probe; end + + # source://activestorage//lib/active_storage/analyzer/video_analyzer.rb#136 + def probe_from(file); end + + # source://activestorage//lib/active_storage/analyzer/video_analyzer.rb#78 + def rotated?; end + + # source://activestorage//lib/active_storage/analyzer/video_analyzer.rb#112 + def side_data; end + + # source://activestorage//lib/active_storage/analyzer/video_analyzer.rb#124 + def streams; end + + # source://activestorage//lib/active_storage/analyzer/video_analyzer.rb#108 + def tags; end + + # source://activestorage//lib/active_storage/analyzer/video_analyzer.rb#86 + def video?; end + + # source://activestorage//lib/active_storage/analyzer/video_analyzer.rb#116 + def video_stream; end + + # source://activestorage//lib/active_storage/analyzer/video_analyzer.rb#34 + def width; end + + class << self + # source://activestorage//lib/active_storage/analyzer/video_analyzer.rb#25 + def accept?(blob); end + end +end + +# = Active Storage \Attached +# +# Abstract base class for the concrete ActiveStorage::Attached::One and ActiveStorage::Attached::Many +# classes that both provide proxy access to the blob association for a record. +# +# source://activestorage//lib/active_storage/attached.rb#9 +class ActiveStorage::Attached + # @return [Attached] a new instance of Attached + # + # source://activestorage//lib/active_storage/attached.rb#12 + def initialize(name, record); end + + # Returns the value of attribute name. + # + # source://activestorage//lib/active_storage/attached.rb#10 + def name; end + + # Returns the value of attribute record. + # + # source://activestorage//lib/active_storage/attached.rb#10 + def record; end + + private + + # source://activestorage//lib/active_storage/attached.rb#17 + def change; end +end + +# source://activestorage//lib/active_storage/attached/changes.rb#4 +module ActiveStorage::Attached::Changes + extend ::ActiveSupport::Autoload +end + +# source://activestorage//lib/active_storage/attached/changes/create_many.rb#4 +class ActiveStorage::Attached::Changes::CreateMany + # source://activestorage//lib/active_storage/attached/changes/create_many.rb#7 + def initialize(name, record, attachables, pending_uploads: T.unsafe(nil)); end + + # source://activestorage//lib/active_storage/attached/changes/create_many.rb#5 + def attachables; end + + # source://activestorage//lib/active_storage/attached/changes/create_many.rb#14 + def attachments; end + + # source://activestorage//lib/active_storage/attached/changes/create_many.rb#18 + def blobs; end + + # source://activestorage//lib/active_storage/attached/changes/create_many.rb#5 + def name; end + + # source://activestorage//lib/active_storage/attached/changes/create_many.rb#5 + def pending_uploads; end + + # source://activestorage//lib/active_storage/attached/changes/create_many.rb#5 + def record; end + + # source://activestorage//lib/active_storage/attached/changes/create_many.rb#26 + def save; end + + # source://activestorage//lib/active_storage/attached/changes/create_many.rb#22 + def upload; end + + private + + # source://activestorage//lib/active_storage/attached/changes/create_many.rb#44 + def assign_associated_attachments; end + + # source://activestorage//lib/active_storage/attached/changes/create_many.rb#36 + def build_subchange_from(attachable); end + + # source://activestorage//lib/active_storage/attached/changes/create_many.rb#52 + def persisted_or_new_attachments; end + + # source://activestorage//lib/active_storage/attached/changes/create_many.rb#48 + def reset_associated_blobs; end + + # source://activestorage//lib/active_storage/attached/changes/create_many.rb#32 + def subchanges; end + + # source://activestorage//lib/active_storage/attached/changes/create_many.rb#40 + def subchanges_without_blobs; end +end + +# source://activestorage//lib/active_storage/attached/changes/create_one.rb#7 +class ActiveStorage::Attached::Changes::CreateOne + # source://activestorage//lib/active_storage/attached/changes/create_one.rb#10 + def initialize(name, record, attachable); end + + # source://activestorage//lib/active_storage/attached/changes/create_one.rb#8 + def attachable; end + + # source://activestorage//lib/active_storage/attached/changes/create_one.rb#15 + def attachment; end + + # source://activestorage//lib/active_storage/attached/changes/create_one.rb#19 + def blob; end + + # source://activestorage//lib/active_storage/attached/changes/create_one.rb#8 + def name; end + + # source://activestorage//lib/active_storage/attached/changes/create_one.rb#8 + def record; end + + # source://activestorage//lib/active_storage/attached/changes/create_one.rb#48 + def save; end + + # source://activestorage//lib/active_storage/attached/changes/create_one.rb#23 + def upload; end + + private + + # source://activestorage//lib/active_storage/attached/changes/create_one.rb#120 + def attachment_service_name; end + + # source://activestorage//lib/active_storage/attached/changes/create_one.rb#64 + def build_attachment; end + + # source://activestorage//lib/active_storage/attached/changes/create_one.rb#58 + def find_attachment; end + + # source://activestorage//lib/active_storage/attached/changes/create_one.rb#54 + def find_or_build_attachment; end + + # source://activestorage//lib/active_storage/attached/changes/create_one.rb#68 + def find_or_build_blob; end +end + +# source://activestorage//lib/active_storage/attached/changes/create_one_of_many.rb#4 +class ActiveStorage::Attached::Changes::CreateOneOfMany < ::ActiveStorage::Attached::Changes::CreateOne + private + + # source://activestorage//lib/active_storage/attached/changes/create_one_of_many.rb#6 + def find_attachment; end +end + +# source://activestorage//lib/active_storage/attached/changes/delete_many.rb#4 +class ActiveStorage::Attached::Changes::DeleteMany + # source://activestorage//lib/active_storage/attached/changes/delete_many.rb#7 + def initialize(name, record); end + + # source://activestorage//lib/active_storage/attached/changes/delete_many.rb#11 + def attachables; end + + # source://activestorage//lib/active_storage/attached/changes/delete_many.rb#15 + def attachments; end + + # source://activestorage//lib/active_storage/attached/changes/delete_many.rb#19 + def blobs; end + + # source://activestorage//lib/active_storage/attached/changes/delete_many.rb#5 + def name; end + + # source://activestorage//lib/active_storage/attached/changes/delete_many.rb#5 + def record; end + + # source://activestorage//lib/active_storage/attached/changes/delete_many.rb#23 + def save; end +end + +# source://activestorage//lib/active_storage/attached/changes/delete_one.rb#4 +class ActiveStorage::Attached::Changes::DeleteOne + # source://activestorage//lib/active_storage/attached/changes/delete_one.rb#7 + def initialize(name, record); end + + # source://activestorage//lib/active_storage/attached/changes/delete_one.rb#11 + def attachment; end + + # source://activestorage//lib/active_storage/attached/changes/delete_one.rb#5 + def name; end + + # source://activestorage//lib/active_storage/attached/changes/delete_one.rb#5 + def record; end + + # source://activestorage//lib/active_storage/attached/changes/delete_one.rb#15 + def save; end +end + +# source://activestorage//lib/active_storage/attached/changes/detach_many.rb#4 +class ActiveStorage::Attached::Changes::DetachMany + # source://activestorage//lib/active_storage/attached/changes/detach_many.rb#7 + def initialize(name, record, attachments); end + + # source://activestorage//lib/active_storage/attached/changes/detach_many.rb#5 + def attachments; end + + # source://activestorage//lib/active_storage/attached/changes/detach_many.rb#11 + def detach; end + + # source://activestorage//lib/active_storage/attached/changes/detach_many.rb#5 + def name; end + + # source://activestorage//lib/active_storage/attached/changes/detach_many.rb#5 + def record; end +end + +# source://activestorage//lib/active_storage/attached/changes/detach_one.rb#4 +class ActiveStorage::Attached::Changes::DetachOne + # source://activestorage//lib/active_storage/attached/changes/detach_one.rb#7 + def initialize(name, record, attachment); end + + # source://activestorage//lib/active_storage/attached/changes/detach_one.rb#5 + def attachment; end + + # source://activestorage//lib/active_storage/attached/changes/detach_one.rb#11 + def detach; end + + # source://activestorage//lib/active_storage/attached/changes/detach_one.rb#5 + def name; end + + # source://activestorage//lib/active_storage/attached/changes/detach_one.rb#5 + def record; end + + private + + # source://activestorage//lib/active_storage/attached/changes/detach_one.rb#19 + def reset; end +end + +# source://activestorage//lib/active_storage/attached/changes/purge_many.rb#4 +class ActiveStorage::Attached::Changes::PurgeMany + # source://activestorage//lib/active_storage/attached/changes/purge_many.rb#7 + def initialize(name, record, attachments); end + + # source://activestorage//lib/active_storage/attached/changes/purge_many.rb#5 + def attachments; end + + # source://activestorage//lib/active_storage/attached/changes/purge_many.rb#5 + def name; end + + # source://activestorage//lib/active_storage/attached/changes/purge_many.rb#11 + def purge; end + + # source://activestorage//lib/active_storage/attached/changes/purge_many.rb#16 + def purge_later; end + + # source://activestorage//lib/active_storage/attached/changes/purge_many.rb#5 + def record; end + + private + + # source://activestorage//lib/active_storage/attached/changes/purge_many.rb#22 + def reset; end +end + +# source://activestorage//lib/active_storage/attached/changes/purge_one.rb#4 +class ActiveStorage::Attached::Changes::PurgeOne + # source://activestorage//lib/active_storage/attached/changes/purge_one.rb#7 + def initialize(name, record, attachment); end + + # source://activestorage//lib/active_storage/attached/changes/purge_one.rb#5 + def attachment; end + + # source://activestorage//lib/active_storage/attached/changes/purge_one.rb#5 + def name; end + + # source://activestorage//lib/active_storage/attached/changes/purge_one.rb#11 + def purge; end + + # source://activestorage//lib/active_storage/attached/changes/purge_one.rb#16 + def purge_later; end + + # source://activestorage//lib/active_storage/attached/changes/purge_one.rb#5 + def record; end + + private + + # source://activestorage//lib/active_storage/attached/changes/purge_one.rb#22 + def reset; end +end + +# source://activestorage//lib/active_storage/attached/many.rb#7 +class ActiveStorage::Attached::Many < ::ActiveStorage::Attached + # source://activestorage//lib/active_storage/attached/many.rb#51 + def attach(*attachables); end + + # source://activestorage//lib/active_storage/attached/many.rb#66 + def attached?; end + + # source://activestorage//lib/active_storage/attached/many.rb#32 + def attachments; end + + # source://activestorage//lib/active_storage/attached/many.rb#37 + def blobs; end + + # source://activestorage//lib/active_storage/attached/many.rb#25 + def detach(*_arg0, **_arg1, &_arg2); end + + # source://activestorage//lib/active_storage/attached/many.rb#27 + def method_missing(method, *_arg1, **_arg2, &_arg3); end + + # source://activestorage//lib/active_storage/attached/many.rb#13 + def purge(*_arg0, **_arg1, &_arg2); end + + # source://activestorage//lib/active_storage/attached/many.rb#19 + def purge_later(*_arg0, **_arg1, &_arg2); end + + private + + # source://activestorage//lib/active_storage/attached/many.rb#75 + def detach_many; end + + # source://activestorage//lib/active_storage/attached/many.rb#71 + def purge_many; end + + # source://activestorage//lib/active_storage/attached/many.rb#27 + def respond_to_missing?(name, include_private = T.unsafe(nil)); end +end + +# source://activestorage//lib/active_storage/attached/model.rb#9 +module ActiveStorage::Attached::Model + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveStorage::Attached::Model::ClassMethods + + # source://activestorage//lib/active_storage/attached/model.rb#281 + def attachment_changes; end + + # source://activestorage//lib/active_storage/attached/model.rb#285 + def changed_for_autosave?; end + + # source://activestorage//lib/active_storage/attached/model.rb#295 + def reload(*_arg0); end + + private + + # source://activestorage//lib/active_storage/attached/model.rb#289 + def initialize_dup(*_arg0); end + + class << self + # source://activestorage//lib/active_storage/attached/model.rb#263 + def validate_service_configuration(service_name, model_class, association_name); end + + private + + # source://activestorage//lib/active_storage/attached/model.rb#274 + def validate_global_service_configuration(model_class); end + end +end + +# source://activestorage//lib/active_storage/attached/model.rb#54 +module ActiveStorage::Attached::Model::ClassMethods + # source://activestorage//lib/active_storage/attached/model.rb#210 + def has_many_attached(name, dependent: T.unsafe(nil), service: T.unsafe(nil), strict_loading: T.unsafe(nil)); end + + # source://activestorage//lib/active_storage/attached/model.rb#108 + def has_one_attached(name, dependent: T.unsafe(nil), service: T.unsafe(nil), strict_loading: T.unsafe(nil)); end +end + +# source://activestorage//lib/active_storage/attached/one.rb#7 +class ActiveStorage::Attached::One < ::ActiveStorage::Attached + # source://activestorage//lib/active_storage/attached/one.rb#58 + def attach(attachable); end + + # source://activestorage//lib/active_storage/attached/one.rb#73 + def attached?; end + + # source://activestorage//lib/active_storage/attached/one.rb#33 + def attachment; end + + # source://activestorage//lib/active_storage/attached/one.rb#44 + def blank?; end + + # source://activestorage//lib/active_storage/attached/one.rb#25 + def detach(*_arg0, **_arg1, &_arg2); end + + # source://activestorage//lib/active_storage/attached/one.rb#27 + def method_missing(method, *_arg1, **_arg2, &_arg3); end + + # source://activestorage//lib/active_storage/attached/one.rb#13 + def purge(*_arg0, **_arg1, &_arg2); end + + # source://activestorage//lib/active_storage/attached/one.rb#19 + def purge_later(*_arg0, **_arg1, &_arg2); end + + private + + # source://activestorage//lib/active_storage/attached/one.rb#82 + def detach_one; end + + # source://activestorage//lib/active_storage/attached/one.rb#78 + def purge_one; end + + # source://activestorage//lib/active_storage/attached/one.rb#27 + def respond_to_missing?(name, include_private = T.unsafe(nil)); end +end + +class ActiveStorage::Attachment < ::ActiveStorage::Record + include ::ActiveStorage::Attachment::GeneratedAttributeMethods + include ::ActiveStorage::Attachment::GeneratedAssociationMethods + + def _run_commit_callbacks(&block); end + def _run_create_callbacks(&block); end + def _run_destroy_callbacks(&block); end + def _run_save_callbacks(&block); end + def _run_touch_callbacks(&block); end + def _run_update_callbacks(&block); end + def autosave_associated_records_for_blob(*args); end + def autosave_associated_records_for_record(*args); end + def method_missing(method, *_arg1, **_arg2, &_arg3); end + def preview(transformations); end + def purge; end + def purge_later; end + def representation(transformations); end + def signed_id(*_arg0, **_arg1, &_arg2); end + def validate_associated_records_for_blob(*args); end + def variant(transformations); end + + private + + def analyze_blob_later; end + def dependent; end + def mirror_blob_later; end + def named_variants; end + def purge_dependent_blob_later; end + def respond_to_missing?(name, include_private = T.unsafe(nil)); end + def transform_variants_later; end + def transformations_by_name(transformations); end + + class << self + def with_all_variant_records(*args, **_arg1); end + + private + + def __class_attr___callbacks; end + def __class_attr___callbacks=(new_value); end + def __class_attr__reflections; end + def __class_attr__reflections=(new_value); end + def __class_attr__validators; end + def __class_attr__validators=(new_value); end + def __class_attr_defined_enums; end + def __class_attr_defined_enums=(new_value); end + end +end + +module ActiveStorage::Attachment::GeneratedAssociationMethods + def blob; end + def blob=(value); end + def blob_changed?; end + def blob_previously_changed?; end + def build_blob(*args, &block); end + def create_blob(*args, &block); end + def create_blob!(*args, &block); end + def record; end + def record=(value); end + def record_changed?; end + def record_previously_changed?; end + def reload_blob; end + def reload_record; end + def reset_blob; end + def reset_record; end +end + +module ActiveStorage::Attachment::GeneratedAttributeMethods; end + +class ActiveStorage::BaseController < ::ActionController::Base + include ::ActiveStorage::SetCurrent + + private + + def _layout(lookup_context, formats, keys); end + def _layout_from_proc; end + + class << self + private + + def __class_attr___callbacks; end + def __class_attr___callbacks=(new_value); end + def __class_attr_config; end + def __class_attr_config=(new_value); end + def __class_attr_etag_with_template_digest; end + def __class_attr_etag_with_template_digest=(new_value); end + def __class_attr_middleware_stack; end + def __class_attr_middleware_stack=(new_value); end + end +end + +class ActiveStorage::BaseJob < ::ActiveJob::Base; end + +class ActiveStorage::Blob < ::ActiveStorage::Record + include ::ActiveStorage::Blob::GeneratedAttributeMethods + include ::ActiveStorage::Blob::GeneratedAssociationMethods + include ::ActiveStorage::Blob::Analyzable + include ::ActiveStorage::Blob::Identifiable + include ::ActiveStorage::Blob::Representable + include ::ActiveStorage::Blob::Servable + include ::ActionText::Attachable + extend ::ActionText::Attachable::ClassMethods + + def _run_commit_callbacks(&block); end + def _run_create_callbacks(&block); end + def _run_destroy_callbacks(&block); end + def _run_initialize_callbacks(&block); end + def _run_save_callbacks(&block); end + def _run_update_callbacks(&block); end + def attachable_plain_text_representation(caption = T.unsafe(nil)); end + def audio?; end + def autosave_associated_records_for_attachments(*args); end + def autosave_associated_records_for_preview_image_attachment(*args); end + def autosave_associated_records_for_preview_image_blob(*args); end + def autosave_associated_records_for_variant_records(*args); end + def compose(keys); end + def custom_metadata; end + def custom_metadata=(metadata); end + def delete; end + def download(&block); end + def download_chunk(range); end + def filename; end + def image?; end + def key; end + def mirror_later; end + def open(tmpdir: T.unsafe(nil), &block); end + def previewable_attachable?; end + def purge; end + def purge_later; end + def regenerate_key; end + def service; end + def service_headers_for_direct_upload; end + def service_url_for_direct_upload(expires_in: T.unsafe(nil)); end + def services; end + def services=(_arg0); end + def services?; end + def signed_id(purpose: T.unsafe(nil), expires_in: T.unsafe(nil), expires_at: T.unsafe(nil)); end + def text?; end + def to_trix_content_attachment_partial_path; end + def unfurl(io, identify: T.unsafe(nil)); end + def upload(io, identify: T.unsafe(nil)); end + def upload_without_unfurling(io); end + def url(expires_in: T.unsafe(nil), disposition: T.unsafe(nil), filename: T.unsafe(nil), **options); end + def validate_associated_records_for_attachments(*args); end + def validate_associated_records_for_variant_records(*args); end + def video?; end + + private + + def compute_checksum_in_chunks(io); end + def extract_content_type(io); end + def service_metadata; end + def touch_attachments; end + def update_service_metadata; end + def web_image?; end + + class << self + def build_after_unfurling(io:, filename:, key: T.unsafe(nil), content_type: T.unsafe(nil), metadata: T.unsafe(nil), service_name: T.unsafe(nil), identify: T.unsafe(nil), record: T.unsafe(nil)); end + def combine_signed_id_purposes(purpose); end + def compose(blobs, filename:, key: T.unsafe(nil), content_type: T.unsafe(nil), metadata: T.unsafe(nil)); end + def create_after_unfurling!(io:, filename:, key: T.unsafe(nil), content_type: T.unsafe(nil), metadata: T.unsafe(nil), service_name: T.unsafe(nil), identify: T.unsafe(nil), record: T.unsafe(nil)); end + def create_and_upload!(io:, filename:, key: T.unsafe(nil), content_type: T.unsafe(nil), metadata: T.unsafe(nil), service_name: T.unsafe(nil), identify: T.unsafe(nil), record: T.unsafe(nil)); end + def create_before_direct_upload!(filename:, byte_size:, checksum:, key: T.unsafe(nil), content_type: T.unsafe(nil), metadata: T.unsafe(nil), service_name: T.unsafe(nil), record: T.unsafe(nil)); end + def find_signed(id, record: T.unsafe(nil), purpose: T.unsafe(nil)); end + def find_signed!(id, record: T.unsafe(nil), purpose: T.unsafe(nil)); end + def generate_unique_secure_token(length: T.unsafe(nil)); end + def scope_for_strict_loading; end + def service; end + def service=(value); end + def service?; end + def services; end + def services=(value); end + def services?; end + def signed_id_verifier; end + def unattached(*args, **_arg1); end + def with_attached_preview_image(*args, **_arg1); end + + private + + def __class_attr___callbacks; end + def __class_attr___callbacks=(new_value); end + def __class_attr__reflections; end + def __class_attr__reflections=(new_value); end + def __class_attr__validators; end + def __class_attr__validators=(new_value); end + def __class_attr_attachment_reflections; end + def __class_attr_attachment_reflections=(new_value); end + def __class_attr_defined_enums; end + def __class_attr_defined_enums=(new_value); end + def __class_attr_service; end + def __class_attr_service=(new_value); end + def __class_attr_services; end + def __class_attr_services=(new_value); end + end +end + +module ActiveStorage::Blob::Analyzable + def analyze; end + def analyze_later; end + def analyzed?; end + + private + + def analyzer; end + def analyzer_class; end + def extract_metadata_via_analyzer; end +end + +module ActiveStorage::Blob::GeneratedAssociationMethods + def attachment_ids; end + def attachment_ids=(ids); end + def attachments; end + def attachments=(value); end + def build_preview_image_attachment(*args, &block); end + def build_preview_image_blob(*args, &block); end + def create_preview_image_attachment(*args, &block); end + def create_preview_image_attachment!(*args, &block); end + def create_preview_image_blob(*args, &block); end + def create_preview_image_blob!(*args, &block); end + def preview_image; end + def preview_image=(attachable); end + def preview_image_attachment; end + def preview_image_attachment=(value); end + def preview_image_blob; end + def preview_image_blob=(value); end + def reload_preview_image_attachment; end + def reload_preview_image_blob; end + def reset_preview_image_attachment; end + def reset_preview_image_blob; end + def variant_record_ids; end + def variant_record_ids=(ids); end + def variant_records; end + def variant_records=(value); end +end + +module ActiveStorage::Blob::GeneratedAttributeMethods; end + +module ActiveStorage::Blob::Identifiable + def identified?; end + def identify; end + def identify_without_saving; end + + private + + def download_identifiable_chunk; end + def identify_content_type; end +end + +ActiveStorage::Blob::MINIMUM_TOKEN_LENGTH = T.let(T.unsafe(nil), Integer) + +module ActiveStorage::Blob::Representable + extend ::ActiveSupport::Concern + + def create_preview_image_later(variations); end + def preprocessed(transformations); end + def preview(transformations); end + def preview_image_needed_before_processing_variants?; end + def previewable?; end + def representable?; end + def representation(transformations); end + def variable?; end + def variant(transformations); end + + private + + def default_variant_format; end + def default_variant_transformations; end + def format; end + def variant_class; end +end + +module ActiveStorage::Blob::Servable + def content_type_for_serving; end + def forced_disposition_for_serving; end + + private + + def allowed_inline?; end + def forcibly_serve_as_binary?; end +end + +module ActiveStorage::Blobs; end + +class ActiveStorage::Blobs::ProxyController < ::ActiveStorage::BaseController + include ::ActiveStorage::SetBlob + include ::ActionController::Live + include ::ActiveStorage::Streaming + include ::ActiveStorage::DisableSession + extend ::ActionController::Live::ClassMethods + + def show; end + + private + + def _layout(lookup_context, formats, keys); end + def _layout_from_proc; end + + class << self + private + + def __class_attr___callbacks; end + def __class_attr___callbacks=(new_value); end + def __class_attr_config; end + def __class_attr_config=(new_value); end + def __class_attr_middleware_stack; end + def __class_attr_middleware_stack=(new_value); end + end +end + +class ActiveStorage::Blobs::RedirectController < ::ActiveStorage::BaseController + include ::ActiveStorage::SetBlob + + def show; end + + private + + def _layout(lookup_context, formats, keys); end + def _layout_from_proc; end + + class << self + private + + def __class_attr___callbacks; end + def __class_attr___callbacks=(new_value); end + def __class_attr_config; end + def __class_attr_config=(new_value); end + def __class_attr_middleware_stack; end + def __class_attr_middleware_stack=(new_value); end + end +end + +class ActiveStorage::Current < ::ActiveSupport::CurrentAttributes + class << self + def url_options; end + def url_options=(value); end + + private + + def __class_attr_defaults; end + def __class_attr_defaults=(new_value); end + end +end + +class ActiveStorage::DirectUploadsController < ::ActiveStorage::BaseController + def create; end + + private + + def _layout(lookup_context, formats, keys); end + def _layout_from_proc; end + def blob_args; end + def direct_upload_json(blob); end + + class << self + private + + def __class_attr_config; end + def __class_attr_config=(new_value); end + def __class_attr_middleware_stack; end + def __class_attr_middleware_stack=(new_value); end + end +end + +module ActiveStorage::DisableSession + extend ::ActiveSupport::Concern +end + +class ActiveStorage::DiskController < ::ActiveStorage::BaseController + include ::ActiveStorage::FileServer + + def show; end + def update; end + + private + + def _layout(lookup_context, formats, keys); end + def _layout_from_proc; end + def acceptable_content?(token); end + def decode_verified_key; end + def decode_verified_token; end + def named_disk_service(name); end + + class << self + private + + def __class_attr___callbacks; end + def __class_attr___callbacks=(new_value); end + def __class_attr_config; end + def __class_attr_config=(new_value); end + def __class_attr_middleware_stack; end + def __class_attr_middleware_stack=(new_value); end + end +end + +# source://activestorage//lib/active_storage/downloader.rb#4 +class ActiveStorage::Downloader + # @return [Downloader] a new instance of Downloader + # + # source://activestorage//lib/active_storage/downloader.rb#7 + def initialize(service); end + + # source://activestorage//lib/active_storage/downloader.rb#11 + def open(key, checksum: T.unsafe(nil), verify: T.unsafe(nil), name: T.unsafe(nil), tmpdir: T.unsafe(nil)); end + + # Returns the value of attribute service. + # + # source://activestorage//lib/active_storage/downloader.rb#5 + def service; end + + private + + # source://activestorage//lib/active_storage/downloader.rb#30 + def download(key, file); end + + # source://activestorage//lib/active_storage/downloader.rb#20 + def open_tempfile(name, tmpdir = T.unsafe(nil)); end + + # source://activestorage//lib/active_storage/downloader.rb#37 + def verify_integrity_of(file, checksum:); end +end + +# source://activestorage//lib/active_storage/engine.rb#23 +class ActiveStorage::Engine < ::Rails::Engine; end + +# Generic base class for all Active Storage exceptions. +# +# source://activestorage//lib/active_storage/errors.rb#5 +class ActiveStorage::Error < ::StandardError; end + +# Raised when ActiveStorage::Blob#download is called on a blob where the +# backing file is no longer present in its service. +# +# source://activestorage//lib/active_storage/errors.rb#25 +class ActiveStorage::FileNotFoundError < ::ActiveStorage::Error; end + +module ActiveStorage::FileServer + private + + def serve_file(path, content_type:, disposition:); end +end + +class ActiveStorage::Filename + include ::Comparable + + def initialize(filename); end + + def <=>(other); end + def as_json(*_arg0); end + def base; end + def extension; end + def extension_with_delimiter; end + def extension_without_delimiter; end + def sanitized; end + def to_s; end + def to_str; end + + class << self + def wrap(filename); end + end +end + +# = Active Storage \FixtureSet +# +# Fixtures are a way of organizing data that you want to test against; in +# short, sample data. +# +# To learn more about fixtures, read the ActiveRecord::FixtureSet documentation. +# +# === YAML +# +# Like other Active Record-backed models, ActiveStorage::Attachment and +# ActiveStorage::Blob records inherit from ActiveRecord::Base instances and +# therefore can be populated by fixtures. +# +# Consider a hypothetical Article model class, its related +# fixture data, as well as fixture data for related ActiveStorage::Attachment +# and ActiveStorage::Blob records: +# +# # app/models/article.rb +# class Article < ApplicationRecord +# has_one_attached :thumbnail +# end +# +# +# +# # fixtures/active_storage/blobs.yml +# first_thumbnail_blob: <%= ActiveStorage::FixtureSet.blob filename: "first.png" %> +# +# +# +# # fixtures/active_storage/attachments.yml +# first_thumbnail_attachment: +# name: thumbnail +# record: first (Article) +# blob: first_thumbnail_blob +# +# When processed, Active Record will insert database records for each fixture +# entry and will ensure the Active Storage relationship is intact. +# +# source://activestorage//lib/active_storage/fixture_set.rb#44 +class ActiveStorage::FixtureSet + include ::ActiveSupport::Testing::FileFixtures + include ::ActiveRecord::SecureToken + extend ::ActiveRecord::SecureToken::ClassMethods + + # source://activestorage//lib/active_storage/fixture_set.rb#45 + def file_fixture_path; end + + # source://activestorage//lib/active_storage/fixture_set.rb#45 + def file_fixture_path?; end + + # source://activestorage//lib/active_storage/fixture_set.rb#70 + def prepare(instance, **attributes); end + + class << self + # Generate a YAML-encoded representation of an ActiveStorage::Blob + # instance's attributes, resolve the file relative to the directory mentioned + # by ActiveSupport::Testing::FileFixtures.file_fixture, and upload + # the file to the Service + # + # ==== Examples + # + # # tests/fixtures/active_storage/blobs.yml + # second_thumbnail_blob: <%= ActiveStorage::FixtureSet.blob( + # filename: "second.svg", + # ) %> + # + # third_thumbnail_blob: <%= ActiveStorage::FixtureSet.blob( + # filename: "third.svg", + # content_type: "image/svg+xml", + # service_name: "public" + # ) %> + # + # source://activestorage//lib/active_storage/fixture_set.rb#66 + def blob(filename:, **attributes); end + + # source://activestorage//lib/active_storage/fixture_set.rb#45 + def file_fixture_path; end + + # source://activestorage//lib/active_storage/fixture_set.rb#45 + def file_fixture_path=(value); end + + # source://activestorage//lib/active_storage/fixture_set.rb#45 + def file_fixture_path?; end + + private + + # source://activestorage//lib/active_storage/fixture_set.rb#45 + def __class_attr_file_fixture_path; end + + # source://activestorage//lib/active_storage/fixture_set.rb#45 + def __class_attr_file_fixture_path=(new_value); end + end +end + +# Raised when uploaded or downloaded data does not match a precomputed checksum. +# Indicates that a network error or a software bug caused data corruption. +# +# source://activestorage//lib/active_storage/errors.rb#21 +class ActiveStorage::IntegrityError < ::ActiveStorage::Error; end + +# Raised when ActiveStorage::Blob#variant is called on a blob that isn't variable. +# Use ActiveStorage::Blob#variable? to determine whether a blob is variable. +# +# source://activestorage//lib/active_storage/errors.rb#9 +class ActiveStorage::InvariableError < ::ActiveStorage::Error; end + +# source://activestorage//lib/active_storage/log_subscriber.rb#6 +class ActiveStorage::LogSubscriber < ::ActiveSupport::LogSubscriber + # source://activestorage//lib/active_storage/log_subscriber.rb#53 + def logger; end + + # source://activestorage//lib/active_storage/log_subscriber.rb#21 + def preview(event); end + + # source://activestorage//lib/active_storage/log_subscriber.rb#26 + def service_delete(event); end + + # source://activestorage//lib/active_storage/log_subscriber.rb#31 + def service_delete_prefixed(event); end + + # source://activestorage//lib/active_storage/log_subscriber.rb#14 + def service_download(event); end + + # source://activestorage//lib/active_storage/log_subscriber.rb#36 + def service_exist(event); end + + # source://activestorage//lib/active_storage/log_subscriber.rb#46 + def service_mirror(event); end + + # source://activestorage//lib/active_storage/log_subscriber.rb#19 + def service_streaming_download(event); end + + # source://activestorage//lib/active_storage/log_subscriber.rb#7 + def service_upload(event); end + + # source://activestorage//lib/active_storage/log_subscriber.rb#41 + def service_url(event); end + + private + + # source://activestorage//lib/active_storage/log_subscriber.rb#62 + def debug(event, colored_message); end + + # source://activestorage//lib/active_storage/log_subscriber.rb#58 + def info(event, colored_message); end + + # source://activestorage//lib/active_storage/log_subscriber.rb#70 + def key_in(event); end + + # source://activestorage//lib/active_storage/log_subscriber.rb#66 + def log_prefix_for_service(event); end + + class << self + private + + # source://activestorage//lib/active_storage/log_subscriber.rb#12 + def __class_attr_log_levels; end + + # source://activestorage//lib/active_storage/log_subscriber.rb#12 + def __class_attr_log_levels=(new_value); end + end +end + +# source://activestorage//lib/active_storage/analyzer/image_analyzer/image_magick.rb#8 +ActiveStorage::MINIMAGICK_AVAILABLE = T.let(T.unsafe(nil), FalseClass) + +class ActiveStorage::MirrorJob < ::ActiveStorage::BaseJob + def perform(key, checksum:); end + + class << self + private + + def __class_attr_queue_name; end + def __class_attr_queue_name=(new_value); end + def __class_attr_rescue_handlers; end + def __class_attr_rescue_handlers=(new_value); end + end +end + +class ActiveStorage::NamedVariant + def initialize(transformations); end + + def preprocessed; end + def preprocessed?(record); end + def transformations; end +end + +class ActiveStorage::Preview + include ::ActiveStorage::Blob::Servable + + def initialize(blob, variation_or_variation_key); end + + def blob; end + def content_type(*_arg0, **_arg1, &_arg2); end + def download(&block); end + def filename(*_arg0, **_arg1, &_arg2); end + def image; end + def key; end + def processed; end + def url(**options); end + def variation; end + + private + + def presentation; end + def previewer; end + def previewer_class; end + def process; end + def processed?; end + def variant; end + def variant?; end +end + +class ActiveStorage::Preview::UnprocessedError < ::StandardError; end + +# Raised when a Previewer is unable to generate a preview image. +# +# source://activestorage//lib/active_storage/errors.rb#28 +class ActiveStorage::PreviewError < ::ActiveStorage::Error; end + +class ActiveStorage::PreviewImageJob < ::ActiveStorage::BaseJob + def perform(blob, variations); end + + class << self + private + + def __class_attr_queue_name; end + def __class_attr_queue_name=(new_value); end + def __class_attr_rescue_handlers; end + def __class_attr_rescue_handlers=(new_value); end + end +end + +# = Active Storage \Previewer +# +# This is an abstract base class for previewers, which generate images from blobs. See +# ActiveStorage::Previewer::MuPDFPreviewer and ActiveStorage::Previewer::VideoPreviewer for +# examples of concrete subclasses. +# +# source://activestorage//lib/active_storage/previewer.rb#9 +class ActiveStorage::Previewer + # @return [Previewer] a new instance of Previewer + # + # source://activestorage//lib/active_storage/previewer.rb#18 + def initialize(blob); end + + # Returns the value of attribute blob. + # + # source://activestorage//lib/active_storage/previewer.rb#10 + def blob; end + + # Override this method in a concrete subclass. Have it yield an attachable preview image (i.e. + # anything accepted by ActiveStorage::Attached::One#attach). Pass the additional options to + # the underlying blob that is created. + # + # @raise [NotImplementedError] + # + # source://activestorage//lib/active_storage/previewer.rb#25 + def preview(**options); end + + private + + # source://activestorage//lib/active_storage/previewer.rb#78 + def capture(*argv, to:); end + + # Downloads the blob to a tempfile on disk. Yields the tempfile. + # + # source://activestorage//lib/active_storage/previewer.rb#31 + def download_blob_to_tempfile(&block); end + + # Executes a system command, capturing its binary output in a tempfile. Yields the tempfile. + # + # Use this method to shell out to a system library (e.g. muPDF or FFmpeg) for preview image + # generation. The resulting tempfile can be used as the +:io+ value in an attachable Hash: + # + # def preview + # download_blob_to_tempfile do |input| + # draw "my-drawing-command", input.path, "--format", "png", "-" do |output| + # yield io: output, filename: "#{blob.filename.base}.png", content_type: "image/png" + # end + # end + # end + # + # The output tempfile is opened in the directory returned by #tmpdir. + # + # source://activestorage//lib/active_storage/previewer.rb#49 + def draw(*argv); end + + # source://activestorage//lib/active_storage/previewer.rb#69 + def instrument(operation, payload = T.unsafe(nil), &block); end + + # source://activestorage//lib/active_storage/previewer.rb#93 + def logger; end + + # source://activestorage//lib/active_storage/previewer.rb#59 + def open_tempfile; end + + # source://activestorage//lib/active_storage/previewer.rb#73 + def service_name; end + + # source://activestorage//lib/active_storage/previewer.rb#97 + def tmpdir; end + + class << self + # Implement this method in a concrete subclass. Have it return true when given a blob from which + # the previewer can generate an image. + # + # @return [Boolean] + # + # source://activestorage//lib/active_storage/previewer.rb#14 + def accept?(blob); end + end +end + +# source://activestorage//lib/active_storage/previewer/mupdf_previewer.rb#4 +class ActiveStorage::Previewer::MuPDFPreviewer < ::ActiveStorage::Previewer + # source://activestorage//lib/active_storage/previewer/mupdf_previewer.rb#27 + def preview(**options); end + + private + + # source://activestorage//lib/active_storage/previewer/mupdf_previewer.rb#36 + def draw_first_page_from(file, &block); end + + class << self + # source://activestorage//lib/active_storage/previewer/mupdf_previewer.rb#6 + def accept?(blob); end + + # source://activestorage//lib/active_storage/previewer/mupdf_previewer.rb#18 + def mutool_exists?; end + + # source://activestorage//lib/active_storage/previewer/mupdf_previewer.rb#14 + def mutool_path; end + + # source://activestorage//lib/active_storage/previewer/mupdf_previewer.rb#10 + def pdf?(content_type); end + end +end + +# source://activestorage//lib/active_storage/previewer/poppler_pdf_previewer.rb#4 +class ActiveStorage::Previewer::PopplerPDFPreviewer < ::ActiveStorage::Previewer + # source://activestorage//lib/active_storage/previewer/poppler_pdf_previewer.rb#25 + def preview(**options); end + + private + + # source://activestorage//lib/active_storage/previewer/poppler_pdf_previewer.rb#34 + def draw_first_page_from(file, &block); end + + class << self + # source://activestorage//lib/active_storage/previewer/poppler_pdf_previewer.rb#6 + def accept?(blob); end + + # source://activestorage//lib/active_storage/previewer/poppler_pdf_previewer.rb#10 + def pdf?(content_type); end + + # source://activestorage//lib/active_storage/previewer/poppler_pdf_previewer.rb#18 + def pdftoppm_exists?; end + + # source://activestorage//lib/active_storage/previewer/poppler_pdf_previewer.rb#14 + def pdftoppm_path; end + end +end + +# source://activestorage//lib/active_storage/previewer/video_previewer.rb#6 +class ActiveStorage::Previewer::VideoPreviewer < ::ActiveStorage::Previewer + # source://activestorage//lib/active_storage/previewer/video_previewer.rb#23 + def preview(**options); end + + private + + # source://activestorage//lib/active_storage/previewer/video_previewer.rb#32 + def draw_relevant_frame_from(file, &block); end + + class << self + # source://activestorage//lib/active_storage/previewer/video_previewer.rb#8 + def accept?(blob); end + + # source://activestorage//lib/active_storage/previewer/video_previewer.rb#12 + def ffmpeg_exists?; end + + # source://activestorage//lib/active_storage/previewer/video_previewer.rb#18 + def ffmpeg_path; end + end +end + +class ActiveStorage::PurgeJob < ::ActiveStorage::BaseJob + def perform(blob); end + + class << self + private + + def __class_attr_queue_name; end + def __class_attr_queue_name=(new_value); end + def __class_attr_rescue_handlers; end + def __class_attr_rescue_handlers=(new_value); end + end +end + +class ActiveStorage::Record < ::ActiveRecord::Base + include ::ActiveStorage::Record::GeneratedAttributeMethods + include ::ActiveStorage::Record::GeneratedAssociationMethods + + class << self + private + + def __class_attr__validators; end + def __class_attr__validators=(new_value); end + def __class_attr_defined_enums; end + def __class_attr_defined_enums=(new_value); end + end +end + +module ActiveStorage::Record::GeneratedAssociationMethods; end +module ActiveStorage::Record::GeneratedAttributeMethods; end + +# source://activestorage//lib/active_storage/reflection.rb#4 +module ActiveStorage::Reflection; end + +# source://activestorage//lib/active_storage/reflection.rb#49 +module ActiveStorage::Reflection::ActiveRecordExtensions + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveStorage::Reflection::ActiveRecordExtensions::ClassMethods + + module GeneratedClassMethods + def attachment_reflections; end + def attachment_reflections=(value); end + def attachment_reflections?; end + end + + module GeneratedInstanceMethods + def attachment_reflections; end + def attachment_reflections?; end + end +end + +# source://activestorage//lib/active_storage/reflection.rb#56 +module ActiveStorage::Reflection::ActiveRecordExtensions::ClassMethods + # Returns an array of reflection objects for all the attachments in the + # class. + # + # source://activestorage//lib/active_storage/reflection.rb#59 + def reflect_on_all_attachments; end + + # Returns the reflection object for the named +attachment+. + # + # User.reflect_on_attachment(:avatar) + # # => the avatar reflection + # + # source://activestorage//lib/active_storage/reflection.rb#68 + def reflect_on_attachment(attachment); end +end + +# source://activestorage//lib/active_storage/reflection.rb#5 +class ActiveStorage::Reflection::HasAttachedReflection < ::ActiveRecord::Reflection::MacroReflection + # source://activestorage//lib/active_storage/reflection.rb#10 + def named_variants; end + + # source://activestorage//lib/active_storage/reflection.rb#6 + def variant(name, transformations); end +end + +# Holds all the metadata about a has_many_attached attachment as it was +# specified in the Active Record class. +# +# source://activestorage//lib/active_storage/reflection.rb#25 +class ActiveStorage::Reflection::HasManyAttachedReflection < ::ActiveStorage::Reflection::HasAttachedReflection + # source://activestorage//lib/active_storage/reflection.rb#26 + def macro; end +end + +# Holds all the metadata about a has_one_attached attachment as it was +# specified in the Active Record class. +# +# source://activestorage//lib/active_storage/reflection.rb#17 +class ActiveStorage::Reflection::HasOneAttachedReflection < ::ActiveStorage::Reflection::HasAttachedReflection + # source://activestorage//lib/active_storage/reflection.rb#18 + def macro; end +end + +# source://activestorage//lib/active_storage/reflection.rb#31 +module ActiveStorage::Reflection::ReflectionExtension + # source://activestorage//lib/active_storage/reflection.rb#32 + def add_attachment_reflection(model, name, reflection); end + + private + + # source://activestorage//lib/active_storage/reflection.rb#37 + def reflection_class_for(macro); end +end + +module ActiveStorage::Representations; end + +class ActiveStorage::Representations::BaseController < ::ActiveStorage::BaseController + include ::ActiveStorage::SetBlob + + private + + def _layout(lookup_context, formats, keys); end + def _layout_from_proc; end + def blob_scope; end + def set_representation; end + + class << self + private + + def __class_attr___callbacks; end + def __class_attr___callbacks=(new_value); end + def __class_attr_config; end + def __class_attr_config=(new_value); end + def __class_attr_middleware_stack; end + def __class_attr_middleware_stack=(new_value); end + end +end + +class ActiveStorage::Representations::ProxyController < ::ActiveStorage::Representations::BaseController + include ::ActionController::Live + include ::ActiveStorage::Streaming + include ::ActiveStorage::DisableSession + extend ::ActionController::Live::ClassMethods + + def show; end + + private + + def _layout(lookup_context, formats, keys); end + def _layout_from_proc; end + + class << self + private + + def __class_attr___callbacks; end + def __class_attr___callbacks=(new_value); end + def __class_attr_config; end + def __class_attr_config=(new_value); end + def __class_attr_middleware_stack; end + def __class_attr_middleware_stack=(new_value); end + end +end + +class ActiveStorage::Representations::RedirectController < ::ActiveStorage::Representations::BaseController + def show; end + + private + + def _layout(lookup_context, formats, keys); end + def _layout_from_proc; end + + class << self + private + + def __class_attr_config; end + def __class_attr_config=(new_value); end + def __class_attr_middleware_stack; end + def __class_attr_middleware_stack=(new_value); end + end +end + +# = Active Storage \Service +# +# Abstract class serving as an interface for concrete services. +# +# The available services are: +# +# * +Disk+, to manage attachments saved directly on the hard drive. +# * +GCS+, to manage attachments through Google Cloud Storage. +# * +S3+, to manage attachments through Amazon S3. +# * +Mirror+, to be able to use several services to manage attachments. +# +# Inside a \Rails application, you can set-up your services through the +# generated config/storage.yml file and reference one +# of the aforementioned constant under the +service+ key. For example: +# +# local: +# service: Disk +# root: <%= Rails.root.join("storage") %> +# +# You can checkout the service's constructor to know which keys are required. +# +# Then, in your application's configuration, you can specify the service to +# use like this: +# +# config.active_storage.service = :local +# +# If you are using Active Storage outside of a Ruby on \Rails application, you +# can configure the service to use like this: +# +# ActiveStorage::Blob.service = ActiveStorage::Service.configure( +# :local, +# { local: {service: "Disk", root: Pathname("/tmp/foo/storage") } } +# ) +# +# source://activestorage//lib/active_storage/service.rb#43 +class ActiveStorage::Service + extend ::ActiveSupport::Autoload + + # Concatenate multiple files into a single "composed" file. + # + # @raise [NotImplementedError] + # + # source://activestorage//lib/active_storage/service.rb#96 + def compose(source_keys, destination_key, filename: T.unsafe(nil), content_type: T.unsafe(nil), disposition: T.unsafe(nil), custom_metadata: T.unsafe(nil)); end + + # Delete the file at the +key+. + # + # @raise [NotImplementedError] + # + # source://activestorage//lib/active_storage/service.rb#101 + def delete(key); end + + # Delete files at keys starting with the +prefix+. + # + # @raise [NotImplementedError] + # + # source://activestorage//lib/active_storage/service.rb#106 + def delete_prefixed(prefix); end + + # Return the content of the file at the +key+. + # + # @raise [NotImplementedError] + # + # source://activestorage//lib/active_storage/service.rb#82 + def download(key); end + + # Return the partial content in the byte +range+ of the file at the +key+. + # + # @raise [NotImplementedError] + # + # source://activestorage//lib/active_storage/service.rb#87 + def download_chunk(key, range); end + + # Return +true+ if a file exists at the +key+. + # + # @raise [NotImplementedError] + # @return [Boolean] + # + # source://activestorage//lib/active_storage/service.rb#111 + def exist?(key); end + + # Returns a Hash of headers for +url_for_direct_upload+ requests. + # + # source://activestorage//lib/active_storage/service.rb#143 + def headers_for_direct_upload(key, filename:, content_type:, content_length:, checksum:, custom_metadata: T.unsafe(nil)); end + + # source://activestorage//lib/active_storage/service.rb#151 + def inspect; end + + # Returns the value of attribute name. + # + # source://activestorage//lib/active_storage/service.rb#46 + def name; end + + # Sets the attribute name + # + # @param value the value to set the attribute name to. + # + # source://activestorage//lib/active_storage/service.rb#46 + def name=(_arg0); end + + # source://activestorage//lib/active_storage/service.rb#91 + def open(*args, **options, &block); end + + # @return [Boolean] + # + # source://activestorage//lib/active_storage/service.rb#147 + def public?; end + + # Update metadata for the file identified by +key+ in the service. + # Override in subclasses only if the service needs to store specific + # metadata that has to be updated upon identification. + # + # source://activestorage//lib/active_storage/service.rb#78 + def update_metadata(key, **metadata); end + + # Upload the +io+ to the +key+ specified. If a +checksum+ is provided, the service will + # ensure a match when the upload has completed or raise an ActiveStorage::IntegrityError. + # + # @raise [NotImplementedError] + # + # source://activestorage//lib/active_storage/service.rb#71 + def upload(key, io, checksum: T.unsafe(nil), **options); end + + # Returns the URL for the file at the +key+. This returns a permanent URL for public files, and returns a + # short-lived URL for private files. For private files you can provide the +disposition+ (+:inline+ or +:attachment+), + # +filename+, and +content_type+ that you wish the file to be served with on request. Additionally, you can also provide + # the amount of seconds the URL will be valid for, specified in +expires_in+. + # + # source://activestorage//lib/active_storage/service.rb#119 + def url(key, **options); end + + # Returns a signed, temporary URL that a direct upload file can be PUT to on the +key+. + # The URL will be valid for the amount of seconds specified in +expires_in+. + # You must also provide the +content_type+, +content_length+, and +checksum+ of the file + # that will be uploaded. All these attributes will be validated by the service upon upload. + # + # @raise [NotImplementedError] + # + # source://activestorage//lib/active_storage/service.rb#138 + def url_for_direct_upload(key, expires_in:, content_type:, content_length:, checksum:, custom_metadata: T.unsafe(nil)); end + + private + + # source://activestorage//lib/active_storage/service.rb#179 + def content_disposition_with(filename:, type: T.unsafe(nil)); end + + # @raise [NotImplementedError] + # + # source://activestorage//lib/active_storage/service.rb#164 + def custom_metadata_headers(metadata); end + + # source://activestorage//lib/active_storage/service.rb#168 + def instrument(operation, payload = T.unsafe(nil), &block); end + + # @raise [NotImplementedError] + # + # source://activestorage//lib/active_storage/service.rb#156 + def private_url(key, expires_in:, filename:, disposition:, content_type:, **_arg5); end + + # @raise [NotImplementedError] + # + # source://activestorage//lib/active_storage/service.rb#160 + def public_url(key, **_arg1); end + + # source://activestorage//lib/active_storage/service.rb#174 + def service_name; end + + class << self + # Override in subclasses that stitch together multiple services and hence + # need to build additional services using the configurator. + # + # Passes the configurator and all of the service's config as keyword args. + # + # See MirrorService for an example. + # + # source://activestorage//lib/active_storage/service.rb#62 + def build(configurator:, name:, service: T.unsafe(nil), **service_config); end + + # Configure an Active Storage service by name from a set of configurations, + # typically loaded from a YAML file. The Active Storage engine uses this + # to set the global Active Storage service when the app boots. + # + # source://activestorage//lib/active_storage/service.rb#52 + def configure(service_name, configurations); end + end +end + +# source://activestorage//lib/active_storage/service/configurator.rb#4 +class ActiveStorage::Service::Configurator + # source://activestorage//lib/active_storage/service/configurator.rb#11 + def initialize(configurations); end + + # source://activestorage//lib/active_storage/service/configurator.rb#15 + def build(service_name); end + + # source://activestorage//lib/active_storage/service/configurator.rb#5 + def configurations; end + + # source://activestorage//lib/active_storage/service/configurator.rb#22 + def inspect; end + + private + + # source://activestorage//lib/active_storage/service/configurator.rb#29 + def config_for(name); end + + # source://activestorage//lib/active_storage/service/configurator.rb#35 + def resolve(class_name); end + + class << self + # source://activestorage//lib/active_storage/service/configurator.rb#7 + def build(service_name, configurations); end + end +end + +# source://activestorage//lib/active_storage/service/registry.rb#4 +class ActiveStorage::Service::Registry + # source://activestorage//lib/active_storage/service/registry.rb#5 + def initialize(configurations); end + + # source://activestorage//lib/active_storage/service/registry.rb#10 + def fetch(name); end + + # source://activestorage//lib/active_storage/service/registry.rb#25 + def inspect; end + + private + + # source://activestorage//lib/active_storage/service/registry.rb#32 + def configurations; end + + # source://activestorage//lib/active_storage/service/registry.rb#34 + def configurator; end + + # source://activestorage//lib/active_storage/service/registry.rb#32 + def services; end +end + +module ActiveStorage::SetBlob + extend ::ActiveSupport::Concern + + private + + def blob_scope; end + def set_blob; end +end + +module ActiveStorage::SetCurrent + extend ::ActiveSupport::Concern +end + +module ActiveStorage::Streaming + extend ::ActiveSupport::Concern + include ::ActionController::Rendering + include ::ActionController::DataStreaming + include ::ActionController::Live + + mixes_in_class_methods ::ActionController::Rendering::ClassMethods + mixes_in_class_methods ::ActionController::Live::ClassMethods + + private + + def send_blob_byte_range_data(blob, range_header, disposition: T.unsafe(nil)); end + def send_blob_stream(blob, disposition: T.unsafe(nil)); end +end + +ActiveStorage::Streaming::DEFAULT_BLOB_STREAMING_DISPOSITION = T.let(T.unsafe(nil), String) + +# source://activestorage//lib/active_storage/structured_event_subscriber.rb#6 +class ActiveStorage::StructuredEventSubscriber < ::ActiveSupport::StructuredEventSubscriber + # source://activestorage//lib/active_storage/structured_event_subscriber.rb#29 + def preview(event); end + + # source://activestorage//lib/active_storage/structured_event_subscriber.rb#36 + def service_delete(event); end + + # source://activestorage//lib/active_storage/structured_event_subscriber.rb#43 + def service_delete_prefixed(event); end + + # source://activestorage//lib/active_storage/structured_event_subscriber.rb#15 + def service_download(event); end + + # source://activestorage//lib/active_storage/structured_event_subscriber.rb#50 + def service_exist(event); end + + # source://activestorage//lib/active_storage/structured_event_subscriber.rb#68 + def service_mirror(event); end + + # source://activestorage//lib/active_storage/structured_event_subscriber.rb#22 + def service_streaming_download(event); end + + # source://activestorage//lib/active_storage/structured_event_subscriber.rb#7 + def service_upload(event); end + + # source://activestorage//lib/active_storage/structured_event_subscriber.rb#59 + def service_url(event); end +end + +class ActiveStorage::TransformJob < ::ActiveStorage::BaseJob + def perform(blob, transformations); end + + class << self + private + + def __class_attr_queue_name; end + def __class_attr_queue_name=(new_value); end + def __class_attr_rescue_handlers; end + def __class_attr_rescue_handlers=(new_value); end + end +end + +# source://activestorage//lib/active_storage.rb#367 +module ActiveStorage::Transformers + extend ::ActiveSupport::Autoload +end + +# source://activestorage//lib/active_storage/transformers/null_transformer.rb#5 +class ActiveStorage::Transformers::NullTransformer < ::ActiveStorage::Transformers::Transformer + private + + # source://activestorage//lib/active_storage/transformers/null_transformer.rb#7 + def process(file, format:); end +end + +# = Active Storage \Transformers \Transformer +# +# A Transformer applies a set of transformations to an image. +# +# The following concrete subclasses are included in Active Storage: +# +# * ActiveStorage::Transformers::ImageProcessingTransformer: +# backed by ImageProcessing, a common interface for MiniMagick and ruby-vips +# +# source://activestorage//lib/active_storage/transformers/transformer.rb#13 +class ActiveStorage::Transformers::Transformer + # @return [Transformer] a new instance of Transformer + # + # source://activestorage//lib/active_storage/transformers/transformer.rb#16 + def initialize(transformations); end + + # Applies the transformations to the source image in +file+, producing a target image in the + # specified +format+. Yields an open Tempfile containing the target image. Closes and unlinks + # the output tempfile after yielding to the given block. Returns the result of the block. + # + # source://activestorage//lib/active_storage/transformers/transformer.rb#23 + def transform(file, format:); end + + # Returns the value of attribute transformations. + # + # source://activestorage//lib/active_storage/transformers/transformer.rb#14 + def transformations; end + + private + + # Returns an open Tempfile containing a transformed image in the given +format+. + # All subclasses implement this method. + # + # @raise [NotImplementedError] + # + # source://activestorage//lib/active_storage/transformers/transformer.rb#36 + def process(file, format:); end +end + +# Raised when ActiveStorage::Blob#preview is called on a blob that isn't previewable. +# Use ActiveStorage::Blob#previewable? to determine whether a blob is previewable. +# +# source://activestorage//lib/active_storage/errors.rb#13 +class ActiveStorage::UnpreviewableError < ::ActiveStorage::Error; end + +# Raised when ActiveStorage::Blob#representation is called on a blob that isn't representable. +# Use ActiveStorage::Blob#representable? to determine whether a blob is representable. +# +# source://activestorage//lib/active_storage/errors.rb#17 +class ActiveStorage::UnrepresentableError < ::ActiveStorage::Error; end + +# source://activestorage//lib/active_storage/gem_version.rb#9 +module ActiveStorage::VERSION; end + +# source://activestorage//lib/active_storage/gem_version.rb#10 +ActiveStorage::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# source://activestorage//lib/active_storage/gem_version.rb#11 +ActiveStorage::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# source://activestorage//lib/active_storage/gem_version.rb#13 +ActiveStorage::VERSION::PRE = T.let(T.unsafe(nil), T.untyped) + +# source://activestorage//lib/active_storage/gem_version.rb#15 +ActiveStorage::VERSION::STRING = T.let(T.unsafe(nil), String) + +# source://activestorage//lib/active_storage/gem_version.rb#12 +ActiveStorage::VERSION::TINY = T.let(T.unsafe(nil), Integer) + +# source://activestorage//lib/active_storage/analyzer/image_analyzer/vips.rb#16 +ActiveStorage::VIPS_AVAILABLE = T.let(T.unsafe(nil), FalseClass) + +class ActiveStorage::Variant + include ::ActiveStorage::Blob::Servable + + def initialize(blob, variation_or_variation_key); end + + def blob; end + def content_type(*_arg0, **_arg1, &_arg2); end + def destroy; end + def download(&block); end + def filename; end + def image; end + def key; end + def processed; end + def service(*_arg0, **_arg1, &_arg2); end + def url(expires_in: T.unsafe(nil), disposition: T.unsafe(nil)); end + def variation; end + + private + + def process; end + def processed?; end +end + +class ActiveStorage::VariantRecord < ::ActiveStorage::Record + include ::ActiveStorage::VariantRecord::GeneratedAttributeMethods + include ::ActiveStorage::VariantRecord::GeneratedAssociationMethods + + def _run_commit_callbacks(&block); end + def _run_create_callbacks(&block); end + def _run_destroy_callbacks(&block); end + def _run_save_callbacks(&block); end + def _run_update_callbacks(&block); end + def autosave_associated_records_for_blob(*args); end + def autosave_associated_records_for_image_attachment(*args); end + def autosave_associated_records_for_image_blob(*args); end + + class << self + def with_attached_image(*args, **_arg1); end + + private + + def __class_attr___callbacks; end + def __class_attr___callbacks=(new_value); end + def __class_attr__reflections; end + def __class_attr__reflections=(new_value); end + def __class_attr__validators; end + def __class_attr__validators=(new_value); end + def __class_attr_attachment_reflections; end + def __class_attr_attachment_reflections=(new_value); end + def __class_attr_defined_enums; end + def __class_attr_defined_enums=(new_value); end + end +end + +module ActiveStorage::VariantRecord::GeneratedAssociationMethods + def blob; end + def blob=(value); end + def blob_changed?; end + def blob_previously_changed?; end + def build_blob(*args, &block); end + def build_image_attachment(*args, &block); end + def build_image_blob(*args, &block); end + def create_blob(*args, &block); end + def create_blob!(*args, &block); end + def create_image_attachment(*args, &block); end + def create_image_attachment!(*args, &block); end + def create_image_blob(*args, &block); end + def create_image_blob!(*args, &block); end + def image; end + def image=(attachable); end + def image_attachment; end + def image_attachment=(value); end + def image_blob; end + def image_blob=(value); end + def reload_blob; end + def reload_image_attachment; end + def reload_image_blob; end + def reset_blob; end + def reset_image_attachment; end + def reset_image_blob; end +end + +module ActiveStorage::VariantRecord::GeneratedAttributeMethods; end + +class ActiveStorage::VariantWithRecord + include ::ActiveStorage::Blob::Servable + + def initialize(blob, variation); end + + def blob; end + def content_type(*_arg0, **_arg1, &_arg2); end + def destroy; end + def download(*_arg0, **_arg1, &_arg2); end + def filename; end + def image; end + def key(*_arg0, **_arg1, &_arg2); end + def processed; end + def service(*_arg0, **_arg1, &_arg2); end + def url(*_arg0, **_arg1, &_arg2); end + def variation; end + + private + + def create_or_find_record(image:); end + def process; end + def processed?; end + def record; end + def transform_blob; end +end + +class ActiveStorage::Variation + def initialize(transformations); end + + def content_type; end + def default_to(defaults); end + def digest; end + def format; end + def key; end + def transform(file, &block); end + def transformations; end + + private + + def transformer; end + + class << self + def decode(key); end + def encode(transformations); end + def wrap(variator); end + end +end diff --git a/sorbet/rbi/gems/activesupport@8.1.1.rbi b/sorbet/rbi/gems/activesupport@8.1.1.rbi new file mode 100644 index 0000000..197bb94 --- /dev/null +++ b/sorbet/rbi/gems/activesupport@8.1.1.rbi @@ -0,0 +1,22782 @@ +# typed: false + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `activesupport` gem. +# Please instead update this file by running `bin/tapioca gem activesupport`. + + +# :include: ../README.rdoc +# +# source://activesupport//lib/active_support/delegation.rb#3 +module ActiveSupport + extend ::ActiveSupport::LazyLoadHooks + extend ::ActiveSupport::Autoload + + # source://activesupport//lib/active_support.rb#114 + def filter_parameters; end + + # source://activesupport//lib/active_support.rb#114 + def filter_parameters=(val); end + + # source://activesupport//lib/active_support.rb#106 + def parallelize_test_databases; end + + # source://activesupport//lib/active_support.rb#106 + def parallelize_test_databases=(val); end + + # source://activesupport//lib/active_support/json/decoding.rb#9 + def parse_json_times; end + + # source://activesupport//lib/active_support/json/decoding.rb#9 + def parse_json_times=(val); end + + # source://activesupport//lib/active_support.rb#104 + def test_order; end + + # source://activesupport//lib/active_support.rb#104 + def test_order=(val); end + + # source://activesupport//lib/active_support.rb#105 + def test_parallelization_threshold; end + + # source://activesupport//lib/active_support.rb#105 + def test_parallelization_threshold=(val); end + + class << self + # source://activesupport//lib/active_support.rb#116 + def cache_format_version; end + + # source://activesupport//lib/active_support.rb#120 + def cache_format_version=(value); end + + # source://activesupport//lib/active_support/deprecator.rb#4 + def deprecator; end + + # source://activesupport//lib/active_support.rb#98 + def eager_load!; end + + # source://activesupport//lib/active_support.rb#109 + def error_reporter; end + + # source://activesupport//lib/active_support.rb#109 + def error_reporter=(_arg0); end + + # source://activesupport//lib/active_support/json/encoding.rb#8 + def escape_html_entities_in_json(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/json/encoding.rb#8 + def escape_html_entities_in_json=(arg); end + + # source://activesupport//lib/active_support/json/encoding.rb#8 + def escape_js_separators_in_json(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/json/encoding.rb#8 + def escape_js_separators_in_json=(arg); end + + # source://activesupport//lib/active_support.rb#112 + def event_reporter; end + + # source://activesupport//lib/active_support.rb#112 + def event_reporter=(_arg0); end + + # source://activesupport//lib/active_support.rb#114 + def filter_parameters; end + + # source://activesupport//lib/active_support.rb#114 + def filter_parameters=(val); end + + # Returns the currently loaded version of Active Support as a +Gem::Version+. + # + # source://activesupport//lib/active_support/gem_version.rb#5 + def gem_version; end + + # source://activesupport//lib/active_support/json/encoding.rb#8 + def json_encoder(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/json/encoding.rb#8 + def json_encoder=(arg); end + + # source://activesupport//lib/active_support.rb#106 + def parallelize_test_databases; end + + # source://activesupport//lib/active_support.rb#106 + def parallelize_test_databases=(val); end + + # source://activesupport//lib/active_support/json/decoding.rb#9 + def parse_json_times; end + + # source://activesupport//lib/active_support/json/decoding.rb#9 + def parse_json_times=(val); end + + # source://activesupport//lib/active_support.rb#104 + def test_order; end + + # source://activesupport//lib/active_support.rb#104 + def test_order=(val); end + + # source://activesupport//lib/active_support.rb#105 + def test_parallelization_threshold; end + + # source://activesupport//lib/active_support.rb#105 + def test_parallelization_threshold=(val); end + + # source://activesupport//lib/active_support/json/encoding.rb#8 + def time_precision(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/json/encoding.rb#8 + def time_precision=(arg); end + + # source://activesupport//lib/active_support.rb#124 + def to_time_preserves_timezone; end + + # source://activesupport//lib/active_support.rb#131 + def to_time_preserves_timezone=(value); end + + # source://activesupport//lib/active_support/json/encoding.rb#8 + def use_standard_json_time_format(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/json/encoding.rb#8 + def use_standard_json_time_format=(arg); end + + # source://activesupport//lib/active_support.rb#139 + def utc_to_local_returns_utc_offset_times; end + + # source://activesupport//lib/active_support.rb#143 + def utc_to_local_returns_utc_offset_times=(value); end + + # Returns the currently loaded version of Active Support as a +Gem::Version+. + # + # source://activesupport//lib/active_support/version.rb#7 + def version; end + end +end + +# = Actionable Errors +# +# Actionable errors lets you define actions to resolve an error. +# +# To make an error actionable, include the +ActiveSupport::ActionableError+ +# module and invoke the +action+ class macro to define the action. An action +# needs a name and a block to execute. +# +# source://activesupport//lib/active_support/actionable_error.rb#11 +module ActiveSupport::ActionableError + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveSupport::ActionableError::ClassMethods + + class << self + # source://activesupport//lib/active_support/actionable_error.rb#20 + def actions(error); end + + # source://activesupport//lib/active_support/actionable_error.rb#29 + def dispatch(error, name); end + end + + module GeneratedClassMethods + def _actions; end + def _actions=(value); end + def _actions?; end + end + + module GeneratedInstanceMethods + def _actions; end + def _actions=(value); end + def _actions?; end + end +end + +# source://activesupport//lib/active_support/actionable_error.rb#35 +module ActiveSupport::ActionableError::ClassMethods + # Defines an action that can resolve the error. + # + # class PendingMigrationError < MigrationError + # include ActiveSupport::ActionableError + # + # action "Run pending migrations" do + # ActiveRecord::Tasks::DatabaseTasks.migrate + # end + # end + # + # source://activesupport//lib/active_support/actionable_error.rb#45 + def action(name, &block); end +end + +# source://activesupport//lib/active_support/actionable_error.rb#14 +class ActiveSupport::ActionableError::NonActionable < ::StandardError; end + +# = \Array Inquirer +# +# Wrapping an array in an +ArrayInquirer+ gives a friendlier way to check +# its string-like contents: +# +# variants = ActiveSupport::ArrayInquirer.new([:phone, :tablet]) +# +# variants.phone? # => true +# variants.tablet? # => true +# variants.desktop? # => false +# +# source://activesupport//lib/active_support/array_inquirer.rb#14 +class ActiveSupport::ArrayInquirer < ::Array + # Passes each element of +candidates+ collection to ArrayInquirer collection. + # The method returns true if any element from the ArrayInquirer collection + # is equal to the stringified or symbolized form of any element in the +candidates+ collection. + # + # If +candidates+ collection is not given, method returns true. + # + # variants = ActiveSupport::ArrayInquirer.new([:phone, :tablet]) + # + # variants.any? # => true + # variants.any?(:phone, :tablet) # => true + # variants.any?('phone', 'desktop') # => true + # variants.any?(:desktop, :watch) # => false + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/array_inquirer.rb#27 + def any?(*candidates); end + + private + + # source://activesupport//lib/active_support/array_inquirer.rb#42 + def method_missing(name, *_arg1, **_arg2, &_arg3); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/array_inquirer.rb#38 + def respond_to_missing?(name, include_private = T.unsafe(nil)); end +end + +# = Active Support \Autoload +# +# Autoload and eager load conveniences for your library. +# +# This module allows you to define autoloads based on +# \Rails conventions (i.e. no need to define the path +# it is automatically guessed based on the filename) +# and also define a set of constants that needs to be +# eager loaded: +# +# module MyLib +# extend ActiveSupport::Autoload +# +# autoload :Model +# +# eager_autoload do +# autoload :Cache +# end +# end +# +# Then your library can be eager loaded by simply calling: +# +# MyLib.eager_load! +# +# source://activesupport//lib/active_support/dependencies/autoload.rb#29 +module ActiveSupport::Autoload + # source://activesupport//lib/active_support/dependencies/autoload.rb#30 + def autoload(const_name, path = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/dependencies/autoload.rb#51 + def autoload_at(path); end + + # source://activesupport//lib/active_support/dependencies/autoload.rb#44 + def autoload_under(path); end + + # source://activesupport//lib/active_support/dependencies/autoload.rb#58 + def eager_autoload; end + + # source://activesupport//lib/active_support/dependencies/autoload.rb#65 + def eager_load!; end +end + +# = Backtrace Cleaner +# +# Backtraces often include many lines that are not relevant for the context +# under review. This makes it hard to find the signal amongst the backtrace +# noise, and adds debugging time. With a BacktraceCleaner, filters and +# silencers are used to remove the noisy lines, so that only the most relevant +# lines remain. +# +# Filters are used to modify lines of data, while silencers are used to remove +# lines entirely. The typical filter use case is to remove lengthy path +# information from the start of each line, and view file paths relevant to the +# app directory instead of the file system root. The typical silencer use case +# is to exclude the output of a noisy library from the backtrace, so that you +# can focus on the rest. +# +# bc = ActiveSupport::BacktraceCleaner.new +# root = "#{Rails.root}/" +# bc.add_filter { |line| line.delete_prefix(root) } # strip the Rails.root prefix +# bc.add_silencer { |line| /puma|rubygems/.match?(line) } # skip any lines from puma or rubygems +# bc.clean(exception.backtrace) # perform the cleanup +# +# To reconfigure an existing BacktraceCleaner (like the default one in \Rails) +# and show as much data as possible, you can always call +# BacktraceCleaner#remove_silencers!, which will restore the +# backtrace to a pristine state. If you need to reconfigure an existing +# BacktraceCleaner so that it does not filter or modify the paths of any lines +# of the backtrace, you can call BacktraceCleaner#remove_filters! +# These two methods will give you a completely untouched backtrace. +# +# Inspired by the Quiet Backtrace gem by thoughtbot. +# +# source://activesupport//lib/active_support/backtrace_cleaner.rb#34 +class ActiveSupport::BacktraceCleaner + # @return [BacktraceCleaner] a new instance of BacktraceCleaner + # + # source://activesupport//lib/active_support/backtrace_cleaner.rb#35 + def initialize; end + + # Adds a filter from the block provided. Each line in the backtrace will be + # mapped against this filter. + # + # # Will turn "/my/rails/root/app/models/person.rb" into "app/models/person.rb" + # root = "#{Rails.root}/" + # backtrace_cleaner.add_filter { |line| line.delete_prefix(root) } + # + # source://activesupport//lib/active_support/backtrace_cleaner.rb#154 + def add_filter(&block); end + + # Adds a silencer from the block provided. If the silencer returns +true+ + # for a given line, it will be excluded from the clean backtrace. + # + # # Will reject all lines that include the word "puma", like "/gems/puma/server.rb" or "/app/my_puma_server/rb" + # backtrace_cleaner.add_silencer { |line| /puma/.match?(line) } + # + # source://activesupport//lib/active_support/backtrace_cleaner.rb#163 + def add_silencer(&block); end + + # Returns the backtrace after all filters and silencers have been run + # against it. Filters run first, then silencers. + # + # source://activesupport//lib/active_support/backtrace_cleaner.rb#45 + def clean(backtrace, kind = T.unsafe(nil)); end + + # Returns the frame with all filters applied. + # returns +nil+ if the frame was silenced. + # + # source://activesupport//lib/active_support/backtrace_cleaner.rb#73 + def clean_frame(frame, kind = T.unsafe(nil)); end + + # Given an array of Thread::Backtrace::Location objects, returns an array + # with the clean ones: + # + # clean_locations = backtrace_cleaner.clean_locations(caller_locations) + # + # Filters and silencers receive strings as usual. However, the +path+ + # attributes of the locations in the returned array are the original, + # unfiltered ones, since locations are immutable. + # + # source://activesupport//lib/active_support/backtrace_cleaner.rb#67 + def clean_locations(locations, kind = T.unsafe(nil)); end + + # Returns the backtrace after all filters and silencers have been run + # against it. Filters run first, then silencers. + # + # source://activesupport//lib/active_support/backtrace_cleaner.rb#57 + def filter(backtrace, kind = T.unsafe(nil)); end + + # Returns the first clean frame of the caller's backtrace, or +nil+. + # + # Frames are strings. + # + # source://activesupport//lib/active_support/backtrace_cleaner.rb#129 + def first_clean_frame(kind = T.unsafe(nil)); end + + # Returns the first clean location of the caller's call stack, or +nil+. + # + # Locations are Thread::Backtrace::Location objects. Since they are + # immutable, their +path+ attributes are the original ones, but filters + # are applied internally so silencers can still rely on them. + # + # source://activesupport//lib/active_support/backtrace_cleaner.rb#141 + def first_clean_location(kind = T.unsafe(nil)); end + + # Removes all filters, but leaves in the silencers. Useful if you suddenly + # need to see entire filepaths in the backtrace that you had already + # filtered out. + # + # source://activesupport//lib/active_support/backtrace_cleaner.rb#177 + def remove_filters!; end + + # Removes all silencers, but leaves in the filters. Useful if your + # context of debugging suddenly expands as you suspect a bug in one of + # the libraries you use. + # + # source://activesupport//lib/active_support/backtrace_cleaner.rb#170 + def remove_silencers!; end + + private + + # source://activesupport//lib/active_support/backtrace_cleaner.rb#198 + def add_core_silencer; end + + # source://activesupport//lib/active_support/backtrace_cleaner.rb#189 + def add_gem_filter; end + + # source://activesupport//lib/active_support/backtrace_cleaner.rb#202 + def add_gem_silencer; end + + # source://activesupport//lib/active_support/backtrace_cleaner.rb#206 + def add_stdlib_silencer; end + + # source://activesupport//lib/active_support/backtrace_cleaner.rb#210 + def filter_backtrace(backtrace); end + + # source://activesupport//lib/active_support/backtrace_cleaner.rb#184 + def initialize_copy(_other); end + + # source://activesupport//lib/active_support/backtrace_cleaner.rb#226 + def noise(backtrace); end + + # source://activesupport//lib/active_support/backtrace_cleaner.rb#218 + def silence(backtrace); end +end + +# source://activesupport//lib/active_support/backtrace_cleaner.rb#182 +ActiveSupport::BacktraceCleaner::FORMATTED_GEMS_PATTERN = T.let(T.unsafe(nil), Regexp) + +# source://activesupport//lib/active_support/benchmark.rb#4 +module ActiveSupport::Benchmark + class << self + # Benchmark realtime in the specified time unit. By default, + # the returned unit is in seconds. + # + # ActiveSupport::Benchmark.realtime { sleep 0.1 } + # # => 0.10007 + # + # ActiveSupport::Benchmark.realtime(:float_millisecond) { sleep 0.1 } + # # => 100.07 + # + # `unit` can be any of the values accepted by Ruby's `Process.clock_gettime`. + # + # source://activesupport//lib/active_support/benchmark.rb#15 + def realtime(unit = T.unsafe(nil), &block); end + end +end + +# = \Benchmarkable +# +# source://activesupport//lib/active_support/benchmarkable.rb#7 +module ActiveSupport::Benchmarkable + # Allows you to measure the execution time of a block in a template and + # records the result to the log. Wrap this block around expensive operations + # or possible bottlenecks to get a time reading for the operation. For + # example, let's say you thought your file processing method was taking too + # long; you could wrap it in a benchmark block. + # + # <% benchmark 'Process data files' do %> + # <%= expensive_files_operation %> + # <% end %> + # + # That would add something like "Process data files (345.2ms)" to the log, + # which you can then use to compare timings when optimizing your code. + # + # You may give an optional logger level (:debug, :info, + # :warn, :error) as the :level option. The + # default logger level value is :info. + # + # <% benchmark 'Low-level files', level: :debug do %> + # <%= lowlevel_files_operation %> + # <% end %> + # + # Finally, you can pass true as the third argument to silence all log + # activity (other than the timing information) from inside the block. This + # is great for boiling down a noisy block to just a single statement that + # produces one log line: + # + # <% benchmark 'Process data files', level: :info, silence: true do %> + # <%= expensive_and_chatty_files_operation %> + # <% end %> + # + # source://activesupport//lib/active_support/benchmarkable.rb#37 + def benchmark(message = T.unsafe(nil), options = T.unsafe(nil), &block); end +end + +# source://activesupport//lib/active_support/core_ext/big_decimal/conversions.rb#7 +module ActiveSupport::BigDecimalWithDefaultFormat + # source://activesupport//lib/active_support/core_ext/big_decimal/conversions.rb#8 + def to_s(format = T.unsafe(nil)); end +end + +# = Active Support Broadcast Logger +# +# The Broadcast logger is a logger used to write messages to multiple IO. It is commonly used +# in development to display messages on STDOUT and also write them to a file (development.log). +# With the Broadcast logger, you can broadcast your logs to a unlimited number of sinks. +# +# The BroadcastLogger acts as a standard logger and all methods you are used to are available. +# However, all the methods on this logger will propagate and be delegated to the other loggers +# that are part of the broadcast. +# +# Broadcasting your logs. +# +# stdout_logger = Logger.new(STDOUT) +# file_logger = Logger.new("development.log") +# broadcast = BroadcastLogger.new(stdout_logger, file_logger) +# +# broadcast.info("Hello world!") # Writes the log to STDOUT and the development.log file. +# +# Add a logger to the broadcast. +# +# stdout_logger = Logger.new(STDOUT) +# broadcast = BroadcastLogger.new(stdout_logger) +# file_logger = Logger.new("development.log") +# broadcast.broadcast_to(file_logger) +# +# broadcast.info("Hello world!") # Writes the log to STDOUT and the development.log file. +# +# Modifying the log level for all broadcasted loggers. +# +# stdout_logger = Logger.new(STDOUT) +# file_logger = Logger.new("development.log") +# broadcast = BroadcastLogger.new(stdout_logger, file_logger) +# +# broadcast.level = Logger::FATAL # Modify the log level for the whole broadcast. +# +# Stop broadcasting log to a sink. +# +# stdout_logger = Logger.new(STDOUT) +# file_logger = Logger.new("development.log") +# broadcast = BroadcastLogger.new(stdout_logger, file_logger) +# broadcast.info("Hello world!") # Writes the log to STDOUT and the development.log file. +# +# broadcast.stop_broadcasting_to(file_logger) +# broadcast.info("Hello world!") # Writes the log *only* to STDOUT. +# +# At least one sink has to be part of the broadcast. Otherwise, your logs will not +# be written anywhere. For instance: +# +# broadcast = BroadcastLogger.new +# broadcast.info("Hello world") # The log message will appear nowhere. +# +# If you are adding a custom logger with custom methods to the broadcast, +# the `BroadcastLogger` will proxy them and return the raw value, or an array +# of raw values, depending on how many loggers in the broadcasts responded to +# the method: +# +# class MyLogger < ::Logger +# def loggable? +# true +# end +# end +# +# logger = BroadcastLogger.new +# logger.loggable? # => A NoMethodError exception is raised because no loggers in the broadcasts could respond. +# +# logger.broadcast_to(MyLogger.new(STDOUT)) +# logger.loggable? # => true +# logger.broadcast_to(MyLogger.new(STDOUT)) +# puts logger.broadcasts # => [MyLogger, MyLogger] +# logger.loggable? # [true, true] +# +# source://activesupport//lib/active_support/broadcast_logger.rb#74 +class ActiveSupport::BroadcastLogger + include ::ActiveSupport::LoggerSilence + include ::ActiveSupport::LoggerThreadSafeLevel + + # @return [BroadcastLogger] a new instance of BroadcastLogger + # + # source://activesupport//lib/active_support/broadcast_logger.rb#81 + def initialize(*loggers); end + + # source://activesupport//lib/active_support/broadcast_logger.rb#127 + def <<(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/broadcast_logger.rb#127 + def add(*_arg0, **_arg1, &_arg2); end + + # Add logger(s) to the broadcast. + # + # broadcast_logger = ActiveSupport::BroadcastLogger.new + # broadcast_logger.broadcast_to(Logger.new(STDOUT), Logger.new(STDERR)) + # + # source://activesupport//lib/active_support/broadcast_logger.rb#92 + def broadcast_to(*loggers); end + + # Returns all the logger that are part of this broadcast. + # + # source://activesupport//lib/active_support/broadcast_logger.rb#78 + def broadcasts; end + + # source://activesupport//lib/active_support/broadcast_logger.rb#127 + def close(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/broadcast_logger.rb#127 + def debug(*_arg0, **_arg1, &_arg2); end + + # Sets the log level to +Logger::DEBUG+ for the whole broadcast. + # + # source://activesupport//lib/active_support/broadcast_logger.rb#146 + def debug!; end + + # True if the log level allows entries with severity +Logger::DEBUG+ to be written + # to at least one broadcast. False otherwise. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/broadcast_logger.rb#141 + def debug?; end + + # source://activesupport//lib/active_support/broadcast_logger.rb#127 + def error(*_arg0, **_arg1, &_arg2); end + + # Sets the log level to +Logger::ERROR+ for the whole broadcast. + # + # source://activesupport//lib/active_support/broadcast_logger.rb#179 + def error!; end + + # True if the log level allows entries with severity +Logger::ERROR+ to be written + # to at least one broadcast. False otherwise. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/broadcast_logger.rb#174 + def error?; end + + # source://activesupport//lib/active_support/broadcast_logger.rb#127 + def fatal(*_arg0, **_arg1, &_arg2); end + + # Sets the log level to +Logger::FATAL+ for the whole broadcast. + # + # source://activesupport//lib/active_support/broadcast_logger.rb#190 + def fatal!; end + + # True if the log level allows entries with severity +Logger::FATAL+ to be written + # to at least one broadcast. False otherwise. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/broadcast_logger.rb#185 + def fatal?; end + + # source://activesupport//lib/active_support/broadcast_logger.rb#127 + def formatter(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/broadcast_logger.rb#127 + def formatter=(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/broadcast_logger.rb#127 + def info(*_arg0, **_arg1, &_arg2); end + + # Sets the log level to +Logger::INFO+ for the whole broadcast. + # + # source://activesupport//lib/active_support/broadcast_logger.rb#157 + def info!; end + + # True if the log level allows entries with severity +Logger::INFO+ to be written + # to at least one broadcast. False otherwise. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/broadcast_logger.rb#152 + def info?; end + + # Returns the lowest level of all the loggers in the broadcast. + # + # source://activesupport//lib/active_support/broadcast_logger.rb#135 + def level; end + + # source://activesupport//lib/active_support/broadcast_logger.rb#127 + def level=(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/broadcast_logger.rb#113 + def local_level; end + + # source://activesupport//lib/active_support/broadcast_logger.rb#107 + def local_level=(level); end + + # source://activesupport//lib/active_support/broadcast_logger.rb#127 + def log(*_arg0, **_arg1, &_arg2); end + + # Returns the value of attribute progname. + # + # source://activesupport//lib/active_support/broadcast_logger.rb#79 + def progname; end + + # Sets the attribute progname + # + # @param value the value to set the attribute progname to. + # + # source://activesupport//lib/active_support/broadcast_logger.rb#79 + def progname=(_arg0); end + + # source://activesupport//lib/active_support/broadcast_logger.rb#127 + def sev_threshold=(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/broadcast_logger.rb#75 + def silencer; end + + # source://activesupport//lib/active_support/broadcast_logger.rb#75 + def silencer=(val); end + + # Remove a logger from the broadcast. When a logger is removed, messages sent to + # the broadcast will no longer be written to its sink. + # + # sink = Logger.new(STDOUT) + # broadcast_logger = ActiveSupport::BroadcastLogger.new + # + # broadcast_logger.stop_broadcasting_to(sink) + # + # source://activesupport//lib/active_support/broadcast_logger.rb#103 + def stop_broadcasting_to(logger); end + + # source://activesupport//lib/active_support/broadcast_logger.rb#127 + def unknown(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/broadcast_logger.rb#127 + def warn(*_arg0, **_arg1, &_arg2); end + + # Sets the log level to +Logger::WARN+ for the whole broadcast. + # + # source://activesupport//lib/active_support/broadcast_logger.rb#168 + def warn!; end + + # True if the log level allows entries with severity +Logger::WARN+ to be written + # to at least one broadcast. False otherwise. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/broadcast_logger.rb#163 + def warn?; end + + private + + # source://activesupport//lib/active_support/broadcast_logger.rb#202 + def dispatch(method, *args, **kwargs, &block); end + + # source://activesupport//lib/active_support/broadcast_logger.rb#194 + def initialize_copy(other); end + + # source://activesupport//lib/active_support/broadcast_logger.rb#222 + def method_missing(name, *_arg1, **_arg2, &_arg3); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/broadcast_logger.rb#234 + def respond_to_missing?(method, include_all); end + + class << self + # source://activesupport//lib/active_support/broadcast_logger.rb#75 + def silencer; end + + # source://activesupport//lib/active_support/broadcast_logger.rb#75 + def silencer=(val); end + end +end + +# source://activesupport//lib/active_support/broadcast_logger.rb#121 +ActiveSupport::BroadcastLogger::LOGGER_METHODS = T.let(T.unsafe(nil), Array) + +# See ActiveSupport::Cache::Store for documentation. +# +# source://activesupport//lib/active_support/cache/entry.rb#6 +module ActiveSupport::Cache + class << self + # Expands out the +key+ argument into a key that can be used for the + # cache store. Optionally accepts a namespace, and all keys will be + # scoped within that namespace. + # + # If the +key+ argument provided is an array, or responds to +to_a+, then + # each of elements in the array will be turned into parameters/keys and + # concatenated into a single key. For example: + # + # ActiveSupport::Cache.expand_cache_key([:foo, :bar]) # => "foo/bar" + # ActiveSupport::Cache.expand_cache_key([:foo, :bar], "namespace") # => "namespace/foo/bar" + # + # The +key+ argument can also respond to +cache_key+ or +to_param+. + # + # source://activesupport//lib/active_support/cache.rb#113 + def expand_cache_key(key, namespace = T.unsafe(nil)); end + + # Returns the value of attribute format_version. + # + # source://activesupport//lib/active_support/cache.rb#60 + def format_version; end + + # Sets the attribute format_version + # + # @param value the value to set the attribute format_version to. + # + # source://activesupport//lib/active_support/cache.rb#60 + def format_version=(_arg0); end + + # Creates a new Store object according to the given options. + # + # If no arguments are passed to this method, then a new + # ActiveSupport::Cache::MemoryStore object will be returned. + # + # If you pass a Symbol as the first argument, then a corresponding cache + # store class under the ActiveSupport::Cache namespace will be created. + # For example: + # + # ActiveSupport::Cache.lookup_store(:memory_store) + # # => returns a new ActiveSupport::Cache::MemoryStore object + # + # ActiveSupport::Cache.lookup_store(:mem_cache_store) + # # => returns a new ActiveSupport::Cache::MemCacheStore object + # + # Any additional arguments will be passed to the corresponding cache store + # class's constructor: + # + # ActiveSupport::Cache.lookup_store(:file_store, '/tmp/cache') + # # => same as: ActiveSupport::Cache::FileStore.new('/tmp/cache') + # + # If the first argument is not a Symbol, then it will simply be returned: + # + # ActiveSupport::Cache.lookup_store(MyOwnCacheStore.new) + # # => returns MyOwnCacheStore.new + # + # source://activesupport//lib/active_support/cache.rb#87 + def lookup_store(store = T.unsafe(nil), *parameters); end + + private + + # source://activesupport//lib/active_support/cache.rb#125 + def retrieve_cache_key(key); end + + # Obtains the specified cache store class, given the name of the +store+. + # Raises an error when the store class cannot be found. + # + # source://activesupport//lib/active_support/cache.rb#137 + def retrieve_store_class(store); end + end +end + +# source://activesupport//lib/active_support/cache/coder.rb#7 +class ActiveSupport::Cache::Coder + # @return [Coder] a new instance of Coder + # + # source://activesupport//lib/active_support/cache/coder.rb#8 + def initialize(serializer, compressor, legacy_serializer: T.unsafe(nil)); end + + # source://activesupport//lib/active_support/cache/coder.rb#14 + def dump(entry); end + + # source://activesupport//lib/active_support/cache/coder.rb#20 + def dump_compressed(entry, threshold); end + + # source://activesupport//lib/active_support/cache/coder.rb#48 + def load(dumped); end + + private + + # source://activesupport//lib/active_support/cache/coder.rb#136 + def dump_version(version); end + + # source://activesupport//lib/active_support/cache/coder.rb#144 + def load_version(dumped_version); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/cache/coder.rb#121 + def signature?(dumped); end + + # source://activesupport//lib/active_support/cache/coder.rb#129 + def try_compress(string, threshold); end + + # source://activesupport//lib/active_support/cache/coder.rb#125 + def type_for_string(value); end +end + +# source://activesupport//lib/active_support/cache/coder.rb#76 +ActiveSupport::Cache::Coder::COMPRESSED_FLAG = T.let(T.unsafe(nil), Integer) + +# source://activesupport//lib/active_support/cache/coder.rb#98 +class ActiveSupport::Cache::Coder::LazyEntry < ::ActiveSupport::Cache::Entry + # @return [LazyEntry] a new instance of LazyEntry + # + # source://activesupport//lib/active_support/cache/coder.rb#99 + def initialize(serializer, compressor, payload, **options); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/cache/coder.rb#114 + def mismatched?(version); end + + # source://activesupport//lib/active_support/cache/coder.rb#106 + def value; end +end + +# source://activesupport//lib/active_support/cache/coder.rb#84 +ActiveSupport::Cache::Coder::MARSHAL_SIGNATURE = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/cache/coder.rb#68 +ActiveSupport::Cache::Coder::OBJECT_DUMP_TYPE = T.let(T.unsafe(nil), Integer) + +# source://activesupport//lib/active_support/cache/coder.rb#80 +ActiveSupport::Cache::Coder::PACKED_EXPIRES_AT_TEMPLATE = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/cache/coder.rb#78 +ActiveSupport::Cache::Coder::PACKED_TEMPLATE = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/cache/coder.rb#79 +ActiveSupport::Cache::Coder::PACKED_TYPE_TEMPLATE = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/cache/coder.rb#82 +ActiveSupport::Cache::Coder::PACKED_VERSION_INDEX = T.let(T.unsafe(nil), Integer) + +# source://activesupport//lib/active_support/cache/coder.rb#81 +ActiveSupport::Cache::Coder::PACKED_VERSION_LENGTH_TEMPLATE = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/cache/coder.rb#66 +ActiveSupport::Cache::Coder::SIGNATURE = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/cache/coder.rb#96 +ActiveSupport::Cache::Coder::STRING_DESERIALIZERS = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/cache/coder.rb#70 +ActiveSupport::Cache::Coder::STRING_ENCODINGS = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/cache/coder.rb#86 +class ActiveSupport::Cache::Coder::StringDeserializer + # @return [StringDeserializer] a new instance of StringDeserializer + # + # source://activesupport//lib/active_support/cache/coder.rb#87 + def initialize(encoding); end + + # source://activesupport//lib/active_support/cache/coder.rb#91 + def load(payload); end +end + +# source://activesupport//lib/active_support/cache.rb#47 +ActiveSupport::Cache::DEFAULT_COMPRESS_LIMIT = T.let(T.unsafe(nil), Integer) + +# Raised by coders when the cache entry can't be deserialized. +# This error is treated as a cache miss. +# +# source://activesupport//lib/active_support/cache.rb#51 +class ActiveSupport::Cache::DeserializationError < ::StandardError; end + +# This class is used to represent cache entries. Cache entries have a value, an optional +# expiration time, and an optional version. The expiration time is used to support the :race_condition_ttl option +# on the cache. The version is used to support the :version option on the cache for rejecting +# mismatches. +# +# Since cache entries in most instances will be serialized, the internals of this class are highly optimized +# using short instance variable names that are lazily defined. +# +# source://activesupport//lib/active_support/cache/entry.rb#14 +class ActiveSupport::Cache::Entry + # Creates a new cache entry for the specified value. Options supported are + # +:compressed+, +:version+, +:expires_at+ and +:expires_in+. + # + # @return [Entry] a new instance of Entry + # + # source://activesupport//lib/active_support/cache/entry.rb#25 + def initialize(value, compressed: T.unsafe(nil), version: T.unsafe(nil), expires_in: T.unsafe(nil), expires_at: T.unsafe(nil), **_arg5); end + + # Returns the size of the cached value. This could be less than + # value.bytesize if the data is compressed. + # + # source://activesupport//lib/active_support/cache/entry.rb#61 + def bytesize; end + + # source://activesupport//lib/active_support/cache/entry.rb#76 + def compressed(compress_threshold); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/cache/entry.rb#72 + def compressed?; end + + # Duplicates the value in a class. This is used by cache implementations that don't natively + # serialize entries to protect against accidental cache modifications. + # + # source://activesupport//lib/active_support/cache/entry.rb#106 + def dup_value!; end + + # Checks if the entry is expired. The +expires_in+ parameter can override + # the value set when the entry was created. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/cache/entry.rb#43 + def expired?; end + + # source://activesupport//lib/active_support/cache/entry.rb#47 + def expires_at; end + + # source://activesupport//lib/active_support/cache/entry.rb#51 + def expires_at=(value); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/cache/entry.rb#100 + def local?; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/cache/entry.rb#37 + def mismatched?(version); end + + # source://activesupport//lib/active_support/cache/entry.rb#116 + def pack; end + + # source://activesupport//lib/active_support/cache/entry.rb#33 + def value; end + + # Returns the value of attribute version. + # + # source://activesupport//lib/active_support/cache/entry.rb#21 + def version; end + + private + + # source://activesupport//lib/active_support/cache/entry.rb#127 + def marshal_load(payload); end + + # source://activesupport//lib/active_support/cache/entry.rb#123 + def uncompress(value); end + + class << self + # source://activesupport//lib/active_support/cache/entry.rb#16 + def unpack(members); end + end +end + +# = \File \Cache \Store +# +# A cache store implementation which stores everything on the filesystem. +# +# source://activesupport//lib/active_support/cache/file_store.rb#12 +class ActiveSupport::Cache::FileStore < ::ActiveSupport::Cache::Store + # @return [FileStore] a new instance of FileStore + # + # source://activesupport//lib/active_support/cache/file_store.rb#20 + def initialize(cache_path, **options); end + + # Returns the value of attribute cache_path. + # + # source://activesupport//lib/active_support/cache/file_store.rb#13 + def cache_path; end + + # Preemptively iterates through all stored keys and removes the ones which have expired. + # + # source://activesupport//lib/active_support/cache/file_store.rb#40 + def cleanup(options = T.unsafe(nil)); end + + # Deletes all items from the cache. In this case it deletes all the entries in the specified + # file store directory except for .keep or .gitkeep. Be careful which directory is specified in your + # config file when using +FileStore+ because everything in that directory will be deleted. + # + # source://activesupport//lib/active_support/cache/file_store.rb#33 + def clear(options = T.unsafe(nil)); end + + # Decrement a cached integer value. Returns the updated value. + # + # If the key is unset, it will be set to +-amount+. + # + # cache.decrement("foo") # => -1 + # + # To set a specific value, call #write: + # + # cache.write("baz", 5) + # cache.decrement("baz") # => 4 + # + # source://activesupport//lib/active_support/cache/file_store.rb#80 + def decrement(name, amount = T.unsafe(nil), **options); end + + # source://activesupport//lib/active_support/cache/file_store.rb#89 + def delete_matched(matcher, options = T.unsafe(nil)); end + + # Increment a cached integer value. Returns the updated value. + # + # If the key is unset, it starts from +0+: + # + # cache.increment("foo") # => 1 + # cache.increment("bar", 100) # => 100 + # + # To set a specific value, call #write: + # + # cache.write("baz", 5) + # cache.increment("baz") # => 6 + # + # source://activesupport//lib/active_support/cache/file_store.rb#60 + def increment(name, amount = T.unsafe(nil), **options); end + + # source://activesupport//lib/active_support/cache/file_store.rb#101 + def inspect; end + + private + + # Delete empty directories in the cache. + # + # source://activesupport//lib/active_support/cache/file_store.rb#195 + def delete_empty_directories(dir); end + + # source://activesupport//lib/active_support/cache/file_store.rb#131 + def delete_entry(key, **options); end + + # Make sure a file path's directories exist. + # + # source://activesupport//lib/active_support/cache/file_store.rb#204 + def ensure_cache_path(path); end + + # Translate a file path into a key. + # + # source://activesupport//lib/active_support/cache/file_store.rb#189 + def file_path_key(path); end + + # Lock a file for a block so only one process can modify it at a time. + # + # source://activesupport//lib/active_support/cache/file_store.rb#148 + def lock_file(file_name, &block); end + + # Modifies the amount of an integer value that is stored in the cache. + # If the key is not found it is created and set to +amount+. + # + # source://activesupport//lib/active_support/cache/file_store.rb#222 + def modify_value(name, amount, options); end + + # Translate a key into a file path. + # + # source://activesupport//lib/active_support/cache/file_store.rb#162 + def normalize_key(key, options); end + + # source://activesupport//lib/active_support/cache/file_store.rb#106 + def read_entry(key, **options); end + + # source://activesupport//lib/active_support/cache/file_store.rb#113 + def read_serialized_entry(key, **_arg1); end + + # source://activesupport//lib/active_support/cache/file_store.rb#208 + def search_dir(dir, &callback); end + + # source://activesupport//lib/active_support/cache/file_store.rb#120 + def write_entry(key, entry, **options); end + + # source://activesupport//lib/active_support/cache/file_store.rb#124 + def write_serialized_entry(key, payload, **options); end + + class << self + # Advertise cache versioning support. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/cache/file_store.rb#26 + def supports_cache_versioning?; end + end +end + +# source://activesupport//lib/active_support/cache/file_store.rb#15 +ActiveSupport::Cache::FileStore::DIR_FORMATTER = T.let(T.unsafe(nil), String) + +# max filename size on file system is 255, minus room for timestamp, pid, and random characters appended by Tempfile (used by atomic write) +# +# source://activesupport//lib/active_support/cache/file_store.rb#16 +ActiveSupport::Cache::FileStore::FILENAME_MAX_SIZE = T.let(T.unsafe(nil), Integer) + +# max is 1024, plus some room +# +# source://activesupport//lib/active_support/cache/file_store.rb#17 +ActiveSupport::Cache::FileStore::FILEPATH_MAX_SIZE = T.let(T.unsafe(nil), Integer) + +# source://activesupport//lib/active_support/cache/file_store.rb#18 +ActiveSupport::Cache::FileStore::GITKEEP_FILES = T.let(T.unsafe(nil), Array) + +# = Memory \Cache \Store +# +# A cache store implementation which stores everything into memory in the +# same process. If you're running multiple Ruby on \Rails server processes +# (which is the case if you're using Phusion Passenger or puma clustered mode), +# then this means that \Rails server process instances won't be able +# to share cache data with each other and this may not be the most +# appropriate cache in that scenario. +# +# This cache has a bounded size specified by the +:size+ options to the +# initializer (default is 32Mb). When the cache exceeds the allotted size, +# a cleanup will occur which tries to prune the cache down to three quarters +# of the maximum size by removing the least recently used entries. +# +# Unlike other Cache store implementations, +MemoryStore+ does not compress +# values by default. +MemoryStore+ does not benefit from compression as much +# as other Store implementations, as it does not send data over a network. +# However, when compression is enabled, it still pays the full cost of +# compression in terms of cpu use. +# +# +MemoryStore+ is thread-safe. +# +# source://activesupport//lib/active_support/cache/memory_store.rb#28 +class ActiveSupport::Cache::MemoryStore < ::ActiveSupport::Cache::Store + # @return [MemoryStore] a new instance of MemoryStore + # + # source://activesupport//lib/active_support/cache/memory_store.rb#73 + def initialize(options = T.unsafe(nil)); end + + # Preemptively iterates through all stored keys and removes the ones which have expired. + # + # source://activesupport//lib/active_support/cache/memory_store.rb#101 + def cleanup(options = T.unsafe(nil)); end + + # Delete all data stored in a given cache store. + # + # source://activesupport//lib/active_support/cache/memory_store.rb#93 + def clear(options = T.unsafe(nil)); end + + # Decrement a cached integer value. Returns the updated value. + # + # If the key is unset or has expired, it will be set to +-amount+. + # + # cache.decrement("foo") # => -1 + # + # To set a specific value, call #write: + # + # cache.write("baz", 5) + # cache.decrement("baz") # => 4 + # + # source://activesupport//lib/active_support/cache/memory_store.rb#166 + def decrement(name, amount = T.unsafe(nil), **options); end + + # Deletes cache entries if the cache key matches a given pattern. + # + # source://activesupport//lib/active_support/cache/memory_store.rb#173 + def delete_matched(matcher, options = T.unsafe(nil)); end + + # Increment a cached integer value. Returns the updated value. + # + # If the key is unset, it will be set to +amount+: + # + # cache.increment("foo") # => 1 + # cache.increment("bar", 100) # => 100 + # + # To set a specific value, call #write: + # + # cache.write("baz", 5) + # cache.increment("baz") # => 6 + # + # source://activesupport//lib/active_support/cache/memory_store.rb#149 + def increment(name, amount = T.unsafe(nil), **options); end + + # source://activesupport//lib/active_support/cache/memory_store.rb#185 + def inspect; end + + # To ensure entries fit within the specified memory prune the cache by removing the least + # recently accessed entries. + # + # source://activesupport//lib/active_support/cache/memory_store.rb#114 + def prune(target_size, max_time = T.unsafe(nil)); end + + # Returns true if the cache is currently being pruned. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/cache/memory_store.rb#133 + def pruning?; end + + # Synchronize calls to the cache. This should be called wherever the underlying cache implementation + # is not thread safe. + # + # source://activesupport//lib/active_support/cache/memory_store.rb#191 + def synchronize(&block); end + + private + + # source://activesupport//lib/active_support/cache/memory_store.rb#198 + def cached_size(key, payload); end + + # source://activesupport//lib/active_support/cache/memory_store.rb#231 + def delete_entry(key, **options); end + + # Modifies the amount of an integer value that is stored in the cache. + # If the key is not found it is created and set to +amount+. + # + # source://activesupport//lib/active_support/cache/memory_store.rb#241 + def modify_value(name, amount, **options); end + + # source://activesupport//lib/active_support/cache/memory_store.rb#202 + def read_entry(key, **options); end + + # source://activesupport//lib/active_support/cache/memory_store.rb#214 + def write_entry(key, entry, **options); end + + class << self + # Advertise cache versioning support. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/cache/memory_store.rb#88 + def supports_cache_versioning?; end + end +end + +# source://activesupport//lib/active_support/cache/memory_store.rb#29 +module ActiveSupport::Cache::MemoryStore::DupCoder + extend ::ActiveSupport::Cache::MemoryStore::DupCoder + + # source://activesupport//lib/active_support/cache/memory_store.rb#32 + def dump(entry); end + + # source://activesupport//lib/active_support/cache/memory_store.rb#40 + def dump_compressed(entry, threshold); end + + # source://activesupport//lib/active_support/cache/memory_store.rb#45 + def load(entry); end + + private + + # source://activesupport//lib/active_support/cache/memory_store.rb#56 + def dump_value(value); end + + # source://activesupport//lib/active_support/cache/memory_store.rb#64 + def load_value(string); end +end + +# source://activesupport//lib/active_support/cache/memory_store.rb#54 +ActiveSupport::Cache::MemoryStore::DupCoder::MARSHAL_SIGNATURE = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/cache/memory_store.rb#196 +ActiveSupport::Cache::MemoryStore::PER_ENTRY_OVERHEAD = T.let(T.unsafe(nil), Integer) + +# = Null \Cache \Store +# +# A cache store implementation which doesn't actually store anything. Useful in +# development and test environments where you don't want caching turned on but +# need to go through the caching interface. +# +# This cache does implement the local cache strategy, so values will actually +# be cached inside blocks that utilize this strategy. See +# ActiveSupport::Cache::Strategy::LocalCache for more details. +# +# source://activesupport//lib/active_support/cache/null_store.rb#14 +class ActiveSupport::Cache::NullStore < ::ActiveSupport::Cache::Store + include ::ActiveSupport::Cache::Strategy::LocalCache + + # source://activesupport//lib/active_support/cache/null_store.rb#25 + def cleanup(options = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/cache/null_store.rb#22 + def clear(options = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/cache/null_store.rb#31 + def decrement(name, amount = T.unsafe(nil), **options); end + + # source://activesupport//lib/active_support/cache/null_store.rb#34 + def delete_matched(matcher, options = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/cache/null_store.rb#28 + def increment(name, amount = T.unsafe(nil), **options); end + + # source://activesupport//lib/active_support/cache/null_store.rb#37 + def inspect; end + + private + + # source://activesupport//lib/active_support/cache/null_store.rb#57 + def delete_entry(key, **_arg1); end + + # source://activesupport//lib/active_support/cache/null_store.rb#42 + def read_entry(key, **s); end + + # source://activesupport//lib/active_support/cache/null_store.rb#46 + def read_serialized_entry(key, raw: T.unsafe(nil), **options); end + + # source://activesupport//lib/active_support/cache/null_store.rb#49 + def write_entry(key, entry, **_arg2); end + + # source://activesupport//lib/active_support/cache/null_store.rb#53 + def write_serialized_entry(key, payload, **_arg2); end + + class << self + # Advertise cache versioning support. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/cache/null_store.rb#18 + def supports_cache_versioning?; end + end +end + +# Mapping of canonical option names to aliases that a store will recognize. +# +# source://activesupport//lib/active_support/cache.rb#43 +ActiveSupport::Cache::OPTION_ALIASES = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#8 +module ActiveSupport::Cache::SerializerWithFallback + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#17 + def load(dumped); end + + private + + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#39 + def marshal_load(payload); end + + class << self + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#9 + def [](format); end + end +end + +# source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#66 +module ActiveSupport::Cache::SerializerWithFallback::Marshal70WithFallback + include ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback::Marshal70WithFallback + + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#88 + def _load(marked); end + + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#73 + def dump(entry); end + + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#77 + def dump_compressed(entry, threshold); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#94 + def dumped?(dumped); end +end + +# source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#71 +ActiveSupport::Cache::SerializerWithFallback::Marshal70WithFallback::MARK_COMPRESSED = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#70 +ActiveSupport::Cache::SerializerWithFallback::Marshal70WithFallback::MARK_UNCOMPRESSED = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#99 +module ActiveSupport::Cache::SerializerWithFallback::Marshal71WithFallback + include ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback::Marshal71WithFallback + + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#109 + def _load(dumped); end + + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#105 + def dump(value); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#113 + def dumped?(dumped); end +end + +# source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#103 +ActiveSupport::Cache::SerializerWithFallback::Marshal71WithFallback::MARSHAL_SIGNATURE = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#118 +module ActiveSupport::Cache::SerializerWithFallback::MessagePackWithFallback + include ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback::MessagePackWithFallback + + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#126 + def _load(dumped); end + + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#122 + def dump(value); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#130 + def dumped?(dumped); end + + private + + # @return [Boolean] + # + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#135 + def available?; end +end + +# source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#45 +module ActiveSupport::Cache::SerializerWithFallback::PassthroughWithFallback + include ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback::PassthroughWithFallback + + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#57 + def _load(entry); end + + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#49 + def dump(entry); end + + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#53 + def dump_compressed(entry, threshold); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#61 + def dumped?(dumped); end +end + +# source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#144 +ActiveSupport::Cache::SerializerWithFallback::SERIALIZERS = T.let(T.unsafe(nil), Hash) + +# = Active Support \Cache \Store +# +# An abstract cache store class. There are multiple cache store +# implementations, each having its own additional features. See the classes +# under the ActiveSupport::Cache module, e.g. +# ActiveSupport::Cache::MemCacheStore. MemCacheStore is currently the most +# popular cache store for large production websites. +# +# Some implementations may not support all methods beyond the basic cache +# methods of #fetch, #write, #read, #exist?, and #delete. +# +# +ActiveSupport::Cache::Store+ can store any Ruby object that is supported +# by its +coder+'s +dump+ and +load+ methods. +# +# cache = ActiveSupport::Cache::MemoryStore.new +# +# cache.read('city') # => nil +# cache.write('city', "Duckburgh") # => true +# cache.read('city') # => "Duckburgh" +# +# cache.write('not serializable', Proc.new {}) # => TypeError +# +# Keys are always translated into Strings and are case sensitive. When an +# object is specified as a key and has a +cache_key+ method defined, this +# method will be called to define the key. Otherwise, the +to_param+ +# method will be called. Hashes and Arrays can also be used as keys. The +# elements will be delimited by slashes, and the elements within a Hash +# will be sorted by key so they are consistent. +# +# cache.read('city') == cache.read(:city) # => true +# +# Nil values can be cached. +# +# If your cache is on a shared infrastructure, you can define a namespace +# for your cache entries. If a namespace is defined, it will be prefixed on +# to every key. The namespace can be either a static value or a Proc. If it +# is a Proc, it will be invoked when each key is evaluated so that you can +# use application logic to invalidate keys. +# +# cache.namespace = -> { @last_mod_time } # Set the namespace to a variable +# @last_mod_time = Time.now # Invalidate the entire cache by changing namespace +# +# source://activesupport//lib/active_support/cache.rb#190 +class ActiveSupport::Cache::Store + # Creates a new cache. + # + # ==== Options + # + # [+:namespace+] + # Sets the namespace for the cache. This option is especially useful if + # your application shares a cache with other applications. + # + # [+:serializer+] + # The serializer for cached values. Must respond to +dump+ and +load+. + # + # The default serializer depends on the cache format version (set via + # +config.active_support.cache_format_version+ when using Rails). The + # default serializer for each format version includes a fallback + # mechanism to deserialize values from any format version. This behavior + # makes it easy to migrate between format versions without invalidating + # the entire cache. + # + # You can also specify serializer: :message_pack to use a + # preconfigured serializer based on ActiveSupport::MessagePack. The + # +:message_pack+ serializer includes the same deserialization fallback + # mechanism, allowing easy migration from (or to) the default + # serializer. The +:message_pack+ serializer may improve performance, + # but it requires the +msgpack+ gem. + # + # [+:compressor+] + # The compressor for serialized cache values. Must respond to +deflate+ + # and +inflate+. + # + # The default compressor is +Zlib+. To define a new custom compressor + # that also decompresses old cache entries, you can check compressed + # values for Zlib's "\x78" signature: + # + # module MyCompressor + # def self.deflate(dumped) + # # compression logic... (make sure result does not start with "\x78"!) + # end + # + # def self.inflate(compressed) + # if compressed.start_with?("\x78") + # Zlib.inflate(compressed) + # else + # # decompression logic... + # end + # end + # end + # + # ActiveSupport::Cache.lookup_store(:redis_cache_store, compressor: MyCompressor) + # + # [+:coder+] + # The coder for serializing and (optionally) compressing cache entries. + # Must respond to +dump+ and +load+. + # + # The default coder composes the serializer and compressor, and includes + # some performance optimizations. If you only need to override the + # serializer or compressor, you should specify the +:serializer+ or + # +:compressor+ options instead. + # + # If the store can handle cache entries directly, you may also specify + # coder: nil to omit the serializer, compressor, and coder. For + # example, if you are using ActiveSupport::Cache::MemoryStore and can + # guarantee that cache values will not be mutated, you can specify + # coder: nil to avoid the overhead of safeguarding against + # mutation. + # + # The +:coder+ option is mutually exclusive with the +:serializer+ and + # +:compressor+ options. Specifying them together will raise an + # +ArgumentError+. + # + # Any other specified options are treated as default options for the + # relevant cache operations, such as #read, #write, and #fetch. + # + # @return [Store] a new instance of Store + # + # source://activesupport//lib/active_support/cache.rb#300 + def initialize(options = T.unsafe(nil)); end + + # Cleans up the cache by removing expired entries. + # + # Options are passed to the underlying cache implementation. + # + # Some implementations may not support this method. + # + # @raise [NotImplementedError] + # + # source://activesupport//lib/active_support/cache.rb#785 + def cleanup(options = T.unsafe(nil)); end + + # Clears the entire cache. Be careful with this method since it could + # affect other processes if shared cache is being used. + # + # The options hash is passed to the underlying cache implementation. + # + # Some implementations may not support this method. + # + # @raise [NotImplementedError] + # + # source://activesupport//lib/active_support/cache.rb#795 + def clear(options = T.unsafe(nil)); end + + # Decrements an integer value in the cache. + # + # Options are passed to the underlying cache implementation. + # + # Some implementations may not support this method. + # + # @raise [NotImplementedError] + # + # source://activesupport//lib/active_support/cache.rb#750 + def decrement(name, amount = T.unsafe(nil), options = T.unsafe(nil)); end + + # Deletes an entry in the cache. Returns +true+ if an entry is deleted + # and +false+ otherwise. + # + # Options are passed to the underlying cache implementation. + # + # source://activesupport//lib/active_support/cache.rb#686 + def delete(name, options = T.unsafe(nil)); end + + # Deletes all entries with keys matching the pattern. + # + # Options are passed to the underlying cache implementation. + # + # Some implementations may not support this method. + # + # @raise [NotImplementedError] + # + # source://activesupport//lib/active_support/cache.rb#732 + def delete_matched(matcher, options = T.unsafe(nil)); end + + # Deletes multiple entries in the cache. Returns the number of deleted + # entries. + # + # Options are passed to the underlying cache implementation. + # + # source://activesupport//lib/active_support/cache.rb#699 + def delete_multi(names, options = T.unsafe(nil)); end + + # Returns +true+ if the cache contains an entry for the given key. + # + # Options are passed to the underlying cache implementation. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/cache.rb#713 + def exist?(name, options = T.unsafe(nil)); end + + # Fetches data from the cache, using the given key. If there is data in + # the cache with the given key, then that data is returned. + # + # If there is no such data in the cache (a cache miss), then +nil+ will be + # returned. However, if a block has been passed, that block will be passed + # the key and executed in the event of a cache miss. The return value of the + # block will be written to the cache under the given cache key, and that + # return value will be returned. + # + # cache.write('today', 'Monday') + # cache.fetch('today') # => "Monday" + # + # cache.fetch('city') # => nil + # cache.fetch('city') do + # 'Duckburgh' + # end + # cache.fetch('city') # => "Duckburgh" + # + # ==== Options + # + # Internally, +fetch+ calls +read_entry+, and calls +write_entry+ on a + # cache miss. Thus, +fetch+ supports the same options as #read and #write. + # Additionally, +fetch+ supports the following options: + # + # * force: true - Forces a cache "miss," meaning we treat the + # cache value as missing even if it's present. Passing a block is + # required when +force+ is true so this always results in a cache write. + # + # cache.write('today', 'Monday') + # cache.fetch('today', force: true) { 'Tuesday' } # => 'Tuesday' + # cache.fetch('today', force: true) # => ArgumentError + # + # The +:force+ option is useful when you're calling some other method to + # ask whether you should force a cache write. Otherwise, it's clearer to + # just call +write+. + # + # * skip_nil: true - Prevents caching a nil result: + # + # cache.fetch('foo') { nil } + # cache.fetch('bar', skip_nil: true) { nil } + # cache.exist?('foo') # => true + # cache.exist?('bar') # => false + # + # * +:race_condition_ttl+ - Specifies the number of seconds during which + # an expired value can be reused while a new value is being generated. + # This can be used to prevent race conditions when cache entries expire, + # by preventing multiple processes from simultaneously regenerating the + # same entry (also known as the dog pile effect). + # + # When a process encounters a cache entry that has expired less than + # +:race_condition_ttl+ seconds ago, it will bump the expiration time by + # +:race_condition_ttl+ seconds before generating a new value. During + # this extended time window, while the process generates a new value, + # other processes will continue to use the old value. After the first + # process writes the new value, other processes will then use it. + # + # If the first process errors out while generating a new value, another + # process can try to generate a new value after the extended time window + # has elapsed. + # + # # Set all values to expire after one second. + # cache = ActiveSupport::Cache::MemoryStore.new(expires_in: 1) + # + # cache.write("foo", "original value") + # val_1 = nil + # val_2 = nil + # p cache.read("foo") # => "original value" + # + # sleep 1 # wait until the cache expires + # + # t1 = Thread.new do + # # fetch does the following: + # # 1. gets an recent expired entry + # # 2. extends the expiry by 2 seconds (race_condition_ttl) + # # 3. regenerates the new value + # val_1 = cache.fetch("foo", race_condition_ttl: 2) do + # sleep 1 + # "new value 1" + # end + # end + # + # # Wait until t1 extends the expiry of the entry + # # but before generating the new value + # sleep 0.1 + # + # val_2 = cache.fetch("foo", race_condition_ttl: 2) do + # # This block won't be executed because t1 extended the expiry + # "new value 2" + # end + # + # t1.join + # + # p val_1 # => "new value 1" + # p val_2 # => "original value" + # p cache.fetch("foo") # => "new value 1" + # + # # The entry requires 3 seconds to expire (expires_in + race_condition_ttl) + # # We have waited 2 seconds already (sleep(1) + t1.join) thus we need to wait 1 + # # more second to see the entry expire. + # sleep 1 + # + # p cache.fetch("foo") # => nil + # + # ==== Dynamic Options + # + # In some cases it may be necessary to dynamically compute options based + # on the cached value. To support this, an ActiveSupport::Cache::WriteOptions + # instance is passed as the second argument to the block. For example: + # + # cache.fetch("authentication-token:#{user.id}") do |key, options| + # token = authenticate_to_service + # options.expires_at = token.expires_at + # token + # end + # + # source://activesupport//lib/active_support/cache.rb#452 + def fetch(name, options = T.unsafe(nil), &block); end + + # Fetches data from the cache, using the given keys. If there is data in + # the cache with the given keys, then that data is returned. Otherwise, + # the supplied block is called for each key for which there was no data, + # and the result will be written to the cache and returned. + # Therefore, you need to pass a block that returns the data to be written + # to the cache. If you do not want to write the cache when the cache is + # not found, use #read_multi. + # + # Returns a hash with the data for each of the names. For example: + # + # cache.write("bim", "bam") + # cache.fetch_multi("bim", "unknown_key") do |key| + # "Fallback value for key: #{key}" + # end + # # => { "bim" => "bam", + # # "unknown_key" => "Fallback value for key: unknown_key" } + # + # You may also specify additional options via the +options+ argument. See #fetch for details. + # Other options are passed to the underlying cache implementation. For example: + # + # cache.fetch_multi("fizz", expires_in: 5.seconds) do |key| + # "buzz" + # end + # # => {"fizz"=>"buzz"} + # cache.read("fizz") + # # => "buzz" + # sleep(6) + # cache.read("fizz") + # # => nil + # + # @raise [ArgumentError] + # + # source://activesupport//lib/active_support/cache.rb#603 + def fetch_multi(*names); end + + # Increments an integer value in the cache. + # + # Options are passed to the underlying cache implementation. + # + # Some implementations may not support this method. + # + # @raise [NotImplementedError] + # + # source://activesupport//lib/active_support/cache.rb#741 + def increment(name, amount = T.unsafe(nil), options = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/cache.rb#197 + def logger; end + + # source://activesupport//lib/active_support/cache.rb#197 + def logger=(val); end + + # Silences the logger within a block. + # + # source://activesupport//lib/active_support/cache.rb#330 + def mute; end + + # Get the current namespace + # + # source://activesupport//lib/active_support/cache.rb#800 + def namespace; end + + # Set the current namespace. Note, this will be ignored if custom + # options are passed to cache wills with a namespace key. + # + # source://activesupport//lib/active_support/cache.rb#806 + def namespace=(namespace); end + + # source://activesupport//lib/active_support/cache.rb#723 + def new_entry(value, options = T.unsafe(nil)); end + + # Returns the value of attribute options. + # + # source://activesupport//lib/active_support/cache.rb#200 + def options; end + + # source://activesupport//lib/active_support/cache.rb#198 + def raise_on_invalid_cache_expiration_time; end + + # source://activesupport//lib/active_support/cache.rb#198 + def raise_on_invalid_cache_expiration_time=(val); end + + # Reads data from the cache, using the given key. If there is data in + # the cache with the given key, then that data is returned. Otherwise, + # +nil+ is returned. + # + # Note, if data was written with the :expires_in or + # :version options, both of these conditions are applied before + # the data is returned. + # + # ==== Options + # + # * +:namespace+ - Replace the store namespace for this call. + # * +:version+ - Specifies a version for the cache entry. If the cached + # version does not match the requested version, the read will be treated + # as a cache miss. This feature is used to support recyclable cache keys. + # + # Other options will be handled by the specific cache store implementation. + # + # source://activesupport//lib/active_support/cache.rb#506 + def read(name, options = T.unsafe(nil)); end + + # Reads a counter that was set by #increment / #decrement. + # + # cache.write_counter("foo", 1) + # cache.read_counter("foo") # => 1 + # cache.increment("foo") + # cache.read_counter("foo") # => 2 + # + # Options are passed to the underlying cache implementation. + # + # source://activesupport//lib/active_support/cache.rb#762 + def read_counter(name, **options); end + + # Reads multiple values at once from the cache. Options can be passed + # in the last argument. + # + # Some cache implementation may optimize this method. + # + # Returns a hash mapping the names provided to the values found. + # + # source://activesupport//lib/active_support/cache.rb#544 + def read_multi(*names); end + + # Returns the value of attribute silence. + # + # source://activesupport//lib/active_support/cache.rb#200 + def silence; end + + # Silences the logger. + # + # source://activesupport//lib/active_support/cache.rb#324 + def silence!; end + + # Returns the value of attribute silence. + # + # source://activesupport//lib/active_support/cache.rb#201 + def silence?; end + + # Writes the value to the cache with the key. The value must be supported + # by the +coder+'s +dump+ and +load+ methods. + # + # Returns +true+ if the write succeeded, +nil+ if there was an error talking + # to the cache backend, or +false+ if the write failed for another reason. + # + # By default, cache entries larger than 1kB are compressed. Compression + # allows more data to be stored in the same memory footprint, leading to + # fewer cache evictions and higher hit rates. + # + # ==== Options + # + # * compress: false - Disables compression of the cache entry. + # + # * +:compress_threshold+ - The compression threshold, specified in bytes. + # \Cache entries larger than this threshold will be compressed. Defaults + # to +1.kilobyte+. + # + # * +:expires_in+ - Sets a relative expiration time for the cache entry, + # specified in seconds. +:expire_in+ and +:expired_in+ are aliases for + # +:expires_in+. + # + # cache = ActiveSupport::Cache::MemoryStore.new(expires_in: 5.minutes) + # cache.write(key, value, expires_in: 1.minute) # Set a lower value for one entry + # + # * +:expires_at+ - Sets an absolute expiration time for the cache entry. + # + # cache = ActiveSupport::Cache::MemoryStore.new + # cache.write(key, value, expires_at: Time.now.at_end_of_hour) + # + # * +:version+ - Specifies a version for the cache entry. When reading + # from the cache, if the cached version does not match the requested + # version, the read will be treated as a cache miss. This feature is + # used to support recyclable cache keys. + # + # * +:unless_exist+ - Prevents overwriting an existing cache entry. + # + # Other options will be handled by the specific cache store implementation. + # + # source://activesupport//lib/active_support/cache.rb#672 + def write(name, value, options = T.unsafe(nil)); end + + # Writes a counter that can then be modified by #increment / #decrement. + # + # cache.write_counter("foo", 1) + # cache.read_counter("foo") # => 1 + # cache.increment("foo") + # cache.read_counter("foo") # => 2 + # + # Options are passed to the underlying cache implementation. + # + # source://activesupport//lib/active_support/cache.rb#775 + def write_counter(name, value, **options); end + + # Cache Storage API to write multiple values at once. + # + # source://activesupport//lib/active_support/cache.rb#559 + def write_multi(hash, options = T.unsafe(nil)); end + + private + + # source://activesupport//lib/active_support/cache.rb#1074 + def _instrument(operation, multi: T.unsafe(nil), options: T.unsafe(nil), **payload, &block); end + + # source://activesupport//lib/active_support/cache.rb#811 + def default_serializer; end + + # Deletes an entry from the cache implementation. Subclasses must + # implement this method. + # + # @raise [NotImplementedError] + # + # source://activesupport//lib/active_support/cache.rb#897 + def delete_entry(key, **options); end + + # Deletes multiples entries in the cache implementation. Subclasses MAY + # implement this method. + # + # source://activesupport//lib/active_support/cache.rb#903 + def delete_multi_entries(entries, **options); end + + # source://activesupport//lib/active_support/cache.rb#862 + def deserialize_entry(payload, **_arg1); end + + # @raise [ArgumentError] + # + # source://activesupport//lib/active_support/cache.rb#984 + def expand_and_namespace_key(key, options = T.unsafe(nil)); end + + # Expands key to be a consistent string value. Invokes +cache_key+ if + # object responds to +cache_key+. Otherwise, +to_param+ method will be + # called. If the key is a Hash, then keys will be sorted alphabetically. + # + # source://activesupport//lib/active_support/cache.rb#1037 + def expanded_key(key); end + + # source://activesupport//lib/active_support/cache.rb#1058 + def expanded_version(key); end + + # source://activesupport//lib/active_support/cache.rb#1111 + def get_entry_value(entry, name, options); end + + # source://activesupport//lib/active_support/cache.rb#1095 + def handle_expired_entry(entry, key, options); end + + # source://activesupport//lib/active_support/cache.rb#937 + def handle_invalid_expires_in(message); end + + # source://activesupport//lib/active_support/cache.rb#1066 + def instrument(operation, key, options = T.unsafe(nil), &block); end + + # source://activesupport//lib/active_support/cache.rb#1070 + def instrument_multi(operation, keys, options = T.unsafe(nil), &block); end + + # Adds the namespace defined in the options to a pattern designed to + # match keys. Implementations that support delete_matched should call + # this method to translate a pattern that matches names into one that + # matches namespaced keys. + # + # source://activesupport//lib/active_support/cache.rb#826 + def key_matcher(pattern, options); end + + # Merges the default options with ones specific to a method call. + # + # source://activesupport//lib/active_support/cache.rb#908 + def merged_options(call_options); end + + # Prefix the key with a namespace string: + # + # namespace_key 'foo', namespace: 'cache' + # # => 'cache:foo' + # + # With a namespace block: + # + # namespace_key 'foo', namespace: -> { 'cache' } + # # => 'cache:foo' + # + # source://activesupport//lib/active_support/cache.rb#1012 + def namespace_key(key, call_options = T.unsafe(nil)); end + + # Expands, namespaces and truncates the cache key. + # Raises an exception when the key is +nil+ or an empty string. + # May be overridden by cache stores to do additional normalization. + # + # source://activesupport//lib/active_support/cache.rb#979 + def normalize_key(key, options = T.unsafe(nil)); end + + # Normalize aliased options to their canonical form + # + # source://activesupport//lib/active_support/cache.rb#948 + def normalize_options(options); end + + # source://activesupport//lib/active_support/cache.rb#1054 + def normalize_version(key, options = T.unsafe(nil)); end + + # Reads an entry from the cache implementation. Subclasses must implement + # this method. + # + # @raise [NotImplementedError] + # + # source://activesupport//lib/active_support/cache.rb#843 + def read_entry(key, **options); end + + # Reads multiple entries from the cache implementation. Subclasses MAY + # implement this method. + # + # source://activesupport//lib/active_support/cache.rb#870 + def read_multi_entries(names, **options); end + + # source://activesupport//lib/active_support/cache.rb#1116 + def save_block_result_to_cache(name, key, options); end + + # source://activesupport//lib/active_support/cache.rb#853 + def serialize_entry(entry, **options); end + + # source://activesupport//lib/active_support/cache.rb#991 + def truncate_key(key); end + + # source://activesupport//lib/active_support/cache.rb#959 + def validate_options(options); end + + # Writes an entry to the cache implementation. Subclasses must implement + # this method. + # + # @raise [NotImplementedError] + # + # source://activesupport//lib/active_support/cache.rb#849 + def write_entry(key, entry, **options); end + + # Writes multiple entries to the cache implementation. Subclasses MAY + # implement this method. + # + # source://activesupport//lib/active_support/cache.rb#889 + def write_multi_entries(hash, **options); end + + class << self + # source://activesupport//lib/active_support/cache.rb#197 + def logger; end + + # source://activesupport//lib/active_support/cache.rb#197 + def logger=(val); end + + # source://activesupport//lib/active_support/cache.rb#198 + def raise_on_invalid_cache_expiration_time; end + + # source://activesupport//lib/active_support/cache.rb#198 + def raise_on_invalid_cache_expiration_time=(val); end + + private + + # source://activesupport//lib/active_support/cache.rb#205 + def retrieve_pool_options(options); end + end +end + +# Default +ConnectionPool+ options +# +# source://activesupport//lib/active_support/cache.rb#192 +ActiveSupport::Cache::Store::DEFAULT_POOL_OPTIONS = T.let(T.unsafe(nil), Hash) + +# Keys are truncated with the Active Support digest if they exceed the limit. +# +# source://activesupport//lib/active_support/cache.rb#195 +ActiveSupport::Cache::Store::MAX_KEY_SIZE = T.let(T.unsafe(nil), Integer) + +# source://activesupport//lib/active_support/cache.rb#53 +module ActiveSupport::Cache::Strategy; end + +# = Local \Cache \Strategy +# +# Caches that implement LocalCache will be backed by an in-memory cache for the +# duration of a block. Repeated calls to the cache for the same key will hit the +# in-memory cache for faster access. +# +# source://activesupport//lib/active_support/cache/strategy/local_cache.rb#13 +module ActiveSupport::Cache::Strategy::LocalCache + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#98 + def cleanup(options = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#92 + def clear(options = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#117 + def decrement(name, amount = T.unsafe(nil), **options); end + + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#104 + def delete_matched(matcher, options = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#124 + def fetch_multi(*names, &block); end + + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#110 + def increment(name, amount = T.unsafe(nil), **options); end + + # The current local cache. + # + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#82 + def local_cache; end + + # Middleware class can be inserted as a Rack handler to be local cache for the + # duration of request. + # + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#88 + def middleware; end + + # Set a new local cache. + # + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#72 + def new_local_cache; end + + # Unset the current local cache. + # + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#77 + def unset_local_cache; end + + # Use a local cache for the duration of block. + # + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#67 + def with_local_cache(&block); end + + private + + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#230 + def bypass_local_cache(&block); end + + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#211 + def delete_entry(key, **_arg1); end + + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#226 + def local_cache_key; end + + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#173 + def read_multi_entries(names, **options); end + + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#159 + def read_serialized_entry(key, raw: T.unsafe(nil), **options); end + + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#234 + def use_temporary_local_cache(temporary_cache); end + + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#216 + def write_cache_value(name, value, **options); end + + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#202 + def write_serialized_entry(key, payload, **_arg2); end +end + +# Class for storing and registering the local caches. +# +# source://activesupport//lib/active_support/cache/strategy/local_cache.rb#17 +module ActiveSupport::Cache::Strategy::LocalCache::LocalCacheRegistry + extend ::ActiveSupport::Cache::Strategy::LocalCache::LocalCacheRegistry + + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#20 + def cache_for(local_cache_key); end + + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#25 + def set_cache_for(local_cache_key, value); end +end + +# = Local \Cache \Store +# +# Simple memory backed cache. This cache is not thread safe and is intended only +# for serving as a temporary memory cache for a single thread. +# +# source://activesupport//lib/active_support/cache/strategy/local_cache.rb#35 +class ActiveSupport::Cache::Strategy::LocalCache::LocalStore + # @return [LocalStore] a new instance of LocalStore + # + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#36 + def initialize; end + + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#40 + def clear(options = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#57 + def delete_entry(key); end + + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#61 + def fetch_entry(key); end + + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#44 + def read_entry(key); end + + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#48 + def read_multi_entries(keys); end + + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#52 + def write_entry(key, entry); end +end + +# -- +# This class wraps up local storage for middlewares. Only the middleware method should +# construct them. +# +# source://activesupport//lib/active_support/cache/strategy/local_cache_middleware.rb#13 +class ActiveSupport::Cache::Strategy::LocalCache::Middleware + # @return [Middleware] a new instance of Middleware + # + # source://activesupport//lib/active_support/cache/strategy/local_cache_middleware.rb#17 + def initialize(name, cache); end + + # Returns the value of attribute cache. + # + # source://activesupport//lib/active_support/cache/strategy/local_cache_middleware.rb#15 + def cache; end + + # Sets the attribute cache + # + # @param value the value to set the attribute cache to. + # + # source://activesupport//lib/active_support/cache/strategy/local_cache_middleware.rb#15 + def cache=(_arg0); end + + # source://activesupport//lib/active_support/cache/strategy/local_cache_middleware.rb#28 + def call(env); end + + # source://activesupport//lib/active_support/cache/strategy/local_cache_middleware.rb#14 + def name; end + + # source://activesupport//lib/active_support/cache/strategy/local_cache_middleware.rb#23 + def new(app); end +end + +# These options mean something to all cache implementations. Individual cache +# implementations may support additional options. +# +# source://activesupport//lib/active_support/cache.rb#26 +ActiveSupport::Cache::UNIVERSAL_OPTIONS = T.let(T.unsafe(nil), Array) + +# Enables the dynamic configuration of Cache entry options while ensuring +# that conflicting options are not both set. When a block is given to +# ActiveSupport::Cache::Store#fetch, the second argument will be an +# instance of +WriteOptions+. +# +# source://activesupport//lib/active_support/cache.rb#1132 +class ActiveSupport::Cache::WriteOptions + # @return [WriteOptions] a new instance of WriteOptions + # + # source://activesupport//lib/active_support/cache.rb#1133 + def initialize(options); end + + # source://activesupport//lib/active_support/cache.rb#1157 + def expires_at; end + + # Sets the Cache entry's +expires_at+ value. If an +expires_in+ option was + # previously set, this will unset it since +expires_at+ and +expires_in+ + # cannot both be set. + # + # source://activesupport//lib/active_support/cache.rb#1164 + def expires_at=(expires_at); end + + # source://activesupport//lib/active_support/cache.rb#1145 + def expires_in; end + + # Sets the Cache entry's +expires_in+ value. If an +expires_at+ option was + # previously set, this will unset it since +expires_in+ and +expires_at+ + # cannot both be set. + # + # source://activesupport//lib/active_support/cache.rb#1152 + def expires_in=(expires_in); end + + # source://activesupport//lib/active_support/cache.rb#1137 + def version; end + + # source://activesupport//lib/active_support/cache.rb#1141 + def version=(version); end +end + +# = Caching Key Generator +# +# CachingKeyGenerator is a wrapper around KeyGenerator which allows users to avoid +# re-executing the key generation process when it's called using the same +salt+ and +# +key_size+. +# +# source://activesupport//lib/active_support/key_generator.rb#55 +class ActiveSupport::CachingKeyGenerator + # @return [CachingKeyGenerator] a new instance of CachingKeyGenerator + # + # source://activesupport//lib/active_support/key_generator.rb#56 + def initialize(key_generator); end + + # Returns a derived key suitable for use. + # + # source://activesupport//lib/active_support/key_generator.rb#62 + def generate_key(*args); end +end + +# = Active Support \Callbacks +# +# \Callbacks are code hooks that are run at key points in an object's life cycle. +# The typical use case is to have a base class define a set of callbacks +# relevant to the other functionality it supplies, so that subclasses can +# install callbacks that enhance or modify the base functionality without +# needing to override or redefine methods of the base class. +# +# Mixing in this module allows you to define the events in the object's +# life cycle that will support callbacks (via ClassMethods#define_callbacks), +# set the instance methods, procs, or callback objects to be called (via +# ClassMethods#set_callback), and run the installed callbacks at the +# appropriate times (via +run_callbacks+). +# +# By default callbacks are halted by throwing +:abort+. +# See ClassMethods#define_callbacks for details. +# +# Three kinds of callbacks are supported: before callbacks, run before a +# certain event; after callbacks, run after the event; and around callbacks, +# blocks that surround the event, triggering it when they yield. Callback code +# can be contained in instance methods, procs or lambdas, or callback objects +# that respond to certain predetermined methods. See ClassMethods#set_callback +# for details. +# +# class Record +# include ActiveSupport::Callbacks +# define_callbacks :save +# +# def save +# run_callbacks :save do +# puts "- save" +# end +# end +# end +# +# class PersonRecord < Record +# set_callback :save, :before, :saving_message +# def saving_message +# puts "saving..." +# end +# +# set_callback :save, :after do |object| +# puts "saved" +# end +# end +# +# person = PersonRecord.new +# person.save +# +# Output: +# saving... +# - save +# saved +# +# source://activesupport//lib/active_support/callbacks.rb#65 +module ActiveSupport::Callbacks + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods + mixes_in_class_methods ::ActiveSupport::DescendantsTracker + + # Runs the callbacks for the given event. + # + # Calls the before and around callbacks in the order they were set, yields + # the block (if given one), and then runs the after callbacks in reverse + # order. + # + # If the callback chain was halted, returns +false+. Otherwise returns the + # result of the block, +nil+ if no callbacks have been set, or +true+ + # if callbacks have been set but no block is given. + # + # run_callbacks :save do + # save + # end + # + # -- + # + # As this method is used in many places, and often wraps large portions of + # user code, it has an additional design goal of minimizing its impact on + # the visible call stack. An exception from inside a :before or :after + # callback can be as noisy as it likes -- but when control has passed + # smoothly through and into the supplied block, we want as little evidence + # as possible that we were here. + # + # source://activesupport//lib/active_support/callbacks.rb#97 + def run_callbacks(kind, type = T.unsafe(nil)); end + + private + + # A hook invoked every time a before callback is halted. + # This can be overridden in ActiveSupport::Callbacks implementors in order + # to provide better debugging/logging. + # + # source://activesupport//lib/active_support/callbacks.rb#150 + def halted_callback_hook(filter, name); end + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + end + + module GeneratedInstanceMethods + def __callbacks; end + end +end + +# source://activesupport//lib/active_support/callbacks.rb#73 +ActiveSupport::Callbacks::CALLBACK_FILTER_TYPES = T.let(T.unsafe(nil), Array) + +# A future invocation of user-supplied code (either as a callback, +# or a condition filter). +# +# source://activesupport//lib/active_support/callbacks.rb#337 +module ActiveSupport::Callbacks::CallTemplate + class << self + # Filters support: + # + # Symbols:: A method to call. + # Procs:: A proc to call with the object. + # Objects:: An object with a before_foo method on it to call. + # + # All of these objects are converted into a CallTemplate and handled + # the same after this point. + # + # source://activesupport//lib/active_support/callbacks.rb#495 + def build(filter, callback); end + end +end + +# source://activesupport//lib/active_support/callbacks.rb#396 +class ActiveSupport::Callbacks::CallTemplate::InstanceExec0 + # @return [InstanceExec0] a new instance of InstanceExec0 + # + # source://activesupport//lib/active_support/callbacks.rb#397 + def initialize(block); end + + # source://activesupport//lib/active_support/callbacks.rb#401 + def expand(target, value, block); end + + # source://activesupport//lib/active_support/callbacks.rb#411 + def inverted_lambda; end + + # source://activesupport//lib/active_support/callbacks.rb#405 + def make_lambda; end +end + +# source://activesupport//lib/active_support/callbacks.rb#418 +class ActiveSupport::Callbacks::CallTemplate::InstanceExec1 + # @return [InstanceExec1] a new instance of InstanceExec1 + # + # source://activesupport//lib/active_support/callbacks.rb#419 + def initialize(block); end + + # source://activesupport//lib/active_support/callbacks.rb#423 + def expand(target, value, block); end + + # source://activesupport//lib/active_support/callbacks.rb#433 + def inverted_lambda; end + + # source://activesupport//lib/active_support/callbacks.rb#427 + def make_lambda; end +end + +# source://activesupport//lib/active_support/callbacks.rb#440 +class ActiveSupport::Callbacks::CallTemplate::InstanceExec2 + # @return [InstanceExec2] a new instance of InstanceExec2 + # + # source://activesupport//lib/active_support/callbacks.rb#441 + def initialize(block); end + + # @raise [ArgumentError] + # + # source://activesupport//lib/active_support/callbacks.rb#445 + def expand(target, value, block); end + + # source://activesupport//lib/active_support/callbacks.rb#457 + def inverted_lambda; end + + # source://activesupport//lib/active_support/callbacks.rb#450 + def make_lambda; end +end + +# source://activesupport//lib/active_support/callbacks.rb#338 +class ActiveSupport::Callbacks::CallTemplate::MethodCall + # @return [MethodCall] a new instance of MethodCall + # + # source://activesupport//lib/active_support/callbacks.rb#339 + def initialize(method); end + + # Return the parts needed to make this call, with the given + # input values. + # + # Returns an array of the form: + # + # [target, block, method, *arguments] + # + # This array can be used as such: + # + # target.send(method, *arguments, &block) + # + # The actual invocation is left up to the caller to minimize + # call stack pollution. + # + # source://activesupport//lib/active_support/callbacks.rb#356 + def expand(target, value, block); end + + # source://activesupport//lib/active_support/callbacks.rb#366 + def inverted_lambda; end + + # source://activesupport//lib/active_support/callbacks.rb#360 + def make_lambda; end +end + +# source://activesupport//lib/active_support/callbacks.rb#373 +class ActiveSupport::Callbacks::CallTemplate::ObjectCall + # @return [ObjectCall] a new instance of ObjectCall + # + # source://activesupport//lib/active_support/callbacks.rb#374 + def initialize(target, method); end + + # source://activesupport//lib/active_support/callbacks.rb#379 + def expand(target, value, block); end + + # source://activesupport//lib/active_support/callbacks.rb#389 + def inverted_lambda; end + + # source://activesupport//lib/active_support/callbacks.rb#383 + def make_lambda; end +end + +# source://activesupport//lib/active_support/callbacks.rb#465 +class ActiveSupport::Callbacks::CallTemplate::ProcCall + # @return [ProcCall] a new instance of ProcCall + # + # source://activesupport//lib/active_support/callbacks.rb#466 + def initialize(target); end + + # source://activesupport//lib/active_support/callbacks.rb#470 + def expand(target, value, block); end + + # source://activesupport//lib/active_support/callbacks.rb#480 + def inverted_lambda; end + + # source://activesupport//lib/active_support/callbacks.rb#474 + def make_lambda; end +end + +# source://activesupport//lib/active_support/callbacks.rb#231 +class ActiveSupport::Callbacks::Callback + # @return [Callback] a new instance of Callback + # + # source://activesupport//lib/active_support/callbacks.rb#246 + def initialize(name, filter, kind, options, chain_config); end + + # Wraps code with filter + # + # source://activesupport//lib/active_support/callbacks.rb#300 + def apply(callback_sequence); end + + # Returns the value of attribute chain_config. + # + # source://activesupport//lib/active_support/callbacks.rb#244 + def chain_config; end + + # source://activesupport//lib/active_support/callbacks.rb#282 + def compiled; end + + # source://activesupport//lib/active_support/callbacks.rb#304 + def current_scopes; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/callbacks.rb#273 + def duplicates?(other); end + + # Returns the value of attribute filter. + # + # source://activesupport//lib/active_support/callbacks.rb#244 + def filter; end + + # Returns the value of attribute kind. + # + # source://activesupport//lib/active_support/callbacks.rb#243 + def kind; end + + # Sets the attribute kind + # + # @param value the value to set the attribute kind to. + # + # source://activesupport//lib/active_support/callbacks.rb#243 + def kind=(_arg0); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/callbacks.rb#269 + def matches?(_kind, _filter); end + + # source://activesupport//lib/active_support/callbacks.rb#257 + def merge_conditional_options(chain, if_option:, unless_option:); end + + # Returns the value of attribute name. + # + # source://activesupport//lib/active_support/callbacks.rb#243 + def name; end + + # Sets the attribute name + # + # @param value the value to set the attribute name to. + # + # source://activesupport//lib/active_support/callbacks.rb#243 + def name=(_arg0); end + + private + + # source://activesupport//lib/active_support/callbacks.rb#312 + def check_conditionals(conditionals); end + + # source://activesupport//lib/active_support/callbacks.rb#327 + def conditions_lambdas; end + + class << self + # source://activesupport//lib/active_support/callbacks.rb#232 + def build(chain, filter, kind, options); end + end +end + +# source://activesupport//lib/active_support/callbacks.rb#309 +ActiveSupport::Callbacks::Callback::EMPTY_ARRAY = T.let(T.unsafe(nil), Array) + +# source://activesupport//lib/active_support/callbacks.rb#568 +class ActiveSupport::Callbacks::CallbackChain + include ::Enumerable + + # @return [CallbackChain] a new instance of CallbackChain + # + # source://activesupport//lib/active_support/callbacks.rb#573 + def initialize(name, config); end + + # source://activesupport//lib/active_support/callbacks.rb#633 + def append(*callbacks); end + + # source://activesupport//lib/active_support/callbacks.rb#601 + def clear; end + + # source://activesupport//lib/active_support/callbacks.rb#615 + def compile(type); end + + # Returns the value of attribute config. + # + # source://activesupport//lib/active_support/callbacks.rb#571 + def config; end + + # source://activesupport//lib/active_support/callbacks.rb#595 + def delete(o); end + + # source://activesupport//lib/active_support/callbacks.rb#585 + def each(&block); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/callbacks.rb#587 + def empty?; end + + # source://activesupport//lib/active_support/callbacks.rb#586 + def index(o); end + + # source://activesupport//lib/active_support/callbacks.rb#589 + def insert(index, o); end + + # Returns the value of attribute name. + # + # source://activesupport//lib/active_support/callbacks.rb#571 + def name; end + + # source://activesupport//lib/active_support/callbacks.rb#637 + def prepend(*callbacks); end + + protected + + # Returns the value of attribute chain. + # + # source://activesupport//lib/active_support/callbacks.rb#642 + def chain; end + + private + + # source://activesupport//lib/active_support/callbacks.rb#645 + def append_one(callback); end + + # source://activesupport//lib/active_support/callbacks.rb#608 + def initialize_copy(other); end + + # source://activesupport//lib/active_support/callbacks.rb#652 + def prepend_one(callback); end + + # source://activesupport//lib/active_support/callbacks.rb#659 + def remove_duplicates(callback); end +end + +# source://activesupport//lib/active_support/callbacks.rb#675 +ActiveSupport::Callbacks::CallbackChain::DEFAULT_TERMINATOR = T.let(T.unsafe(nil), ActiveSupport::Callbacks::CallbackChain::DefaultTerminator) + +# source://activesupport//lib/active_support/callbacks.rb#665 +class ActiveSupport::Callbacks::CallbackChain::DefaultTerminator + # source://activesupport//lib/active_support/callbacks.rb#666 + def call(target, result_lambda); end +end + +# Execute before and after filters in a sequence instead of +# chaining them with nested lambda calls, see: +# https://github.com/rails/rails/issues/18011 +# +# source://activesupport//lib/active_support/callbacks.rb#519 +class ActiveSupport::Callbacks::CallbackSequence + # @return [CallbackSequence] a new instance of CallbackSequence + # + # source://activesupport//lib/active_support/callbacks.rb#520 + def initialize(nested = T.unsafe(nil), call_template = T.unsafe(nil), user_conditions = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/callbacks.rb#535 + def after(after); end + + # source://activesupport//lib/active_support/callbacks.rb#541 + def around(call_template, user_conditions); end + + # source://activesupport//lib/active_support/callbacks.rb#529 + def before(before); end + + # source://activesupport//lib/active_support/callbacks.rb#555 + def expand_call_template(arg, block); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/callbacks.rb#551 + def final?; end + + # source://activesupport//lib/active_support/callbacks.rb#563 + def invoke_after(arg); end + + # source://activesupport//lib/active_support/callbacks.rb#559 + def invoke_before(arg); end + + # Returns the value of attribute nested. + # + # source://activesupport//lib/active_support/callbacks.rb#549 + def nested; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/callbacks.rb#545 + def skip?(arg); end +end + +# source://activesupport//lib/active_support/callbacks.rb#678 +module ActiveSupport::Callbacks::ClassMethods + # This is used internally to append, prepend and skip callbacks to the + # CallbackChain. + # + # source://activesupport//lib/active_support/callbacks.rb#688 + def __update_callbacks(name); end + + # Define sets of events in the object life cycle that support callbacks. + # + # define_callbacks :validate + # define_callbacks :initialize, :save, :destroy + # + # ===== Options + # + # * :terminator - Determines when a before filter will halt the + # callback chain, preventing following before and around callbacks from + # being called and the event from being triggered. + # This should be a lambda to be executed. + # The current object and the result lambda of the callback will be provided + # to the terminator lambda. + # + # define_callbacks :validate, terminator: ->(target, result_lambda) { result_lambda.call == false } + # + # In this example, if any before validate callbacks returns +false+, + # any successive before and around callback is not executed. + # + # The default terminator halts the chain when a callback throws +:abort+. + # + # * :skip_after_callbacks_if_terminated - Determines if after + # callbacks should be terminated by the :terminator option. By + # default after callbacks are executed no matter if callback chain was + # terminated or not. This option has no effect if :terminator + # option is set to +nil+. + # + # * :scope - Indicates which methods should be executed when an + # object is used as a callback. + # + # class Audit + # def before(caller) + # puts 'Audit: before is called' + # end + # + # def before_save(caller) + # puts 'Audit: before_save is called' + # end + # end + # + # class Account + # include ActiveSupport::Callbacks + # + # define_callbacks :save + # set_callback :save, :before, Audit.new + # + # def save + # run_callbacks :save do + # puts 'save in main' + # end + # end + # end + # + # In the above case whenever you save an account the method + # Audit#before will be called. On the other hand + # + # define_callbacks :save, scope: [:kind, :name] + # + # would trigger Audit#before_save instead. That's constructed + # by calling #{kind}_#{name} on the given instance. In this + # case "kind" is "before" and "name" is "save". In this context +:kind+ + # and +:name+ have special meanings: +:kind+ refers to the kind of + # callback (before/after/around) and +:name+ refers to the method on + # which callbacks are being defined. + # + # A declaration like + # + # define_callbacks :save, scope: [:name] + # + # would call Audit#save. + # + # ===== Notes + # + # +names+ passed to +define_callbacks+ must not end with + # !, ? or =. + # + # Calling +define_callbacks+ multiple times with the same +names+ will + # overwrite previous callbacks registered with #set_callback. + # + # source://activesupport//lib/active_support/callbacks.rb#903 + def define_callbacks(*names); end + + # source://activesupport//lib/active_support/callbacks.rb#679 + def normalize_callback_params(filters, block); end + + # Remove all set callbacks for the given event. + # + # source://activesupport//lib/active_support/callbacks.rb#813 + def reset_callbacks(name); end + + # Install a callback for the given event. + # + # set_callback :save, :before, :before_method + # set_callback :save, :after, :after_method, if: :condition + # set_callback :save, :around, ->(r, block) { stuff; result = block.call; stuff } + # + # The second argument indicates whether the callback is to be run +:before+, + # +:after+, or +:around+ the event. If omitted, +:before+ is assumed. This + # means the first example above can also be written as: + # + # set_callback :save, :before_method + # + # The callback can be specified as a symbol naming an instance method; as a + # proc, lambda, or block; or as an object that responds to a certain method + # determined by the :scope argument to #define_callbacks. + # + # If a proc, lambda, or block is given, its body is evaluated in the context + # of the current object. It can also optionally accept the current object as + # an argument. + # + # Before and around callbacks are called in the order that they are set; + # after callbacks are called in the reverse order. + # + # Around callbacks can access the return value from the event, if it + # wasn't halted, from the +yield+ call. + # + # ===== Options + # + # * :if - A symbol or an array of symbols, each naming an instance + # method or a proc; the callback will be called only when they all return + # a true value. + # + # If a proc is given, its body is evaluated in the context of the + # current object. It can also optionally accept the current object as + # an argument. + # * :unless - A symbol or an array of symbols, each naming an + # instance method or a proc; the callback will be called only when they + # all return a false value. + # + # If a proc is given, its body is evaluated in the context of the + # current object. It can also optionally accept the current object as + # an argument. + # * :prepend - If +true+, the callback will be prepended to the + # existing chain rather than appended. + # + # source://activesupport//lib/active_support/callbacks.rb#739 + def set_callback(name, *filter_list, &block); end + + # Skip a previously set callback. Like #set_callback, :if or + # :unless options may be passed in order to control when the + # callback is skipped. + # + # Note: this example uses +PersonRecord+ and +#saving_message+, which you + # can see defined here[rdoc-ref:ActiveSupport::Callbacks] + # + # class Writer < PersonRecord + # attr_accessor :age + # skip_callback :save, :before, :saving_message, if: -> { age > 18 } + # end + # + # When if option returns true, callback is skipped. + # + # writer = Writer.new + # writer.age = 20 + # writer.save + # + # Output: + # - save + # saved + # + # When if option returns false, callback is NOT skipped. + # + # young_writer = Writer.new + # young_writer.age = 17 + # young_writer.save + # + # Output: + # saving... + # - save + # saved + # + # An ArgumentError will be raised if the callback has not + # already been set (unless the :raise option is set to false). + # + # source://activesupport//lib/active_support/callbacks.rb#788 + def skip_callback(name, *filter_list, &block); end + + protected + + # source://activesupport//lib/active_support/callbacks.rb#939 + def get_callbacks(name); end + + # source://activesupport//lib/active_support/callbacks.rb#943 + def set_callbacks(name, callbacks); end +end + +# source://activesupport//lib/active_support/callbacks.rb#153 +module ActiveSupport::Callbacks::Conditionals; end + +# source://activesupport//lib/active_support/callbacks.rb#154 +class ActiveSupport::Callbacks::Conditionals::Value + # @return [Value] a new instance of Value + # + # source://activesupport//lib/active_support/callbacks.rb#155 + def initialize(&block); end + + # source://activesupport//lib/active_support/callbacks.rb#158 + def call(target, value); end +end + +# source://activesupport//lib/active_support/callbacks.rb#162 +module ActiveSupport::Callbacks::Filters; end + +# source://activesupport//lib/active_support/callbacks.rb#194 +class ActiveSupport::Callbacks::Filters::After + # @return [After] a new instance of After + # + # source://activesupport//lib/active_support/callbacks.rb#196 + def initialize(user_callback, user_conditions, chain_config); end + + # source://activesupport//lib/active_support/callbacks.rb#214 + def apply(callback_sequence); end + + # source://activesupport//lib/active_support/callbacks.rb#202 + def call(env); end + + # Returns the value of attribute halting. + # + # source://activesupport//lib/active_support/callbacks.rb#195 + def halting; end + + # Returns the value of attribute user_callback. + # + # source://activesupport//lib/active_support/callbacks.rb#195 + def user_callback; end + + # Returns the value of attribute user_conditions. + # + # source://activesupport//lib/active_support/callbacks.rb#195 + def user_conditions; end +end + +# source://activesupport//lib/active_support/callbacks.rb#219 +class ActiveSupport::Callbacks::Filters::Around + # @return [Around] a new instance of Around + # + # source://activesupport//lib/active_support/callbacks.rb#220 + def initialize(user_callback, user_conditions); end + + # source://activesupport//lib/active_support/callbacks.rb#225 + def apply(callback_sequence); end +end + +# source://activesupport//lib/active_support/callbacks.rb#165 +class ActiveSupport::Callbacks::Filters::Before + # @return [Before] a new instance of Before + # + # source://activesupport//lib/active_support/callbacks.rb#166 + def initialize(user_callback, user_conditions, chain_config, filter, name); end + + # source://activesupport//lib/active_support/callbacks.rb#189 + def apply(callback_sequence); end + + # source://activesupport//lib/active_support/callbacks.rb#173 + def call(env); end + + # Returns the value of attribute filter. + # + # source://activesupport//lib/active_support/callbacks.rb#171 + def filter; end + + # Returns the value of attribute halted_lambda. + # + # source://activesupport//lib/active_support/callbacks.rb#171 + def halted_lambda; end + + # Returns the value of attribute name. + # + # source://activesupport//lib/active_support/callbacks.rb#171 + def name; end + + # Returns the value of attribute user_callback. + # + # source://activesupport//lib/active_support/callbacks.rb#171 + def user_callback; end + + # Returns the value of attribute user_conditions. + # + # source://activesupport//lib/active_support/callbacks.rb#171 + def user_conditions; end +end + +# source://activesupport//lib/active_support/callbacks.rb#163 +class ActiveSupport::Callbacks::Filters::Environment < ::Struct + # Returns the value of attribute halted + # + # @return [Object] the current value of halted + # + # source://activesupport//lib/active_support/callbacks.rb#163 + def halted; end + + # Sets the attribute halted + # + # @param value [Object] the value to set the attribute halted to. + # @return [Object] the newly set value + # + # source://activesupport//lib/active_support/callbacks.rb#163 + def halted=(_); end + + # Returns the value of attribute target + # + # @return [Object] the current value of target + # + # source://activesupport//lib/active_support/callbacks.rb#163 + def target; end + + # Sets the attribute target + # + # @param value [Object] the value to set the attribute target to. + # @return [Object] the newly set value + # + # source://activesupport//lib/active_support/callbacks.rb#163 + def target=(_); end + + # Returns the value of attribute value + # + # @return [Object] the current value of value + # + # source://activesupport//lib/active_support/callbacks.rb#163 + def value; end + + # Sets the attribute value + # + # @param value [Object] the value to set the attribute value to. + # @return [Object] the newly set value + # + # source://activesupport//lib/active_support/callbacks.rb#163 + def value=(_); end + + class << self + # source://activesupport//lib/active_support/callbacks.rb#163 + def [](*_arg0); end + + # source://activesupport//lib/active_support/callbacks.rb#163 + def inspect; end + + # source://activesupport//lib/active_support/callbacks.rb#163 + def keyword_init?; end + + # source://activesupport//lib/active_support/callbacks.rb#163 + def members; end + + # source://activesupport//lib/active_support/callbacks.rb#163 + def new(*_arg0); end + end +end + +# source://activesupport//lib/active_support/class_attribute.rb#4 +module ActiveSupport::ClassAttribute + class << self + # source://activesupport//lib/active_support/class_attribute.rb#6 + def redefine(owner, name, namespaced_name, value); end + + # source://activesupport//lib/active_support/class_attribute.rb#26 + def redefine_method(owner, name, private: T.unsafe(nil), &block); end + end +end + +# source://activesupport//lib/active_support/code_generator.rb#4 +class ActiveSupport::CodeGenerator + # @return [CodeGenerator] a new instance of CodeGenerator + # + # source://activesupport//lib/active_support/code_generator.rb#53 + def initialize(owner, path, line); end + + # @yield [@sources] + # + # source://activesupport//lib/active_support/code_generator.rb#61 + def class_eval; end + + # source://activesupport//lib/active_support/code_generator.rb#65 + def define_cached_method(canonical_name, namespace:, as: T.unsafe(nil), &block); end + + # source://activesupport//lib/active_support/code_generator.rb#69 + def execute; end + + class << self + # source://activesupport//lib/active_support/code_generator.rb#41 + def batch(owner, path, line); end + end +end + +# source://activesupport//lib/active_support/code_generator.rb#5 +class ActiveSupport::CodeGenerator::MethodSet + # @return [MethodSet] a new instance of MethodSet + # + # source://activesupport//lib/active_support/code_generator.rb#8 + def initialize(namespace); end + + # source://activesupport//lib/active_support/code_generator.rb#28 + def apply(owner, path, line); end + + # source://activesupport//lib/active_support/code_generator.rb#15 + def define_cached_method(canonical_name, as: T.unsafe(nil)); end +end + +# source://activesupport//lib/active_support/code_generator.rb#6 +ActiveSupport::CodeGenerator::MethodSet::METHOD_CACHES = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/core_ext/range/compare_range.rb#4 +module ActiveSupport::CompareWithRange + # Extends the default Range#=== to support range comparisons. + # (1..5) === (1..5) # => true + # (1..5) === (2..3) # => true + # (1..5) === (1...6) # => true + # (1..5) === (2..6) # => false + # + # The native Range#=== behavior is untouched. + # ('a'..'f') === ('c') # => true + # (5..9) === (11) # => false + # + # The given range must be fully bounded, with both start and end. + # + # source://activesupport//lib/active_support/core_ext/range/compare_range.rb#16 + def ===(value); end + + # Extends the default Range#include? to support range comparisons. + # (1..5).include?(1..5) # => true + # (1..5).include?(2..3) # => true + # (1..5).include?(1...6) # => true + # (1..5).include?(2..6) # => false + # + # The native Range#include? behavior is untouched. + # ('a'..'f').include?('c') # => true + # (5..9).include?(11) # => false + # + # The given range must be fully bounded, with both start and end. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/range/compare_range.rb#41 + def include?(value); end +end + +# = Active Support \Concern +# +# A typical module looks like this: +# +# module M +# def self.included(base) +# base.extend ClassMethods +# base.class_eval do +# scope :disabled, -> { where(disabled: true) } +# end +# end +# +# module ClassMethods +# ... +# end +# end +# +# By using +ActiveSupport::Concern+ the above module could instead be +# written as: +# +# require "active_support/concern" +# +# module M +# extend ActiveSupport::Concern +# +# included do +# scope :disabled, -> { where(disabled: true) } +# end +# +# class_methods do +# ... +# end +# end +# +# Moreover, it gracefully handles module dependencies. Given a +Foo+ module +# and a +Bar+ module which depends on the former, we would typically write the +# following: +# +# module Foo +# def self.included(base) +# base.class_eval do +# def self.method_injected_by_foo +# ... +# end +# end +# end +# end +# +# module Bar +# def self.included(base) +# base.method_injected_by_foo +# end +# end +# +# class Host +# include Foo # We need to include this dependency for Bar +# include Bar # Bar is the module that Host really needs +# end +# +# But why should +Host+ care about +Bar+'s dependencies, namely +Foo+? We +# could try to hide these from +Host+ directly including +Foo+ in +Bar+: +# +# module Bar +# include Foo +# def self.included(base) +# base.method_injected_by_foo +# end +# end +# +# class Host +# include Bar +# end +# +# Unfortunately this won't work, since when +Foo+ is included, its base +# is the +Bar+ module, not the +Host+ class. With +ActiveSupport::Concern+, +# module dependencies are properly resolved: +# +# require "active_support/concern" +# +# module Foo +# extend ActiveSupport::Concern +# included do +# def self.method_injected_by_foo +# ... +# end +# end +# end +# +# module Bar +# extend ActiveSupport::Concern +# include Foo +# +# included do +# self.method_injected_by_foo +# end +# end +# +# class Host +# include Bar # It works, now Bar takes care of its dependencies +# end +# +# === Prepending concerns +# +# Just like include, concerns also support prepend with a corresponding +# prepended do callback. module ClassMethods or class_methods do are +# prepended as well. +# +# prepend is also used for any dependencies. +# +# source://activesupport//lib/active_support/concern.rb#112 +module ActiveSupport::Concern + # source://activesupport//lib/active_support/concern.rb#129 + def append_features(base); end + + # Define class methods from given block. + # You can define private class methods as well. + # + # module Example + # extend ActiveSupport::Concern + # + # class_methods do + # def foo; puts 'foo'; end + # + # private + # def bar; puts 'bar'; end + # end + # end + # + # class Buzz + # include Example + # end + # + # Buzz.foo # => "foo" + # Buzz.bar # => private method 'bar' called for Buzz:Class(NoMethodError) + # + # source://activesupport//lib/active_support/concern.rb#209 + def class_methods(&class_methods_module_definition); end + + # Evaluate given block in context of base class, + # so that you can write class macros here. + # When you define more than one +included+ block, it raises an exception. + # + # source://activesupport//lib/active_support/concern.rb#158 + def included(base = T.unsafe(nil), &block); end + + # source://activesupport//lib/active_support/concern.rb#142 + def prepend_features(base); end + + # Evaluate given block in context of base class, + # so that you can write class macros here. + # When you define more than one +prepended+ block, it raises an exception. + # + # source://activesupport//lib/active_support/concern.rb#175 + def prepended(base = T.unsafe(nil), &block); end + + class << self + # source://activesupport//lib/active_support/concern.rb#125 + def extended(base); end + end +end + +# source://activesupport//lib/active_support/concern.rb#113 +class ActiveSupport::Concern::MultipleIncludedBlocks < ::StandardError + # @return [MultipleIncludedBlocks] a new instance of MultipleIncludedBlocks + # + # source://activesupport//lib/active_support/concern.rb#114 + def initialize; end +end + +# source://activesupport//lib/active_support/concern.rb#119 +class ActiveSupport::Concern::MultiplePrependBlocks < ::StandardError + # @return [MultiplePrependBlocks] a new instance of MultiplePrependBlocks + # + # source://activesupport//lib/active_support/concern.rb#120 + def initialize; end +end + +# source://activesupport//lib/active_support/concurrency/share_lock.rb#6 +module ActiveSupport::Concurrency; end + +# A monitor that will permit dependency loading while blocked waiting for +# the lock. +# +# source://activesupport//lib/active_support/concurrency/load_interlock_aware_monitor.rb#9 +ActiveSupport::Concurrency::LoadInterlockAwareMonitor = Monitor + +# source://activesupport//lib/active_support/concurrency/null_lock.rb#5 +module ActiveSupport::Concurrency::NullLock + extend ::ActiveSupport::Concurrency::NullLock + + # source://activesupport//lib/active_support/concurrency/null_lock.rb#8 + def synchronize; end +end + +# A share/exclusive lock, otherwise known as a read/write lock. +# +# https://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock +# +# source://activesupport//lib/active_support/concurrency/share_lock.rb#10 +class ActiveSupport::Concurrency::ShareLock + include ::MonitorMixin + + # @return [ShareLock] a new instance of ShareLock + # + # source://activesupport//lib/active_support/concurrency/share_lock.rb#49 + def initialize; end + + # Execute the supplied block while holding the Exclusive lock. If + # +no_wait+ is set and the lock is not immediately available, + # returns +nil+ without yielding. Otherwise, returns the result of + # the block. + # + # See +start_exclusive+ for other options. + # + # source://activesupport//lib/active_support/concurrency/share_lock.rb#147 + def exclusive(purpose: T.unsafe(nil), compatible: T.unsafe(nil), after_compatible: T.unsafe(nil), no_wait: T.unsafe(nil)); end + + # We track Thread objects, instead of just using counters, because + # we need exclusive locks to be reentrant, and we need to be able + # to upgrade share locks to exclusive. + # + # source://activesupport//lib/active_support/concurrency/share_lock.rb#17 + def raw_state; end + + # Execute the supplied block while holding the Share lock. + # + # source://activesupport//lib/active_support/concurrency/share_lock.rb#158 + def sharing; end + + # Returns false if +no_wait+ is set and the lock is not + # immediately available. Otherwise, returns true after the lock + # has been acquired. + # + # +purpose+ and +compatible+ work together; while this thread is + # waiting for the exclusive lock, it will yield its share (if any) + # to any other attempt whose +purpose+ appears in this attempt's + # +compatible+ list. This allows a "loose" upgrade, which, being + # less strict, prevents some classes of deadlocks. + # + # For many resources, loose upgrades are sufficient: if a thread + # is awaiting a lock, it is not running any other code. With + # +purpose+ matching, it is possible to yield only to other + # threads whose activity will not interfere. + # + # source://activesupport//lib/active_support/concurrency/share_lock.rb#75 + def start_exclusive(purpose: T.unsafe(nil), compatible: T.unsafe(nil), no_wait: T.unsafe(nil)); end + + # source://activesupport//lib/active_support/concurrency/share_lock.rb#113 + def start_sharing; end + + # Relinquish the exclusive lock. Must only be called by the thread + # that called start_exclusive (and currently holds the lock). + # + # source://activesupport//lib/active_support/concurrency/share_lock.rb#95 + def stop_exclusive(compatible: T.unsafe(nil)); end + + # source://activesupport//lib/active_support/concurrency/share_lock.rb#130 + def stop_sharing; end + + # Temporarily give up all held Share locks while executing the + # supplied block, allowing any +compatible+ exclusive lock request + # to proceed. + # + # source://activesupport//lib/active_support/concurrency/share_lock.rb#170 + def yield_shares(purpose: T.unsafe(nil), compatible: T.unsafe(nil), block_share: T.unsafe(nil)); end + + private + + # Must be called within synchronize + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/concurrency/share_lock.rb#203 + def busy_for_exclusive?(purpose); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/concurrency/share_lock.rb#208 + def busy_for_sharing?(purpose); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/concurrency/share_lock.rb#213 + def eligible_waiters?(compatible); end + + # source://activesupport//lib/active_support/concurrency/share_lock.rb#217 + def wait_for(method, &block); end +end + +# source://activesupport//lib/active_support/concurrency/thread_monitor.rb#5 +class ActiveSupport::Concurrency::ThreadMonitor + # @return [ThreadMonitor] a new instance of ThreadMonitor + # + # source://activesupport//lib/active_support/concurrency/thread_monitor.rb#10 + def initialize; end + + # source://activesupport//lib/active_support/concurrency/thread_monitor.rb#16 + def synchronize(&block); end + + private + + # source://activesupport//lib/active_support/concurrency/thread_monitor.rb#37 + def mon_enter; end + + # source://activesupport//lib/active_support/concurrency/thread_monitor.rb#43 + def mon_exit; end + + # source://activesupport//lib/active_support/concurrency/thread_monitor.rb#29 + def mon_try_enter; end +end + +# source://activesupport//lib/active_support/concurrency/thread_monitor.rb#7 +ActiveSupport::Concurrency::ThreadMonitor::EXCEPTION_IMMEDIATE = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/concurrency/thread_monitor.rb#6 +ActiveSupport::Concurrency::ThreadMonitor::EXCEPTION_NEVER = T.let(T.unsafe(nil), Hash) + +# = Active Support \Configurable +# +# Configurable provides a config method to store and retrieve +# configuration options as an OrderedOptions. +# +# source://activesupport//lib/active_support/configurable.rb#17 +module ActiveSupport::Configurable + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveSupport::Configurable::ClassMethods + + # Reads and writes attributes from a configuration OrderedOptions. + # + # require "active_support/configurable" + # + # class User + # include ActiveSupport::Configurable + # end + # + # user = User.new + # + # user.config.allowed_access = true + # user.config.level = 1 + # + # user.config.allowed_access # => true + # user.config.level # => 1 + # + # source://activesupport//lib/active_support/configurable.rb#189 + def config; end +end + +# source://activesupport//lib/active_support/configurable.rb#35 +module ActiveSupport::Configurable::ClassMethods + # Reads and writes attributes from a configuration OrderedOptions. + # + # require "active_support/configurable" + # + # class User + # include ActiveSupport::Configurable + # end + # + # User.config.allowed_access = true + # User.config.level = 1 + # + # User.config.allowed_access # => true + # User.config.level # => 1 + # + # source://activesupport//lib/active_support/configurable.rb#49 + def config; end + + # Configure values from within the passed block. + # + # require "active_support/configurable" + # + # class User + # include ActiveSupport::Configurable + # end + # + # User.allowed_access # => nil + # + # User.configure do |config| + # config.allowed_access = true + # end + # + # User.allowed_access # => true + # + # @yield [config] + # + # source://activesupport//lib/active_support/configurable.rb#73 + def configure; end + + private + + # Allows you to add shortcut so that you don't have to refer to attribute + # through config. Also look at the example for config to contrast. + # + # Defines both class and instance config accessors. + # + # class User + # include ActiveSupport::Configurable + # config_accessor :allowed_access + # end + # + # User.allowed_access # => nil + # User.allowed_access = false + # User.allowed_access # => false + # + # user = User.new + # user.allowed_access # => false + # user.allowed_access = true + # user.allowed_access # => true + # + # User.allowed_access # => false + # + # The attribute name must be a valid method name in Ruby. + # + # class User + # include ActiveSupport::Configurable + # config_accessor :"1_Badname" + # end + # # => NameError: invalid config attribute name + # + # To omit the instance writer method, pass instance_writer: false. + # To omit the instance reader method, pass instance_reader: false. + # + # class User + # include ActiveSupport::Configurable + # config_accessor :allowed_access, instance_reader: false, instance_writer: false + # end + # + # User.allowed_access = false + # User.allowed_access # => false + # + # User.new.allowed_access = true # => NoMethodError + # User.new.allowed_access # => NoMethodError + # + # Or pass instance_accessor: false, to omit both instance methods. + # + # class User + # include ActiveSupport::Configurable + # config_accessor :allowed_access, instance_accessor: false + # end + # + # User.allowed_access = false + # User.allowed_access # => false + # + # User.new.allowed_access = true # => NoMethodError + # User.new.allowed_access # => NoMethodError + # + # Also you can pass default or a block to set up the attribute with a default value. + # + # class User + # include ActiveSupport::Configurable + # config_accessor :allowed_access, default: false + # config_accessor :hair_colors do + # [:brown, :black, :blonde, :red] + # end + # end + # + # User.allowed_access # => false + # User.hair_colors # => [:brown, :black, :blonde, :red] + # + # source://activesupport//lib/active_support/configurable.rb#145 + def config_accessor(*names, instance_reader: T.unsafe(nil), instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil)); end + + # source://activesupport//lib/active_support/configurable.rb#166 + def inherited(subclass); end +end + +# source://activesupport//lib/active_support/configurable.rb#20 +class ActiveSupport::Configurable::Configuration < ::ActiveSupport::InheritableOptions + # source://activesupport//lib/active_support/configurable.rb#21 + def compile_methods!; end + + class << self + # Compiles reader methods so we don't have to go through method_missing. + # + # source://activesupport//lib/active_support/configurable.rb#26 + def compile_methods!(keys); end + end +end + +# Reads a YAML configuration file, evaluating any ERB, then +# parsing the resulting YAML. +# +# Warns in case of YAML confusing characters, like invisible +# non-breaking spaces. +# +# source://activesupport//lib/active_support/configuration_file.rb#9 +class ActiveSupport::ConfigurationFile + # @return [ConfigurationFile] a new instance of ConfigurationFile + # + # source://activesupport//lib/active_support/configuration_file.rb#12 + def initialize(content_path); end + + # source://activesupport//lib/active_support/configuration_file.rb#21 + def parse(context: T.unsafe(nil), **options); end + + private + + # source://activesupport//lib/active_support/configuration_file.rb#44 + def read(content_path); end + + # source://activesupport//lib/active_support/configuration_file.rb#54 + def render(context); end + + class << self + # source://activesupport//lib/active_support/configuration_file.rb#17 + def parse(content_path, **options); end + end +end + +# source://activesupport//lib/active_support/configuration_file.rb#10 +class ActiveSupport::ConfigurationFile::FormatError < ::StandardError; end + +# Provides a DSL for declaring a continuous integration workflow that can be run either locally or in the cloud. +# Each step is timed, reports success/error, and is aggregated into a collective report that reports total runtime, +# as well as whether the entire run was successful or not. +# +# Example: +# +# ActiveSupport::ContinuousIntegration.run do +# step "Setup", "bin/setup --skip-server" +# step "Style: Ruby", "bin/rubocop" +# step "Security: Gem audit", "bin/bundler-audit" +# step "Tests: Rails", "bin/rails test test:system" +# +# if success? +# step "Signoff: Ready for merge and deploy", "gh signoff" +# else +# failure "Skipping signoff; CI failed.", "Fix the issues and try again." +# end +# end +# +# Starting with Rails 8.1, a default `bin/ci` and `config/ci.rb` file are created to provide out-of-the-box CI. +# +# source://activesupport//lib/active_support/continuous_integration.rb#24 +class ActiveSupport::ContinuousIntegration + # @return [ContinuousIntegration] a new instance of ContinuousIntegration + # + # source://activesupport//lib/active_support/continuous_integration.rb#64 + def initialize; end + + # Echo text to the terminal in the color corresponding to the type of the text. + # + # Examples: + # + # echo "This is going to be green!", type: :success + # echo "This is going to be red!", type: :error + # + # See ActiveSupport::ContinuousIntegration::COLORS for a complete list of options. + # + # source://activesupport//lib/active_support/continuous_integration.rb#111 + def echo(text, type:); end + + # Display an error heading with the title and optional subtitle to reflect that the run failed. + # + # source://activesupport//lib/active_support/continuous_integration.rb#86 + def failure(title, subtitle = T.unsafe(nil)); end + + # Display a colorized heading followed by an optional subtitle. + # + # Examples: + # + # heading "Smoke Testing", "End-to-end tests verifying key functionality", padding: false + # heading "Skipping video encoding tests", "Install FFmpeg to run these tests", type: :error + # + # See ActiveSupport::ContinuousIntegration::COLORS for a complete list of options. + # + # source://activesupport//lib/active_support/continuous_integration.rb#98 + def heading(heading, subtitle = T.unsafe(nil), type: T.unsafe(nil), padding: T.unsafe(nil)); end + + # source://activesupport//lib/active_support/continuous_integration.rb#116 + def report(title, &block); end + + # Returns the value of attribute results. + # + # source://activesupport//lib/active_support/continuous_integration.rb#33 + def results; end + + # Declare a step with a title and a command. The command can either be given as a single string or as multiple + # strings that will be passed to `system` as individual arguments (and therefore correctly escaped for paths etc). + # + # Examples: + # + # step "Setup", "bin/setup" + # step "Single test", "bin/rails", "test", "--name", "test_that_is_one" + # + # source://activesupport//lib/active_support/continuous_integration.rb#75 + def step(title, *command); end + + # Returns true if all steps were successful. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/continuous_integration.rb#81 + def success?; end + + private + + # source://activesupport//lib/active_support/continuous_integration.rb#141 + def colorize(text, type); end + + # source://activesupport//lib/active_support/continuous_integration.rb#134 + def timing; end + + class << self + # Perform a CI run. Execute each step, show their results and runtime, and exit with a non-zero status if there are any failures. + # + # Pass an optional title, subtitle, and a block that declares the steps to be executed. + # + # Sets the CI environment variable to "true" to allow for conditional behavior in the app, like enabling eager loading and disabling logging. + # + # Example: + # + # ActiveSupport::ContinuousIntegration.run do + # step "Setup", "bin/setup --skip-server" + # step "Style: Ruby", "bin/rubocop" + # step "Security: Gem audit", "bin/bundler-audit" + # step "Tests: Rails", "bin/rails test test:system" + # + # if success? + # step "Signoff: Ready for merge and deploy", "gh signoff" + # else + # failure "Skipping signoff; CI failed.", "Fix the issues and try again." + # end + # end + # + # source://activesupport//lib/active_support/continuous_integration.rb#55 + def run(title = T.unsafe(nil), subtitle = T.unsafe(nil), &block); end + end +end + +# source://activesupport//lib/active_support/continuous_integration.rb#25 +ActiveSupport::ContinuousIntegration::COLORS = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/core_ext/erb/util.rb#6 +module ActiveSupport::CoreExt; end + +# source://activesupport//lib/active_support/core_ext/erb/util.rb#7 +module ActiveSupport::CoreExt::ERBUtil + # A utility method for escaping HTML tag characters. + # This method is also aliased as h. + # + # puts html_escape('is a > 0 & a < 10?') + # # => is a > 0 & a < 10? + # + # source://activesupport//lib/active_support/core_ext/erb/util.rb#28 + def h(s); end + + # A utility method for escaping HTML tag characters. + # This method is also aliased as h. + # + # puts html_escape('is a > 0 & a < 10?') + # # => is a > 0 & a < 10? + # + # source://activesupport//lib/active_support/core_ext/erb/util.rb#10 + def html_escape(s); end + + # HTML escapes strings but doesn't wrap them with an ActiveSupport::SafeBuffer. + # This method is not for public consumption! Seriously! + # + # source://activesupport//lib/active_support/core_ext/erb/util.rb#18 + def unwrapped_html_escape(s); end +end + +# source://activesupport//lib/active_support/core_ext/erb/util.rb#31 +module ActiveSupport::CoreExt::ERBUtilPrivate + include ::ActiveSupport::CoreExt::ERBUtil + + private + + # source://activesupport//lib/active_support/core_ext/erb/util.rb#33 + def h(s); end + + # source://activesupport//lib/active_support/core_ext/erb/util.rb#33 + def html_escape(s); end + + # source://activesupport//lib/active_support/core_ext/erb/util.rb#33 + def unwrapped_html_escape(s); end +end + +# = Current Attributes +# +# Abstract super class that provides a thread-isolated attributes singleton, which resets automatically +# before and after each request. This allows you to keep all the per-request attributes easily +# available to the whole system. +# +# The following full app-like example demonstrates how to use a Current class to +# facilitate easy access to the global, per-request attributes without passing them deeply +# around everywhere: +# +# # app/models/current.rb +# class Current < ActiveSupport::CurrentAttributes +# attribute :account, :user +# attribute :request_id, :user_agent, :ip_address +# +# resets { Time.zone = nil } +# +# def user=(user) +# super +# self.account = user.account +# Time.zone = user.time_zone +# end +# end +# +# # app/controllers/concerns/authentication.rb +# module Authentication +# extend ActiveSupport::Concern +# +# included do +# before_action :authenticate +# end +# +# private +# def authenticate +# if authenticated_user = User.find_by(id: cookies.encrypted[:user_id]) +# Current.user = authenticated_user +# else +# redirect_to new_session_url +# end +# end +# end +# +# # app/controllers/concerns/set_current_request_details.rb +# module SetCurrentRequestDetails +# extend ActiveSupport::Concern +# +# included do +# before_action do +# Current.request_id = request.uuid +# Current.user_agent = request.user_agent +# Current.ip_address = request.ip +# end +# end +# end +# +# class ApplicationController < ActionController::Base +# include Authentication +# include SetCurrentRequestDetails +# end +# +# class MessagesController < ApplicationController +# def create +# Current.account.messages.create(message_params) +# end +# end +# +# class Message < ApplicationRecord +# belongs_to :creator, default: -> { Current.user } +# after_create { |message| Event.create(record: message) } +# end +# +# class Event < ApplicationRecord +# before_create do +# self.request_id = Current.request_id +# self.user_agent = Current.user_agent +# self.ip_address = Current.ip_address +# end +# end +# +# A word of caution: It's easy to overdo a global singleton like Current and tangle your model as a result. +# Current should only be used for a few, top-level globals, like account, user, and request details. +# The attributes stuck in Current should be used by more or less all actions on all requests. If you start +# sticking controller-specific attributes in there, you're going to create a mess. +# +# source://activesupport//lib/active_support/current_attributes.rb#93 +class ActiveSupport::CurrentAttributes + include ::ActiveSupport::Callbacks + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::ActiveSupport::DescendantsTracker + + # @return [CurrentAttributes] a new instance of CurrentAttributes + # + # source://activesupport//lib/active_support/current_attributes.rb#186 + def initialize; end + + # source://activesupport//lib/active_support/current_attributes.rb#94 + def __callbacks; end + + # source://activesupport//lib/active_support/current_attributes.rb#95 + def _reset_callbacks; end + + # source://activesupport//lib/active_support/current_attributes.rb#95 + def _run_reset_callbacks; end + + # source://activesupport//lib/active_support/current_attributes.rb#95 + def _run_reset_callbacks!(&block); end + + # source://activesupport//lib/active_support/current_attributes.rb#186 + def attributes; end + + # Sets the attribute attributes + # + # @param value the value to set the attribute attributes to. + # + # source://activesupport//lib/active_support/current_attributes.rb#186 + def attributes=(_arg0); end + + # source://activesupport//lib/active_support/current_attributes.rb#186 + def defaults; end + + # source://activesupport//lib/active_support/current_attributes.rb#186 + def defaults?; end + + # Reset all attributes. Should be called before and after actions, when used as a per-request singleton. + # + # source://activesupport//lib/active_support/current_attributes.rb#186 + def reset; end + + # Expose one or more attributes within a block. Old values are returned after the block concludes. + # Example demonstrating the common use of needing to set Current attributes outside the request-cycle: + # + # class Chat::PublicationJob < ApplicationJob + # def perform(attributes, room_number, creator) + # Current.set(person: creator) do + # Chat::Publisher.publish(attributes: attributes, room_number: room_number) + # end + # end + # end + # + # source://activesupport//lib/active_support/current_attributes.rb#186 + def set(attributes, &block); end + + private + + # source://activesupport//lib/active_support/current_attributes.rb#186 + def resolve_defaults; end + + class << self + # source://activesupport//lib/active_support/current_attributes.rb#94 + def __callbacks; end + + # source://activesupport//lib/active_support/current_attributes.rb#94 + def __callbacks=(value); end + + # source://activesupport//lib/active_support/current_attributes.rb#95 + def _reset_callbacks; end + + # source://activesupport//lib/active_support/current_attributes.rb#95 + def _reset_callbacks=(value); end + + # Calls this callback after #reset is called on the instance. Used for resetting external collaborators, like Time.zone. + # + # source://activesupport//lib/active_support/current_attributes.rb#153 + def after_reset(*methods, &block); end + + # Declares one or more attributes that will be given both class and instance accessor methods. + # + # ==== Options + # + # * :default - The default value for the attributes. If the value + # is a proc or lambda, it will be called whenever an instance is + # constructed. Otherwise, the value will be duplicated with +#dup+. + # Default values are re-assigned when the attributes are reset. + # + # source://activesupport//lib/active_support/current_attributes.rb#115 + def attribute(*names, default: T.unsafe(nil)); end + + # source://activesupport//lib/active_support/current_attributes.rb#197 + def attributes(&_arg0); end + + # source://activesupport//lib/active_support/current_attributes.rb#197 + def attributes=(arg); end + + # Calls this callback before #reset is called on the instance. Used for resetting external collaborators that depend on current values. + # + # source://activesupport//lib/active_support/current_attributes.rb#145 + def before_reset(*methods, &block); end + + # source://activesupport//lib/active_support/current_attributes.rb#157 + def clear_all; end + + # source://activesupport//lib/active_support/current_attributes.rb#201 + def defaults; end + + # source://activesupport//lib/active_support/current_attributes.rb#201 + def defaults=(value); end + + # source://activesupport//lib/active_support/current_attributes.rb#201 + def defaults?; end + + # Returns singleton instance for this class in this thread. If none exists, one is created. + # + # source://activesupport//lib/active_support/current_attributes.rb#103 + def instance; end + + # source://activesupport//lib/active_support/current_attributes.rb#155 + def reset(*_arg0, **_arg1, &_arg2); end + + # Calls this callback after #reset is called on the instance. Used for resetting external collaborators, like Time.zone. + # + # source://activesupport//lib/active_support/current_attributes.rb#150 + def resets(*methods, &block); end + + # source://activesupport//lib/active_support/current_attributes.rb#155 + def set(*_arg0, **_arg1, &_arg2); end + + private + + # source://activesupport//lib/active_support/current_attributes.rb#94 + def __class_attr___callbacks; end + + # source://activesupport//lib/active_support/current_attributes.rb#94 + def __class_attr___callbacks=(new_value); end + + # source://activesupport//lib/active_support/current_attributes.rb#201 + def __class_attr_defaults; end + + # source://activesupport//lib/active_support/current_attributes.rb#201 + def __class_attr_defaults=(new_value); end + + # source://activesupport//lib/active_support/current_attributes.rb#169 + def current_instances; end + + # source://activesupport//lib/active_support/current_attributes.rb#173 + def current_instances_key; end + + # source://activesupport//lib/active_support/current_attributes.rb#165 + def generated_attribute_methods; end + + # @private + # + # source://activesupport//lib/active_support/current_attributes.rb#185 + def method_added(name); end + + # source://activesupport//lib/active_support/current_attributes.rb#177 + def method_missing(name, *_arg1, **_arg2, &_arg3); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/current_attributes.rb#181 + def respond_to_missing?(name, _); end + end +end + +# source://activesupport//lib/active_support/current_attributes.rb#97 +ActiveSupport::CurrentAttributes::INVALID_ATTRIBUTE_NAMES = T.let(T.unsafe(nil), Array) + +# source://activesupport//lib/active_support/current_attributes.rb#99 +ActiveSupport::CurrentAttributes::NOT_SET = T.let(T.unsafe(nil), Object) + +# Provides +deep_merge+ and +deep_merge!+ methods. Expects the including class +# to provide a merge!(other, &block) method. +# +# source://activesupport//lib/active_support/deep_mergeable.rb#6 +module ActiveSupport::DeepMergeable + # Returns a new instance with the values from +other+ merged recursively. + # + # class Hash + # include ActiveSupport::DeepMergeable + # end + # + # hash_1 = { a: true, b: { c: [1, 2, 3] } } + # hash_2 = { a: false, b: { x: [3, 4, 5] } } + # + # hash_1.deep_merge(hash_2) + # # => { a: false, b: { c: [1, 2, 3], x: [3, 4, 5] } } + # + # A block can be provided to merge non-DeepMergeable values: + # + # hash_1 = { a: 100, b: 200, c: { c1: 100 } } + # hash_2 = { b: 250, c: { c1: 200 } } + # + # hash_1.deep_merge(hash_2) do |key, this_val, other_val| + # this_val + other_val + # end + # # => { a: 100, b: 450, c: { c1: 300 } } + # + # source://activesupport//lib/active_support/deep_mergeable.rb#29 + def deep_merge(other, &block); end + + # Same as #deep_merge, but modifies +self+. + # + # source://activesupport//lib/active_support/deep_mergeable.rb#34 + def deep_merge!(other, &block); end + + # Returns true if +other+ can be deep merged into +self+. Classes may + # override this method to restrict or expand the domain of deep mergeable + # values. Defaults to checking that +other+ is of type +self.class+. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/deep_mergeable.rb#49 + def deep_merge?(other); end +end + +# source://activesupport//lib/active_support/delegation.rb#14 +module ActiveSupport::Delegation + class << self + # source://activesupport//lib/active_support/delegation.rb#21 + def generate(owner, methods, location: T.unsafe(nil), to: T.unsafe(nil), prefix: T.unsafe(nil), allow_nil: T.unsafe(nil), nilable: T.unsafe(nil), private: T.unsafe(nil), as: T.unsafe(nil), signature: T.unsafe(nil)); end + + # source://activesupport//lib/active_support/delegation.rb#150 + def generate_method_missing(owner, target, allow_nil: T.unsafe(nil)); end + end +end + +# source://activesupport//lib/active_support/delegation.rb#18 +ActiveSupport::Delegation::RESERVED_METHOD_NAMES = T.let(T.unsafe(nil), Set) + +# source://activesupport//lib/active_support/delegation.rb#15 +ActiveSupport::Delegation::RUBY_RESERVED_KEYWORDS = T.let(T.unsafe(nil), Array) + +# Error generated by +delegate+ when a method is called on +nil+ and +allow_nil+ +# option is not used. +# +# source://activesupport//lib/active_support/delegation.rb#6 +class ActiveSupport::DelegationError < ::NoMethodError + class << self + # source://activesupport//lib/active_support/delegation.rb#8 + def nil_target(method_name, target); end + end +end + +# source://activesupport//lib/active_support/dependencies/interlock.rb#6 +module ActiveSupport::Dependencies + class << self + # source://activesupport//lib/active_support/dependencies.rb#66 + def _autoloaded_tracked_classes; end + + # source://activesupport//lib/active_support/dependencies.rb#66 + def _autoloaded_tracked_classes=(_arg0); end + + # source://activesupport//lib/active_support/dependencies.rb#60 + def _eager_load_paths; end + + # source://activesupport//lib/active_support/dependencies.rb#60 + def _eager_load_paths=(_arg0); end + + # source://activesupport//lib/active_support/dependencies.rb#53 + def autoload_once_paths; end + + # source://activesupport//lib/active_support/dependencies.rb#53 + def autoload_once_paths=(_arg0); end + + # source://activesupport//lib/active_support/dependencies.rb#47 + def autoload_paths; end + + # source://activesupport//lib/active_support/dependencies.rb#47 + def autoload_paths=(_arg0); end + + # source://activesupport//lib/active_support/dependencies.rb#73 + def autoloader; end + + # source://activesupport//lib/active_support/dependencies.rb#73 + def autoloader=(_arg0); end + + # Private method that reloads constants autoloaded by the main autoloader. + # + # Rails.application.reloader.reload! is the public interface for application + # reload. That involves more things, like deleting unloaded classes from the + # internal state of the descendants tracker, or reloading routes. + # + # source://activesupport//lib/active_support/dependencies.rb#80 + def clear; end + + # Private method that helps configuring the autoloaders. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/dependencies.rb#98 + def eager_load?(path); end + + # source://activesupport//lib/active_support/dependencies.rb#9 + def interlock; end + + # source://activesupport//lib/active_support/dependencies.rb#9 + def interlock=(_arg0); end + + # Execute the supplied block while holding an exclusive lock, + # preventing any other thread from being inside a #run_interlock + # block at the same time. + # + # source://activesupport//lib/active_support/dependencies.rb#23 + def load_interlock(&block); end + + # Execute the supplied block without interference from any + # concurrent loads. + # + # source://activesupport//lib/active_support/dependencies.rb#16 + def run_interlock(&block); end + + # Private method used by require_dependency. + # + # source://activesupport//lib/active_support/dependencies.rb#88 + def search_for_file(relpath); end + + # Execute the supplied block while holding an exclusive lock, + # preventing any other thread from being inside a #run_interlock + # block at the same time. + # + # source://activesupport//lib/active_support/dependencies.rb#35 + def unload_interlock(&block); end + end +end + +# source://activesupport//lib/active_support/dependencies/interlock.rb#7 +class ActiveSupport::Dependencies::Interlock + # @return [Interlock] a new instance of Interlock + # + # source://activesupport//lib/active_support/dependencies/interlock.rb#8 + def initialize; end + + # source://activesupport//lib/active_support/dependencies/interlock.rb#37 + def done_running; end + + # source://activesupport//lib/active_support/dependencies/interlock.rb#29 + def done_unloading; end + + # source://activesupport//lib/active_support/dependencies/interlock.rb#12 + def loading(&block); end + + # source://activesupport//lib/active_support/dependencies/interlock.rb#45 + def permit_concurrent_loads(&block); end + + # source://activesupport//lib/active_support/dependencies/interlock.rb#50 + def raw_state(&block); end + + # source://activesupport//lib/active_support/dependencies/interlock.rb#41 + def running(&block); end + + # source://activesupport//lib/active_support/dependencies/interlock.rb#33 + def start_running; end + + # source://activesupport//lib/active_support/dependencies/interlock.rb#25 + def start_unloading; end + + # source://activesupport//lib/active_support/dependencies/interlock.rb#21 + def unloading(&block); end +end + +# source://activesupport//lib/active_support/dependencies/require_dependency.rb#3 +module ActiveSupport::Dependencies::RequireDependency + # Warning: This method is obsolete. The semantics of the autoloader + # match Ruby's and you do not need to be defensive with load order anymore. + # Just refer to classes and modules normally. + # + # Engines that do not control the mode in which their parent application runs + # should call +require_dependency+ where needed in case the runtime mode is + # +:classic+. + # + # source://activesupport//lib/active_support/dependencies/require_dependency.rb#11 + def require_dependency(filename); end +end + +# = Active Support \Deprecation +# +# \Deprecation specifies the API used by \Rails to deprecate methods, instance variables, objects, and constants. It's +# also available for gems or applications. +# +# For a gem, use Deprecation.new to create a Deprecation object and store it in your module or class (in order for +# users to be able to configure it). +# +# module MyLibrary +# def self.deprecator +# @deprecator ||= ActiveSupport::Deprecation.new("2.0", "MyLibrary") +# end +# end +# +# For a Railtie or Engine, you may also want to add it to the application's deprecators, so that the application's +# configuration can be applied to it. +# +# module MyLibrary +# class Railtie < Rails::Railtie +# initializer "my_library.deprecator" do |app| +# app.deprecators[:my_library] = MyLibrary.deprecator +# end +# end +# end +# +# With the above initializer, configuration settings like the following will affect +MyLibrary.deprecator+: +# +# # in config/environments/test.rb +# config.active_support.deprecation = :raise +# +# source://activesupport//lib/active_support/deprecation.rb#33 +class ActiveSupport::Deprecation + include ::ActiveSupport::Deprecation::Behavior + include ::ActiveSupport::Deprecation::Reporting + include ::ActiveSupport::Deprecation::Disallowed + include ::ActiveSupport::Deprecation::MethodWrapper + + # It accepts two parameters on initialization. The first is a version of library + # and the second is a library name. + # + # ActiveSupport::Deprecation.new('2.0', 'MyLibrary') + # + # @return [Deprecation] a new instance of Deprecation + # + # source://activesupport//lib/active_support/deprecation.rb#71 + def initialize(deprecation_horizon = T.unsafe(nil), gem_name = T.unsafe(nil)); end + + # The version number in which the deprecated behavior will be removed, by default. + # + # source://activesupport//lib/active_support/deprecation.rb#65 + def deprecation_horizon; end + + # The version number in which the deprecated behavior will be removed, by default. + # + # source://activesupport//lib/active_support/deprecation.rb#65 + def deprecation_horizon=(_arg0); end + + class << self + # source://activesupport//lib/active_support/deprecation.rb#60 + def _instance; end + end +end + +# Behavior module allows to determine how to display deprecation messages. +# You can create a custom behavior or set any from the +DEFAULT_BEHAVIORS+ +# constant. Available behaviors are: +# +# [+:raise+] Raise ActiveSupport::DeprecationException. +# [+:stderr+] Log all deprecation warnings to $stderr. +# [+:log+] Log all deprecation warnings to +Rails.logger+. +# [+:notify+] Use ActiveSupport::Notifications to notify +deprecation.rails+. +# [+:report+] Use ActiveSupport::ErrorReporter to report deprecations. +# [+:silence+] Do nothing. On \Rails, set config.active_support.report_deprecations = false to disable all behaviors. +# +# Setting behaviors only affects deprecations that happen after boot time. +# For more information you can read the documentation of the #behavior= method. +# +# source://activesupport//lib/active_support/deprecation/behaviors.rb#69 +module ActiveSupport::Deprecation::Behavior + # Returns the current behavior or if one isn't set, defaults to +:stderr+. + # + # source://activesupport//lib/active_support/deprecation/behaviors.rb#74 + def behavior; end + + # Sets the behavior to the specified value. Can be a single value, array, + # or an object that responds to +call+. + # + # Available behaviors: + # + # [+:raise+] Raise ActiveSupport::DeprecationException. + # [+:stderr+] Log all deprecation warnings to $stderr. + # [+:log+] Log all deprecation warnings to +Rails.logger+. + # [+:notify+] Use ActiveSupport::Notifications to notify +deprecation.rails+. + # [+:report+] Use ActiveSupport::ErrorReporter to report deprecations. + # [+:silence+] Do nothing. + # + # Setting behaviors only affects deprecations that happen after boot time. + # Deprecation warnings raised by gems are not affected by this setting + # because they happen before \Rails boots up. + # + # deprecator = ActiveSupport::Deprecation.new + # deprecator.behavior = :stderr + # deprecator.behavior = [:stderr, :log] + # deprecator.behavior = MyCustomHandler + # deprecator.behavior = ->(message, callstack, deprecation_horizon, gem_name) { + # # custom stuff + # } + # + # If you are using \Rails, you can set + # config.active_support.report_deprecations = false to disable + # all deprecation behaviors. This is similar to the +:silence+ option but + # more performant. + # + # source://activesupport//lib/active_support/deprecation/behaviors.rb#111 + def behavior=(behavior); end + + # Whether to print a backtrace along with the warning. + # + # source://activesupport//lib/active_support/deprecation/behaviors.rb#71 + def debug; end + + # Whether to print a backtrace along with the warning. + # + # source://activesupport//lib/active_support/deprecation/behaviors.rb#71 + def debug=(_arg0); end + + # Returns the current behavior for disallowed deprecations or if one isn't set, defaults to +:raise+. + # + # source://activesupport//lib/active_support/deprecation/behaviors.rb#79 + def disallowed_behavior; end + + # Sets the behavior for disallowed deprecations (those configured by + # ActiveSupport::Deprecation#disallowed_warnings=) to the specified + # value. As with #behavior=, this can be a single value, array, or an + # object that responds to +call+. + # + # source://activesupport//lib/active_support/deprecation/behaviors.rb#119 + def disallowed_behavior=(behavior); end + + private + + # source://activesupport//lib/active_support/deprecation/behaviors.rb#124 + def arity_coerce(behavior); end + + # source://activesupport//lib/active_support/deprecation/behaviors.rb#143 + def arity_of_callable(callable); end +end + +# Default warning behaviors per Rails.env. +# +# source://activesupport//lib/active_support/deprecation/behaviors.rb#13 +ActiveSupport::Deprecation::DEFAULT_BEHAVIORS = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/deprecation/constant_accessor.rb#5 +module ActiveSupport::Deprecation::DeprecatedConstantAccessor + class << self + # @private + # + # source://activesupport//lib/active_support/deprecation/constant_accessor.rb#6 + def included(base); end + end +end + +# DeprecatedConstantProxy transforms a constant into a deprecated one. It takes the full names of an old +# (deprecated) constant and of a new constant (both in string form) and a deprecator. The deprecated constant now +# returns the value of the new one. +# +# PLANETS = %w(mercury venus earth mars jupiter saturn uranus neptune pluto) +# +# # (In a later update, the original implementation of `PLANETS` has been removed.) +# +# PLANETS_POST_2006 = %w(mercury venus earth mars jupiter saturn uranus neptune) +# PLANETS = ActiveSupport::Deprecation::DeprecatedConstantProxy.new("PLANETS", "PLANETS_POST_2006", ActiveSupport::Deprecation.new) +# +# PLANETS.map { |planet| planet.capitalize } +# # => DEPRECATION WARNING: PLANETS is deprecated! Use PLANETS_POST_2006 instead. +# (Backtrace information…) +# ["Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune"] +# +# source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#120 +class ActiveSupport::Deprecation::DeprecatedConstantProxy < ::Module + # @return [DeprecatedConstantProxy] a new instance of DeprecatedConstantProxy + # + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#128 + def initialize(old_const, new_const, deprecator, message: T.unsafe(nil)); end + + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#158 + def append_features(base); end + + # Returns the class of the new constant. + # + # PLANETS_POST_2006 = %w(mercury venus earth mars jupiter saturn uranus neptune) + # PLANETS = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('PLANETS', 'PLANETS_POST_2006') + # PLANETS.class # => Array + # + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#154 + def class; end + + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#168 + def extended(base); end + + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#147 + def hash(*_arg0, **_arg1, &_arg2); end + + # Don't give a deprecation warning on inspect since test/unit and error + # logs rely on it for diagnostics. + # + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#141 + def inspect; end + + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#147 + def instance_methods(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#147 + def name(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#163 + def prepend_features(base); end + + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#147 + def respond_to?(*_arg0, **_arg1, &_arg2); end + + private + + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#178 + def const_missing(name); end + + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#183 + def method_missing(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#174 + def target; end + + class << self + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#121 + def new(*args, **options, &block); end + end +end + +# DeprecatedInstanceVariableProxy transforms an instance variable into a deprecated one. It takes an instance of a +# class, a method on that class, an instance variable, and a deprecator as the last argument. +# +# Trying to use the deprecated instance variable will result in a deprecation warning, pointing to the method as a +# replacement. +# +# class Example +# def initialize +# @request = ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy.new(self, :request, :@request, ActiveSupport::Deprecation.new) +# @_request = :special_request +# end +# +# def request +# @_request +# end +# +# def old_request +# @request +# end +# end +# +# example = Example.new +# # => # +# +# example.old_request.to_s +# # => DEPRECATION WARNING: @request is deprecated! Call request.to_s instead of +# @request.to_s +# (Backtrace information…) +# "special_request" +# +# example.request.to_s +# # => "special_request" +# +# source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#87 +class ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy < ::ActiveSupport::Deprecation::DeprecationProxy + # @return [DeprecatedInstanceVariableProxy] a new instance of DeprecatedInstanceVariableProxy + # + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#88 + def initialize(instance, method, var = T.unsafe(nil), deprecator:); end + + private + + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#96 + def target; end + + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#100 + def warn(callstack, called, args); end +end + +# DeprecatedObjectProxy transforms an object into a deprecated one. It takes an object, a deprecation message, and +# a deprecator. +# +# deprecated_object = ActiveSupport::Deprecation::DeprecatedObjectProxy.new(Object.new, "This object is now deprecated", ActiveSupport::Deprecation.new) +# # => # +# +# deprecated_object.to_s +# DEPRECATION WARNING: This object is now deprecated. +# (Backtrace) +# # => "#" +# +# source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#38 +class ActiveSupport::Deprecation::DeprecatedObjectProxy < ::ActiveSupport::Deprecation::DeprecationProxy + # @return [DeprecatedObjectProxy] a new instance of DeprecatedObjectProxy + # + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#39 + def initialize(object, message, deprecator); end + + private + + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#46 + def target; end + + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#50 + def warn(callstack, called, args); end +end + +# source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#5 +class ActiveSupport::Deprecation::DeprecationProxy + # Don't give a deprecation warning on inspect since test/unit and error + # logs rely on it for diagnostics. + # + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#17 + def inspect; end + + private + + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#22 + def method_missing(called, *args, &block); end + + class << self + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#6 + def new(*args, **kwargs, &block); end + end +end + +# A managed collection of deprecators. Configuration methods, such as +# #behavior=, affect all deprecators in the collection. Additionally, the +# #silence method silences all deprecators in the collection for the +# duration of a given block. +# +# source://activesupport//lib/active_support/deprecation/deprecators.rb#9 +class ActiveSupport::Deprecation::Deprecators + # @return [Deprecators] a new instance of Deprecators + # + # source://activesupport//lib/active_support/deprecation/deprecators.rb#10 + def initialize; end + + # Returns a deprecator added to this collection via #[]=. + # + # source://activesupport//lib/active_support/deprecation/deprecators.rb#16 + def [](name); end + + # Adds a given +deprecator+ to this collection. The deprecator will be + # immediately configured with any options previously set on this + # collection. + # + # deprecators = ActiveSupport::Deprecation::Deprecators.new + # deprecators.debug = true + # + # foo_deprecator = ActiveSupport::Deprecation.new("2.0", "Foo") + # foo_deprecator.debug # => false + # + # deprecators[:foo] = foo_deprecator + # deprecators[:foo].debug # => true + # foo_deprecator.debug # => true + # + # source://activesupport//lib/active_support/deprecation/deprecators.rb#34 + def []=(name, deprecator); end + + # Sets the deprecation warning behavior for all deprecators in this + # collection. + # + # See ActiveSupport::Deprecation#behavior=. + # + # source://activesupport//lib/active_support/deprecation/deprecators.rb#60 + def behavior=(behavior); end + + # Sets the debug flag for all deprecators in this collection. + # + # source://activesupport//lib/active_support/deprecation/deprecators.rb#52 + def debug=(debug); end + + # Sets the disallowed deprecation warning behavior for all deprecators in + # this collection. + # + # See ActiveSupport::Deprecation#disallowed_behavior=. + # + # source://activesupport//lib/active_support/deprecation/deprecators.rb#68 + def disallowed_behavior=(disallowed_behavior); end + + # Sets the disallowed deprecation warnings for all deprecators in this + # collection. + # + # See ActiveSupport::Deprecation#disallowed_warnings=. + # + # source://activesupport//lib/active_support/deprecation/deprecators.rb#76 + def disallowed_warnings=(disallowed_warnings); end + + # Iterates over all deprecators in this collection. If no block is given, + # returns an +Enumerator+. + # + # source://activesupport//lib/active_support/deprecation/deprecators.rb#41 + def each(&block); end + + # Silences all deprecators in this collection for the duration of the + # given block. + # + # See ActiveSupport::Deprecation#silence. + # + # source://activesupport//lib/active_support/deprecation/deprecators.rb#84 + def silence(&block); end + + # Sets the silenced flag for all deprecators in this collection. + # + # source://activesupport//lib/active_support/deprecation/deprecators.rb#47 + def silenced=(silenced); end + + private + + # source://activesupport//lib/active_support/deprecation/deprecators.rb#97 + def apply_options(deprecator); end + + # source://activesupport//lib/active_support/deprecation/deprecators.rb#92 + def set_option(name, value); end +end + +# source://activesupport//lib/active_support/deprecation/disallowed.rb#5 +module ActiveSupport::Deprecation::Disallowed + # Returns the configured criteria used to identify deprecation messages + # which should be treated as disallowed. + # + # source://activesupport//lib/active_support/deprecation/disallowed.rb#21 + def disallowed_warnings; end + + # Sets the criteria used to identify deprecation messages which should be + # disallowed. Can be an array containing strings, symbols, or regular + # expressions. (Symbols are treated as strings.) These are compared against + # the text of the generated deprecation warning. + # + # Additionally the scalar symbol +:all+ may be used to treat all + # deprecations as disallowed. + # + # Deprecations matching a substring or regular expression will be handled + # using the configured Behavior#disallowed_behavior rather than + # Behavior#behavior. + # + # source://activesupport//lib/active_support/deprecation/disallowed.rb#17 + def disallowed_warnings=(_arg0); end + + private + + # @return [Boolean] + # + # source://activesupport//lib/active_support/deprecation/disallowed.rb#26 + def deprecation_disallowed?(message); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/deprecation/disallowed.rb#39 + def explicitly_allowed?(message); end +end + +# source://activesupport//lib/active_support/deprecation.rb#57 +ActiveSupport::Deprecation::MUTEX = T.let(T.unsafe(nil), Thread::Mutex) + +# source://activesupport//lib/active_support/deprecation/method_wrappers.rb#8 +module ActiveSupport::Deprecation::MethodWrapper + # Declare that a method has been deprecated. + # + # class Fred + # def aaa; end + # def bbb; end + # def ccc; end + # def ddd; end + # def eee; end + # end + # + # deprecator = ActiveSupport::Deprecation.new('next-release', 'MyGem') + # + # deprecator.deprecate_methods(Fred, :aaa, bbb: :zzz, ccc: 'use Bar#ccc instead') + # # => Fred + # + # Fred.new.aaa + # # DEPRECATION WARNING: aaa is deprecated and will be removed from MyGem next-release. (called from irb_binding at (irb):10) + # # => nil + # + # Fred.new.bbb + # # DEPRECATION WARNING: bbb is deprecated and will be removed from MyGem next-release (use zzz instead). (called from irb_binding at (irb):11) + # # => nil + # + # Fred.new.ccc + # # DEPRECATION WARNING: ccc is deprecated and will be removed from MyGem next-release (use Bar#ccc instead). (called from irb_binding at (irb):12) + # # => nil + # + # source://activesupport//lib/active_support/deprecation/method_wrappers.rb#35 + def deprecate_methods(target_module, *method_names); end +end + +# source://activesupport//lib/active_support/deprecation/reporting.rb#7 +module ActiveSupport::Deprecation::Reporting + # Allow previously disallowed deprecation warnings within the block. + # allowed_warnings can be an array containing strings, symbols, or regular + # expressions. (Symbols are treated as strings). These are compared against + # the text of deprecation warning messages generated within the block. + # Matching warnings will be exempt from the rules set by + # ActiveSupport::Deprecation#disallowed_warnings. + # + # The optional if: argument accepts a truthy/falsy value or an object that + # responds to .call. If truthy, then matching warnings will be allowed. + # If falsey then the method yields to the block without allowing the warning. + # + # deprecator = ActiveSupport::Deprecation.new + # deprecator.disallowed_behavior = :raise + # deprecator.disallowed_warnings = [ + # "something broke" + # ] + # + # deprecator.warn('something broke!') + # # => ActiveSupport::DeprecationException + # + # deprecator.allow ['something broke'] do + # deprecator.warn('something broke!') + # end + # # => nil + # + # deprecator.allow ['something broke'], if: Rails.env.production? do + # deprecator.warn('something broke!') + # end + # # => ActiveSupport::DeprecationException for dev/test, nil for production + # + # source://activesupport//lib/active_support/deprecation/reporting.rb#89 + def allow(allowed_warnings = T.unsafe(nil), if: T.unsafe(nil), &block); end + + # source://activesupport//lib/active_support/deprecation/reporting.rb#48 + def begin_silence; end + + # source://activesupport//lib/active_support/deprecation/reporting.rb#99 + def deprecation_warning(deprecated_method_name, message = T.unsafe(nil), caller_backtrace = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/deprecation/reporting.rb#52 + def end_silence; end + + # Name of gem where method is deprecated + # + # source://activesupport//lib/active_support/deprecation/reporting.rb#11 + def gem_name; end + + # Name of gem where method is deprecated + # + # source://activesupport//lib/active_support/deprecation/reporting.rb#11 + def gem_name=(_arg0); end + + # Silence deprecation warnings within the block. + # + # deprecator = ActiveSupport::Deprecation.new + # deprecator.warn('something broke!') + # # => "DEPRECATION WARNING: something broke! (called from your_code.rb:1)" + # + # deprecator.silence do + # deprecator.warn('something broke!') + # end + # # => nil + # + # source://activesupport//lib/active_support/deprecation/reporting.rb#41 + def silence(&block); end + + # source://activesupport//lib/active_support/deprecation/reporting.rb#56 + def silenced; end + + # Whether to print a message (silent mode) + # + # source://activesupport//lib/active_support/deprecation/reporting.rb#9 + def silenced=(_arg0); end + + # Outputs a deprecation warning to the output configured by + # ActiveSupport::Deprecation#behavior. + # + # ActiveSupport::Deprecation.new.warn('something broke!') + # # => "DEPRECATION WARNING: something broke! (called from your_code.rb:1)" + # + # source://activesupport//lib/active_support/deprecation/reporting.rb#18 + def warn(message = T.unsafe(nil), callstack = T.unsafe(nil)); end + + private + + # Outputs a deprecation warning message + # + # deprecated_method_warning(:method_name) + # # => "method_name is deprecated and will be removed from Rails #{deprecation_horizon}" + # deprecated_method_warning(:method_name, :another_method) + # # => "method_name is deprecated and will be removed from Rails #{deprecation_horizon} (use another_method instead)" + # deprecated_method_warning(:method_name, "Optional message") + # # => "method_name is deprecated and will be removed from Rails #{deprecation_horizon} (Optional message)" + # + # source://activesupport//lib/active_support/deprecation/reporting.rb#115 + def deprecated_method_warning(method_name, message = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/deprecation/reporting.rb#129 + def deprecation_caller_message(callstack); end + + # source://activesupport//lib/active_support/deprecation/reporting.rb#124 + def deprecation_message(callstack, message = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/deprecation/reporting.rb#140 + def extract_callstack(callstack); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/deprecation/reporting.rb#157 + def ignored_callstack?(path); end +end + +# source://activesupport//lib/active_support/deprecation/reporting.rb#154 +ActiveSupport::Deprecation::Reporting::LIB_DIR = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/deprecation/reporting.rb#152 +ActiveSupport::Deprecation::Reporting::RAILS_GEM_ROOT = T.let(T.unsafe(nil), String) + +# Raised when ActiveSupport::Deprecation::Behavior#behavior is set with :raise. +# You would set :raise, as a behavior to raise errors and proactively report exceptions from deprecations. +# +# source://activesupport//lib/active_support/deprecation/behaviors.rb#8 +class ActiveSupport::DeprecationException < ::StandardError; end + +# = Active Support Descendants Tracker +# +# This module provides an internal implementation to track descendants +# which is faster than iterating through +ObjectSpace+. +# +# However Ruby 3.1 provide a fast native +Class#subclasses+ method, +# so if you know your code won't be executed on older rubies, including +# +ActiveSupport::DescendantsTracker+ does not provide any benefit. +# +# source://activesupport//lib/active_support/descendants_tracker.rb#14 +module ActiveSupport::DescendantsTracker + # source://activesupport//lib/active_support/descendants_tracker.rb#107 + def descendants; end + + class << self + # source://activesupport//lib/active_support/descendants_tracker.rb#78 + def clear(classes); end + + # source://activesupport//lib/active_support/descendants_tracker.rb#102 + def descendants(klass); end + + # source://activesupport//lib/active_support/descendants_tracker.rb#69 + def disable_clear!; end + + # source://activesupport//lib/active_support/descendants_tracker.rb#89 + def reject!(classes); end + + # source://activesupport//lib/active_support/descendants_tracker.rb#98 + def subclasses(klass); end + end +end + +# source://activesupport//lib/active_support/descendants_tracker.rb#58 +module ActiveSupport::DescendantsTracker::ReloadedClassesFiltering + # source://activesupport//lib/active_support/descendants_tracker.rb#63 + def descendants; end + + # source://activesupport//lib/active_support/descendants_tracker.rb#59 + def subclasses; end +end + +# On TruffleRuby `ObjectSpace::WeakMap` keys are strong references. +# So we use `object_id` as a key and the actual object as a value. +# +# JRuby for now doesn't have Class#descendant, but when it will, it will likely +# have the same WeakMap semantic than Truffle so we future proof this as much as possible. +# +# source://activesupport//lib/active_support/descendants_tracker.rb#20 +class ActiveSupport::DescendantsTracker::WeakSet < ::ObjectSpace::WeakMap + # source://activesupport//lib/active_support/descendants_tracker.rb#23 + def <<(object); end + + # source://activesupport//lib/active_support/descendants_tracker.rb#21 + def to_a; end +end + +# source://activesupport//lib/active_support/digest.rb#6 +class ActiveSupport::Digest + class << self + # source://activesupport//lib/active_support/digest.rb#8 + def hash_digest_class; end + + # @raise [ArgumentError] + # + # source://activesupport//lib/active_support/digest.rb#12 + def hash_digest_class=(klass); end + + # source://activesupport//lib/active_support/digest.rb#17 + def hexdigest(arg); end + end +end + +# = Active Support \Duration +# +# Provides accurate date and time measurements using Date#advance and +# Time#advance, respectively. It mainly supports the methods on Numeric. +# +# 1.month.ago # equivalent to Time.now.advance(months: -1) +# +# source://activesupport//lib/active_support/duration.rb#14 +class ActiveSupport::Duration + # @return [Duration] a new instance of Duration + # + # source://activesupport//lib/active_support/duration.rb#226 + def initialize(value, parts, variable = T.unsafe(nil)); end + + # Returns the modulo of this Duration by another Duration or Numeric. + # Numeric values are treated as seconds. + # + # source://activesupport//lib/active_support/duration.rb#312 + def %(other); end + + # Multiplies this Duration by a Numeric and returns a new Duration. + # + # source://activesupport//lib/active_support/duration.rb#287 + def *(other); end + + # Adds another Duration or a Numeric to this Duration. Numeric values + # are treated as seconds. + # + # source://activesupport//lib/active_support/duration.rb#268 + def +(other); end + + # source://activesupport//lib/active_support/duration.rb#326 + def +@; end + + # Subtracts another Duration or a Numeric from this Duration. Numeric + # values are treated as seconds. + # + # source://activesupport//lib/active_support/duration.rb#282 + def -(other); end + + # source://activesupport//lib/active_support/duration.rb#322 + def -@; end + + # Divides this Duration by a Numeric and returns a new Duration. + # + # source://activesupport//lib/active_support/duration.rb#298 + def /(other); end + + # Compares one Duration with another or a Numeric to this Duration. + # Numeric values are treated as seconds. + # + # source://activesupport//lib/active_support/duration.rb#258 + def <=>(other); end + + # Returns +true+ if +other+ is also a Duration instance with the + # same +value+, or if other == value. + # + # source://activesupport//lib/active_support/duration.rb#341 + def ==(other); end + + # source://activesupport//lib/active_support/duration.rb#481 + def _parts; end + + # source://activesupport//lib/active_support/duration.rb#224 + def abs(&_arg0); end + + # Calculates a new Time or Date that is as far in the future + # as this Duration represents. + # + # source://activesupport//lib/active_support/duration.rb#440 + def after(time = T.unsafe(nil)); end + + # Calculates a new Time or Date that is as far in the past + # as this Duration represents. + # + # source://activesupport//lib/active_support/duration.rb#444 + def ago(time = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/duration.rb#459 + def as_json(options = T.unsafe(nil)); end + + # Calculates a new Time or Date that is as far in the past + # as this Duration represents. + # + # source://activesupport//lib/active_support/duration.rb#448 + def before(time = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/duration.rb#245 + def coerce(other); end + + # source://activesupport//lib/active_support/duration.rb#467 + def encode_with(coder); end + + # Returns +true+ if +other+ is also a Duration instance, which has the + # same parts as this one. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/duration.rb#426 + def eql?(other); end + + # Calculates a new Time or Date that is as far in the future + # as this Duration represents. + # + # source://activesupport//lib/active_support/duration.rb#439 + def from_now(time = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/duration.rb#430 + def hash; end + + # Returns the amount of days a duration covers as a float + # + # 12.hours.in_days # => 0.5 + # + # source://activesupport//lib/active_support/duration.rb#399 + def in_days; end + + # Returns the amount of hours a duration covers as a float + # + # 1.day.in_hours # => 24.0 + # + # source://activesupport//lib/active_support/duration.rb#392 + def in_hours; end + + # Returns the amount of minutes a duration covers as a float + # + # 1.day.in_minutes # => 1440.0 + # + # source://activesupport//lib/active_support/duration.rb#385 + def in_minutes; end + + # Returns the amount of months a duration covers as a float + # + # 9.weeks.in_months # => 2.07 + # + # source://activesupport//lib/active_support/duration.rb#413 + def in_months; end + + # Returns the number of seconds that this Duration represents. + # + # 1.minute.to_i # => 60 + # 1.hour.to_i # => 3600 + # 1.day.to_i # => 86400 + # + # Note that this conversion makes some assumptions about the + # duration of some periods, e.g. months are always 1/12 of year + # and years are 365.2425 days: + # + # # equivalent to (1.year / 12).to_i + # 1.month.to_i # => 2629746 + # + # # equivalent to 365.2425.days.to_i + # 1.year.to_i # => 31556952 + # + # In such cases, Ruby's core + # Date[https://docs.ruby-lang.org/en/master/Date.html] and + # Time[https://docs.ruby-lang.org/en/master/Time.html] should be used for precision + # date and time arithmetic. + # + # source://activesupport//lib/active_support/duration.rb#380 + def in_seconds; end + + # Returns the amount of weeks a duration covers as a float + # + # 2.months.in_weeks # => 8.696 + # + # source://activesupport//lib/active_support/duration.rb#406 + def in_weeks; end + + # Returns the amount of years a duration covers as a float + # + # 30.days.in_years # => 0.082 + # + # source://activesupport//lib/active_support/duration.rb#420 + def in_years; end + + # source://activesupport//lib/active_support/duration.rb#463 + def init_with(coder); end + + # source://activesupport//lib/active_support/duration.rb#450 + def inspect; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/duration.rb#335 + def instance_of?(klass); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/duration.rb#330 + def is_a?(klass); end + + # Build ISO 8601 Duration string for this duration. + # The +precision+ parameter can be used to limit seconds' precision of duration. + # + # source://activesupport//lib/active_support/duration.rb#473 + def iso8601(precision: T.unsafe(nil)); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/duration.rb#333 + def kind_of?(klass); end + + # source://activesupport//lib/active_support/duration.rb#224 + def negative?(&_arg0); end + + # Returns a copy of the parts hash that defines the duration. + # + # 5.minutes.parts # => {:minutes=>5} + # 3.years.parts # => {:years=>3} + # + # source://activesupport//lib/active_support/duration.rb#241 + def parts; end + + # source://activesupport//lib/active_support/duration.rb#224 + def positive?(&_arg0); end + + # Calculates a new Time or Date that is as far in the future + # as this Duration represents. + # + # source://activesupport//lib/active_support/duration.rb#436 + def since(time = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/duration.rb#224 + def to_f(&_arg0); end + + # Returns the number of seconds that this Duration represents. + # + # 1.minute.to_i # => 60 + # 1.hour.to_i # => 3600 + # 1.day.to_i # => 86400 + # + # Note that this conversion makes some assumptions about the + # duration of some periods, e.g. months are always 1/12 of year + # and years are 365.2425 days: + # + # # equivalent to (1.year / 12).to_i + # 1.month.to_i # => 2629746 + # + # # equivalent to 365.2425.days.to_i + # 1.year.to_i # => 31556952 + # + # In such cases, Ruby's core + # Date[https://docs.ruby-lang.org/en/master/Date.html] and + # Time[https://docs.ruby-lang.org/en/master/Time.html] should be used for precision + # date and time arithmetic. + # + # source://activesupport//lib/active_support/duration.rb#377 + def to_i; end + + # Returns the amount of seconds a duration covers as a string. + # For more information check to_i method. + # + # 1.day.to_s # => "86400" + # + # source://activesupport//lib/active_support/duration.rb#353 + def to_s; end + + # Calculates a new Time or Date that is as far in the past + # as this Duration represents. + # + # source://activesupport//lib/active_support/duration.rb#447 + def until(time = T.unsafe(nil)); end + + # Returns the value of attribute value. + # + # source://activesupport//lib/active_support/duration.rb#133 + def value; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/duration.rb#477 + def variable?; end + + # source://activesupport//lib/active_support/duration.rb#224 + def zero?(&_arg0); end + + private + + # source://activesupport//lib/active_support/duration.rb#516 + def method_missing(*_arg0, **_arg1, &_arg2); end + + # @raise [TypeError] + # + # source://activesupport//lib/active_support/duration.rb#520 + def raise_type_error(other); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/duration.rb#512 + def respond_to_missing?(method, _); end + + # source://activesupport//lib/active_support/duration.rb#486 + def sum(sign, time = T.unsafe(nil)); end + + class << self + # source://activesupport//lib/active_support/duration.rb#149 + def ===(other); end + + # Creates a new Duration from a seconds value that is converted + # to the individual parts: + # + # ActiveSupport::Duration.build(31556952).parts # => {:years=>1} + # ActiveSupport::Duration.build(2716146).parts # => {:months=>1, :days=>1} + # + # source://activesupport//lib/active_support/duration.rb#189 + def build(value); end + + # source://activesupport//lib/active_support/duration.rb#167 + def days(value); end + + # source://activesupport//lib/active_support/duration.rb#163 + def hours(value); end + + # source://activesupport//lib/active_support/duration.rb#159 + def minutes(value); end + + # source://activesupport//lib/active_support/duration.rb#175 + def months(value); end + + # Creates a new Duration from string formatted according to ISO 8601 Duration. + # + # See {ISO 8601}[https://en.wikipedia.org/wiki/ISO_8601#Durations] for more information. + # This method allows negative parts to be present in pattern. + # If invalid string is provided, it will raise +ActiveSupport::Duration::ISO8601Parser::ParsingError+. + # + # source://activesupport//lib/active_support/duration.rb#144 + def parse(iso8601duration); end + + # source://activesupport//lib/active_support/duration.rb#155 + def seconds(value); end + + # source://activesupport//lib/active_support/duration.rb#171 + def weeks(value); end + + # source://activesupport//lib/active_support/duration.rb#179 + def years(value); end + + private + + # source://activesupport//lib/active_support/duration.rb#217 + def calculate_total_seconds(parts); end + end +end + +# Parses a string formatted according to ISO 8601 Duration into the hash. +# +# See {ISO 8601}[https://en.wikipedia.org/wiki/ISO_8601#Durations] for more information. +# +# This parser allows negative parts to be present in pattern. +# +# source://activesupport//lib/active_support/duration/iso8601_parser.rb#12 +class ActiveSupport::Duration::ISO8601Parser + # @return [ISO8601Parser] a new instance of ISO8601Parser + # + # source://activesupport//lib/active_support/duration/iso8601_parser.rb#34 + def initialize(string); end + + # Returns the value of attribute mode. + # + # source://activesupport//lib/active_support/duration/iso8601_parser.rb#32 + def mode; end + + # Sets the attribute mode + # + # @param value the value to set the attribute mode to. + # + # source://activesupport//lib/active_support/duration/iso8601_parser.rb#32 + def mode=(_arg0); end + + # source://activesupport//lib/active_support/duration/iso8601_parser.rb#41 + def parse!; end + + # Returns the value of attribute parts. + # + # source://activesupport//lib/active_support/duration/iso8601_parser.rb#31 + def parts; end + + # Returns the value of attribute scanner. + # + # source://activesupport//lib/active_support/duration/iso8601_parser.rb#31 + def scanner; end + + # Returns the value of attribute sign. + # + # source://activesupport//lib/active_support/duration/iso8601_parser.rb#32 + def sign; end + + # Sets the attribute sign + # + # @param value the value to set the attribute sign to. + # + # source://activesupport//lib/active_support/duration/iso8601_parser.rb#32 + def sign=(_arg0); end + + private + + # @return [Boolean] + # + # source://activesupport//lib/active_support/duration/iso8601_parser.rb#83 + def finished?; end + + # Parses number which can be a float with either comma or period. + # + # source://activesupport//lib/active_support/duration/iso8601_parser.rb#88 + def number; end + + # @raise [ParsingError] + # + # source://activesupport//lib/active_support/duration/iso8601_parser.rb#96 + def raise_parsing_error(reason = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/duration/iso8601_parser.rb#92 + def scan(pattern); end + + # Checks for various semantic errors as stated in ISO 8601 standard. + # + # source://activesupport//lib/active_support/duration/iso8601_parser.rb#101 + def validate!; end +end + +# source://activesupport//lib/active_support/duration/iso8601_parser.rb#17 +ActiveSupport::Duration::ISO8601Parser::COMMA = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/duration/iso8601_parser.rb#22 +ActiveSupport::Duration::ISO8601Parser::DATE_COMPONENT = T.let(T.unsafe(nil), Regexp) + +# source://activesupport//lib/active_support/duration/iso8601_parser.rb#28 +ActiveSupport::Duration::ISO8601Parser::DATE_COMPONENTS = T.let(T.unsafe(nil), Array) + +# source://activesupport//lib/active_support/duration/iso8601_parser.rb#20 +ActiveSupport::Duration::ISO8601Parser::DATE_MARKER = T.let(T.unsafe(nil), Regexp) + +# source://activesupport//lib/active_support/duration/iso8601_parser.rb#25 +ActiveSupport::Duration::ISO8601Parser::DATE_TO_PART = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/duration/iso8601_parser.rb#16 +ActiveSupport::Duration::ISO8601Parser::PERIOD = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/duration/iso8601_parser.rb#15 +ActiveSupport::Duration::ISO8601Parser::PERIOD_OR_COMMA = T.let(T.unsafe(nil), Regexp) + +# source://activesupport//lib/active_support/duration/iso8601_parser.rb#13 +class ActiveSupport::Duration::ISO8601Parser::ParsingError < ::ArgumentError; end + +# source://activesupport//lib/active_support/duration/iso8601_parser.rb#19 +ActiveSupport::Duration::ISO8601Parser::SIGN_MARKER = T.let(T.unsafe(nil), Regexp) + +# source://activesupport//lib/active_support/duration/iso8601_parser.rb#23 +ActiveSupport::Duration::ISO8601Parser::TIME_COMPONENT = T.let(T.unsafe(nil), Regexp) + +# source://activesupport//lib/active_support/duration/iso8601_parser.rb#29 +ActiveSupport::Duration::ISO8601Parser::TIME_COMPONENTS = T.let(T.unsafe(nil), Array) + +# source://activesupport//lib/active_support/duration/iso8601_parser.rb#21 +ActiveSupport::Duration::ISO8601Parser::TIME_MARKER = T.let(T.unsafe(nil), Regexp) + +# source://activesupport//lib/active_support/duration/iso8601_parser.rb#26 +ActiveSupport::Duration::ISO8601Parser::TIME_TO_PART = T.let(T.unsafe(nil), Hash) + +# Serializes duration to string according to ISO 8601 Duration format. +# +# source://activesupport//lib/active_support/duration/iso8601_serializer.rb#6 +class ActiveSupport::Duration::ISO8601Serializer + # @return [ISO8601Serializer] a new instance of ISO8601Serializer + # + # source://activesupport//lib/active_support/duration/iso8601_serializer.rb#9 + def initialize(duration, precision: T.unsafe(nil)); end + + # Builds and returns output string. + # + # source://activesupport//lib/active_support/duration/iso8601_serializer.rb#15 + def serialize; end + + private + + # source://activesupport//lib/active_support/duration/iso8601_serializer.rb#55 + def format_seconds(seconds); end + + # Return pair of duration's parts and whole duration sign. + # Parts are summarized (as they can become repetitive due to addition, etc). + # Zero parts are removed as not significant. + # + # source://activesupport//lib/active_support/duration/iso8601_serializer.rb#38 + def normalize; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/duration/iso8601_serializer.rb#51 + def week_mixed_with_date?(parts); end +end + +# source://activesupport//lib/active_support/duration/iso8601_serializer.rb#7 +ActiveSupport::Duration::ISO8601Serializer::DATE_COMPONENTS = T.let(T.unsafe(nil), Array) + +# source://activesupport//lib/active_support/duration.rb#130 +ActiveSupport::Duration::PARTS = T.let(T.unsafe(nil), Array) + +# source://activesupport//lib/active_support/duration.rb#120 +ActiveSupport::Duration::PARTS_IN_SECONDS = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/duration.rb#115 +ActiveSupport::Duration::SECONDS_PER_DAY = T.let(T.unsafe(nil), Integer) + +# source://activesupport//lib/active_support/duration.rb#114 +ActiveSupport::Duration::SECONDS_PER_HOUR = T.let(T.unsafe(nil), Integer) + +# source://activesupport//lib/active_support/duration.rb#113 +ActiveSupport::Duration::SECONDS_PER_MINUTE = T.let(T.unsafe(nil), Integer) + +# 1/12 of a gregorian year +# +# source://activesupport//lib/active_support/duration.rb#117 +ActiveSupport::Duration::SECONDS_PER_MONTH = T.let(T.unsafe(nil), Integer) + +# source://activesupport//lib/active_support/duration.rb#116 +ActiveSupport::Duration::SECONDS_PER_WEEK = T.let(T.unsafe(nil), Integer) + +# length of a gregorian year (365.2425 days) +# +# source://activesupport//lib/active_support/duration.rb#118 +ActiveSupport::Duration::SECONDS_PER_YEAR = T.let(T.unsafe(nil), Integer) + +# source://activesupport//lib/active_support/duration.rb#15 +class ActiveSupport::Duration::Scalar < ::Numeric + # @return [Scalar] a new instance of Scalar + # + # source://activesupport//lib/active_support/duration.rb#19 + def initialize(value); end + + # source://activesupport//lib/active_support/duration.rb#85 + def %(other); end + + # source://activesupport//lib/active_support/duration.rb#66 + def *(other); end + + # source://activesupport//lib/active_support/duration.rb#41 + def +(other); end + + # source://activesupport//lib/active_support/duration.rb#53 + def -(other); end + + # source://activesupport//lib/active_support/duration.rb#27 + def -@; end + + # source://activesupport//lib/active_support/duration.rb#77 + def /(other); end + + # source://activesupport//lib/active_support/duration.rb#31 + def <=>(other); end + + # source://activesupport//lib/active_support/duration.rb#23 + def coerce(other); end + + # source://activesupport//lib/active_support/duration.rb#17 + def to_f(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/duration.rb#17 + def to_i(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/duration.rb#17 + def to_s(*_arg0, **_arg1, &_arg2); end + + # Returns the value of attribute value. + # + # source://activesupport//lib/active_support/duration.rb#16 + def value; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/duration.rb#93 + def variable?; end + + private + + # source://activesupport//lib/active_support/duration.rb#98 + def calculate(op, other); end + + # @raise [TypeError] + # + # source://activesupport//lib/active_support/duration.rb#108 + def raise_type_error(other); end +end + +# source://activesupport//lib/active_support/duration.rb#131 +ActiveSupport::Duration::VARIABLE_PARTS = T.let(T.unsafe(nil), Array) + +# source://activesupport//lib/active_support/editor.rb#6 +class ActiveSupport::Editor + # @return [Editor] a new instance of Editor + # + # source://activesupport//lib/active_support/editor.rb#48 + def initialize(url_pattern); end + + # source://activesupport//lib/active_support/editor.rb#52 + def url_for(path, line); end + + class << self + # Returns the current editor pattern if it is known. + # First check for the `RAILS_EDITOR` environment variable, and if it's + # missing, check for the `EDITOR` environment variable. + # + # source://activesupport//lib/active_support/editor.rb#28 + def current; end + + # source://activesupport//lib/active_support/editor.rb#39 + def find(name); end + + # Registers a URL pattern for opening file in a given editor. + # This allows Rails to generate clickable links to control known editors. + # + # Example: + # + # ActiveSupport::Editor.register("myeditor", "myeditor://%s:%d") + # + # source://activesupport//lib/active_support/editor.rb#17 + def register(name, url_pattern, aliases: T.unsafe(nil)); end + + # source://activesupport//lib/active_support/editor.rb#43 + def reset; end + end +end + +# = Encrypted Configuration +# +# Provides convenience methods on top of EncryptedFile to access values stored +# as encrypted YAML. +# +# Values can be accessed via +Hash+ methods, such as +fetch+ and +dig+, or via +# dynamic accessor methods, similar to OrderedOptions. +# +# my_config = ActiveSupport::EncryptedConfiguration.new(...) +# my_config.read # => "some_secret: 123\nsome_namespace:\n another_secret: 456" +# +# my_config[:some_secret] +# # => 123 +# my_config.some_secret +# # => 123 +# my_config.dig(:some_namespace, :another_secret) +# # => 456 +# my_config.some_namespace.another_secret +# # => 456 +# my_config.fetch(:foo) +# # => KeyError +# my_config.foo! +# # => KeyError +# +# source://activesupport//lib/active_support/encrypted_configuration.rb#35 +class ActiveSupport::EncryptedConfiguration < ::ActiveSupport::EncryptedFile + # @return [EncryptedConfiguration] a new instance of EncryptedConfiguration + # + # source://activesupport//lib/active_support/encrypted_configuration.rb#54 + def initialize(config_path:, key_path:, env_key:, raise_if_missing_key:); end + + # Returns the decrypted content as a Hash with symbolized keys. + # + # my_config = ActiveSupport::EncryptedConfiguration.new(...) + # my_config.read # => "some_secret: 123\nsome_namespace:\n another_secret: 456" + # + # my_config.config + # # => { some_secret: 123, some_namespace: { another_secret: 789 } } + # + # source://activesupport//lib/active_support/encrypted_configuration.rb#85 + def config; end + + # source://activesupport//lib/active_support/encrypted_configuration.rb#89 + def inspect; end + + # source://activesupport//lib/active_support/encrypted_configuration.rb#52 + def method_missing(method, *_arg1, **_arg2, &_arg3); end + + # Reads the file and returns the decrypted content. See EncryptedFile#read. + # + # source://activesupport//lib/active_support/encrypted_configuration.rb#62 + def read; end + + # source://activesupport//lib/active_support/encrypted_configuration.rb#69 + def validate!; end + + private + + # source://activesupport//lib/active_support/encrypted_configuration.rb#94 + def deep_symbolize_keys(hash); end + + # source://activesupport//lib/active_support/encrypted_configuration.rb#102 + def deep_transform(hash); end + + # source://activesupport//lib/active_support/encrypted_configuration.rb#116 + def deserialize(content); end + + # source://activesupport//lib/active_support/encrypted_configuration.rb#112 + def options; end + + # source://activesupport//lib/active_support/encrypted_configuration.rb#52 + def respond_to_missing?(name, include_private = T.unsafe(nil)); end +end + +# source://activesupport//lib/active_support/encrypted_configuration.rb#36 +class ActiveSupport::EncryptedConfiguration::InvalidContentError < ::RuntimeError + # @return [InvalidContentError] a new instance of InvalidContentError + # + # source://activesupport//lib/active_support/encrypted_configuration.rb#37 + def initialize(content_path); end + + # source://activesupport//lib/active_support/encrypted_configuration.rb#41 + def message; end +end + +# source://activesupport//lib/active_support/encrypted_configuration.rb#46 +class ActiveSupport::EncryptedConfiguration::InvalidKeyError < ::RuntimeError + # @return [InvalidKeyError] a new instance of InvalidKeyError + # + # source://activesupport//lib/active_support/encrypted_configuration.rb#47 + def initialize(content_path, key); end +end + +# source://activesupport//lib/active_support/encrypted_file.rb#8 +class ActiveSupport::EncryptedFile + # @return [EncryptedFile] a new instance of EncryptedFile + # + # source://activesupport//lib/active_support/encrypted_file.rb#42 + def initialize(content_path:, key_path:, env_key:, raise_if_missing_key:); end + + # source://activesupport//lib/active_support/encrypted_file.rb#83 + def change(&block); end + + # Returns the value of attribute content_path. + # + # source://activesupport//lib/active_support/encrypted_file.rb#40 + def content_path; end + + # Returns the value of attribute env_key. + # + # source://activesupport//lib/active_support/encrypted_file.rb#40 + def env_key; end + + # Returns the encryption key, first trying the environment variable + # specified by +env_key+, then trying the key file specified by +key_path+. + # If +raise_if_missing_key+ is true, raises MissingKeyError if the + # environment variable is not set and the key file does not exist. + # + # source://activesupport//lib/active_support/encrypted_file.rb#52 + def key; end + + # Returns truthy if #key is truthy. Returns falsy otherwise. Unlike #key, + # does not raise MissingKeyError when +raise_if_missing_key+ is true. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/encrypted_file.rb#58 + def key?; end + + # Returns the value of attribute key_path. + # + # source://activesupport//lib/active_support/encrypted_file.rb#40 + def key_path; end + + # Returns the value of attribute raise_if_missing_key. + # + # source://activesupport//lib/active_support/encrypted_file.rb#40 + def raise_if_missing_key; end + + # Reads the file and returns the decrypted content. + # + # Raises: + # - MissingKeyError if the key is missing and +raise_if_missing_key+ is true. + # - MissingContentError if the encrypted file does not exist or otherwise + # if the key is missing. + # - ActiveSupport::MessageEncryptor::InvalidMessage if the content cannot be + # decrypted or verified. + # + # source://activesupport//lib/active_support/encrypted_file.rb#70 + def read; end + + # source://activesupport//lib/active_support/encrypted_file.rb#78 + def write(contents); end + + private + + # @raise [InvalidKeyLengthError] + # + # source://activesupport//lib/active_support/encrypted_file.rb#129 + def check_key_length; end + + # source://activesupport//lib/active_support/encrypted_file.rb#108 + def decrypt(contents); end + + # source://activesupport//lib/active_support/encrypted_file.rb#103 + def encrypt(contents); end + + # source://activesupport//lib/active_support/encrypted_file.rb#112 + def encryptor; end + + # @raise [MissingKeyError] + # + # source://activesupport//lib/active_support/encrypted_file.rb#125 + def handle_missing_key; end + + # source://activesupport//lib/active_support/encrypted_file.rb#117 + def read_env_key; end + + # source://activesupport//lib/active_support/encrypted_file.rb#121 + def read_key_file; end + + # source://activesupport//lib/active_support/encrypted_file.rb#89 + def writing(contents); end + + class << self + # source://activesupport//lib/active_support/encrypted_file.rb#35 + def expected_key_length; end + + # source://activesupport//lib/active_support/encrypted_file.rb#31 + def generate_key; end + end +end + +# source://activesupport//lib/active_support/encrypted_file.rb#29 +ActiveSupport::EncryptedFile::CIPHER = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/encrypted_file.rb#23 +class ActiveSupport::EncryptedFile::InvalidKeyLengthError < ::RuntimeError + # @return [InvalidKeyLengthError] a new instance of InvalidKeyLengthError + # + # source://activesupport//lib/active_support/encrypted_file.rb#24 + def initialize; end +end + +# source://activesupport//lib/active_support/encrypted_file.rb#9 +class ActiveSupport::EncryptedFile::MissingContentError < ::RuntimeError + # @return [MissingContentError] a new instance of MissingContentError + # + # source://activesupport//lib/active_support/encrypted_file.rb#10 + def initialize(content_path); end +end + +# source://activesupport//lib/active_support/encrypted_file.rb#15 +class ActiveSupport::EncryptedFile::MissingKeyError < ::RuntimeError + # @return [MissingKeyError] a new instance of MissingKeyError + # + # source://activesupport//lib/active_support/encrypted_file.rb#16 + def initialize(key_path:, env_key:); end +end + +# source://activesupport//lib/active_support/core_ext/enumerable.rb#4 +module ActiveSupport::EnumerableCoreExt; end + +# source://activesupport//lib/active_support/core_ext/enumerable.rb#5 +module ActiveSupport::EnumerableCoreExt::Constants + private + + # source://activesupport//lib/active_support/core_ext/enumerable.rb#7 + def const_missing(name); end +end + +# HACK: For performance reasons, Enumerable shouldn't have any constants of its own. +# So we move SoleItemExpectedError into ActiveSupport::EnumerableCoreExt. +# +# source://activesupport//lib/active_support/core_ext/enumerable.rb#25 +ActiveSupport::EnumerableCoreExt::SoleItemExpectedError = Enumerable::SoleItemExpectedError + +# source://activesupport//lib/active_support/environment_inquirer.rb#9 +class ActiveSupport::EnvironmentInquirer < ::ActiveSupport::StringInquirer + # @raise [ArgumentError] + # @return [EnvironmentInquirer] a new instance of EnvironmentInquirer + # + # source://activesupport//lib/active_support/environment_inquirer.rb#15 + def initialize(env); end + + # source://activesupport//lib/active_support/environment_inquirer.rb#28 + def development?; end + + # Returns true if we're in the development or test environment. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/environment_inquirer.rb#36 + def local?; end + + # source://activesupport//lib/active_support/environment_inquirer.rb#28 + def production?; end + + # source://activesupport//lib/active_support/environment_inquirer.rb#28 + def test?; end +end + +# Optimization for the three default environments, so this inquirer doesn't need to rely on +# the slower delegation through method_missing that StringInquirer would normally entail. +# +# source://activesupport//lib/active_support/environment_inquirer.rb#10 +ActiveSupport::EnvironmentInquirer::DEFAULT_ENVIRONMENTS = T.let(T.unsafe(nil), Array) + +# Environments that'll respond true for #local? +# +# source://activesupport//lib/active_support/environment_inquirer.rb#13 +ActiveSupport::EnvironmentInquirer::LOCAL_ENVIRONMENTS = T.let(T.unsafe(nil), Array) + +# = Active Support \Error Reporter +# +# +ActiveSupport::ErrorReporter+ is a common interface for error reporting services. +# +# To rescue and report any unhandled error, you can use the #handle method: +# +# Rails.error.handle do +# do_something! +# end +# +# If an error is raised, it will be reported and swallowed. +# +# Alternatively, if you want to report the error but not swallow it, you can use #record: +# +# Rails.error.record do +# do_something! +# end +# +# Both methods can be restricted to handle only a specific error class: +# +# maybe_tags = Rails.error.handle(Redis::BaseError) { redis.get("tags") } +# +# source://activesupport//lib/active_support/error_reporter.rb#26 +class ActiveSupport::ErrorReporter + # @return [ErrorReporter] a new instance of ErrorReporter + # + # source://activesupport//lib/active_support/error_reporter.rb#35 + def initialize(*subscribers, logger: T.unsafe(nil)); end + + # Add a middleware to modify the error context before it is sent to subscribers. + # + # Middleware is added to a stack of callables run on an error's execution context + # before passing to subscribers. Allows creation of entries in error context that + # are shared by all subscribers. + # + # A context middleware receives the same parameters as #report. + # It must return a hash - the middleware stack returns the hash after it has + # run through all middlewares. A middleware can mutate or replace the hash. + # + # Rails.error.add_middleware(-> (error, context) { context.merge({ foo: :bar }) }) + # + # source://activesupport//lib/active_support/error_reporter.rb#218 + def add_middleware(middleware); end + + # Returns the value of attribute debug_mode. + # + # source://activesupport//lib/active_support/error_reporter.rb#31 + def debug_mode; end + + # Sets the attribute debug_mode + # + # @param value the value to set the attribute debug_mode to. + # + # source://activesupport//lib/active_support/error_reporter.rb#31 + def debug_mode=(_arg0); end + + # Prevent a subscriber from being notified of errors for the + # duration of the block. You may pass in the subscriber itself, or its class. + # + # This can be helpful for error reporting service integrations, when they wish + # to handle any errors higher in the stack. + # + # source://activesupport//lib/active_support/error_reporter.rb#186 + def disable(subscriber); end + + # Evaluates the given block, reporting and swallowing any unhandled error. + # If no error is raised, returns the return value of the block. Otherwise, + # returns the result of +fallback.call+, or +nil+ if +fallback+ is not + # specified. + # + # # Will report a TypeError to all subscribers and return nil. + # Rails.error.handle do + # 1 + '1' + # end + # + # Can be restricted to handle only specific error classes: + # + # maybe_tags = Rails.error.handle(Redis::BaseError) { redis.get("tags") } + # + # ==== Options + # + # * +:severity+ - This value is passed along to subscribers to indicate how + # important the error report is. Can be +:error+, +:warning+, or +:info+. + # Defaults to +:warning+. + # + # * +:context+ - Extra information that is passed along to subscribers. For + # example: + # + # Rails.error.handle(context: { section: "admin" }) do + # # ... + # end + # + # * +:fallback+ - A callable that provides +handle+'s return value when an + # unhandled error is raised. For example: + # + # user = Rails.error.handle(fallback: -> { User.anonymous }) do + # User.find_by(params) + # end + # + # * +:source+ - This value is passed along to subscribers to indicate the + # source of the error. Subscribers can use this value to ignore certain + # errors. Defaults to "application". + # + # source://activesupport//lib/active_support/error_reporter.rb#79 + def handle(*error_classes, severity: T.unsafe(nil), context: T.unsafe(nil), fallback: T.unsafe(nil), source: T.unsafe(nil)); end + + # Returns the value of attribute logger. + # + # source://activesupport//lib/active_support/error_reporter.rb#31 + def logger; end + + # Sets the attribute logger + # + # @param value the value to set the attribute logger to. + # + # source://activesupport//lib/active_support/error_reporter.rb#31 + def logger=(_arg0); end + + # Evaluates the given block, reporting and re-raising any unhandled error. + # If no error is raised, returns the return value of the block. + # + # # Will report a TypeError to all subscribers and re-raise it. + # Rails.error.record do + # 1 + '1' + # end + # + # Can be restricted to handle only specific error classes: + # + # tags = Rails.error.record(Redis::BaseError) { redis.get("tags") } + # + # ==== Options + # + # * +:severity+ - This value is passed along to subscribers to indicate how + # important the error report is. Can be +:error+, +:warning+, or +:info+. + # Defaults to +:error+. + # + # * +:context+ - Extra information that is passed along to subscribers. For + # example: + # + # Rails.error.record(context: { section: "admin" }) do + # # ... + # end + # + # * +:source+ - This value is passed along to subscribers to indicate the + # source of the error. Subscribers can use this value to ignore certain + # errors. Defaults to "application". + # + # source://activesupport//lib/active_support/error_reporter.rb#115 + def record(*error_classes, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil)); end + + # Report an error directly to subscribers. You can use this method when the + # block-based #handle and #record methods are not suitable. + # + # Rails.error.report(error) + # + # The +error+ argument must be an instance of Exception. + # + # Rails.error.report(Exception.new("Something went wrong")) + # + # Otherwise you can use #unexpected to report an error which does accept a + # string argument. + # + # @raise [ArgumentError] + # + # source://activesupport//lib/active_support/error_reporter.rb#233 + def report(error, handled: T.unsafe(nil), severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil)); end + + # Update the execution context that is accessible to error subscribers. Any + # context passed to #handle, #record, or #report will be merged with the + # context set here. + # + # Rails.error.set_context(section: "checkout", user_id: @user.id) + # + # source://activesupport//lib/active_support/error_reporter.rb#202 + def set_context(*_arg0, **_arg1, &_arg2); end + + # Register a new error subscriber. The subscriber must respond to + # + # report(Exception, handled: Boolean, severity: (:error OR :warning OR :info), context: Hash, source: String) + # + # The +report+ method should never raise an error. + # + # source://activesupport//lib/active_support/error_reporter.rb#162 + def subscribe(subscriber); end + + # Either report the given error when in production, or raise it when in development or test. + # + # When called in production, after the error is reported, this method will return + # nil and execution will continue. + # + # When called in development, the original error is wrapped in a different error class to ensure + # it's not being rescued higher in the stack and will be surfaced to the developer. + # + # This method is intended for reporting violated assertions about preconditions, or similar + # cases that can and should be gracefully handled in production, but that aren't supposed to happen. + # + # The error can be either an exception instance or a String. + # + # example: + # + # def edit + # if published? + # Rails.error.unexpected("[BUG] Attempting to edit a published article, that shouldn't be possible") + # return false + # end + # # ... + # end + # + # source://activesupport//lib/active_support/error_reporter.rb#146 + def unexpected(error, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil)); end + + # Unregister an error subscriber. Accepts either a subscriber or a class. + # + # subscriber = MyErrorSubscriber.new + # Rails.error.subscribe(subscriber) + # + # Rails.error.unsubscribe(subscriber) + # # or + # Rails.error.unsubscribe(MyErrorSubscriber) + # + # source://activesupport//lib/active_support/error_reporter.rb#177 + def unsubscribe(subscriber); end + + private + + # source://activesupport//lib/active_support/error_reporter.rb#278 + def ensure_backtrace(error); end +end + +# source://activesupport//lib/active_support/error_reporter.rb#29 +ActiveSupport::ErrorReporter::DEFAULT_RESCUE = T.let(T.unsafe(nil), Array) + +# source://activesupport//lib/active_support/error_reporter.rb#28 +ActiveSupport::ErrorReporter::DEFAULT_SOURCE = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/error_reporter.rb#298 +class ActiveSupport::ErrorReporter::ErrorContextMiddlewareStack + # @return [ErrorContextMiddlewareStack] a new instance of ErrorContextMiddlewareStack + # + # source://activesupport//lib/active_support/error_reporter.rb#299 + def initialize; end + + # Run all middlewares in the stack + # + # source://activesupport//lib/active_support/error_reporter.rb#313 + def execute(error, handled:, severity:, context:, source:); end + + # Add a middleware to the error context stack. + # + # source://activesupport//lib/active_support/error_reporter.rb#304 + def use(middleware); end +end + +# source://activesupport//lib/active_support/error_reporter.rb#27 +ActiveSupport::ErrorReporter::SEVERITIES = T.let(T.unsafe(nil), Array) + +# source://activesupport//lib/active_support/error_reporter.rb#33 +class ActiveSupport::ErrorReporter::UnexpectedError < ::Exception; end + +# source://activesupport//lib/active_support/event_reporter.rb#49 +class ActiveSupport::EventContext + class << self + # source://activesupport//lib/active_support/event_reporter.rb#65 + def clear; end + + # source://activesupport//lib/active_support/event_reporter.rb#54 + def context; end + + # source://activesupport//lib/active_support/event_reporter.rb#58 + def set_context(context_hash); end + end +end + +# source://activesupport//lib/active_support/event_reporter.rb#50 +ActiveSupport::EventContext::EMPTY_CONTEXT = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/event_reporter.rb#51 +ActiveSupport::EventContext::FIBER_KEY = T.let(T.unsafe(nil), Symbol) + +# = Active Support \Event Reporter +# +# +ActiveSupport::EventReporter+ provides an interface for reporting structured events to subscribers. +# +# To report an event, you can use the +notify+ method: +# +# Rails.event.notify("user_created", { id: 123 }) +# # Emits event: +# # { +# # name: "user_created", +# # payload: { id: 123 }, +# # timestamp: 1738964843208679035, +# # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } +# # } +# +# The +notify+ API can receive either an event name and a payload hash, or an event object. Names are coerced to strings. +# +# === Event Objects +# +# If an event object is passed to the +notify+ API, it will be passed through to subscribers as-is, and the name of the +# object's class will be used as the event name. +# +# class UserCreatedEvent +# def initialize(id:, name:) +# @id = id +# @name = name +# end +# +# def serialize +# { +# id: @id, +# name: @name +# } +# end +# end +# +# Rails.event.notify(UserCreatedEvent.new(id: 123, name: "John Doe")) +# # Emits event: +# # { +# # name: "UserCreatedEvent", +# # payload: #, +# # timestamp: 1738964843208679035, +# # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } +# # } +# +# An event is any Ruby object representing a schematized event. While payload hashes allow arbitrary, +# implicitly-structured data, event objects are intended to enforce a particular schema. +# +# Subscribers are responsible for serializing event objects. +# +# === Subscribers +# +# Subscribers must implement the +emit+ method, which will be called with the event hash. +# +# The event hash has the following keys: +# +# name: String (The name of the event) +# payload: Hash, Object (The payload of the event, or the event object itself) +# tags: Hash (The tags of the event) +# context: Hash (The context of the event) +# timestamp: Float (The timestamp of the event, in nanoseconds) +# source_location: Hash (The source location of the event, containing the filepath, lineno, and label) +# +# Subscribers are responsible for encoding events to their desired format before emitting them to their +# target destination, such as a streaming platform, a log device, or an alerting service. +# +# class JSONEventSubscriber +# def emit(event) +# json_data = JSON.generate(event) +# LogExporter.export(json_data) +# end +# end +# +# class LogSubscriber +# def emit(event) +# payload = event[:payload].map { |key, value| "#{key}=#{value}" }.join(" ") +# source_location = event[:source_location] +# log = "[#{event[:name]}] #{payload} at #{source_location[:filepath]}:#{source_location[:lineno]}" +# Rails.logger.info(log) +# end +# end +# +# Note that event objects are passed through to subscribers as-is, and may need to be serialized before being encoded: +# +# class UserCreatedEvent +# def initialize(id:, name:) +# @id = id +# @name = name +# end +# +# def serialize +# { +# id: @id, +# name: @name +# } +# end +# end +# +# class LogSubscriber +# def emit(event) +# payload = event[:payload] +# json_data = JSON.generate(payload.serialize) +# LogExporter.export(json_data) +# end +# end +# +# ==== Filtered Subscriptions +# +# Subscribers can be configured with an optional filter proc to only receive a subset of events: +# +# # Only receive events with names starting with "user." +# Rails.event.subscribe(user_subscriber) { |event| event[:name].start_with?("user.") } +# +# # Only receive events with specific payload types +# Rails.event.subscribe(audit_subscriber) { |event| event[:payload].is_a?(AuditEvent) } +# +# === Debug Events +# +# You can use the +debug+ method to report an event that will only be reported if the +# event reporter is in debug mode: +# +# Rails.event.debug("my_debug_event", { foo: "bar" }) +# +# === Tags +# +# To add additional context to an event, separate from the event payload, you can add +# tags via the +tagged+ method: +# +# Rails.event.tagged("graphql") do +# Rails.event.notify("user_created", { id: 123 }) +# end +# +# # Emits event: +# # { +# # name: "user_created", +# # payload: { id: 123 }, +# # tags: { graphql: true }, +# # context: {}, +# # timestamp: 1738964843208679035, +# # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } +# # } +# +# === Context Store +# +# You may want to attach metadata to every event emitted by the reporter. While tags +# provide domain-specific context for a series of events, context is scoped to the job / request +# and should be used for metadata associated with the execution context. +# Context can be set via the +set_context+ method: +# +# Rails.event.set_context(request_id: "abcd123", user_agent: "TestAgent") +# Rails.event.notify("user_created", { id: 123 }) +# +# # Emits event: +# # { +# # name: "user_created", +# # payload: { id: 123 }, +# # tags: {}, +# # context: { request_id: "abcd123", user_agent: "TestAgent" }, +# # timestamp: 1738964843208679035, +# # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } +# # } +# +# Context is reset automatically before and after each request. +# +# A custom context store can be configured via +config.active_support.event_reporter_context_store+. +# +# # config/application.rb +# config.active_support.event_reporter_context_store = CustomContextStore +# +# class CustomContextStore +# class << self +# def context +# # Return the context. +# end +# +# def set_context(context_hash) +# # Append context_hash to the existing context store. +# end +# +# def clear +# # Delete the stored context. +# end +# end +# end +# +# The Event Reporter standardizes on symbol keys for all payload data, tags, and context store entries. +# String keys are automatically converted to symbols for consistency. +# +# Rails.event.notify("user.created", { "id" => 123 }) +# # Emits event: +# # { +# # name: "user.created", +# # payload: { id: 123 }, +# # } +# +# === Security +# +# When reporting events, Hash-based payloads are automatically filtered to remove sensitive data based on {Rails.application.filter_parameters}[https://guides.rubyonrails.org/configuring.html#config-filter-parameters]. +# +# If an {event object}[rdoc-ref:EventReporter@Event+Objects] is given instead, subscribers will need to filter sensitive data themselves, e.g. with ActiveSupport::ParameterFilter. +# +# source://activesupport//lib/active_support/event_reporter.rb#271 +class ActiveSupport::EventReporter + # @return [EventReporter] a new instance of EventReporter + # + # source://activesupport//lib/active_support/event_reporter.rb#286 + def initialize(*subscribers, raise_on_error: T.unsafe(nil)); end + + # Clears all context data. + # + # source://activesupport//lib/active_support/event_reporter.rb#525 + def clear_context; end + + # Returns the current context data. + # + # source://activesupport//lib/active_support/event_reporter.rb#530 + def context; end + + # Report an event only when in debug mode. For example: + # + # Rails.event.debug("sql.query", { sql: "SELECT * FROM users" }) + # + # ==== Arguments + # + # * +:payload+ - The event payload when using string/symbol event names. + # + # * +:caller_depth+ - The stack depth to use for source location (default: 1). + # + # * +:kwargs+ - Additional payload data when using string/symbol event names. + # + # source://activesupport//lib/active_support/event_reporter.rb#435 + def debug(name_or_object, payload = T.unsafe(nil), caller_depth: T.unsafe(nil), **kwargs); end + + # source://activesupport//lib/active_support/event_reporter.rb#276 + def debug_mode=(_arg0); end + + # Check if debug mode is currently enabled. Debug mode is enabled on the reporter + # via +with_debug+, and in local environments. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/event_reporter.rb#420 + def debug_mode?; end + + # Reports an event to all registered subscribers. An event name and payload can be provided: + # + # Rails.event.notify("user.created", { id: 123 }) + # # Emits event: + # # { + # # name: "user.created", + # # payload: { id: 123 }, + # # tags: {}, + # # context: {}, + # # timestamp: 1738964843208679035, + # # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } + # # } + # + # Alternatively, an event object can be provided: + # + # Rails.event.notify(UserCreatedEvent.new(id: 123)) + # # Emits event: + # # { + # # name: "UserCreatedEvent", + # # payload: #, + # # tags: {}, + # # context: {}, + # # timestamp: 1738964843208679035, + # # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } + # # } + # + # ==== Arguments + # + # * +:payload+ - The event payload when using string/symbol event names. + # + # * +:caller_depth+ - The stack depth to use for source location (default: 1). + # + # * +:kwargs+ - Additional payload data when using string/symbol event names. + # + # source://activesupport//lib/active_support/event_reporter.rb#363 + def notify(name_or_object, payload = T.unsafe(nil), caller_depth: T.unsafe(nil), **kwargs); end + + # Sets whether to raise an error if a subscriber raises an error during + # event emission, or when unexpected arguments are passed to +notify+. + # + # source://activesupport//lib/active_support/event_reporter.rb#274 + def raise_on_error=(_arg0); end + + # source://activesupport//lib/active_support/event_reporter.rb#534 + def reload_payload_filter; end + + # Sets context data that will be included with all events emitted by the reporter. + # Context data should be scoped to the job or request, and is reset automatically + # before and after each request and job. + # + # Rails.event.set_context(user_agent: "TestAgent") + # Rails.event.set_context(job_id: "abc123") + # Rails.event.tagged("graphql") do + # Rails.event.notify("user_created", { id: 123 }) + # end + # + # # Emits event: + # # { + # # name: "user_created", + # # payload: { id: 123 }, + # # tags: { graphql: true }, + # # context: { user_agent: "TestAgent", job_id: "abc123" }, + # # timestamp: 1738964843208679035 + # # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } + # # } + # + # source://activesupport//lib/active_support/event_reporter.rb#520 + def set_context(context); end + + # Registers a new event subscriber. The subscriber must respond to + # + # emit(event: Hash) + # + # The event hash will have the following keys: + # + # name: String (The name of the event) + # payload: Hash, Object (The payload of the event, or the event object itself) + # tags: Hash (The tags of the event) + # context: Hash (The context of the event) + # timestamp: Float (The timestamp of the event, in nanoseconds) + # source_location: Hash (The source location of the event, containing the filepath, lineno, and label) + # + # An optional filter proc can be provided to only receive a subset of events: + # + # Rails.event.subscribe(subscriber) { |event| event[:name].start_with?("user.") } + # Rails.event.subscribe(subscriber) { |event| event[:payload].is_a?(UserEvent) } + # + # source://activesupport//lib/active_support/event_reporter.rb#311 + def subscribe(subscriber, &filter); end + + # :nodoc + # + # source://activesupport//lib/active_support/event_reporter.rb#278 + def subscribers; end + + # Add tags to events to supply additional context. Tags operate in a stack-oriented manner, + # so all events emitted within the block inherit the same set of tags. For example: + # + # Rails.event.tagged("graphql") do + # Rails.event.notify("user.created", { id: 123 }) + # end + # + # # Emits event: + # # { + # # name: "user.created", + # # payload: { id: 123 }, + # # tags: { graphql: true }, + # # context: {}, + # # timestamp: 1738964843208679035, + # # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } + # # } + # + # Tags can be provided as arguments or as keyword arguments, and can be nested: + # + # Rails.event.tagged("graphql") do + # # Other code here... + # Rails.event.tagged(section: "admin") do + # Rails.event.notify("user.created", { id: 123 }) + # end + # end + # + # # Emits event: + # # { + # # name: "user.created", + # # payload: { id: 123 }, + # # tags: { section: "admin", graphql: true }, + # # context: {}, + # # timestamp: 1738964843208679035, + # # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } + # # } + # + # The +tagged+ API can also receive a tag object: + # + # graphql_tag = GraphqlTag.new(operation_name: "user_created", operation_type: "mutation") + # Rails.event.tagged(graphql_tag) do + # Rails.event.notify("user.created", { id: 123 }) + # end + # + # # Emits event: + # # { + # # name: "user.created", + # # payload: { id: 123 }, + # # tags: { "GraphqlTag": # }, + # # context: {}, + # # timestamp: 1738964843208679035, + # # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } + # # } + # + # source://activesupport//lib/active_support/event_reporter.rb#497 + def tagged(*args, **kwargs, &block); end + + # Unregister an event subscriber. Accepts either a subscriber or a class. + # + # subscriber = MyEventSubscriber.new + # Rails.event.subscribe(subscriber) + # + # Rails.event.unsubscribe(subscriber) + # # or + # Rails.event.unsubscribe(MyEventSubscriber) + # + # source://activesupport//lib/active_support/event_reporter.rb#326 + def unsubscribe(subscriber); end + + # Temporarily enables debug mode for the duration of the block. + # Calls to +debug+ will only be reported if debug mode is enabled. + # + # Rails.event.with_debug do + # Rails.event.debug("sql.query", { sql: "SELECT * FROM users" }) + # end + # + # source://activesupport//lib/active_support/event_reporter.rb#410 + def with_debug; end + + private + + # source://activesupport//lib/active_support/event_reporter.rb#544 + def context_store; end + + # source://activesupport//lib/active_support/event_reporter.rb#579 + def handle_unexpected_args(name_or_object, payload, kwargs); end + + # source://activesupport//lib/active_support/event_reporter.rb#548 + def payload_filter; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/event_reporter.rb#540 + def raise_on_error?; end + + # source://activesupport//lib/active_support/event_reporter.rb#555 + def resolve_name(name_or_object); end + + # source://activesupport//lib/active_support/event_reporter.rb#564 + def resolve_payload(name_or_object, payload, **kwargs); end + + class << self + # source://activesupport//lib/active_support/event_reporter.rb#281 + def context_store; end + + # source://activesupport//lib/active_support/event_reporter.rb#281 + def context_store=(_arg0); end + end +end + +# source://activesupport//lib/active_support/execution_context.rb#4 +module ActiveSupport::ExecutionContext + class << self + # source://activesupport//lib/active_support/execution_context.rb#69 + def []=(key, value); end + + # source://activesupport//lib/active_support/execution_context.rb#40 + def after_change(&block); end + + # source://activesupport//lib/active_support/execution_context.rb#96 + def clear; end + + # source://activesupport//lib/active_support/execution_context.rb#100 + def current_attributes_instances; end + + # Returns the value of attribute nestable. + # + # source://activesupport//lib/active_support/execution_context.rb#38 + def nestable; end + + # Sets the attribute nestable + # + # @param value the value to set the attribute nestable to. + # + # source://activesupport//lib/active_support/execution_context.rb#38 + def nestable=(_arg0); end + + # source://activesupport//lib/active_support/execution_context.rb#87 + def pop; end + + # source://activesupport//lib/active_support/execution_context.rb#78 + def push; end + + # Updates the execution context. If a block is given, it resets the provided keys to their + # previous value once the block exits. + # + # source://activesupport//lib/active_support/execution_context.rb#46 + def set(**options); end + + # source://activesupport//lib/active_support/execution_context.rb#74 + def to_h; end + + private + + # source://activesupport//lib/active_support/execution_context.rb#105 + def record; end + end +end + +# source://activesupport//lib/active_support/execution_context.rb#5 +class ActiveSupport::ExecutionContext::Record + # @return [Record] a new instance of Record + # + # source://activesupport//lib/active_support/execution_context.rb#8 + def initialize; end + + # Returns the value of attribute current_attributes_instances. + # + # source://activesupport//lib/active_support/execution_context.rb#6 + def current_attributes_instances; end + + # source://activesupport//lib/active_support/execution_context.rb#21 + def pop; end + + # source://activesupport//lib/active_support/execution_context.rb#14 + def push; end + + # Returns the value of attribute store. + # + # source://activesupport//lib/active_support/execution_context.rb#6 + def store; end +end + +# source://activesupport//lib/active_support/execution_wrapper.rb#7 +class ActiveSupport::ExecutionWrapper + include ::ActiveSupport::Callbacks + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::ActiveSupport::DescendantsTracker + + # source://activesupport//lib/active_support/execution_wrapper.rb#8 + def __callbacks; end + + # source://activesupport//lib/active_support/execution_wrapper.rb#15 + def _complete_callbacks; end + + # source://activesupport//lib/active_support/execution_wrapper.rb#14 + def _run_callbacks; end + + # source://activesupport//lib/active_support/execution_wrapper.rb#15 + def _run_complete_callbacks; end + + # source://activesupport//lib/active_support/execution_wrapper.rb#15 + def _run_complete_callbacks!(&block); end + + # source://activesupport//lib/active_support/execution_wrapper.rb#14 + def _run_run_callbacks; end + + # source://activesupport//lib/active_support/execution_wrapper.rb#14 + def _run_run_callbacks!(&block); end + + # source://activesupport//lib/active_support/execution_wrapper.rb#141 + def complete; end + + # Complete this in-flight execution. This method *must* be called + # exactly once on the result of any call to +run!+. + # + # Where possible, prefer +wrap+. + # + # source://activesupport//lib/active_support/execution_wrapper.rb#135 + def complete!; end + + # source://activesupport//lib/active_support/execution_wrapper.rb#127 + def run; end + + # source://activesupport//lib/active_support/execution_wrapper.rb#122 + def run!; end + + private + + # source://activesupport//lib/active_support/execution_wrapper.rb#146 + def hook_state; end + + class << self + # source://activesupport//lib/active_support/execution_wrapper.rb#8 + def __callbacks; end + + # source://activesupport//lib/active_support/execution_wrapper.rb#8 + def __callbacks=(value); end + + # source://activesupport//lib/active_support/execution_wrapper.rb#15 + def _complete_callbacks; end + + # source://activesupport//lib/active_support/execution_wrapper.rb#15 + def _complete_callbacks=(value); end + + # source://activesupport//lib/active_support/execution_wrapper.rb#14 + def _run_callbacks; end + + # source://activesupport//lib/active_support/execution_wrapper.rb#14 + def _run_callbacks=(value); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/execution_wrapper.rb#118 + def active?; end + + # source://activesupport//lib/active_support/execution_wrapper.rb#114 + def active_key; end + + # source://activesupport//lib/active_support/execution_wrapper.rb#110 + def error_reporter; end + + # source://activesupport//lib/active_support/execution_wrapper.rb#100 + def perform; end + + # Register an object to be invoked during both the +run+ and + # +complete+ steps. + # + # +hook.complete+ will be passed the value returned from +hook.run+, + # and will only be invoked if +run+ has previously been called. + # (Mostly, this means it won't be invoked if an exception occurs in + # a preceding +to_run+ block; all ordinary +to_complete+ blocks are + # invoked in that situation.) + # + # source://activesupport//lib/active_support/execution_wrapper.rb#50 + def register_hook(hook, outer: T.unsafe(nil)); end + + # Run this execution. + # + # Returns an instance, whose +complete!+ method *must* be invoked + # after the work has been performed. + # + # Where possible, prefer +wrap+. + # + # source://activesupport//lib/active_support/execution_wrapper.rb#66 + def run!(reset: T.unsafe(nil)); end + + # source://activesupport//lib/active_support/execution_wrapper.rb#21 + def to_complete(*args, &block); end + + # source://activesupport//lib/active_support/execution_wrapper.rb#17 + def to_run(*args, &block); end + + # Perform the work in the supplied block as an execution. + # + # source://activesupport//lib/active_support/execution_wrapper.rb#86 + def wrap(source: T.unsafe(nil)); end + + private + + # source://activesupport//lib/active_support/execution_wrapper.rb#8 + def __class_attr___callbacks; end + + # source://activesupport//lib/active_support/execution_wrapper.rb#8 + def __class_attr___callbacks=(new_value); end + end +end + +# source://activesupport//lib/active_support/execution_wrapper.rb#32 +class ActiveSupport::ExecutionWrapper::CompleteHook < ::Struct + # source://activesupport//lib/active_support/execution_wrapper.rb#39 + def after(target); end + + # source://activesupport//lib/active_support/execution_wrapper.rb#33 + def before(target); end + + # Returns the value of attribute hook + # + # @return [Object] the current value of hook + # + # source://activesupport//lib/active_support/execution_wrapper.rb#32 + def hook; end + + # Sets the attribute hook + # + # @param value [Object] the value to set the attribute hook to. + # @return [Object] the newly set value + # + # source://activesupport//lib/active_support/execution_wrapper.rb#32 + def hook=(_); end + + class << self + # source://activesupport//lib/active_support/execution_wrapper.rb#32 + def [](*_arg0); end + + # source://activesupport//lib/active_support/execution_wrapper.rb#32 + def inspect; end + + # source://activesupport//lib/active_support/execution_wrapper.rb#32 + def keyword_init?; end + + # source://activesupport//lib/active_support/execution_wrapper.rb#32 + def members; end + + # source://activesupport//lib/active_support/execution_wrapper.rb#32 + def new(*_arg0); end + end +end + +# source://activesupport//lib/active_support/execution_wrapper.rb#10 +ActiveSupport::ExecutionWrapper::Null = T.let(T.unsafe(nil), Object) + +# source://activesupport//lib/active_support/execution_wrapper.rb#25 +class ActiveSupport::ExecutionWrapper::RunHook < ::Struct + # source://activesupport//lib/active_support/execution_wrapper.rb#26 + def before(target); end + + # Returns the value of attribute hook + # + # @return [Object] the current value of hook + # + # source://activesupport//lib/active_support/execution_wrapper.rb#25 + def hook; end + + # Sets the attribute hook + # + # @param value [Object] the value to set the attribute hook to. + # @return [Object] the newly set value + # + # source://activesupport//lib/active_support/execution_wrapper.rb#25 + def hook=(_); end + + class << self + # source://activesupport//lib/active_support/execution_wrapper.rb#25 + def [](*_arg0); end + + # source://activesupport//lib/active_support/execution_wrapper.rb#25 + def inspect; end + + # source://activesupport//lib/active_support/execution_wrapper.rb#25 + def keyword_init?; end + + # source://activesupport//lib/active_support/execution_wrapper.rb#25 + def members; end + + # source://activesupport//lib/active_support/execution_wrapper.rb#25 + def new(*_arg0); end + end +end + +# source://activesupport//lib/active_support/executor.rb#6 +class ActiveSupport::Executor < ::ActiveSupport::ExecutionWrapper; end + +# = \File Update Checker +# +# FileUpdateChecker specifies the API used by \Rails to watch files +# and control reloading. The API depends on four methods: +# +# * +initialize+ which expects two parameters and one block as +# described below. +# +# * +updated?+ which returns a boolean if there were updates in +# the filesystem or not. +# +# * +execute+ which executes the given block on initialization +# and updates the latest watched files and timestamp. +# +# * +execute_if_updated+ which just executes the block if it was updated. +# +# After initialization, a call to +execute_if_updated+ must execute +# the block only if there was really a change in the filesystem. +# +# This class is used by \Rails to reload the I18n framework whenever +# they are changed upon a new request. +# +# i18n_reloader = ActiveSupport::FileUpdateChecker.new(paths) do +# I18n.reload! +# end +# +# ActiveSupport::Reloader.to_prepare do +# i18n_reloader.execute_if_updated +# end +# +# source://activesupport//lib/active_support/file_update_checker.rb#35 +class ActiveSupport::FileUpdateChecker + # It accepts two parameters on initialization. The first is an array + # of files and the second is an optional hash of directories. The hash must + # have directories as keys and the value is an array of extensions to be + # watched under that directory. + # + # This method must also receive a block that will be called once a path + # changes. The array of files and list of directories cannot be changed + # after FileUpdateChecker has been initialized. + # + # @return [FileUpdateChecker] a new instance of FileUpdateChecker + # + # source://activesupport//lib/active_support/file_update_checker.rb#44 + def initialize(files, dirs = T.unsafe(nil), &block); end + + # Executes the given block and updates the latest watched files and + # timestamp. + # + # source://activesupport//lib/active_support/file_update_checker.rb#85 + def execute; end + + # Execute the block given if updated. + # + # source://activesupport//lib/active_support/file_update_checker.rb#95 + def execute_if_updated; end + + # Check if any of the entries were updated. If so, the watched and/or + # updated_at values are cached until the block is executed via +execute+ + # or +execute_if_updated+. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/file_update_checker.rb#66 + def updated?; end + + private + + # source://activesupport//lib/active_support/file_update_checker.rb#160 + def compile_ext(array); end + + # source://activesupport//lib/active_support/file_update_checker.rb#147 + def compile_glob(hash); end + + # source://activesupport//lib/active_support/file_update_checker.rb#156 + def escape(key); end + + # This method returns the maximum mtime of the files in +paths+, or +nil+ + # if the array is empty. + # + # Files with a mtime in the future are ignored. Such abnormal situation + # can happen for example if the user changes the clock by hand. It is + # healthy to consider this edge case because with mtimes in the future + # reloading is not triggered. + # + # source://activesupport//lib/active_support/file_update_checker.rb#125 + def max_mtime(paths); end + + # source://activesupport//lib/active_support/file_update_checker.rb#114 + def updated_at(paths); end + + # source://activesupport//lib/active_support/file_update_checker.rb#106 + def watched; end +end + +# source://activesupport//lib/active_support/fork_tracker.rb#4 +module ActiveSupport::ForkTracker + class << self + # source://activesupport//lib/active_support/fork_tracker.rb#31 + def after_fork(&block); end + + # source://activesupport//lib/active_support/fork_tracker.rb#19 + def after_fork_callback; end + + # source://activesupport//lib/active_support/fork_tracker.rb#27 + def hook!; end + + # source://activesupport//lib/active_support/fork_tracker.rb#36 + def unregister(callback); end + end +end + +# source://activesupport//lib/active_support/fork_tracker.rb#5 +module ActiveSupport::ForkTracker::CoreExt + # source://activesupport//lib/active_support/fork_tracker.rb#6 + def _fork; end +end + +# = Active Support \Gzip +# +# A convenient wrapper for the zlib standard library that allows +# compression/decompression of strings with gzip. +# +# gzip = ActiveSupport::Gzip.compress('compress me!') +# # => "\x1F\x8B\b\x00o\x8D\xCDO\x00\x03K\xCE\xCF-(J-.V\xC8MU\x04\x00R>n\x83\f\x00\x00\x00" +# +# ActiveSupport::Gzip.decompress(gzip) +# # => "compress me!" +# +# source://activesupport//lib/active_support/gzip.rb#17 +module ActiveSupport::Gzip + class << self + # Compresses a string using gzip. + # + # source://activesupport//lib/active_support/gzip.rb#32 + def compress(source, level = T.unsafe(nil), strategy = T.unsafe(nil)); end + + # Decompresses a gzipped string. + # + # source://activesupport//lib/active_support/gzip.rb#27 + def decompress(source); end + end +end + +# source://activesupport//lib/active_support/gzip.rb#18 +class ActiveSupport::Gzip::Stream < ::StringIO + # @return [Stream] a new instance of Stream + # + # source://activesupport//lib/active_support/gzip.rb#19 + def initialize(*_arg0); end + + # source://activesupport//lib/active_support/gzip.rb#23 + def close; end +end + +# = \Hash With Indifferent Access +# +# Implements a hash where keys :foo and "foo" are considered +# to be the same. +# +# rgb = ActiveSupport::HashWithIndifferentAccess.new +# +# rgb[:black] = '#000000' +# rgb[:black] # => '#000000' +# rgb['black'] # => '#000000' +# +# rgb['white'] = '#FFFFFF' +# rgb[:white] # => '#FFFFFF' +# rgb['white'] # => '#FFFFFF' +# +# Internally symbols are mapped to strings when used as keys in the entire +# writing interface (calling []=, merge, etc). This +# mapping belongs to the public interface. For example, given: +# +# hash = ActiveSupport::HashWithIndifferentAccess.new(a: 1) +# +# You are guaranteed that the key is returned as a string: +# +# hash.keys # => ["a"] +# +# Technically other types of keys are accepted: +# +# hash = ActiveSupport::HashWithIndifferentAccess.new(a: 1) +# hash[0] = 0 +# hash # => {"a"=>1, 0=>0} +# +# but this class is intended for use cases where strings or symbols are the +# expected keys and it is convenient to understand both as the same. For +# example the +params+ hash in Ruby on \Rails. +# +# Note that core extensions define Hash#with_indifferent_access: +# +# rgb = { black: '#000000', white: '#FFFFFF' }.with_indifferent_access +# +# which may be handy. +# +# To access this class outside of \Rails, require the core extension with: +# +# require "active_support/core_ext/hash/indifferent_access" +# +# which will, in turn, require this file. +# +# source://activesupport//lib/active_support/hash_with_indifferent_access.rb#55 +class ActiveSupport::HashWithIndifferentAccess < ::Hash + # @return [HashWithIndifferentAccess] a new instance of HashWithIndifferentAccess + # + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#70 + def initialize(constructor = T.unsafe(nil)); end + + # Same as Hash#[] where the key passed as argument can be + # either a string or a symbol: + # + # counters = ActiveSupport::HashWithIndifferentAccess.new + # counters[:foo] = 1 + # + # counters['foo'] # => 1 + # counters[:foo] # => 1 + # counters[:zoo] # => nil + # + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#184 + def [](key); end + + # Assigns a new value to the hash: + # + # hash = ActiveSupport::HashWithIndifferentAccess.new + # hash[:key] = 'value' + # + # This value can be later fetched using either +:key+ or 'key'. + # + # If the value is a Hash or contains one or multiple Hashes, they will be + # converted to +HashWithIndifferentAccess+. + # + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#101 + def []=(key, value); end + + # Same as Hash#assoc where the key passed as argument can be + # either a string or a symbol: + # + # counters = ActiveSupport::HashWithIndifferentAccess.new + # counters[:foo] = 1 + # + # counters.assoc('foo') # => ["foo", 1] + # counters.assoc(:foo) # => ["foo", 1] + # counters.assoc(:zoo) # => nil + # + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#197 + def assoc(key); end + + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#390 + def compact; end + + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#334 + def deep_symbolize_keys; end + + # Same as Hash#default where the key passed as argument can be + # either a string or a symbol: + # + # hash = ActiveSupport::HashWithIndifferentAccess.new(1) + # hash.default # => 1 + # + # hash = ActiveSupport::HashWithIndifferentAccess.new { |hash, key| key } + # hash.default # => nil + # hash.default('foo') # => 'foo' + # hash.default(:foo) # => 'foo' + # + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#239 + def default(key = T.unsafe(nil)); end + + # Removes the specified key from the hash. + # + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#317 + def delete(key); end + + # Same as Hash#dig where the key passed as argument can be + # either a string or a symbol: + # + # counters = ActiveSupport::HashWithIndifferentAccess.new + # counters[:foo] = { bar: 1 } + # + # counters.dig('foo', 'bar') # => 1 + # counters.dig(:foo, :bar) # => 1 + # counters.dig(:zoo) # => nil + # + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#224 + def dig(*args); end + + # Returns a shallow copy of the hash. + # + # hash = ActiveSupport::HashWithIndifferentAccess.new({ a: { b: 'b' } }) + # dup = hash.dup + # dup[:a][:c] = 'c' + # + # hash[:a][:c] # => "c" + # dup[:a][:c] # => "c" + # + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#280 + def dup; end + + # Returns a hash with indifferent access that includes everything except given keys. + # hash = { a: "x", b: "y", c: 10 }.with_indifferent_access + # hash.except(:a, "b") # => {c: 10}.with_indifferent_access + # hash # => { a: "x", b: "y", c: 10 }.with_indifferent_access + # + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#325 + def except(*keys); end + + # Returns +true+ so that Array#extract_options! finds members of + # this class. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#58 + def extractable_options?; end + + # Same as Hash#fetch where the key passed as argument can be + # either a string or a symbol: + # + # counters = ActiveSupport::HashWithIndifferentAccess.new + # counters[:foo] = 1 + # + # counters.fetch('foo') # => 1 + # counters.fetch(:bar, 0) # => 0 + # counters.fetch(:bar) { |key| 0 } # => 0 + # counters.fetch(:zoo) # => KeyError: key not found: "zoo" + # + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#211 + def fetch(key, *extras); end + + # Returns an array of the values at the specified indices, but also + # raises an exception when one of the keys can't be found. + # + # hash = ActiveSupport::HashWithIndifferentAccess.new + # hash[:a] = 'x' + # hash[:b] = 'y' + # hash.fetch_values('a', 'b') # => ["x", "y"] + # hash.fetch_values('a', 'c') { |key| 'z' } # => ["x", "z"] + # hash.fetch_values('a', 'c') # => KeyError: key not found: "c" + # + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#267 + def fetch_values(*indices, &block); end + + # Checks the hash for a key matching the argument passed in: + # + # hash = ActiveSupport::HashWithIndifferentAccess.new + # hash['key'] = 'value' + # hash.key?(:key) # => true + # hash.key?('key') # => true + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#172 + def has_key?(key); end + + # Checks the hash for a key matching the argument passed in: + # + # hash = ActiveSupport::HashWithIndifferentAccess.new + # hash['key'] = 'value' + # hash.key?(:key) # => true + # hash.key?('key') # => true + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#171 + def include?(key); end + + # Checks the hash for a key matching the argument passed in: + # + # hash = ActiveSupport::HashWithIndifferentAccess.new + # hash['key'] = 'value' + # hash.key?(:key) # => true + # hash.key?('key') # => true + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#167 + def key?(key); end + + # Checks the hash for a key matching the argument passed in: + # + # hash = ActiveSupport::HashWithIndifferentAccess.new + # hash['key'] = 'value' + # hash.key?(:key) # => true + # hash.key?('key') # => true + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#173 + def member?(key); end + + # This method has the same semantics of +update+, except it does not + # modify the receiver but rather returns a new hash with indifferent + # access with the result of the merge. + # + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#287 + def merge(*hashes, &block); end + + # Updates the receiver in-place, merging in the hashes passed as arguments: + # + # hash_1 = ActiveSupport::HashWithIndifferentAccess.new + # hash_1[:key] = 'value' + # + # hash_2 = ActiveSupport::HashWithIndifferentAccess.new + # hash_2[:key] = 'New Value!' + # + # hash_1.update(hash_2) # => {"key"=>"New Value!"} + # + # hash = ActiveSupport::HashWithIndifferentAccess.new + # hash.update({ "a" => 1 }, { "b" => 2 }) # => { "a" => 1, "b" => 2 } + # + # The arguments can be either an + # +ActiveSupport::HashWithIndifferentAccess+ or a regular +Hash+. + # In either case the merge respects the semantics of indifferent access. + # + # If the argument is a regular hash with keys +:key+ and "key" only one + # of the values end up in the receiver, but which one is unspecified. + # + # When given a block, the value for duplicated keys will be determined + # by the result of invoking the block with the duplicated key, the value + # in the receiver, and the value in +other_hash+. The rules for duplicated + # keys follow the semantics of indifferent access: + # + # hash_1[:key] = 10 + # hash_2['key'] = 12 + # hash_1.update(hash_2) { |key, old, new| old + new } # => {"key"=>22} + # + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#159 + def merge!(*other_hashes, &block); end + + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#66 + def nested_under_indifferent_access; end + + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#90 + def regular_update(*_arg0); end + + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#89 + def regular_writer(_arg0, _arg1); end + + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#342 + def reject(*args, &block); end + + # Replaces the contents of this hash with other_hash. + # + # h = { "a" => 100, "b" => 200 } + # h.replace({ "c" => 300, "d" => 400 }) # => {"c"=>300, "d"=>400} + # + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#312 + def replace(other_hash); end + + # Like +merge+ but the other way around: Merges the receiver into the + # argument and returns a new hash with indifferent access as result: + # + # hash = ActiveSupport::HashWithIndifferentAccess.new + # hash['a'] = nil + # hash.reverse_merge(a: 0, b: 1) # => {"a"=>nil, "b"=>1} + # + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#297 + def reverse_merge(other_hash); end + + # Same semantics as +reverse_merge+ but modifies the receiver in-place. + # + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#303 + def reverse_merge!(other_hash); end + + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#337 + def select(*args, &block); end + + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#380 + def slice(*keys); end + + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#385 + def slice!(*keys); end + + # Assigns a new value to the hash: + # + # hash = ActiveSupport::HashWithIndifferentAccess.new + # hash[:key] = 'value' + # + # This value can be later fetched using either +:key+ or 'key'. + # + # If the value is a Hash or contains one or multiple Hashes, they will be + # converted to +HashWithIndifferentAccess+. unless `convert_value: false` + # is set. + # + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#115 + def store(key, value, convert_value: T.unsafe(nil)); end + + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#332 + def symbolize_keys; end + + # Convert to a regular hash with string keys. + # + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#395 + def to_hash; end + + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#333 + def to_options; end + + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#335 + def to_options!; end + + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#401 + def to_proc; end + + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#354 + def transform_keys(hash = T.unsafe(nil), &block); end + + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#366 + def transform_keys!(hash = T.unsafe(nil), &block); end + + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#347 + def transform_values(&block); end + + # Updates the receiver in-place, merging in the hashes passed as arguments: + # + # hash_1 = ActiveSupport::HashWithIndifferentAccess.new + # hash_1[:key] = 'value' + # + # hash_2 = ActiveSupport::HashWithIndifferentAccess.new + # hash_2[:key] = 'New Value!' + # + # hash_1.update(hash_2) # => {"key"=>"New Value!"} + # + # hash = ActiveSupport::HashWithIndifferentAccess.new + # hash.update({ "a" => 1 }, { "b" => 2 }) # => { "a" => 1, "b" => 2 } + # + # The arguments can be either an + # +ActiveSupport::HashWithIndifferentAccess+ or a regular +Hash+. + # In either case the merge respects the semantics of indifferent access. + # + # If the argument is a regular hash with keys +:key+ and "key" only one + # of the values end up in the receiver, but which one is unspecified. + # + # When given a block, the value for duplicated keys will be determined + # by the result of invoking the block with the duplicated key, the value + # in the receiver, and the value in +other_hash+. The rules for duplicated + # keys follow the semantics of indifferent access: + # + # hash_1[:key] = 10 + # hash_2['key'] = 12 + # hash_1.update(hash_2) { |key, old, new| old + new } # => {"key"=>22} + # + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#148 + def update(*other_hashes, &block); end + + # Returns an array of the values at the specified indices: + # + # hash = ActiveSupport::HashWithIndifferentAccess.new + # hash[:a] = 'x' + # hash[:b] = 'y' + # hash.values_at('a', 'b') # => ["x", "y"] + # + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#253 + def values_at(*keys); end + + # Like +merge+ but the other way around: Merges the receiver into the + # argument and returns a new hash with indifferent access as result: + # + # hash = ActiveSupport::HashWithIndifferentAccess.new + # hash['a'] = nil + # hash.reverse_merge(a: 0, b: 1) # => {"a"=>nil, "b"=>1} + # + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#300 + def with_defaults(other_hash); end + + # Same semantics as +reverse_merge+ but modifies the receiver in-place. + # + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#306 + def with_defaults!(other_hash); end + + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#62 + def with_indifferent_access; end + + # Returns a hash with indifferent access that includes everything except given keys. + # hash = { a: "x", b: "y", c: 10 }.with_indifferent_access + # hash.except(:a, "b") # => {c: 10}.with_indifferent_access + # hash # => { a: "x", b: "y", c: 10 }.with_indifferent_access + # + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#328 + def without(*keys); end + + private + + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#406 + def cast(other); end + + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#410 + def convert_key(key); end + + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#414 + def convert_value(value, conversion: T.unsafe(nil)); end + + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#427 + def convert_value_to_hash(value); end + + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#438 + def copy_defaults(target); end + + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#447 + def update_with_single_argument(other_hash, block); end + + class << self + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#85 + def [](*args); end + end +end + +# source://activesupport//lib/active_support/hash_with_indifferent_access.rb#352 +ActiveSupport::HashWithIndifferentAccess::NOT_GIVEN = T.let(T.unsafe(nil), Object) + +# source://activesupport//lib/active_support/html_safe_translation.rb#4 +module ActiveSupport::HtmlSafeTranslation + extend ::ActiveSupport::HtmlSafeTranslation + + # @return [Boolean] + # + # source://activesupport//lib/active_support/html_safe_translation.rb#30 + def html_safe_translation_key?(key); end + + # source://activesupport//lib/active_support/html_safe_translation.rb#7 + def translate(key, **options); end + + private + + # source://activesupport//lib/active_support/html_safe_translation.rb#35 + def html_escape_translation_options(options); end + + # source://activesupport//lib/active_support/html_safe_translation.rb#48 + def html_safe_translation(translation); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/html_safe_translation.rb#43 + def i18n_option?(name); end +end + +# = Active Support \Inflector +# +# The Inflector transforms words from singular to plural, class names to table +# names, modularized class names to ones without, and class names to foreign +# keys. The default inflections for pluralization, singularization, and +# uncountable words are kept in inflections.rb. +# +# The \Rails core team has stated patches for the inflections library will not +# be accepted in order to avoid breaking legacy applications which may be +# relying on errant inflections. If you discover an incorrect inflection and +# require it for your application or wish to define rules for languages other +# than English, please correct or add them yourself (explained below). +# +# source://activesupport//lib/active_support/inflector/inflections.rb#8 +module ActiveSupport::Inflector + extend ::ActiveSupport::Inflector + + # Converts strings to UpperCamelCase. + # If the +uppercase_first_letter+ parameter is set to false, then produces + # lowerCamelCase. + # + # Also converts '/' to '::' which is useful for converting + # paths to namespaces. + # + # camelize('active_model') # => "ActiveModel" + # camelize('active_model', false) # => "activeModel" + # camelize('active_model/errors') # => "ActiveModel::Errors" + # camelize('active_model/errors', false) # => "activeModel::Errors" + # + # As a rule of thumb you can think of +camelize+ as the inverse of + # #underscore, though there are cases where that does not hold: + # + # camelize(underscore('SSLError')) # => "SslError" + # + # source://activesupport//lib/active_support/inflector/methods.rb#70 + def camelize(term, uppercase_first_letter = T.unsafe(nil)); end + + # Creates a class name from a plural table name like \Rails does for table + # names to models. Note that this returns a string and not a Class. (To + # convert to an actual class follow +classify+ with #constantize.) + # + # classify('ham_and_eggs') # => "HamAndEgg" + # classify('posts') # => "Post" + # + # Singular names are not handled correctly: + # + # classify('calculus') # => "Calculu" + # + # source://activesupport//lib/active_support/inflector/methods.rb#218 + def classify(table_name); end + + # Tries to find a constant with the name specified in the argument string. + # + # constantize('Module') # => Module + # constantize('Foo::Bar') # => Foo::Bar + # + # The name is assumed to be the one of a top-level constant, no matter + # whether it starts with "::" or not. No lexical context is taken into + # account: + # + # C = 'outside' + # module M + # C = 'inside' + # C # => 'inside' + # constantize('C') # => 'outside', same as ::C + # end + # + # NameError is raised when the name is not in CamelCase or the constant is + # unknown. + # + # source://activesupport//lib/active_support/inflector/methods.rb#289 + def constantize(camel_cased_word); end + + # Replaces underscores with dashes in the string. + # + # dasherize('puni_puni') # => "puni-puni" + # + # source://activesupport//lib/active_support/inflector/methods.rb#226 + def dasherize(underscored_word); end + + # Removes the rightmost segment from the constant expression in the string. + # + # deconstantize('Net::HTTP') # => "Net" + # deconstantize('::Net::HTTP') # => "::Net" + # deconstantize('String') # => "" + # deconstantize('::String') # => "" + # deconstantize('') # => "" + # + # See also #demodulize. + # + # source://activesupport//lib/active_support/inflector/methods.rb#256 + def deconstantize(path); end + + # Removes the module part from the expression in the string. + # + # demodulize('ActiveSupport::Inflector::Inflections') # => "Inflections" + # demodulize('Inflections') # => "Inflections" + # demodulize('::Inflections') # => "Inflections" + # demodulize('') # => "" + # + # See also #deconstantize. + # + # source://activesupport//lib/active_support/inflector/methods.rb#238 + def demodulize(path); end + + # Converts the first character in the string to lowercase. + # + # downcase_first('If they enjoyed The Matrix') # => "if they enjoyed The Matrix" + # downcase_first('I') # => "i" + # downcase_first('') # => "" + # + # source://activesupport//lib/active_support/inflector/methods.rb#175 + def downcase_first(string); end + + # Creates a foreign key name from a class name. + # +separate_class_name_and_id_with_underscore+ sets whether + # the method should put '_' between the name and 'id'. + # + # foreign_key('Message') # => "message_id" + # foreign_key('Message', false) # => "messageid" + # foreign_key('Admin::Post') # => "post_id" + # + # source://activesupport//lib/active_support/inflector/methods.rb#267 + def foreign_key(class_name, separate_class_name_and_id_with_underscore = T.unsafe(nil)); end + + # Tweaks an attribute name for display to end users. + # + # Specifically, performs these transformations: + # + # * Applies human inflection rules to the argument. + # * Deletes leading underscores, if any. + # * Removes an "_id" suffix if present. + # * Replaces underscores with spaces, if any. + # * Downcases all words except acronyms. + # * Capitalizes the first word. + # The capitalization of the first word can be turned off by setting the + # +:capitalize+ option to false (default is true). + # + # The trailing '_id' can be kept and capitalized by setting the + # optional parameter +keep_id_suffix+ to true (default is false). + # + # humanize('employee_salary') # => "Employee salary" + # humanize('author_id') # => "Author" + # humanize('author_id', capitalize: false) # => "author" + # humanize('_id') # => "Id" + # humanize('author_id', keep_id_suffix: true) # => "Author id" + # + # If "SSL" was defined to be an acronym: + # + # humanize('ssl_error') # => "SSL error" + # + # source://activesupport//lib/active_support/inflector/methods.rb#135 + def humanize(lower_case_and_underscored_word, capitalize: T.unsafe(nil), keep_id_suffix: T.unsafe(nil)); end + + # Yields a singleton instance of Inflector::Inflections so you can specify + # additional inflector rules. If passed an optional locale, rules for other + # languages can be specified. If not specified, defaults to :en. + # Only rules for English are provided. + # + # ActiveSupport::Inflector.inflections(:en) do |inflect| + # inflect.uncountable 'rails' + # end + # + # source://activesupport//lib/active_support/inflector/inflections.rb#281 + def inflections(locale = T.unsafe(nil)); end + + # Returns the suffix that should be added to a number to denote the position + # in an ordered sequence such as 1st, 2nd, 3rd, 4th. + # + # ordinal(1) # => "st" + # ordinal(2) # => "nd" + # ordinal(1002) # => "nd" + # ordinal(1003) # => "rd" + # ordinal(-11) # => "th" + # ordinal(-1021) # => "st" + # + # source://activesupport//lib/active_support/inflector/methods.rb#334 + def ordinal(number); end + + # Turns a number into an ordinal string used to denote the position in an + # ordered sequence such as 1st, 2nd, 3rd, 4th. + # + # ordinalize(1) # => "1st" + # ordinalize(2) # => "2nd" + # ordinalize(1002) # => "1002nd" + # ordinalize(1003) # => "1003rd" + # ordinalize(-11) # => "-11th" + # ordinalize(-1021) # => "-1021st" + # + # source://activesupport//lib/active_support/inflector/methods.rb#347 + def ordinalize(number); end + + # Replaces special characters in a string so that it may be used as part of + # a 'pretty' URL. + # + # parameterize("Donald E. Knuth") # => "donald-e-knuth" + # parameterize("^très|Jolie-- ") # => "tres-jolie" + # + # To use a custom separator, override the +separator+ argument. + # + # parameterize("Donald E. Knuth", separator: '_') # => "donald_e_knuth" + # parameterize("^très|Jolie__ ", separator: '_') # => "tres_jolie" + # + # To preserve the case of the characters in a string, use the +preserve_case+ argument. + # + # parameterize("Donald E. Knuth", preserve_case: true) # => "Donald-E-Knuth" + # parameterize("^très|Jolie-- ", preserve_case: true) # => "tres-Jolie" + # + # It preserves dashes and underscores unless they are used as separators: + # + # parameterize("^très|Jolie__ ") # => "tres-jolie__" + # parameterize("^très|Jolie-- ", separator: "_") # => "tres_jolie--" + # parameterize("^très_Jolie-- ", separator: ".") # => "tres_jolie--" + # + # If the optional parameter +locale+ is specified, + # the word will be parameterized as a word of that language. + # By default, this parameter is set to nil and it will use + # the configured I18n.locale. + # + # source://activesupport//lib/active_support/inflector/transliterate.rb#123 + def parameterize(string, separator: T.unsafe(nil), preserve_case: T.unsafe(nil), locale: T.unsafe(nil)); end + + # Returns the plural form of the word in the string. + # + # If passed an optional +locale+ parameter, the word will be + # pluralized using rules defined for that language. By default, + # this parameter is set to :en. + # + # pluralize('post') # => "posts" + # pluralize('octopus') # => "octopi" + # pluralize('sheep') # => "sheep" + # pluralize('words') # => "words" + # pluralize('CamelOctopus') # => "CamelOctopi" + # pluralize('ley', :es) # => "leyes" + # + # source://activesupport//lib/active_support/inflector/methods.rb#33 + def pluralize(word, locale = T.unsafe(nil)); end + + # Tries to find a constant with the name specified in the argument string. + # + # safe_constantize('Module') # => Module + # safe_constantize('Foo::Bar') # => Foo::Bar + # + # The name is assumed to be the one of a top-level constant, no matter + # whether it starts with "::" or not. No lexical context is taken into + # account: + # + # C = 'outside' + # module M + # C = 'inside' + # C # => 'inside' + # safe_constantize('C') # => 'outside', same as ::C + # end + # + # +nil+ is returned when the name is not in CamelCase or the constant (or + # part of it) is unknown. + # + # safe_constantize('blargle') # => nil + # safe_constantize('UnknownModule') # => nil + # safe_constantize('UnknownModule::Foo::Bar') # => nil + # + # source://activesupport//lib/active_support/inflector/methods.rb#315 + def safe_constantize(camel_cased_word); end + + # The reverse of #pluralize, returns the singular form of a word in a + # string. + # + # If passed an optional +locale+ parameter, the word will be + # singularized using rules defined for that language. By default, + # this parameter is set to :en. + # + # singularize('posts') # => "post" + # singularize('octopi') # => "octopus" + # singularize('sheep') # => "sheep" + # singularize('word') # => "word" + # singularize('CamelOctopi') # => "CamelOctopus" + # singularize('leyes', :es) # => "ley" + # + # source://activesupport//lib/active_support/inflector/methods.rb#50 + def singularize(word, locale = T.unsafe(nil)); end + + # Creates the name of a table like \Rails does for models to table names. + # This method uses the #pluralize method on the last word in the string. + # + # tableize('RawScaledScorer') # => "raw_scaled_scorers" + # tableize('ham_and_egg') # => "ham_and_eggs" + # tableize('fancyCategory') # => "fancy_categories" + # + # source://activesupport//lib/active_support/inflector/methods.rb#204 + def tableize(class_name); end + + # Capitalizes all the words and replaces some characters in the string to + # create a nicer looking title. +titleize+ is meant for creating pretty + # output. It is not used in the \Rails internals. + # + # The trailing '_id','Id'.. can be kept and capitalized by setting the + # optional parameter +keep_id_suffix+ to true. + # By default, this parameter is false. + # + # titleize('man from the boondocks') # => "Man From The Boondocks" + # titleize('x-men: the last stand') # => "X Men: The Last Stand" + # titleize('TheManWithoutAPast') # => "The Man Without A Past" + # titleize('raiders_of_the_lost_ark') # => "Raiders Of The Lost Ark" + # titleize('string_ending_with_id', keep_id_suffix: true) # => "String Ending With Id" + # + # source://activesupport//lib/active_support/inflector/methods.rb#192 + def titleize(word, keep_id_suffix: T.unsafe(nil)); end + + # Replaces non-ASCII characters with an ASCII approximation, or if none + # exists, a replacement character which defaults to "?". + # + # transliterate('Ærøskøbing') + # # => "AEroskobing" + # + # Default approximations are provided for Western/Latin characters, + # e.g, "ø", "ñ", "é", "ß", etc. + # + # This method is I18n aware, so you can set up custom approximations for a + # locale. This can be useful, for example, to transliterate German's "ü" + # and "ö" to "ue" and "oe", or to add support for transliterating Russian + # to ASCII. + # + # In order to make your custom transliterations available, you must set + # them as the i18n.transliterate.rule i18n key: + # + # # Store the transliterations in locales/de.yml + # i18n: + # transliterate: + # rule: + # ü: "ue" + # ö: "oe" + # + # # Or set them using Ruby + # I18n.backend.store_translations(:de, i18n: { + # transliterate: { + # rule: { + # 'ü' => 'ue', + # 'ö' => 'oe' + # } + # } + # }) + # + # The value for i18n.transliterate.rule can be a simple Hash that + # maps characters to ASCII approximations as shown above, or, for more + # complex requirements, a Proc: + # + # I18n.backend.store_translations(:de, i18n: { + # transliterate: { + # rule: ->(string) { MyTransliterator.transliterate(string) } + # } + # }) + # + # Now you can have different transliterations for each locale: + # + # transliterate('Jürgen', locale: :en) + # # => "Jurgen" + # + # transliterate('Jürgen', locale: :de) + # # => "Juergen" + # + # Transliteration is restricted to UTF-8, US-ASCII, and GB18030 strings. + # Other encodings will raise an ArgumentError. + # + # @raise [ArgumentError] + # + # source://activesupport//lib/active_support/inflector/transliterate.rb#64 + def transliterate(string, replacement = T.unsafe(nil), locale: T.unsafe(nil)); end + + # Makes an underscored, lowercase form from the expression in the string. + # + # Changes '::' to '/' to convert namespaces to paths. + # + # underscore('ActiveModel') # => "active_model" + # underscore('ActiveModel::Errors') # => "active_model/errors" + # + # As a rule of thumb you can think of +underscore+ as the inverse of + # #camelize, though there are cases where that does not hold: + # + # camelize(underscore('SSLError')) # => "SslError" + # + # source://activesupport//lib/active_support/inflector/methods.rb#99 + def underscore(camel_cased_word); end + + # Converts the first character in the string to uppercase. + # + # upcase_first('what a Lovely Day') # => "What a Lovely Day" + # upcase_first('w') # => "W" + # upcase_first('') # => "" + # + # source://activesupport//lib/active_support/inflector/methods.rb#166 + def upcase_first(string); end + + private + + # Applies inflection rules for +singularize+ and +pluralize+. + # + # If passed an optional +locale+ parameter, the uncountables will be + # found for that locale. + # + # apply_inflections('post', inflections.plurals, :en) # => "posts" + # apply_inflections('posts', inflections.singulars, :en) # => "post" + # + # source://activesupport//lib/active_support/inflector/methods.rb#376 + def apply_inflections(word, rules, locale = T.unsafe(nil)); end + + # Mounts a regular expression, returned as a string to ease interpolation, + # that will match part by part the given constant. + # + # const_regexp("Foo::Bar::Baz") # => "Foo(::Bar(::Baz)?)?" + # const_regexp("::") # => "::" + # + # source://activesupport//lib/active_support/inflector/methods.rb#357 + def const_regexp(camel_cased_word); end +end + +# source://activesupport//lib/active_support/inflector/transliterate.rb#8 +ActiveSupport::Inflector::ALLOWED_ENCODINGS_FOR_TRANSLITERATE = T.let(T.unsafe(nil), Array) + +# = Active Support \Inflections +# +# A singleton instance of this class is yielded by Inflector.inflections, +# which can then be used to specify additional inflection rules. If passed +# an optional locale, rules for other languages can be specified. The +# default locale is :en. Only rules for English are provided. +# +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, '\1\2en' +# inflect.singular /^(ox)en/i, '\1' +# +# inflect.irregular 'cactus', 'cacti' +# +# inflect.uncountable 'equipment' +# end +# +# New rules are added at the top. So in the example above, the irregular +# rule for cactus will now be the first of the pluralization and +# singularization rules that is runs. This guarantees that your rules run +# before any of the rules that may already have been loaded. +# +# source://activesupport//lib/active_support/inflector/inflections.rb#31 +class ActiveSupport::Inflector::Inflections + # @return [Inflections] a new instance of Inflections + # + # source://activesupport//lib/active_support/inflector/inflections.rb#96 + def initialize; end + + # Specifies a new acronym. An acronym must be specified as it will appear + # in a camelized string. An underscore string that contains the acronym + # will retain the acronym when passed to +camelize+, +humanize+, or + # +titleize+. A camelized string that contains the acronym will maintain + # the acronym when titleized or humanized, and will convert the acronym + # into a non-delimited single lowercase word when passed to +underscore+. + # + # acronym 'HTML' + # titleize 'html' # => 'HTML' + # camelize 'html' # => 'HTML' + # underscore 'MyHTML' # => 'my_html' + # + # The acronym, however, must occur as a delimited unit and not be part of + # another word for conversions to recognize it: + # + # acronym 'HTTP' + # camelize 'my_http_delimited' # => 'MyHTTPDelimited' + # camelize 'https' # => 'Https', not 'HTTPs' + # underscore 'HTTPS' # => 'http_s', not 'https' + # + # acronym 'HTTPS' + # camelize 'https' # => 'HTTPS' + # underscore 'HTTPS' # => 'https' + # + # Note: Acronyms that are passed to +pluralize+ will no longer be + # recognized, since the acronym will not occur as a delimited unit in the + # pluralized result. To work around this, you must specify the pluralized + # form as an acronym as well: + # + # acronym 'API' + # camelize(pluralize('api')) # => 'Apis' + # + # acronym 'APIs' + # camelize(pluralize('api')) # => 'APIs' + # + # +acronym+ may be used to specify any word that contains an acronym or + # otherwise needs to maintain a non-standard capitalization. The only + # restriction is that the word must begin with a capital letter. + # + # acronym 'RESTful' + # underscore 'RESTful' # => 'restful' + # underscore 'RESTfulController' # => 'restful_controller' + # titleize 'RESTfulController' # => 'RESTful Controller' + # camelize 'restful' # => 'RESTful' + # camelize 'restful_controller' # => 'RESTfulController' + # + # acronym 'McDonald' + # underscore 'McDonald' # => 'mcdonald' + # camelize 'mcdonald' # => 'McDonald' + # + # source://activesupport//lib/active_support/inflector/inflections.rb#158 + def acronym(word); end + + # Returns the value of attribute acronyms. + # + # source://activesupport//lib/active_support/inflector/inflections.rb#92 + def acronyms; end + + # source://activesupport//lib/active_support/inflector/inflections.rb#94 + def acronyms_camelize_regex; end + + # source://activesupport//lib/active_support/inflector/inflections.rb#94 + def acronyms_underscore_regex; end + + # Clears the loaded inflections within a given scope (default is + # :all). Give the scope as a symbol of the inflection type, the + # options are: :plurals, :singulars, :uncountables, + # :humans, :acronyms. + # + # clear :all + # clear :plurals + # + # source://activesupport//lib/active_support/inflector/inflections.rb#247 + def clear(scope = T.unsafe(nil)); end + + # Specifies a humanized form of a string by a regular expression rule or + # by a string mapping. When using a regular expression based replacement, + # the normal humanize formatting is called after the replacement. When a + # string is used, the human form should be specified as desired (example: + # 'The name', not 'the_name'). + # + # human /_cnt$/i, '\1_count' + # human 'legacy_col_person_name', 'Name' + # + # source://activesupport//lib/active_support/inflector/inflections.rb#236 + def human(rule, replacement); end + + # Returns the value of attribute humans. + # + # source://activesupport//lib/active_support/inflector/inflections.rb#92 + def humans; end + + # Specifies a new irregular that applies to both pluralization and + # singularization at the same time. This can only be used for strings, not + # regular expressions. You simply pass the irregular in singular and + # plural form. + # + # irregular 'cactus', 'cacti' + # irregular 'person', 'people' + # + # source://activesupport//lib/active_support/inflector/inflections.rb#190 + def irregular(singular, plural); end + + # Specifies a new pluralization rule and its replacement. The rule can + # either be a string or a regular expression. The replacement should + # always be a string that may include references to the matched data from + # the rule. + # + # source://activesupport//lib/active_support/inflector/inflections.rb#167 + def plural(rule, replacement); end + + # Returns the value of attribute plurals. + # + # source://activesupport//lib/active_support/inflector/inflections.rb#92 + def plurals; end + + # Specifies a new singularization rule and its replacement. The rule can + # either be a string or a regular expression. The replacement should + # always be a string that may include references to the matched data from + # the rule. + # + # source://activesupport//lib/active_support/inflector/inflections.rb#177 + def singular(rule, replacement); end + + # Returns the value of attribute singulars. + # + # source://activesupport//lib/active_support/inflector/inflections.rb#92 + def singulars; end + + # Specifies words that are uncountable and should not be inflected. + # + # uncountable 'money' + # uncountable 'money', 'information' + # uncountable %w( money information rice ) + # + # source://activesupport//lib/active_support/inflector/inflections.rb#224 + def uncountable(*words); end + + # Returns the value of attribute uncountables. + # + # source://activesupport//lib/active_support/inflector/inflections.rb#92 + def uncountables; end + + private + + # source://activesupport//lib/active_support/inflector/inflections.rb#266 + def define_acronym_regex_patterns; end + + # Private, for the test suite. + # + # source://activesupport//lib/active_support/inflector/inflections.rb#102 + def initialize_dup(orig); end + + class << self + # source://activesupport//lib/active_support/inflector/inflections.rb#77 + def instance(locale = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/inflector/inflections.rb#83 + def instance_or_fallback(locale); end + end +end + +# source://activesupport//lib/active_support/inflector/inflections.rb#35 +class ActiveSupport::Inflector::Inflections::Uncountables + include ::Enumerable + + # @return [Uncountables] a new instance of Uncountables + # + # source://activesupport//lib/active_support/inflector/inflections.rb#40 + def initialize; end + + # source://activesupport//lib/active_support/inflector/inflections.rb#50 + def <<(word); end + + # source://activesupport//lib/active_support/inflector/inflections.rb#38 + def ==(arg); end + + # source://activesupport//lib/active_support/inflector/inflections.rb#61 + def add(words); end + + # source://activesupport//lib/active_support/inflector/inflections.rb#45 + def delete(entry); end + + # source://activesupport//lib/active_support/inflector/inflections.rb#38 + def each(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/inflector/inflections.rb#38 + def empty?(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/inflector/inflections.rb#57 + def flatten; end + + # source://activesupport//lib/active_support/inflector/inflections.rb#38 + def pop(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/inflector/inflections.rb#38 + def to_a(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/inflector/inflections.rb#38 + def to_ary(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/inflector/inflections.rb#38 + def to_s(*_arg0, **_arg1, &_arg2); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/inflector/inflections.rb#68 + def uncountable?(str); end +end + +# = Inheritable Options +# +# +InheritableOptions+ provides a constructor to build an OrderedOptions +# hash inherited from another hash. +# +# Use this if you already have some hash and you want to create a new one based on it. +# +# h = ActiveSupport::InheritableOptions.new({ girl: 'Mary', boy: 'John' }) +# h.girl # => 'Mary' +# h.boy # => 'John' +# +# If the existing hash has string keys, call Hash#symbolize_keys on it. +# +# h = ActiveSupport::InheritableOptions.new({ 'girl' => 'Mary', 'boy' => 'John' }.symbolize_keys) +# h.girl # => 'Mary' +# h.boy # => 'John' +# +# source://activesupport//lib/active_support/ordered_options.rb#89 +class ActiveSupport::InheritableOptions < ::ActiveSupport::OrderedOptions + # @return [InheritableOptions] a new instance of InheritableOptions + # + # source://activesupport//lib/active_support/ordered_options.rb#90 + def initialize(parent = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/ordered_options.rb#107 + def ==(other); end + + # source://activesupport//lib/active_support/ordered_options.rb#142 + def each(&block); end + + # source://activesupport//lib/active_support/ordered_options.rb#134 + def inheritable_copy; end + + # source://activesupport//lib/active_support/ordered_options.rb#111 + def inspect; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/ordered_options.rb#126 + def key?(key); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/ordered_options.rb#130 + def overridden?(key); end + + # source://activesupport//lib/active_support/ordered_options.rb#119 + def pretty_print(pp); end + + # source://activesupport//lib/active_support/ordered_options.rb#138 + def to_a; end + + # source://activesupport//lib/active_support/ordered_options.rb#103 + def to_h; end + + # source://activesupport//lib/active_support/ordered_options.rb#115 + def to_s; end + + private + + # source://activesupport//lib/active_support/ordered_options.rb#123 + def own_key?(_arg0); end +end + +# source://activesupport//lib/active_support/isolated_execution_state.rb#4 +module ActiveSupport::IsolatedExecutionState + class << self + # source://activesupport//lib/active_support/isolated_execution_state.rb#31 + def [](key); end + + # source://activesupport//lib/active_support/isolated_execution_state.rb#37 + def []=(key, value); end + + # source://activesupport//lib/active_support/isolated_execution_state.rb#50 + def clear; end + + # source://activesupport//lib/active_support/isolated_execution_state.rb#54 + def context; end + + # source://activesupport//lib/active_support/isolated_execution_state.rb#46 + def delete(key); end + + # Returns the value of attribute isolation_level. + # + # source://activesupport//lib/active_support/isolated_execution_state.rb#11 + def isolation_level; end + + # source://activesupport//lib/active_support/isolated_execution_state.rb#13 + def isolation_level=(level); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/isolated_execution_state.rb#42 + def key?(key); end + + # Returns the value of attribute scope. + # + # source://activesupport//lib/active_support/isolated_execution_state.rb#11 + def scope; end + + # source://activesupport//lib/active_support/isolated_execution_state.rb#58 + def share_with(other, &block); end + end +end + +# source://activesupport//lib/active_support/json/decoding.rb#11 +module ActiveSupport::JSON + class << self + # Parses a JSON string (JavaScript Object Notation) into a Ruby object. + # See http://www.json.org for more info. + # + # ActiveSupport::JSON.decode("{\"team\":\"rails\",\"players\":\"36\"}") + # # => {"team" => "rails", "players" => "36"} + # ActiveSupport::JSON.decode("2.39") + # # => 2.39 + # + # source://activesupport//lib/active_support/json/decoding.rb#24 + def decode(json, options = T.unsafe(nil)); end + + # Dumps objects in JSON (JavaScript Object Notation). + # See http://www.json.org for more info. + # + # ActiveSupport::JSON.encode({ team: 'rails', players: '36' }) + # # => "{\"team\":\"rails\",\"players\":\"36\"}" + # + # By default, it generates JSON that is safe to include in JavaScript, as + # it escapes U+2028 (Line Separator) and U+2029 (Paragraph Separator): + # + # ActiveSupport::JSON.encode({ key: "\u2028" }) + # # => "{\"key\":\"\\u2028\"}" + # + # By default, it also generates JSON that is safe to include in HTML, as + # it escapes <, >, and &: + # + # ActiveSupport::JSON.encode({ key: "<>&" }) + # # => "{\"key\":\"\\u003c\\u003e\\u0026\"}" + # + # This behavior can be changed with the +escape_html_entities+ option, or the + # global escape_html_entities_in_json configuration option. + # + # ActiveSupport::JSON.encode({ key: "<>&" }, escape_html_entities: false) + # # => "{\"key\":\"<>&\"}" + # + # For performance reasons, you can set the +escape+ option to false, + # which will skip all escaping: + # + # ActiveSupport::JSON.encode({ key: "\u2028<>&" }, escape: false) + # # => "{\"key\":\"\u2028<>&\"}" + # + # source://activesupport//lib/active_support/json/encoding.rb#56 + def dump(value, options = T.unsafe(nil)); end + + # Dumps objects in JSON (JavaScript Object Notation). + # See http://www.json.org for more info. + # + # ActiveSupport::JSON.encode({ team: 'rails', players: '36' }) + # # => "{\"team\":\"rails\",\"players\":\"36\"}" + # + # By default, it generates JSON that is safe to include in JavaScript, as + # it escapes U+2028 (Line Separator) and U+2029 (Paragraph Separator): + # + # ActiveSupport::JSON.encode({ key: "\u2028" }) + # # => "{\"key\":\"\\u2028\"}" + # + # By default, it also generates JSON that is safe to include in HTML, as + # it escapes <, >, and &: + # + # ActiveSupport::JSON.encode({ key: "<>&" }) + # # => "{\"key\":\"\\u003c\\u003e\\u0026\"}" + # + # This behavior can be changed with the +escape_html_entities+ option, or the + # global escape_html_entities_in_json configuration option. + # + # ActiveSupport::JSON.encode({ key: "<>&" }, escape_html_entities: false) + # # => "{\"key\":\"<>&\"}" + # + # For performance reasons, you can set the +escape+ option to false, + # which will skip all escaping: + # + # ActiveSupport::JSON.encode({ key: "\u2028<>&" }, escape: false) + # # => "{\"key\":\"\u2028<>&\"}" + # + # source://activesupport//lib/active_support/json/encoding.rb#47 + def encode(value, options = T.unsafe(nil)); end + + # Parses a JSON string (JavaScript Object Notation) into a Ruby object. + # See http://www.json.org for more info. + # + # ActiveSupport::JSON.decode("{\"team\":\"rails\",\"players\":\"36\"}") + # # => {"team" => "rails", "players" => "36"} + # ActiveSupport::JSON.decode("2.39") + # # => 2.39 + # + # source://activesupport//lib/active_support/json/decoding.rb#33 + def load(json, options = T.unsafe(nil)); end + + # Returns the class of the error that will be raised when there is an + # error in decoding JSON. Using this method means you won't directly + # depend on the ActiveSupport's JSON implementation, in case it changes + # in the future. + # + # begin + # obj = ActiveSupport::JSON.decode(some_string) + # rescue ActiveSupport::JSON.parse_error + # Rails.logger.warn("Attempted to decode invalid JSON: #{some_string}") + # end + # + # source://activesupport//lib/active_support/json/decoding.rb#45 + def parse_error; end + + private + + # source://activesupport//lib/active_support/json/decoding.rb#50 + def convert_dates_from(data); end + end +end + +# source://activesupport//lib/active_support/json/decoding.rb#14 +ActiveSupport::JSON::DATETIME_REGEX = T.let(T.unsafe(nil), Regexp) + +# matches YAML-formatted dates +# +# source://activesupport//lib/active_support/json/decoding.rb#13 +ActiveSupport::JSON::DATE_REGEX = T.let(T.unsafe(nil), Regexp) + +# source://activesupport//lib/active_support/json/encoding.rb#59 +module ActiveSupport::JSON::Encoding + class << self + # source://activesupport//lib/active_support/json/encoding.rb#239 + def encode_without_escape(value); end + + # source://activesupport//lib/active_support/json/encoding.rb#235 + def encode_without_options(value); end + + # If true, encode >, <, & as escaped unicode sequences (e.g. > as \u003e) + # as a safety measure. + # + # source://activesupport//lib/active_support/json/encoding.rb#212 + def escape_html_entities_in_json; end + + # If true, encode >, <, & as escaped unicode sequences (e.g. > as \u003e) + # as a safety measure. + # + # source://activesupport//lib/active_support/json/encoding.rb#212 + def escape_html_entities_in_json=(_arg0); end + + # If true, encode LINE SEPARATOR (U+2028) and PARAGRAPH SEPARATOR (U+2029) + # as escaped unicode sequences ('\u2028' and '\u2029'). + # Historically these characters were not valid inside JavaScript strings + # but that changed in ECMAScript 2019. As such it's no longer a concern in + # modern browsers: https://caniuse.com/mdn-javascript_builtins_json_json_superset. + # + # source://activesupport//lib/active_support/json/encoding.rb#219 + def escape_js_separators_in_json; end + + # If true, encode LINE SEPARATOR (U+2028) and PARAGRAPH SEPARATOR (U+2029) + # as escaped unicode sequences ('\u2028' and '\u2029'). + # Historically these characters were not valid inside JavaScript strings + # but that changed in ECMAScript 2019. As such it's no longer a concern in + # modern browsers: https://caniuse.com/mdn-javascript_builtins_json_json_superset. + # + # source://activesupport//lib/active_support/json/encoding.rb#219 + def escape_js_separators_in_json=(_arg0); end + + # Sets the encoder used by \Rails to encode Ruby objects into JSON strings + # in +Object#to_json+ and +ActiveSupport::JSON.encode+. + # + # source://activesupport//lib/active_support/json/encoding.rb#227 + def json_encoder; end + + # source://activesupport//lib/active_support/json/encoding.rb#229 + def json_encoder=(encoder); end + + # Sets the precision of encoded time values. + # Defaults to 3 (equivalent to millisecond precision) + # + # source://activesupport//lib/active_support/json/encoding.rb#223 + def time_precision; end + + # Sets the precision of encoded time values. + # Defaults to 3 (equivalent to millisecond precision) + # + # source://activesupport//lib/active_support/json/encoding.rb#223 + def time_precision=(_arg0); end + + # If true, use ISO 8601 format for dates and times. Otherwise, fall back + # to the Active Support legacy format. + # + # source://activesupport//lib/active_support/json/encoding.rb#208 + def use_standard_json_time_format; end + + # If true, use ISO 8601 format for dates and times. Otherwise, fall back + # to the Active Support legacy format. + # + # source://activesupport//lib/active_support/json/encoding.rb#208 + def use_standard_json_time_format=(_arg0); end + end +end + +# source://activesupport//lib/active_support/json/encoding.rb#63 +ActiveSupport::JSON::Encoding::ESCAPED_CHARS = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/json/encoding.rb#72 +ActiveSupport::JSON::Encoding::FULL_ESCAPE_REGEX = T.let(T.unsafe(nil), Regexp) + +# source://activesupport//lib/active_support/json/encoding.rb#71 +ActiveSupport::JSON::Encoding::HTML_ENTITIES_REGEX = T.let(T.unsafe(nil), Regexp) + +# source://activesupport//lib/active_support/json/encoding.rb#150 +class ActiveSupport::JSON::Encoding::JSONGemCoderEncoder + # @return [JSONGemCoderEncoder] a new instance of JSONGemCoderEncoder + # + # source://activesupport//lib/active_support/json/encoding.rb#171 + def initialize(options = T.unsafe(nil)); end + + # Encode the given object into a JSON string + # + # source://activesupport//lib/active_support/json/encoding.rb#183 + def encode(value); end +end + +# source://activesupport//lib/active_support/json/encoding.rb#152 +ActiveSupport::JSON::Encoding::JSONGemCoderEncoder::CODER = T.let(T.unsafe(nil), JSON::Coder) + +# source://activesupport//lib/active_support/json/encoding.rb#151 +ActiveSupport::JSON::Encoding::JSONGemCoderEncoder::JSON_NATIVE_TYPES = T.let(T.unsafe(nil), Array) + +# source://activesupport//lib/active_support/json/encoding.rb#75 +class ActiveSupport::JSON::Encoding::JSONGemEncoder + # @return [JSONGemEncoder] a new instance of JSONGemEncoder + # + # source://activesupport//lib/active_support/json/encoding.rb#78 + def initialize(options = T.unsafe(nil)); end + + # Encode the given object into a JSON string + # + # source://activesupport//lib/active_support/json/encoding.rb#83 + def encode(value); end + + # Returns the value of attribute options. + # + # source://activesupport//lib/active_support/json/encoding.rb#76 + def options; end + + private + + # Convert an object into a "JSON-ready" representation composed of + # primitives like Hash, Array, String, Symbol, Numeric, + # and +true+/+false+/+nil+. + # Recursively calls #as_json to the object to recursively build a + # fully JSON-ready object. + # + # This allows developers to implement #as_json without having to + # worry about what base types of objects they are allowed to return + # or having to remember to call #as_json recursively. + # + # Note: the +options+ hash passed to +object.to_json+ is only passed + # to +object.as_json+, not any of this method's recursive +#as_json+ + # calls. + # + # source://activesupport//lib/active_support/json/encoding.rb#118 + def jsonify(value); end + + # Encode a "jsonified" Ruby data structure using the JSON gem + # + # source://activesupport//lib/active_support/json/encoding.rb#143 + def stringify(jsonified); end +end + +# source://activesupport//lib/active_support/json/encoding.rb#73 +ActiveSupport::JSON::Encoding::JS_SEPARATORS_REGEX = T.let(T.unsafe(nil), Regexp) + +# source://activesupport//lib/active_support/json/encoding.rb#60 +ActiveSupport::JSON::Encoding::U2028 = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/json/encoding.rb#61 +ActiveSupport::JSON::Encoding::U2029 = T.let(T.unsafe(nil), String) + +# = Key Generator +# +# KeyGenerator is a simple wrapper around OpenSSL's implementation of PBKDF2. +# It can be used to derive a number of keys for various purposes from a given secret. +# This lets \Rails applications have a single secure secret, but avoid reusing that +# key in multiple incompatible contexts. +# +# source://activesupport//lib/active_support/key_generator.rb#13 +class ActiveSupport::KeyGenerator + # @return [KeyGenerator] a new instance of KeyGenerator + # + # source://activesupport//lib/active_support/key_generator.rb#28 + def initialize(secret, options = T.unsafe(nil)); end + + # Returns a derived key suitable for use. The default +key_size+ is chosen + # to be compatible with the default settings of ActiveSupport::MessageVerifier. + # i.e. OpenSSL::Digest::SHA1#block_length + # + # source://activesupport//lib/active_support/key_generator.rb#41 + def generate_key(salt, key_size = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/key_generator.rb#45 + def inspect; end + + class << self + # source://activesupport//lib/active_support/key_generator.rb#23 + def hash_digest_class; end + + # source://activesupport//lib/active_support/key_generator.rb#15 + def hash_digest_class=(klass); end + end +end + +# = Lazy Load Hooks +# +# LazyLoadHooks allows \Rails to lazily load a lot of components and thus +# making the app boot faster. Because of this feature now there is no need to +# require +ActiveRecord::Base+ at boot time purely to apply +# configuration. Instead a hook is registered that applies configuration once +# +ActiveRecord::Base+ is loaded. Here +ActiveRecord::Base+ is +# used as example but this feature can be applied elsewhere too. +# +# Here is an example where on_load method is called to register a hook. +# +# initializer 'active_record.initialize_timezone' do +# ActiveSupport.on_load(:active_record) do +# self.time_zone_aware_attributes = true +# self.default_timezone = :utc +# end +# end +# +# When the entirety of +ActiveRecord::Base+ has been +# evaluated then run_load_hooks is invoked. The very last line of +# +ActiveRecord::Base+ is: +# +# ActiveSupport.run_load_hooks(:active_record, ActiveRecord::Base) +# +# run_load_hooks will then execute all the hooks that were registered +# with the on_load method. In the case of the above example, it will +# execute the block of code that is in the +initializer+. +# +# Registering a hook that has already run results in that hook executing +# immediately. This allows hooks to be nested for code that relies on +# multiple lazily loaded components: +# +# initializer "action_text.renderer" do +# ActiveSupport.on_load(:action_controller_base) do +# ActiveSupport.on_load(:action_text_content) do +# self.default_renderer = Class.new(ActionController::Base).renderer +# end +# end +# end +# +# source://activesupport//lib/active_support/lazy_load_hooks.rb#43 +module ActiveSupport::LazyLoadHooks + # Declares a block that will be executed when a \Rails component is fully + # loaded. If the component has already loaded, the block is executed + # immediately. + # + # ==== Options + # + # * :yield - Yields the object that run_load_hooks to +block+. + # * :run_once - Given +block+ will run only once. + # + # source://activesupport//lib/active_support/lazy_load_hooks.rb#60 + def on_load(name, options = T.unsafe(nil), &block); end + + # Executes all blocks registered to +name+ via on_load, using +base+ as the + # evaluation context. + # + # ActiveSupport.run_load_hooks(:active_record, ActiveRecord::Base) + # + # In the case of the above example, it will execute all hooks registered + # for +:active_record+ within the class +ActiveRecord::Base+. + # + # source://activesupport//lib/active_support/lazy_load_hooks.rb#75 + def run_load_hooks(name, base = T.unsafe(nil)); end + + private + + # source://activesupport//lib/active_support/lazy_load_hooks.rb#91 + def execute_hook(name, base, options, block); end + + # source://activesupport//lib/active_support/lazy_load_hooks.rb#83 + def with_execution_control(name, block, once); end + + class << self + # source://activesupport//lib/active_support/lazy_load_hooks.rb#44 + def extended(base); end + end +end + +# = Active Support Log \Subscriber +# +# +ActiveSupport::LogSubscriber+ is an object set to consume +# ActiveSupport::Notifications with the sole purpose of logging them. +# The log subscriber dispatches notifications to a registered object based +# on its given namespace. +# +# An example would be Active Record log subscriber responsible for logging +# queries: +# +# module ActiveRecord +# class LogSubscriber < ActiveSupport::LogSubscriber +# attach_to :active_record +# +# def sql(event) +# info "#{event.payload[:name]} (#{event.duration}) #{event.payload[:sql]}" +# end +# end +# end +# +# ActiveRecord::LogSubscriber.logger must be set as well, but it is assigned +# automatically in a \Rails environment. +# +# After configured, whenever a "sql.active_record" notification is +# published, it will properly dispatch the event +# (ActiveSupport::Notifications::Event) to the +sql+ method. +# +# Being an ActiveSupport::Notifications consumer, +# +ActiveSupport::LogSubscriber+ exposes a simple interface to check if +# instrumented code raises an exception. It is common to log a different +# message in case of an error, and this can be achieved by extending +# the previous example: +# +# module ActiveRecord +# class LogSubscriber < ActiveSupport::LogSubscriber +# def sql(event) +# exception = event.payload[:exception] +# +# if exception +# exception_object = event.payload[:exception_object] +# +# error "[ERROR] #{event.payload[:name]}: #{exception.join(', ')} " \ +# "(#{exception_object.backtrace.first})" +# else +# # standard logger code +# end +# end +# end +# end +# +# +ActiveSupport::LogSubscriber+ also has some helpers to deal with +# logging. For example, ActiveSupport::LogSubscriber.flush_all! will ensure +# that all logs are flushed, and it is called in Rails::Rack::Logger after a +# request finishes. +# +# source://activesupport//lib/active_support/log_subscriber.rb#64 +class ActiveSupport::LogSubscriber < ::ActiveSupport::Subscriber + # @return [LogSubscriber] a new instance of LogSubscriber + # + # source://activesupport//lib/active_support/log_subscriber.rb#133 + def initialize; end + + # source://activesupport//lib/active_support/log_subscriber.rb#146 + def call(event); end + + # source://activesupport//lib/active_support/log_subscriber.rb#83 + def colorize_logging; end + + # source://activesupport//lib/active_support/log_subscriber.rb#83 + def colorize_logging=(val); end + + # source://activesupport//lib/active_support/log_subscriber.rb#156 + def debug(progname = T.unsafe(nil), &block); end + + # source://activesupport//lib/active_support/log_subscriber.rb#156 + def error(progname = T.unsafe(nil), &block); end + + # source://activesupport//lib/active_support/log_subscriber.rb#152 + def event_levels=(_arg0); end + + # source://activesupport//lib/active_support/log_subscriber.rb#156 + def fatal(progname = T.unsafe(nil), &block); end + + # source://activesupport//lib/active_support/log_subscriber.rb#156 + def info(progname = T.unsafe(nil), &block); end + + # source://activesupport//lib/active_support/log_subscriber.rb#138 + def logger; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/log_subscriber.rb#142 + def silenced?(event); end + + # source://activesupport//lib/active_support/log_subscriber.rb#156 + def unknown(progname = T.unsafe(nil), &block); end + + # source://activesupport//lib/active_support/log_subscriber.rb#156 + def warn(progname = T.unsafe(nil), &block); end + + private + + # Set color by using a symbol or one of the defined constants. Set modes + # by specifying bold, italic, or underline options. Inspired by Highline, + # this method will automatically clear formatting at the end of the returned String. + # + # source://activesupport//lib/active_support/log_subscriber.rb#166 + def color(text, color, mode_options = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/log_subscriber.rb#180 + def log_exception(name, e); end + + # source://activesupport//lib/active_support/log_subscriber.rb#174 + def mode_from(options); end + + class << self + # source://activesupport//lib/active_support/log_subscriber.rb#99 + def attach_to(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/log_subscriber.rb#83 + def colorize_logging; end + + # source://activesupport//lib/active_support/log_subscriber.rb#83 + def colorize_logging=(val); end + + # Flush all log_subscribers' logger. + # + # source://activesupport//lib/active_support/log_subscriber.rb#112 + def flush_all!; end + + # source://activesupport//lib/active_support/log_subscriber.rb#84 + def log_levels; end + + # source://activesupport//lib/active_support/log_subscriber.rb#84 + def log_levels=(value); end + + # source://activesupport//lib/active_support/log_subscriber.rb#84 + def log_levels?; end + + # source://activesupport//lib/active_support/log_subscriber.rb#107 + def log_subscribers; end + + # source://activesupport//lib/active_support/log_subscriber.rb#93 + def logger; end + + # Sets the attribute logger + # + # @param value the value to set the attribute logger to. + # + # source://activesupport//lib/active_support/log_subscriber.rb#105 + def logger=(_arg0); end + + private + + # source://activesupport//lib/active_support/log_subscriber.rb#84 + def __class_attr_log_levels; end + + # source://activesupport//lib/active_support/log_subscriber.rb#84 + def __class_attr_log_levels=(new_value); end + + # source://activesupport//lib/active_support/log_subscriber.rb#117 + def fetch_public_methods(subscriber, inherit_all); end + + # source://activesupport//lib/active_support/log_subscriber.rb#121 + def set_event_levels; end + + # source://activesupport//lib/active_support/log_subscriber.rb#127 + def subscribe_log_level(method, level); end + end +end + +# ANSI sequence colors +# +# source://activesupport//lib/active_support/log_subscriber.rb#74 +ActiveSupport::LogSubscriber::BLACK = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/log_subscriber.rb#78 +ActiveSupport::LogSubscriber::BLUE = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/log_subscriber.rb#80 +ActiveSupport::LogSubscriber::CYAN = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/log_subscriber.rb#76 +ActiveSupport::LogSubscriber::GREEN = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/log_subscriber.rb#86 +ActiveSupport::LogSubscriber::LEVEL_CHECKS = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/log_subscriber.rb#79 +ActiveSupport::LogSubscriber::MAGENTA = T.let(T.unsafe(nil), String) + +# ANSI sequence modes +# +# source://activesupport//lib/active_support/log_subscriber.rb#66 +ActiveSupport::LogSubscriber::MODES = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/log_subscriber.rb#75 +ActiveSupport::LogSubscriber::RED = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/log_subscriber.rb#81 +ActiveSupport::LogSubscriber::WHITE = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/log_subscriber.rb#77 +ActiveSupport::LogSubscriber::YELLOW = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/logger.rb#8 +class ActiveSupport::Logger < ::Logger + include ::ActiveSupport::LoggerSilence + include ::ActiveSupport::LoggerThreadSafeLevel + + # @return [Logger] a new instance of Logger + # + # source://activesupport//lib/active_support/logger.rb#33 + def initialize(*args, **kwargs); end + + # source://activesupport//lib/active_support/logger.rb#9 + def silencer; end + + # source://activesupport//lib/active_support/logger.rb#9 + def silencer=(val); end + + class << self + # Returns true if the logger destination matches one of the sources + # + # logger = Logger.new(STDOUT) + # ActiveSupport::Logger.logger_outputs_to?(logger, STDOUT) + # # => true + # + # logger = Logger.new('/var/log/rails.log') + # ActiveSupport::Logger.logger_outputs_to?(logger, '/var/log/rails.log') + # # => true + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/logger.rb#20 + def logger_outputs_to?(logger, *sources); end + + # source://activesupport//lib/active_support/logger.rb#47 + def normalize_sources(sources); end + + # source://activesupport//lib/active_support/logger.rb#9 + def silencer; end + + # source://activesupport//lib/active_support/logger.rb#9 + def silencer=(val); end + end +end + +# Simple formatter which only displays the message. +# +# source://activesupport//lib/active_support/logger.rb#39 +class ActiveSupport::Logger::SimpleFormatter < ::Logger::Formatter + # This method is invoked when a log event occurs + # + # source://activesupport//lib/active_support/logger.rb#41 + def call(severity, timestamp, progname, msg); end +end + +# source://activesupport//lib/active_support/logger_silence.rb#8 +module ActiveSupport::LoggerSilence + extend ::ActiveSupport::Concern + include ::ActiveSupport::LoggerThreadSafeLevel + + # Silences the logger for the duration of the block. + # + # source://activesupport//lib/active_support/logger_silence.rb#17 + def silence(severity = T.unsafe(nil)); end +end + +# source://activesupport//lib/active_support/logger_thread_safe_level.rb#7 +module ActiveSupport::LoggerThreadSafeLevel + extend ::ActiveSupport::Concern + + # source://activesupport//lib/active_support/logger_thread_safe_level.rb#10 + def initialize(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/logger_thread_safe_level.rb#35 + def level; end + + # source://activesupport//lib/active_support/logger_thread_safe_level.rb#15 + def local_level; end + + # source://activesupport//lib/active_support/logger_thread_safe_level.rb#19 + def local_level=(level); end + + # Change the thread-local level for the duration of the given block. + # + # source://activesupport//lib/active_support/logger_thread_safe_level.rb#40 + def log_at(level); end + + private + + # Returns the value of attribute local_level_key. + # + # source://activesupport//lib/active_support/logger_thread_safe_level.rb#48 + def local_level_key; end +end + +# = Active Support Message Encryptor +# +# MessageEncryptor is a simple way to encrypt values which get stored +# somewhere you don't trust. +# +# The cipher text and initialization vector are base64 encoded and returned +# to you. +# +# This can be used in situations similar to the MessageVerifier, but +# where you don't want users to be able to determine the value of the payload. +# +# len = ActiveSupport::MessageEncryptor.key_len +# salt = SecureRandom.random_bytes(len) +# key = ActiveSupport::KeyGenerator.new('password').generate_key(salt, len) # => "\x89\xE0\x156\xAC..." +# crypt = ActiveSupport::MessageEncryptor.new(key) # => # +# encrypted_data = crypt.encrypt_and_sign('my secret data') # => "NlFBTTMwOUV5UlA1QlNEN2xkY2d6eThYWWh..." +# crypt.decrypt_and_verify(encrypted_data) # => "my secret data" +# +# The +decrypt_and_verify+ method will raise an +# +ActiveSupport::MessageEncryptor::InvalidMessage+ exception if the data +# provided cannot be decrypted or verified. +# +# crypt.decrypt_and_verify('not encrypted data') # => ActiveSupport::MessageEncryptor::InvalidMessage +# +# === Confining messages to a specific purpose +# +# By default any message can be used throughout your app. But they can also be +# confined to a specific +:purpose+. +# +# token = crypt.encrypt_and_sign("this is the chair", purpose: :login) +# +# Then that same purpose must be passed when verifying to get the data back out: +# +# crypt.decrypt_and_verify(token, purpose: :login) # => "this is the chair" +# crypt.decrypt_and_verify(token, purpose: :shipping) # => nil +# crypt.decrypt_and_verify(token) # => nil +# +# Likewise, if a message has no purpose it won't be returned when verifying with +# a specific purpose. +# +# token = crypt.encrypt_and_sign("the conversation is lively") +# crypt.decrypt_and_verify(token, purpose: :scare_tactics) # => nil +# crypt.decrypt_and_verify(token) # => "the conversation is lively" +# +# === Making messages expire +# +# By default messages last forever and verifying one year from now will still +# return the original value. But messages can be set to expire at a given +# time with +:expires_in+ or +:expires_at+. +# +# crypt.encrypt_and_sign(parcel, expires_in: 1.month) +# crypt.encrypt_and_sign(doowad, expires_at: Time.now.end_of_year) +# +# Then the messages can be verified and returned up to the expire time. +# Thereafter, verifying returns +nil+. +# +# === Rotating keys +# +# MessageEncryptor also supports rotating out old configurations by falling +# back to a stack of encryptors. Call +rotate+ to build and add an encryptor +# so +decrypt_and_verify+ will also try the fallback. +# +# By default any rotated encryptors use the values of the primary +# encryptor unless specified otherwise. +# +# You'd give your encryptor the new defaults: +# +# crypt = ActiveSupport::MessageEncryptor.new(@secret, cipher: "aes-256-gcm") +# +# Then gradually rotate the old values out by adding them as fallbacks. Any message +# generated with the old values will then work until the rotation is removed. +# +# crypt.rotate old_secret # Fallback to an old secret instead of @secret. +# crypt.rotate cipher: "aes-256-cbc" # Fallback to an old cipher instead of aes-256-gcm. +# +# Though if both the secret and the cipher was changed at the same time, +# the above should be combined into: +# +# crypt.rotate old_secret, cipher: "aes-256-cbc" +# +# source://activesupport//lib/active_support/message_encryptor.rb#90 +class ActiveSupport::MessageEncryptor < ::ActiveSupport::Messages::Codec + include ::ActiveSupport::Messages::Rotator + + # Initialize a new MessageEncryptor. +secret+ must be at least as long as + # the cipher key size. For the default 'aes-256-gcm' cipher, this is 256 + # bits. If you are using a user-entered secret, you can generate a suitable + # key by using ActiveSupport::KeyGenerator or a similar key + # derivation function. + # + # The first additional parameter is used as the signature key for + # MessageVerifier. This allows you to specify keys to encrypt and sign + # data. Ignored when using an AEAD cipher like 'aes-256-gcm'. + # + # ActiveSupport::MessageEncryptor.new('secret', 'signature_secret') + # + # ==== Options + # + # [+:cipher+] + # Cipher to use. Can be any cipher returned by +OpenSSL::Cipher.ciphers+. + # Default is 'aes-256-gcm'. + # + # [+:digest+] + # Digest used for signing. Ignored when using an AEAD cipher like + # 'aes-256-gcm'. + # + # [+:serializer+] + # The serializer used to serialize message data. You can specify any + # object that responds to +dump+ and +load+, or you can choose from + # several preconfigured serializers: +:marshal+, +:json_allow_marshal+, + # +:json+, +:message_pack_allow_marshal+, +:message_pack+. + # + # The preconfigured serializers include a fallback mechanism to support + # multiple deserialization formats. For example, the +:marshal+ serializer + # will serialize using +Marshal+, but can deserialize using +Marshal+, + # ActiveSupport::JSON, or ActiveSupport::MessagePack. This makes it easy + # to migrate between serializers. + # + # The +:marshal+, +:json_allow_marshal+, and +:message_pack_allow_marshal+ + # serializers support deserializing using +Marshal+, but the others do + # not. Beware that +Marshal+ is a potential vector for deserialization + # attacks in cases where a message signing secret has been leaked. If + # possible, choose a serializer that does not support +Marshal+. + # + # The +:message_pack+ and +:message_pack_allow_marshal+ serializers use + # ActiveSupport::MessagePack, which can roundtrip some Ruby types that are + # not supported by JSON, and may provide improved performance. However, + # these require the +msgpack+ gem. + # + # When using \Rails, the default depends on +config.active_support.message_serializer+. + # Otherwise, the default is +:marshal+. + # + # [+:url_safe+] + # By default, MessageEncryptor generates RFC 4648 compliant strings + # which are not URL-safe. In other words, they can contain "+" and "/". + # If you want to generate URL-safe strings (in compliance with "Base 64 + # Encoding with URL and Filename Safe Alphabet" in RFC 4648), you can + # pass +true+. + # + # [+:force_legacy_metadata_serializer+] + # Whether to use the legacy metadata serializer, which serializes the + # message first, then wraps it in an envelope which is also serialized. This + # was the default in \Rails 7.0 and below. + # + # If you don't pass a truthy value, the default is set using + # +config.active_support.use_message_serializer_for_metadata+. + # + # @return [MessageEncryptor] a new instance of MessageEncryptor + # + # source://activesupport//lib/active_support/message_encryptor.rb#183 + def initialize(*args, on_rotation: T.unsafe(nil), **options); end + + # source://activesupport//lib/active_support/message_encryptor.rb#256 + def create_message(value, **options); end + + # Decrypt and verify a message. We need to verify the message in order to + # avoid padding attacks. Reference: https://www.limited-entropy.com/padding-oracle-attacks/. + # + # ==== Options + # + # [+:purpose+] + # The purpose that the message was generated with. If the purpose does not + # match, +decrypt_and_verify+ will return +nil+. + # + # message = encryptor.encrypt_and_sign("hello", purpose: "greeting") + # encryptor.decrypt_and_verify(message, purpose: "greeting") # => "hello" + # encryptor.decrypt_and_verify(message) # => nil + # + # message = encryptor.encrypt_and_sign("bye") + # encryptor.decrypt_and_verify(message) # => "bye" + # encryptor.decrypt_and_verify(message, purpose: "greeting") # => nil + # + # source://activesupport//lib/active_support/message_encryptor.rb#241 + def decrypt_and_verify(message, **options); end + + # Encrypt and sign a message. We need to sign the message in order to avoid + # padding attacks. Reference: https://www.limited-entropy.com/padding-oracle-attacks/. + # + # ==== Options + # + # [+:expires_at+] + # The datetime at which the message expires. After this datetime, + # verification of the message will fail. + # + # message = encryptor.encrypt_and_sign("hello", expires_at: Time.now.tomorrow) + # encryptor.decrypt_and_verify(message) # => "hello" + # # 24 hours later... + # encryptor.decrypt_and_verify(message) # => nil + # + # [+:expires_in+] + # The duration for which the message is valid. After this duration has + # elapsed, verification of the message will fail. + # + # message = encryptor.encrypt_and_sign("hello", expires_in: 24.hours) + # encryptor.decrypt_and_verify(message) # => "hello" + # # 24 hours later... + # encryptor.decrypt_and_verify(message) # => nil + # + # [+:purpose+] + # The purpose of the message. If specified, the same purpose must be + # specified when verifying the message; otherwise, verification will fail. + # (See #decrypt_and_verify.) + # + # source://activesupport//lib/active_support/message_encryptor.rb#220 + def encrypt_and_sign(value, **options); end + + # source://activesupport//lib/active_support/message_encryptor.rb#264 + def inspect; end + + # source://activesupport//lib/active_support/message_encryptor.rb#260 + def read_message(message, on_rotation: T.unsafe(nil), **options); end + + private + + # Returns the value of attribute aead_mode. + # + # source://activesupport//lib/active_support/message_encryptor.rb#371 + def aead_mode; end + + # Returns the value of attribute aead_mode. + # + # source://activesupport//lib/active_support/message_encryptor.rb#372 + def aead_mode?; end + + # source://activesupport//lib/active_support/message_encryptor.rb#295 + def decrypt(encrypted_message); end + + # source://activesupport//lib/active_support/message_encryptor.rb#277 + def encrypt(data); end + + # source://activesupport//lib/active_support/message_encryptor.rb#340 + def extract_part(encrypted_message, rindex, length); end + + # source://activesupport//lib/active_support/message_encryptor.rb#350 + def extract_parts(encrypted_message); end + + # source://activesupport//lib/active_support/message_encryptor.rb#336 + def join_parts(parts); end + + # source://activesupport//lib/active_support/message_encryptor.rb#320 + def length_after_encode(length_before_encode); end + + # source://activesupport//lib/active_support/message_encryptor.rb#332 + def length_of_encoded_auth_tag; end + + # source://activesupport//lib/active_support/message_encryptor.rb#328 + def length_of_encoded_iv; end + + # source://activesupport//lib/active_support/message_encryptor.rb#367 + def new_cipher; end + + # source://activesupport//lib/active_support/message_encryptor.rb#269 + def sign(data); end + + # source://activesupport//lib/active_support/message_encryptor.rb#273 + def verify(data); end + + class << self + # source://activesupport//lib/active_support/message_encryptor.rb#96 + def default_cipher; end + + # Given a cipher, returns the key length of the cipher to help generate the key of desired size + # + # source://activesupport//lib/active_support/message_encryptor.rb#252 + def key_len(cipher = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/message_encryptor.rb#93 + def use_authenticated_message_encryption; end + + # source://activesupport//lib/active_support/message_encryptor.rb#93 + def use_authenticated_message_encryption=(val); end + end +end + +# source://activesupport//lib/active_support/message_encryptor.rb#118 +ActiveSupport::MessageEncryptor::AUTH_TAG_LENGTH = T.let(T.unsafe(nil), Integer) + +# source://activesupport//lib/active_support/message_encryptor.rb#115 +class ActiveSupport::MessageEncryptor::InvalidMessage < ::StandardError; end + +# source://activesupport//lib/active_support/message_encryptor.rb#105 +module ActiveSupport::MessageEncryptor::NullSerializer + class << self + # source://activesupport//lib/active_support/message_encryptor.rb#110 + def dump(value); end + + # source://activesupport//lib/active_support/message_encryptor.rb#106 + def load(value); end + end +end + +# source://activesupport//lib/active_support/message_encryptor.rb#116 +ActiveSupport::MessageEncryptor::OpenSSLCipherError = OpenSSL::Cipher::CipherError + +# source://activesupport//lib/active_support/message_encryptor.rb#119 +ActiveSupport::MessageEncryptor::SEPARATOR = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/message_encryptors.rb#6 +class ActiveSupport::MessageEncryptors < ::ActiveSupport::Messages::RotationCoordinator + private + + # source://activesupport//lib/active_support/message_encryptors.rb#187 + def build(salt, secret_generator:, secret_generator_options:, **options); end +end + +# = Active Support Message Verifier +# +# +MessageVerifier+ makes it easy to generate and verify messages which are +# signed to prevent tampering. +# +# In a \Rails application, you can use +Rails.application.message_verifier+ +# to manage unique instances of verifiers for each use case. +# {Learn more}[link:classes/Rails/Application.html#method-i-message_verifier]. +# +# This is useful for cases like remember-me tokens and auto-unsubscribe links +# where the session store isn't suitable or available. +# +# First, generate a signed message: +# cookies[:remember_me] = Rails.application.message_verifier(:remember_me).generate([@user.id, 2.weeks.from_now]) +# +# Later verify that message: +# +# id, time = Rails.application.message_verifier(:remember_me).verify(cookies[:remember_me]) +# if time.future? +# self.current_user = User.find(id) +# end +# +# === Signing is not encryption +# +# The signed messages are not encrypted. The payload is merely encoded (Base64 by default) and can be decoded by +# anyone. The signature is just assuring that the message wasn't tampered with. For example: +# +# message = Rails.application.message_verifier('my_purpose').generate('never put secrets here') +# # => "BAhJIhtuZXZlciBwdXQgc2VjcmV0cyBoZXJlBjoGRVQ=--a0c1c0827919da5e949e989c971249355735e140" +# Base64.decode64(message.split("--").first) # no key needed +# # => 'never put secrets here' +# +# If you also need to encrypt the contents, you must use ActiveSupport::MessageEncryptor instead. +# +# === Confine messages to a specific purpose +# +# It's not recommended to use the same verifier for different purposes in your application. +# Doing so could allow a malicious actor to re-use a signed message to perform an unauthorized +# action. +# You can reduce this risk by confining signed messages to a specific +:purpose+. +# +# token = @verifier.generate("signed message", purpose: :login) +# +# Then that same purpose must be passed when verifying to get the data back out: +# +# @verifier.verified(token, purpose: :login) # => "signed message" +# @verifier.verified(token, purpose: :shipping) # => nil +# @verifier.verified(token) # => nil +# +# @verifier.verify(token, purpose: :login) # => "signed message" +# @verifier.verify(token, purpose: :shipping) # => raises ActiveSupport::MessageVerifier::InvalidSignature +# @verifier.verify(token) # => raises ActiveSupport::MessageVerifier::InvalidSignature +# +# Likewise, if a message has no purpose it won't be returned when verifying with +# a specific purpose. +# +# token = @verifier.generate("signed message") +# @verifier.verified(token, purpose: :redirect) # => nil +# @verifier.verified(token) # => "signed message" +# +# @verifier.verify(token, purpose: :redirect) # => raises ActiveSupport::MessageVerifier::InvalidSignature +# @verifier.verify(token) # => "signed message" +# +# === Expiring messages +# +# By default messages last forever and verifying one year from now will still +# return the original value. But messages can be set to expire at a given +# time with +:expires_in+ or +:expires_at+. +# +# @verifier.generate("signed message", expires_in: 1.month) +# @verifier.generate("signed message", expires_at: Time.now.end_of_year) +# +# Messages can then be verified and returned until expiry. +# Thereafter, the +verified+ method returns +nil+ while +verify+ raises +# +ActiveSupport::MessageVerifier::InvalidSignature+. +# +# === Rotating keys +# +# MessageVerifier also supports rotating out old configurations by falling +# back to a stack of verifiers. Call +rotate+ to build and add a verifier so +# either +verified+ or +verify+ will also try verifying with the fallback. +# +# By default any rotated verifiers use the values of the primary +# verifier unless specified otherwise. +# +# You'd give your verifier the new defaults: +# +# verifier = ActiveSupport::MessageVerifier.new(@secret, digest: "SHA512", serializer: JSON) +# +# Then gradually rotate the old values out by adding them as fallbacks. Any message +# generated with the old values will then work until the rotation is removed. +# +# verifier.rotate(old_secret) # Fallback to an old secret instead of @secret. +# verifier.rotate(digest: "SHA256") # Fallback to an old digest instead of SHA512. +# verifier.rotate(serializer: Marshal) # Fallback to an old serializer instead of JSON. +# +# Though the above would most likely be combined into one rotation: +# +# verifier.rotate(old_secret, digest: "SHA256", serializer: Marshal) +# +# source://activesupport//lib/active_support/message_verifier.rb#110 +class ActiveSupport::MessageVerifier < ::ActiveSupport::Messages::Codec + include ::ActiveSupport::Messages::Rotator + + # Initialize a new MessageVerifier with a secret for the signature. + # + # ==== Options + # + # [+:digest+] + # Digest used for signing. The default is "SHA1". See + # +OpenSSL::Digest+ for alternatives. + # + # [+:serializer+] + # The serializer used to serialize message data. You can specify any + # object that responds to +dump+ and +load+, or you can choose from + # several preconfigured serializers: +:marshal+, +:json_allow_marshal+, + # +:json+, +:message_pack_allow_marshal+, +:message_pack+. + # + # The preconfigured serializers include a fallback mechanism to support + # multiple deserialization formats. For example, the +:marshal+ serializer + # will serialize using +Marshal+, but can deserialize using +Marshal+, + # ActiveSupport::JSON, or ActiveSupport::MessagePack. This makes it easy + # to migrate between serializers. + # + # The +:marshal+, +:json_allow_marshal+, and +:message_pack_allow_marshal+ + # serializers support deserializing using +Marshal+, but the others do + # not. Beware that +Marshal+ is a potential vector for deserialization + # attacks in cases where a message signing secret has been leaked. If + # possible, choose a serializer that does not support +Marshal+. + # + # The +:message_pack+ and +:message_pack_allow_marshal+ serializers use + # ActiveSupport::MessagePack, which can roundtrip some Ruby types that are + # not supported by JSON, and may provide improved performance. However, + # these require the +msgpack+ gem. + # + # When using \Rails, the default depends on +config.active_support.message_serializer+. + # Otherwise, the default is +:marshal+. + # + # [+:url_safe+] + # By default, MessageVerifier generates RFC 4648 compliant strings which are + # not URL-safe. In other words, they can contain "+" and "/". If you want to + # generate URL-safe strings (in compliance with "Base 64 Encoding with URL + # and Filename Safe Alphabet" in RFC 4648), you can pass +true+. + # Note that MessageVerifier will always accept both URL-safe and URL-unsafe + # encoded messages, to allow a smooth transition between the two settings. + # + # [+:force_legacy_metadata_serializer+] + # Whether to use the legacy metadata serializer, which serializes the + # message first, then wraps it in an envelope which is also serialized. This + # was the default in \Rails 7.0 and below. + # + # If you don't pass a truthy value, the default is set using + # +config.active_support.use_message_serializer_for_metadata+. + # + # @raise [ArgumentError] + # @return [MessageVerifier] a new instance of MessageVerifier + # + # source://activesupport//lib/active_support/message_verifier.rb#167 + def initialize(*args, on_rotation: T.unsafe(nil), **options); end + + # source://activesupport//lib/active_support/message_verifier.rb#310 + def create_message(value, **options); end + + # Generates a signed message for the provided value. + # + # The message is signed with the +MessageVerifier+'s secret. + # Returns Base64-encoded message joined with the generated signature. + # + # verifier = ActiveSupport::MessageVerifier.new("secret") + # verifier.generate("signed message") # => "BAhJIhNzaWduZWQgbWVzc2FnZQY6BkVU--f67d5f27c3ee0b8483cebf2103757455e947493b" + # + # ==== Options + # + # [+:expires_at+] + # The datetime at which the message expires. After this datetime, + # verification of the message will fail. + # + # message = verifier.generate("hello", expires_at: Time.now.tomorrow) + # verifier.verified(message) # => "hello" + # # 24 hours later... + # verifier.verified(message) # => nil + # verifier.verify(message) # => raises ActiveSupport::MessageVerifier::InvalidSignature + # + # [+:expires_in+] + # The duration for which the message is valid. After this duration has + # elapsed, verification of the message will fail. + # + # message = verifier.generate("hello", expires_in: 24.hours) + # verifier.verified(message) # => "hello" + # # 24 hours later... + # verifier.verified(message) # => nil + # verifier.verify(message) # => raises ActiveSupport::MessageVerifier::InvalidSignature + # + # [+:purpose+] + # The purpose of the message. If specified, the same purpose must be + # specified when verifying the message; otherwise, verification will fail. + # (See #verified and #verify.) + # + # source://activesupport//lib/active_support/message_verifier.rb#306 + def generate(value, **options); end + + # source://activesupport//lib/active_support/message_verifier.rb#318 + def inspect; end + + # source://activesupport//lib/active_support/message_verifier.rb#314 + def read_message(message, on_rotation: T.unsafe(nil), **options); end + + # Checks if a signed message could have been generated by signing an object + # with the +MessageVerifier+'s secret. + # + # verifier = ActiveSupport::MessageVerifier.new("secret") + # signed_message = verifier.generate("signed message") + # verifier.valid_message?(signed_message) # => true + # + # tampered_message = signed_message.chop # editing the message invalidates the signature + # verifier.valid_message?(tampered_message) # => false + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/message_verifier.rb#183 + def valid_message?(message); end + + # Decodes the signed message using the +MessageVerifier+'s secret. + # + # verifier = ActiveSupport::MessageVerifier.new("secret") + # + # signed_message = verifier.generate("signed message") + # verifier.verified(signed_message) # => "signed message" + # + # Returns +nil+ if the message was not signed with the same secret. + # + # other_verifier = ActiveSupport::MessageVerifier.new("different_secret") + # other_verifier.verified(signed_message) # => nil + # + # Returns +nil+ if the message is not Base64-encoded. + # + # invalid_message = "f--46a0120593880c733a53b6dad75b42ddc1c8996d" + # verifier.verified(invalid_message) # => nil + # + # Raises any error raised while decoding the signed message. + # + # incompatible_message = "test--dad7b06c94abba8d46a15fafaef56c327665d5ff" + # verifier.verified(incompatible_message) # => TypeError: incompatible marshal file format + # + # ==== Options + # + # [+:purpose+] + # The purpose that the message was generated with. If the purpose does not + # match, +verified+ will return +nil+. + # + # message = verifier.generate("hello", purpose: "greeting") + # verifier.verified(message, purpose: "greeting") # => "hello" + # verifier.verified(message, purpose: "chatting") # => nil + # verifier.verified(message) # => nil + # + # message = verifier.generate("bye") + # verifier.verified(message) # => "bye" + # verifier.verified(message, purpose: "greeting") # => nil + # + # source://activesupport//lib/active_support/message_verifier.rb#224 + def verified(message, **options); end + + # Decodes the signed message using the +MessageVerifier+'s secret. + # + # verifier = ActiveSupport::MessageVerifier.new("secret") + # signed_message = verifier.generate("signed message") + # + # verifier.verify(signed_message) # => "signed message" + # + # Raises +InvalidSignature+ if the message was not signed with the same + # secret or was not Base64-encoded. + # + # other_verifier = ActiveSupport::MessageVerifier.new("different_secret") + # other_verifier.verify(signed_message) # => ActiveSupport::MessageVerifier::InvalidSignature + # + # ==== Options + # + # [+:purpose+] + # The purpose that the message was generated with. If the purpose does not + # match, +verify+ will raise ActiveSupport::MessageVerifier::InvalidSignature. + # + # message = verifier.generate("hello", purpose: "greeting") + # verifier.verify(message, purpose: "greeting") # => "hello" + # verifier.verify(message, purpose: "chatting") # => raises InvalidSignature + # verifier.verify(message) # => raises InvalidSignature + # + # message = verifier.generate("bye") + # verifier.verify(message) # => "bye" + # verifier.verify(message, purpose: "greeting") # => raises InvalidSignature + # + # source://activesupport//lib/active_support/message_verifier.rb#262 + def verify(message, **options); end + + private + + # source://activesupport//lib/active_support/message_verifier.rb#323 + def decode(encoded, url_safe: T.unsafe(nil)); end + + # source://activesupport//lib/active_support/message_verifier.rb#356 + def digest_length_in_hex; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/message_verifier.rb#373 + def digest_matches_data?(digest, data); end + + # source://activesupport//lib/active_support/message_verifier.rb#335 + def extract_encoded(signed); end + + # source://activesupport//lib/active_support/message_verifier.rb#352 + def generate_digest(data); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/message_verifier.rb#364 + def separator_at?(signed_message, index); end + + # source://activesupport//lib/active_support/message_verifier.rb#368 + def separator_index_for(signed_message); end + + # source://activesupport//lib/active_support/message_verifier.rb#330 + def sign_encoded(encoded); end +end + +# source://activesupport//lib/active_support/message_verifier.rb#113 +class ActiveSupport::MessageVerifier::InvalidSignature < ::StandardError; end + +# source://activesupport//lib/active_support/message_verifier.rb#115 +ActiveSupport::MessageVerifier::SEPARATOR = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/message_verifier.rb#116 +ActiveSupport::MessageVerifier::SEPARATOR_LENGTH = T.let(T.unsafe(nil), Integer) + +# source://activesupport//lib/active_support/message_verifiers.rb#6 +class ActiveSupport::MessageVerifiers < ::ActiveSupport::Messages::RotationCoordinator + private + + # source://activesupport//lib/active_support/message_verifiers.rb#185 + def build(salt, secret_generator:, secret_generator_options:, **options); end +end + +# source://activesupport//lib/active_support/messages/rotation_coordinator.rb#6 +module ActiveSupport::Messages; end + +# source://activesupport//lib/active_support/messages/codec.rb#9 +class ActiveSupport::Messages::Codec + include ::ActiveSupport::Messages::Metadata + + # @return [Codec] a new instance of Codec + # + # source://activesupport//lib/active_support/messages/codec.rb#15 + def initialize(**options); end + + private + + # source://activesupport//lib/active_support/messages/codec.rb#45 + def catch_and_ignore(throwable, &block); end + + # source://activesupport//lib/active_support/messages/codec.rb#52 + def catch_and_raise(throwable, as: T.unsafe(nil), &block); end + + # source://activesupport//lib/active_support/messages/codec.rb#29 + def decode(encoded, url_safe: T.unsafe(nil)); end + + # source://activesupport//lib/active_support/messages/codec.rb#39 + def deserialize(serialized); end + + # source://activesupport//lib/active_support/messages/codec.rb#25 + def encode(data, url_safe: T.unsafe(nil)); end + + # source://activesupport//lib/active_support/messages/codec.rb#35 + def serialize(data); end + + # Returns the value of attribute serializer. + # + # source://activesupport//lib/active_support/messages/codec.rb#23 + def serializer; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/messages/codec.rb#60 + def use_message_serializer_for_metadata?; end + + class << self + # source://activesupport//lib/active_support/messages/codec.rb#12 + def default_serializer; end + + # source://activesupport//lib/active_support/messages/codec.rb#12 + def default_serializer=(value); end + + private + + # source://activesupport//lib/active_support/messages/codec.rb#12 + def __class_attr_default_serializer; end + + # source://activesupport//lib/active_support/messages/codec.rb#12 + def __class_attr_default_serializer=(new_value); end + end +end + +# source://activesupport//lib/active_support/messages/metadata.rb#9 +module ActiveSupport::Messages::Metadata + private + + # source://activesupport//lib/active_support/messages/metadata.rb#128 + def deserialize_from_json(serialized); end + + # source://activesupport//lib/active_support/messages/metadata.rb#141 + def deserialize_from_json_safe_string(string); end + + # source://activesupport//lib/active_support/messages/metadata.rb#43 + def deserialize_with_metadata(message, **expected_metadata); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/messages/metadata.rb#96 + def dual_serialized_metadata_envelope_json?(string); end + + # source://activesupport//lib/active_support/messages/metadata.rb#78 + def extract_from_metadata_envelope(envelope, purpose: T.unsafe(nil)); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/messages/metadata.rb#92 + def metadata_envelope?(object); end + + # source://activesupport//lib/active_support/messages/metadata.rb#114 + def parse_expiry(expires_at); end + + # source://activesupport//lib/active_support/messages/metadata.rb#100 + def pick_expiry(expires_at, expires_in); end + + # source://activesupport//lib/active_support/messages/metadata.rb#124 + def serialize_to_json(data); end + + # source://activesupport//lib/active_support/messages/metadata.rb#137 + def serialize_to_json_safe_string(data); end + + # source://activesupport//lib/active_support/messages/metadata.rb#30 + def serialize_with_metadata(data, **metadata); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/messages/metadata.rb#60 + def use_message_serializer_for_metadata?; end + + # source://activesupport//lib/active_support/messages/metadata.rb#64 + def wrap_in_metadata_envelope(hash, expires_at: T.unsafe(nil), expires_in: T.unsafe(nil), purpose: T.unsafe(nil)); end + + # source://activesupport//lib/active_support/messages/metadata.rb#71 + def wrap_in_metadata_legacy_envelope(hash, expires_at: T.unsafe(nil), expires_in: T.unsafe(nil), purpose: T.unsafe(nil)); end + + class << self + # source://activesupport//lib/active_support/messages/metadata.rb#10 + def use_message_serializer_for_metadata; end + + # source://activesupport//lib/active_support/messages/metadata.rb#10 + def use_message_serializer_for_metadata=(_arg0); end + end +end + +# source://activesupport//lib/active_support/messages/metadata.rb#12 +ActiveSupport::Messages::Metadata::ENVELOPE_SERIALIZERS = T.let(T.unsafe(nil), Array) + +# source://activesupport//lib/active_support/messages/metadata.rb#19 +ActiveSupport::Messages::Metadata::TIMESTAMP_SERIALIZERS = T.let(T.unsafe(nil), Array) + +# source://activesupport//lib/active_support/messages/rotation_configuration.rb#5 +class ActiveSupport::Messages::RotationConfiguration + # @return [RotationConfiguration] a new instance of RotationConfiguration + # + # source://activesupport//lib/active_support/messages/rotation_configuration.rb#8 + def initialize; end + + # Returns the value of attribute encrypted. + # + # source://activesupport//lib/active_support/messages/rotation_configuration.rb#6 + def encrypted; end + + # source://activesupport//lib/active_support/messages/rotation_configuration.rb#12 + def rotate(kind, *args, **options); end + + # Returns the value of attribute signed. + # + # source://activesupport//lib/active_support/messages/rotation_configuration.rb#6 + def signed; end +end + +# source://activesupport//lib/active_support/messages/rotation_coordinator.rb#7 +class ActiveSupport::Messages::RotationCoordinator + # @raise [ArgumentError] + # @return [RotationCoordinator] a new instance of RotationCoordinator + # + # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#10 + def initialize(&secret_generator); end + + # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#18 + def [](salt); end + + # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#22 + def []=(salt, codec); end + + # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#48 + def clear_rotations; end + + # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#54 + def on_rotation(&callback); end + + # @raise [ArgumentError] + # + # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#35 + def prepend(**options, &block); end + + # @raise [ArgumentError] + # + # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#26 + def rotate(**options, &block); end + + # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#44 + def rotate_defaults; end + + # Returns the value of attribute transitional. + # + # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#8 + def transitional; end + + # Sets the attribute transitional + # + # @param value the value to set the attribute transitional to. + # + # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#8 + def transitional=(_arg0); end + + private + + # @raise [NotImplementedError] + # + # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#97 + def build(salt, secret_generator:, secret_generator_options:, **options); end + + # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#85 + def build_with_rotations(salt); end + + # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#60 + def changing_configuration!; end + + # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#71 + def normalize_options(options); end +end + +# source://activesupport//lib/active_support/messages/rotator.rb#5 +module ActiveSupport::Messages::Rotator + # source://activesupport//lib/active_support/messages/rotator.rb#6 + def initialize(*args, on_rotation: T.unsafe(nil), **options); end + + # source://activesupport//lib/active_support/messages/rotator.rb#23 + def fall_back_to(fallback); end + + # source://activesupport//lib/active_support/messages/rotator.rb#18 + def on_rotation(&on_rotation); end + + # source://activesupport//lib/active_support/messages/rotator.rb#28 + def read_message(message, on_rotation: T.unsafe(nil), **options); end + + # source://activesupport//lib/active_support/messages/rotator.rb#14 + def rotate(*args, **options); end + + private + + # source://activesupport//lib/active_support/messages/rotator.rb#54 + def build_rotation(*args, **options); end + + # source://activesupport//lib/active_support/messages/rotator.rb#58 + def catch_rotation_error(&block); end + + # source://activesupport//lib/active_support/messages/rotator.rb#48 + def initialize_dup(*_arg0); end +end + +# source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#8 +module ActiveSupport::Messages::SerializerWithFallback + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#17 + def load(dumped); end + + private + + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#33 + def detect_format(dumped); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#44 + def fallback?(format); end + + class << self + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#9 + def [](format); end + end +end + +# source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#48 +module ActiveSupport::Messages::SerializerWithFallback::AllowMarshal + private + + # @return [Boolean] + # + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#50 + def fallback?(format); end +end + +# source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#78 +module ActiveSupport::Messages::SerializerWithFallback::JsonWithFallback + include ::ActiveSupport::Messages::SerializerWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback::JsonWithFallback + + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#90 + def _load(dumped); end + + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#86 + def dump(object); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#96 + def dumped?(dumped); end + + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#82 + def format; end + + private + + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#101 + def detect_format(dumped); end +end + +# source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#94 +ActiveSupport::Messages::SerializerWithFallback::JsonWithFallback::JSON_START_WITH = T.let(T.unsafe(nil), Regexp) + +# source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#107 +module ActiveSupport::Messages::SerializerWithFallback::JsonWithFallbackAllowMarshal + include ::ActiveSupport::Messages::SerializerWithFallback + include ::ActiveSupport::Messages::SerializerWithFallback::JsonWithFallback + include ::ActiveSupport::Messages::SerializerWithFallback::AllowMarshal + extend ::ActiveSupport::Messages::SerializerWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback::JsonWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback::AllowMarshal + extend ::ActiveSupport::Messages::SerializerWithFallback::JsonWithFallbackAllowMarshal +end + +# source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#55 +module ActiveSupport::Messages::SerializerWithFallback::MarshalWithFallback + include ::ActiveSupport::Messages::SerializerWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback::MarshalWithFallback + + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#67 + def _load(dumped); end + + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#63 + def dump(object); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#73 + def dumped?(dumped); end + + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#59 + def format; end +end + +# source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#71 +ActiveSupport::Messages::SerializerWithFallback::MarshalWithFallback::MARSHAL_SIGNATURE = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#113 +module ActiveSupport::Messages::SerializerWithFallback::MessagePackWithFallback + include ::ActiveSupport::Messages::SerializerWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback::MessagePackWithFallback + + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#125 + def _load(dumped); end + + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#121 + def dump(object); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#129 + def dumped?(dumped); end + + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#117 + def format; end + + private + + # @return [Boolean] + # + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#134 + def available?; end +end + +# source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#143 +module ActiveSupport::Messages::SerializerWithFallback::MessagePackWithFallbackAllowMarshal + include ::ActiveSupport::Messages::SerializerWithFallback + include ::ActiveSupport::Messages::SerializerWithFallback::MessagePackWithFallback + include ::ActiveSupport::Messages::SerializerWithFallback::AllowMarshal + extend ::ActiveSupport::Messages::SerializerWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback::MessagePackWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback::AllowMarshal + extend ::ActiveSupport::Messages::SerializerWithFallback::MessagePackWithFallbackAllowMarshal +end + +# source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#149 +ActiveSupport::Messages::SerializerWithFallback::SERIALIZERS = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/multibyte.rb#4 +module ActiveSupport::Multibyte + class << self + # Returns the current proxy class. + # + # source://activesupport//lib/active_support/multibyte.rb#23 + def proxy_class; end + + # The proxy class returned when calling mb_chars. You can use this accessor + # to configure your own proxy class so you can support other encodings. See + # the ActiveSupport::Multibyte::Chars implementation for an example how to + # do this. + # + # ActiveSupport::Multibyte.proxy_class = CharsForUTF32 + # + # source://activesupport//lib/active_support/multibyte.rb#14 + def proxy_class=(klass); end + end +end + +# = Active Support \Multibyte \Chars +# +# Chars enables you to work transparently with UTF-8 encoding in the Ruby +# String class without having extensive knowledge about the encoding. A +# Chars object accepts a string upon initialization and proxies String +# methods in an encoding safe manner. All the normal String methods are also +# implemented on the proxy. +# +# String methods are proxied through the Chars object, and can be accessed +# through the +mb_chars+ method. Methods which would normally return a +# String object now return a Chars object so methods can be chained. +# +# 'The Perfect String '.mb_chars.downcase.strip +# # => # +# +# Chars objects are perfectly interchangeable with String objects as long as +# no explicit class checks are made. If certain methods do explicitly check +# the class, call +to_s+ before you pass chars objects to them. +# +# bad.explicit_checking_method 'T'.mb_chars.downcase.to_s +# +# The default Chars implementation assumes that the encoding of the string +# is UTF-8, if you want to handle different encodings you can write your own +# multibyte string handler and configure it through +# ActiveSupport::Multibyte.proxy_class. +# +# class CharsForUTF32 +# def size +# @wrapped_string.size / 4 +# end +# +# def self.accepts?(string) +# string.length % 4 == 0 +# end +# end +# +# ActiveSupport::Multibyte.proxy_class = CharsForUTF32 +# +# source://activesupport//lib/active_support/multibyte/chars.rb#47 +class ActiveSupport::Multibyte::Chars + include ::Comparable + + # Creates a new Chars instance by wrapping _string_. + # + # @return [Chars] a new instance of Chars + # + # source://activesupport//lib/active_support/multibyte/chars.rb#56 + def initialize(string, deprecation: T.unsafe(nil)); end + + # source://activesupport//lib/active_support/multibyte/chars.rb#53 + def <=>(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/multibyte/chars.rb#53 + def =~(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/multibyte/chars.rb#53 + def acts_like_string?(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/multibyte/chars.rb#171 + def as_json(options = T.unsafe(nil)); end + + # Performs composition on all the characters. + # + # 'é'.length # => 1 + # 'é'.mb_chars.compose.to_s.length # => 1 + # + # source://activesupport//lib/active_support/multibyte/chars.rb#150 + def compose; end + + # Performs canonical decomposition on all the characters. + # + # 'é'.length # => 1 + # 'é'.mb_chars.decompose.to_s.length # => 2 + # + # source://activesupport//lib/active_support/multibyte/chars.rb#142 + def decompose; end + + # Returns the number of grapheme clusters in the string. + # + # 'क्षि'.mb_chars.length # => 4 + # 'क्षि'.mb_chars.grapheme_length # => 2 + # + # source://activesupport//lib/active_support/multibyte/chars.rb#158 + def grapheme_length; end + + # Limits the byte size of the string to a number of bytes without breaking + # characters. Usable when the storage for a string is limited for some + # reason. + # + # 'こんにちは'.mb_chars.limit(7).to_s # => "こん" + # + # source://activesupport//lib/active_support/multibyte/chars.rb#125 + def limit(limit); end + + # source://activesupport//lib/active_support/multibyte/chars.rb#53 + def match?(*_arg0, **_arg1, &_arg2); end + + # Forward all undefined methods to the wrapped string. + # + # source://activesupport//lib/active_support/multibyte/chars.rb#72 + def method_missing(method, *_arg1, **_arg2, &_arg3); end + + # Reverses all characters in the string. + # + # 'Café'.mb_chars.reverse.to_s # => 'éfaC' + # + # source://activesupport//lib/active_support/multibyte/chars.rb#116 + def reverse; end + + # source://activesupport//lib/active_support/multibyte/chars.rb#176 + def reverse!(*args); end + + # Works like String#slice!, but returns an instance of + # Chars, or +nil+ if the string was not modified. The string will not be + # modified if the range given is out of bounds + # + # string = 'Welcome' + # string.mb_chars.slice!(3) # => # + # string # => 'Welome' + # string.mb_chars.slice!(0..3) # => # + # string # => 'me' + # + # source://activesupport//lib/active_support/multibyte/chars.rb#106 + def slice!(*args); end + + # Works just like String#split, with the exception that the items + # in the resulting list are Chars instances instead of String. This makes + # chaining methods easier. + # + # 'Café périferôl'.mb_chars.split(/é/).map { |part| part.upcase.to_s } # => ["CAF", " P", "RIFERÔL"] + # + # source://activesupport//lib/active_support/multibyte/chars.rb#93 + def split(*args); end + + # Replaces all ISO-8859-1 or CP1252 characters by their UTF-8 equivalent + # resulting in a valid UTF-8 string. + # + # Passing +true+ will forcibly tidy all bytes, assuming that the string's + # encoding is entirely CP1252 or ISO-8859-1. + # + # source://activesupport//lib/active_support/multibyte/chars.rb#167 + def tidy_bytes(force = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/multibyte/chars.rb#176 + def tidy_bytes!(*args); end + + # Capitalizes the first letter of every word, when possible. + # + # "ÉL QUE SE ENTERÓ".mb_chars.titleize.to_s # => "Él Que Se Enteró" + # "日本語".mb_chars.titleize.to_s # => "日本語" + # + # source://activesupport//lib/active_support/multibyte/chars.rb#136 + def titlecase; end + + # Capitalizes the first letter of every word, when possible. + # + # "ÉL QUE SE ENTERÓ".mb_chars.titleize.to_s # => "Él Que Se Enteró" + # "日本語".mb_chars.titleize.to_s # => "日本語" + # + # source://activesupport//lib/active_support/multibyte/chars.rb#133 + def titleize; end + + # Returns the value of attribute wrapped_string. + # + # source://activesupport//lib/active_support/multibyte/chars.rb#50 + def to_s; end + + # Returns the value of attribute wrapped_string. + # + # source://activesupport//lib/active_support/multibyte/chars.rb#51 + def to_str; end + + # Returns the value of attribute wrapped_string. + # + # source://activesupport//lib/active_support/multibyte/chars.rb#49 + def wrapped_string; end + + private + + # source://activesupport//lib/active_support/multibyte/chars.rb#183 + def chars(string); end + + # Returns +true+ if _obj_ responds to the given method. Private methods + # are included in the search only if the optional second parameter + # evaluates to +true+. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/multibyte/chars.rb#84 + def respond_to_missing?(method, include_private); end +end + +# source://activesupport//lib/active_support/multibyte/unicode.rb#5 +module ActiveSupport::Multibyte::Unicode + extend ::ActiveSupport::Multibyte::Unicode + + # Compose decomposed characters to the composed form. + # + # source://activesupport//lib/active_support/multibyte/unicode.rb#21 + def compose(codepoints); end + + # Decompose composed characters to the decomposed form. + # + # source://activesupport//lib/active_support/multibyte/unicode.rb#12 + def decompose(type, codepoints); end + + # Replaces all ISO-8859-1 or CP1252 characters by their UTF-8 equivalent + # resulting in a valid UTF-8 string. + # + # Passing +true+ will forcibly tidy all bytes, assuming that the string's + # encoding is entirely CP1252 or ISO-8859-1. + # + # source://activesupport//lib/active_support/multibyte/unicode.rb#30 + def tidy_bytes(string, force = T.unsafe(nil)); end + + private + + # source://activesupport//lib/active_support/multibyte/unicode.rb#37 + def recode_windows1252_chars(string); end +end + +# The Unicode version that is supported by the implementation +# +# source://activesupport//lib/active_support/multibyte/unicode.rb#9 +ActiveSupport::Multibyte::Unicode::UNICODE_VERSION = T.let(T.unsafe(nil), String) + +# = \Notifications +# +# +ActiveSupport::Notifications+ provides an instrumentation API for +# Ruby. +# +# == Instrumenters +# +# To instrument an event you just need to do: +# +# ActiveSupport::Notifications.instrument('render', extra: :information) do +# render plain: 'Foo' +# end +# +# That first executes the block and then notifies all subscribers once done. +# +# In the example above +render+ is the name of the event, and the rest is called +# the _payload_. The payload is a mechanism that allows instrumenters to pass +# extra information to subscribers. Payloads consist of a hash whose contents +# are arbitrary and generally depend on the event. +# +# == Subscribers +# +# You can consume those events and the information they provide by registering +# a subscriber. +# +# ActiveSupport::Notifications.subscribe('render') do |event| +# event.name # => "render" +# event.duration # => 10 (in milliseconds) +# event.payload # => { extra: :information } +# event.allocations # => 1826 (objects) +# end +# +# +Event+ objects record CPU time and allocations. If you don't need this +# it's also possible to pass a block that accepts five arguments: +# +# ActiveSupport::Notifications.subscribe('render') do |name, start, finish, id, payload| +# name # => String, name of the event (such as 'render' from above) +# start # => Time, when the instrumented block started execution +# finish # => Time, when the instrumented block ended execution +# id # => String, unique ID for the instrumenter that fired the event +# payload # => Hash, the payload +# end +# +# Here, the +start+ and +finish+ values represent wall-clock time. If you are +# concerned about accuracy, you can register a monotonic subscriber. +# +# ActiveSupport::Notifications.monotonic_subscribe('render') do |name, start, finish, id, payload| +# name # => String, name of the event (such as 'render' from above) +# start # => Float, monotonic time when the instrumented block started execution +# finish # => Float, monotonic time when the instrumented block ended execution +# id # => String, unique ID for the instrumenter that fired the event +# payload # => Hash, the payload +# end +# +# For instance, let's store all "render" events in an array: +# +# events = [] +# +# ActiveSupport::Notifications.subscribe('render') do |event| +# events << event +# end +# +# That code returns right away, you are just subscribing to "render" events. +# The block is saved and will be called whenever someone instruments "render": +# +# ActiveSupport::Notifications.instrument('render', extra: :information) do +# render plain: 'Foo' +# end +# +# event = events.first +# event.name # => "render" +# event.duration # => 10 (in milliseconds) +# event.payload # => { extra: :information } +# event.allocations # => 1826 (objects) +# +# If an exception happens during that particular instrumentation the payload will +# have a key :exception with an array of two elements as value: a string with +# the name of the exception class, and the exception message. +# The :exception_object key of the payload will have the exception +# itself as the value: +# +# event.payload[:exception] # => ["ArgumentError", "Invalid value"] +# event.payload[:exception_object] # => # +# +# As the earlier example depicts, the class ActiveSupport::Notifications::Event +# is able to take the arguments as they come and provide an object-oriented +# interface to that data. +# +# It is also possible to pass an object which responds to call method +# as the second parameter to the subscribe method instead of a block: +# +# module ActionController +# class PageRequest +# def call(name, started, finished, unique_id, payload) +# Rails.logger.debug ['notification:', name, started, finished, unique_id, payload].join(' ') +# end +# end +# end +# +# ActiveSupport::Notifications.subscribe('process_action.action_controller', ActionController::PageRequest.new) +# +# resulting in the following output within the logs including a hash with the payload: +# +# notification: process_action.action_controller 2012-04-13 01:08:35 +0300 2012-04-13 01:08:35 +0300 af358ed7fab884532ec7 { +# controller: "Devise::SessionsController", +# action: "new", +# params: {"action"=>"new", "controller"=>"devise/sessions"}, +# format: :html, +# method: "GET", +# path: "/login/sign_in", +# status: 200, +# view_runtime: 279.3080806732178, +# db_runtime: 40.053 +# } +# +# You can also subscribe to all events whose name matches a certain regexp: +# +# ActiveSupport::Notifications.subscribe(/render/) do |*args| +# ... +# end +# +# and even pass no argument to subscribe, in which case you are subscribing +# to all events. +# +# == Temporary Subscriptions +# +# Sometimes you do not want to subscribe to an event for the entire life of +# the application. There are two ways to unsubscribe. +# +# WARNING: The instrumentation framework is designed for long-running subscribers, +# use this feature sparingly because it wipes some internal caches and that has +# a negative impact on performance. +# +# === Subscribe While a Block Runs +# +# You can subscribe to some event temporarily while some block runs. For +# example, in +# +# callback = lambda {|event| ... } +# ActiveSupport::Notifications.subscribed(callback, "sql.active_record") do +# ... +# end +# +# the callback will be called for all "sql.active_record" events instrumented +# during the execution of the block. The callback is unsubscribed automatically +# after that. +# +# To record +started+ and +finished+ values with monotonic time, +# specify the optional :monotonic option to the +# subscribed method. The :monotonic option is set +# to +false+ by default. +# +# callback = lambda {|name, started, finished, unique_id, payload| ... } +# ActiveSupport::Notifications.subscribed(callback, "sql.active_record", monotonic: true) do +# ... +# end +# +# === Manual Unsubscription +# +# The +subscribe+ method returns a subscriber object: +# +# subscriber = ActiveSupport::Notifications.subscribe("render") do |event| +# ... +# end +# +# To prevent that block from being called anymore, just unsubscribe passing +# that reference: +# +# ActiveSupport::Notifications.unsubscribe(subscriber) +# +# You can also unsubscribe by passing the name of the subscriber object. Note +# that this will unsubscribe all subscriptions with the given name: +# +# ActiveSupport::Notifications.unsubscribe("render") +# +# Subscribers using a regexp or other pattern-matching object will remain subscribed +# to all events that match their original pattern, unless those events match a string +# passed to +unsubscribe+: +# +# subscriber = ActiveSupport::Notifications.subscribe(/render/) { } +# ActiveSupport::Notifications.unsubscribe('render_template.action_view') +# subscriber.matches?('render_template.action_view') # => false +# subscriber.matches?('render_partial.action_view') # => true +# +# == Default Queue +# +# Notifications ships with a queue implementation that consumes and publishes events +# to all log subscribers. You can use any queue implementation you want. +# +# source://activesupport//lib/active_support/notifications/instrumenter.rb#7 +module ActiveSupport::Notifications + class << self + # source://activesupport//lib/active_support/notifications.rb#208 + def instrument(name, payload = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/notifications.rb#269 + def instrumenter; end + + # Performs the same functionality as #subscribe, but the +start+ and + # +finish+ block arguments are in monotonic time instead of wall-clock + # time. Monotonic time will not jump forward or backward (due to NTP or + # Daylights Savings). Use +monotonic_subscribe+ when accuracy of time + # duration is important. For example, computing elapsed time between + # two events. + # + # source://activesupport//lib/active_support/notifications.rb#254 + def monotonic_subscribe(pattern = T.unsafe(nil), callback = T.unsafe(nil), &block); end + + # Returns the value of attribute notifier. + # + # source://activesupport//lib/active_support/notifications.rb#198 + def notifier; end + + # Sets the attribute notifier + # + # @param value the value to set the attribute notifier to. + # + # source://activesupport//lib/active_support/notifications.rb#198 + def notifier=(_arg0); end + + # source://activesupport//lib/active_support/notifications.rb#200 + def publish(name, *args); end + + # source://activesupport//lib/active_support/notifications.rb#204 + def publish_event(event); end + + # Subscribe to a given event name with the passed +block+. + # + # You can subscribe to events by passing a String to match exact event + # names, or by passing a Regexp to match all events that match a pattern. + # + # If the block passed to the method only takes one argument, + # it will yield an +Event+ object to the block: + # + # ActiveSupport::Notifications.subscribe(/render/) do |event| + # @event = event + # end + # + # Otherwise the +block+ will receive five arguments with information + # about the event: + # + # ActiveSupport::Notifications.subscribe('render') do |name, start, finish, id, payload| + # name # => String, name of the event (such as 'render' from above) + # start # => Time, when the instrumented block started execution + # finish # => Time, when the instrumented block ended execution + # id # => String, unique ID for the instrumenter that fired the event + # payload # => Hash, the payload + # end + # + # Raises an error if invalid event name type is passed: + # + # ActiveSupport::Notifications.subscribe(:render) {|event| ...} + # #=> ArgumentError (pattern must be specified as a String, Regexp or empty) + # + # source://activesupport//lib/active_support/notifications.rb#244 + def subscribe(pattern = T.unsafe(nil), callback = T.unsafe(nil), &block); end + + # source://activesupport//lib/active_support/notifications.rb#258 + def subscribed(callback, pattern = T.unsafe(nil), monotonic: T.unsafe(nil), &block); end + + # source://activesupport//lib/active_support/notifications.rb#265 + def unsubscribe(subscriber_or_name); end + + private + + # source://activesupport//lib/active_support/notifications.rb#274 + def registry; end + end +end + +# source://activesupport//lib/active_support/notifications/instrumenter.rb#106 +class ActiveSupport::Notifications::Event + # @return [Event] a new instance of Event + # + # source://activesupport//lib/active_support/notifications/instrumenter.rb#110 + def initialize(name, start, ending, transaction_id, payload); end + + # Returns the number of allocations made between the call to #start! and + # the call to #finish!. + # + # source://activesupport//lib/active_support/notifications/instrumenter.rb#176 + def allocations; end + + # Returns the CPU time (in milliseconds) passed between the call to + # #start! and the call to #finish!. + # + # source://activesupport//lib/active_support/notifications/instrumenter.rb#163 + def cpu_time; end + + # Returns the difference in milliseconds between when the execution of the + # event started and when it ended. + # + # ActiveSupport::Notifications.subscribe('wait') do |event| + # @event = event + # end + # + # ActiveSupport::Notifications.instrument('wait') do + # sleep 1 + # end + # + # @event.duration # => 1000.138 + # + # source://activesupport//lib/active_support/notifications/instrumenter.rb#198 + def duration; end + + # source://activesupport//lib/active_support/notifications/instrumenter.rb#128 + def end; end + + # Record information at the time this event finishes + # + # source://activesupport//lib/active_support/notifications/instrumenter.rb#154 + def finish!; end + + # Returns the time spent in GC (in milliseconds) between the call to #start! + # and the call to #finish! + # + # source://activesupport//lib/active_support/notifications/instrumenter.rb#182 + def gc_time; end + + # Returns the idle time (in milliseconds) passed between the call to + # #start! and the call to #finish!. + # + # source://activesupport//lib/active_support/notifications/instrumenter.rb#169 + def idle_time; end + + # Returns the value of attribute name. + # + # source://activesupport//lib/active_support/notifications/instrumenter.rb#107 + def name; end + + # Returns the value of attribute payload. + # + # source://activesupport//lib/active_support/notifications/instrumenter.rb#108 + def payload; end + + # Sets the attribute payload + # + # @param value the value to set the attribute payload to. + # + # source://activesupport//lib/active_support/notifications/instrumenter.rb#108 + def payload=(_arg0); end + + # source://activesupport//lib/active_support/notifications/instrumenter.rb#132 + def record; end + + # Record information at the time this event starts + # + # source://activesupport//lib/active_support/notifications/instrumenter.rb#146 + def start!; end + + # source://activesupport//lib/active_support/notifications/instrumenter.rb#124 + def time; end + + # Returns the value of attribute transaction_id. + # + # source://activesupport//lib/active_support/notifications/instrumenter.rb#107 + def transaction_id; end + + private + + # source://activesupport//lib/active_support/notifications/instrumenter.rb#203 + def now; end + + # Likely on JRuby, TruffleRuby + # + # source://activesupport//lib/active_support/notifications/instrumenter.rb#230 + def now_allocations; end + + # source://activesupport//lib/active_support/notifications/instrumenter.rb#210 + def now_cpu; end + + # source://activesupport//lib/active_support/notifications/instrumenter.rb#220 + def now_gc; end +end + +# This is a default queue implementation that ships with Notifications. +# It just pushes events to all registered log subscribers. +# +# This class is thread safe. All methods are reentrant. +# +# source://activesupport//lib/active_support/notifications/fanout.rb#55 +class ActiveSupport::Notifications::Fanout + include ::ActiveSupport::Notifications::FanoutIteration + + # @return [Fanout] a new instance of Fanout + # + # source://activesupport//lib/active_support/notifications/fanout.rb#56 + def initialize; end + + # source://activesupport//lib/active_support/notifications/fanout.rb#319 + def all_listeners_for(name); end + + # source://activesupport//lib/active_support/notifications/fanout.rb#286 + def build_handle(name, id, payload); end + + # source://activesupport//lib/active_support/notifications/fanout.rb#106 + def clear_cache(key = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/notifications/fanout.rb#305 + def finish(name, id, payload, listeners = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/notifications/fanout.rb#190 + def group_listeners(listeners); end + + # source://activesupport//lib/active_support/notifications/fanout.rb#196 + def groups_for(name); end + + # source://activesupport//lib/active_support/notifications/fanout.rb#64 + def inspect; end + + # source://activesupport//lib/active_support/notifications/fanout.rb#328 + def listeners_for(name); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/notifications/fanout.rb#332 + def listening?(name); end + + # source://activesupport//lib/active_support/notifications/fanout.rb#311 + def publish(name, *_arg1, **_arg2, &_arg3); end + + # source://activesupport//lib/active_support/notifications/fanout.rb#315 + def publish_event(event); end + + # source://activesupport//lib/active_support/notifications/fanout.rb#298 + def start(name, id, payload); end + + # source://activesupport//lib/active_support/notifications/fanout.rb#69 + def subscribe(pattern = T.unsafe(nil), callable = T.unsafe(nil), monotonic: T.unsafe(nil), &block); end + + # source://activesupport//lib/active_support/notifications/fanout.rb#86 + def unsubscribe(subscriber_or_name); end + + # This is a sync queue, so there is no waiting. + # + # source://activesupport//lib/active_support/notifications/fanout.rb#337 + def wait; end +end + +# source://activesupport//lib/active_support/notifications/fanout.rb#116 +class ActiveSupport::Notifications::Fanout::BaseGroup + include ::ActiveSupport::Notifications::FanoutIteration + + # @return [BaseGroup] a new instance of BaseGroup + # + # source://activesupport//lib/active_support/notifications/fanout.rb#119 + def initialize(listeners, name, id, payload); end + + # source://activesupport//lib/active_support/notifications/fanout.rb#123 + def each(&block); end +end + +# source://activesupport//lib/active_support/notifications/fanout.rb#128 +class ActiveSupport::Notifications::Fanout::BaseTimeGroup < ::ActiveSupport::Notifications::Fanout::BaseGroup + # source://activesupport//lib/active_support/notifications/fanout.rb#133 + def finish(name, id, payload); end + + # source://activesupport//lib/active_support/notifications/fanout.rb#129 + def start(name, id, payload); end +end + +# source://activesupport//lib/active_support/notifications/fanout.rb#169 +class ActiveSupport::Notifications::Fanout::EventObjectGroup < ::ActiveSupport::Notifications::Fanout::BaseGroup + # source://activesupport//lib/active_support/notifications/fanout.rb#175 + def finish(name, id, payload); end + + # source://activesupport//lib/active_support/notifications/fanout.rb#170 + def start(name, id, payload); end + + private + + # source://activesupport//lib/active_support/notifications/fanout.rb#185 + def build_event(name, id, payload); end +end + +# source://activesupport//lib/active_support/notifications/fanout.rb#155 +class ActiveSupport::Notifications::Fanout::EventedGroup < ::ActiveSupport::Notifications::Fanout::BaseGroup + # source://activesupport//lib/active_support/notifications/fanout.rb#162 + def finish(name, id, payload); end + + # source://activesupport//lib/active_support/notifications/fanout.rb#156 + def start(name, id, payload); end +end + +# A +Handle+ is used to record the start and finish time of event. +# +# Both #start and #finish must each be called exactly once. +# +# Where possible, it's best to use the block form: ActiveSupport::Notifications.instrument. +# +Handle+ is a low-level API intended for cases where the block form can't be used. +# +# handle = ActiveSupport::Notifications.instrumenter.build_handle("my.event", {}) +# begin +# handle.start +# # work to be instrumented +# ensure +# handle.finish +# end +# +# source://activesupport//lib/active_support/notifications/fanout.rb#230 +class ActiveSupport::Notifications::Fanout::Handle + include ::ActiveSupport::Notifications::FanoutIteration + + # @return [Handle] a new instance of Handle + # + # source://activesupport//lib/active_support/notifications/fanout.rb#233 + def initialize(notifier, name, id, groups, payload); end + + # source://activesupport//lib/active_support/notifications/fanout.rb#250 + def finish; end + + # source://activesupport//lib/active_support/notifications/fanout.rb#254 + def finish_with_values(name, id, payload); end + + # source://activesupport//lib/active_support/notifications/fanout.rb#241 + def start; end + + private + + # source://activesupport//lib/active_support/notifications/fanout.rb#264 + def ensure_state!(expected); end +end + +# source://activesupport//lib/active_support/notifications/fanout.rb#141 +class ActiveSupport::Notifications::Fanout::MonotonicTimedGroup < ::ActiveSupport::Notifications::Fanout::BaseTimeGroup + private + + # source://activesupport//lib/active_support/notifications/fanout.rb#143 + def now; end +end + +# source://activesupport//lib/active_support/notifications/fanout.rb#271 +module ActiveSupport::Notifications::Fanout::NullHandle + extend ::ActiveSupport::Notifications::Fanout::NullHandle + + # source://activesupport//lib/active_support/notifications/fanout.rb#277 + def finish; end + + # source://activesupport//lib/active_support/notifications/fanout.rb#280 + def finish_with_values(_name, _id, _payload); end + + # source://activesupport//lib/active_support/notifications/fanout.rb#274 + def start; end +end + +# source://activesupport//lib/active_support/notifications/fanout.rb#340 +module ActiveSupport::Notifications::Fanout::Subscribers + class << self + # source://activesupport//lib/active_support/notifications/fanout.rb#341 + def new(pattern, listener, monotonic); end + end +end + +# source://activesupport//lib/active_support/notifications/fanout.rb#455 +class ActiveSupport::Notifications::Fanout::Subscribers::EventObject < ::ActiveSupport::Notifications::Fanout::Subscribers::Evented + # source://activesupport//lib/active_support/notifications/fanout.rb#456 + def group_class; end + + # source://activesupport//lib/active_support/notifications/fanout.rb#460 + def publish_event(event); end +end + +# source://activesupport//lib/active_support/notifications/fanout.rb#397 +class ActiveSupport::Notifications::Fanout::Subscribers::Evented + # @return [Evented] a new instance of Evented + # + # source://activesupport//lib/active_support/notifications/fanout.rb#400 + def initialize(pattern, delegate); end + + # Returns the value of attribute delegate. + # + # source://activesupport//lib/active_support/notifications/fanout.rb#398 + def delegate; end + + # source://activesupport//lib/active_support/notifications/fanout.rb#408 + def group_class; end + + # Returns the value of attribute pattern. + # + # source://activesupport//lib/active_support/notifications/fanout.rb#398 + def pattern; end + + # source://activesupport//lib/active_support/notifications/fanout.rb#412 + def publish(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/notifications/fanout.rb#418 + def publish_event(event); end + + # Returns the value of attribute silenceable. + # + # source://activesupport//lib/active_support/notifications/fanout.rb#398 + def silenceable; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/notifications/fanout.rb#426 + def silenced?(name); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/notifications/fanout.rb#430 + def subscribed_to?(name); end + + # source://activesupport//lib/active_support/notifications/fanout.rb#434 + def unsubscribe!(name); end +end + +# source://activesupport//lib/active_support/notifications/fanout.rb#360 +class ActiveSupport::Notifications::Fanout::Subscribers::Matcher + # @return [Matcher] a new instance of Matcher + # + # source://activesupport//lib/active_support/notifications/fanout.rb#373 + def initialize(pattern); end + + # source://activesupport//lib/active_support/notifications/fanout.rb#382 + def ===(name); end + + # Returns the value of attribute exclusions. + # + # source://activesupport//lib/active_support/notifications/fanout.rb#361 + def exclusions; end + + # Returns the value of attribute pattern. + # + # source://activesupport//lib/active_support/notifications/fanout.rb#361 + def pattern; end + + # source://activesupport//lib/active_support/notifications/fanout.rb#378 + def unsubscribe!(name); end + + class << self + # source://activesupport//lib/active_support/notifications/fanout.rb#363 + def wrap(pattern); end + end +end + +# source://activesupport//lib/active_support/notifications/fanout.rb#386 +class ActiveSupport::Notifications::Fanout::Subscribers::Matcher::AllMessages + # source://activesupport//lib/active_support/notifications/fanout.rb#387 + def ===(name); end + + # source://activesupport//lib/active_support/notifications/fanout.rb#391 + def unsubscribe!(*_arg0); end +end + +# source://activesupport//lib/active_support/notifications/fanout.rb#449 +class ActiveSupport::Notifications::Fanout::Subscribers::MonotonicTimed < ::ActiveSupport::Notifications::Fanout::Subscribers::Timed + # source://activesupport//lib/active_support/notifications/fanout.rb#450 + def group_class; end +end + +# source://activesupport//lib/active_support/notifications/fanout.rb#439 +class ActiveSupport::Notifications::Fanout::Subscribers::Timed < ::ActiveSupport::Notifications::Fanout::Subscribers::Evented + # source://activesupport//lib/active_support/notifications/fanout.rb#440 + def group_class; end + + # source://activesupport//lib/active_support/notifications/fanout.rb#444 + def publish(*_arg0, **_arg1, &_arg2); end +end + +# source://activesupport//lib/active_support/notifications/fanout.rb#148 +class ActiveSupport::Notifications::Fanout::TimedGroup < ::ActiveSupport::Notifications::Fanout::BaseTimeGroup + private + + # source://activesupport//lib/active_support/notifications/fanout.rb#150 + def now; end +end + +# source://activesupport//lib/active_support/notifications/fanout.rb#18 +module ActiveSupport::Notifications::FanoutIteration + private + + # source://activesupport//lib/active_support/notifications/fanout.rb#20 + def iterate_guarding_exceptions(collection, &block); end +end + +# source://activesupport//lib/active_support/notifications/fanout.rb#8 +class ActiveSupport::Notifications::InstrumentationSubscriberError < ::RuntimeError + # @return [InstrumentationSubscriberError] a new instance of InstrumentationSubscriberError + # + # source://activesupport//lib/active_support/notifications/fanout.rb#11 + def initialize(exceptions); end + + # Returns the value of attribute exceptions. + # + # source://activesupport//lib/active_support/notifications/fanout.rb#9 + def exceptions; end +end + +# Instrumenters are stored in a thread local. +# +# source://activesupport//lib/active_support/notifications/instrumenter.rb#9 +class ActiveSupport::Notifications::Instrumenter + # @return [Instrumenter] a new instance of Instrumenter + # + # source://activesupport//lib/active_support/notifications/instrumenter.rb#12 + def initialize(notifier); end + + # Returns a "handle" for an event with the given +name+ and +payload+. + # + # #start and #finish must each be called exactly once on the returned object. + # + # Where possible, it's best to use #instrument, which will record the + # start and finish of the event and correctly handle any exceptions. + # +build_handle+ is a low-level API intended for cases where using + # +instrument+ isn't possible. + # + # See ActiveSupport::Notifications::Fanout::Handle. + # + # source://activesupport//lib/active_support/notifications/instrumenter.rb#78 + def build_handle(name, payload); end + + # Send a finish notification with +name+ and +payload+. + # + # source://activesupport//lib/active_support/notifications/instrumenter.rb#92 + def finish(name, payload); end + + # source://activesupport//lib/active_support/notifications/instrumenter.rb#96 + def finish_with_state(listeners_state, name, payload); end + + # Returns the value of attribute id. + # + # source://activesupport//lib/active_support/notifications/instrumenter.rb#10 + def id; end + + # Given a block, instrument it by measuring the time taken to execute + # and publish it. Without a block, simply send a message via the + # notifier. Notice that events get sent even if an error occurs in the + # passed-in block. + # + # source://activesupport//lib/active_support/notifications/instrumenter.rb#54 + def instrument(name, payload = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/notifications/instrumenter.rb#82 + def new_event(name, payload = T.unsafe(nil)); end + + # Send a start notification with +name+ and +payload+. + # + # source://activesupport//lib/active_support/notifications/instrumenter.rb#87 + def start(name, payload); end + + private + + # source://activesupport//lib/active_support/notifications/instrumenter.rb#101 + def unique_id; end +end + +# source://activesupport//lib/active_support/notifications/instrumenter.rb#21 +class ActiveSupport::Notifications::Instrumenter::LegacyHandle + # @return [LegacyHandle] a new instance of LegacyHandle + # + # source://activesupport//lib/active_support/notifications/instrumenter.rb#34 + def initialize(notifier, name, id, payload); end + + # source://activesupport//lib/active_support/notifications/instrumenter.rb#45 + def finish; end + + # source://activesupport//lib/active_support/notifications/instrumenter.rb#41 + def start; end +end + +# source://activesupport//lib/active_support/notifications/instrumenter.rb#22 +class ActiveSupport::Notifications::Instrumenter::LegacyHandle::Wrapper + # @return [Wrapper] a new instance of Wrapper + # + # source://activesupport//lib/active_support/notifications/instrumenter.rb#23 + def initialize(notifier); end + + # source://activesupport//lib/active_support/notifications/instrumenter.rb#27 + def build_handle(name, id, payload); end + + # source://activesupport//lib/active_support/notifications/instrumenter.rb#31 + def finish(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/notifications/instrumenter.rb#31 + def start(*_arg0, **_arg1, &_arg2); end +end + +# = Number Helper +# +# Provides methods for formatting numbers into currencies, percentages, +# phone numbers, and more. +# +# Example usage in a class: +# class Topic +# include ActiveSupport::NumberHelper +# +# def price +# number_to_currency(@price) +# end +# end +# +# Example usage in a module: +# require "active_support/number_helper" +# +# module NumberFormatting +# def format_price(price) +# ActiveSupport::NumberHelper.number_to_currency(price) +# end +# end +# +# source://activesupport//lib/active_support/number_helper.rb#26 +module ActiveSupport::NumberHelper + extend ::ActiveSupport::Autoload + extend ::ActiveSupport::NumberHelper + + # Formats a +number+ into a currency string. + # + # number_to_currency(1234567890.50) # => "$1,234,567,890.50" + # number_to_currency(1234567890.506) # => "$1,234,567,890.51" + # number_to_currency("12x34") # => "$12x34" + # + # number_to_currency(1234567890.50, unit: "£", separator: ",", delimiter: "") + # # => "£1234567890,50" + # + # The currency unit and number formatting of the current locale will be used + # unless otherwise specified via options. No currency conversion is + # performed. If the user is given a way to change their locale, they will + # also be able to change the relative value of the currency displayed with + # this helper. If your application will ever support multiple locales, you + # may want to specify a constant +:locale+ option or consider using a + # library capable of currency conversion. + # + # ==== Options + # + # [+:locale+] + # The locale to use for formatting. Defaults to the current locale. + # + # number_to_currency(1234567890.506, locale: :fr) + # # => "1 234 567 890,51 €" + # + # [+:precision+] + # The level of precision. Defaults to 2. + # + # number_to_currency(1234567890.123, precision: 3) # => "$1,234,567,890.123" + # number_to_currency(0.456789, precision: 0) # => "$0" + # + # [+:round_mode+] + # Specifies how rounding is performed. See +BigDecimal.mode+. Defaults to + # +:default+. + # + # number_to_currency(1234567890.01, precision: 0, round_mode: :up) + # # => "$1,234,567,891" + # + # [+:unit+] + # The denomination of the currency. Defaults to "$". + # + # [+:separator+] + # The decimal separator. Defaults to ".". + # + # [+:delimiter+] + # The thousands delimiter. Defaults to ",". + # + # [+:format+] + # The format for non-negative numbers. %u represents the currency, + # and %n represents the number. Defaults to "%u%n". + # + # number_to_currency(1234567890.50, format: "%n %u") + # # => "1,234,567,890.50 $" + # + # [+:negative_format+] + # The format for negative numbers. %u and %n behave the + # same as in +:format+, but %n represents the absolute value of + # the number. Defaults to the value of +:format+ prepended with -. + # + # number_to_currency(-1234567890.50, negative_format: "(%u%n)") + # # => "($1,234,567,890.50)" + # + # [+:strip_insignificant_zeros+] + # Whether to remove insignificant zeros after the decimal separator. + # Defaults to false. + # + # number_to_currency(1234567890.50, strip_insignificant_zeros: true) + # # => "$1,234,567,890.5" + # + # source://activesupport//lib/active_support/number_helper.rb#161 + def number_to_currency(number, options = T.unsafe(nil)); end + + # Formats +number+ by grouping thousands with a delimiter. + # + # number_to_delimited(12345678) # => "12,345,678" + # number_to_delimited("123456") # => "123,456" + # number_to_delimited(12345678.9876) # => "12,345,678.9876" + # number_to_delimited("12x34") # => "12x34" + # + # number_to_delimited(12345678.9876, delimiter: ".", separator: ",") + # # => "12.345.678,9876" + # + # ==== Options + # + # [+:locale+] + # The locale to use for formatting. Defaults to the current locale. + # + # number_to_delimited(12345678.05, locale: :fr) + # # => "12 345 678,05" + # + # [+:delimiter+] + # The thousands delimiter. Defaults to ",". + # + # number_to_delimited(12345678, delimiter: ".") + # # => "12.345.678" + # + # [+:separator+] + # The decimal separator. Defaults to ".". + # + # number_to_delimited(12345678.05, separator: " ") + # # => "12,345,678 05" + # + # [+:delimiter_pattern+] + # A regexp to determine the placement of delimiters. Helpful when using + # currency formats like INR. + # + # number_to_delimited("123456.78", delimiter_pattern: /(\d+?)(?=(\d\d)+(\d)(?!\d))/) + # # => "1,23,456.78" + # + # source://activesupport//lib/active_support/number_helper.rb#264 + def number_to_delimited(number, options = T.unsafe(nil)); end + + # Formats +number+ into a more human-friendly representation. Useful for + # numbers that can become very large and too hard to read. + # + # number_to_human(123) # => "123" + # number_to_human(1234) # => "1.23 Thousand" + # number_to_human(12345) # => "12.3 Thousand" + # number_to_human(1234567) # => "1.23 Million" + # number_to_human(1234567890) # => "1.23 Billion" + # number_to_human(1234567890123) # => "1.23 Trillion" + # number_to_human(1234567890123456) # => "1.23 Quadrillion" + # number_to_human(1234567890123456789) # => "1230 Quadrillion" + # + # See #number_to_human_size if you want to pretty-print a file size. + # + # ==== Options + # + # [+:locale+] + # The locale to use for formatting. Defaults to the current locale. + # + # [+:precision+] + # The level of precision. Defaults to 3. + # + # number_to_human(123456, precision: 2) # => "120 Thousand" + # number_to_human(123456, precision: 4) # => "123.5 Thousand" + # + # [+:round_mode+] + # Specifies how rounding is performed. See +BigDecimal.mode+. Defaults to + # +:default+. + # + # number_to_human(123456, precision: 2, round_mode: :up) + # # => "130 Thousand" + # + # [+:significant+] + # Whether +:precision+ should be applied to significant digits instead of + # fractional digits. Defaults to true. + # + # [+:separator+] + # The decimal separator. Defaults to ".". + # + # number_to_human(123456, precision: 4, separator: ",") + # # => "123,5 Thousand" + # + # [+:delimiter+] + # The thousands delimiter. Defaults to ",". + # + # [+:strip_insignificant_zeros+] + # Whether to remove insignificant zeros after the decimal separator. + # Defaults to true. + # + # number_to_human(1000000) # => "1 Million" + # number_to_human(1000000, strip_insignificant_zeros: false) # => "1.00 Million" + # number_to_human(10.01) # => "10" + # number_to_human(10.01, strip_insignificant_zeros: false) # => "10.0" + # + # [+:format+] + # The format of the output. %n represents the number, and + # %u represents the quantifier (e.g., "Thousand"). Defaults to + # "%n %u". + # + # [+:units+] + # A Hash of custom unit quantifier names. + # + # number_to_human(1, units: { unit: "m", thousand: "km" }) # => "1 m" + # number_to_human(100, units: { unit: "m", thousand: "km" }) # => "100 m" + # number_to_human(1000, units: { unit: "m", thousand: "km" }) # => "1 km" + # number_to_human(100000, units: { unit: "m", thousand: "km" }) # => "100 km" + # number_to_human(10000000, units: { unit: "m", thousand: "km" }) # => "10000 km" + # + # The following keys are supported for integer units: +:unit+, +:ten+, + # +:hundred+, +:thousand+, +:million+, +:billion+, +:trillion+, + # +:quadrillion+. Additionally, the following keys are supported for + # fractional units: +:deci+, +:centi+, +:mili+, +:micro+, +:nano+, + # +:pico+, +:femto+. + # + # The Hash can also be defined as a scope in an I18n locale. For example: + # + # en: + # distance: + # centi: + # one: "centimeter" + # other: "centimeters" + # unit: + # one: "meter" + # other: "meters" + # thousand: + # one: "kilometer" + # other: "kilometers" + # + # Then it can be specified by name: + # + # number_to_human(1, units: :distance) # => "1 meter" + # number_to_human(100, units: :distance) # => "100 meters" + # number_to_human(1000, units: :distance) # => "1 kilometer" + # number_to_human(100000, units: :distance) # => "100 kilometers" + # number_to_human(10000000, units: :distance) # => "10000 kilometers" + # number_to_human(0.1, units: :distance) # => "10 centimeters" + # number_to_human(0.01, units: :distance) # => "1 centimeter" + # + # source://activesupport//lib/active_support/number_helper.rb#475 + def number_to_human(number, options = T.unsafe(nil)); end + + # Formats +number+ as bytes into a more human-friendly representation. + # Useful for reporting file sizes to users. + # + # number_to_human_size(123) # => "123 Bytes" + # number_to_human_size(1234) # => "1.21 KB" + # number_to_human_size(12345) # => "12.1 KB" + # number_to_human_size(1234567) # => "1.18 MB" + # number_to_human_size(1234567890) # => "1.15 GB" + # number_to_human_size(1234567890123) # => "1.12 TB" + # number_to_human_size(1234567890123456) # => "1.1 PB" + # number_to_human_size(1234567890123456789) # => "1.07 EB" + # + # See #number_to_human if you want to pretty-print a generic number. + # + # ==== Options + # + # [+:locale+] + # The locale to use for formatting. Defaults to the current locale. + # + # [+:precision+] + # The level of precision. Defaults to 3. + # + # number_to_human_size(123456, precision: 2) # => "120 KB" + # number_to_human_size(1234567, precision: 2) # => "1.2 MB" + # + # [+:round_mode+] + # Specifies how rounding is performed. See +BigDecimal.mode+. Defaults to + # +:default+. + # + # number_to_human_size(123456, precision: 2, round_mode: :up) + # # => "130 KB" + # + # [+:significant+] + # Whether +:precision+ should be applied to significant digits instead of + # fractional digits. Defaults to true. + # + # [+:separator+] + # The decimal separator. Defaults to ".". + # + # number_to_human_size(1234567, separator: ",") + # # => "1,18 MB" + # + # [+:delimiter+] + # The thousands delimiter. Defaults to ",". + # + # [+:strip_insignificant_zeros+] + # Whether to remove insignificant zeros after the decimal separator. + # Defaults to true. + # + # source://activesupport//lib/active_support/number_helper.rb#373 + def number_to_human_size(number, options = T.unsafe(nil)); end + + # Formats +number+ as a percentage string. + # + # number_to_percentage(100) # => "100.000%" + # number_to_percentage("99") # => "99.000%" + # number_to_percentage("99x") # => "99x%" + # + # number_to_percentage(12345.6789, delimiter: ".", separator: ",", precision: 2) + # # => "12.345,68%" + # + # ==== Options + # + # [+:locale+] + # The locale to use for formatting. Defaults to the current locale. + # + # number_to_percentage(1000, locale: :fr) + # # => "1000,000%" + # + # [+:precision+] + # The level of precision, or +nil+ to preserve +number+'s precision. + # Defaults to 2. + # + # number_to_percentage(12.3456789, precision: 4) # => "12.3457%" + # number_to_percentage(99.999, precision: 0) # => "100%" + # number_to_percentage(99.999, precision: nil) # => "99.999%" + # + # [+:round_mode+] + # Specifies how rounding is performed. See +BigDecimal.mode+. Defaults to + # +:default+. + # + # number_to_percentage(12.3456789, precision: 4, round_mode: :down) + # # => "12.3456%" + # + # [+:significant+] + # Whether +:precision+ should be applied to significant digits instead of + # fractional digits. Defaults to false. + # + # number_to_percentage(12345.6789) # => "12345.679%" + # number_to_percentage(12345.6789, significant: true) # => "12300%" + # number_to_percentage(12345.6789, precision: 2) # => "12345.68%" + # number_to_percentage(12345.6789, precision: 2, significant: true) # => "12000%" + # + # [+:separator+] + # The decimal separator. Defaults to ".". + # + # [+:delimiter+] + # The thousands delimiter. Defaults to ",". + # + # [+:strip_insignificant_zeros+] + # Whether to remove insignificant zeros after the decimal separator. + # Defaults to false. + # + # [+:format+] + # The format of the output. %n represents the number. Defaults to + # "%n%". + # + # number_to_percentage(100, format: "%n %") + # # => "100.000 %" + # + # source://activesupport//lib/active_support/number_helper.rb#223 + def number_to_percentage(number, options = T.unsafe(nil)); end + + # Formats +number+ into a phone number. + # + # number_to_phone(5551234) # => "555-1234" + # number_to_phone("5551234") # => "555-1234" + # number_to_phone(1235551234) # => "123-555-1234" + # number_to_phone("12x34") # => "12x34" + # + # number_to_phone(1235551234, delimiter: ".", country_code: 1, extension: 1343) + # # => "+1.123.555.1234 x 1343" + # + # ==== Options + # + # [+:area_code+] + # Whether to use parentheses for the area code. Defaults to false. + # + # number_to_phone(1235551234, area_code: true) + # # => "(123) 555-1234" + # + # [+:delimiter+] + # The digit group delimiter to use. Defaults to "-". + # + # number_to_phone(1235551234, delimiter: " ") + # # => "123 555 1234" + # + # [+:country_code+] + # A country code to prepend. + # + # number_to_phone(1235551234, country_code: 1) + # # => "+1-123-555-1234" + # + # [+:extension+] + # An extension to append. + # + # number_to_phone(1235551234, extension: 555) + # # => "123-555-1234 x 555" + # + # [+:pattern+] + # A regexp that specifies how the digits should be grouped. The first + # three captures from the regexp are treated as digit groups. + # + # number_to_phone(13312345678, pattern: /(\d{3})(\d{4})(\d{4})$/) + # # => "133-1234-5678" + # number_to_phone(75561234567, pattern: /(\d{1,4})(\d{4})(\d{4})$/, area_code: true) + # # => "(755) 6123-4567" + # + # source://activesupport//lib/active_support/number_helper.rb#88 + def number_to_phone(number, options = T.unsafe(nil)); end + + # Formats +number+ to a specific level of precision. + # + # number_to_rounded(12345.6789) # => "12345.679" + # number_to_rounded(12345.6789, precision: 2) # => "12345.68" + # number_to_rounded(12345.6789, precision: 0) # => "12345" + # number_to_rounded(12345, precision: 5) # => "12345.00000" + # + # ==== Options + # + # [+:locale+] + # The locale to use for formatting. Defaults to the current locale. + # + # number_to_rounded(111.234, locale: :fr) + # # => "111,234" + # + # [+:precision+] + # The level of precision, or +nil+ to preserve +number+'s precision. + # Defaults to 3. + # + # number_to_rounded(12345.6789, precision: nil) + # # => "12345.6789" + # + # [+:round_mode+] + # Specifies how rounding is performed. See +BigDecimal.mode+. Defaults to + # +:default+. + # + # number_to_rounded(12.34, precision: 0, round_mode: :up) + # # => "13" + # + # [+:significant+] + # Whether +:precision+ should be applied to significant digits instead of + # fractional digits. Defaults to false. + # + # number_to_rounded(12345.6789) # => "12345.679" + # number_to_rounded(12345.6789, significant: true) # => "12300" + # number_to_rounded(12345.6789, precision: 2) # => "12345.68" + # number_to_rounded(12345.6789, precision: 2, significant: true) # => "12000" + # + # [+:separator+] + # The decimal separator. Defaults to ".". + # + # [+:delimiter+] + # The thousands delimiter. Defaults to ",". + # + # [+:strip_insignificant_zeros+] + # Whether to remove insignificant zeros after the decimal separator. + # Defaults to false. + # + # number_to_rounded(12.34, strip_insignificant_zeros: false) # => "12.340" + # number_to_rounded(12.34, strip_insignificant_zeros: true) # => "12.34" + # number_to_rounded(12.3456, strip_insignificant_zeros: true) # => "12.346" + # + # source://activesupport//lib/active_support/number_helper.rb#320 + def number_to_rounded(number, options = T.unsafe(nil)); end +end + +# source://activesupport//lib/active_support/number_helper/number_converter.rb#12 +class ActiveSupport::NumberHelper::NumberConverter + # @return [NumberConverter] a new instance of NumberConverter + # + # source://activesupport//lib/active_support/number_helper/number_converter.rb#124 + def initialize(number, options); end + + # source://activesupport//lib/active_support/number_helper/number_converter.rb#130 + def execute; end + + # source://activesupport//lib/active_support/number_helper/number_converter.rb#14 + def namespace; end + + # source://activesupport//lib/active_support/number_helper/number_converter.rb#14 + def namespace=(_arg0); end + + # source://activesupport//lib/active_support/number_helper/number_converter.rb#14 + def namespace?; end + + # Returns the value of attribute number. + # + # source://activesupport//lib/active_support/number_helper/number_converter.rb#19 + def number; end + + # Returns the value of attribute opts. + # + # source://activesupport//lib/active_support/number_helper/number_converter.rb#19 + def opts; end + + # source://activesupport//lib/active_support/number_helper/number_converter.rb#17 + def validate_float; end + + # source://activesupport//lib/active_support/number_helper/number_converter.rb#17 + def validate_float=(_arg0); end + + # source://activesupport//lib/active_support/number_helper/number_converter.rb#17 + def validate_float?; end + + private + + # source://activesupport//lib/active_support/number_helper/number_converter.rb#149 + def default_format_options; end + + # source://activesupport//lib/active_support/number_helper/number_converter.rb#174 + def default_value(key); end + + # source://activesupport//lib/active_support/number_helper/number_converter.rb#145 + def format_options; end + + # source://activesupport//lib/active_support/number_helper/number_converter.rb#155 + def i18n_format_options; end + + # source://activesupport//lib/active_support/number_helper/number_converter.rb#141 + def options; end + + # source://activesupport//lib/active_support/number_helper/number_converter.rb#170 + def translate_in_locale(key, **i18n_options); end + + # source://activesupport//lib/active_support/number_helper/number_converter.rb#166 + def translate_number_value_with_default(key, **i18n_options); end + + # source://activesupport//lib/active_support/number_helper/number_converter.rb#178 + def valid_bigdecimal; end + + class << self + # source://activesupport//lib/active_support/number_helper/number_converter.rb#120 + def convert(number, options); end + + # source://activesupport//lib/active_support/number_helper/number_converter.rb#14 + def namespace; end + + # source://activesupport//lib/active_support/number_helper/number_converter.rb#14 + def namespace=(value); end + + # source://activesupport//lib/active_support/number_helper/number_converter.rb#14 + def namespace?; end + + # source://activesupport//lib/active_support/number_helper/number_converter.rb#17 + def validate_float; end + + # source://activesupport//lib/active_support/number_helper/number_converter.rb#17 + def validate_float=(value); end + + # source://activesupport//lib/active_support/number_helper/number_converter.rb#17 + def validate_float?; end + + private + + # source://activesupport//lib/active_support/number_helper/number_converter.rb#14 + def __class_attr_namespace; end + + # source://activesupport//lib/active_support/number_helper/number_converter.rb#14 + def __class_attr_namespace=(new_value); end + + # source://activesupport//lib/active_support/number_helper/number_converter.rb#17 + def __class_attr_validate_float; end + + # source://activesupport//lib/active_support/number_helper/number_converter.rb#17 + def __class_attr_validate_float=(new_value); end + end +end + +# source://activesupport//lib/active_support/number_helper/number_converter.rb#21 +ActiveSupport::NumberHelper::NumberConverter::DEFAULTS = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/number_helper/number_to_currency_converter.rb#7 +class ActiveSupport::NumberHelper::NumberToCurrencyConverter < ::ActiveSupport::NumberHelper::NumberConverter + # source://activesupport//lib/active_support/number_helper/number_to_currency_converter.rb#10 + def convert; end + + private + + # source://activesupport//lib/active_support/number_helper/number_to_currency_converter.rb#38 + def i18n_opts; end + + # source://activesupport//lib/active_support/number_helper/number_to_currency_converter.rb#29 + def options; end + + class << self + private + + # source://activesupport//lib/active_support/number_helper/number_to_currency_converter.rb#8 + def __class_attr_namespace; end + + # source://activesupport//lib/active_support/number_helper/number_to_currency_converter.rb#8 + def __class_attr_namespace=(new_value); end + end +end + +# source://activesupport//lib/active_support/number_helper/number_to_delimited_converter.rb#7 +class ActiveSupport::NumberHelper::NumberToDelimitedConverter < ::ActiveSupport::NumberHelper::NumberConverter + # source://activesupport//lib/active_support/number_helper/number_to_delimited_converter.rb#12 + def convert; end + + private + + # source://activesupport//lib/active_support/number_helper/number_to_delimited_converter.rb#25 + def delimiter_pattern; end + + # source://activesupport//lib/active_support/number_helper/number_to_delimited_converter.rb#17 + def parts; end + + class << self + private + + # source://activesupport//lib/active_support/number_helper/number_to_delimited_converter.rb#8 + def __class_attr_validate_float; end + + # source://activesupport//lib/active_support/number_helper/number_to_delimited_converter.rb#8 + def __class_attr_validate_float=(new_value); end + end +end + +# source://activesupport//lib/active_support/number_helper/number_to_delimited_converter.rb#10 +ActiveSupport::NumberHelper::NumberToDelimitedConverter::DEFAULT_DELIMITER_REGEX = T.let(T.unsafe(nil), Regexp) + +# source://activesupport//lib/active_support/number_helper/number_to_human_converter.rb#7 +class ActiveSupport::NumberHelper::NumberToHumanConverter < ::ActiveSupport::NumberHelper::NumberConverter + # source://activesupport//lib/active_support/number_helper/number_to_human_converter.rb#15 + def convert; end + + private + + # source://activesupport//lib/active_support/number_helper/number_to_human_converter.rb#50 + def calculate_exponent(units); end + + # source://activesupport//lib/active_support/number_helper/number_to_human_converter.rb#38 + def determine_unit(units, exponent); end + + # source://activesupport//lib/active_support/number_helper/number_to_human_converter.rb#34 + def format; end + + # source://activesupport//lib/active_support/number_helper/number_to_human_converter.rb#55 + def unit_exponents(units); end + + class << self + private + + # source://activesupport//lib/active_support/number_helper/number_to_human_converter.rb#12 + def __class_attr_namespace; end + + # source://activesupport//lib/active_support/number_helper/number_to_human_converter.rb#12 + def __class_attr_namespace=(new_value); end + + # source://activesupport//lib/active_support/number_helper/number_to_human_converter.rb#13 + def __class_attr_validate_float; end + + # source://activesupport//lib/active_support/number_helper/number_to_human_converter.rb#13 + def __class_attr_validate_float=(new_value); end + end +end + +# source://activesupport//lib/active_support/number_helper/number_to_human_converter.rb#8 +ActiveSupport::NumberHelper::NumberToHumanConverter::DECIMAL_UNITS = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/number_helper/number_to_human_converter.rb#10 +ActiveSupport::NumberHelper::NumberToHumanConverter::INVERTED_DECIMAL_UNITS = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/number_helper/number_to_human_size_converter.rb#7 +class ActiveSupport::NumberHelper::NumberToHumanSizeConverter < ::ActiveSupport::NumberHelper::NumberConverter + # source://activesupport//lib/active_support/number_helper/number_to_human_size_converter.rb#13 + def convert; end + + private + + # source://activesupport//lib/active_support/number_helper/number_to_human_size_converter.rb#55 + def base; end + + # source://activesupport//lib/active_support/number_helper/number_to_human_size_converter.rb#31 + def conversion_format; end + + # source://activesupport//lib/active_support/number_helper/number_to_human_size_converter.rb#44 + def exponent; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/number_helper/number_to_human_size_converter.rb#51 + def smaller_than_base?; end + + # source://activesupport//lib/active_support/number_helper/number_to_human_size_converter.rb#39 + def storage_unit_key; end + + # source://activesupport//lib/active_support/number_helper/number_to_human_size_converter.rb#35 + def unit; end + + class << self + private + + # source://activesupport//lib/active_support/number_helper/number_to_human_size_converter.rb#10 + def __class_attr_namespace; end + + # source://activesupport//lib/active_support/number_helper/number_to_human_size_converter.rb#10 + def __class_attr_namespace=(new_value); end + + # source://activesupport//lib/active_support/number_helper/number_to_human_size_converter.rb#11 + def __class_attr_validate_float; end + + # source://activesupport//lib/active_support/number_helper/number_to_human_size_converter.rb#11 + def __class_attr_validate_float=(new_value); end + end +end + +# source://activesupport//lib/active_support/number_helper/number_to_human_size_converter.rb#8 +ActiveSupport::NumberHelper::NumberToHumanSizeConverter::STORAGE_UNITS = T.let(T.unsafe(nil), Array) + +# source://activesupport//lib/active_support/number_helper/number_to_percentage_converter.rb#7 +class ActiveSupport::NumberHelper::NumberToPercentageConverter < ::ActiveSupport::NumberHelper::NumberConverter + # source://activesupport//lib/active_support/number_helper/number_to_percentage_converter.rb#10 + def convert; end + + class << self + private + + # source://activesupport//lib/active_support/number_helper/number_to_percentage_converter.rb#8 + def __class_attr_namespace; end + + # source://activesupport//lib/active_support/number_helper/number_to_percentage_converter.rb#8 + def __class_attr_namespace=(new_value); end + end +end + +# source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#8 +class ActiveSupport::NumberHelper::NumberToPhoneConverter < ::ActiveSupport::NumberHelper::NumberConverter + # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#9 + def convert; end + + private + + # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#16 + def convert_to_phone_number(number); end + + # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#24 + def convert_with_area_code(number); end + + # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#31 + def convert_without_area_code(number); end + + # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#47 + def country_code(code); end + + # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#43 + def delimiter; end + + # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#51 + def phone_ext(ext); end + + # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#55 + def regexp_pattern(default_pattern); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#39 + def start_with_delimiter?(number); end +end + +# source://activesupport//lib/active_support/number_helper/number_to_rounded_converter.rb#7 +class ActiveSupport::NumberHelper::NumberToRoundedConverter < ::ActiveSupport::NumberHelper::NumberConverter + # source://activesupport//lib/active_support/number_helper/number_to_rounded_converter.rb#11 + def convert; end + + private + + # source://activesupport//lib/active_support/number_helper/number_to_rounded_converter.rb#49 + def format_number(number); end + + # source://activesupport//lib/active_support/number_helper/number_to_rounded_converter.rb#45 + def strip_insignificant_zeros; end + + class << self + private + + # source://activesupport//lib/active_support/number_helper/number_to_rounded_converter.rb#8 + def __class_attr_namespace; end + + # source://activesupport//lib/active_support/number_helper/number_to_rounded_converter.rb#8 + def __class_attr_namespace=(new_value); end + + # source://activesupport//lib/active_support/number_helper/number_to_rounded_converter.rb#9 + def __class_attr_validate_float; end + + # source://activesupport//lib/active_support/number_helper/number_to_rounded_converter.rb#9 + def __class_attr_validate_float=(new_value); end + end +end + +# source://activesupport//lib/active_support/number_helper/rounding_helper.rb#5 +class ActiveSupport::NumberHelper::RoundingHelper + # @return [RoundingHelper] a new instance of RoundingHelper + # + # source://activesupport//lib/active_support/number_helper/rounding_helper.rb#8 + def initialize(options); end + + # source://activesupport//lib/active_support/number_helper/rounding_helper.rb#20 + def digit_count(number); end + + # Returns the value of attribute options. + # + # source://activesupport//lib/active_support/number_helper/rounding_helper.rb#6 + def options; end + + # source://activesupport//lib/active_support/number_helper/rounding_helper.rb#12 + def round(number); end + + private + + # source://activesupport//lib/active_support/number_helper/rounding_helper.rb#37 + def absolute_precision(number); end + + # source://activesupport//lib/active_support/number_helper/rounding_helper.rb#26 + def convert_to_decimal(number); end +end + +# source://activesupport//lib/active_support/core_ext/numeric/conversions.rb#7 +module ActiveSupport::NumericWithFormat + # \Numeric With Format + # + # Provides options for converting numbers into formatted strings. + # Options are provided for phone numbers, currency, percentage, + # precision, positional notation, file size, and pretty printing. + # + # This method is aliased to to_formatted_s. + # + # ==== Options + # + # For details on which formats use which options, see ActiveSupport::NumberHelper + # + # ==== Examples + # + # Phone Numbers: + # 5551234.to_fs(:phone) # => "555-1234" + # 1235551234.to_fs(:phone) # => "123-555-1234" + # 1235551234.to_fs(:phone, area_code: true) # => "(123) 555-1234" + # 1235551234.to_fs(:phone, delimiter: ' ') # => "123 555 1234" + # 1235551234.to_fs(:phone, area_code: true, extension: 555) # => "(123) 555-1234 x 555" + # 1235551234.to_fs(:phone, country_code: 1) # => "+1-123-555-1234" + # 1235551234.to_fs(:phone, country_code: 1, extension: 1343, delimiter: '.') + # # => "+1.123.555.1234 x 1343" + # + # Currency: + # 1234567890.50.to_fs(:currency) # => "$1,234,567,890.50" + # 1234567890.506.to_fs(:currency) # => "$1,234,567,890.51" + # 1234567890.506.to_fs(:currency, precision: 3) # => "$1,234,567,890.506" + # 1234567890.506.to_fs(:currency, round_mode: :down) # => "$1,234,567,890.50" + # 1234567890.506.to_fs(:currency, locale: :fr) # => "1 234 567 890,51 €" + # -1234567890.50.to_fs(:currency, negative_format: '(%u%n)') + # # => "($1,234,567,890.50)" + # 1234567890.50.to_fs(:currency, unit: '£', separator: ',', delimiter: '') + # # => "£1234567890,50" + # 1234567890.50.to_fs(:currency, unit: '£', separator: ',', delimiter: '', format: '%n %u') + # # => "1234567890,50 £" + # + # Percentage: + # 100.to_fs(:percentage) # => "100.000%" + # 100.to_fs(:percentage, precision: 0) # => "100%" + # 1000.to_fs(:percentage, delimiter: '.', separator: ',') # => "1.000,000%" + # 302.24398923423.to_fs(:percentage, precision: 5) # => "302.24399%" + # 302.24398923423.to_fs(:percentage, round_mode: :down) # => "302.243%" + # 1000.to_fs(:percentage, locale: :fr) # => "1 000,000%" + # 100.to_fs(:percentage, format: '%n %') # => "100.000 %" + # + # Delimited: + # 12345678.to_fs(:delimited) # => "12,345,678" + # 12345678.05.to_fs(:delimited) # => "12,345,678.05" + # 12345678.to_fs(:delimited, delimiter: '.') # => "12.345.678" + # 12345678.to_fs(:delimited, delimiter: ',') # => "12,345,678" + # 12345678.05.to_fs(:delimited, separator: ' ') # => "12,345,678 05" + # 12345678.05.to_fs(:delimited, locale: :fr) # => "12 345 678,05" + # 98765432.98.to_fs(:delimited, delimiter: ' ', separator: ',') + # # => "98 765 432,98" + # + # Rounded: + # 111.2345.to_fs(:rounded) # => "111.235" + # 111.2345.to_fs(:rounded, precision: 2) # => "111.23" + # 111.2345.to_fs(:rounded, precision: 2, round_mode: :up) # => "111.24" + # 13.to_fs(:rounded, precision: 5) # => "13.00000" + # 389.32314.to_fs(:rounded, precision: 0) # => "389" + # 111.2345.to_fs(:rounded, significant: true) # => "111" + # 111.2345.to_fs(:rounded, precision: 1, significant: true) # => "100" + # 13.to_fs(:rounded, precision: 5, significant: true) # => "13.000" + # 111.234.to_fs(:rounded, locale: :fr) # => "111,234" + # 13.to_fs(:rounded, precision: 5, significant: true, strip_insignificant_zeros: true) + # # => "13" + # 389.32314.to_fs(:rounded, precision: 4, significant: true) # => "389.3" + # 1111.2345.to_fs(:rounded, precision: 2, separator: ',', delimiter: '.') + # # => "1.111,23" + # + # Human-friendly size in Bytes: + # 123.to_fs(:human_size) # => "123 Bytes" + # 1234.to_fs(:human_size) # => "1.21 KB" + # 12345.to_fs(:human_size) # => "12.1 KB" + # 1234567.to_fs(:human_size) # => "1.18 MB" + # 1234567890.to_fs(:human_size) # => "1.15 GB" + # 1234567890123.to_fs(:human_size) # => "1.12 TB" + # 1234567890123456.to_fs(:human_size) # => "1.1 PB" + # 1234567890123456789.to_fs(:human_size) # => "1.07 EB" + # 1234567.to_fs(:human_size, precision: 2) # => "1.2 MB" + # 1234567.to_fs(:human_size, precision: 2, round_mode: :up) # => "1.3 MB" + # 483989.to_fs(:human_size, precision: 2) # => "470 KB" + # 1234567.to_fs(:human_size, precision: 2, separator: ',') # => "1,2 MB" + # 1234567890123.to_fs(:human_size, precision: 5) # => "1.1228 TB" + # 524288000.to_fs(:human_size, precision: 5) # => "500 MB" + # + # Human-friendly format: + # 123.to_fs(:human) # => "123" + # 1234.to_fs(:human) # => "1.23 Thousand" + # 12345.to_fs(:human) # => "12.3 Thousand" + # 1234567.to_fs(:human) # => "1.23 Million" + # 1234567890.to_fs(:human) # => "1.23 Billion" + # 1234567890123.to_fs(:human) # => "1.23 Trillion" + # 1234567890123456.to_fs(:human) # => "1.23 Quadrillion" + # 1234567890123456789.to_fs(:human) # => "1230 Quadrillion" + # 489939.to_fs(:human, precision: 2) # => "490 Thousand" + # 489939.to_fs(:human, precision: 2, round_mode: :down) # => "480 Thousand" + # 489939.to_fs(:human, precision: 4) # => "489.9 Thousand" + # 1234567.to_fs(:human, precision: 4, + # significant: false) # => "1.2346 Million" + # 1234567.to_fs(:human, precision: 1, + # separator: ',', + # significant: false) # => "1,2 Million" + # + # source://activesupport//lib/active_support/core_ext/numeric/conversions.rb#139 + def to_formatted_s(format = T.unsafe(nil), options = T.unsafe(nil)); end + + # \Numeric With Format + # + # Provides options for converting numbers into formatted strings. + # Options are provided for phone numbers, currency, percentage, + # precision, positional notation, file size, and pretty printing. + # + # This method is aliased to to_formatted_s. + # + # ==== Options + # + # For details on which formats use which options, see ActiveSupport::NumberHelper + # + # ==== Examples + # + # Phone Numbers: + # 5551234.to_fs(:phone) # => "555-1234" + # 1235551234.to_fs(:phone) # => "123-555-1234" + # 1235551234.to_fs(:phone, area_code: true) # => "(123) 555-1234" + # 1235551234.to_fs(:phone, delimiter: ' ') # => "123 555 1234" + # 1235551234.to_fs(:phone, area_code: true, extension: 555) # => "(123) 555-1234 x 555" + # 1235551234.to_fs(:phone, country_code: 1) # => "+1-123-555-1234" + # 1235551234.to_fs(:phone, country_code: 1, extension: 1343, delimiter: '.') + # # => "+1.123.555.1234 x 1343" + # + # Currency: + # 1234567890.50.to_fs(:currency) # => "$1,234,567,890.50" + # 1234567890.506.to_fs(:currency) # => "$1,234,567,890.51" + # 1234567890.506.to_fs(:currency, precision: 3) # => "$1,234,567,890.506" + # 1234567890.506.to_fs(:currency, round_mode: :down) # => "$1,234,567,890.50" + # 1234567890.506.to_fs(:currency, locale: :fr) # => "1 234 567 890,51 €" + # -1234567890.50.to_fs(:currency, negative_format: '(%u%n)') + # # => "($1,234,567,890.50)" + # 1234567890.50.to_fs(:currency, unit: '£', separator: ',', delimiter: '') + # # => "£1234567890,50" + # 1234567890.50.to_fs(:currency, unit: '£', separator: ',', delimiter: '', format: '%n %u') + # # => "1234567890,50 £" + # + # Percentage: + # 100.to_fs(:percentage) # => "100.000%" + # 100.to_fs(:percentage, precision: 0) # => "100%" + # 1000.to_fs(:percentage, delimiter: '.', separator: ',') # => "1.000,000%" + # 302.24398923423.to_fs(:percentage, precision: 5) # => "302.24399%" + # 302.24398923423.to_fs(:percentage, round_mode: :down) # => "302.243%" + # 1000.to_fs(:percentage, locale: :fr) # => "1 000,000%" + # 100.to_fs(:percentage, format: '%n %') # => "100.000 %" + # + # Delimited: + # 12345678.to_fs(:delimited) # => "12,345,678" + # 12345678.05.to_fs(:delimited) # => "12,345,678.05" + # 12345678.to_fs(:delimited, delimiter: '.') # => "12.345.678" + # 12345678.to_fs(:delimited, delimiter: ',') # => "12,345,678" + # 12345678.05.to_fs(:delimited, separator: ' ') # => "12,345,678 05" + # 12345678.05.to_fs(:delimited, locale: :fr) # => "12 345 678,05" + # 98765432.98.to_fs(:delimited, delimiter: ' ', separator: ',') + # # => "98 765 432,98" + # + # Rounded: + # 111.2345.to_fs(:rounded) # => "111.235" + # 111.2345.to_fs(:rounded, precision: 2) # => "111.23" + # 111.2345.to_fs(:rounded, precision: 2, round_mode: :up) # => "111.24" + # 13.to_fs(:rounded, precision: 5) # => "13.00000" + # 389.32314.to_fs(:rounded, precision: 0) # => "389" + # 111.2345.to_fs(:rounded, significant: true) # => "111" + # 111.2345.to_fs(:rounded, precision: 1, significant: true) # => "100" + # 13.to_fs(:rounded, precision: 5, significant: true) # => "13.000" + # 111.234.to_fs(:rounded, locale: :fr) # => "111,234" + # 13.to_fs(:rounded, precision: 5, significant: true, strip_insignificant_zeros: true) + # # => "13" + # 389.32314.to_fs(:rounded, precision: 4, significant: true) # => "389.3" + # 1111.2345.to_fs(:rounded, precision: 2, separator: ',', delimiter: '.') + # # => "1.111,23" + # + # Human-friendly size in Bytes: + # 123.to_fs(:human_size) # => "123 Bytes" + # 1234.to_fs(:human_size) # => "1.21 KB" + # 12345.to_fs(:human_size) # => "12.1 KB" + # 1234567.to_fs(:human_size) # => "1.18 MB" + # 1234567890.to_fs(:human_size) # => "1.15 GB" + # 1234567890123.to_fs(:human_size) # => "1.12 TB" + # 1234567890123456.to_fs(:human_size) # => "1.1 PB" + # 1234567890123456789.to_fs(:human_size) # => "1.07 EB" + # 1234567.to_fs(:human_size, precision: 2) # => "1.2 MB" + # 1234567.to_fs(:human_size, precision: 2, round_mode: :up) # => "1.3 MB" + # 483989.to_fs(:human_size, precision: 2) # => "470 KB" + # 1234567.to_fs(:human_size, precision: 2, separator: ',') # => "1,2 MB" + # 1234567890123.to_fs(:human_size, precision: 5) # => "1.1228 TB" + # 524288000.to_fs(:human_size, precision: 5) # => "500 MB" + # + # Human-friendly format: + # 123.to_fs(:human) # => "123" + # 1234.to_fs(:human) # => "1.23 Thousand" + # 12345.to_fs(:human) # => "12.3 Thousand" + # 1234567.to_fs(:human) # => "1.23 Million" + # 1234567890.to_fs(:human) # => "1.23 Billion" + # 1234567890123.to_fs(:human) # => "1.23 Trillion" + # 1234567890123456.to_fs(:human) # => "1.23 Quadrillion" + # 1234567890123456789.to_fs(:human) # => "1230 Quadrillion" + # 489939.to_fs(:human, precision: 2) # => "490 Thousand" + # 489939.to_fs(:human, precision: 2, round_mode: :down) # => "480 Thousand" + # 489939.to_fs(:human, precision: 4) # => "489.9 Thousand" + # 1234567.to_fs(:human, precision: 4, + # significant: false) # => "1.2346 Million" + # 1234567.to_fs(:human, precision: 1, + # separator: ',', + # significant: false) # => "1,2 Million" + # + # source://activesupport//lib/active_support/core_ext/numeric/conversions.rb#113 + def to_fs(format = T.unsafe(nil), options = T.unsafe(nil)); end +end + +# source://activesupport//lib/active_support/option_merger.rb#6 +class ActiveSupport::OptionMerger + # @return [OptionMerger] a new instance of OptionMerger + # + # source://activesupport//lib/active_support/option_merger.rb#11 + def initialize(context, options); end + + private + + # source://activesupport//lib/active_support/option_merger.rb#16 + def method_missing(method, *arguments, &block); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/option_merger.rb#34 + def respond_to_missing?(*_arg0, **_arg1, &_arg2); end +end + +# DEPRECATED: +ActiveSupport::OrderedHash+ implements a hash that preserves +# insertion order. +# +# oh = ActiveSupport::OrderedHash.new +# oh[:a] = 1 +# oh[:b] = 2 +# oh.keys # => [:a, :b], this order is guaranteed +# +# Also, maps the +omap+ feature for YAML files +# (See https://yaml.org/type/omap.html) to support ordered items +# when loading from YAML. +# +# +ActiveSupport::OrderedHash+ is namespaced to prevent conflicts +# with other implementations. +# +# source://activesupport//lib/active_support/ordered_hash.rb#24 +class ActiveSupport::OrderedHash < ::Hash + # source://activesupport//lib/active_support/ordered_hash.rb#29 + def encode_with(coder); end + + # Returns true to make sure that this hash is extractable via Array#extract_options! + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/ordered_hash.rb#46 + def extractable_options?; end + + # source://activesupport//lib/active_support/ordered_hash.rb#41 + def nested_under_indifferent_access; end + + # source://activesupport//lib/active_support/ordered_hash.rb#37 + def reject(*args, &block); end + + # source://activesupport//lib/active_support/ordered_hash.rb#33 + def select(*args, &block); end + + # source://activesupport//lib/active_support/ordered_hash.rb#25 + def to_yaml_type; end +end + +# = Ordered Options +# +# +OrderedOptions+ inherits from +Hash+ and provides dynamic accessor methods. +# +# With a +Hash+, key-value pairs are typically managed like this: +# +# h = {} +# h[:boy] = 'John' +# h[:girl] = 'Mary' +# h[:boy] # => 'John' +# h[:girl] # => 'Mary' +# h[:dog] # => nil +# +# Using +OrderedOptions+, the above code can be written as: +# +# h = ActiveSupport::OrderedOptions.new +# h.boy = 'John' +# h.girl = 'Mary' +# h.boy # => 'John' +# h.girl # => 'Mary' +# h.dog # => nil +# +# To raise an exception when the value is blank, append a +# bang to the key name, like: +# +# h.dog! # => raises KeyError: :dog is blank +# +# source://activesupport//lib/active_support/ordered_options.rb#33 +class ActiveSupport::OrderedOptions < ::Hash + # source://activesupport//lib/active_support/ordered_options.rb#41 + def [](key); end + + # source://activesupport//lib/active_support/ordered_options.rb#37 + def []=(key, value); end + + # source://activesupport//lib/active_support/ordered_options.rb#45 + def dig(key, *identifiers); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/ordered_options.rb#64 + def extractable_options?; end + + # source://activesupport//lib/active_support/ordered_options.rb#68 + def inspect; end + + # source://activesupport//lib/active_support/ordered_options.rb#49 + def method_missing(method, *args); end + + protected + + # preserve the original #[] method + # + # source://activesupport//lib/active_support/ordered_options.rb#34 + def _get(_arg0); end + + private + + # @return [Boolean] + # + # source://activesupport//lib/active_support/ordered_options.rb#60 + def respond_to_missing?(name, include_private); end +end + +# = Active Support Parameter Filter +# +# +ParameterFilter+ replaces values in a Hash-like object if their +# keys match one of the specified filters. +# +# Matching based on nested keys is possible by using dot notation, e.g. +# "credit_card.number". +# +# If a proc is given as a filter, each key and value of the Hash-like +# and of any nested Hashes will be passed to it. The value or key can +# then be mutated as desired using methods such as String#replace. +# +# # Replaces values with "[FILTERED]" for keys that match /password/i. +# ActiveSupport::ParameterFilter.new([:password]) +# +# # Replaces values with "[FILTERED]" for keys that match /foo|bar/i. +# ActiveSupport::ParameterFilter.new([:foo, "bar"]) +# +# # Replaces values for the exact key "pin" and for keys that begin with +# # "pin_". Does not match keys that otherwise include "pin" as a +# # substring, such as "shipping_id". +# ActiveSupport::ParameterFilter.new([/\Apin\z/, /\Apin_/]) +# +# # Replaces the value for :code in `{ credit_card: { code: "xxxx" } }`. +# # Does not change `{ file: { code: "xxxx" } }`. +# ActiveSupport::ParameterFilter.new(["credit_card.code"]) +# +# # Reverses values for keys that match /secret/i. +# ActiveSupport::ParameterFilter.new([-> (k, v) do +# v.reverse! if /secret/i.match?(k) +# end]) +# +# source://activesupport//lib/active_support/parameter_filter.rb#39 +class ActiveSupport::ParameterFilter + # Create instance with given filters. Supported type of filters are +String+, +Regexp+, and +Proc+. + # Other types of filters are treated as +String+ using +to_s+. + # For +Proc+ filters, key, value, and optional original hash is passed to block arguments. + # + # ==== Options + # + # * :mask - A replaced object when filtered. Defaults to "[FILTERED]". + # + # @return [ParameterFilter] a new instance of ParameterFilter + # + # source://activesupport//lib/active_support/parameter_filter.rb#77 + def initialize(filters = T.unsafe(nil), mask: T.unsafe(nil)); end + + # Mask value of +params+ if key matches one of filters. + # + # source://activesupport//lib/active_support/parameter_filter.rb#83 + def filter(params); end + + # Returns filtered value for given key. For +Proc+ filters, third block argument is not populated. + # + # source://activesupport//lib/active_support/parameter_filter.rb#88 + def filter_param(key, value); end + + private + + # source://activesupport//lib/active_support/parameter_filter.rb#125 + def call(params, full_parent_key = T.unsafe(nil), original_params = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/parameter_filter.rb#93 + def compile_filters!(filters); end + + # source://activesupport//lib/active_support/parameter_filter.rb#135 + def value_for_key(key, value, full_parent_key = T.unsafe(nil), original_params = T.unsafe(nil)); end + + class << self + # Precompiles an array of filters that otherwise would be passed directly to + # #initialize. Depending on the quantity and types of filters, + # precompilation can improve filtering performance, especially in the case + # where the ParameterFilter instance itself cannot be retained (but the + # precompiled filters can be retained). + # + # filters = [/foo/, :bar, "nested.baz", /nested\.qux/] + # + # precompiled = ActiveSupport::ParameterFilter.precompile_filters(filters) + # # => [/(?-mix:foo)|(?i:bar)/, /(?i:nested\.baz)|(?-mix:nested\.qux)/] + # + # ActiveSupport::ParameterFilter.new(precompiled) + # + # source://activesupport//lib/active_support/parameter_filter.rb#55 + def precompile_filters(filters); end + end +end + +# source://activesupport//lib/active_support/parameter_filter.rb#40 +ActiveSupport::ParameterFilter::FILTERED = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/railtie.rb#7 +class ActiveSupport::Railtie < ::Rails::Railtie; end + +# = \Range With Format +# +# source://activesupport//lib/active_support/core_ext/range/conversions.rb#5 +module ActiveSupport::RangeWithFormat + # Convert range to a formatted string. See RANGE_FORMATS for predefined formats. + # + # This method is aliased to to_formatted_s. + # + # range = (1..100) # => 1..100 + # + # range.to_s # => "1..100" + # range.to_fs(:db) # => "BETWEEN '1' AND '100'" + # + # range = (1..) # => 1.. + # range.to_fs(:db) # => ">= '1'" + # + # range = (..100) # => ..100 + # range.to_fs(:db) # => "<= '100'" + # + # == Adding your own range formats to to_fs + # You can add your own formats to the Range::RANGE_FORMATS hash. + # Use the format name as the hash key and a Proc instance. + # + # # config/initializers/range_formats.rb + # Range::RANGE_FORMATS[:short] = ->(start, stop) { "Between #{start.to_fs(:db)} and #{stop.to_fs(:db)}" } + # + # source://activesupport//lib/active_support/core_ext/range/conversions.rb#58 + def to_formatted_s(format = T.unsafe(nil)); end + + # Convert range to a formatted string. See RANGE_FORMATS for predefined formats. + # + # This method is aliased to to_formatted_s. + # + # range = (1..100) # => 1..100 + # + # range.to_s # => "1..100" + # range.to_fs(:db) # => "BETWEEN '1' AND '100'" + # + # range = (1..) # => 1.. + # range.to_fs(:db) # => ">= '1'" + # + # range = (..100) # => ..100 + # range.to_fs(:db) # => "<= '100'" + # + # == Adding your own range formats to to_fs + # You can add your own formats to the Range::RANGE_FORMATS hash. + # Use the format name as the hash key and a Proc instance. + # + # # config/initializers/range_formats.rb + # Range::RANGE_FORMATS[:short] = ->(start, stop) { "Between #{start.to_fs(:db)} and #{stop.to_fs(:db)}" } + # + # source://activesupport//lib/active_support/core_ext/range/conversions.rb#51 + def to_fs(format = T.unsafe(nil)); end +end + +# source://activesupport//lib/active_support/core_ext/range/conversions.rb#6 +ActiveSupport::RangeWithFormat::RANGE_FORMATS = T.let(T.unsafe(nil), Hash) + +# = Active Support \Reloader +# +# This class defines several callbacks: +# +# to_prepare -- Run once at application startup, and also from +# +to_run+. +# +# to_run -- Run before a work run that is reloading. If +# +reload_classes_only_on_change+ is true (the default), the class +# unload will have already occurred. +# +# to_complete -- Run after a work run that has reloaded. If +# +reload_classes_only_on_change+ is false, the class unload will +# have occurred after the work run, but before this callback. +# +# before_class_unload -- Run immediately before the classes are +# unloaded. +# +# after_class_unload -- Run immediately after the classes are +# unloaded. +# +# source://activesupport//lib/active_support/reloader.rb#28 +class ActiveSupport::Reloader < ::ActiveSupport::ExecutionWrapper + # @return [Reloader] a new instance of Reloader + # + # source://activesupport//lib/active_support/reloader.rb#99 + def initialize; end + + # source://activesupport//lib/active_support/reloader.rb#31 + def _class_unload_callbacks; end + + # source://activesupport//lib/active_support/reloader.rb#29 + def _prepare_callbacks; end + + # source://activesupport//lib/active_support/reloader.rb#31 + def _run_class_unload_callbacks; end + + # source://activesupport//lib/active_support/reloader.rb#31 + def _run_class_unload_callbacks!(&block); end + + # source://activesupport//lib/active_support/reloader.rb#29 + def _run_prepare_callbacks; end + + # source://activesupport//lib/active_support/reloader.rb#29 + def _run_prepare_callbacks!(&block); end + + # source://activesupport//lib/active_support/reloader.rb#48 + def _run_run_callbacks(&block); end + + # source://activesupport//lib/active_support/reloader.rb#85 + def check; end + + # source://activesupport//lib/active_support/reloader.rb#85 + def check=(_arg0); end + + # source://activesupport//lib/active_support/reloader.rb#85 + def check?; end + + # source://activesupport//lib/active_support/reloader.rb#126 + def class_unload!(&block); end + + # source://activesupport//lib/active_support/reloader.rb#131 + def complete!; end + + # source://activesupport//lib/active_support/reloader.rb#84 + def executor; end + + # source://activesupport//lib/active_support/reloader.rb#84 + def executor=(_arg0); end + + # source://activesupport//lib/active_support/reloader.rb#84 + def executor?; end + + # Release the unload lock if it has been previously obtained + # + # source://activesupport//lib/active_support/reloader.rb#114 + def release_unload_lock!; end + + # Acquire the ActiveSupport::Dependencies::Interlock unload lock, + # ensuring it will be released automatically + # + # source://activesupport//lib/active_support/reloader.rb#106 + def require_unload_lock!; end + + # source://activesupport//lib/active_support/reloader.rb#121 + def run!; end + + class << self + # source://activesupport//lib/active_support/reloader.rb#31 + def _class_unload_callbacks; end + + # source://activesupport//lib/active_support/reloader.rb#31 + def _class_unload_callbacks=(value); end + + # source://activesupport//lib/active_support/reloader.rb#29 + def _prepare_callbacks; end + + # source://activesupport//lib/active_support/reloader.rb#29 + def _prepare_callbacks=(value); end + + # Registers a callback that will run immediately after the classes are unloaded. + # + # source://activesupport//lib/active_support/reloader.rb#44 + def after_class_unload(*args, &block); end + + # Registers a callback that will run immediately before the classes are unloaded. + # + # source://activesupport//lib/active_support/reloader.rb#39 + def before_class_unload(*args, &block); end + + # source://activesupport//lib/active_support/reloader.rb#85 + def check; end + + # source://activesupport//lib/active_support/reloader.rb#87 + def check!; end + + # source://activesupport//lib/active_support/reloader.rb#85 + def check=(value); end + + # source://activesupport//lib/active_support/reloader.rb#85 + def check?; end + + # source://activesupport//lib/active_support/reloader.rb#84 + def executor; end + + # source://activesupport//lib/active_support/reloader.rb#84 + def executor=(value); end + + # source://activesupport//lib/active_support/reloader.rb#84 + def executor?; end + + # source://activesupport//lib/active_support/reloader.rb#95 + def prepare!; end + + # Initiate a manual reload + # + # source://activesupport//lib/active_support/reloader.rb#51 + def reload!; end + + # source://activesupport//lib/active_support/reloader.rb#91 + def reloaded!; end + + # source://activesupport//lib/active_support/reloader.rb#62 + def run!(reset: T.unsafe(nil)); end + + # Registers a callback that will run once at application startup and every time the code is reloaded. + # + # source://activesupport//lib/active_support/reloader.rb#34 + def to_prepare(*args, &block); end + + # Run the supplied block as a work unit, reloading code as needed + # + # source://activesupport//lib/active_support/reloader.rb#71 + def wrap(**kwargs); end + + private + + # source://activesupport//lib/active_support/reloader.rb#29 + def __class_attr___callbacks; end + + # source://activesupport//lib/active_support/reloader.rb#29 + def __class_attr___callbacks=(new_value); end + + # source://activesupport//lib/active_support/reloader.rb#85 + def __class_attr_check; end + + # source://activesupport//lib/active_support/reloader.rb#85 + def __class_attr_check=(new_value); end + + # source://activesupport//lib/active_support/reloader.rb#84 + def __class_attr_executor; end + + # source://activesupport//lib/active_support/reloader.rb#84 + def __class_attr_executor=(new_value); end + end +end + +# = Active Support \Rescuable +# +# Rescuable module adds support for easier exception handling. +# +# source://activesupport//lib/active_support/rescuable.rb#11 +module ActiveSupport::Rescuable + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveSupport::Rescuable::ClassMethods + + # Internal handler lookup. Delegates to class method. Some libraries call + # this directly, so keeping it around for compatibility. + # + # source://activesupport//lib/active_support/rescuable.rb#172 + def handler_for_rescue(exception); end + + # Delegates to the class method, but uses the instance as the subject for + # rescue_from handlers (method calls, +instance_exec+ blocks). + # + # source://activesupport//lib/active_support/rescuable.rb#166 + def rescue_with_handler(exception); end + + module GeneratedClassMethods + def rescue_handlers; end + def rescue_handlers=(value); end + def rescue_handlers?; end + end + + module GeneratedInstanceMethods + def rescue_handlers; end + def rescue_handlers=(value); end + def rescue_handlers?; end + end +end + +# source://activesupport//lib/active_support/rescuable.rb#18 +module ActiveSupport::Rescuable::ClassMethods + # source://activesupport//lib/active_support/rescuable.rb#105 + def handler_for_rescue(exception, object: T.unsafe(nil)); end + + # Registers exception classes with a handler to be called by rescue_with_handler. + # + # rescue_from receives a series of exception classes or class + # names, and an exception handler specified by a trailing :with + # option containing the name of a method or a Proc object. Alternatively, a block + # can be given as the handler. + # + # Handlers that take one argument will be called with the exception, so + # that the exception can be inspected when dealing with it. + # + # Handlers are inherited. They are searched from right to left, from + # bottom to top, and up the hierarchy. The handler of the first class for + # which exception.is_a?(klass) holds true is the one invoked, if + # any. + # + # class ApplicationController < ActionController::Base + # rescue_from User::NotAuthorized, with: :deny_access + # rescue_from ActiveRecord::RecordInvalid, with: :show_record_errors + # + # rescue_from "MyApp::BaseError" do |exception| + # redirect_to root_url, alert: exception.message + # end + # + # private + # def deny_access + # head :forbidden + # end + # + # def show_record_errors(exception) + # redirect_back_or_to root_url, alert: exception.record.errors.full_messages.to_sentence + # end + # end + # + # Exceptions raised inside exception handlers are not propagated up. + # + # source://activesupport//lib/active_support/rescuable.rb#53 + def rescue_from(*klasses, with: T.unsafe(nil), &block); end + + # Matches an exception to a handler based on the exception class. + # + # If no handler matches the exception, check for a handler matching the + # (optional) +exception.cause+. If no handler matches the exception or its + # cause, this returns +nil+, so you can deal with unhandled exceptions. + # Be sure to re-raise unhandled exceptions if this is what you expect. + # + # begin + # # ... + # rescue => exception + # rescue_with_handler(exception) || raise + # end + # + # Returns the exception if it was handled and +nil+ if it was not. + # + # source://activesupport//lib/active_support/rescuable.rb#90 + def rescue_with_handler(exception, object: T.unsafe(nil), visited_exceptions: T.unsafe(nil)); end + + private + + # source://activesupport//lib/active_support/rescuable.rb#139 + def constantize_rescue_handler_class(class_or_name); end + + # source://activesupport//lib/active_support/rescuable.rb#124 + def find_rescue_handler(exception); end +end + +# source://activesupport//lib/active_support/core_ext/string/output_safety.rb#19 +class ActiveSupport::SafeBuffer < ::String + # @return [SafeBuffer] a new instance of SafeBuffer + # + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#70 + def initialize(_str = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#124 + def %(args); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#115 + def *(_); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#111 + def +(other); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#85 + def <<(value); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#38 + def [](*args); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#103 + def []=(arg1, arg2, arg3 = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#143 + def as_json(*_arg0); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#87 + def bytesplice(*args, value); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def capitalize(*args, &block); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def capitalize!(*args); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def chomp(*args, &block); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def chomp!(*args); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def chop(*args, &block); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def chop!(*args); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#59 + def chr; end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#79 + def concat(value); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def delete(*args, &block); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def delete!(*args); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def delete_prefix(*args, &block); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def delete_prefix!(*args); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def delete_suffix(*args, &block); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def delete_suffix!(*args); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def downcase(*args, &block); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def downcase!(*args); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#151 + def encode_with(coder); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#171 + def gsub(*args, &block); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#171 + def gsub!(*args, &block); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#135 + def html_safe?; end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#91 + def insert(index, value); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def lstrip(*args, &block); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def lstrip!(*args); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def next(*args, &block); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def next!(*args); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#95 + def prepend(value); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#99 + def replace(value); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def reverse(*args, &block); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def reverse!(*args); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def rstrip(*args, &block); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def rstrip!(*args); end + + # @raise [SafeConcatError] + # + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#65 + def safe_concat(value); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def scrub(*args, &block); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def scrub!(*args); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#49 + def slice(*args); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#51 + def slice!(*args); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def squeeze(*args, &block); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def squeeze!(*args); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def strip(*args, &block); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def strip!(*args); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#171 + def sub(*args, &block); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#171 + def sub!(*args, &block); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def succ(*args, &block); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def succ!(*args); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def swapcase(*args, &block); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def swapcase!(*args); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#147 + def to_param; end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#139 + def to_s; end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def tr(*args, &block); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def tr!(*args); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def tr_s(*args, &block); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def tr_s!(*args); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def unicode_normalize(*args, &block); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def unicode_normalize!(*args); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def upcase(*args, &block); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 + def upcase!(*args); end + + private + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#198 + def explicit_html_escape_interpolated_argument(arg); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#202 + def implicit_html_escape_interpolated_argument(arg); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#74 + def initialize_copy(other); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#28 + def original_concat(*_arg0); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#210 + def set_block_back_references(block, match_data); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#216 + def string_into_safe_buffer(new_string, is_html_safe); end +end + +# Raised when ActiveSupport::SafeBuffer#safe_concat is called on unsafe buffers. +# +# source://activesupport//lib/active_support/core_ext/string/output_safety.rb#32 +class ActiveSupport::SafeBuffer::SafeConcatError < ::StandardError + # @return [SafeConcatError] a new instance of SafeConcatError + # + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#33 + def initialize; end +end + +# source://activesupport//lib/active_support/core_ext/string/output_safety.rb#20 +ActiveSupport::SafeBuffer::UNSAFE_STRING_METHODS = T.let(T.unsafe(nil), Array) + +# source://activesupport//lib/active_support/core_ext/string/output_safety.rb#26 +ActiveSupport::SafeBuffer::UNSAFE_STRING_METHODS_WITH_BACKREF = T.let(T.unsafe(nil), Array) + +# = Secure Compare Rotator +# +# The ActiveSupport::SecureCompareRotator is a wrapper around ActiveSupport::SecurityUtils.secure_compare +# and allows you to rotate a previously defined value to a new one. +# +# It can be used as follow: +# +# rotator = ActiveSupport::SecureCompareRotator.new('new_production_value') +# rotator.rotate('previous_production_value') +# rotator.secure_compare!('previous_production_value') +# +# One real use case example would be to rotate a basic auth credentials: +# +# class MyController < ApplicationController +# def authenticate_request +# rotator = ActiveSupport::SecureCompareRotator.new('new_password') +# rotator.rotate('old_password') +# +# authenticate_or_request_with_http_basic do |username, password| +# rotator.secure_compare!(password) +# rescue ActiveSupport::SecureCompareRotator::InvalidMatch +# false +# end +# end +# end +# +# source://activesupport//lib/active_support/secure_compare_rotator.rb#32 +class ActiveSupport::SecureCompareRotator + include ::ActiveSupport::SecurityUtils + + # @return [SecureCompareRotator] a new instance of SecureCompareRotator + # + # source://activesupport//lib/active_support/secure_compare_rotator.rb#37 + def initialize(value, on_rotation: T.unsafe(nil)); end + + # source://activesupport//lib/active_support/secure_compare_rotator.rb#43 + def rotate(previous_value); end + + # source://activesupport//lib/active_support/secure_compare_rotator.rb#47 + def secure_compare!(other_value, on_rotation: T.unsafe(nil)); end +end + +# source://activesupport//lib/active_support/secure_compare_rotator.rb#35 +class ActiveSupport::SecureCompareRotator::InvalidMatch < ::StandardError; end + +# source://activesupport//lib/active_support/security_utils.rb#4 +module ActiveSupport::SecurityUtils + private + + # @raise [ArgumentError] + # + # source://activesupport//lib/active_support/security_utils.rb#11 + def fixed_length_secure_compare(a, b); end + + # Secure string comparison for strings of variable length. + # + # While a timing attack would not be able to discern the content of + # a secret compared via secure_compare, it is possible to determine + # the secret length. This should be considered when using secure_compare + # to compare weak, short secrets to user input. + # + # source://activesupport//lib/active_support/security_utils.rb#33 + def secure_compare(a, b); end + + class << self + # @raise [ArgumentError] + # + # source://activesupport//lib/active_support/security_utils.rb#25 + def fixed_length_secure_compare(a, b); end + + # Secure string comparison for strings of variable length. + # + # While a timing attack would not be able to discern the content of + # a secret compared via secure_compare, it is possible to determine + # the secret length. This should be considered when using secure_compare + # to compare weak, short secrets to user input. + # + # source://activesupport//lib/active_support/security_utils.rb#36 + def secure_compare(a, b); end + end +end + +# = \String Inquirer +# +# Wrapping a string in this class gives you a prettier way to test +# for equality. The value returned by Rails.env is wrapped +# in a StringInquirer object, so instead of calling this: +# +# Rails.env == 'production' +# +# you can call this: +# +# Rails.env.production? +# +# == Instantiating a new \StringInquirer +# +# vehicle = ActiveSupport::StringInquirer.new('car') +# vehicle.car? # => true +# vehicle.bike? # => false +# +# source://activesupport//lib/active_support/string_inquirer.rb#21 +class ActiveSupport::StringInquirer < ::String + private + + # source://activesupport//lib/active_support/string_inquirer.rb#27 + def method_missing(method_name, *_arg1, **_arg2, &_arg3); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/string_inquirer.rb#23 + def respond_to_missing?(method_name, include_private = T.unsafe(nil)); end +end + +# = Active Support Structured Event \Subscriber +# +# +ActiveSupport::StructuredEventSubscriber+ consumes ActiveSupport::Notifications +# in order to emit structured events via +Rails.event+. +# +# An example would be the Action Controller structured event subscriber, responsible for +# emitting request processing events: +# +# module ActionController +# class StructuredEventSubscriber < ActiveSupport::StructuredEventSubscriber +# attach_to :action_controller +# +# def start_processing(event) +# emit_event("controller.request_started", +# controller: event.payload[:controller], +# action: event.payload[:action], +# format: event.payload[:format] +# ) +# end +# end +# end +# +# After configured, whenever a "start_processing.action_controller" notification is published, +# it will properly dispatch the event (+ActiveSupport::Notifications::Event+) to the +start_processing+ method. +# The subscriber can then emit a structured event via the +emit_event+ method. +# +# source://activesupport//lib/active_support/structured_event_subscriber.rb#31 +class ActiveSupport::StructuredEventSubscriber < ::ActiveSupport::Subscriber + # @return [StructuredEventSubscriber] a new instance of StructuredEventSubscriber + # + # source://activesupport//lib/active_support/structured_event_subscriber.rb#56 + def initialize; end + + # source://activesupport//lib/active_support/structured_event_subscriber.rb#88 + def call(event); end + + # Like +emit_event+, but only emits when the event reporter is in debug mode + # + # source://activesupport//lib/active_support/structured_event_subscriber.rb#82 + def emit_debug_event(name, payload = T.unsafe(nil), caller_depth: T.unsafe(nil), **kwargs); end + + # Emit a structured event via Rails.event.notify. + # + # ==== Arguments + # + # * +name+ - The event name as a string or symbol + # * +payload+ - The event payload as a hash or object + # * +caller_depth+ - Stack depth for source location (default: 1) + # * +kwargs+ - Additional payload data merged with the payload hash + # + # source://activesupport//lib/active_support/structured_event_subscriber.rb#75 + def emit_event(name, payload = T.unsafe(nil), caller_depth: T.unsafe(nil), **kwargs); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/structured_event_subscriber.rb#61 + def silenced?(event); end + + # source://activesupport//lib/active_support/structured_event_subscriber.rb#65 + def silenced_events=(_arg0); end + + private + + # source://activesupport//lib/active_support/structured_event_subscriber.rb#95 + def handle_event_error(name, error); end + + class << self + # source://activesupport//lib/active_support/structured_event_subscriber.rb#37 + def attach_to(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/structured_event_subscriber.rb#32 + def debug_methods; end + + # source://activesupport//lib/active_support/structured_event_subscriber.rb#32 + def debug_methods=(value); end + + # source://activesupport//lib/active_support/structured_event_subscriber.rb#32 + def debug_methods?; end + + private + + # source://activesupport//lib/active_support/structured_event_subscriber.rb#32 + def __class_attr_debug_methods; end + + # source://activesupport//lib/active_support/structured_event_subscriber.rb#32 + def __class_attr_debug_methods=(new_value); end + + # source://activesupport//lib/active_support/structured_event_subscriber.rb#50 + def debug_only(method); end + + # source://activesupport//lib/active_support/structured_event_subscriber.rb#44 + def set_silenced_events; end + end +end + +# source://activesupport//lib/active_support/structured_event_subscriber.rb#34 +ActiveSupport::StructuredEventSubscriber::DEBUG_CHECK = T.let(T.unsafe(nil), Proc) + +# = Active Support \Subscriber +# +# +ActiveSupport::Subscriber+ is an object set to consume +# ActiveSupport::Notifications. The subscriber dispatches notifications to +# a registered object based on its given namespace. +# +# An example would be an Active Record subscriber responsible for collecting +# statistics about queries: +# +# module ActiveRecord +# class StatsSubscriber < ActiveSupport::Subscriber +# attach_to :active_record +# +# def sql(event) +# Statsd.timing("sql.#{event.payload[:name]}", event.duration) +# end +# end +# end +# +# After configured, whenever a "sql.active_record" notification is +# published, it will properly dispatch the event +# (ActiveSupport::Notifications::Event) to the +sql+ method. +# +# We can detach a subscriber as well: +# +# ActiveRecord::StatsSubscriber.detach_from(:active_record) +# +# source://activesupport//lib/active_support/subscriber.rb#32 +class ActiveSupport::Subscriber + # @return [Subscriber] a new instance of Subscriber + # + # source://activesupport//lib/active_support/subscriber.rb#70 + def initialize; end + + # source://activesupport//lib/active_support/subscriber.rb#70 + def call(event); end + + # source://activesupport//lib/active_support/subscriber.rb#70 + def patterns; end + + class << self + # Attach the subscriber to a namespace. + # + # source://activesupport//lib/active_support/subscriber.rb#35 + def attach_to(namespace, subscriber = T.unsafe(nil), notifier = T.unsafe(nil), inherit_all: T.unsafe(nil)); end + + # Detach the subscriber from a namespace. + # + # source://activesupport//lib/active_support/subscriber.rb#50 + def detach_from(namespace, notifier = T.unsafe(nil)); end + + # Adds event subscribers for all new methods added to the class. + # + # source://activesupport//lib/active_support/subscriber.rb#69 + def method_added(event); end + + # source://activesupport//lib/active_support/subscriber.rb#79 + def subscribers; end + + private + + # source://activesupport//lib/active_support/subscriber.rb#86 + def add_event_subscriber(event); end + + # source://activesupport//lib/active_support/subscriber.rb#124 + def fetch_public_methods(subscriber, inherit_all); end + + # source://activesupport//lib/active_support/subscriber.rb#108 + def find_attached_subscriber; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/subscriber.rb#112 + def invalid_event?(event); end + + # Returns the value of attribute namespace. + # + # source://activesupport//lib/active_support/subscriber.rb#84 + def namespace; end + + # Returns the value of attribute notifier. + # + # source://activesupport//lib/active_support/subscriber.rb#84 + def notifier; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/subscriber.rb#120 + def pattern_subscribed?(pattern); end + + # source://activesupport//lib/active_support/subscriber.rb#116 + def prepare_pattern(event); end + + # source://activesupport//lib/active_support/subscriber.rb#97 + def remove_event_subscriber(event); end + + # Returns the value of attribute subscriber. + # + # source://activesupport//lib/active_support/subscriber.rb#84 + def subscriber; end + end +end + +# This is a class for wrapping syntax errors. The purpose of this class +# is to enhance the backtraces on SyntaxError exceptions to include the +# source location of the syntax error. That way we can display the error +# source on error pages in development. +# +# source://activesupport//lib/active_support/syntax_error_proxy.rb#10 +class ActiveSupport::SyntaxErrorProxy + # source://activesupport//lib/active_support/syntax_error_proxy.rb#11 + def backtrace; end + + # source://activesupport//lib/active_support/syntax_error_proxy.rb#37 + def backtrace_locations; end + + private + + # source://activesupport//lib/active_support/syntax_error_proxy.rb#50 + def parse_message_for_trace; end +end + +# source://activesupport//lib/active_support/syntax_error_proxy.rb#15 +class ActiveSupport::SyntaxErrorProxy::BacktraceLocation < ::Struct + # source://activesupport//lib/active_support/syntax_error_proxy.rb#22 + def base_label; end + + # source://activesupport//lib/active_support/syntax_error_proxy.rb#19 + def label; end + + # source://activesupport//lib/active_support/syntax_error_proxy.rb#16 + def spot(_); end +end + +# source://activesupport//lib/active_support/syntax_error_proxy.rb#26 +class ActiveSupport::SyntaxErrorProxy::BacktraceLocationProxy + # @return [BacktraceLocationProxy] a new instance of BacktraceLocationProxy + # + # source://activesupport//lib/active_support/syntax_error_proxy.rb#27 + def initialize(loc, ex); end + + # source://activesupport//lib/active_support/syntax_error_proxy.rb#32 + def spot(_); end +end + +# source://activesupport//lib/active_support/event_reporter.rb#6 +class ActiveSupport::TagStack + class << self + # source://activesupport//lib/active_support/event_reporter.rb#11 + def tags; end + + # source://activesupport//lib/active_support/event_reporter.rb#15 + def with_tags(*args, **kwargs); end + + private + + # source://activesupport//lib/active_support/event_reporter.rb#30 + def resolve_tags(args, kwargs); end + end +end + +# source://activesupport//lib/active_support/event_reporter.rb#7 +ActiveSupport::TagStack::EMPTY_TAGS = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/event_reporter.rb#8 +ActiveSupport::TagStack::FIBER_KEY = T.let(T.unsafe(nil), Symbol) + +# = Active Support Tagged Logging +# +# Wraps any standard Logger object to provide tagging capabilities. +# +# May be called with a block: +# +# logger = ActiveSupport::TaggedLogging.new(Logger.new(STDOUT)) +# logger.tagged('BCX') { logger.info 'Stuff' } # Logs "[BCX] Stuff" +# logger.tagged('BCX', "Jason") { |tagged_logger| tagged_logger.info 'Stuff' } # Logs "[BCX] [Jason] Stuff" +# logger.tagged('BCX') { logger.tagged('Jason') { logger.info 'Stuff' } } # Logs "[BCX] [Jason] Stuff" +# +# If called without a block, a new logger will be returned with applied tags: +# +# logger = ActiveSupport::TaggedLogging.new(Logger.new(STDOUT)) +# logger.tagged("BCX").info "Stuff" # Logs "[BCX] Stuff" +# logger.tagged("BCX", "Jason").info "Stuff" # Logs "[BCX] [Jason] Stuff" +# logger.tagged("BCX").tagged("Jason").info "Stuff" # Logs "[BCX] [Jason] Stuff" +# +# This is used by the default Rails.logger as configured by Railties to make +# it easy to stamp log lines with subdomains, request ids, and anything else +# to aid debugging of multi-user production applications. +# +# source://activesupport//lib/active_support/tagged_logging.rb#29 +module ActiveSupport::TaggedLogging + # source://activesupport//lib/active_support/tagged_logging.rb#139 + def clear_tags!(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/tagged_logging.rb#152 + def flush; end + + # source://activesupport//lib/active_support/tagged_logging.rb#139 + def pop_tags(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/tagged_logging.rb#139 + def push_tags(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/tagged_logging.rb#141 + def tagged(*tags); end + + class << self + # Returns an `ActiveSupport::Logger` that has already been wrapped with tagged logging concern. + # + # source://activesupport//lib/active_support/tagged_logging.rb#117 + def logger(*args, **kwargs); end + + # source://activesupport//lib/active_support/tagged_logging.rb#121 + def new(logger); end + end +end + +# source://activesupport//lib/active_support/tagged_logging.rb#30 +module ActiveSupport::TaggedLogging::Formatter + # This method is invoked when a log event occurs. + # + # source://activesupport//lib/active_support/tagged_logging.rb#32 + def call(severity, timestamp, progname, msg); end + + # source://activesupport//lib/active_support/tagged_logging.rb#51 + def clear_tags!; end + + # source://activesupport//lib/active_support/tagged_logging.rb#61 + def current_tags; end + + # source://activesupport//lib/active_support/tagged_logging.rb#47 + def pop_tags(count = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/tagged_logging.rb#43 + def push_tags(*tags); end + + # source://activesupport//lib/active_support/tagged_logging.rb#55 + def tag_stack; end + + # source://activesupport//lib/active_support/tagged_logging.rb#36 + def tagged(*tags); end + + # source://activesupport//lib/active_support/tagged_logging.rb#65 + def tags_text; end +end + +# source://activesupport//lib/active_support/tagged_logging.rb#108 +module ActiveSupport::TaggedLogging::LocalTagStorage + # Returns the value of attribute tag_stack. + # + # source://activesupport//lib/active_support/tagged_logging.rb#109 + def tag_stack; end + + # Sets the attribute tag_stack + # + # @param value the value to set the attribute tag_stack to. + # + # source://activesupport//lib/active_support/tagged_logging.rb#109 + def tag_stack=(_arg0); end + + class << self + # @private + # + # source://activesupport//lib/active_support/tagged_logging.rb#111 + def extended(base); end + end +end + +# source://activesupport//lib/active_support/tagged_logging.rb#70 +class ActiveSupport::TaggedLogging::TagStack + # @return [TagStack] a new instance of TagStack + # + # source://activesupport//lib/active_support/tagged_logging.rb#73 + def initialize; end + + # source://activesupport//lib/active_support/tagged_logging.rb#91 + def clear; end + + # source://activesupport//lib/active_support/tagged_logging.rb#96 + def format_message(message); end + + # source://activesupport//lib/active_support/tagged_logging.rb#86 + def pop_tags(count); end + + # source://activesupport//lib/active_support/tagged_logging.rb#78 + def push_tags(tags); end + + # Returns the value of attribute tags. + # + # source://activesupport//lib/active_support/tagged_logging.rb#71 + def tags; end +end + +# source://activesupport//lib/active_support/test_case.rb#23 +class ActiveSupport::TestCase < ::Minitest::Test + include ::ActiveSupport::Testing::SetupAndTeardown + include ::ActiveSupport::Testing::TestsWithoutAssertions + include ::ActiveSupport::Testing::TaggedLogging + include ::ActiveSupport::Callbacks + include ::ActiveSupport::Testing::Assertions + include ::ActiveSupport::Testing::ErrorReporterAssertions + include ::ActiveSupport::Testing::EventReporterAssertions + include ::ActiveSupport::Testing::NotificationAssertions + include ::ActiveSupport::Testing::Deprecation + include ::ActiveSupport::Testing::ConstantStubbing + include ::ActiveSupport::Testing::TimeHelpers + include ::ActiveSupport::Testing::FileFixtures + include ::Turbo::TestAssertions + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::ActiveSupport::DescendantsTracker + extend ::ActiveSupport::Testing::SetupAndTeardown::ClassMethods + extend ::ActiveSupport::Testing::Declarative + + # source://activesupport//lib/active_support/test_case.rb#198 + def __callbacks; end + + # source://activesupport//lib/active_support/test_case.rb#198 + def _run_setup_callbacks; end + + # source://activesupport//lib/active_support/test_case.rb#198 + def _run_setup_callbacks!(&block); end + + # source://activesupport//lib/active_support/test_case.rb#198 + def _run_teardown_callbacks; end + + # source://activesupport//lib/active_support/test_case.rb#198 + def _run_teardown_callbacks!(&block); end + + # source://activesupport//lib/active_support/test_case.rb#198 + def _setup_callbacks; end + + # source://activesupport//lib/active_support/test_case.rb#198 + def _teardown_callbacks; end + + # source://activesupport//lib/active_support/test_case.rb#296 + def assert_no_match(matcher, obj, msg = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/test_case.rb#219 + def assert_not_empty(obj, msg = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/test_case.rb#230 + def assert_not_equal(exp, act, msg = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/test_case.rb#241 + def assert_not_in_delta(exp, act, delta = T.unsafe(nil), msg = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/test_case.rb#252 + def assert_not_in_epsilon(exp, act, epsilon = T.unsafe(nil), msg = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/test_case.rb#263 + def assert_not_includes(collection, obj, msg = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/test_case.rb#274 + def assert_not_instance_of(cls, obj, msg = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/test_case.rb#285 + def assert_not_kind_of(cls, obj, msg = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/test_case.rb#307 + def assert_not_nil(obj, msg = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/test_case.rb#318 + def assert_not_operator(o1, op, o2 = T.unsafe(nil), msg = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/test_case.rb#329 + def assert_not_predicate(o1, op, msg = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/test_case.rb#340 + def assert_not_respond_to(obj, meth, msg = T.unsafe(nil), include_all: T.unsafe(nil)); end + + # source://activesupport//lib/active_support/test_case.rb#351 + def assert_not_same(exp, act, msg = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/test_case.rb#353 + def dom_class(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/test_case.rb#353 + def dom_id(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/test_case.rb#207 + def file_fixture_path; end + + # source://activesupport//lib/active_support/test_case.rb#207 + def file_fixture_path?; end + + # source://activesupport//lib/active_support/test_case.rb#355 + def inspect; end + + # source://activesupport//lib/active_support/test_case.rb#190 + def method_name; end + + # Returns the current parallel worker ID if tests are running in parallel + # + # source://activesupport//lib/active_support/test_case.rb#193 + def parallel_worker_id; end + + class << self + # source://activesupport//lib/active_support/test_case.rb#198 + def __callbacks; end + + # source://activesupport//lib/active_support/test_case.rb#198 + def __callbacks=(value); end + + # source://activesupport//lib/active_support/test_case.rb#198 + def _setup_callbacks; end + + # source://activesupport//lib/active_support/test_case.rb#198 + def _setup_callbacks=(value); end + + # source://activesupport//lib/active_support/test_case.rb#198 + def _teardown_callbacks; end + + # source://activesupport//lib/active_support/test_case.rb#198 + def _teardown_callbacks=(value); end + + # source://activesupport//lib/active_support/test_case.rb#207 + def file_fixture_path; end + + # source://activesupport//lib/active_support/test_case.rb#207 + def file_fixture_path=(value); end + + # source://activesupport//lib/active_support/test_case.rb#207 + def file_fixture_path?; end + + # Returns the current parallel worker ID if tests are running in parallel, + # nil otherwise. + # + # ActiveSupport::TestCase.parallel_worker_id # => 2 + # + # source://activesupport//lib/active_support/test_case.rb#34 + def parallel_worker_id; end + + # source://activesupport//lib/active_support/test_case.rb#38 + def parallel_worker_id=(value); end + + # Parallelizes the test suite. + # + # Takes a +workers+ argument that controls how many times the process + # is forked. For each process a new database will be created suffixed + # with the worker number. + # + # test-database_0 + # test-database_1 + # + # If ENV["PARALLEL_WORKERS"] is set the workers argument will be ignored + # and the environment variable will be used instead. This is useful for CI + # environments, or other environments where you may need more workers than + # you do for local testing. + # + # If the number of workers is set to +1+ or fewer, the tests will not be + # parallelized. + # + # If +workers+ is set to +:number_of_processors+, the number of workers will be + # set to the actual core count on the machine you are on. + # + # The default parallelization method is to fork processes. If you'd like to + # use threads instead you can pass with: :threads to the +parallelize+ + # method. Note the threaded parallelization does not create multiple + # databases and will not work with system tests. + # + # parallelize(workers: :number_of_processors, with: :threads) + # + # The threaded parallelization uses minitest's parallel executor directly. + # The processes parallelization uses a Ruby DRb server. + # + # Because parallelization presents an overhead, it is only enabled when the + # number of tests to run is above the +threshold+ param. The default value is + # 50, and it's configurable via +config.active_support.test_parallelization_threshold+. + # + # If you want to skip Rails default creation of one database per process in favor of + # writing your own implementation, you can set +parallelize_databases+, or configure it + # via +config.active_support.parallelize_test_databases+. + # + # parallelize(workers: :number_of_processors, parallelize_databases: false) + # + # Note that your test suite may deadlock if you attempt to use only one database + # with multiple processes. + # + # source://activesupport//lib/active_support/test_case.rb#107 + def parallelize(workers: T.unsafe(nil), with: T.unsafe(nil), threshold: T.unsafe(nil), parallelize_databases: T.unsafe(nil)); end + + # Before fork hook for parallel testing. This can be used to run anything + # before the processes are forked. + # + # In your +test_helper.rb+ add the following: + # + # class ActiveSupport::TestCase + # parallelize_before_fork do + # # run this before fork + # end + # end + # + # source://activesupport//lib/active_support/test_case.rb#132 + def parallelize_before_fork(&block); end + + # Setup hook for parallel testing. This can be used if you have multiple + # databases or any behavior that needs to be run after the process is forked + # but before the tests run. + # + # Note: this feature is not available with the threaded parallelization. + # + # In your +test_helper.rb+ add the following: + # + # class ActiveSupport::TestCase + # parallelize_setup do + # # create databases + # end + # end + # + # source://activesupport//lib/active_support/test_case.rb#149 + def parallelize_setup(&block); end + + # Clean up hook for parallel testing. This can be used to drop databases + # if your app uses multiple write/read databases or other clean up before + # the tests finish. This runs before the forked process is closed. + # + # Note: this feature is not available with the threaded parallelization. + # + # In your +test_helper.rb+ add the following: + # + # class ActiveSupport::TestCase + # parallelize_teardown do + # # drop databases + # end + # end + # + # source://activesupport//lib/active_support/test_case.rb#166 + def parallelize_teardown(&block); end + + # Returns the order in which test cases are run. + # + # ActiveSupport::TestCase.test_order # => :random + # + # Possible values are +:random+, +:parallel+, +:alpha+, +:sorted+. + # Defaults to +:random+. + # + # source://activesupport//lib/active_support/test_case.rb#61 + def test_order; end + + # Sets the order in which test cases are run. + # + # ActiveSupport::TestCase.test_order = :random # => :random + # + # Valid values are: + # * +:random+ (to run tests in random order) + # * +:parallel+ (to run tests in parallel) + # * +:sorted+ (to run tests alphabetically by method name) + # * +:alpha+ (equivalent to +:sorted+) + # + # source://activesupport//lib/active_support/test_case.rb#51 + def test_order=(new_order); end + + private + + # source://activesupport//lib/active_support/test_case.rb#198 + def __class_attr___callbacks; end + + # source://activesupport//lib/active_support/test_case.rb#198 + def __class_attr___callbacks=(new_value); end + + # source://activesupport//lib/active_support/test_case.rb#207 + def __class_attr_file_fixture_path; end + + # source://activesupport//lib/active_support/test_case.rb#207 + def __class_attr_file_fixture_path=(new_value); end + end +end + +# source://activesupport//lib/active_support/test_case.rb#24 +ActiveSupport::TestCase::Assertion = Minitest::Assertion + +# source://activesupport//lib/active_support/testing/tagged_logging.rb#4 +module ActiveSupport::Testing; end + +# source://activesupport//lib/active_support/testing/assertions.rb#7 +module ActiveSupport::Testing::Assertions + # Assertion that the result of evaluating an expression is changed before + # and after invoking the passed in block. + # + # assert_changes 'Status.all_good?' do + # post :create, params: { status: { ok: false } } + # end + # + # You can pass the block as a string to be evaluated in the context of + # the block. A lambda can be passed for the block as well. + # + # assert_changes -> { Status.all_good? } do + # post :create, params: { status: { ok: false } } + # end + # + # The assertion is useful to test side effects. The passed block can be + # anything that can be converted to string with #to_s. + # + # assert_changes :@object do + # @object = 42 + # end + # + # The keyword arguments +:from+ and +:to+ can be given to specify the + # expected initial value and the expected value after the block was + # executed. The comparison is done using case equality (===), which means + # you can specify patterns or classes: + # + # # Exact value match + # assert_changes :@object, from: nil, to: :foo do + # @object = :foo + # end + # + # # Case equality + # assert_changes -> { user.token }, to: /\w{32}/ do + # user.generate_token + # end + # + # # Type check + # assert_changes -> { current_error }, from: nil, to: RuntimeError do + # raise "Oops" + # end + # + # An error message can be specified. + # + # assert_changes -> { Status.all_good? }, 'Expected the status to be bad' do + # post :create, params: { status: { incident: true } } + # end + # + # source://activesupport//lib/active_support/testing/assertions.rb#211 + def assert_changes(expression, message = T.unsafe(nil), from: T.unsafe(nil), to: T.unsafe(nil), &block); end + + # Test numeric difference between the return value of an expression as a + # result of what is evaluated in the yielded block. + # + # assert_difference 'Article.count' do + # post :create, params: { article: {...} } + # end + # + # An arbitrary expression is passed in and evaluated. + # + # assert_difference 'Article.last.comments(:reload).size' do + # post :create, params: { comment: {...} } + # end + # + # An arbitrary positive or negative difference can be specified. + # The default is +1+. + # + # assert_difference 'Article.count', -1 do + # post :delete, params: { id: ... } + # end + # + # An array of expressions can be passed in and evaluated. + # + # assert_difference [ 'Article.count', 'Post.count' ], 2 do + # post :create, params: { article: {...} } + # end + # + # A hash of expressions/numeric differences can be passed in and evaluated. + # + # assert_difference({ 'Article.count' => 1, 'Notification.count' => 2 }) do + # post :create, params: { article: {...} } + # end + # + # A lambda, a list of lambdas or a hash of lambdas/numeric differences can be passed in and evaluated: + # + # assert_difference ->{ Article.count }, 2 do + # post :create, params: { article: {...} } + # end + # + # assert_difference [->{ Article.count }, ->{ Post.count }], 2 do + # post :create, params: { article: {...} } + # end + # + # assert_difference ->{ Article.count } => 1, ->{ Notification.count } => 2 do + # post :create, params: { article: {...} } + # end + # + # An error message can be specified. + # + # assert_difference 'Article.count', -1, 'An Article should be destroyed' do + # post :delete, params: { id: ... } + # end + # + # source://activesupport//lib/active_support/testing/assertions.rb#105 + def assert_difference(expression, *args, &block); end + + # Assertion that the result of evaluating an expression is not changed before + # and after invoking the passed in block. + # + # assert_no_changes 'Status.all_good?' do + # post :create, params: { status: { ok: true } } + # end + # + # Provide the optional keyword argument +:from+ to specify the expected + # initial value. The comparison is done using case equality (===), which means + # you can specify patterns or classes: + # + # # Exact value match + # assert_no_changes -> { Status.all_good? }, from: true do + # post :create, params: { status: { ok: true } } + # end + # + # # Case equality + # assert_no_changes -> { user.token }, from: /\w{32}/ do + # user.touch + # end + # + # # Type check + # assert_no_changes -> { current_error }, from: RuntimeError do + # retry_operation + # end + # + # An error message can be specified. + # + # assert_no_changes -> { Status.all_good? }, 'Expected the status to be good' do + # post :create, params: { status: { ok: false } } + # end + # + # source://activesupport//lib/active_support/testing/assertions.rb#280 + def assert_no_changes(expression, message = T.unsafe(nil), from: T.unsafe(nil), &block); end + + # Assertion that the numeric result of evaluating an expression is not + # changed before and after invoking the passed in block. + # + # assert_no_difference 'Article.count' do + # post :create, params: { article: invalid_attributes } + # end + # + # A lambda can be passed in and evaluated. + # + # assert_no_difference -> { Article.count } do + # post :create, params: { article: invalid_attributes } + # end + # + # An error message can be specified. + # + # assert_no_difference 'Article.count', 'An Article should not be created' do + # post :create, params: { article: invalid_attributes } + # end + # + # An array of expressions can also be passed in and evaluated. + # + # assert_no_difference [ 'Article.count', -> { Post.count } ] do + # post :create, params: { article: invalid_attributes } + # end + # + # source://activesupport//lib/active_support/testing/assertions.rb#161 + def assert_no_difference(expression, message = T.unsafe(nil), &block); end + + # Asserts that an expression is not truthy. Passes if +object+ is +nil+ or + # +false+. "Truthy" means "considered true in a conditional" like if + # foo. + # + # assert_not nil # => true + # assert_not false # => true + # assert_not 'foo' # => Expected "foo" to be nil or false + # + # An error message can be specified. + # + # assert_not foo, 'foo should be false' + # + # source://activesupport//lib/active_support/testing/assertions.rb#21 + def assert_not(object, message = T.unsafe(nil)); end + + # Assertion that the block should not raise an exception. + # + # Passes if evaluated code in the yielded block raises no exception. + # + # assert_nothing_raised do + # perform_service(param: 'no_exception') + # end + # + # source://activesupport//lib/active_support/testing/assertions.rb#48 + def assert_nothing_raised; end + + # Asserts that a block raises one of +exp+. This is an enhancement of the + # standard Minitest assertion method with the ability to test error + # messages. + # + # assert_raises(ArgumentError, match: /incorrect param/i) do + # perform_service(param: 'exception') + # end + # + # source://activesupport//lib/active_support/testing/assertions.rb#39 + def assert_raise(*exp, match: T.unsafe(nil), &block); end + + # Asserts that a block raises one of +exp+. This is an enhancement of the + # standard Minitest assertion method with the ability to test error + # messages. + # + # assert_raises(ArgumentError, match: /incorrect param/i) do + # perform_service(param: 'exception') + # end + # + # source://activesupport//lib/active_support/testing/assertions.rb#34 + def assert_raises(*exp, match: T.unsafe(nil), &block); end + + private + + # source://activesupport//lib/active_support/testing/assertions.rb#314 + def _assert_nothing_raised_or_warn(assertion, &block); end + + # source://activesupport//lib/active_support/testing/assertions.rb#329 + def _callable_to_source_string(callable); end +end + +# source://activesupport//lib/active_support/testing/assertions.rb#8 +ActiveSupport::Testing::Assertions::UNTRACKED = T.let(T.unsafe(nil), Object) + +# Resolves a constant from a minitest spec name. +# +# Given the following spec-style test: +# +# describe WidgetsController, :index do +# describe "authenticated user" do +# describe "returns widgets" do +# it "has a controller that exists" do +# assert_kind_of WidgetsController, @controller +# end +# end +# end +# end +# +# The test will have the following name: +# +# "WidgetsController::index::authenticated user::returns widgets" +# +# The constant WidgetsController can be resolved from the name. +# The following code will resolve the constant: +# +# controller = determine_constant_from_test_name(name) do |constant| +# Class === constant && constant < ::ActionController::Metal +# end +# +# source://activesupport//lib/active_support/testing/constant_lookup.rb#32 +module ActiveSupport::Testing::ConstantLookup + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveSupport::Testing::ConstantLookup::ClassMethods +end + +# source://activesupport//lib/active_support/testing/constant_lookup.rb#35 +module ActiveSupport::Testing::ConstantLookup::ClassMethods + # source://activesupport//lib/active_support/testing/constant_lookup.rb#36 + def determine_constant_from_test_name(test_name); end +end + +# source://activesupport//lib/active_support/testing/constant_stubbing.rb#5 +module ActiveSupport::Testing::ConstantStubbing + # Changes the value of a constant for the duration of a block. Example: + # + # # World::List::Import::LARGE_IMPORT_THRESHOLD = 5000 + # stub_const(World::List::Import, :LARGE_IMPORT_THRESHOLD, 1) do + # assert_equal 1, World::List::Import::LARGE_IMPORT_THRESHOLD + # end + # + # assert_equal 5000, World::List::Import::LARGE_IMPORT_THRESHOLD + # + # Using this method rather than forcing World::List::Import::LARGE_IMPORT_THRESHOLD = 5000 prevents + # warnings from being thrown, and ensures that the old value is returned after the test has completed. + # + # If the constant doesn't already exists, but you need it set for the duration of the block + # you can do so by passing `exists: false`. + # + # stub_const(object, :SOME_CONST, 1, exists: false) do + # assert_equal 1, SOME_CONST + # end + # + # Note: Stubbing a const will stub it across all threads. So if you have concurrent threads + # (like separate test suites running in parallel) that all depend on the same constant, it's possible + # divergent stubbing will trample on each other. + # + # source://activesupport//lib/active_support/testing/constant_stubbing.rb#28 + def stub_const(mod, constant, new_value, exists: T.unsafe(nil)); end +end + +# source://activesupport//lib/active_support/testing/declarative.rb#5 +module ActiveSupport::Testing::Declarative + # Helper to define a test method using a String. Under the hood, it replaces + # spaces with underscores and defines the test method. + # + # test "verify something" do + # ... + # end + # + # source://activesupport//lib/active_support/testing/declarative.rb#13 + def test(name, &block); end +end + +# source://activesupport//lib/active_support/testing/deprecation.rb#7 +module ActiveSupport::Testing::Deprecation + # :call-seq: + # assert_deprecated(deprecator, &block) + # assert_deprecated(match, deprecator, &block) + # + # Asserts that a matching deprecation warning was emitted by the given deprecator during the execution of the yielded block. + # + # assert_deprecated(/foo/, CustomDeprecator) do + # CustomDeprecator.warn "foo should no longer be used" + # end + # + # The +match+ object may be a +Regexp+, or +String+ appearing in the message. + # + # assert_deprecated('foo', CustomDeprecator) do + # CustomDeprecator.warn "foo should no longer be used" + # end + # + # If the +match+ is omitted (or explicitly +nil+), any deprecation warning will match. + # + # assert_deprecated(CustomDeprecator) do + # CustomDeprecator.warn "foo should no longer be used" + # end + # + # source://activesupport//lib/active_support/testing/deprecation.rb#30 + def assert_deprecated(match = T.unsafe(nil), deprecator = T.unsafe(nil), &block); end + + # Asserts that no deprecation warnings are emitted by the given deprecator during the execution of the yielded block. + # + # assert_not_deprecated(CustomDeprecator) do + # CustomDeprecator.warn "message" # fails assertion + # end + # + # assert_not_deprecated(ActiveSupport::Deprecation.new) do + # CustomDeprecator.warn "message" # passes assertion, different deprecator + # end + # + # source://activesupport//lib/active_support/testing/deprecation.rb#55 + def assert_not_deprecated(deprecator, &block); end + + # Returns the return value of the block and an array of all the deprecation warnings emitted by the given + # +deprecator+ during the execution of the yielded block. + # + # collect_deprecations(CustomDeprecator) do + # CustomDeprecator.warn "message" + # ActiveSupport::Deprecation.new.warn "other message" + # :result + # end # => [:result, ["message"]] + # + # source://activesupport//lib/active_support/testing/deprecation.rb#69 + def collect_deprecations(deprecator); end +end + +# source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#5 +module ActiveSupport::Testing::ErrorReporterAssertions + # Assertion that the block should cause at least one exception to be reported + # to +Rails.error+. + # + # Passes if the evaluated code in the yielded block reports a matching exception. + # + # assert_error_reported(IOError) do + # Rails.error.report(IOError.new("Oops")) + # end + # + # To test further details about the reported exception, you can use the return + # value. + # + # report = assert_error_reported(IOError) do + # # ... + # end + # assert_equal "Oops", report.error.message + # assert_equal "admin", report.context[:section] + # assert_equal :warning, report.severity + # assert_predicate report, :handled? + # + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#88 + def assert_error_reported(error_class = T.unsafe(nil), &block); end + + # Assertion that the block should not cause an exception to be reported + # to +Rails.error+. + # + # Passes if evaluated code in the yielded block reports no exception. + # + # assert_no_error_reported do + # perform_service(param: 'no_exception') + # end + # + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#62 + def assert_no_error_reported(&block); end + + # Captures reported errors from within the block that match the given + # error class. + # + # reports = capture_error_reports(IOError) do + # Rails.error.report(IOError.new("Oops")) + # Rails.error.report(IOError.new("Oh no")) + # Rails.error.report(StandardError.new) + # end + # + # assert_equal 2, reports.size + # assert_equal "Oops", reports.first.error.message + # assert_equal "Oh no", reports.last.error.message + # + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#118 + def capture_error_reports(error_class = T.unsafe(nil), &block); end +end + +# source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#6 +module ActiveSupport::Testing::ErrorReporterAssertions::ErrorCollector + class << self + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#16 + def record; end + + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#29 + def report(error, **kwargs); end + + private + + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#38 + def subscribe; end + end +end + +# source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 +class ActiveSupport::Testing::ErrorReporterAssertions::ErrorCollector::Report < ::Struct + # Returns the value of attribute context + # + # @return [Object] the current value of context + # + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 + def context; end + + # Sets the attribute context + # + # @param value [Object] the value to set the attribute context to. + # @return [Object] the newly set value + # + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 + def context=(_); end + + # Returns the value of attribute error + # + # @return [Object] the current value of error + # + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 + def error; end + + # Sets the attribute error + # + # @param value [Object] the value to set the attribute error to. + # @return [Object] the newly set value + # + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 + def error=(_); end + + # Returns the value of attribute handled + # + # @return [Object] the current value of handled + # + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 + def handled; end + + # Sets the attribute handled + # + # @param value [Object] the value to set the attribute handled to. + # @return [Object] the newly set value + # + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 + def handled=(_); end + + # Returns the value of attribute handled + # + # @return [Object] the current value of handled + # + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#12 + def handled?; end + + # Returns the value of attribute severity + # + # @return [Object] the current value of severity + # + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 + def severity; end + + # Sets the attribute severity + # + # @param value [Object] the value to set the attribute severity to. + # @return [Object] the newly set value + # + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 + def severity=(_); end + + # Returns the value of attribute source + # + # @return [Object] the current value of source + # + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 + def source; end + + # Sets the attribute source + # + # @param value [Object] the value to set the attribute source to. + # @return [Object] the newly set value + # + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 + def source=(_); end + + class << self + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 + def [](*_arg0); end + + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 + def inspect; end + + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 + def keyword_init?; end + + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 + def members; end + + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 + def new(*_arg0); end + end +end + +# Provides test helpers for asserting on ActiveSupport::EventReporter events. +# +# source://activesupport//lib/active_support/testing/event_reporter_assertions.rb#6 +module ActiveSupport::Testing::EventReporterAssertions + # Asserts that the block causes an event with the given name to be reported + # to +Rails.event+. + # + # Passes if the evaluated code in the yielded block reports a matching event. + # + # assert_event_reported("user.created") do + # Rails.event.notify("user.created", { id: 123 }) + # end + # + # To test further details about the reported event, you can specify payload and tag matchers. + # + # assert_event_reported("user.created", + # payload: { id: 123, name: "John Doe" }, + # tags: { request_id: /[0-9]+/ } + # ) do + # Rails.event.tagged(request_id: "123") do + # Rails.event.notify("user.created", { id: 123, name: "John Doe" }) + # end + # end + # + # The matchers support partial matching - only the specified keys need to match. + # + # assert_event_reported("user.created", payload: { id: 123 }) do + # Rails.event.notify("user.created", { id: 123, name: "John Doe" }) + # end + # + # source://activesupport//lib/active_support/testing/event_reporter_assertions.rb#142 + def assert_event_reported(name, payload: T.unsafe(nil), tags: T.unsafe(nil), &block); end + + # Asserts that the provided events were reported, regardless of order. + # + # assert_events_reported([ + # { name: "user.created", payload: { id: 123 } }, + # { name: "email.sent", payload: { to: "user@example.com" } } + # ]) do + # create_user_and_send_welcome_email + # end + # + # Supports the same payload and tag matching as +assert_event_reported+. + # + # assert_events_reported([ + # { + # name: "process.started", + # payload: { id: 123 }, + # tags: { request_id: /[0-9]+/ } + # }, + # { name: "process.completed" } + # ]) do + # Rails.event.tagged(request_id: "456") do + # start_and_complete_process(123) + # end + # end + # + # source://activesupport//lib/active_support/testing/event_reporter_assertions.rb#184 + def assert_events_reported(expected_events, &block); end + + # Asserts that the block does not cause an event to be reported to +Rails.event+. + # + # If no name is provided, passes if evaluated code in the yielded block reports no events. + # + # assert_no_event_reported do + # service_that_does_not_report_events.perform + # end + # + # If a name is provided, passes if evaluated code in the yielded block reports no events + # with that name. + # + # assert_no_event_reported("user.created") do + # service_that_does_not_report_events.perform + # end + # + # source://activesupport//lib/active_support/testing/event_reporter_assertions.rb#101 + def assert_no_event_reported(name = T.unsafe(nil), payload: T.unsafe(nil), tags: T.unsafe(nil), &block); end + + # Allows debug events to be reported to +Rails.event+ for the duration of a given block. + # + # with_debug_event_reporting do + # service_that_reports_debug_events.perform + # end + # + # source://activesupport//lib/active_support/testing/event_reporter_assertions.rb#222 + def with_debug_event_reporting(&block); end +end + +# source://activesupport//lib/active_support/testing/event_reporter_assertions.rb#7 +module ActiveSupport::Testing::EventReporterAssertions::EventCollector + class << self + # source://activesupport//lib/active_support/testing/event_reporter_assertions.rb#46 + def emit(event); end + + # source://activesupport//lib/active_support/testing/event_reporter_assertions.rb#53 + def record; end + + private + + # source://activesupport//lib/active_support/testing/event_reporter_assertions.rb#81 + def event_recorders; end + + # source://activesupport//lib/active_support/testing/event_reporter_assertions.rb#66 + def subscribe; end + end +end + +# source://activesupport//lib/active_support/testing/event_reporter_assertions.rb#11 +class ActiveSupport::Testing::EventReporterAssertions::EventCollector::Event + # @return [Event] a new instance of Event + # + # source://activesupport//lib/active_support/testing/event_reporter_assertions.rb#14 + def initialize(event_data); end + + # Returns the value of attribute event_data. + # + # source://activesupport//lib/active_support/testing/event_reporter_assertions.rb#12 + def event_data; end + + # source://activesupport//lib/active_support/testing/event_reporter_assertions.rb#18 + def inspect; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/testing/event_reporter_assertions.rb#22 + def matches?(name, payload, tags); end + + private + + # @return [Boolean] + # + # source://activesupport//lib/active_support/testing/event_reporter_assertions.rb#34 + def matches_hash?(expected_hash, event_key); end +end + +# Adds simple access to sample files called file fixtures. +# File fixtures are normal files stored in +# ActiveSupport::TestCase.file_fixture_path. +# +# File fixtures are represented as +Pathname+ objects. +# This makes it easy to extract specific information: +# +# file_fixture("example.txt").read # get the file's content +# file_fixture("example.mp3").size # get the file size +# +# source://activesupport//lib/active_support/testing/file_fixtures.rb#16 +module ActiveSupport::Testing::FileFixtures + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + # Returns a +Pathname+ to the fixture file named +fixture_name+. + # + # Raises +ArgumentError+ if +fixture_name+ can't be found. + # + # source://activesupport//lib/active_support/testing/file_fixtures.rb#26 + def file_fixture(fixture_name); end + + module GeneratedClassMethods + def file_fixture_path; end + def file_fixture_path=(value); end + def file_fixture_path?; end + end + + module GeneratedInstanceMethods + def file_fixture_path; end + def file_fixture_path?; end + end +end + +# source://activesupport//lib/active_support/testing/isolation.rb#7 +module ActiveSupport::Testing::Isolation + include ::ActiveSupport::Testing::Isolation::Forking + + # source://activesupport//lib/active_support/testing/isolation.rb#20 + def run; end + + class << self + # @return [Boolean] + # + # source://activesupport//lib/active_support/testing/isolation.rb#16 + def forking_env?; end + + # source://activesupport//lib/active_support/testing/isolation.rb#10 + def included(klass); end + end +end + +# source://activesupport//lib/active_support/testing/isolation.rb#35 +module ActiveSupport::Testing::Isolation::Forking + # source://activesupport//lib/active_support/testing/isolation.rb#36 + def run_in_isolation(&blk); end +end + +# source://activesupport//lib/active_support/testing/isolation.rb#73 +module ActiveSupport::Testing::Isolation::Subprocess + # Complicated H4X to get this working in Windows / JRuby with + # no forking. + # + # source://activesupport//lib/active_support/testing/isolation.rb#78 + def run_in_isolation(&blk); end +end + +# source://activesupport//lib/active_support/testing/isolation.rb#74 +ActiveSupport::Testing::Isolation::Subprocess::ORIG_ARGV = T.let(T.unsafe(nil), Array) + +# source://activesupport//lib/active_support/testing/isolation.rb#8 +class ActiveSupport::Testing::Isolation::SubprocessCrashed < ::StandardError; end + +# source://activesupport//lib/active_support/testing/notification_assertions.rb#5 +module ActiveSupport::Testing::NotificationAssertions + # Assert no notifications were emitted for a given +pattern+. + # + # You can assert no notifications were emitted by passing a pattern, which accepts + # either a string or regexp, and a block. While the block is executed, if no + # matching notifications are emitted, the assertion will pass. + # + # assert_no_notifications("post.submitted") do + # post.destroy # => emits non-matching notification + # end + # + # source://activesupport//lib/active_support/testing/notification_assertions.rb#66 + def assert_no_notifications(pattern = T.unsafe(nil), &block); end + + # Assert a notification was emitted with a given +pattern+ and optional +payload+. + # + # You can assert that a notification was emitted by passing a pattern, which accepts + # either a string or regexp, an optional payload, and a block. While the block + # is executed, if a matching notification is emitted, the assertion will pass + # and the notification will be returned. + # + # Note that the payload is matched as a subset, meaning that the notification must + # contain at least the specified keys and values, but may contain additional ones. + # + # assert_notification("post.submitted", title: "Cool Post") do + # post.submit(title: "Cool Post", body: "Cool Body") # => emits matching notification + # end + # + # Using the returned notification, you can make more customized assertions. + # + # notification = assert_notification("post.submitted", title: "Cool Post") do + # ActiveSupport::Notifications.instrument("post.submitted", title: "Cool Post", body: Body.new("Cool Body")) + # end + # + # assert_instance_of(Body, notification.payload[:body]) + # + # source://activesupport//lib/active_support/testing/notification_assertions.rb#28 + def assert_notification(pattern, payload = T.unsafe(nil), &block); end + + # Assert the number of notifications emitted with a given +pattern+. + # + # You can assert the number of notifications emitted by passing a pattern, which accepts + # either a string or regexp, a count, and a block. While the block is executed, + # the number of matching notifications emitted will be counted. After the block's + # execution completes, the assertion will pass if the count matches. + # + # assert_notifications_count("post.submitted", 1) do + # post.submit(title: "Cool Post") # => emits matching notification + # end + # + # source://activesupport//lib/active_support/testing/notification_assertions.rb#51 + def assert_notifications_count(pattern, count, &block); end + + # Capture emitted notifications, optionally filtered by a +pattern+. + # + # You can capture emitted notifications, optionally filtered by a pattern, + # which accepts either a string or regexp, and a block. + # + # notifications = capture_notifications("post.submitted") do + # post.submit(title: "Cool Post") # => emits matching notification + # end + # + # source://activesupport//lib/active_support/testing/notification_assertions.rb#85 + def capture_notifications(pattern = T.unsafe(nil), &block); end +end + +# source://activesupport//lib/active_support/testing/parallelization/server.rb#8 +class ActiveSupport::Testing::Parallelization + # @return [Parallelization] a new instance of Parallelization + # + # source://activesupport//lib/active_support/testing/parallelization.rb#36 + def initialize(worker_count); end + + # source://activesupport//lib/active_support/testing/parallelization.rb#54 + def <<(work); end + + # source://activesupport//lib/active_support/testing/parallelization.rb#26 + def after_fork_hooks; end + + # source://activesupport//lib/active_support/testing/parallelization.rb#43 + def before_fork; end + + # source://activesupport//lib/active_support/testing/parallelization.rb#18 + def before_fork_hooks; end + + # source://activesupport//lib/active_support/testing/parallelization.rb#34 + def run_cleanup_hooks; end + + # source://activesupport//lib/active_support/testing/parallelization.rb#62 + def shutdown; end + + # source://activesupport//lib/active_support/testing/parallelization.rb#58 + def size; end + + # source://activesupport//lib/active_support/testing/parallelization.rb#47 + def start; end + + class << self + # source://activesupport//lib/active_support/testing/parallelization.rb#22 + def after_fork_hook(&blk); end + + # source://activesupport//lib/active_support/testing/parallelization.rb#26 + def after_fork_hooks; end + + # source://activesupport//lib/active_support/testing/parallelization.rb#14 + def before_fork_hook(&blk); end + + # source://activesupport//lib/active_support/testing/parallelization.rb#18 + def before_fork_hooks; end + + # source://activesupport//lib/active_support/testing/parallelization.rb#30 + def run_cleanup_hook(&blk); end + + # source://activesupport//lib/active_support/testing/parallelization.rb#34 + def run_cleanup_hooks; end + end +end + +# source://activesupport//lib/active_support/testing/parallelization/server.rb#9 +class ActiveSupport::Testing::Parallelization::PrerecordResultClass < ::Struct + # Returns the value of attribute name + # + # @return [Object] the current value of name + # + # source://activesupport//lib/active_support/testing/parallelization/server.rb#9 + def name; end + + # Sets the attribute name + # + # @param value [Object] the value to set the attribute name to. + # @return [Object] the newly set value + # + # source://activesupport//lib/active_support/testing/parallelization/server.rb#9 + def name=(_); end + + class << self + # source://activesupport//lib/active_support/testing/parallelization/server.rb#9 + def [](*_arg0); end + + # source://activesupport//lib/active_support/testing/parallelization/server.rb#9 + def inspect; end + + # source://activesupport//lib/active_support/testing/parallelization/server.rb#9 + def keyword_init?; end + + # source://activesupport//lib/active_support/testing/parallelization/server.rb#9 + def members; end + + # source://activesupport//lib/active_support/testing/parallelization/server.rb#9 + def new(*_arg0); end + end +end + +# source://activesupport//lib/active_support/testing/parallelization/server.rb#11 +class ActiveSupport::Testing::Parallelization::Server + include ::DRb::DRbUndumped + + # @return [Server] a new instance of Server + # + # source://activesupport//lib/active_support/testing/parallelization/server.rb#14 + def initialize; end + + # source://activesupport//lib/active_support/testing/parallelization/server.rb#32 + def <<(o); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/testing/parallelization/server.rb#64 + def active_workers?; end + + # source://activesupport//lib/active_support/testing/parallelization/server.rb#68 + def interrupt; end + + # source://activesupport//lib/active_support/testing/parallelization/server.rb#37 + def pop; end + + # @raise [DRb::DRbConnError] + # + # source://activesupport//lib/active_support/testing/parallelization/server.rb#21 + def record(reporter, result); end + + # source://activesupport//lib/active_support/testing/parallelization/server.rb#54 + def remove_dead_workers(dead_pids); end + + # source://activesupport//lib/active_support/testing/parallelization/server.rb#72 + def shutdown; end + + # source://activesupport//lib/active_support/testing/parallelization/server.rb#44 + def start_worker(worker_id, worker_pid); end + + # source://activesupport//lib/active_support/testing/parallelization/server.rb#49 + def stop_worker(worker_id, worker_pid); end +end + +# source://activesupport//lib/active_support/testing/parallelization/worker.rb#6 +class ActiveSupport::Testing::Parallelization::Worker + # @return [Worker] a new instance of Worker + # + # source://activesupport//lib/active_support/testing/parallelization/worker.rb#7 + def initialize(number, url); end + + # source://activesupport//lib/active_support/testing/parallelization/worker.rb#80 + def after_fork; end + + # source://activesupport//lib/active_support/testing/parallelization/worker.rb#42 + def perform_job(job); end + + # source://activesupport//lib/active_support/testing/parallelization/worker.rb#88 + def run_cleanup; end + + # source://activesupport//lib/active_support/testing/parallelization/worker.rb#56 + def safe_record(reporter, result); end + + # source://activesupport//lib/active_support/testing/parallelization/worker.rb#14 + def start; end + + # source://activesupport//lib/active_support/testing/parallelization/worker.rb#36 + def work_from_queue; end + + private + + # source://activesupport//lib/active_support/testing/parallelization/worker.rb#95 + def add_setup_exception(result); end + + # source://activesupport//lib/active_support/testing/parallelization/worker.rb#99 + def set_process_title(status); end +end + +# source://activesupport//lib/active_support/testing/parallelize_executor.rb#5 +class ActiveSupport::Testing::ParallelizeExecutor + # @return [ParallelizeExecutor] a new instance of ParallelizeExecutor + # + # source://activesupport//lib/active_support/testing/parallelize_executor.rb#8 + def initialize(size:, with:, threshold: T.unsafe(nil)); end + + # source://activesupport//lib/active_support/testing/parallelize_executor.rb#22 + def <<(work); end + + # Returns the value of attribute parallelize_with. + # + # source://activesupport//lib/active_support/testing/parallelize_executor.rb#6 + def parallelize_with; end + + # source://activesupport//lib/active_support/testing/parallelize_executor.rb#26 + def shutdown; end + + # Returns the value of attribute size. + # + # source://activesupport//lib/active_support/testing/parallelize_executor.rb#6 + def size; end + + # source://activesupport//lib/active_support/testing/parallelize_executor.rb#15 + def start; end + + # Returns the value of attribute threshold. + # + # source://activesupport//lib/active_support/testing/parallelize_executor.rb#6 + def threshold; end + + private + + # source://activesupport//lib/active_support/testing/parallelize_executor.rb#35 + def build_parallel_executor; end + + # source://activesupport//lib/active_support/testing/parallelize_executor.rb#72 + def execution_info; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/testing/parallelize_executor.rb#60 + def many_workers?; end + + # source://activesupport//lib/active_support/testing/parallelize_executor.rb#31 + def parallel_executor; end + + # source://activesupport//lib/active_support/testing/parallelize_executor.rb#47 + def parallelize; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/testing/parallelize_executor.rb#52 + def parallelized?; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/testing/parallelize_executor.rb#56 + def should_parallelize?; end + + # source://activesupport//lib/active_support/testing/parallelize_executor.rb#68 + def show_execution_info; end + + # source://activesupport//lib/active_support/testing/parallelize_executor.rb#64 + def tests_count; end +end + +# Adds support for +setup+ and +teardown+ callbacks. +# These callbacks serve as a replacement to overwriting the +# #setup and #teardown methods of your TestCase. +# +# class ExampleTest < ActiveSupport::TestCase +# setup do +# # ... +# end +# +# teardown do +# # ... +# end +# end +# +# source://activesupport//lib/active_support/testing/setup_and_teardown.rb#20 +module ActiveSupport::Testing::SetupAndTeardown + # source://activesupport//lib/active_support/testing/setup_and_teardown.rb#44 + def after_teardown; end + + # source://activesupport//lib/active_support/testing/setup_and_teardown.rb#39 + def before_setup; end + + class << self + # source://activesupport//lib/active_support/testing/setup_and_teardown.rb#21 + def prepended(klass); end + end +end + +# source://activesupport//lib/active_support/testing/setup_and_teardown.rb#27 +module ActiveSupport::Testing::SetupAndTeardown::ClassMethods + # Add a callback, which runs before TestCase#setup. + # + # source://activesupport//lib/active_support/testing/setup_and_teardown.rb#29 + def setup(*args, &block); end + + # Add a callback, which runs after TestCase#teardown. + # + # source://activesupport//lib/active_support/testing/setup_and_teardown.rb#34 + def teardown(*args, &block); end +end + +# Manages stubs for TimeHelpers +# +# source://activesupport//lib/active_support/testing/time_helpers.rb#9 +class ActiveSupport::Testing::SimpleStubs + # @return [SimpleStubs] a new instance of SimpleStubs + # + # source://activesupport//lib/active_support/testing/time_helpers.rb#12 + def initialize; end + + # Stubs object.method_name with the given block + # If the method is already stubbed, remove that stub + # so that removing this stub will restore the original implementation. + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # target = Time.zone.local(2004, 11, 24, 1, 4, 44) + # simple_stubs.stub_object(Time, :now) { at(target.to_i) } + # Time.current # => Wed, 24 Nov 2004 01:04:44 EST -05:00 + # + # source://activesupport//lib/active_support/testing/time_helpers.rb#23 + def stub_object(object, method_name, &block); end + + # Returns true if any stubs are set, false if there are none + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/testing/time_helpers.rb#53 + def stubbed?; end + + # Returns the Stub for object#method_name + # (nil if it is not stubbed) + # + # source://activesupport//lib/active_support/testing/time_helpers.rb#48 + def stubbing(object, method_name); end + + # Remove all object-method stubs held by this instance + # + # source://activesupport//lib/active_support/testing/time_helpers.rb#37 + def unstub_all!; end + + private + + # Restores the original object.method described by the Stub + # + # source://activesupport//lib/active_support/testing/time_helpers.rb#59 + def unstub_object(stub); end +end + +# source://activesupport//lib/active_support/testing/time_helpers.rb#10 +class ActiveSupport::Testing::SimpleStubs::Stub < ::Struct + # Returns the value of attribute method_name + # + # @return [Object] the current value of method_name + # + # source://activesupport//lib/active_support/testing/time_helpers.rb#10 + def method_name; end + + # Sets the attribute method_name + # + # @param value [Object] the value to set the attribute method_name to. + # @return [Object] the newly set value + # + # source://activesupport//lib/active_support/testing/time_helpers.rb#10 + def method_name=(_); end + + # Returns the value of attribute object + # + # @return [Object] the current value of object + # + # source://activesupport//lib/active_support/testing/time_helpers.rb#10 + def object; end + + # Sets the attribute object + # + # @param value [Object] the value to set the attribute object to. + # @return [Object] the newly set value + # + # source://activesupport//lib/active_support/testing/time_helpers.rb#10 + def object=(_); end + + # Returns the value of attribute original_method + # + # @return [Object] the current value of original_method + # + # source://activesupport//lib/active_support/testing/time_helpers.rb#10 + def original_method; end + + # Sets the attribute original_method + # + # @param value [Object] the value to set the attribute original_method to. + # @return [Object] the newly set value + # + # source://activesupport//lib/active_support/testing/time_helpers.rb#10 + def original_method=(_); end + + class << self + # source://activesupport//lib/active_support/testing/time_helpers.rb#10 + def [](*_arg0); end + + # source://activesupport//lib/active_support/testing/time_helpers.rb#10 + def inspect; end + + # source://activesupport//lib/active_support/testing/time_helpers.rb#10 + def keyword_init?; end + + # source://activesupport//lib/active_support/testing/time_helpers.rb#10 + def members; end + + # source://activesupport//lib/active_support/testing/time_helpers.rb#10 + def new(*_arg0); end + end +end + +# Logs a "PostsControllerTest: test name" heading before each test to +# make test.log easier to search and follow along with. +# +# source://activesupport//lib/active_support/testing/tagged_logging.rb#7 +module ActiveSupport::Testing::TaggedLogging + # source://activesupport//lib/active_support/testing/tagged_logging.rb#10 + def before_setup; end + + # source://activesupport//lib/active_support/testing/tagged_logging.rb#8 + def tagged_logger=(_arg0); end + + private + + # source://activesupport//lib/active_support/testing/tagged_logging.rb#22 + def tagged_logger; end +end + +# Warns when a test case does not perform any assertions. +# +# This is helpful in detecting broken tests that do not perform intended assertions. +# +# source://activesupport//lib/active_support/testing/tests_without_assertions.rb#8 +module ActiveSupport::Testing::TestsWithoutAssertions + # source://activesupport//lib/active_support/testing/tests_without_assertions.rb#9 + def after_teardown; end +end + +# Contains helpers that help you test passage of time. +# +# source://activesupport//lib/active_support/testing/time_helpers.rb#68 +module ActiveSupport::Testing::TimeHelpers + # source://activesupport//lib/active_support/testing/time_helpers.rb#69 + def after_teardown; end + + # Calls +travel_to+ with +date_or_time+, which defaults to +Time.now+. + # Forwards optional with_usec argument. + # + # Time.current # => Sun, 09 Jul 2017 15:34:49 EST -05:00 + # freeze_time + # sleep(1) + # Time.current # => Sun, 09 Jul 2017 15:34:49 EST -05:00 + # freeze_time Time.current + 1.day + # sleep(1) + # Time.current # => Mon, 10 Jul 2017 15:34:49 EST -05:00 + # + # This method also accepts a block, which will return the current time back to its original + # state at the end of the block: + # + # Time.current # => Sun, 09 Jul 2017 15:34:49 EST -05:00 + # freeze_time do + # sleep(1) + # User.create.created_at # => Sun, 09 Jul 2017 15:34:49 EST -05:00 + # end + # Time.current # => Sun, 09 Jul 2017 15:34:50 EST -05:00 + # + # source://activesupport//lib/active_support/testing/time_helpers.rb#261 + def freeze_time(date_or_time = T.unsafe(nil), with_usec: T.unsafe(nil), &block); end + + # Changes current time to the time in the future or in the past by a given time difference by + # stubbing +Time.now+, +Date.today+, and +DateTime.now+. The stubs are automatically removed + # at the end of the test. + # + # Note that the usec for the resulting time will be set to 0 to prevent rounding + # errors with external services, like MySQL (which will round instead of floor, + # leading to off-by-one-second errors), unless the with_usec argument + # is set to true. + # + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # travel 1.day + # Time.current # => Sun, 10 Nov 2013 15:34:49 EST -05:00 + # Date.current # => Sun, 10 Nov 2013 + # DateTime.current # => Sun, 10 Nov 2013 15:34:49 -0500 + # + # This method also accepts a block, which will return the current time back to its original + # state at the end of the block: + # + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # travel 1.day do + # User.create.created_at # => Sun, 10 Nov 2013 15:34:49 EST -05:00 + # end + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # + # source://activesupport//lib/active_support/testing/time_helpers.rb#97 + def travel(duration, with_usec: T.unsafe(nil), &block); end + + # Returns the current time back to its original state, by removing the stubs added by + # +travel+, +travel_to+, and +freeze_time+. + # + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # + # travel_to Time.zone.local(2004, 11, 24, 1, 4, 44) + # Time.current # => Wed, 24 Nov 2004 01:04:44 EST -05:00 + # + # travel_back + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # + # This method also accepts a block, which brings the stubs back at the end of the block: + # + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # + # travel_to Time.zone.local(2004, 11, 24, 1, 4, 44) + # Time.current # => Wed, 24 Nov 2004 01:04:44 EST -05:00 + # + # travel_back do + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # end + # + # Time.current # => Wed, 24 Nov 2004 01:04:44 EST -05:00 + # + # source://activesupport//lib/active_support/testing/time_helpers.rb#231 + def travel_back; end + + # Changes current time to the given time by stubbing +Time.now+, +Time.new+, + # +Date.today+, and +DateTime.now+ to return the time or date passed into this method. + # The stubs are automatically removed at the end of the test. + # + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # travel_to Time.zone.local(2004, 11, 24, 1, 4, 44) + # Time.current # => Wed, 24 Nov 2004 01:04:44 EST -05:00 + # Date.current # => Wed, 24 Nov 2004 + # DateTime.current # => Wed, 24 Nov 2004 01:04:44 -0500 + # + # Dates are taken as their timestamp at the beginning of the day in the + # application time zone. Time.current returns said timestamp, + # and Time.now its equivalent in the system time zone. Similarly, + # Date.current returns a date equal to the argument, and + # Date.today the date according to Time.now, which may + # be different. (Note that you rarely want to deal with Time.now, + # or Date.today, in order to honor the application time zone + # please always use Time.current and Date.current.) + # + # Note that the usec for the time passed will be set to 0 to prevent rounding + # errors with external services, like MySQL (which will round instead of floor, + # leading to off-by-one-second errors), unless the with_usec argument + # is set to true. + # + # This method also accepts a block, which will return the current time back to its original + # state at the end of the block: + # + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # travel_to Time.zone.local(2004, 11, 24, 1, 4, 44) do + # Time.current # => Wed, 24 Nov 2004 01:04:44 EST -05:00 + # end + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # + # source://activesupport//lib/active_support/testing/time_helpers.rb#133 + def travel_to(date_or_time, with_usec: T.unsafe(nil)); end + + # Returns the current time back to its original state, by removing the stubs added by + # +travel+, +travel_to+, and +freeze_time+. + # + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # + # travel_to Time.zone.local(2004, 11, 24, 1, 4, 44) + # Time.current # => Wed, 24 Nov 2004 01:04:44 EST -05:00 + # + # travel_back + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # + # This method also accepts a block, which brings the stubs back at the end of the block: + # + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # + # travel_to Time.zone.local(2004, 11, 24, 1, 4, 44) + # Time.current # => Wed, 24 Nov 2004 01:04:44 EST -05:00 + # + # travel_back do + # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 + # end + # + # Time.current # => Wed, 24 Nov 2004 01:04:44 EST -05:00 + # + # source://activesupport//lib/active_support/testing/time_helpers.rb#239 + def unfreeze_time; end + + private + + # Returns the value of attribute in_block. + # + # source://activesupport//lib/active_support/testing/time_helpers.rb#270 + def in_block; end + + # Sets the attribute in_block + # + # @param value the value to set the attribute in_block to. + # + # source://activesupport//lib/active_support/testing/time_helpers.rb#270 + def in_block=(_arg0); end + + # source://activesupport//lib/active_support/testing/time_helpers.rb#266 + def simple_stubs; end +end + +# = Active Support \Time With Zone +# +# A Time-like class that can represent a time in any time zone. Necessary +# because standard Ruby Time instances are limited to UTC and the +# system's ENV['TZ'] zone. +# +# You shouldn't ever need to create a TimeWithZone instance directly via +new+. +# Instead use methods +local+, +parse+, +at+, and +now+ on TimeZone instances, +# and +in_time_zone+ on Time and DateTime instances. +# +# Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' +# Time.zone.local(2007, 2, 10, 15, 30, 45) # => Sat, 10 Feb 2007 15:30:45.000000000 EST -05:00 +# Time.zone.parse('2007-02-10 15:30:45') # => Sat, 10 Feb 2007 15:30:45.000000000 EST -05:00 +# Time.zone.at(1171139445) # => Sat, 10 Feb 2007 15:30:45.000000000 EST -05:00 +# Time.zone.now # => Sun, 18 May 2008 13:07:55.754107581 EDT -04:00 +# Time.utc(2007, 2, 10, 20, 30, 45).in_time_zone # => Sat, 10 Feb 2007 15:30:45.000000000 EST -05:00 +# +# See Time and TimeZone for further documentation of these methods. +# +# TimeWithZone instances implement the same API as Ruby Time instances, so +# that Time and TimeWithZone instances are interchangeable. +# +# t = Time.zone.now # => Sun, 18 May 2008 13:27:25.031505668 EDT -04:00 +# t.hour # => 13 +# t.dst? # => true +# t.utc_offset # => -14400 +# t.zone # => "EDT" +# t.to_fs(:rfc822) # => "Sun, 18 May 2008 13:27:25 -0400" +# t + 1.day # => Mon, 19 May 2008 13:27:25.031505668 EDT -04:00 +# t.beginning_of_year # => Tue, 01 Jan 2008 00:00:00.000000000 EST -05:00 +# t > Time.utc(1999) # => true +# t.is_a?(Time) # => true +# t.is_a?(ActiveSupport::TimeWithZone) # => true +# +# source://activesupport//lib/active_support/time_with_zone.rb#44 +class ActiveSupport::TimeWithZone + include ::DateAndTime::Compatibility + include ::Comparable + + # @return [TimeWithZone] a new instance of TimeWithZone + # + # source://activesupport//lib/active_support/time_with_zone.rb#51 + def initialize(utc_time, time_zone, local_time = T.unsafe(nil), period = T.unsafe(nil)); end + + # Adds an interval of time to the current object's time and returns that + # value as a new TimeWithZone object. + # + # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' + # now = Time.zone.now # => Sun, 02 Nov 2014 01:26:28.725182881 EDT -04:00 + # now + 1000 # => Sun, 02 Nov 2014 01:43:08.725182881 EDT -04:00 + # + # If we're adding a Duration of variable length (i.e., years, months, days), + # move forward from #time, otherwise move forward from #utc, for accuracy + # when moving across DST boundaries. + # + # For instance, a time + 24.hours will advance exactly 24 hours, while a + # time + 1.day will advance 23-25 hours, depending on the day. + # + # now + 24.hours # => Mon, 03 Nov 2014 00:26:28.725182881 EST -05:00 + # now + 1.day # => Mon, 03 Nov 2014 01:26:28.725182881 EST -05:00 + # + # source://activesupport//lib/active_support/time_with_zone.rb#310 + def +(other); end + + # Subtracts an interval of time and returns a new TimeWithZone object unless + # the other value +acts_like?+ time. In which case, it will subtract the + # other time and return the difference in seconds as a Float. + # + # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' + # now = Time.zone.now # => Mon, 03 Nov 2014 00:26:28.725182881 EST -05:00 + # now - 1000 # => Mon, 03 Nov 2014 00:09:48.725182881 EST -05:00 + # + # If subtracting a Duration of variable length (i.e., years, months, days), + # move backward from #time, otherwise move backward from #utc, for accuracy + # when moving across DST boundaries. + # + # For instance, a time - 24.hours will go subtract exactly 24 hours, while a + # time - 1.day will subtract 23-25 hours, depending on the day. + # + # now - 24.hours # => Sun, 02 Nov 2014 01:26:28.725182881 EDT -04:00 + # now - 1.day # => Sun, 02 Nov 2014 00:26:28.725182881 EDT -04:00 + # + # If both the TimeWithZone object and the other value act like Time, a Float + # will be returned. + # + # Time.zone.now - 1.day.ago # => 86399.999967 + # + # source://activesupport//lib/active_support/time_with_zone.rb#345 + def -(other); end + + # Use the time in UTC for comparisons. + # + # source://activesupport//lib/active_support/time_with_zone.rb#243 + def <=>(other); end + + # So that +self+ acts_like?(:time). + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/time_with_zone.rb#502 + def acts_like_time?; end + + # Uses Date to provide precise Time calculations for years, months, and days + # according to the proleptic Gregorian calendar. The result is returned as a + # new TimeWithZone object. + # + # The +options+ parameter takes a hash with any of these keys: + # :years, :months, :weeks, :days, + # :hours, :minutes, :seconds. + # + # If advancing by a value of variable length (i.e., years, weeks, months, + # days), move forward from #time, otherwise move forward from #utc, for + # accuracy when moving across DST boundaries. + # + # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' + # now = Time.zone.now # => Sun, 02 Nov 2014 01:26:28.558049687 EDT -04:00 + # now.advance(seconds: 1) # => Sun, 02 Nov 2014 01:26:29.558049687 EDT -04:00 + # now.advance(minutes: 1) # => Sun, 02 Nov 2014 01:27:28.558049687 EDT -04:00 + # now.advance(hours: 1) # => Sun, 02 Nov 2014 01:26:28.558049687 EST -05:00 + # now.advance(days: 1) # => Mon, 03 Nov 2014 01:26:28.558049687 EST -05:00 + # now.advance(weeks: 1) # => Sun, 09 Nov 2014 01:26:28.558049687 EST -05:00 + # now.advance(months: 1) # => Tue, 02 Dec 2014 01:26:28.558049687 EST -05:00 + # now.advance(years: 1) # => Mon, 02 Nov 2015 01:26:28.558049687 EST -05:00 + # + # source://activesupport//lib/active_support/time_with_zone.rb#434 + def advance(options); end + + # source://activesupport//lib/active_support/time_with_zone.rb#247 + def after?(_arg0); end + + # Subtracts an interval of time from the current object's time and returns + # the result as a new TimeWithZone object. + # + # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' + # now = Time.zone.now # => Mon, 03 Nov 2014 00:26:28.725182881 EST -05:00 + # now.ago(1000) # => Mon, 03 Nov 2014 00:09:48.725182881 EST -05:00 + # + # If we're subtracting a Duration of variable length (i.e., years, months, + # days), move backward from #time, otherwise move backward from #utc, for + # accuracy when moving across DST boundaries. + # + # For instance, time.ago(24.hours) will move back exactly 24 hours, + # while time.ago(1.day) will move back 23-25 hours, depending on + # the day. + # + # now.ago(24.hours) # => Sun, 02 Nov 2014 01:26:28.725182881 EDT -04:00 + # now.ago(1.day) # => Sun, 02 Nov 2014 00:26:28.725182881 EDT -04:00 + # + # source://activesupport//lib/active_support/time_with_zone.rb#373 + def ago(other); end + + # Coerces time to a string for JSON encoding. The default format is ISO 8601. + # You can get %Y/%m/%d %H:%M:%S +offset style by setting + # ActiveSupport::JSON::Encoding.use_standard_json_time_format + # to +false+. + # + # # With ActiveSupport::JSON::Encoding.use_standard_json_time_format = true + # Time.utc(2005,2,1,15,15,10).in_time_zone("Hawaii").as_json + # # => "2005-02-01T05:15:10.000-10:00" + # + # # With ActiveSupport::JSON::Encoding.use_standard_json_time_format = false + # Time.utc(2005,2,1,15,15,10).in_time_zone("Hawaii").as_json + # # => "2005/02/01 05:15:10 -1000" + # + # source://activesupport//lib/active_support/time_with_zone.rb#178 + def as_json(options = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/time_with_zone.rb#246 + def before?(_arg0); end + + # Returns true if the current object's time is within the specified + # +min+ and +max+ time. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/time_with_zone.rb#251 + def between?(min, max); end + + # An instance of ActiveSupport::TimeWithZone is never blank + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/time_with_zone.rb#513 + def blank?; end + + # Returns a new +ActiveSupport::TimeWithZone+ where one or more of the elements have + # been changed according to the +options+ parameter. The time options (:hour, + # :min, :sec, :usec, :nsec) reset cascadingly, + # so if only the hour is passed, then minute, sec, usec, and nsec is set to 0. If the + # hour and minute is passed, then sec, usec, and nsec is set to 0. The +options+ + # parameter takes a hash with any of these keys: :year, :month, + # :day, :hour, :min, :sec, :usec, + # :nsec, :offset, :zone. Pass either :usec + # or :nsec, not both. Similarly, pass either :zone or + # :offset, not both. + # + # t = Time.zone.now # => Fri, 14 Apr 2017 11:45:15.116992711 EST -05:00 + # t.change(year: 2020) # => Tue, 14 Apr 2020 11:45:15.116992711 EST -05:00 + # t.change(hour: 12) # => Fri, 14 Apr 2017 12:00:00.000000000 EST -05:00 + # t.change(min: 30) # => Fri, 14 Apr 2017 11:30:00.000000000 EST -05:00 + # t.change(offset: "-10:00") # => Fri, 14 Apr 2017 11:45:15.116992711 HST -10:00 + # t.change(zone: "Hawaii") # => Fri, 14 Apr 2017 11:45:15.116992711 HST -10:00 + # + # source://activesupport//lib/active_support/time_with_zone.rb#394 + def change(options); end + + # Returns a Time instance of the simultaneous time in the UTC timezone. + # + # source://activesupport//lib/active_support/time_with_zone.rb#72 + def comparable_time; end + + # source://activesupport//lib/active_support/time_with_zone.rb#445 + def day; end + + # Returns true if the current time is within Daylight Savings \Time for the + # specified time zone. + # + # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' + # Time.zone.parse("2012-5-30").dst? # => true + # Time.zone.parse("2012-11-30").dst? # => false + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/time_with_zone.rb#100 + def dst?; end + + # source://activesupport//lib/active_support/time_with_zone.rb#190 + def encode_with(coder); end + + # Returns +true+ if +other+ is equal to current object. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/time_with_zone.rb#286 + def eql?(other); end + + # Returns a formatted string of the offset from UTC, or an alternative + # string if the time zone is already UTC. + # + # Time.zone = 'Eastern Time (US & Canada)' # => "Eastern Time (US & Canada)" + # Time.zone.now.formatted_offset(true) # => "-05:00" + # Time.zone.now.formatted_offset(false) # => "-0500" + # Time.zone = 'UTC' # => "UTC" + # Time.zone.now.formatted_offset(true, "0") # => "0" + # + # source://activesupport//lib/active_support/time_with_zone.rb#131 + def formatted_offset(colon = T.unsafe(nil), alternate_utc_string = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/time_with_zone.rb#521 + def freeze; end + + # Returns true if the current object's time is in the future. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/time_with_zone.rb#281 + def future?; end + + # Returns a Time instance of the simultaneous time in the UTC timezone. + # + # source://activesupport//lib/active_support/time_with_zone.rb#73 + def getgm; end + + # Returns a Time instance of the simultaneous time in the system timezone. + # + # source://activesupport//lib/active_support/time_with_zone.rb#92 + def getlocal(utc_offset = T.unsafe(nil)); end + + # Returns a Time instance of the simultaneous time in the UTC timezone. + # + # source://activesupport//lib/active_support/time_with_zone.rb#74 + def getutc; end + + # Returns true if the current time zone is set to UTC. + # + # Time.zone = 'UTC' # => 'UTC' + # Time.zone.now.utc? # => true + # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' + # Time.zone.now.utc? # => false + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/time_with_zone.rb#114 + def gmt?; end + + # Returns the offset from current time to UTC time in seconds. + # + # source://activesupport//lib/active_support/time_with_zone.rb#120 + def gmt_offset; end + + # Returns a Time instance of the simultaneous time in the UTC timezone. + # + # source://activesupport//lib/active_support/time_with_zone.rb#75 + def gmtime; end + + # Returns the offset from current time to UTC time in seconds. + # + # source://activesupport//lib/active_support/time_with_zone.rb#121 + def gmtoff; end + + # source://activesupport//lib/active_support/time_with_zone.rb#290 + def hash; end + + # source://activesupport//lib/active_support/time_with_zone.rb#445 + def hour; end + + # Returns a string of the object's date and time in the format used by + # HTTP requests. + # + # Time.zone.now.httpdate # => "Tue, 01 Jan 2013 04:39:43 GMT" + # + # source://activesupport//lib/active_support/time_with_zone.rb#198 + def httpdate; end + + # Adds an interval of time to the current object's time and returns that + # value as a new TimeWithZone object. + # + # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' + # now = Time.zone.now # => Sun, 02 Nov 2014 01:26:28.725182881 EDT -04:00 + # now + 1000 # => Sun, 02 Nov 2014 01:43:08.725182881 EDT -04:00 + # + # If we're adding a Duration of variable length (i.e., years, months, days), + # move forward from #time, otherwise move forward from #utc, for accuracy + # when moving across DST boundaries. + # + # For instance, a time + 24.hours will advance exactly 24 hours, while a + # time + 1.day will advance 23-25 hours, depending on the day. + # + # now + 24.hours # => Mon, 03 Nov 2014 00:26:28.725182881 EST -05:00 + # now + 1.day # => Mon, 03 Nov 2014 01:26:28.725182881 EST -05:00 + # + # source://activesupport//lib/active_support/time_with_zone.rb#320 + def in(other); end + + # Returns the simultaneous time in Time.zone, or the specified zone. + # + # source://activesupport//lib/active_support/time_with_zone.rb#83 + def in_time_zone(new_zone = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/time_with_zone.rb#186 + def init_with(coder); end + + # Returns a string of the object's date, time, zone, and offset from UTC. + # + # Time.zone.now.inspect # => "2024-11-13 07:00:10.528054960 UTC +00:00" + # + # source://activesupport//lib/active_support/time_with_zone.rb#146 + def inspect; end + + # Say we're a Time to thwart type checking. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/time_with_zone.rb#507 + def is_a?(klass); end + + # Returns true if the current time is within Daylight Savings \Time for the + # specified time zone. + # + # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' + # Time.zone.parse("2012-5-30").dst? # => true + # Time.zone.parse("2012-11-30").dst? # => false + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/time_with_zone.rb#103 + def isdst; end + + # Returns a string of the object's date and time in the ISO 8601 standard + # format. + # + # Time.zone.now.xmlschema # => "2014-12-04T11:02:37-05:00" + # + # source://activesupport//lib/active_support/time_with_zone.rb#163 + def iso8601(fraction_digits = T.unsafe(nil)); end + + # Say we're a Time to thwart type checking. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/time_with_zone.rb#510 + def kind_of?(klass); end + + # Returns a Time instance of the simultaneous time in the system timezone. + # + # source://activesupport//lib/active_support/time_with_zone.rb#89 + def localtime(utc_offset = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/time_with_zone.rb#527 + def marshal_dump; end + + # source://activesupport//lib/active_support/time_with_zone.rb#531 + def marshal_load(variables); end + + # source://activesupport//lib/active_support/time_with_zone.rb#445 + def mday; end + + # Send the missing method to +time+ instance, and wrap result in a new + # TimeWithZone with the existing +time_zone+. + # + # source://activesupport//lib/active_support/time_with_zone.rb#551 + def method_missing(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/time_with_zone.rb#445 + def min; end + + # source://activesupport//lib/active_support/time_with_zone.rb#445 + def mon; end + + # source://activesupport//lib/active_support/time_with_zone.rb#445 + def month; end + + # Returns true if the current object's time falls within + # the next day (tomorrow). + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/time_with_zone.rb#271 + def next_day?; end + + # source://activesupport//lib/active_support/time_with_zone.rb#445 + def nsec; end + + # Returns true if the current object's time is in the past. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/time_with_zone.rb#256 + def past?; end + + # Returns the underlying +TZInfo::TimezonePeriod+. + # + # source://activesupport//lib/active_support/time_with_zone.rb#78 + def period; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/time_with_zone.rb#517 + def present?; end + + # Returns true if the current object's time falls within + # the previous day (yesterday). + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/time_with_zone.rb#278 + def prev_day?; end + + # respond_to_missing? is not called in some cases, such as when type conversion is + # performed with Kernel#String + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/time_with_zone.rb#537 + def respond_to?(sym, include_priv = T.unsafe(nil)); end + + # Returns a string of the object's date and time in the RFC 2822 standard + # format. + # + # Time.zone.now.rfc2822 # => "Tue, 01 Jan 2013 04:51:39 +0000" + # + # source://activesupport//lib/active_support/time_with_zone.rb#206 + def rfc2822; end + + # Returns a string of the object's date and time in the ISO 8601 standard + # format. + # + # Time.zone.now.xmlschema # => "2014-12-04T11:02:37-05:00" + # + # source://activesupport//lib/active_support/time_with_zone.rb#164 + def rfc3339(fraction_digits = T.unsafe(nil)); end + + # Returns a string of the object's date and time in the RFC 2822 standard + # format. + # + # Time.zone.now.rfc2822 # => "Tue, 01 Jan 2013 04:51:39 +0000" + # + # source://activesupport//lib/active_support/time_with_zone.rb#209 + def rfc822; end + + # source://activesupport//lib/active_support/time_with_zone.rb#445 + def sec; end + + # Adds an interval of time to the current object's time and returns that + # value as a new TimeWithZone object. + # + # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' + # now = Time.zone.now # => Sun, 02 Nov 2014 01:26:28.725182881 EDT -04:00 + # now + 1000 # => Sun, 02 Nov 2014 01:43:08.725182881 EDT -04:00 + # + # If we're adding a Duration of variable length (i.e., years, months, days), + # move forward from #time, otherwise move forward from #utc, for accuracy + # when moving across DST boundaries. + # + # For instance, a time + 24.hours will advance exactly 24 hours, while a + # time + 1.day will advance 23-25 hours, depending on the day. + # + # now + 24.hours # => Mon, 03 Nov 2014 00:26:28.725182881 EST -05:00 + # now + 1.day # => Mon, 03 Nov 2014 01:26:28.725182881 EST -05:00 + # + # source://activesupport//lib/active_support/time_with_zone.rb#319 + def since(other); end + + # Replaces %Z directive with +zone before passing to Time#strftime, + # so that zone information is correct. + # + # source://activesupport//lib/active_support/time_with_zone.rb#237 + def strftime(format); end + + # Returns a Time instance that represents the time in +time_zone+. + # + # source://activesupport//lib/active_support/time_with_zone.rb#64 + def time; end + + # Returns the value of attribute time_zone. + # + # source://activesupport//lib/active_support/time_with_zone.rb#49 + def time_zone; end + + # Returns Array of parts of Time in sequence of + # [seconds, minutes, hours, day, month, year, weekday, yearday, dst?, zone]. + # + # now = Time.zone.now # => Tue, 18 Aug 2015 02:29:27.485278555 UTC +00:00 + # now.to_a # => [27, 29, 2, 18, 8, 2015, 2, 230, false, "UTC"] + # + # source://activesupport//lib/active_support/time_with_zone.rb#457 + def to_a; end + + # source://activesupport//lib/active_support/time_with_zone.rb#445 + def to_date; end + + # Returns an instance of DateTime with the timezone's UTC offset + # + # Time.zone.now.to_datetime # => Tue, 18 Aug 2015 02:32:20 +0000 + # Time.current.in_time_zone('Hawaii').to_datetime # => Mon, 17 Aug 2015 16:32:20 -1000 + # + # source://activesupport//lib/active_support/time_with_zone.rb#490 + def to_datetime; end + + # Returns the object's date and time as a floating-point number of seconds + # since the Epoch (January 1, 1970 00:00 UTC). + # + # Time.zone.now.to_f # => 1417709320.285418 + # + # source://activesupport//lib/active_support/time_with_zone.rb#465 + def to_f; end + + # Returns a string of the object's date and time. + # + # This method is aliased to to_formatted_s. + # + # Accepts an optional format: + # * :default - default value, mimics Ruby Time#to_s format. + # * :db - format outputs time in UTC :db time. See Time#to_fs(:db). + # * Any key in +Time::DATE_FORMATS+ can be used. See active_support/core_ext/time/conversions.rb. + # + # source://activesupport//lib/active_support/time_with_zone.rb#233 + def to_formatted_s(format = T.unsafe(nil)); end + + # Returns a string of the object's date and time. + # + # This method is aliased to to_formatted_s. + # + # Accepts an optional format: + # * :default - default value, mimics Ruby Time#to_s format. + # * :db - format outputs time in UTC :db time. See Time#to_fs(:db). + # * Any key in +Time::DATE_FORMATS+ can be used. See active_support/core_ext/time/conversions.rb. + # + # source://activesupport//lib/active_support/time_with_zone.rb#224 + def to_fs(format = T.unsafe(nil)); end + + # Returns the object's date and time as an integer number of seconds + # since the Epoch (January 1, 1970 00:00 UTC). + # + # Time.zone.now.to_i # => 1417709320 + # + # source://activesupport//lib/active_support/time_with_zone.rb#473 + def to_i; end + + # Returns the object's date and time as a rational number of seconds + # since the Epoch (January 1, 1970 00:00 UTC). + # + # Time.zone.now.to_r # => (708854548642709/500000) + # + # source://activesupport//lib/active_support/time_with_zone.rb#482 + def to_r; end + + # Returns a string of the object's date and time. + # + # source://activesupport//lib/active_support/time_with_zone.rb#212 + def to_s; end + + # Returns an instance of +Time+, either with the same timezone as +self+, + # with the same UTC offset as +self+ or in the local system timezone + # depending on the setting of +ActiveSupport.to_time_preserves_timezone+. + # + # source://activesupport//lib/active_support/time_with_zone.rb#497 + def to_time; end + + # Returns true if the current object's time falls within + # the current day. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/time_with_zone.rb#262 + def today?; end + + # Returns true if the current object's time falls within + # the next day (tomorrow). + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/time_with_zone.rb#268 + def tomorrow?; end + + # Returns the object's date and time as an integer number of seconds + # since the Epoch (January 1, 1970 00:00 UTC). + # + # Time.zone.now.to_i # => 1417709320 + # + # source://activesupport//lib/active_support/time_with_zone.rb#476 + def tv_sec; end + + # source://activesupport//lib/active_support/time_with_zone.rb#445 + def usec; end + + # Returns a Time instance of the simultaneous time in the UTC timezone. + # + # source://activesupport//lib/active_support/time_with_zone.rb#69 + def utc; end + + # Returns true if the current time zone is set to UTC. + # + # Time.zone = 'UTC' # => 'UTC' + # Time.zone.now.utc? # => true + # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' + # Time.zone.now.utc? # => false + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/time_with_zone.rb#111 + def utc?; end + + # Returns the offset from current time to UTC time in seconds. + # + # source://activesupport//lib/active_support/time_with_zone.rb#117 + def utc_offset; end + + # source://activesupport//lib/active_support/time_with_zone.rb#445 + def wday; end + + # Returns a string of the object's date and time in the ISO 8601 standard + # format. + # + # Time.zone.now.xmlschema # => "2014-12-04T11:02:37-05:00" + # + # source://activesupport//lib/active_support/time_with_zone.rb#154 + def xmlschema(fraction_digits = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/time_with_zone.rb#445 + def yday; end + + # source://activesupport//lib/active_support/time_with_zone.rb#445 + def year; end + + # Returns true if the current object's time falls within + # the previous day (yesterday). + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/time_with_zone.rb#275 + def yesterday?; end + + # Returns the time zone abbreviation. + # + # Time.zone = 'Eastern Time (US & Canada)' # => "Eastern Time (US & Canada)" + # Time.zone.now.zone # => "EST" + # + # source://activesupport//lib/active_support/time_with_zone.rb#139 + def zone; end + + private + + # @return [Boolean] + # + # source://activesupport//lib/active_support/time_with_zone.rb#589 + def duration_of_variable_length?(obj); end + + # source://activesupport//lib/active_support/time_with_zone.rb#570 + def get_period_and_ensure_valid_local_time(period); end + + # source://activesupport//lib/active_support/time_with_zone.rb#560 + def incorporate_utc_offset(time, offset); end + + # Ensure proxy class responds to all methods that underlying time instance + # responds to. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/time_with_zone.rb#545 + def respond_to_missing?(sym, include_priv); end + + # source://activesupport//lib/active_support/time_with_zone.rb#583 + def transfer_time_values_to_utc_constructor(time); end + + # source://activesupport//lib/active_support/time_with_zone.rb#593 + def wrap_with_time_zone(time); end +end + +# source://activesupport//lib/active_support/time_with_zone.rb#45 +ActiveSupport::TimeWithZone::PRECISIONS = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/time_with_zone.rb#558 +ActiveSupport::TimeWithZone::SECONDS_PER_DAY = T.let(T.unsafe(nil), Integer) + +# = Active Support \Time Zone +# +# The TimeZone class serves as a wrapper around +TZInfo::Timezone+ instances. +# It allows us to do the following: +# +# * Limit the set of zones provided by TZInfo to a meaningful subset of 134 +# zones. +# * Retrieve and display zones with a friendlier name +# (e.g., "Eastern \Time (US & Canada)" instead of "America/New_York"). +# * Lazily load +TZInfo::Timezone+ instances only when they're needed. +# * Create ActiveSupport::TimeWithZone instances via TimeZone's +local+, +# +parse+, +at+, and +now+ methods. +# +# If you set config.time_zone in the \Rails Application, you can +# access this TimeZone object via Time.zone: +# +# # application.rb: +# class Application < Rails::Application +# config.time_zone = 'Eastern Time (US & Canada)' +# end +# +# Time.zone # => # +# Time.zone.name # => "Eastern Time (US & Canada)" +# Time.zone.now # => Sun, 18 May 2008 14:30:44 EDT -04:00 +# +# source://activesupport//lib/active_support/values/time_zone.rb#31 +class ActiveSupport::TimeZone + include ::Comparable + + # :stopdoc: + # + # @return [TimeZone] a new instance of TimeZone + # + # source://activesupport//lib/active_support/values/time_zone.rb#310 + def initialize(name, utc_offset = T.unsafe(nil), tzinfo = T.unsafe(nil)); end + + # Compare this time zone to the parameter. The two are compared first on + # their offsets, and then by name. + # + # source://activesupport//lib/active_support/values/time_zone.rb#340 + def <=>(zone); end + + # Compare #name and TZInfo identifier to a supplied regexp, returning +true+ + # if a match is found. + # + # source://activesupport//lib/active_support/values/time_zone.rb#349 + def =~(re); end + + # source://activesupport//lib/active_support/values/time_zone.rb#574 + def abbr(time); end + + # \Method for creating new ActiveSupport::TimeWithZone instance in time zone + # of +self+ from number of seconds since the Unix epoch. + # + # Time.zone = 'Hawaii' # => "Hawaii" + # Time.utc(2000).to_f # => 946684800.0 + # Time.zone.at(946684800.0) # => Fri, 31 Dec 1999 14:00:00 HST -10:00 + # + # A second argument can be supplied to specify sub-second precision. + # + # Time.zone = 'Hawaii' # => "Hawaii" + # Time.at(946684800, 123456.789).nsec # => 123456789 + # + # source://activesupport//lib/active_support/values/time_zone.rb#386 + def at(*args); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/values/time_zone.rb#578 + def dst?(time); end + + # source://activesupport//lib/active_support/values/time_zone.rb#586 + def encode_with(coder); end + + # Returns a formatted string of the offset from UTC, or an alternative + # string if the time zone is already UTC. + # + # zone = ActiveSupport::TimeZone['Central Time (US & Canada)'] + # zone.formatted_offset # => "-06:00" + # zone.formatted_offset(false) # => "-0600" + # + # source://activesupport//lib/active_support/values/time_zone.rb#334 + def formatted_offset(colon = T.unsafe(nil), alternate_utc_string = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/values/time_zone.rb#582 + def init_with(coder); end + + # \Method for creating new ActiveSupport::TimeWithZone instance in time zone + # of +self+ from an ISO 8601 string. + # + # Time.zone = 'Hawaii' # => "Hawaii" + # Time.zone.iso8601('1999-12-31T14:00:00') # => Fri, 31 Dec 1999 14:00:00 HST -10:00 + # + # If the time components are missing then they will be set to zero. + # + # Time.zone = 'Hawaii' # => "Hawaii" + # Time.zone.iso8601('1999-12-31') # => Fri, 31 Dec 1999 00:00:00 HST -10:00 + # + # If the string is invalid then an +ArgumentError+ will be raised unlike +parse+ + # which usually returns +nil+ when given an invalid date string. + # + # source://activesupport//lib/active_support/values/time_zone.rb#403 + def iso8601(str); end + + # \Method for creating new ActiveSupport::TimeWithZone instance in time zone + # of +self+ from given values. + # + # Time.zone = 'Hawaii' # => "Hawaii" + # Time.zone.local(2007, 2, 1, 15, 30, 45) # => Thu, 01 Feb 2007 15:30:45 HST -10:00 + # + # source://activesupport//lib/active_support/values/time_zone.rb#370 + def local(*args); end + + # Adjust the given time to the simultaneous time in UTC. Returns a + # Time.utc() instance. + # + # source://activesupport//lib/active_support/values/time_zone.rb#558 + def local_to_utc(time, dst = T.unsafe(nil)); end + + # Compare #name and TZInfo identifier to a supplied regexp, returning +true+ + # if a match is found. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/values/time_zone.rb#355 + def match?(re); end + + # Returns the value of attribute name. + # + # source://activesupport//lib/active_support/values/time_zone.rb#297 + def name; end + + # Returns an ActiveSupport::TimeWithZone instance representing the current + # time in the time zone represented by +self+. + # + # Time.zone = 'Hawaii' # => "Hawaii" + # Time.zone.now # => Wed, 23 Jan 2008 20:24:27 HST -10:00 + # + # source://activesupport//lib/active_support/values/time_zone.rb#523 + def now; end + + # \Method for creating new ActiveSupport::TimeWithZone instance in time zone + # of +self+ from parsed string. + # + # Time.zone = 'Hawaii' # => "Hawaii" + # Time.zone.parse('1999-12-31 14:00:00') # => Fri, 31 Dec 1999 14:00:00 HST -10:00 + # + # If upper components are missing from the string, they are supplied from + # TimeZone#now: + # + # Time.zone.now # => Fri, 31 Dec 1999 14:00:00 HST -10:00 + # Time.zone.parse('22:30:00') # => Fri, 31 Dec 1999 22:30:00 HST -10:00 + # + # However, if the date component is not provided, but any other upper + # components are supplied, then the day of the month defaults to 1: + # + # Time.zone.parse('Mar 2000') # => Wed, 01 Mar 2000 00:00:00 HST -10:00 + # + # If the string is invalid then an +ArgumentError+ could be raised. + # + # source://activesupport//lib/active_support/values/time_zone.rb#460 + def parse(str, now = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/values/time_zone.rb#566 + def period_for_local(time, dst = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/values/time_zone.rb#562 + def period_for_utc(time); end + + # source://activesupport//lib/active_support/values/time_zone.rb#570 + def periods_for_local(time); end + + # \Method for creating new ActiveSupport::TimeWithZone instance in time zone + # of +self+ from an RFC 3339 string. + # + # Time.zone = 'Hawaii' # => "Hawaii" + # Time.zone.rfc3339('2000-01-01T00:00:00Z') # => Fri, 31 Dec 1999 14:00:00 HST -10:00 + # + # If the time or zone components are missing then an +ArgumentError+ will + # be raised. This is much stricter than either +parse+ or +iso8601+ which + # allow for missing components. + # + # Time.zone = 'Hawaii' # => "Hawaii" + # Time.zone.rfc3339('1999-12-31') # => ArgumentError: invalid date + # + # @raise [ArgumentError] + # + # source://activesupport//lib/active_support/values/time_zone.rb#476 + def rfc3339(str); end + + # Returns a standard time zone name defined by IANA + # https://www.iana.org/time-zones + # + # source://activesupport//lib/active_support/values/time_zone.rb#319 + def standard_name; end + + # Parses +str+ according to +format+ and returns an ActiveSupport::TimeWithZone. + # + # Assumes that +str+ is a time in the time zone +self+, + # unless +format+ includes an explicit time zone. + # (This is the same behavior as +parse+.) + # In either case, the returned TimeWithZone has the timezone of +self+. + # + # Time.zone = 'Hawaii' # => "Hawaii" + # Time.zone.strptime('1999-12-31 14:00:00', '%Y-%m-%d %H:%M:%S') # => Fri, 31 Dec 1999 14:00:00 HST -10:00 + # + # If upper components are missing from the string, they are supplied from + # TimeZone#now: + # + # Time.zone.now # => Fri, 31 Dec 1999 14:00:00 HST -10:00 + # Time.zone.strptime('22:30:00', '%H:%M:%S') # => Fri, 31 Dec 1999 22:30:00 HST -10:00 + # + # However, if the date component is not provided, but any other upper + # components are supplied, then the day of the month defaults to 1: + # + # Time.zone.strptime('Mar 2000', '%b %Y') # => Wed, 01 Mar 2000 00:00:00 HST -10:00 + # + # source://activesupport//lib/active_support/values/time_zone.rb#514 + def strptime(str, format, now = T.unsafe(nil)); end + + # Returns a textual representation of this time zone. + # + # source://activesupport//lib/active_support/values/time_zone.rb#361 + def to_s; end + + # Returns the current date in this time zone. + # + # source://activesupport//lib/active_support/values/time_zone.rb#528 + def today; end + + # Returns the next date in this time zone. + # + # source://activesupport//lib/active_support/values/time_zone.rb#533 + def tomorrow; end + + # Returns the value of attribute tzinfo. + # + # source://activesupport//lib/active_support/values/time_zone.rb#298 + def tzinfo; end + + # Returns the offset of this time zone from UTC in seconds. + # + # source://activesupport//lib/active_support/values/time_zone.rb#324 + def utc_offset; end + + # Adjust the given time to the simultaneous time in the time zone + # represented by +self+. Returns a local time with the appropriate offset + # -- if you want an ActiveSupport::TimeWithZone instance, use + # Time#in_time_zone() instead. + # + # As of tzinfo 2, utc_to_local returns a Time with a non-zero utc_offset. + # See the +utc_to_local_returns_utc_offset_times+ config for more info. + # + # source://activesupport//lib/active_support/values/time_zone.rb#549 + def utc_to_local(time); end + + # Returns the previous date in this time zone. + # + # source://activesupport//lib/active_support/values/time_zone.rb#538 + def yesterday; end + + private + + # @raise [ArgumentError] + # + # source://activesupport//lib/active_support/values/time_zone.rb#592 + def parts_to_time(parts, now); end + + # source://activesupport//lib/active_support/values/time_zone.rb#617 + def time_now; end + + class << self + # Locate a specific time zone object. If the argument is a string, it + # is interpreted to mean the name of the timezone to locate. If it is a + # numeric value it is either the hour offset, or the second offset, of the + # timezone to find. (The first one with that offset will be returned.) + # Returns +nil+ if no such time zone is known to the system. + # + # source://activesupport//lib/active_support/values/time_zone.rb#233 + def [](arg); end + + # Returns an array of all TimeZone objects. There are multiple + # TimeZone objects per time zone, in many cases, to make it easier + # for users to find their own time zone. + # + # source://activesupport//lib/active_support/values/time_zone.rb#224 + def all; end + + # source://activesupport//lib/active_support/values/time_zone.rb#266 + def clear; end + + # A convenience method for returning a collection of TimeZone objects + # for time zones in the country specified by its ISO 3166-1 Alpha2 code. + # + # source://activesupport//lib/active_support/values/time_zone.rb#261 + def country_zones(country_code); end + + # source://activesupport//lib/active_support/values/time_zone.rb#212 + def create(*_arg0); end + + # source://activesupport//lib/active_support/values/time_zone.rb#208 + def find_tzinfo(name); end + + # Returns a TimeZone instance with the given name, or +nil+ if no + # such TimeZone instance exists. (This exists to support the use of + # this class with the +composed_of+ macro.) + # + # source://activesupport//lib/active_support/values/time_zone.rb#217 + def new(name); end + + # Assumes self represents an offset from UTC in seconds (as returned from + # Time#utc_offset) and turns this into an +HH:MM formatted string. + # + # ActiveSupport::TimeZone.seconds_to_utc_offset(-21_600) # => "-06:00" + # + # source://activesupport//lib/active_support/values/time_zone.rb#200 + def seconds_to_utc_offset(seconds, colon = T.unsafe(nil)); end + + # A convenience method for returning a collection of TimeZone objects + # for time zones in the USA. + # + # source://activesupport//lib/active_support/values/time_zone.rb#255 + def us_zones; end + + private + + # source://activesupport//lib/active_support/values/time_zone.rb#274 + def load_country_zones(code); end + + # source://activesupport//lib/active_support/values/time_zone.rb#288 + def zones_map; end + end +end + +# Keys are \Rails TimeZone names, values are TZInfo identifiers. +# +# source://activesupport//lib/active_support/values/time_zone.rb#33 +ActiveSupport::TimeZone::MAPPING = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/values/time_zone.rb#189 +ActiveSupport::TimeZone::UTC_OFFSET_WITHOUT_COLON = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/values/time_zone.rb#188 +ActiveSupport::TimeZone::UTC_OFFSET_WITH_COLON = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/core_ext/object/json.rb#35 +module ActiveSupport::ToJsonWithActiveSupportEncoder + # source://activesupport//lib/active_support/core_ext/object/json.rb#36 + def to_json(options = T.unsafe(nil)); end +end + +# source://activesupport//lib/active_support/core_ext/object/try.rb#6 +module ActiveSupport::Tryable + # source://activesupport//lib/active_support/core_ext/object/try.rb#7 + def try(*args, **_arg1, &block); end + + # source://activesupport//lib/active_support/core_ext/object/try.rb#20 + def try!(*args, **_arg1, &block); end +end + +# source://activesupport//lib/active_support/gem_version.rb#9 +module ActiveSupport::VERSION; end + +# source://activesupport//lib/active_support/gem_version.rb#10 +ActiveSupport::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# source://activesupport//lib/active_support/gem_version.rb#11 +ActiveSupport::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# source://activesupport//lib/active_support/gem_version.rb#13 +ActiveSupport::VERSION::PRE = T.let(T.unsafe(nil), T.untyped) + +# source://activesupport//lib/active_support/gem_version.rb#15 +ActiveSupport::VERSION::STRING = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/gem_version.rb#12 +ActiveSupport::VERSION::TINY = T.let(T.unsafe(nil), Integer) + +# source://activesupport//lib/active_support/core_ext/hash/conversions.rb#140 +class ActiveSupport::XMLConverter + # @return [XMLConverter] a new instance of XMLConverter + # + # source://activesupport//lib/active_support/core_ext/hash/conversions.rb#151 + def initialize(xml, disallowed_types = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/core_ext/hash/conversions.rb#156 + def to_h; end + + private + + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/hash/conversions.rb#222 + def become_array?(value); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/hash/conversions.rb#218 + def become_content?(value); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/hash/conversions.rb#226 + def become_empty_string?(value); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/hash/conversions.rb#232 + def become_hash?(value); end + + # source://activesupport//lib/active_support/core_ext/hash/conversions.rb#172 + def deep_to_h(value); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/hash/conversions.rb#241 + def garbage?(value); end + + # source://activesupport//lib/active_support/core_ext/hash/conversions.rb#161 + def normalize_keys(params); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/hash/conversions.rb#236 + def nothing?(value); end + + # source://activesupport//lib/active_support/core_ext/hash/conversions.rb#257 + def process_array(value); end + + # source://activesupport//lib/active_support/core_ext/hash/conversions.rb#248 + def process_content(value); end + + # source://activesupport//lib/active_support/core_ext/hash/conversions.rb#185 + def process_hash(value); end +end + +# source://activesupport//lib/active_support/core_ext/hash/conversions.rb#149 +ActiveSupport::XMLConverter::DISALLOWED_TYPES = T.let(T.unsafe(nil), Array) + +# Raised if the XML contains attributes with type="yaml" or +# type="symbol". Read Hash#from_xml for more details. +# +# source://activesupport//lib/active_support/core_ext/hash/conversions.rb#143 +class ActiveSupport::XMLConverter::DisallowedType < ::StandardError + # @return [DisallowedType] a new instance of DisallowedType + # + # source://activesupport//lib/active_support/core_ext/hash/conversions.rb#144 + def initialize(type); end +end + +# = \XmlMini +# +# To use the much faster libxml parser: +# gem "libxml-ruby" +# XmlMini.backend = 'LibXML' +# +# source://activesupport//lib/active_support/xml_mini.rb#17 +module ActiveSupport::XmlMini + extend ::ActiveSupport::XmlMini + + # source://activesupport//lib/active_support/xml_mini.rb#102 + def backend; end + + # source://activesupport//lib/active_support/xml_mini.rb#106 + def backend=(name); end + + # Returns the value of attribute depth. + # + # source://activesupport//lib/active_support/xml_mini.rb#97 + def depth; end + + # Sets the attribute depth + # + # @param value the value to set the attribute depth to. + # + # source://activesupport//lib/active_support/xml_mini.rb#97 + def depth=(_arg0); end + + # source://activesupport//lib/active_support/xml_mini.rb#100 + def parse(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/xml_mini.rb#153 + def rename_key(key, options = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/xml_mini.rb#120 + def to_tag(key, value, options); end + + # source://activesupport//lib/active_support/xml_mini.rb#112 + def with_backend(name); end + + private + + # source://activesupport//lib/active_support/xml_mini.rb#164 + def _dasherize(key); end + + # source://activesupport//lib/active_support/xml_mini.rb#170 + def _parse_binary(bin, entity); end + + # source://activesupport//lib/active_support/xml_mini.rb#181 + def _parse_file(file, entity); end + + # source://activesupport//lib/active_support/xml_mini.rb#189 + def _parse_hex_binary(bin); end + + # source://activesupport//lib/active_support/xml_mini.rb#201 + def cast_backend_name_to_module(name); end + + # source://activesupport//lib/active_support/xml_mini.rb#193 + def current_thread_backend; end + + # source://activesupport//lib/active_support/xml_mini.rb#197 + def current_thread_backend=(name); end +end + +# source://activesupport//lib/active_support/xml_mini.rb#34 +ActiveSupport::XmlMini::DEFAULT_ENCODINGS = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/xml_mini.rb#56 +ActiveSupport::XmlMini::FORMATTING = T.let(T.unsafe(nil), Hash) + +# This module decorates files deserialized using Hash.from_xml with +# the original_filename and content_type methods. +# +# source://activesupport//lib/active_support/xml_mini.rb#22 +module ActiveSupport::XmlMini::FileLike + # source://activesupport//lib/active_support/xml_mini.rb#29 + def content_type; end + + # source://activesupport//lib/active_support/xml_mini.rb#23 + def content_type=(_arg0); end + + # source://activesupport//lib/active_support/xml_mini.rb#25 + def original_filename; end + + # source://activesupport//lib/active_support/xml_mini.rb#23 + def original_filename=(_arg0); end +end + +# source://activesupport//lib/active_support/xml_mini.rb#66 +ActiveSupport::XmlMini::PARSING = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/xml_mini.rb#39 +ActiveSupport::XmlMini::TYPE_NAMES = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/xml_mini/rexml.rb#8 +module ActiveSupport::XmlMini_REXML + extend ::ActiveSupport::XmlMini_REXML + + # Parse an XML Document string or IO into a simple hash. + # + # Same as XmlSimple::xml_in but doesn't shoot itself in the foot, + # and uses the defaults from Active Support. + # + # data:: + # XML Document string or IO to parse + # + # source://activesupport//lib/active_support/xml_mini/rexml.rb#20 + def parse(data); end + + private + + # Actually converts an XML document element into a data structure. + # + # element:: + # The document element to be collapsed. + # + # source://activesupport//lib/active_support/xml_mini/rexml.rb#63 + def collapse(element, depth); end + + # Determines if a document element has text content + # + # element:: + # XML element to be checked. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/xml_mini/rexml.rb#133 + def empty_content?(element); end + + # Converts the attributes array of an XML element into a hash. + # Returns an empty Hash if node has no attributes. + # + # element:: + # XML element to extract attributes from. + # + # source://activesupport//lib/active_support/xml_mini/rexml.rb#123 + def get_attributes(element); end + + # Adds a new key/value pair to an existing Hash. If the key to be added + # already exists and the existing value associated with key is not + # an Array, it will be wrapped in an Array. Then the new value is + # appended to that Array. + # + # hash:: + # Hash to add key/value pair to. + # key:: + # Key to be added. + # value:: + # Value to be associated with key. + # + # source://activesupport//lib/active_support/xml_mini/rexml.rb#103 + def merge!(hash, key, value); end + + # Convert an XML element and merge into the hash + # + # hash:: + # Hash to merge the converted element into. + # element:: + # XML element to merge into hash + # + # @raise [REXML::ParseException] + # + # source://activesupport//lib/active_support/xml_mini/rexml.rb#54 + def merge_element!(hash, element, depth); end + + # Merge all the texts of an element into the hash + # + # hash:: + # Hash to add the converted element to. + # element:: + # XML element whose texts are to me merged into the hash + # + # source://activesupport//lib/active_support/xml_mini/rexml.rb#81 + def merge_texts!(hash, element); end + + # source://activesupport//lib/active_support/xml_mini/rexml.rb#41 + def require_rexml; end +end + +# source://activesupport//lib/active_support/xml_mini/rexml.rb#11 +ActiveSupport::XmlMini_REXML::CONTENT_KEY = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/core_ext/array/extract.rb#3 +class Array + include ::Enumerable + + # source://activesupport//lib/active_support/core_ext/object/json.rb#164 + def as_json(options = T.unsafe(nil)); end + + # An array is blank if it's empty: + # + # [].blank? # => true + # [1,2,3].blank? # => false + # + # @return [true, false] + # + # source://activesupport//lib/active_support/core_ext/object/blank.rb#102 + def blank?; end + + # Removes all blank elements from the +Array+ in place and returns self. + # Uses Object#blank? for determining if an item is blank. + # + # a = [1, "", nil, 2, " ", [], {}, false, true] + # a.compact_blank! + # # => [1, 2, true] + # + # source://activesupport//lib/active_support/core_ext/enumerable.rb#275 + def compact_blank!; end + + # Returns a deep copy of array. + # + # array = [1, [2, 3]] + # dup = array.deep_dup + # dup[1][2] = 4 + # + # array[1][2] # => nil + # dup[1][2] # => 4 + # + # source://activesupport//lib/active_support/core_ext/object/deep_dup.rb#29 + def deep_dup; end + + # Returns a copy of the Array excluding the specified elements. + # + # ["David", "Rafael", "Aaron", "Todd"].excluding("Aaron", "Todd") # => ["David", "Rafael"] + # [ [ 0, 1 ], [ 1, 0 ] ].excluding([ [ 1, 0 ] ]) # => [ [ 0, 1 ] ] + # + # Note: This is an optimization of Enumerable#excluding that uses Array#- + # instead of Array#reject for performance reasons. + # + # source://activesupport//lib/active_support/core_ext/array/access.rb#47 + def excluding(*elements); end + + # Removes and returns the elements for which the block returns a true value. + # If no block is given, an Enumerator is returned instead. + # + # numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + # odd_numbers = numbers.extract! { |number| number.odd? } # => [1, 3, 5, 7, 9] + # numbers # => [0, 2, 4, 6, 8] + # + # source://activesupport//lib/active_support/core_ext/array/extract.rb#10 + def extract!; end + + # Extracts options from a set of arguments. Removes and returns the last + # element in the array if it's a hash, otherwise returns a blank hash. + # + # def options(*args) + # args.extract_options! + # end + # + # options(1, 2) # => {} + # options(1, 2, a: :b) # => {:a=>:b} + # + # source://activesupport//lib/active_support/core_ext/array/extract_options.rb#24 + def extract_options!; end + + # Equal to self[4]. + # + # %w( a b c d e ).fifth # => "e" + # + # source://activesupport//lib/active_support/core_ext/array/access.rb#76 + def fifth; end + + # Equal to self[41]. Also known as accessing "the reddit". + # + # (1..42).to_a.forty_two # => 42 + # + # source://activesupport//lib/active_support/core_ext/array/access.rb#83 + def forty_two; end + + # Equal to self[3]. + # + # %w( a b c d e ).fourth # => "d" + # + # source://activesupport//lib/active_support/core_ext/array/access.rb#69 + def fourth; end + + # Returns the tail of the array from +position+. + # + # %w( a b c d ).from(0) # => ["a", "b", "c", "d"] + # %w( a b c d ).from(2) # => ["c", "d"] + # %w( a b c d ).from(10) # => [] + # %w().from(0) # => [] + # %w( a b c d ).from(-2) # => ["c", "d"] + # %w( a b c ).from(-10) # => [] + # + # source://activesupport//lib/active_support/core_ext/array/access.rb#12 + def from(position); end + + # Splits or iterates over the array in +number+ of groups, padding any + # remaining slots with +fill_with+ unless it is +false+. + # + # %w(1 2 3 4 5 6 7 8 9 10).in_groups(3) {|group| p group} + # ["1", "2", "3", "4"] + # ["5", "6", "7", nil] + # ["8", "9", "10", nil] + # + # %w(1 2 3 4 5 6 7 8 9 10).in_groups(3, ' ') {|group| p group} + # ["1", "2", "3", "4"] + # ["5", "6", "7", " "] + # ["8", "9", "10", " "] + # + # %w(1 2 3 4 5 6 7).in_groups(3, false) {|group| p group} + # ["1", "2", "3"] + # ["4", "5"] + # ["6", "7"] + # + # source://activesupport//lib/active_support/core_ext/array/grouping.rb#62 + def in_groups(number, fill_with = T.unsafe(nil), &block); end + + # Splits or iterates over the array in groups of size +number+, + # padding any remaining slots with +fill_with+ unless it is +false+. + # + # %w(1 2 3 4 5 6 7 8 9 10).in_groups_of(3) {|group| p group} + # ["1", "2", "3"] + # ["4", "5", "6"] + # ["7", "8", "9"] + # ["10", nil, nil] + # + # %w(1 2 3 4 5).in_groups_of(2, ' ') {|group| p group} + # ["1", "2"] + # ["3", "4"] + # ["5", " "] + # + # %w(1 2 3 4 5).in_groups_of(2, false) {|group| p group} + # ["1", "2"] + # ["3", "4"] + # ["5"] + # + # source://activesupport//lib/active_support/core_ext/array/grouping.rb#22 + def in_groups_of(number, fill_with = T.unsafe(nil), &block); end + + # Returns a new array that includes the passed elements. + # + # [ 1, 2, 3 ].including(4, 5) # => [ 1, 2, 3, 4, 5 ] + # [ [ 0, 1 ] ].including([ [ 1, 0 ] ]) # => [ [ 0, 1 ], [ 1, 0 ] ] + # + # source://activesupport//lib/active_support/core_ext/array/access.rb#36 + def including(*elements); end + + # Wraps the array in an ActiveSupport::ArrayInquirer object, which gives a + # friendlier way to check its string-like contents. + # + # pets = [:cat, :dog].inquiry + # + # pets.cat? # => true + # pets.ferret? # => false + # + # pets.any?(:cat, :ferret) # => true + # pets.any?(:ferret, :alligator) # => false + # + # source://activesupport//lib/active_support/core_ext/array/inquiry.rb#16 + def inquiry; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/object/blank.rb#104 + def present?; end + + # Equal to self[1]. + # + # %w( a b c d e ).second # => "b" + # + # source://activesupport//lib/active_support/core_ext/array/access.rb#55 + def second; end + + # Equal to self[-2]. + # + # %w( a b c d e ).second_to_last # => "d" + # + # source://activesupport//lib/active_support/core_ext/array/access.rb#97 + def second_to_last; end + + # Divides the array into one or more subarrays based on a delimiting +value+ + # or the result of an optional block. + # + # [1, 2, 3, 4, 5].split(3) # => [[1, 2], [4, 5]] + # (1..10).to_a.split { |i| i % 3 == 0 } # => [[1, 2], [4, 5], [7, 8], [10]] + # + # source://activesupport//lib/active_support/core_ext/array/grouping.rb#93 + def split(value = T.unsafe(nil), &block); end + + # Equal to self[2]. + # + # %w( a b c d e ).third # => "c" + # + # source://activesupport//lib/active_support/core_ext/array/access.rb#62 + def third; end + + # Equal to self[-3]. + # + # %w( a b c d e ).third_to_last # => "c" + # + # source://activesupport//lib/active_support/core_ext/array/access.rb#90 + def third_to_last; end + + # Returns the beginning of the array up to +position+. + # + # %w( a b c d ).to(0) # => ["a"] + # %w( a b c d ).to(2) # => ["a", "b", "c"] + # %w( a b c d ).to(10) # => ["a", "b", "c", "d"] + # %w().to(0) # => [] + # %w( a b c d ).to(-2) # => ["a", "b", "c"] + # %w( a b c ).to(-10) # => [] + # + # source://activesupport//lib/active_support/core_ext/array/access.rb#24 + def to(position); end + + # Extends Array#to_s to convert a collection of elements into a + # comma separated id list if :db argument is given as the format. + # + # This method is aliased to to_formatted_s. + # + # Blog.all.to_fs(:db) # => "1,2,3" + # Blog.none.to_fs(:db) # => "null" + # [1,2].to_fs # => "[1, 2]" + # + # source://activesupport//lib/active_support/core_ext/array/conversions.rb#106 + def to_formatted_s(format = T.unsafe(nil)); end + + # Extends Array#to_s to convert a collection of elements into a + # comma separated id list if :db argument is given as the format. + # + # This method is aliased to to_formatted_s. + # + # Blog.all.to_fs(:db) # => "1,2,3" + # Blog.none.to_fs(:db) # => "null" + # [1,2].to_fs # => "[1, 2]" + # + # source://activesupport//lib/active_support/core_ext/array/conversions.rb#94 + def to_fs(format = T.unsafe(nil)); end + + # Calls to_param on all its elements and joins the result with + # slashes. This is used by url_for in Action Pack. + # + # source://activesupport//lib/active_support/core_ext/object/to_query.rb#48 + def to_param; end + + # Converts an array into a string suitable for use as a URL query string, + # using the given +key+ as the param name. + # + # ['Rails', 'coding'].to_query('hobbies') # => "hobbies%5B%5D=Rails&hobbies%5B%5D=coding" + # + # source://activesupport//lib/active_support/core_ext/object/to_query.rb#56 + def to_query(key); end + + # Converts the array to a comma-separated sentence where the last element is + # joined by the connector word. + # + # You can pass the following options to change the default behavior. If you + # pass an option key that doesn't exist in the list below, it will raise an + # ArgumentError. + # + # ==== Options + # + # * :words_connector - The sign or word used to join all but the last + # element in arrays with three or more elements (default: ", "). + # * :last_word_connector - The sign or word used to join the last element + # in arrays with three or more elements (default: ", and "). + # * :two_words_connector - The sign or word used to join the elements + # in arrays with two elements (default: " and "). + # * :locale - If +i18n+ is available, you can set a locale and use + # the connector options defined on the 'support.array' namespace in the + # corresponding dictionary file. + # + # ==== Examples + # + # [].to_sentence # => "" + # ['one'].to_sentence # => "one" + # ['one', 'two'].to_sentence # => "one and two" + # ['one', 'two', 'three'].to_sentence # => "one, two, and three" + # + # ['one', 'two'].to_sentence(passing: 'invalid option') + # # => ArgumentError: Unknown key: :passing. Valid keys are: :words_connector, :two_words_connector, :last_word_connector, :locale + # + # ['one', 'two'].to_sentence(two_words_connector: '-') + # # => "one-two" + # + # ['one', 'two', 'three'].to_sentence(words_connector: ' or ', last_word_connector: ' or at least ') + # # => "one or two or at least three" + # + # Using :locale option: + # + # # Given this locale dictionary: + # # + # # es: + # # support: + # # array: + # # words_connector: " o " + # # two_words_connector: " y " + # # last_word_connector: " o al menos " + # + # ['uno', 'dos'].to_sentence(locale: :es) + # # => "uno y dos" + # + # ['uno', 'dos', 'tres'].to_sentence(locale: :es) + # # => "uno o dos o al menos tres" + # + # source://activesupport//lib/active_support/core_ext/array/conversions.rb#60 + def to_sentence(options = T.unsafe(nil)); end + + # Returns a string that represents the array in XML by invoking +to_xml+ + # on each element. Active Record collections delegate their representation + # in XML to this method. + # + # All elements are expected to respond to +to_xml+, if any of them does + # not then an exception is raised. + # + # The root node reflects the class name of the first element in plural + # if all elements belong to the same type and that's not Hash: + # + # customer.projects.to_xml + # + # + # + # + # 20000.0 + # 1567 + # 2008-04-09 + # ... + # + # + # 57230.0 + # 1567 + # 2008-04-15 + # ... + # + # + # + # Otherwise the root element is "objects": + # + # [{ foo: 1, bar: 2}, { baz: 3}].to_xml + # + # + # + # + # 2 + # 1 + # + # + # 3 + # + # + # + # If the collection is empty the root element is "nil-classes" by default: + # + # [].to_xml + # + # + # + # + # To ensure a meaningful root element use the :root option: + # + # customer_with_no_projects.projects.to_xml(root: 'projects') + # + # + # + # + # By default name of the node for the children of root is root.singularize. + # You can change it with the :children option. + # + # The +options+ hash is passed downwards: + # + # Message.all.to_xml(skip_types: true) + # + # + # + # + # 2008-03-07T09:58:18+01:00 + # 1 + # 1 + # 2008-03-07T09:58:18+01:00 + # 1 + # + # + # + # source://activesupport//lib/active_support/core_ext/array/conversions.rb#183 + def to_xml(options = T.unsafe(nil)); end + + # Returns a copy of the Array excluding the specified elements. + # + # ["David", "Rafael", "Aaron", "Todd"].excluding("Aaron", "Todd") # => ["David", "Rafael"] + # [ [ 0, 1 ], [ 1, 0 ] ].excluding([ [ 1, 0 ] ]) # => [ [ 0, 1 ] ] + # + # Note: This is an optimization of Enumerable#excluding that uses Array#- + # instead of Array#reject for performance reasons. + # + # source://activesupport//lib/active_support/core_ext/array/access.rb#50 + def without(*elements); end + + class << self + # Wraps its argument in an array unless it is already an array (or array-like). + # + # Specifically: + # + # * If the argument is +nil+ an empty array is returned. + # * Otherwise, if the argument responds to +to_ary+ it is invoked, and its result returned. + # * Otherwise, returns an array with the argument as its single element. + # + # Array.wrap(nil) # => [] + # Array.wrap([1, 2, 3]) # => [1, 2, 3] + # Array.wrap(0) # => [0] + # + # This method is similar in purpose to Kernel#Array, but there are some differences: + # + # * If the argument responds to +to_ary+ the method is invoked. Kernel#Array + # moves on to try +to_a+ if the returned value is +nil+, but Array.wrap returns + # an array with the argument as its single element right away. + # * If the returned value from +to_ary+ is neither +nil+ nor an +Array+ object, Kernel#Array + # raises an exception, while Array.wrap does not, it just returns the value. + # * It does not call +to_a+ on the argument, if the argument does not respond to +to_ary+ + # it returns an array with the argument as its single element. + # + # The last point is easily explained with some enumerables: + # + # Array(foo: :bar) # => [[:foo, :bar]] + # Array.wrap(foo: :bar) # => [{:foo=>:bar}] + # + # There's also a related idiom that uses the splat operator: + # + # [*object] + # + # which returns [] for +nil+, but calls to Array(object) otherwise. + # + # The differences with Kernel#Array explained above + # apply to the rest of objects. + # + # source://activesupport//lib/active_support/core_ext/array/wrap.rb#39 + def wrap(object); end + end +end + +# source://activesupport//lib/active_support/core_ext/object/json.rb#124 +class BigDecimal < ::Numeric + include ::ActiveSupport::BigDecimalWithDefaultFormat + include ::ActiveSupport::NumericWithFormat + + # A BigDecimal would be naturally represented as a JSON number. Most libraries, + # however, parse non-integer JSON numbers directly as floats. Clients using + # those libraries would get in general a wrong number and no way to recover + # other than manually inspecting the string with the JSON code itself. + # + # That's why a JSON string is returned. The JSON literal is not numeric, but + # if the other end knows by contract that the data is supposed to be a + # BigDecimal, it still has the chance to post-process the string and get the + # real value. + # + # source://activesupport//lib/active_support/core_ext/object/json.rb#134 + def as_json(options = T.unsafe(nil)); end +end + +# source://activesupport//lib/active_support/core_ext/class/attribute.rb#6 +class Class < ::Module + include ::ActiveSupport::DescendantsTracker::ReloadedClassesFiltering + + # Declare a class-level attribute whose value is inheritable by subclasses. + # Subclasses can change their own value and it will not impact parent class. + # + # ==== Options + # + # * :instance_reader - Sets the instance reader method (defaults to true). + # * :instance_writer - Sets the instance writer method (defaults to true). + # * :instance_accessor - Sets both instance methods (defaults to true). + # * :instance_predicate - Sets a predicate method (defaults to true). + # * :default - Sets a default value for the attribute (defaults to nil). + # + # ==== Examples + # + # class Base + # class_attribute :setting + # end + # + # class Subclass < Base + # end + # + # Base.setting = true + # Subclass.setting # => true + # Subclass.setting = false + # Subclass.setting # => false + # Base.setting # => true + # + # In the above case as long as Subclass does not assign a value to setting + # by performing Subclass.setting = _something_, Subclass.setting + # would read value assigned to parent class. Once Subclass assigns a value then + # the value assigned by Subclass would be returned. + # + # This matches normal Ruby method inheritance: think of writing an attribute + # on a subclass as overriding the reader method. However, you need to be aware + # when using +class_attribute+ with mutable structures as +Array+ or +Hash+. + # In such cases, you don't want to do changes in place. Instead use setters: + # + # Base.setting = [] + # Base.setting # => [] + # Subclass.setting # => [] + # + # # Appending in child changes both parent and child because it is the same object: + # Subclass.setting << :foo + # Base.setting # => [:foo] + # Subclass.setting # => [:foo] + # + # # Use setters to not propagate changes: + # Base.setting = [] + # Subclass.setting += [:foo] + # Base.setting # => [] + # Subclass.setting # => [:foo] + # + # For convenience, an instance predicate method is defined as well. + # To skip it, pass instance_predicate: false. + # + # Subclass.setting? # => false + # + # Instances may overwrite the class value in the same way: + # + # Base.setting = true + # object = Base.new + # object.setting # => true + # object.setting = false + # object.setting # => false + # Base.setting # => true + # + # To opt out of the instance reader method, pass instance_reader: false. + # + # object.setting # => NoMethodError + # object.setting? # => NoMethodError + # + # To opt out of the instance writer method, pass instance_writer: false. + # + # object.setting = false # => NoMethodError + # + # To opt out of both instance methods, pass instance_accessor: false. + # + # To set a default value for the attribute, pass default:, like so: + # + # class_attribute :settings, default: {} + # + # source://activesupport//lib/active_support/core_ext/class/attribute.rb#86 + def class_attribute(*attrs, instance_accessor: T.unsafe(nil), instance_reader: T.unsafe(nil), instance_writer: T.unsafe(nil), instance_predicate: T.unsafe(nil), default: T.unsafe(nil)); end + + # Returns an array with all classes that are < than its receiver. + # + # class C; end + # C.descendants # => [] + # + # class B < C; end + # C.descendants # => [B] + # + # class A < B; end + # C.descendants # => [B, A] + # + # class D < C; end + # C.descendants # => [B, A, D] + # + # source://activesupport//lib/active_support/core_ext/class/subclasses.rb#19 + def descendants; end + + # source://activesupport//lib/active_support/descendants_tracker.rb#59 + def subclasses; end +end + +# source://activesupport//lib/active_support/core_ext/object/json.rb#68 +class Data + # source://activesupport//lib/active_support/core_ext/object/json.rb#69 + def as_json(options = T.unsafe(nil)); end +end + +# source://activesupport//lib/active_support/core_ext/date/zones.rb#6 +class Date + include ::Comparable + include ::DateAndTime::Zones + include ::DateAndTime::Calculations + + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#98 + def +(other); end + + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#108 + def -(other); end + + # Allow Date to be compared with Time by converting to DateTime and relying on the <=> from there. + # + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#160 + def <=>(other); end + + # Duck-types as a Date-like class. See Object#acts_like?. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/date/acts_like.rb#7 + def acts_like_date?; end + + # Provides precise Date calculations for years, months, and days. The +options+ parameter takes a hash with + # any of these keys: :years, :months, :weeks, :days. + # + # The increments are applied in order of time units from largest to smallest. + # In other words, the date is incremented first by +:years+, then by + # +:months+, then by +:weeks+, then by +:days+. This order can affect the + # result around the end of a month. For example, incrementing first by months + # then by days: + # + # Date.new(2004, 9, 30).advance(months: 1, days: 1) + # # => Sun, 31 Oct 2004 + # + # Whereas incrementing first by days then by months yields a different result: + # + # Date.new(2004, 9, 30).advance(days: 1).advance(months: 1) + # # => Mon, 01 Nov 2004 + # + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#127 + def advance(options); end + + # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00) + # and then subtracts the specified number of seconds. + # + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#55 + def ago(seconds); end + + # source://activesupport//lib/active_support/core_ext/object/json.rb#211 + def as_json(options = T.unsafe(nil)); end + + # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00) + # + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#72 + def at_beginning_of_day; end + + # Converts Date to a Time (or DateTime if necessary) with the time portion set to the end of the day (23:59:59) + # + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#88 + def at_end_of_day; end + + # Converts Date to a Time (or DateTime if necessary) with the time portion set to the middle of the day (12:00) + # + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#80 + def at_midday; end + + # Converts Date to a Time (or DateTime if necessary) with the time portion set to the middle of the day (12:00) + # + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#82 + def at_middle_of_day; end + + # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00) + # + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#71 + def at_midnight; end + + # Converts Date to a Time (or DateTime if necessary) with the time portion set to the middle of the day (12:00) + # + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#81 + def at_noon; end + + # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00) + # + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#67 + def beginning_of_day; end + + # No Date is blank: + # + # Date.today.blank? # => false + # + # @return [false] + # + # source://activesupport//lib/active_support/core_ext/date/blank.rb#11 + def blank?; end + + # Returns a new Date where one or more of the elements have been changed according to the +options+ parameter. + # The +options+ parameter is a hash with a combination of these keys: :year, :month, :day. + # + # Date.new(2007, 5, 12).change(day: 1) # => Date.new(2007, 5, 1) + # Date.new(2007, 5, 12).change(year: 2005, month: 1) # => Date.new(2005, 1, 12) + # + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#143 + def change(options); end + + # Allow Date to be compared with Time by converting to DateTime and relying on the <=> from there. + # + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#152 + def compare_with_coercion(other); end + + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#159 + def compare_without_coercion(_arg0); end + + # source://activesupport//lib/active_support/core_ext/date/conversions.rb#66 + def default_inspect; end + + # Converts Date to a Time (or DateTime if necessary) with the time portion set to the end of the day (23:59:59) + # + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#85 + def end_of_day; end + + # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00) + # and then adds the specified number of seconds + # + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#64 + def in(seconds); end + + # Overrides the default inspect method with a human readable one, e.g., "Mon, 21 Feb 2005" + # + # source://activesupport//lib/active_support/core_ext/date/conversions.rb#67 + def inspect; end + + # Converts Date to a Time (or DateTime if necessary) with the time portion set to the middle of the day (12:00) + # + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#78 + def midday; end + + # Converts Date to a Time (or DateTime if necessary) with the time portion set to the middle of the day (12:00) + # + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#75 + def middle_of_day; end + + # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00) + # + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#70 + def midnight; end + + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#100 + def minus_with_duration(other); end + + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#107 + def minus_without_duration(_arg0); end + + # Converts Date to a Time (or DateTime if necessary) with the time portion set to the middle of the day (12:00) + # + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#79 + def noon; end + + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#90 + def plus_with_duration(other); end + + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#97 + def plus_without_duration(_arg0); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/date/blank.rb#15 + def present?; end + + # Overrides the default inspect method with a human readable one, e.g., "Mon, 21 Feb 2005" + # + # source://activesupport//lib/active_support/core_ext/date/conversions.rb#63 + def readable_inspect; end + + # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00) + # and then adds the specified number of seconds + # + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#61 + def since(seconds); end + + # Convert to a formatted string. See DATE_FORMATS for predefined formats. + # + # This method is aliased to to_formatted_s. + # + # date = Date.new(2007, 11, 10) # => Sat, 10 Nov 2007 + # + # date.to_fs(:db) # => "2007-11-10" + # date.to_formatted_s(:db) # => "2007-11-10" + # + # date.to_fs(:short) # => "10 Nov" + # date.to_fs(:number) # => "20071110" + # date.to_fs(:long) # => "November 10, 2007" + # date.to_fs(:long_ordinal) # => "November 10th, 2007" + # date.to_fs(:rfc822) # => "10 Nov 2007" + # date.to_fs(:rfc2822) # => "10 Nov 2007" + # date.to_fs(:iso8601) # => "2007-11-10" + # + # == Adding your own date formats to to_fs + # You can add your own formats to the Date::DATE_FORMATS hash. + # Use the format name as the hash key and either a strftime string + # or Proc instance that takes a date argument as the value. + # + # # config/initializers/date_formats.rb + # Date::DATE_FORMATS[:month_and_year] = '%B %Y' + # Date::DATE_FORMATS[:short_ordinal] = ->(date) { date.strftime("%B #{date.day.ordinalize}") } + # + # source://activesupport//lib/active_support/core_ext/date/conversions.rb#60 + def to_formatted_s(format = T.unsafe(nil)); end + + # Convert to a formatted string. See DATE_FORMATS for predefined formats. + # + # This method is aliased to to_formatted_s. + # + # date = Date.new(2007, 11, 10) # => Sat, 10 Nov 2007 + # + # date.to_fs(:db) # => "2007-11-10" + # date.to_formatted_s(:db) # => "2007-11-10" + # + # date.to_fs(:short) # => "10 Nov" + # date.to_fs(:number) # => "20071110" + # date.to_fs(:long) # => "November 10, 2007" + # date.to_fs(:long_ordinal) # => "November 10th, 2007" + # date.to_fs(:rfc822) # => "10 Nov 2007" + # date.to_fs(:rfc2822) # => "10 Nov 2007" + # date.to_fs(:iso8601) # => "2007-11-10" + # + # == Adding your own date formats to to_fs + # You can add your own formats to the Date::DATE_FORMATS hash. + # Use the format name as the hash key and either a strftime string + # or Proc instance that takes a date argument as the value. + # + # # config/initializers/date_formats.rb + # Date::DATE_FORMATS[:month_and_year] = '%B %Y' + # Date::DATE_FORMATS[:short_ordinal] = ->(date) { date.strftime("%B #{date.day.ordinalize}") } + # + # source://activesupport//lib/active_support/core_ext/date/conversions.rb#49 + def to_fs(format = T.unsafe(nil)); end + + # Converts a Date instance to a Time, where the time is set to the beginning of the day. + # The timezone can be either +:local+ or +:utc+ (default +:local+). + # + # date = Date.new(2007, 11, 10) # => Sat, 10 Nov 2007 + # + # date.to_time # => 2007-11-10 00:00:00 0800 + # date.to_time(:local) # => 2007-11-10 00:00:00 0800 + # + # date.to_time(:utc) # => 2007-11-10 00:00:00 UTC + # + # NOTE: The +:local+ timezone is Ruby's *process* timezone, i.e. ENV['TZ']. + # If the application's timezone is needed, then use +in_time_zone+ instead. + # + # @raise [ArgumentError] + # + # source://activesupport//lib/active_support/core_ext/date/conversions.rb#69 + def to_time(form = T.unsafe(nil)); end + + # Returns a string which represents the time in used time zone as DateTime + # defined by XML Schema: + # + # date = Date.new(2015, 05, 23) # => Sat, 23 May 2015 + # date.xmlschema # => "2015-05-23T00:00:00+04:00" + # + # source://activesupport//lib/active_support/core_ext/date/conversions.rb#88 + def xmlschema; end + + class << self + # Returns the week start (e.g. +:monday+) for the current request, if this has been set (via Date.beginning_of_week=). + # If Date.beginning_of_week has not been set for the current request, returns the week start specified in config.beginning_of_week. + # If no +config.beginning_of_week+ was specified, returns +:monday+. + # + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#19 + def beginning_of_week; end + + # Sets Date.beginning_of_week to a week start (e.g. +:monday+) for current request/thread. + # + # This method accepts any of the following day symbols: + # +:monday+, +:tuesday+, +:wednesday+, +:thursday+, +:friday+, +:saturday+, +:sunday+ + # + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#27 + def beginning_of_week=(week_start); end + + # Returns the value of attribute beginning_of_week_default. + # + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#14 + def beginning_of_week_default; end + + # Sets the attribute beginning_of_week_default + # + # @param value the value to set the attribute beginning_of_week_default to. + # + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#14 + def beginning_of_week_default=(_arg0); end + + # Returns Time.zone.today when Time.zone or config.time_zone are set, otherwise just returns Date.today. + # + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#48 + def current; end + + # Returns week start day symbol (e.g. +:monday+), or raises an +ArgumentError+ for invalid day symbol. + # + # @raise [ArgumentError] + # + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#32 + def find_beginning_of_week!(week_start); end + + # Returns a new Date representing the date 1 day after today (i.e. tomorrow's date). + # + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#43 + def tomorrow; end + + # Returns a new Date representing the date 1 day ago (i.e. yesterday's date). + # + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#38 + def yesterday; end + end +end + +# source://activesupport//lib/active_support/core_ext/date/conversions.rb#9 +Date::DATE_FORMATS = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/core_ext/date_and_time/compatibility.rb#6 +module DateAndTime; end + +# source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#7 +module DateAndTime::Calculations + # Returns true if the date/time falls after date_or_time. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#72 + def after?(date_or_time); end + + # Returns a Range representing the whole day of the current date/time. + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#310 + def all_day; end + + # Returns a Range representing the whole month of the current date/time. + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#321 + def all_month; end + + # Returns a Range representing the whole quarter of the current date/time. + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#326 + def all_quarter; end + + # Returns a Range representing the whole week of the current date/time. + # Week starts on start_day, default is Date.beginning_of_week or config.beginning_of_week when set. + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#316 + def all_week(start_day = T.unsafe(nil)); end + + # Returns a Range representing the whole year of the current date/time. + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#331 + def all_year; end + + # Returns a new date/time at the start of the month. + # + # today = Date.today # => Thu, 18 Jun 2015 + # today.beginning_of_month # => Mon, 01 Jun 2015 + # + # +DateTime+ objects will have a time set to 0:00. + # + # now = DateTime.current # => Thu, 18 Jun 2015 15:23:13 +0000 + # now.beginning_of_month # => Mon, 01 Jun 2015 00:00:00 +0000 + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#128 + def at_beginning_of_month; end + + # Returns a new date/time at the start of the quarter. + # + # today = Date.today # => Fri, 10 Jul 2015 + # today.beginning_of_quarter # => Wed, 01 Jul 2015 + # + # +DateTime+ objects will have a time set to 0:00. + # + # now = DateTime.current # => Fri, 10 Jul 2015 18:41:29 +0000 + # now.beginning_of_quarter # => Wed, 01 Jul 2015 00:00:00 +0000 + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#143 + def at_beginning_of_quarter; end + + # Returns a new date/time representing the start of this week on the given day. + # Week is assumed to start on +start_day+, default is + # +Date.beginning_of_week+ or +config.beginning_of_week+ when set. + # +DateTime+ objects have their time set to 0:00. + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#271 + def at_beginning_of_week(start_day = T.unsafe(nil)); end + + # Returns a new date/time at the beginning of the year. + # + # today = Date.today # => Fri, 10 Jul 2015 + # today.beginning_of_year # => Thu, 01 Jan 2015 + # + # +DateTime+ objects will have a time set to 0:00. + # + # now = DateTime.current # => Fri, 10 Jul 2015 18:41:29 +0000 + # now.beginning_of_year # => Thu, 01 Jan 2015 00:00:00 +0000 + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#182 + def at_beginning_of_year; end + + # Returns a new date/time representing the end of the month. + # DateTime objects will have a time set to 23:59:59. + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#300 + def at_end_of_month; end + + # Returns a new date/time at the end of the quarter. + # + # today = Date.today # => Fri, 10 Jul 2015 + # today.end_of_quarter # => Wed, 30 Sep 2015 + # + # +DateTime+ objects will have a time set to 23:59:59. + # + # now = DateTime.current # => Fri, 10 Jul 2015 18:41:29 +0000 + # now.end_of_quarter # => Wed, 30 Sep 2015 23:59:59 +0000 + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#158 + def at_end_of_quarter; end + + # Returns a new date/time representing the end of this week on the given day. + # Week is assumed to start on +start_day+, default is + # +Date.beginning_of_week+ or +config.beginning_of_week+ when set. + # DateTime objects have their time set to 23:59:59. + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#286 + def at_end_of_week(start_day = T.unsafe(nil)); end + + # Returns a new date/time representing the end of the year. + # DateTime objects will have a time set to 23:59:59. + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#307 + def at_end_of_year; end + + # Returns true if the date/time falls before date_or_time. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#67 + def before?(date_or_time); end + + # Returns a new date/time at the start of the month. + # + # today = Date.today # => Thu, 18 Jun 2015 + # today.beginning_of_month # => Mon, 01 Jun 2015 + # + # +DateTime+ objects will have a time set to 0:00. + # + # now = DateTime.current # => Thu, 18 Jun 2015 15:23:13 +0000 + # now.beginning_of_month # => Mon, 01 Jun 2015 00:00:00 +0000 + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#125 + def beginning_of_month; end + + # Returns a new date/time at the start of the quarter. + # + # today = Date.today # => Fri, 10 Jul 2015 + # today.beginning_of_quarter # => Wed, 01 Jul 2015 + # + # +DateTime+ objects will have a time set to 0:00. + # + # now = DateTime.current # => Fri, 10 Jul 2015 18:41:29 +0000 + # now.beginning_of_quarter # => Wed, 01 Jul 2015 00:00:00 +0000 + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#139 + def beginning_of_quarter; end + + # Returns a new date/time representing the start of this week on the given day. + # Week is assumed to start on +start_day+, default is + # +Date.beginning_of_week+ or +config.beginning_of_week+ when set. + # +DateTime+ objects have their time set to 0:00. + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#267 + def beginning_of_week(start_day = T.unsafe(nil)); end + + # Returns a new date/time at the beginning of the year. + # + # today = Date.today # => Fri, 10 Jul 2015 + # today.beginning_of_year # => Thu, 01 Jan 2015 + # + # +DateTime+ objects will have a time set to 0:00. + # + # now = DateTime.current # => Fri, 10 Jul 2015 18:41:29 +0000 + # now.beginning_of_year # => Thu, 01 Jan 2015 00:00:00 +0000 + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#179 + def beginning_of_year; end + + # Returns a new date/time the specified number of days ago. + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#77 + def days_ago(days); end + + # Returns a new date/time the specified number of days in the future. + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#82 + def days_since(days); end + + # Returns the number of days to the start of the week on the given day. + # Week is assumed to start on +start_day+, default is + # +Date.beginning_of_week+ or +config.beginning_of_week+ when set. + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#258 + def days_to_week_start(start_day = T.unsafe(nil)); end + + # Returns a new date/time representing the end of the month. + # DateTime objects will have a time set to 23:59:59. + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#296 + def end_of_month; end + + # Returns a new date/time at the end of the quarter. + # + # today = Date.today # => Fri, 10 Jul 2015 + # today.end_of_quarter # => Wed, 30 Sep 2015 + # + # +DateTime+ objects will have a time set to 23:59:59. + # + # now = DateTime.current # => Fri, 10 Jul 2015 18:41:29 +0000 + # now.end_of_quarter # => Wed, 30 Sep 2015 23:59:59 +0000 + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#154 + def end_of_quarter; end + + # Returns a new date/time representing the end of this week on the given day. + # Week is assumed to start on +start_day+, default is + # +Date.beginning_of_week+ or +config.beginning_of_week+ when set. + # DateTime objects have their time set to 23:59:59. + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#283 + def end_of_week(start_day = T.unsafe(nil)); end + + # Returns a new date/time representing the end of the year. + # DateTime objects will have a time set to 23:59:59. + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#304 + def end_of_year; end + + # Returns true if the date/time is in the future. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#52 + def future?; end + + # Short-hand for months_ago(1). + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#240 + def last_month; end + + # Short-hand for months_ago(3). + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#248 + def last_quarter; end + + # Returns a new date/time representing the given day in the previous week. + # Week is assumed to start on +start_day+, default is + # +Date.beginning_of_week+ or +config.beginning_of_week+ when set. + # DateTime objects have their time set to 0:00 unless +same_time+ is true. + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#227 + def last_week(start_day = T.unsafe(nil), same_time: T.unsafe(nil)); end + + # Returns a new date/time representing the previous weekday. + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#237 + def last_weekday; end + + # Short-hand for years_ago(1). + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#251 + def last_year; end + + # Returns Monday of this week assuming that week starts on Monday. + # +DateTime+ objects have their time set to 0:00. + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#275 + def monday; end + + # Returns a new date/time the specified number of months ago. + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#97 + def months_ago(months); end + + # Returns a new date/time the specified number of months in the future. + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#102 + def months_since(months); end + + # Returns true if the date/time is tomorrow. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#38 + def next_day?; end + + # Returns a new date/time representing the next occurrence of the specified day of week. + # + # today = Date.today # => Thu, 14 Dec 2017 + # today.next_occurring(:monday) # => Mon, 18 Dec 2017 + # today.next_occurring(:thursday) # => Thu, 21 Dec 2017 + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#340 + def next_occurring(day_of_week); end + + # Short-hand for months_since(3). + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#215 + def next_quarter; end + + # Returns a new date/time representing the given day in the next week. + # + # today = Date.today # => Thu, 07 May 2015 + # today.next_week # => Mon, 11 May 2015 + # + # The +given_day_in_next_week+ defaults to the beginning of the week + # which is determined by +Date.beginning_of_week+ or +config.beginning_of_week+ + # when set. + # + # today = Date.today # => Thu, 07 May 2015 + # today.next_week(:friday) # => Fri, 15 May 2015 + # + # +DateTime+ objects have their time set to 0:00 unless +same_time+ is true. + # + # now = DateTime.current # => Thu, 07 May 2015 13:31:16 +0000 + # now.next_week # => Mon, 11 May 2015 00:00:00 +0000 + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#200 + def next_week(given_day_in_next_week = T.unsafe(nil), same_time: T.unsafe(nil)); end + + # Returns a new date/time representing the next weekday. + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#206 + def next_weekday; end + + # Returns true if the date/time does not fall on a Saturday or Sunday. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#62 + def on_weekday?; end + + # Returns true if the date/time falls on a Saturday or Sunday. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#57 + def on_weekend?; end + + # Returns true if the date/time is in the past. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#47 + def past?; end + + # Returns true if the date/time is yesterday. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#44 + def prev_day?; end + + # Returns a new date/time representing the previous occurrence of the specified day of week. + # + # today = Date.today # => Thu, 14 Dec 2017 + # today.prev_occurring(:monday) # => Mon, 11 Dec 2017 + # today.prev_occurring(:thursday) # => Thu, 07 Dec 2017 + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#351 + def prev_occurring(day_of_week); end + + # Short-hand for months_ago(3). + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#245 + def prev_quarter; end + + # Returns a new date/time representing the given day in the previous week. + # Week is assumed to start on +start_day+, default is + # +Date.beginning_of_week+ or +config.beginning_of_week+ when set. + # DateTime objects have their time set to 0:00 unless +same_time+ is true. + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#223 + def prev_week(start_day = T.unsafe(nil), same_time: T.unsafe(nil)); end + + # Returns a new date/time representing the previous weekday. + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#230 + def prev_weekday; end + + # Returns the quarter for a date/time. + # + # Date.new(2010, 1, 31).quarter # => 1 + # Date.new(2010, 4, 12).quarter # => 2 + # Date.new(2010, 9, 15).quarter # => 3 + # Date.new(2010, 12, 25).quarter # => 4 + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#166 + def quarter; end + + # Returns Sunday of this week assuming that week starts on Monday. + # +DateTime+ objects have their time set to 23:59:59. + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#290 + def sunday; end + + # Returns true if the date/time is today. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#30 + def today?; end + + # Returns a new date/time representing tomorrow. + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#25 + def tomorrow; end + + # Returns true if the date/time is tomorrow. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#35 + def tomorrow?; end + + # Returns a new date/time the specified number of weeks ago. + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#87 + def weeks_ago(weeks); end + + # Returns a new date/time the specified number of weeks in the future. + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#92 + def weeks_since(weeks); end + + # Returns a new date/time the specified number of years ago. + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#107 + def years_ago(years); end + + # Returns a new date/time the specified number of years in the future. + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#112 + def years_since(years); end + + # Returns a new date/time representing yesterday. + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#20 + def yesterday; end + + # Returns true if the date/time is yesterday. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#41 + def yesterday?; end + + private + + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#370 + def copy_time_to(other); end + + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#366 + def days_span(day); end + + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#358 + def first_hour(date_or_time); end + + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#362 + def last_hour(date_or_time); end +end + +# source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#8 +DateAndTime::Calculations::DAYS_INTO_WEEK = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#17 +DateAndTime::Calculations::WEEKEND_DAYS = T.let(T.unsafe(nil), Array) + +# source://activesupport//lib/active_support/core_ext/date_and_time/compatibility.rb#7 +module DateAndTime::Compatibility + # source://activesupport//lib/active_support/core_ext/date_and_time/compatibility.rb#21 + def utc_to_local_returns_utc_offset_times; end + + class << self + # source://activesupport//lib/active_support/core_ext/date_and_time/compatibility.rb#21 + def utc_to_local_returns_utc_offset_times; end + + # source://activesupport//lib/active_support/core_ext/date_and_time/compatibility.rb#21 + def utc_to_local_returns_utc_offset_times=(val); end + end +end + +# source://activesupport//lib/active_support/core_ext/date_and_time/zones.rb#4 +module DateAndTime::Zones + # Returns the simultaneous time in Time.zone if a zone is given or + # if Time.zone_default is set. Otherwise, it returns the current time. + # + # Time.zone = 'Hawaii' # => 'Hawaii' + # Time.utc(2000).in_time_zone # => Fri, 31 Dec 1999 14:00:00 HST -10:00 + # Date.new(2000).in_time_zone # => Sat, 01 Jan 2000 00:00:00 HST -10:00 + # + # This method is similar to Time#localtime, except that it uses Time.zone as the local zone + # instead of the operating system's time zone. + # + # You can also pass in a TimeZone instance or string that identifies a TimeZone as an argument, + # and the conversion will be based on that zone instead of Time.zone. + # + # Time.utc(2000).in_time_zone('Alaska') # => Fri, 31 Dec 1999 15:00:00 AKST -09:00 + # Date.new(2000).in_time_zone('Alaska') # => Sat, 01 Jan 2000 00:00:00 AKST -09:00 + # + # source://activesupport//lib/active_support/core_ext/date_and_time/zones.rb#20 + def in_time_zone(zone = T.unsafe(nil)); end + + private + + # source://activesupport//lib/active_support/core_ext/date_and_time/zones.rb#32 + def time_with_zone(time, zone); end +end + +# source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#5 +class DateTime < ::Date + include ::DateAndTime::Compatibility + + # Layers additional behavior on DateTime#<=> so that Time and + # ActiveSupport::TimeWithZone instances can be compared with a DateTime. + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#208 + def <=>(other); end + + # Duck-types as a Date-like class. See Object#acts_like?. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/date_time/acts_like.rb#8 + def acts_like_date?; end + + # Duck-types as a Time-like class. See Object#acts_like?. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/date_time/acts_like.rb#13 + def acts_like_time?; end + + # Uses Date to provide precise Time calculations for years, months, and days. + # The +options+ parameter takes a hash with any of these keys: :years, + # :months, :weeks, :days, :hours, + # :minutes, :seconds. + # + # Just like Date#advance, increments are applied in order of time units from + # largest to smallest. This order can affect the result around the end of a + # month. + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#82 + def advance(options); end + + # Returns a new DateTime representing the time a number of seconds ago. + # Do not use this method in combination with x.months, use months_ago instead! + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#109 + def ago(seconds); end + + # source://activesupport//lib/active_support/core_ext/object/json.rb#221 + def as_json(options = T.unsafe(nil)); end + + # Returns a new DateTime representing the start of the day (0:00). + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#127 + def at_beginning_of_day; end + + # Returns a new DateTime representing the start of the hour (hh:00:00). + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#149 + def at_beginning_of_hour; end + + # Returns a new DateTime representing the start of the minute (hh:mm:00). + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#161 + def at_beginning_of_minute; end + + # Returns a new DateTime representing the end of the day (23:59:59). + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#143 + def at_end_of_day; end + + # Returns a new DateTime representing the end of the hour (hh:59:59). + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#155 + def at_end_of_hour; end + + # Returns a new DateTime representing the end of the minute (hh:mm:59). + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#167 + def at_end_of_minute; end + + # Returns a new DateTime representing the middle of the day (12:00) + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#135 + def at_midday; end + + # Returns a new DateTime representing the middle of the day (12:00) + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#137 + def at_middle_of_day; end + + # Returns a new DateTime representing the start of the day (0:00). + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#126 + def at_midnight; end + + # Returns a new DateTime representing the middle of the day (12:00) + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#136 + def at_noon; end + + # Returns a new DateTime representing the start of the day (0:00). + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#122 + def beginning_of_day; end + + # Returns a new DateTime representing the start of the hour (hh:00:00). + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#146 + def beginning_of_hour; end + + # Returns a new DateTime representing the start of the minute (hh:mm:00). + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#158 + def beginning_of_minute; end + + # No DateTime is ever blank: + # + # DateTime.now.blank? # => false + # + # @return [false] + # + # source://activesupport//lib/active_support/core_ext/date_time/blank.rb#11 + def blank?; end + + # Returns a new DateTime where one or more of the elements have been changed + # according to the +options+ parameter. The time options (:hour, + # :min, :sec) reset cascadingly, so if only the hour is + # passed, then minute and sec is set to 0. If the hour and minute is passed, + # then sec is set to 0. The +options+ parameter takes a hash with any of these + # keys: :year, :month, :day, :hour, + # :min, :sec, :offset, :start. + # + # DateTime.new(2012, 8, 29, 22, 35, 0).change(day: 1) # => DateTime.new(2012, 8, 1, 22, 35, 0) + # DateTime.new(2012, 8, 29, 22, 35, 0).change(year: 1981, day: 1) # => DateTime.new(1981, 8, 1, 22, 35, 0) + # DateTime.new(2012, 8, 29, 22, 35, 0).change(year: 1981, hour: 0) # => DateTime.new(1981, 8, 29, 0, 0, 0) + # + # @raise [ArgumentError] + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#51 + def change(options); end + + # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#61 + def default_inspect; end + + # Returns a new DateTime representing the end of the day (23:59:59). + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#140 + def end_of_day; end + + # Returns a new DateTime representing the end of the hour (hh:59:59). + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#152 + def end_of_hour; end + + # Returns a new DateTime representing the end of the minute (hh:mm:59). + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#164 + def end_of_minute; end + + # Returns a formatted string of the offset from UTC, or an alternative + # string if the time zone is already UTC. + # + # datetime = DateTime.civil(2000, 1, 1, 0, 0, 0, Rational(-6, 24)) + # datetime.formatted_offset # => "-06:00" + # datetime.formatted_offset(false) # => "-0600" + # + # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#53 + def formatted_offset(colon = T.unsafe(nil), alternate_utc_string = T.unsafe(nil)); end + + # Returns a Time instance of the simultaneous time in the UTC timezone. + # + # DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24)) # => Mon, 21 Feb 2005 10:11:12 -0600 + # DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24)).utc # => Mon, 21 Feb 2005 16:11:12 UTC + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#192 + def getgm; end + + # Returns a Time instance of the simultaneous time in the system timezone. + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#178 + def getlocal(utc_offset = T.unsafe(nil)); end + + # Returns a Time instance of the simultaneous time in the UTC timezone. + # + # DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24)) # => Mon, 21 Feb 2005 10:11:12 -0600 + # DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24)).utc # => Mon, 21 Feb 2005 16:11:12 UTC + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#193 + def getutc; end + + # Returns a Time instance of the simultaneous time in the UTC timezone. + # + # DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24)) # => Mon, 21 Feb 2005 10:11:12 -0600 + # DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24)).utc # => Mon, 21 Feb 2005 16:11:12 UTC + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#194 + def gmtime; end + + # Returns a new DateTime representing the time a number of seconds since the + # instance time. Do not use this method in combination with x.months, use + # months_since instead! + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#119 + def in(seconds); end + + # Overrides the default inspect method with a human readable one, e.g., "Mon, 21 Feb 2005 14:30:00 +0000". + # + # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#62 + def inspect; end + + # Returns a Time instance of the simultaneous time in the system timezone. + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#170 + def localtime(utc_offset = T.unsafe(nil)); end + + # Returns a new DateTime representing the middle of the day (12:00) + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#133 + def midday; end + + # Returns a new DateTime representing the middle of the day (12:00) + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#130 + def middle_of_day; end + + # Returns a new DateTime representing the start of the day (0:00). + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#125 + def midnight; end + + # Returns a new DateTime representing the middle of the day (12:00) + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#134 + def noon; end + + # Returns the fraction of a second as nanoseconds + # + # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#96 + def nsec; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/date_time/blank.rb#15 + def present?; end + + # Overrides the default inspect method with a human readable one, e.g., "Mon, 21 Feb 2005 14:30:00 +0000". + # + # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#58 + def readable_inspect; end + + # Returns the number of seconds since 00:00:00. + # + # DateTime.new(2012, 8, 29, 0, 0, 0).seconds_since_midnight # => 0 + # DateTime.new(2012, 8, 29, 12, 34, 56).seconds_since_midnight # => 45296 + # DateTime.new(2012, 8, 29, 23, 59, 59).seconds_since_midnight # => 86399 + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#20 + def seconds_since_midnight; end + + # Returns the number of seconds until 23:59:59. + # + # DateTime.new(2012, 8, 29, 0, 0, 0).seconds_until_end_of_day # => 86399 + # DateTime.new(2012, 8, 29, 12, 34, 56).seconds_until_end_of_day # => 41103 + # DateTime.new(2012, 8, 29, 23, 59, 59).seconds_until_end_of_day # => 0 + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#29 + def seconds_until_end_of_day; end + + # Returns a new DateTime representing the time a number of seconds since the + # instance time. Do not use this method in combination with x.months, use + # months_since instead! + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#116 + def since(seconds); end + + # Returns the fraction of a second as a +Rational+ + # + # DateTime.new(2012, 8, 29, 0, 0, 0.5).subsec # => (1/2) + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#36 + def subsec; end + + # Converts +self+ to a floating-point number of seconds, including fractional microseconds, since the Unix epoch. + # + # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#81 + def to_f; end + + # Convert to a formatted string. See Time::DATE_FORMATS for predefined formats. + # + # This method is aliased to to_formatted_s. + # + # ==== Examples + # + # datetime = DateTime.civil(2007, 12, 4, 0, 0, 0, 0) # => Tue, 04 Dec 2007 00:00:00 +0000 + # + # datetime.to_fs(:db) # => "2007-12-04 00:00:00" + # datetime.to_formatted_s(:db) # => "2007-12-04 00:00:00" + # datetime.to_fs(:number) # => "20071204000000" + # datetime.to_fs(:short) # => "04 Dec 00:00" + # datetime.to_fs(:long) # => "December 04, 2007 00:00" + # datetime.to_fs(:long_ordinal) # => "December 4th, 2007 00:00" + # datetime.to_fs(:rfc822) # => "Tue, 04 Dec 2007 00:00:00 +0000" + # datetime.to_fs(:iso8601) # => "2007-12-04T00:00:00+00:00" + # + # ==== Adding your own datetime formats to +to_fs+ + # + # DateTime formats are shared with Time. You can add your own to the + # Time::DATE_FORMATS hash. Use the format name as the hash key and + # either a strftime string or Proc instance that takes a time or + # datetime argument as the value. + # + # # config/initializers/time_formats.rb + # Time::DATE_FORMATS[:month_and_year] = '%B %Y' + # Time::DATE_FORMATS[:short_ordinal] = lambda { |time| time.strftime("%B #{time.day.ordinalize}") } + # + # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#44 + def to_formatted_s(format = T.unsafe(nil)); end + + # Convert to a formatted string. See Time::DATE_FORMATS for predefined formats. + # + # This method is aliased to to_formatted_s. + # + # ==== Examples + # + # datetime = DateTime.civil(2007, 12, 4, 0, 0, 0, 0) # => Tue, 04 Dec 2007 00:00:00 +0000 + # + # datetime.to_fs(:db) # => "2007-12-04 00:00:00" + # datetime.to_formatted_s(:db) # => "2007-12-04 00:00:00" + # datetime.to_fs(:number) # => "20071204000000" + # datetime.to_fs(:short) # => "04 Dec 00:00" + # datetime.to_fs(:long) # => "December 04, 2007 00:00" + # datetime.to_fs(:long_ordinal) # => "December 4th, 2007 00:00" + # datetime.to_fs(:rfc822) # => "Tue, 04 Dec 2007 00:00:00 +0000" + # datetime.to_fs(:iso8601) # => "2007-12-04T00:00:00+00:00" + # + # ==== Adding your own datetime formats to +to_fs+ + # + # DateTime formats are shared with Time. You can add your own to the + # Time::DATE_FORMATS hash. Use the format name as the hash key and + # either a strftime string or Proc instance that takes a time or + # datetime argument as the value. + # + # # config/initializers/time_formats.rb + # Time::DATE_FORMATS[:month_and_year] = '%B %Y' + # Time::DATE_FORMATS[:short_ordinal] = lambda { |time| time.strftime("%B #{time.day.ordinalize}") } + # + # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#37 + def to_fs(format = T.unsafe(nil)); end + + # Converts +self+ to an integer number of seconds since the Unix epoch. + # + # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#86 + def to_i; end + + # Return an instance of +Time+ with the same UTC offset + # as +self+. + # + # source://activesupport//lib/active_support/core_ext/date_time/compatibility.rb#9 + def to_time; end + + # Returns the fraction of a second as microseconds + # + # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#91 + def usec; end + + # Returns a Time instance of the simultaneous time in the UTC timezone. + # + # DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24)) # => Mon, 21 Feb 2005 10:11:12 -0600 + # DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24)).utc # => Mon, 21 Feb 2005 16:11:12 UTC + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#184 + def utc; end + + # Returns +true+ if offset == 0. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#197 + def utc?; end + + # Returns the offset value in seconds. + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#202 + def utc_offset; end + + private + + # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#101 + def offset_in_seconds; end + + # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#105 + def seconds_since_unix_epoch; end + + class << self + # Returns DateTime with local offset for given year if format is local else + # offset is zero. + # + # DateTime.civil_from_format :local, 2012 + # # => Sun, 01 Jan 2012 00:00:00 +0300 + # DateTime.civil_from_format :local, 2012, 12, 17 + # # => Mon, 17 Dec 2012 00:00:00 +0000 + # + # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#71 + def civil_from_format(utc_or_local, year, month = T.unsafe(nil), day = T.unsafe(nil), hour = T.unsafe(nil), min = T.unsafe(nil), sec = T.unsafe(nil)); end + + # Returns Time.zone.now.to_datetime when Time.zone or + # config.time_zone are set, otherwise returns + # Time.now.to_datetime. + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#10 + def current; end + end +end + +# source://activesupport//lib/active_support/core_ext/object/try.rb#117 +class Delegator < ::BasicObject + include ::ActiveSupport::Tryable +end + +# source://activesupport//lib/active_support/core_ext/digest/uuid.rb#7 +module Digest::UUID + class << self + # Returns the nil UUID. This is a special form of UUID that is specified to + # have all 128 bits set to zero. + # + # source://activesupport//lib/active_support/core_ext/digest/uuid.rb#58 + def nil_uuid; end + + # Generates a v5 non-random UUID (Universally Unique IDentifier). + # + # Using OpenSSL::Digest::MD5 generates version 3 UUIDs; OpenSSL::Digest::SHA1 generates version 5 UUIDs. + # uuid_from_hash always generates the same UUID for a given name and namespace combination. + # + # See RFC 4122 for details of UUID at: https://www.ietf.org/rfc/rfc4122.txt + # + # source://activesupport//lib/active_support/core_ext/digest/uuid.rb#19 + def uuid_from_hash(hash_class, namespace, name); end + + # Convenience method for uuid_from_hash using OpenSSL::Digest::MD5. + # + # source://activesupport//lib/active_support/core_ext/digest/uuid.rb#42 + def uuid_v3(uuid_namespace, name); end + + # Convenience method for SecureRandom.uuid. + # + # source://activesupport//lib/active_support/core_ext/digest/uuid.rb#52 + def uuid_v4; end + + # Convenience method for uuid_from_hash using OpenSSL::Digest::SHA1. + # + # source://activesupport//lib/active_support/core_ext/digest/uuid.rb#47 + def uuid_v5(uuid_namespace, name); end + + private + + # source://activesupport//lib/active_support/core_ext/digest/uuid.rb#62 + def pack_uuid_namespace(namespace); end + end +end + +# source://activesupport//lib/active_support/core_ext/digest/uuid.rb#8 +Digest::UUID::DNS_NAMESPACE = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/core_ext/digest/uuid.rb#10 +Digest::UUID::OID_NAMESPACE = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/core_ext/digest/uuid.rb#9 +Digest::UUID::URL_NAMESPACE = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/core_ext/digest/uuid.rb#11 +Digest::UUID::X500_NAMESPACE = T.let(T.unsafe(nil), String) + +module ERB::Escape; end + +# source://activesupport//lib/active_support/core_ext/erb/util.rb#39 +module ERB::Util + include ::ActiveSupport::CoreExt::ERBUtil + include ::ActiveSupport::CoreExt::ERBUtilPrivate + extend ::ActiveSupport::CoreExt::ERBUtil + + private + + # A utility method for escaping HTML without affecting existing escaped entities. + # + # html_escape_once('1 < 2 & 3') + # # => "1 < 2 & 3" + # + # html_escape_once('<< Accept & Checkout') + # # => "<< Accept & Checkout" + # + # source://activesupport//lib/active_support/core_ext/erb/util.rb#63 + def html_escape_once(s); end + + # A utility method for escaping HTML entities in JSON strings. Specifically, the + # &, > and < characters are replaced with their equivalent unicode escaped form - + # \u0026, \u003e, and \u003c. The Unicode sequences \u2028 and \u2029 are also + # escaped as they are treated as newline characters in some JavaScript engines. + # These sequences have identical meaning as the original characters inside the + # context of a JSON string, so assuming the input is a valid and well-formed + # JSON value, the output will have equivalent meaning when parsed: + # + # json = JSON.generate({ name: ""}) + # # => "{\"name\":\"\"}" + # + # json_escape(json) + # # => "{\"name\":\"\\u003C/script\\u003E\\u003Cscript\\u003Ealert('PWNED!!!')\\u003C/script\\u003E\"}" + # + # JSON.parse(json) == JSON.parse(json_escape(json)) + # # => true + # + # The intended use case for this method is to escape JSON strings before including + # them inside a script tag to avoid XSS vulnerability: + # + # + # + # It is necessary to +raw+ the result of +json_escape+, so that quotation marks + # don't get converted to " entities. +json_escape+ doesn't + # automatically flag the result as HTML safe, since the raw value is unsafe to + # use inside HTML attributes. + # + # If your JSON is being used downstream for insertion into the DOM, be aware of + # whether or not it is being inserted via html(). Most jQuery plugins do this. + # If that is the case, be sure to +html_escape+ or +sanitize+ any user-generated + # content returned by your JSON. + # + # If you need to output JSON elsewhere in your HTML, you can just do something + # like this, as any unsafe characters (including quotation marks) will be + # automatically escaped for you: + # + #
    ...
    + # + # WARNING: this helper only works with valid JSON. Using this on non-JSON values + # will open up serious XSS vulnerabilities. For example, if you replace the + # +current_user.to_json+ in the example above with user input instead, the browser + # will happily eval() that string as JavaScript. + # + # The escaping performed in this method is identical to those performed in the + # Active Support JSON encoder when +ActiveSupport.escape_html_entities_in_json+ is + # set to true. Because this transformation is idempotent, this helper can be + # applied even if +ActiveSupport.escape_html_entities_in_json+ is already true. + # + # Therefore, when you are unsure if +ActiveSupport.escape_html_entities_in_json+ + # is enabled, or if you are unsure where your JSON string originated from, it + # is recommended that you always apply this helper (other libraries, such as the + # JSON gem, do not provide this kind of protection by default; also some gems + # might override +to_json+ to bypass Active Support's encoder). + # + # source://activesupport//lib/active_support/core_ext/erb/util.rb#124 + def json_escape(s); end + + # A utility method for escaping XML names of tags and names of attributes. + # + # xml_name_escape('1 < 2 & 3') + # # => "1___2___3" + # + # It follows the requirements of the specification: https://www.w3.org/TR/REC-xml/#NT-Name + # + # source://activesupport//lib/active_support/core_ext/erb/util.rb#142 + def xml_name_escape(name); end + + class << self + # A utility method for escaping HTML without affecting existing escaped entities. + # + # html_escape_once('1 < 2 & 3') + # # => "1 < 2 & 3" + # + # html_escape_once('<< Accept & Checkout') + # # => "<< Accept & Checkout" + # + # source://activesupport//lib/active_support/core_ext/erb/util.rb#67 + def html_escape_once(s); end + + # A utility method for escaping HTML entities in JSON strings. Specifically, the + # &, > and < characters are replaced with their equivalent unicode escaped form - + # \u0026, \u003e, and \u003c. The Unicode sequences \u2028 and \u2029 are also + # escaped as they are treated as newline characters in some JavaScript engines. + # These sequences have identical meaning as the original characters inside the + # context of a JSON string, so assuming the input is a valid and well-formed + # JSON value, the output will have equivalent meaning when parsed: + # + # json = JSON.generate({ name: ""}) + # # => "{\"name\":\"\"}" + # + # json_escape(json) + # # => "{\"name\":\"\\u003C/script\\u003E\\u003Cscript\\u003Ealert('PWNED!!!')\\u003C/script\\u003E\"}" + # + # JSON.parse(json) == JSON.parse(json_escape(json)) + # # => true + # + # The intended use case for this method is to escape JSON strings before including + # them inside a script tag to avoid XSS vulnerability: + # + # + # + # It is necessary to +raw+ the result of +json_escape+, so that quotation marks + # don't get converted to " entities. +json_escape+ doesn't + # automatically flag the result as HTML safe, since the raw value is unsafe to + # use inside HTML attributes. + # + # If your JSON is being used downstream for insertion into the DOM, be aware of + # whether or not it is being inserted via html(). Most jQuery plugins do this. + # If that is the case, be sure to +html_escape+ or +sanitize+ any user-generated + # content returned by your JSON. + # + # If you need to output JSON elsewhere in your HTML, you can just do something + # like this, as any unsafe characters (including quotation marks) will be + # automatically escaped for you: + # + #
    ...
    + # + # WARNING: this helper only works with valid JSON. Using this on non-JSON values + # will open up serious XSS vulnerabilities. For example, if you replace the + # +current_user.to_json+ in the example above with user input instead, the browser + # will happily eval() that string as JavaScript. + # + # The escaping performed in this method is identical to those performed in the + # Active Support JSON encoder when +ActiveSupport.escape_html_entities_in_json+ is + # set to true. Because this transformation is idempotent, this helper can be + # applied even if +ActiveSupport.escape_html_entities_in_json+ is already true. + # + # Therefore, when you are unsure if +ActiveSupport.escape_html_entities_in_json+ + # is enabled, or if you are unsure where your JSON string originated from, it + # is recommended that you always apply this helper (other libraries, such as the + # JSON gem, do not provide this kind of protection by default; also some gems + # might override +to_json+ to bypass Active Support's encoder). + # + # source://activesupport//lib/active_support/core_ext/erb/util.rb#134 + def json_escape(s); end + + # Tokenizes a line of ERB. This is really just for error reporting and + # nobody should use it. + # + # source://activesupport//lib/active_support/core_ext/erb/util.rb#161 + def tokenize(source); end + + # source://activesupport//lib/active_support/core_ext/erb/util.rb#10 + def unwrapped_html_escape(s); end + + # A utility method for escaping XML names of tags and names of attributes. + # + # xml_name_escape('1 < 2 & 3') + # # => "1___2___3" + # + # It follows the requirements of the specification: https://www.w3.org/TR/REC-xml/#NT-Name + # + # source://activesupport//lib/active_support/core_ext/erb/util.rb#157 + def xml_name_escape(name); end + end +end + +# source://activesupport//lib/active_support/core_ext/erb/util.rb#40 +ERB::Util::HTML_ESCAPE = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/core_ext/erb/util.rb#41 +ERB::Util::HTML_ESCAPE_ONCE_REGEXP = T.let(T.unsafe(nil), Regexp) + +# source://activesupport//lib/active_support/core_ext/erb/util.rb#49 +ERB::Util::INVALID_TAG_NAME_FOLLOWING_REGEXP = T.let(T.unsafe(nil), Regexp) + +# source://activesupport//lib/active_support/core_ext/erb/util.rb#47 +ERB::Util::INVALID_TAG_NAME_START_REGEXP = T.let(T.unsafe(nil), Regexp) + +# source://activesupport//lib/active_support/core_ext/erb/util.rb#50 +ERB::Util::SAFE_XML_TAG_NAME_REGEXP = T.let(T.unsafe(nil), Regexp) + +# source://activesupport//lib/active_support/core_ext/erb/util.rb#48 +ERB::Util::TAG_NAME_FOLLOWING_CODEPOINTS = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/core_ext/erb/util.rb#51 +ERB::Util::TAG_NAME_REPLACEMENT_CHAR = T.let(T.unsafe(nil), String) + +# Following XML requirements: https://www.w3.org/TR/REC-xml/#NT-Name +# +# source://activesupport//lib/active_support/core_ext/erb/util.rb#44 +ERB::Util::TAG_NAME_START_CODEPOINTS = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/core_ext/object/json.rb#145 +module Enumerable + include ::ActiveSupport::ToJsonWithActiveSupportEncoder + extend ::ActiveSupport::EnumerableCoreExt::Constants + + # source://activesupport//lib/active_support/core_ext/object/json.rb#146 + def as_json(options = T.unsafe(nil)); end + + # Returns a new +Array+ without the blank items. + # Uses Object#blank? for determining if an item is blank. + # + # [1, "", nil, 2, " ", [], {}, false, true].compact_blank + # # => [1, 2, true] + # + # Set.new([nil, "", 1, false]).compact_blank + # # => [1] + # + # When called on a +Hash+, returns a new +Hash+ without the blank values. + # + # { a: "", b: 1, c: nil, d: [], e: false, f: true }.compact_blank + # # => { b: 1, f: true } + # + # source://activesupport//lib/active_support/core_ext/enumerable.rb#184 + def compact_blank; end + + # The negative of the Enumerable#include?. Returns +true+ if the + # collection does not include the object. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/enumerable.rb#118 + def exclude?(object); end + + # Returns a copy of the enumerable excluding the specified elements. + # + # ["David", "Rafael", "Aaron", "Todd"].excluding "Aaron", "Todd" + # # => ["David", "Rafael"] + # + # ["David", "Rafael", "Aaron", "Todd"].excluding %w[ Aaron Todd ] + # # => ["David", "Rafael"] + # + # {foo: 1, bar: 2, baz: 3}.excluding :bar + # # => {foo: 1, baz: 3} + # + # source://activesupport//lib/active_support/core_ext/enumerable.rb#132 + def excluding(*elements); end + + # Returns a new +Array+ where the order has been set to that provided in the +series+, based on the +key+ of the + # objects in the original enumerable. + # + # [ Person.find(5), Person.find(3), Person.find(1) ].in_order_of(:id, [ 1, 5, 3 ]) + # # => [ Person.find(1), Person.find(5), Person.find(3) ] + # + # If the +series+ include keys that have no corresponding element in the Enumerable, these are ignored. + # If the Enumerable has additional elements that aren't named in the +series+, these are not included in the result, unless + # the +filter+ option is set to +false+. + # + # source://activesupport//lib/active_support/core_ext/enumerable.rb#197 + def in_order_of(key, series, filter: T.unsafe(nil)); end + + # Returns a new array that includes the passed elements. + # + # [ 1, 2, 3 ].including(4, 5) + # # => [ 1, 2, 3, 4, 5 ] + # + # ["David", "Rafael"].including %w[ Aaron Todd ] + # # => ["David", "Rafael", "Aaron", "Todd"] + # + # source://activesupport//lib/active_support/core_ext/enumerable.rb#112 + def including(*elements); end + + # Convert an enumerable to a hash, using the block result as the key and the + # element as the value. + # + # people.index_by(&:login) + # # => { "nextangle" => , "chade-" => , ...} + # + # people.index_by { |person| "#{person.first_name} #{person.last_name}" } + # # => { "Chade- Fowlersburg-e" => , "David Heinemeier Hansson" => , ...} + # + # source://activesupport//lib/active_support/core_ext/enumerable.rb#52 + def index_by; end + + # Convert an enumerable to a hash, using the element as the key and the block + # result as the value. + # + # post = Post.new(title: "hey there", body: "what's up?") + # + # %i( title body ).index_with { |attr_name| post.public_send(attr_name) } + # # => { title: "hey there", body: "what's up?" } + # + # If an argument is passed instead of a block, it will be used as the value + # for all elements: + # + # %i( created_at updated_at ).index_with(Time.now) + # # => { created_at: 2020-03-09 22:31:47, updated_at: 2020-03-09 22:31:47 } + # + # source://activesupport//lib/active_support/core_ext/enumerable.rb#75 + def index_with(default = T.unsafe(nil)); end + + # Returns +true+ if the enumerable has more than 1 element. Functionally + # equivalent to enum.to_a.size > 1. Can be called with a block too, + # much like any?, so people.many? { |p| p.age > 26 } returns +true+ + # if more than one person is over 26. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/enumerable.rb#93 + def many?; end + + # Calculates the maximum from the extracted elements. + # + # payments = [Payment.new(5), Payment.new(15), Payment.new(10)] + # payments.maximum(:price) # => 15 + # + # source://activesupport//lib/active_support/core_ext/enumerable.rb#40 + def maximum(key); end + + # Calculates the minimum from the extracted elements. + # + # payments = [Payment.new(5), Payment.new(15), Payment.new(10)] + # payments.minimum(:price) # => 5 + # + # source://activesupport//lib/active_support/core_ext/enumerable.rb#32 + def minimum(key); end + + # Extract the given key from the first element in the enumerable. + # + # [{ name: "David" }, { name: "Rafael" }, { name: "Aaron" }].pick(:name) + # # => "David" + # + # [{ id: 1, name: "David" }, { id: 2, name: "Rafael" }].pick(:id, :name) + # # => [1, "David"] + # + # source://activesupport//lib/active_support/core_ext/enumerable.rb#161 + def pick(*keys); end + + # Extract the given key from each element in the enumerable. + # + # [{ name: "David" }, { name: "Rafael" }, { name: "Aaron" }].pluck(:name) + # # => ["David", "Rafael", "Aaron"] + # + # [{ id: 1, name: "David" }, { id: 2, name: "Rafael" }].pluck(:id, :name) + # # => [[1, "David"], [2, "Rafael"]] + # + # source://activesupport//lib/active_support/core_ext/enumerable.rb#145 + def pluck(*keys); end + + # Returns the sole item in the enumerable. If there are no items, or more + # than one item, raises Enumerable::SoleItemExpectedError. + # + # ["x"].sole # => "x" + # Set.new.sole # => Enumerable::SoleItemExpectedError: no item found + # { a: 1, b: 2 }.sole # => Enumerable::SoleItemExpectedError: multiple items found + # + # source://activesupport//lib/active_support/core_ext/enumerable.rb#211 + def sole; end + + # Returns a copy of the enumerable excluding the specified elements. + # + # ["David", "Rafael", "Aaron", "Todd"].excluding "Aaron", "Todd" + # # => ["David", "Rafael"] + # + # ["David", "Rafael", "Aaron", "Todd"].excluding %w[ Aaron Todd ] + # # => ["David", "Rafael"] + # + # {foo: 1, bar: 2, baz: 3}.excluding :bar + # # => {foo: 1, baz: 3} + # + # source://activesupport//lib/active_support/core_ext/enumerable.rb#136 + def without(*elements); end +end + +# Error generated by +sole+ when called on an enumerable that doesn't have +# exactly one item. +# +# source://activesupport//lib/active_support/core_ext/enumerable.rb#21 +class Enumerable::SoleItemExpectedError < ::StandardError; end + +# source://activesupport//lib/active_support/core_ext/object/json.rb#263 +class Exception + # source://activesupport//lib/active_support/core_ext/object/json.rb#264 + def as_json(options = T.unsafe(nil)); end +end + +# source://activesupport//lib/active_support/core_ext/object/blank.rb#65 +class FalseClass + # source://activesupport//lib/active_support/core_ext/object/json.rb#87 + def as_json(options = T.unsafe(nil)); end + + # +false+ is blank: + # + # false.blank? # => true + # + # @return [true] + # + # source://activesupport//lib/active_support/core_ext/object/blank.rb#71 + def blank?; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/object/blank.rb#75 + def present?; end + + # Returns +self+. + # + # source://activesupport//lib/active_support/core_ext/object/to_query.rb#40 + def to_param; end +end + +# source://activesupport//lib/active_support/core_ext/file/atomic.rb#5 +class File < ::IO + class << self + # Write to a file atomically. Useful for situations where you don't + # want other processes or threads to see half-written files. + # + # File.atomic_write('important.file') do |file| + # file.write('hello') + # end + # + # This method needs to create a temporary file. By default it will create it + # in the same directory as the destination file. If you don't like this + # behavior you can provide a different directory but it must be on the + # same physical filesystem as the file you're trying to write. + # + # File.atomic_write('/data/something.important', '/data/tmp') do |file| + # file.write('hello') + # end + # + # source://activesupport//lib/active_support/core_ext/file/atomic.rb#21 + def atomic_write(file_name, temp_dir = T.unsafe(nil)); end + + # Private utility method. + # + # source://activesupport//lib/active_support/core_ext/file/atomic.rb#56 + def probe_stat_in(dir); end + end +end + +# source://activesupport//lib/active_support/core_ext/object/json.rb#116 +class Float < ::Numeric + include ::ActiveSupport::NumericWithFormat + + # Encoding Infinity or NaN to JSON should return "null". The default returns + # "Infinity" or "NaN" which are not valid JSON. + # + # source://activesupport//lib/active_support/core_ext/object/json.rb#119 + def as_json(options = T.unsafe(nil)); end +end + +# source://activesupport//lib/active_support/core_ext/hash/deep_merge.rb#5 +class Hash + include ::Enumerable + include ::ActiveSupport::DeepMergeable + + # source://activesupport//lib/active_support/core_ext/object/json.rb#175 + def as_json(options = T.unsafe(nil)); end + + # Validates all keys in a hash match *valid_keys, raising + # +ArgumentError+ on a mismatch. + # + # Note that keys are treated differently than HashWithIndifferentAccess, + # meaning that string and symbol keys will not match. + # + # { name: 'Rob', years: '28' }.assert_valid_keys(:name, :age) # => raises "ArgumentError: Unknown key: :years. Valid keys are: :name, :age" + # { name: 'Rob', age: '28' }.assert_valid_keys('name', 'age') # => raises "ArgumentError: Unknown key: :name. Valid keys are: 'name', 'age'" + # { name: 'Rob', age: '28' }.assert_valid_keys(:name, :age) # => passes, raises nothing + # + # source://activesupport//lib/active_support/core_ext/hash/keys.rb#48 + def assert_valid_keys(*valid_keys); end + + # A hash is blank if it's empty: + # + # {}.blank? # => true + # { key: 'value' }.blank? # => false + # + # @return [true, false] + # + # source://activesupport//lib/active_support/core_ext/object/blank.rb#116 + def blank?; end + + # Hash#reject has its own definition, so this needs one too. + # + # source://activesupport//lib/active_support/core_ext/enumerable.rb#234 + def compact_blank; end + + # Removes all blank values from the +Hash+ in place and returns self. + # Uses Object#blank? for determining if a value is blank. + # + # h = { a: "", b: 1, c: nil, d: [], e: false, f: true } + # h.compact_blank! + # # => { b: 1, f: true } + # + # source://activesupport//lib/active_support/core_ext/enumerable.rb#244 + def compact_blank!; end + + # Returns a deep copy of hash. + # + # hash = { a: { b: 'b' } } + # dup = hash.deep_dup + # dup[:a][:c] = 'c' + # + # hash[:a][:c] # => nil + # dup[:a][:c] # => "c" + # + # source://activesupport//lib/active_support/core_ext/object/deep_dup.rb#43 + def deep_dup; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/hash/deep_merge.rb#40 + def deep_merge?(other); end + + # Returns a new hash with all keys converted to strings. + # This includes the keys from the root hash and from all + # nested hashes and arrays. + # + # hash = { person: { name: 'Rob', age: '28' } } + # + # hash.deep_stringify_keys + # # => {"person"=>{"name"=>"Rob", "age"=>"28"}} + # + # source://activesupport//lib/active_support/core_ext/hash/keys.rb#84 + def deep_stringify_keys; end + + # Destructively converts all keys to strings. + # This includes the keys from the root hash and from all + # nested hashes and arrays. + # + # source://activesupport//lib/active_support/core_ext/hash/keys.rb#91 + def deep_stringify_keys!; end + + # Returns a new hash with all keys converted to symbols, as long as + # they respond to +to_sym+. This includes the keys from the root hash + # and from all nested hashes and arrays. + # + # hash = { 'person' => { 'name' => 'Rob', 'age' => '28' } } + # + # hash.deep_symbolize_keys + # # => {:person=>{:name=>"Rob", :age=>"28"}} + # + # source://activesupport//lib/active_support/core_ext/hash/keys.rb#103 + def deep_symbolize_keys; end + + # Destructively converts all keys to symbols, as long as they respond + # to +to_sym+. This includes the keys from the root hash and from all + # nested hashes and arrays. + # + # source://activesupport//lib/active_support/core_ext/hash/keys.rb#110 + def deep_symbolize_keys!; end + + # Returns a new hash with all keys converted by the block operation. + # This includes the keys from the root hash and from all + # nested hashes and arrays. + # + # hash = { person: { name: 'Rob', age: '28' } } + # + # hash.deep_transform_keys{ |key| key.to_s.upcase } + # # => {"PERSON"=>{"NAME"=>"Rob", "AGE"=>"28"}} + # + # source://activesupport//lib/active_support/core_ext/hash/keys.rb#65 + def deep_transform_keys(&block); end + + # Destructively converts all keys by using the block operation. + # This includes the keys from the root hash and from all + # nested hashes and arrays. + # + # source://activesupport//lib/active_support/core_ext/hash/keys.rb#72 + def deep_transform_keys!(&block); end + + # Returns a new hash with all values converted by the block operation. + # This includes the values from the root hash and from all + # nested hashes and arrays. + # + # hash = { person: { name: 'Rob', age: '28' } } + # + # hash.deep_transform_values{ |value| value.to_s.upcase } + # # => {person: {name: "ROB", age: "28"}} + # + # source://activesupport//lib/active_support/core_ext/hash/deep_transform_values.rb#12 + def deep_transform_values(&block); end + + # Destructively converts all values by using the block operation. + # This includes the values from the root hash and from all + # nested hashes and arrays. + # + # source://activesupport//lib/active_support/core_ext/hash/deep_transform_values.rb#19 + def deep_transform_values!(&block); end + + # Removes the given keys from hash and returns it. + # hash = { a: true, b: false, c: nil } + # hash.except!(:c) # => { a: true, b: false } + # hash # => { a: true, b: false } + # + # source://activesupport//lib/active_support/core_ext/hash/except.rb#8 + def except!(*keys); end + + # Removes and returns the key/value pairs matching the given keys. + # + # hash = { a: 1, b: 2, c: 3, d: 4 } + # hash.extract!(:a, :b) # => {:a=>1, :b=>2} + # hash # => {:c=>3, :d=>4} + # + # source://activesupport//lib/active_support/core_ext/hash/slice.rb#24 + def extract!(*keys); end + + # By default, only instances of Hash itself are extractable. + # Subclasses of Hash may implement this method and return + # true to declare themselves as extractable. If a Hash + # is extractable, Array#extract_options! pops it from + # the Array when it is the last element of the Array. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/array/extract_options.rb#9 + def extractable_options?; end + + # Returns an ActiveSupport::HashWithIndifferentAccess out of its receiver: + # + # { a: 1 }.with_indifferent_access['a'] # => 1 + # Called when object is nested under an object that receives + # #with_indifferent_access. This method will be called on the current object + # by the enclosing object and is aliased to #with_indifferent_access by + # default. Subclasses of Hash may override this method to return +self+ if + # converting to an ActiveSupport::HashWithIndifferentAccess would not be + # desirable. + # + # b = { b: 1 } + # { a: b }.with_indifferent_access['a'] # calls b.nested_under_indifferent_access + # # => {"b"=>1} + # + # source://activesupport//lib/active_support/core_ext/hash/indifferent_access.rb#23 + def nested_under_indifferent_access; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/object/blank.rb#118 + def present?; end + + # Merges the caller into +other_hash+. For example, + # + # options = options.reverse_merge(size: 25, velocity: 10) + # + # is equivalent to + # + # options = { size: 25, velocity: 10 }.merge(options) + # + # This is particularly useful for initializing an options hash + # with default values. + # + # source://activesupport//lib/active_support/core_ext/hash/reverse_merge.rb#14 + def reverse_merge(other_hash); end + + # Destructive +reverse_merge+. + # + # source://activesupport//lib/active_support/core_ext/hash/reverse_merge.rb#20 + def reverse_merge!(other_hash); end + + # Destructive +reverse_merge+. + # + # source://activesupport//lib/active_support/core_ext/hash/reverse_merge.rb#23 + def reverse_update(other_hash); end + + # Replaces the hash with only the given keys. + # Returns a hash containing the removed key/value pairs. + # + # hash = { a: 1, b: 2, c: 3, d: 4 } + # hash.slice!(:a, :b) # => {:c=>3, :d=>4} + # hash # => {:a=>1, :b=>2} + # + # source://activesupport//lib/active_support/core_ext/hash/slice.rb#10 + def slice!(*keys); end + + # Returns a new hash with all keys converted to strings. + # + # hash = { name: 'Rob', age: '28' } + # + # hash.stringify_keys + # # => {"name"=>"Rob", "age"=>"28"} + # + # source://activesupport//lib/active_support/core_ext/hash/keys.rb#10 + def stringify_keys; end + + # Destructively converts all keys to strings. Same as + # +stringify_keys+, but modifies +self+. + # + # source://activesupport//lib/active_support/core_ext/hash/keys.rb#16 + def stringify_keys!; end + + # Returns a new hash with all keys converted to symbols, as long as + # they respond to +to_sym+. + # + # hash = { 'name' => 'Rob', 'age' => '28' } + # + # hash.symbolize_keys + # # => {:name=>"Rob", :age=>"28"} + # + # source://activesupport//lib/active_support/core_ext/hash/keys.rb#27 + def symbolize_keys; end + + # Destructively converts all keys to symbols, as long as they respond + # to +to_sym+. Same as +symbolize_keys+, but modifies +self+. + # + # source://activesupport//lib/active_support/core_ext/hash/keys.rb#34 + def symbolize_keys!; end + + # Returns a new hash with all keys converted to symbols, as long as + # they respond to +to_sym+. + # + # hash = { 'name' => 'Rob', 'age' => '28' } + # + # hash.symbolize_keys + # # => {:name=>"Rob", :age=>"28"} + # + # source://activesupport//lib/active_support/core_ext/hash/keys.rb#30 + def to_options; end + + # Destructively converts all keys to symbols, as long as they respond + # to +to_sym+. Same as +symbolize_keys+, but modifies +self+. + # + # source://activesupport//lib/active_support/core_ext/hash/keys.rb#37 + def to_options!; end + + # Returns a string representation of the receiver suitable for use as a URL + # query string: + # + # {name: 'David', nationality: 'Danish'}.to_query + # # => "name=David&nationality=Danish" + # + # An optional namespace can be passed to enclose key names: + # + # {name: 'David', nationality: 'Danish'}.to_query('user') + # # => "user%5Bname%5D=David&user%5Bnationality%5D=Danish" + # + # The string pairs "key=value" that conform the query string + # are sorted lexicographically in ascending order. + # + # source://activesupport//lib/active_support/core_ext/object/to_query.rb#92 + def to_param(namespace = T.unsafe(nil)); end + + # Returns a string representation of the receiver suitable for use as a URL + # query string: + # + # {name: 'David', nationality: 'Danish'}.to_query + # # => "name=David&nationality=Danish" + # + # An optional namespace can be passed to enclose key names: + # + # {name: 'David', nationality: 'Danish'}.to_query('user') + # # => "user%5Bname%5D=David&user%5Bnationality%5D=Danish" + # + # The string pairs "key=value" that conform the query string + # are sorted lexicographically in ascending order. + # + # source://activesupport//lib/active_support/core_ext/object/to_query.rb#81 + def to_query(namespace = T.unsafe(nil)); end + + # Returns a string containing an XML representation of its receiver: + # + # { foo: 1, bar: 2 }.to_xml + # # => + # # + # # + # # 1 + # # 2 + # # + # + # To do so, the method loops over the pairs and builds nodes that depend on + # the _values_. Given a pair +key+, +value+: + # + # * If +value+ is a hash there's a recursive call with +key+ as :root. + # + # * If +value+ is an array there's a recursive call with +key+ as :root, + # and +key+ singularized as :children. + # + # * If +value+ is a callable object it must expect one or two arguments. Depending + # on the arity, the callable is invoked with the +options+ hash as first argument + # with +key+ as :root, and +key+ singularized as second argument. The + # callable can add nodes by using options[:builder]. + # + # {foo: lambda { |options, key| options[:builder].b(key) }}.to_xml + # # => "foo" + # + # * If +value+ responds to +to_xml+ the method is invoked with +key+ as :root. + # + # class Foo + # def to_xml(options) + # options[:builder].bar 'fooing!' + # end + # end + # + # { foo: Foo.new }.to_xml(skip_instruct: true) + # # => + # # + # # fooing! + # # + # + # * Otherwise, a node with +key+ as tag is created with a string representation of + # +value+ as text node. If +value+ is +nil+ an attribute "nil" set to "true" is added. + # Unless the option :skip_types exists and is true, an attribute "type" is + # added as well according to the following mapping: + # + # XML_TYPE_NAMES = { + # "Symbol" => "symbol", + # "Integer" => "integer", + # "BigDecimal" => "decimal", + # "Float" => "float", + # "TrueClass" => "boolean", + # "FalseClass" => "boolean", + # "Date" => "date", + # "DateTime" => "dateTime", + # "Time" => "dateTime" + # } + # + # By default the root node is "hash", but that's configurable via the :root option. + # + # The default XML builder is a fresh instance of +Builder::XmlMarkup+. You can + # configure your own builder with the :builder option. The method also accepts + # options like :dasherize and friends, they are forwarded to the builder. + # + # source://activesupport//lib/active_support/core_ext/hash/conversions.rb#74 + def to_xml(options = T.unsafe(nil)); end + + # Merges the caller into +other_hash+. For example, + # + # options = options.reverse_merge(size: 25, velocity: 10) + # + # is equivalent to + # + # options = { size: 25, velocity: 10 }.merge(options) + # + # This is particularly useful for initializing an options hash + # with default values. + # + # source://activesupport//lib/active_support/core_ext/hash/reverse_merge.rb#17 + def with_defaults(other_hash); end + + # Destructive +reverse_merge+. + # + # source://activesupport//lib/active_support/core_ext/hash/reverse_merge.rb#24 + def with_defaults!(other_hash); end + + # Returns an ActiveSupport::HashWithIndifferentAccess out of its receiver: + # + # { a: 1 }.with_indifferent_access['a'] # => 1 + # + # source://activesupport//lib/active_support/core_ext/hash/indifferent_access.rb#9 + def with_indifferent_access; end + + private + + # Support methods for deep transforming nested hashes and arrays. + # + # source://activesupport//lib/active_support/core_ext/hash/keys.rb#116 + def _deep_transform_keys_in_object(object, &block); end + + # source://activesupport//lib/active_support/core_ext/hash/keys.rb#129 + def _deep_transform_keys_in_object!(object, &block); end + + # Support methods for deep transforming nested hashes and arrays. + # + # source://activesupport//lib/active_support/core_ext/hash/deep_transform_values.rb#25 + def _deep_transform_values_in_object(object, &block); end + + # source://activesupport//lib/active_support/core_ext/hash/deep_transform_values.rb#36 + def _deep_transform_values_in_object!(object, &block); end + + class << self + # Builds a Hash from XML just like Hash.from_xml, but also allows Symbol and YAML. + # + # source://activesupport//lib/active_support/core_ext/hash/conversions.rb#133 + def from_trusted_xml(xml); end + + # Returns a Hash containing a collection of pairs when the key is the node name and the value is + # its content + # + # xml = <<-XML + # + # + # 1 + # 2 + # + # XML + # + # hash = Hash.from_xml(xml) + # # => {"hash"=>{"foo"=>1, "bar"=>2}} + # + # +DisallowedType+ is raised if the XML contains attributes with type="yaml" or + # type="symbol". Use Hash.from_trusted_xml to + # parse this XML. + # + # Custom +disallowed_types+ can also be passed in the form of an + # array. + # + # xml = <<-XML + # + # + # 1 + # "David" + # + # XML + # + # hash = Hash.from_xml(xml, ['integer']) + # # => ActiveSupport::XMLConverter::DisallowedType: Disallowed type attribute: "integer" + # + # Note that passing custom disallowed types will override the default types, + # which are Symbol and YAML. + # + # source://activesupport//lib/active_support/core_ext/hash/conversions.rb#128 + def from_xml(xml, disallowed_types = T.unsafe(nil)); end + end +end + +# :stopdoc: +# +# source://activesupport//lib/active_support/hash_with_indifferent_access.rb#464 +HashWithIndifferentAccess = ActiveSupport::HashWithIndifferentAccess + +# :enddoc: +# +# source://activesupport//lib/active_support/i18n_railtie.rb#9 +module I18n; end + +# source://activesupport//lib/active_support/i18n_railtie.rb#10 +class I18n::Railtie < ::Rails::Railtie + class << self + # source://activesupport//lib/active_support/i18n_railtie.rb#103 + def include_fallbacks_module; end + + # source://activesupport//lib/active_support/i18n_railtie.rb#107 + def init_fallbacks(fallbacks); end + + # Setup i18n configuration. + # + # source://activesupport//lib/active_support/i18n_railtie.rb#36 + def initialize_i18n(app); end + + # source://activesupport//lib/active_support/i18n_railtie.rb#84 + def setup_raise_on_missing_translations_config(app, strict); end + + # source://activesupport//lib/active_support/i18n_railtie.rb#123 + def validate_fallbacks(fallbacks); end + + # source://activesupport//lib/active_support/i18n_railtie.rb#134 + def watched_dirs_with_extensions(paths); end + end +end + +# source://activesupport//lib/active_support/core_ext/object/json.rb#151 +class IO + include ::Enumerable + include ::File::Constants + + # source://activesupport//lib/active_support/core_ext/object/json.rb#152 + def as_json(options = T.unsafe(nil)); end +end + +class IO::Buffer + include ::Comparable + + def initialize(*_arg0); end + + def &(_arg0); end + def <=>(_arg0); end + def ^(_arg0); end + def and!(_arg0); end + def clear(*_arg0); end + def copy(*_arg0); end + def each(*_arg0); end + def each_byte(*_arg0); end + def empty?; end + def external?; end + def free; end + def get_string(*_arg0); end + def get_value(_arg0, _arg1); end + def get_values(_arg0, _arg1); end + def hexdump(*_arg0); end + def inspect; end + def internal?; end + def locked; end + def locked?; end + def mapped?; end + def not!; end + def null?; end + def or!(_arg0); end + def pread(*_arg0); end + def private?; end + def pwrite(*_arg0); end + def read(*_arg0); end + def readonly?; end + def resize(_arg0); end + def set_string(*_arg0); end + def set_value(_arg0, _arg1, _arg2); end + def set_values(_arg0, _arg1, _arg2); end + def shared?; end + def size; end + def slice(*_arg0); end + def to_s; end + def transfer; end + def valid?; end + def values(*_arg0); end + def write(*_arg0); end + def xor!(_arg0); end + def |(_arg0); end + def ~; end + + private + + def initialize_copy(_arg0); end + + class << self + def for(_arg0); end + def map(*_arg0); end + def size_of(_arg0); end + def string(_arg0); end + end +end + +class IO::Buffer::AccessError < ::RuntimeError; end +class IO::Buffer::AllocationError < ::RuntimeError; end +IO::Buffer::BIG_ENDIAN = T.let(T.unsafe(nil), Integer) +IO::Buffer::DEFAULT_SIZE = T.let(T.unsafe(nil), Integer) +IO::Buffer::EXTERNAL = T.let(T.unsafe(nil), Integer) +IO::Buffer::HOST_ENDIAN = T.let(T.unsafe(nil), Integer) +IO::Buffer::INTERNAL = T.let(T.unsafe(nil), Integer) +class IO::Buffer::InvalidatedError < ::RuntimeError; end +IO::Buffer::LITTLE_ENDIAN = T.let(T.unsafe(nil), Integer) +IO::Buffer::LOCKED = T.let(T.unsafe(nil), Integer) +class IO::Buffer::LockedError < ::RuntimeError; end +IO::Buffer::MAPPED = T.let(T.unsafe(nil), Integer) +class IO::Buffer::MaskError < ::ArgumentError; end +IO::Buffer::NETWORK_ENDIAN = T.let(T.unsafe(nil), Integer) +IO::Buffer::PAGE_SIZE = T.let(T.unsafe(nil), Integer) +IO::Buffer::PRIVATE = T.let(T.unsafe(nil), Integer) +IO::Buffer::READONLY = T.let(T.unsafe(nil), Integer) +IO::Buffer::SHARED = T.let(T.unsafe(nil), Integer) +class IO::ConsoleMode; end + +class IO::EAGAINWaitReadable < ::Errno::EAGAIN + include ::IO::WaitReadable +end + +class IO::EAGAINWaitWritable < ::Errno::EAGAIN + include ::IO::WaitWritable +end + +class IO::EINPROGRESSWaitReadable < ::Errno::EINPROGRESS + include ::IO::WaitReadable +end + +class IO::EINPROGRESSWaitWritable < ::Errno::EINPROGRESS + include ::IO::WaitWritable +end + +IO::EWOULDBLOCKWaitReadable = IO::EAGAINWaitReadable +IO::EWOULDBLOCKWaitWritable = IO::EAGAINWaitWritable +IO::PRIORITY = T.let(T.unsafe(nil), Integer) +IO::READABLE = T.let(T.unsafe(nil), Integer) +IO::WRITABLE = T.let(T.unsafe(nil), Integer) + +# source://activesupport//lib/active_support/core_ext/integer/time.rb#6 +class Integer < ::Numeric + include ::ActiveSupport::NumericWithFormat + + # Returns a Duration instance matching the number of months provided. + # + # 2.months # => 2 months + # + # source://activesupport//lib/active_support/core_ext/integer/time.rb#13 + def month; end + + # Returns a Duration instance matching the number of months provided. + # + # 2.months # => 2 months + # + # source://activesupport//lib/active_support/core_ext/integer/time.rb#10 + def months; end + + # Returns a Duration instance matching the number of years provided. + # + # 2.years # => 2 years + # + # source://activesupport//lib/active_support/core_ext/integer/time.rb#21 + def year; end + + # Returns a Duration instance matching the number of years provided. + # + # 2.years # => 2 years + # + # source://activesupport//lib/active_support/core_ext/integer/time.rb#18 + def years; end +end + +Integer::GMP_VERSION = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/core_ext/kernel/reporting.rb#3 +module Kernel + private + + # Sets $VERBOSE to +true+ for the duration of the block and back to its + # original value afterwards. + # + # source://activesupport//lib/active_support/core_ext/kernel/reporting.rb#20 + def enable_warnings(&block); end + + # Sets $VERBOSE to +nil+ for the duration of the block and back to its original + # value afterwards. + # + # silence_warnings do + # value = noisy_call # no warning voiced + # end + # + # noisy_call # warning voiced + # + # source://activesupport//lib/active_support/core_ext/kernel/reporting.rb#14 + def silence_warnings(&block); end + + # Blocks and ignores any exception passed as argument if raised within the block. + # + # suppress(ZeroDivisionError) do + # 1/0 + # puts 'This code is NOT reached' + # end + # + # puts 'This code gets executed and nothing related to ZeroDivisionError was seen' + # + # source://activesupport//lib/active_support/core_ext/kernel/reporting.rb#41 + def suppress(*exception_classes); end + + # Sets $VERBOSE for the duration of the block and back to its original + # value afterwards. + # + # source://activesupport//lib/active_support/core_ext/kernel/reporting.rb#26 + def with_warnings(flag); end + + class << self + # Sets $VERBOSE to +true+ for the duration of the block and back to its + # original value afterwards. + # + # source://activesupport//lib/active_support/core_ext/kernel/reporting.rb#20 + def enable_warnings(&block); end + + # Sets $VERBOSE to +nil+ for the duration of the block and back to its original + # value afterwards. + # + # silence_warnings do + # value = noisy_call # no warning voiced + # end + # + # noisy_call # warning voiced + # + # source://activesupport//lib/active_support/core_ext/kernel/reporting.rb#14 + def silence_warnings(&block); end + + # Blocks and ignores any exception passed as argument if raised within the block. + # + # suppress(ZeroDivisionError) do + # 1/0 + # puts 'This code is NOT reached' + # end + # + # puts 'This code gets executed and nothing related to ZeroDivisionError was seen' + # + # source://activesupport//lib/active_support/core_ext/kernel/reporting.rb#41 + def suppress(*exception_classes); end + + # Sets $VERBOSE for the duration of the block and back to its original + # value afterwards. + # + # source://activesupport//lib/active_support/core_ext/kernel/reporting.rb#26 + def with_warnings(flag); end + end +end + +# == Attribute Accessors per Thread +# +# Extends the module object with class/module and instance accessors for +# class/module attributes, just like the native attr* accessors for instance +# attributes, but does so on a per-thread basis. +# +# So the values are scoped within the Thread.current space under the class name +# of the module. +# +# Note that it can also be scoped per-fiber if +Rails.application.config.active_support.isolation_level+ +# is set to +:fiber+. +# +# source://activesupport//lib/active_support/core_ext/module/delegation.rb#3 +class Module + include ::Module::Concerning + + # Allows you to make aliases for attributes, which includes + # getter, setter, and a predicate. + # + # class Content < ActiveRecord::Base + # # has a title attribute + # end + # + # class Email < Content + # alias_attribute :subject, :title + # end + # + # e = Email.find(1) + # e.title # => "Superstars" + # e.subject # => "Superstars" + # e.subject? # => true + # e.subject = "Megastars" + # e.title # => "Megastars" + # + # source://activesupport//lib/active_support/core_ext/module/aliasing.rb#21 + def alias_attribute(new_name, old_name); end + + # A module may or may not have a name. + # + # module M; end + # M.name # => "M" + # + # m = Module.new + # m.name # => nil + # + # +anonymous?+ method returns true if module does not have a name, false otherwise: + # + # Module.new.anonymous? # => true + # + # module M; end + # M.anonymous? # => false + # + # A module gets a name when it is first assigned to a constant. Either + # via the +module+ or +class+ keyword or by an explicit assignment: + # + # m = Module.new # creates an anonymous module + # m.anonymous? # => true + # M = m # m gets a name here as a side-effect + # m.name # => "M" + # m.anonymous? # => false + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/module/anonymous.rb#27 + def anonymous?; end + + # source://activesupport//lib/active_support/core_ext/object/json.rb#53 + def as_json(options = T.unsafe(nil)); end + + # Declares an attribute reader and writer backed by an internally-named instance + # variable. + # + # source://activesupport//lib/active_support/core_ext/module/attr_internal.rb#20 + def attr_internal(*attrs); end + + # Declares an attribute reader and writer backed by an internally-named instance + # variable. + # + # source://activesupport//lib/active_support/core_ext/module/attr_internal.rb#16 + def attr_internal_accessor(*attrs); end + + # Declares an attribute reader backed by an internally-named instance variable. + # + # source://activesupport//lib/active_support/core_ext/module/attr_internal.rb#5 + def attr_internal_reader(*attrs); end + + # Declares an attribute writer backed by an internally-named instance variable. + # + # source://activesupport//lib/active_support/core_ext/module/attr_internal.rb#10 + def attr_internal_writer(*attrs); end + + # Defines both class and instance accessors for class attributes. + # All class and instance methods created will be public, even if + # this method is called with a private or protected access modifier. + # + # module HairColors + # mattr_accessor :hair_colors + # end + # + # class Person + # include HairColors + # end + # + # HairColors.hair_colors = [:brown, :black, :blonde, :red] + # HairColors.hair_colors # => [:brown, :black, :blonde, :red] + # Person.new.hair_colors # => [:brown, :black, :blonde, :red] + # + # If a subclass changes the value then that would also change the value for + # parent class. Similarly if parent class changes the value then that would + # change the value of subclasses too. + # + # class Citizen < Person + # end + # + # Citizen.new.hair_colors << :blue + # Person.new.hair_colors # => [:brown, :black, :blonde, :red, :blue] + # + # To omit the instance writer method, pass instance_writer: false. + # To omit the instance reader method, pass instance_reader: false. + # + # module HairColors + # mattr_accessor :hair_colors, instance_writer: false, instance_reader: false + # end + # + # class Person + # include HairColors + # end + # + # Person.new.hair_colors = [:brown] # => NoMethodError + # Person.new.hair_colors # => NoMethodError + # + # Or pass instance_accessor: false, to omit both instance methods. + # + # module HairColors + # mattr_accessor :hair_colors, instance_accessor: false + # end + # + # class Person + # include HairColors + # end + # + # Person.new.hair_colors = [:brown] # => NoMethodError + # Person.new.hair_colors # => NoMethodError + # + # You can set a default value for the attribute. + # + # module HairColors + # mattr_accessor :hair_colors, default: [:brown, :black, :blonde, :red] + # mattr_accessor(:hair_styles) { [:long, :short] } + # end + # + # class Person + # include HairColors + # end + # + # Person.class_variable_get("@@hair_colors") # => [:brown, :black, :blonde, :red] + # Person.class_variable_get("@@hair_styles") # => [:long, :short] + # + # source://activesupport//lib/active_support/core_ext/module/attribute_accessors.rb#213 + def cattr_accessor(*syms, instance_reader: T.unsafe(nil), instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil), &blk); end + + # Defines a class attribute and creates a class and instance reader methods. + # The underlying class variable is set to +nil+, if it is not previously + # defined. All class and instance methods created will be public, even if + # this method is called with a private or protected access modifier. + # + # module HairColors + # mattr_reader :hair_colors + # end + # + # HairColors.hair_colors # => nil + # HairColors.class_variable_set("@@hair_colors", [:brown, :black]) + # HairColors.hair_colors # => [:brown, :black] + # + # The attribute name must be a valid method name in Ruby. + # + # module Foo + # mattr_reader :"1_Badname" + # end + # # => NameError: invalid attribute name: 1_Badname + # + # To omit the instance reader method, pass + # instance_reader: false or instance_accessor: false. + # + # module HairColors + # mattr_reader :hair_colors, instance_reader: false + # end + # + # class Person + # include HairColors + # end + # + # Person.new.hair_colors # => NoMethodError + # + # You can set a default value for the attribute. + # + # module HairColors + # mattr_reader :hair_colors, default: [:brown, :black, :blonde, :red] + # mattr_reader(:hair_styles) { [:long, :short] } + # end + # + # class Person + # include HairColors + # end + # + # Person.new.hair_colors # => [:brown, :black, :blonde, :red] + # Person.new.hair_styles # => [:long, :short] + # + # @raise [TypeError] + # + # source://activesupport//lib/active_support/core_ext/module/attribute_accessors.rb#75 + def cattr_reader(*syms, instance_reader: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil), location: T.unsafe(nil)); end + + # Defines a class attribute and creates a class and instance writer methods to + # allow assignment to the attribute. All class and instance methods created + # will be public, even if this method is called with a private or protected + # access modifier. + # + # module HairColors + # mattr_writer :hair_colors + # end + # + # class Person + # include HairColors + # end + # + # HairColors.hair_colors = [:brown, :black] + # Person.class_variable_get("@@hair_colors") # => [:brown, :black] + # Person.new.hair_colors = [:blonde, :red] + # HairColors.class_variable_get("@@hair_colors") # => [:blonde, :red] + # + # To omit the instance writer method, pass + # instance_writer: false or instance_accessor: false. + # + # module HairColors + # mattr_writer :hair_colors, instance_writer: false + # end + # + # class Person + # include HairColors + # end + # + # Person.new.hair_colors = [:blonde, :red] # => NoMethodError + # + # You can set a default value for the attribute. + # + # module HairColors + # mattr_writer :hair_colors, default: [:brown, :black, :blonde, :red] + # mattr_writer(:hair_styles) { [:long, :short] } + # end + # + # class Person + # include HairColors + # end + # + # Person.class_variable_get("@@hair_colors") # => [:brown, :black, :blonde, :red] + # Person.class_variable_get("@@hair_styles") # => [:long, :short] + # + # @raise [TypeError] + # + # source://activesupport//lib/active_support/core_ext/module/attribute_accessors.rb#140 + def cattr_writer(*syms, instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil), location: T.unsafe(nil)); end + + # Returns a copy of module or class if it's anonymous. If it's + # named, returns +self+. + # + # Object.deep_dup == Object # => true + # klass = Class.new + # klass.deep_dup == klass # => false + # + # source://activesupport//lib/active_support/core_ext/object/deep_dup.rb#64 + def deep_dup; end + + # Provides a +delegate+ class method to easily expose contained objects' + # public methods as your own. + # + # ==== Options + # * :to - Specifies the target object name as a symbol or string + # * :prefix - Prefixes the new method with the target name or a custom prefix + # * :allow_nil - If set to true, prevents a +ActiveSupport::DelegationError+ + # from being raised + # * :private - If set to true, changes method visibility to private + # + # The macro receives one or more method names (specified as symbols or + # strings) and the name of the target object via the :to option + # (also a symbol or string). + # + # Delegation is particularly useful with Active Record associations: + # + # class Greeter < ActiveRecord::Base + # def hello + # 'hello' + # end + # + # def goodbye + # 'goodbye' + # end + # end + # + # class Foo < ActiveRecord::Base + # belongs_to :greeter + # delegate :hello, to: :greeter + # end + # + # Foo.new.hello # => "hello" + # Foo.new.goodbye # => NoMethodError: undefined method `goodbye' for # + # + # Multiple delegates to the same target are allowed: + # + # class Foo < ActiveRecord::Base + # belongs_to :greeter + # delegate :hello, :goodbye, to: :greeter + # end + # + # Foo.new.goodbye # => "goodbye" + # + # Methods can be delegated to instance variables, class variables, or constants + # by providing them as a symbols: + # + # class Foo + # CONSTANT_ARRAY = [0,1,2,3] + # @@class_array = [4,5,6,7] + # + # def initialize + # @instance_array = [8,9,10,11] + # end + # delegate :sum, to: :CONSTANT_ARRAY + # delegate :min, to: :@@class_array + # delegate :max, to: :@instance_array + # end + # + # Foo.new.sum # => 6 + # Foo.new.min # => 4 + # Foo.new.max # => 11 + # + # It's also possible to delegate a method to the class by using +:class+: + # + # class Foo + # def self.hello + # "world" + # end + # + # delegate :hello, to: :class + # end + # + # Foo.new.hello # => "world" + # + # Delegates can optionally be prefixed using the :prefix option. If the value + # is true, the delegate methods are prefixed with the name of the object being + # delegated to. + # + # Person = Struct.new(:name, :address) + # + # class Invoice < Struct.new(:client) + # delegate :name, :address, to: :client, prefix: true + # end + # + # john_doe = Person.new('John Doe', 'Vimmersvej 13') + # invoice = Invoice.new(john_doe) + # invoice.client_name # => "John Doe" + # invoice.client_address # => "Vimmersvej 13" + # + # It is also possible to supply a custom prefix. + # + # class Invoice < Struct.new(:client) + # delegate :name, :address, to: :client, prefix: :customer + # end + # + # invoice = Invoice.new(john_doe) + # invoice.customer_name # => 'John Doe' + # invoice.customer_address # => 'Vimmersvej 13' + # + # The delegated methods are public by default. + # Pass private: true to change that. + # + # class User < ActiveRecord::Base + # has_one :profile + # delegate :first_name, to: :profile + # delegate :date_of_birth, to: :profile, private: true + # + # def age + # Date.today.year - date_of_birth.year + # end + # end + # + # User.new.first_name # => "Tomas" + # User.new.date_of_birth # => NoMethodError: private method `date_of_birth' called for # + # User.new.age # => 2 + # + # If the target is +nil+ and does not respond to the delegated method a + # +ActiveSupport::DelegationError+ is raised. If you wish to instead return +nil+, + # use the :allow_nil option. + # + # class User < ActiveRecord::Base + # has_one :profile + # delegate :age, to: :profile + # end + # + # User.new.age + # # => ActiveSupport::DelegationError: User#age delegated to profile.age, but profile is nil + # + # But if not having a profile yet is fine and should not be an error + # condition: + # + # class User < ActiveRecord::Base + # has_one :profile + # delegate :age, to: :profile, allow_nil: true + # end + # + # User.new.age # nil + # + # Note that if the target is not +nil+ then the call is attempted regardless of the + # :allow_nil option, and thus an exception is still raised if said object + # does not respond to the method: + # + # class Foo + # def initialize(bar) + # @bar = bar + # end + # + # delegate :name, to: :@bar, allow_nil: true + # end + # + # Foo.new("Bar").name # raises NoMethodError: undefined method `name' + # + # The target method must be public, otherwise it will raise +NoMethodError+. + # + # source://activesupport//lib/active_support/core_ext/module/delegation.rb#160 + def delegate(*methods, to: T.unsafe(nil), prefix: T.unsafe(nil), allow_nil: T.unsafe(nil), private: T.unsafe(nil)); end + + # When building decorators, a common pattern may emerge: + # + # class Partition + # def initialize(event) + # @event = event + # end + # + # def person + # detail.person || creator + # end + # + # private + # def respond_to_missing?(name, include_private = false) + # @event.respond_to?(name, include_private) + # end + # + # def method_missing(method, *args, &block) + # @event.send(method, *args, &block) + # end + # end + # + # With Module#delegate_missing_to, the above is condensed to: + # + # class Partition + # delegate_missing_to :@event + # + # def initialize(event) + # @event = event + # end + # + # def person + # detail.person || creator + # end + # end + # + # The target can be anything callable within the object, e.g. instance + # variables, methods, constants, etc. + # + # The delegated method must be public on the target, otherwise it will + # raise +ActiveSupport::DelegationError+. If you wish to instead return +nil+, + # use the :allow_nil option. + # + # The marshal_dump and _dump methods are exempt from + # delegation due to possible interference when calling + # Marshal.dump(object), should the delegation target method + # of object add or remove instance variables. + # + # source://activesupport//lib/active_support/core_ext/module/delegation.rb#218 + def delegate_missing_to(target, allow_nil: T.unsafe(nil)); end + + # deprecate :foo, deprecator: MyLib.deprecator + # deprecate :foo, bar: "warning!", deprecator: MyLib.deprecator + # + # A deprecator is typically an instance of ActiveSupport::Deprecation, but you can also pass any object that responds + # to deprecation_warning(deprecated_method_name, message, caller_backtrace) where you can implement your + # custom warning behavior. + # + # class MyLib::Deprecator + # def deprecation_warning(deprecated_method_name, message, caller_backtrace = nil) + # message = "#{deprecated_method_name} is deprecated and will be removed from MyLibrary | #{message}" + # Kernel.warn message + # end + # end + # + # source://activesupport//lib/active_support/core_ext/module/deprecation.rb#17 + def deprecate(*method_names, deprecator:, **options); end + + # Defines both class and instance accessors for class attributes. + # All class and instance methods created will be public, even if + # this method is called with a private or protected access modifier. + # + # module HairColors + # mattr_accessor :hair_colors + # end + # + # class Person + # include HairColors + # end + # + # HairColors.hair_colors = [:brown, :black, :blonde, :red] + # HairColors.hair_colors # => [:brown, :black, :blonde, :red] + # Person.new.hair_colors # => [:brown, :black, :blonde, :red] + # + # If a subclass changes the value then that would also change the value for + # parent class. Similarly if parent class changes the value then that would + # change the value of subclasses too. + # + # class Citizen < Person + # end + # + # Citizen.new.hair_colors << :blue + # Person.new.hair_colors # => [:brown, :black, :blonde, :red, :blue] + # + # To omit the instance writer method, pass instance_writer: false. + # To omit the instance reader method, pass instance_reader: false. + # + # module HairColors + # mattr_accessor :hair_colors, instance_writer: false, instance_reader: false + # end + # + # class Person + # include HairColors + # end + # + # Person.new.hair_colors = [:brown] # => NoMethodError + # Person.new.hair_colors # => NoMethodError + # + # Or pass instance_accessor: false, to omit both instance methods. + # + # module HairColors + # mattr_accessor :hair_colors, instance_accessor: false + # end + # + # class Person + # include HairColors + # end + # + # Person.new.hair_colors = [:brown] # => NoMethodError + # Person.new.hair_colors # => NoMethodError + # + # You can set a default value for the attribute. + # + # module HairColors + # mattr_accessor :hair_colors, default: [:brown, :black, :blonde, :red] + # mattr_accessor(:hair_styles) { [:long, :short] } + # end + # + # class Person + # include HairColors + # end + # + # Person.class_variable_get("@@hair_colors") # => [:brown, :black, :blonde, :red] + # Person.class_variable_get("@@hair_styles") # => [:long, :short] + # + # source://activesupport//lib/active_support/core_ext/module/attribute_accessors.rb#208 + def mattr_accessor(*syms, instance_reader: T.unsafe(nil), instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil), &blk); end + + # Defines a class attribute and creates a class and instance reader methods. + # The underlying class variable is set to +nil+, if it is not previously + # defined. All class and instance methods created will be public, even if + # this method is called with a private or protected access modifier. + # + # module HairColors + # mattr_reader :hair_colors + # end + # + # HairColors.hair_colors # => nil + # HairColors.class_variable_set("@@hair_colors", [:brown, :black]) + # HairColors.hair_colors # => [:brown, :black] + # + # The attribute name must be a valid method name in Ruby. + # + # module Foo + # mattr_reader :"1_Badname" + # end + # # => NameError: invalid attribute name: 1_Badname + # + # To omit the instance reader method, pass + # instance_reader: false or instance_accessor: false. + # + # module HairColors + # mattr_reader :hair_colors, instance_reader: false + # end + # + # class Person + # include HairColors + # end + # + # Person.new.hair_colors # => NoMethodError + # + # You can set a default value for the attribute. + # + # module HairColors + # mattr_reader :hair_colors, default: [:brown, :black, :blonde, :red] + # mattr_reader(:hair_styles) { [:long, :short] } + # end + # + # class Person + # include HairColors + # end + # + # Person.new.hair_colors # => [:brown, :black, :blonde, :red] + # Person.new.hair_styles # => [:long, :short] + # + # @raise [TypeError] + # + # source://activesupport//lib/active_support/core_ext/module/attribute_accessors.rb#55 + def mattr_reader(*syms, instance_reader: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil), location: T.unsafe(nil)); end + + # Defines a class attribute and creates a class and instance writer methods to + # allow assignment to the attribute. All class and instance methods created + # will be public, even if this method is called with a private or protected + # access modifier. + # + # module HairColors + # mattr_writer :hair_colors + # end + # + # class Person + # include HairColors + # end + # + # HairColors.hair_colors = [:brown, :black] + # Person.class_variable_get("@@hair_colors") # => [:brown, :black] + # Person.new.hair_colors = [:blonde, :red] + # HairColors.class_variable_get("@@hair_colors") # => [:blonde, :red] + # + # To omit the instance writer method, pass + # instance_writer: false or instance_accessor: false. + # + # module HairColors + # mattr_writer :hair_colors, instance_writer: false + # end + # + # class Person + # include HairColors + # end + # + # Person.new.hair_colors = [:blonde, :red] # => NoMethodError + # + # You can set a default value for the attribute. + # + # module HairColors + # mattr_writer :hair_colors, default: [:brown, :black, :blonde, :red] + # mattr_writer(:hair_styles) { [:long, :short] } + # end + # + # class Person + # include HairColors + # end + # + # Person.class_variable_get("@@hair_colors") # => [:brown, :black, :blonde, :red] + # Person.class_variable_get("@@hair_styles") # => [:long, :short] + # + # @raise [TypeError] + # + # source://activesupport//lib/active_support/core_ext/module/attribute_accessors.rb#121 + def mattr_writer(*syms, instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil), location: T.unsafe(nil)); end + + # source://activesupport//lib/active_support/core_ext/module/redefine_method.rb#30 + def method_visibility(method); end + + # Returns the module which contains this one according to its name. + # + # module M + # module N + # end + # end + # X = M::N + # + # M::N.module_parent # => M + # X.module_parent # => M + # + # The parent of top-level and anonymous modules is Object. + # + # M.module_parent # => Object + # Module.new.module_parent # => Object + # + # source://activesupport//lib/active_support/core_ext/module/introspection.rb#37 + def module_parent; end + + # Returns the name of the module containing this one. + # + # M::N.module_parent_name # => "M" + # + # source://activesupport//lib/active_support/core_ext/module/introspection.rb#9 + def module_parent_name; end + + # Returns all the parents of this module according to its name, ordered from + # nested outwards. The receiver is not contained within the result. + # + # module M + # module N + # end + # end + # X = M::N + # + # M.module_parents # => [Object] + # M::N.module_parents # => [M, Object] + # X.module_parents # => [M, Object] + # + # source://activesupport//lib/active_support/core_ext/module/introspection.rb#53 + def module_parents; end + + # Replaces the existing method definition, if there is one, with the passed + # block as its body. + # + # source://activesupport//lib/active_support/core_ext/module/redefine_method.rb#17 + def redefine_method(method, &block); end + + # Replaces the existing singleton method definition, if there is one, with + # the passed block as its body. + # + # source://activesupport//lib/active_support/core_ext/module/redefine_method.rb#26 + def redefine_singleton_method(method, &block); end + + # Removes the named method, if it exists. + # + # source://activesupport//lib/active_support/core_ext/module/remove_method.rb#7 + def remove_possible_method(method); end + + # Removes the named singleton method, if it exists. + # + # source://activesupport//lib/active_support/core_ext/module/remove_method.rb#14 + def remove_possible_singleton_method(method); end + + # Marks the named method as intended to be redefined, if it exists. + # Suppresses the Ruby method redefinition warning. Prefer + # #redefine_method where possible. + # + # source://activesupport//lib/active_support/core_ext/module/redefine_method.rb#7 + def silence_redefinition_of_method(method); end + + # Defines both class and instance accessors for class attributes. + # + # class Account + # thread_mattr_accessor :user + # end + # + # Account.user = "DHH" + # Account.user # => "DHH" + # Account.new.user # => "DHH" + # + # Unlike +mattr_accessor+, values are *not* shared with subclasses or parent classes. + # If a subclass changes the value, the parent class' value is not changed. + # If the parent class changes the value, the value of subclasses is not changed. + # + # class Customer < Account + # end + # + # Account.user # => "DHH" + # Customer.user # => nil + # Customer.user = "Rafael" + # Customer.user # => "Rafael" + # Account.user # => "DHH" + # + # To omit the instance writer method, pass instance_writer: false. + # To omit the instance reader method, pass instance_reader: false. + # + # class Current + # thread_mattr_accessor :user, instance_writer: false, instance_reader: false + # end + # + # Current.new.user = "DHH" # => NoMethodError + # Current.new.user # => NoMethodError + # + # Or pass instance_accessor: false, to omit both instance methods. + # + # class Current + # thread_mattr_accessor :user, instance_accessor: false + # end + # + # Current.new.user = "DHH" # => NoMethodError + # Current.new.user # => NoMethodError + # + # A default value may be specified using the +:default+ option. Because + # multiple threads can access the default value, non-frozen default values + # will be duped and frozen. + # + # source://activesupport//lib/active_support/core_ext/module/attribute_accessors_per_thread.rb#174 + def thread_cattr_accessor(*syms, instance_reader: T.unsafe(nil), instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil)); end + + # Defines a per-thread class attribute and creates class and instance reader methods. + # The underlying per-thread class variable is set to +nil+, if it is not previously defined. + # + # module Current + # thread_mattr_reader :user + # end + # + # Current.user = "DHH" + # Current.user # => "DHH" + # Thread.new { Current.user }.value # => nil + # + # The attribute name must be a valid method name in Ruby. + # + # module Foo + # thread_mattr_reader :"1_Badname" + # end + # # => NameError: invalid attribute name: 1_Badname + # + # To omit the instance reader method, pass + # instance_reader: false or instance_accessor: false. + # + # class Current + # thread_mattr_reader :user, instance_reader: false + # end + # + # Current.new.user # => NoMethodError + # + # source://activesupport//lib/active_support/core_ext/module/attribute_accessors_per_thread.rb#81 + def thread_cattr_reader(*syms, instance_reader: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil)); end + + # Defines a per-thread class attribute and creates a class and instance writer methods to + # allow assignment to the attribute. + # + # module Current + # thread_mattr_writer :user + # end + # + # Current.user = "DHH" + # Thread.current[:attr_Current_user] # => "DHH" + # + # To omit the instance writer method, pass + # instance_writer: false or instance_accessor: false. + # + # class Current + # thread_mattr_writer :user, instance_writer: false + # end + # + # Current.new.user = "DHH" # => NoMethodError + # + # source://activesupport//lib/active_support/core_ext/module/attribute_accessors_per_thread.rb#123 + def thread_cattr_writer(*syms, instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil)); end + + # Defines both class and instance accessors for class attributes. + # + # class Account + # thread_mattr_accessor :user + # end + # + # Account.user = "DHH" + # Account.user # => "DHH" + # Account.new.user # => "DHH" + # + # Unlike +mattr_accessor+, values are *not* shared with subclasses or parent classes. + # If a subclass changes the value, the parent class' value is not changed. + # If the parent class changes the value, the value of subclasses is not changed. + # + # class Customer < Account + # end + # + # Account.user # => "DHH" + # Customer.user # => nil + # Customer.user = "Rafael" + # Customer.user # => "Rafael" + # Account.user # => "DHH" + # + # To omit the instance writer method, pass instance_writer: false. + # To omit the instance reader method, pass instance_reader: false. + # + # class Current + # thread_mattr_accessor :user, instance_writer: false, instance_reader: false + # end + # + # Current.new.user = "DHH" # => NoMethodError + # Current.new.user # => NoMethodError + # + # Or pass instance_accessor: false, to omit both instance methods. + # + # class Current + # thread_mattr_accessor :user, instance_accessor: false + # end + # + # Current.new.user = "DHH" # => NoMethodError + # Current.new.user # => NoMethodError + # + # A default value may be specified using the +:default+ option. Because + # multiple threads can access the default value, non-frozen default values + # will be duped and frozen. + # + # source://activesupport//lib/active_support/core_ext/module/attribute_accessors_per_thread.rb#170 + def thread_mattr_accessor(*syms, instance_reader: T.unsafe(nil), instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil)); end + + # Defines a per-thread class attribute and creates class and instance reader methods. + # The underlying per-thread class variable is set to +nil+, if it is not previously defined. + # + # module Current + # thread_mattr_reader :user + # end + # + # Current.user = "DHH" + # Current.user # => "DHH" + # Thread.new { Current.user }.value # => nil + # + # The attribute name must be a valid method name in Ruby. + # + # module Foo + # thread_mattr_reader :"1_Badname" + # end + # # => NameError: invalid attribute name: 1_Badname + # + # To omit the instance reader method, pass + # instance_reader: false or instance_accessor: false. + # + # class Current + # thread_mattr_reader :user, instance_reader: false + # end + # + # Current.new.user # => NoMethodError + # + # source://activesupport//lib/active_support/core_ext/module/attribute_accessors_per_thread.rb#41 + def thread_mattr_reader(*syms, instance_reader: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil)); end + + # Defines a per-thread class attribute and creates a class and instance writer methods to + # allow assignment to the attribute. + # + # module Current + # thread_mattr_writer :user + # end + # + # Current.user = "DHH" + # Thread.current[:attr_Current_user] # => "DHH" + # + # To omit the instance writer method, pass + # instance_writer: false or instance_accessor: false. + # + # class Current + # thread_mattr_writer :user, instance_writer: false + # end + # + # Current.new.user = "DHH" # => NoMethodError + # + # source://activesupport//lib/active_support/core_ext/module/attribute_accessors_per_thread.rb#101 + def thread_mattr_writer(*syms, instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil)); end + + private + + # source://activesupport//lib/active_support/core_ext/module/attr_internal.rb#40 + def attr_internal_define(attr_name, type); end + + class << self + # Returns the value of attribute attr_internal_naming_format. + # + # source://activesupport//lib/active_support/core_ext/module/attr_internal.rb#23 + def attr_internal_naming_format; end + + # source://activesupport//lib/active_support/core_ext/module/attr_internal.rb#25 + def attr_internal_naming_format=(format); end + end +end + +# == Bite-sized separation of concerns +# +# We often find ourselves with a medium-sized chunk of behavior that we'd +# like to extract, but only mix in to a single class. +# +# Extracting a plain old Ruby object to encapsulate it and collaborate or +# delegate to the original object is often a good choice, but when there's +# no additional state to encapsulate or we're making DSL-style declarations +# about the parent class, introducing new collaborators can obfuscate rather +# than simplify. +# +# The typical route is to just dump everything in a monolithic class, perhaps +# with a comment, as a least-bad alternative. Using modules in separate files +# means tedious sifting to get a big-picture view. +# +# == Dissatisfying ways to separate small concerns +# +# === Using comments: +# +# class Todo < ApplicationRecord +# # Other todo implementation +# # ... +# +# ## Event tracking +# has_many :events +# +# before_create :track_creation +# +# private +# def track_creation +# # ... +# end +# end +# +# === With an inline module: +# +# Noisy syntax. +# +# class Todo < ApplicationRecord +# # Other todo implementation +# # ... +# +# module EventTracking +# extend ActiveSupport::Concern +# +# included do +# has_many :events +# before_create :track_creation +# end +# +# private +# def track_creation +# # ... +# end +# end +# include EventTracking +# end +# +# === Mix-in noise exiled to its own file: +# +# Once our chunk of behavior starts pushing the scroll-to-understand-it +# boundary, we give in and move it to a separate file. At this size, the +# increased overhead can be a reasonable tradeoff even if it reduces our +# at-a-glance perception of how things work. +# +# class Todo < ApplicationRecord +# # Other todo implementation +# # ... +# +# include TodoEventTracking +# end +# +# == Introducing Module#concerning +# +# By quieting the mix-in noise, we arrive at a natural, low-ceremony way to +# separate bite-sized concerns. +# +# class Todo < ApplicationRecord +# # Other todo implementation +# # ... +# +# concerning :EventTracking do +# included do +# has_many :events +# before_create :track_creation +# end +# +# private +# def track_creation +# # ... +# end +# end +# end +# +# Todo.ancestors +# # => [Todo, Todo::EventTracking, ApplicationRecord, Object] +# +# This small step has some wonderful ripple effects. We can +# * grok the behavior of our class in one glance, +# * clean up monolithic junk-drawer classes by separating their concerns, and +# * stop leaning on protected/private for crude "this is internal stuff" modularity. +# +# === Prepending concerning +# +# concerning supports a prepend: true argument which will prepend the +# concern instead of using include for it. +# +# source://activesupport//lib/active_support/core_ext/module/concerning.rb#112 +module Module::Concerning + # A low-cruft shortcut to define a concern. + # + # concern :EventTracking do + # ... + # end + # + # is equivalent to + # + # module EventTracking + # extend ActiveSupport::Concern + # + # ... + # end + # + # source://activesupport//lib/active_support/core_ext/module/concerning.rb#132 + def concern(topic, &module_definition); end + + # Define a new concern and mix it in. + # + # source://activesupport//lib/active_support/core_ext/module/concerning.rb#114 + def concerning(topic, prepend: T.unsafe(nil), &block); end +end + +# source://activesupport//lib/active_support/core_ext/module/delegation.rb#5 +Module::DelegationError = ActiveSupport::DelegationError + +# source://activesupport//lib/active_support/core_ext/name_error.rb#3 +class NameError < ::StandardError + include ::ErrorHighlight::CoreExt + include ::DidYouMean::Correctable + + # Extract the name of the missing constant from the exception message. + # + # begin + # HelloWorld + # rescue NameError => e + # e.missing_name + # end + # # => "HelloWorld" + # + # source://activesupport//lib/active_support/core_ext/name_error.rb#12 + def missing_name; end + + # Was this exception raised because the given name was missing? + # + # begin + # HelloWorld + # rescue NameError => e + # e.missing_name?("HelloWorld") + # end + # # => true + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/name_error.rb#44 + def missing_name?(name); end + + private + + # source://activesupport//lib/active_support/core_ext/name_error.rb#56 + def real_mod_name(mod); end +end + +# source://activesupport//lib/active_support/core_ext/name_error.rb#53 +NameError::UNBOUND_METHOD_MODULE_NAME = T.let(T.unsafe(nil), UnboundMethod) + +# source://activesupport//lib/active_support/core_ext/object/blank.rb#50 +class NilClass + # source://activesupport//lib/active_support/core_ext/object/json.rb#93 + def as_json(options = T.unsafe(nil)); end + + # +nil+ is blank: + # + # nil.blank? # => true + # + # @return [true] + # + # source://activesupport//lib/active_support/core_ext/object/blank.rb#56 + def blank?; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/object/blank.rb#60 + def present?; end + + # Returns +self+. + # + # source://activesupport//lib/active_support/core_ext/object/to_query.rb#26 + def to_param; end + + # Returns a CGI-escaped +key+. + # + # source://activesupport//lib/active_support/core_ext/object/to_query.rb#21 + def to_query(key); end + + # Calling +try+ on +nil+ always returns +nil+. + # It becomes especially helpful when navigating through associations that may return +nil+. + # + # nil.try(:name) # => nil + # + # Without +try+ + # @person && @person.children.any? && @person.children.first.name + # + # With +try+ + # @person.try(:children).try(:first).try(:name) + # + # source://activesupport//lib/active_support/core_ext/object/try.rb#148 + def try(*_arg0, &_arg1); end + + # Calling +try!+ on +nil+ always returns +nil+. + # + # nil.try!(:name) # => nil + # + # source://activesupport//lib/active_support/core_ext/object/try.rb#155 + def try!(*_arg0, &_arg1); end +end + +# source://activesupport//lib/active_support/core_ext/object/blank.rb#170 +class Numeric + include ::Comparable + + # source://activesupport//lib/active_support/core_ext/object/json.rb#111 + def as_json(options = T.unsafe(nil)); end + + # No number is blank: + # + # 1.blank? # => false + # 0.blank? # => false + # + # @return [false] + # + # source://activesupport//lib/active_support/core_ext/object/blank.rb#177 + def blank?; end + + # Enables the use of byte calculations and declarations, like 45.bytes + 2.6.megabytes + # + # 2.bytes # => 2 + # + # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#18 + def byte; end + + # Enables the use of byte calculations and declarations, like 45.bytes + 2.6.megabytes + # + # 2.bytes # => 2 + # + # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#15 + def bytes; end + + # Returns a Duration instance matching the number of days provided. + # + # 2.days # => 2 days + # + # source://activesupport//lib/active_support/core_ext/numeric/time.rb#40 + def day; end + + # Returns a Duration instance matching the number of days provided. + # + # 2.days # => 2 days + # + # source://activesupport//lib/active_support/core_ext/numeric/time.rb#37 + def days; end + + # Returns the number of bytes equivalent to the exabytes provided. + # + # 2.exabytes # => 2_305_843_009_213_693_952 + # + # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#66 + def exabyte; end + + # Returns the number of bytes equivalent to the exabytes provided. + # + # 2.exabytes # => 2_305_843_009_213_693_952 + # + # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#63 + def exabytes; end + + # Returns a Duration instance matching the number of fortnights provided. + # + # 2.fortnights # => 4 weeks + # + # source://activesupport//lib/active_support/core_ext/numeric/time.rb#56 + def fortnight; end + + # Returns a Duration instance matching the number of fortnights provided. + # + # 2.fortnights # => 4 weeks + # + # source://activesupport//lib/active_support/core_ext/numeric/time.rb#53 + def fortnights; end + + # Returns the number of bytes equivalent to the gigabytes provided. + # + # 2.gigabytes # => 2_147_483_648 + # + # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#42 + def gigabyte; end + + # Returns the number of bytes equivalent to the gigabytes provided. + # + # 2.gigabytes # => 2_147_483_648 + # + # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#39 + def gigabytes; end + + # Returns a Duration instance matching the number of hours provided. + # + # 2.hours # => 2 hours + # + # source://activesupport//lib/active_support/core_ext/numeric/time.rb#32 + def hour; end + + # Returns a Duration instance matching the number of hours provided. + # + # 2.hours # => 2 hours + # + # source://activesupport//lib/active_support/core_ext/numeric/time.rb#29 + def hours; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#13 + def html_safe?; end + + # Returns the number of milliseconds equivalent to the seconds provided. + # Used with the standard time durations. + # + # 2.in_milliseconds # => 2000 + # 1.hour.in_milliseconds # => 3600000 + # + # source://activesupport//lib/active_support/core_ext/numeric/time.rb#63 + def in_milliseconds; end + + # Returns the number of bytes equivalent to the kilobytes provided. + # + # 2.kilobytes # => 2048 + # + # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#26 + def kilobyte; end + + # Returns the number of bytes equivalent to the kilobytes provided. + # + # 2.kilobytes # => 2048 + # + # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#23 + def kilobytes; end + + # Returns the number of bytes equivalent to the megabytes provided. + # + # 2.megabytes # => 2_097_152 + # + # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#34 + def megabyte; end + + # Returns the number of bytes equivalent to the megabytes provided. + # + # 2.megabytes # => 2_097_152 + # + # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#31 + def megabytes; end + + # Returns a Duration instance matching the number of minutes provided. + # + # 2.minutes # => 2 minutes + # + # source://activesupport//lib/active_support/core_ext/numeric/time.rb#24 + def minute; end + + # Returns a Duration instance matching the number of minutes provided. + # + # 2.minutes # => 2 minutes + # + # source://activesupport//lib/active_support/core_ext/numeric/time.rb#21 + def minutes; end + + # Returns the number of bytes equivalent to the petabytes provided. + # + # 2.petabytes # => 2_251_799_813_685_248 + # + # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#58 + def petabyte; end + + # Returns the number of bytes equivalent to the petabytes provided. + # + # 2.petabytes # => 2_251_799_813_685_248 + # + # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#55 + def petabytes; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/object/blank.rb#181 + def present?; end + + # Returns a Duration instance matching the number of seconds provided. + # + # 2.seconds # => 2 seconds + # + # source://activesupport//lib/active_support/core_ext/numeric/time.rb#16 + def second; end + + # Returns a Duration instance matching the number of seconds provided. + # + # 2.seconds # => 2 seconds + # + # source://activesupport//lib/active_support/core_ext/numeric/time.rb#13 + def seconds; end + + # Returns the number of bytes equivalent to the terabytes provided. + # + # 2.terabytes # => 2_199_023_255_552 + # + # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#50 + def terabyte; end + + # Returns the number of bytes equivalent to the terabytes provided. + # + # 2.terabytes # => 2_199_023_255_552 + # + # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#47 + def terabytes; end + + # Returns a Duration instance matching the number of weeks provided. + # + # 2.weeks # => 2 weeks + # + # source://activesupport//lib/active_support/core_ext/numeric/time.rb#48 + def week; end + + # Returns a Duration instance matching the number of weeks provided. + # + # 2.weeks # => 2 weeks + # + # source://activesupport//lib/active_support/core_ext/numeric/time.rb#45 + def weeks; end + + # Returns the number of bytes equivalent to the zettabytes provided. + # + # 2.zettabytes # => 2_361_183_241_434_822_606_848 + # + # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#74 + def zettabyte; end + + # Returns the number of bytes equivalent to the zettabytes provided. + # + # 2.zettabytes # => 2_361_183_241_434_822_606_848 + # + # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#71 + def zettabytes; end +end + +# source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#9 +Numeric::EXABYTE = T.let(T.unsafe(nil), Integer) + +# source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#6 +Numeric::GIGABYTE = T.let(T.unsafe(nil), Integer) + +# source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#4 +Numeric::KILOBYTE = T.let(T.unsafe(nil), Integer) + +# source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#5 +Numeric::MEGABYTE = T.let(T.unsafe(nil), Integer) + +# source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#8 +Numeric::PETABYTE = T.let(T.unsafe(nil), Integer) + +# source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#7 +Numeric::TERABYTE = T.let(T.unsafe(nil), Integer) + +# source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#10 +Numeric::ZETTABYTE = T.let(T.unsafe(nil), Integer) + +# -- +# Most objects are cloneable, but not all. For example you can't dup methods: +# +# method(:puts).dup # => TypeError: allocator undefined for Method +# +# Classes may signal their instances are not duplicable removing +dup+/+clone+ +# or raising exceptions from them. So, to dup an arbitrary object you normally +# use an optimistic approach and are ready to catch an exception, say: +# +# arbitrary_object.dup rescue object +# +# Rails dups objects in a few critical spots where they are not that arbitrary. +# That rescue is very expensive (like 40 times slower than a predicate), and it +# is often triggered. +# +# That's why we hardcode the following cases and check duplicable? instead of +# using that rescue idiom. +# ++ +# +# source://activesupport//lib/active_support/core_ext/object/duplicable.rb#21 +class Object < ::BasicObject + include ::ActiveSupport::Dependencies::RequireDependency + include ::Kernel + include ::PP::ObjectMixin + include ::ActiveSupport::Tryable + include ::ActiveSupport::ToJsonWithActiveSupportEncoder + + # Provides a way to check whether some class acts like some other class based on the existence of + # an appropriately-named marker method. + # + # A class that provides the same interface as SomeClass may define a marker method named + # acts_like_some_class? to signal its compatibility to callers of + # acts_like?(:some_class). + # + # For example, Active Support extends Date to define an acts_like_date? method, + # and extends Time to define acts_like_time?. As a result, developers can call + # x.acts_like?(:time) and x.acts_like?(:date) to test duck-type compatibility, + # and classes that are able to act like Time can also define an acts_like_time? + # method to interoperate. + # + # Note that the marker method is only expected to exist. It isn't called, so its body or return + # value are irrelevant. + # + # ==== Example: A class that provides the same interface as String + # + # This class may define: + # + # class Stringish + # def acts_like_string? + # end + # end + # + # Then client code can query for duck-type-safeness this way: + # + # Stringish.new.acts_like?(:string) # => true + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/object/acts_like.rb#33 + def acts_like?(duck); end + + # source://activesupport//lib/active_support/core_ext/object/json.rb#59 + def as_json(options = T.unsafe(nil)); end + + # An object is blank if it's false, empty, or a whitespace string. + # For example, +nil+, '', ' ', [], {}, and +false+ are all blank. + # + # This simplifies + # + # !address || address.empty? + # + # to + # + # address.blank? + # + # @return [true, false] + # + # source://activesupport//lib/active_support/core_ext/object/blank.rb#18 + def blank?; end + + # Returns a deep copy of object if it's duplicable. If it's + # not duplicable, returns +self+. + # + # object = Object.new + # dup = object.deep_dup + # dup.instance_variable_set(:@a, 1) + # + # object.instance_variable_defined?(:@a) # => false + # dup.instance_variable_defined?(:@a) # => true + # + # source://activesupport//lib/active_support/core_ext/object/deep_dup.rb#15 + def deep_dup; end + + # Can you safely dup this object? + # + # False for method objects; + # true otherwise. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/object/duplicable.rb#26 + def duplicable?; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#7 + def html_safe?; end + + # Returns true if this object is included in the argument. + # + # When argument is a +Range+, +#cover?+ is used to properly handle inclusion + # check within open ranges. Otherwise, argument must be any object which responds + # to +#include?+. Usage: + # + # characters = ["Konata", "Kagami", "Tsukasa"] + # "Konata".in?(characters) # => true + # + # For non +Range+ arguments, this will throw an +ArgumentError+ if the argument + # doesn't respond to +#include?+. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/object/inclusion.rb#15 + def in?(another_object); end + + # Returns a hash with string keys that maps instance variable names without "@" to their + # corresponding values. + # + # class C + # def initialize(x, y) + # @x, @y = x, y + # end + # end + # + # C.new(0, 1).instance_values # => {"x" => 0, "y" => 1} + # + # source://activesupport//lib/active_support/core_ext/object/instance_variables.rb#14 + def instance_values; end + + # Returns an array of instance variable names as strings including "@". + # + # class C + # def initialize(x, y) + # @x, @y = x, y + # end + # end + # + # C.new(0, 1).instance_variable_names # => ["@y", "@x"] + # + # source://activesupport//lib/active_support/core_ext/object/instance_variables.rb#29 + def instance_variable_names; end + + # Returns the receiver if it's present otherwise returns +nil+. + # object.presence is equivalent to + # + # object.present? ? object : nil + # + # For example, something like + # + # state = params[:state] if params[:state].present? + # country = params[:country] if params[:country].present? + # region = state || country || 'US' + # + # becomes + # + # region = params[:state].presence || params[:country].presence || 'US' + # + # @return [Object] + # + # source://activesupport//lib/active_support/core_ext/object/blank.rb#45 + def presence; end + + # Returns the receiver if it's included in the argument otherwise returns +nil+. + # Argument must be any object which responds to +#include?+. Usage: + # + # params[:bucket_type].presence_in %w( project calendar ) + # + # This will throw an +ArgumentError+ if the argument doesn't respond to +#include?+. + # + # @return [Object] + # + # source://activesupport//lib/active_support/core_ext/object/inclusion.rb#34 + def presence_in(another_object); end + + # An object is present if it's not blank. + # + # @return [true, false] + # + # source://activesupport//lib/active_support/core_ext/object/blank.rb#25 + def present?; end + + # Alias of to_s. + # + # source://activesupport//lib/active_support/core_ext/object/to_query.rb#8 + def to_param; end + + # Converts an object into a string suitable for use as a URL query string, + # using the given key as the param name. + # + # source://activesupport//lib/active_support/core_ext/object/to_query.rb#14 + def to_query(key); end + + # Set and restore public attributes around a block. + # + # client.timeout # => 5 + # client.with(timeout: 1) do |c| + # c.timeout # => 1 + # end + # client.timeout # => 5 + # + # The receiver is yielded to the provided block. + # + # This method is a shorthand for the common begin/ensure pattern: + # + # old_value = object.attribute + # begin + # object.attribute = new_value + # # do things + # ensure + # object.attribute = old_value + # end + # + # It can be used on any object as long as both the reader and writer methods + # are public. + # + # source://activesupport//lib/active_support/core_ext/object/with.rb#26 + def with(**attributes); end + + # An elegant way to factor duplication out of options passed to a series of + # method calls. Each method called in the block, with the block variable as + # the receiver, will have its options merged with the default +options+ + # Hash or Hash-like object provided. Each method called on + # the block variable must take an options hash as its final argument. + # + # Without with_options, this code contains duplication: + # + # class Account < ActiveRecord::Base + # has_many :customers, dependent: :destroy + # has_many :products, dependent: :destroy + # has_many :invoices, dependent: :destroy + # has_many :expenses, dependent: :destroy + # end + # + # Using with_options, we can remove the duplication: + # + # class Account < ActiveRecord::Base + # with_options dependent: :destroy do |assoc| + # assoc.has_many :customers + # assoc.has_many :products + # assoc.has_many :invoices + # assoc.has_many :expenses + # end + # end + # + # It can also be used with an explicit receiver: + # + # I18n.with_options locale: user.locale, scope: 'newsletter' do |i18n| + # subject i18n.t :subject + # body i18n.t :body, user_name: user.name + # end + # + # When you don't pass an explicit receiver, it executes the whole block + # in merging options context: + # + # class Account < ActiveRecord::Base + # with_options dependent: :destroy do + # has_many :customers + # has_many :products + # has_many :invoices + # has_many :expenses + # end + # end + # + # with_options can also be nested since the call is forwarded to its receiver. + # + # NOTE: Each nesting level will merge inherited defaults in addition to their own. + # + # class Post < ActiveRecord::Base + # with_options if: :persisted?, length: { minimum: 50 } do + # validates :content, if: -> { content.present? } + # end + # end + # + # The code is equivalent to: + # + # validates :content, length: { minimum: 50 }, if: -> { content.present? } + # + # Hence the inherited default for +if+ key is ignored. + # + # NOTE: You cannot call class methods implicitly inside of +with_options+. + # You can access these methods using the class name instead: + # + # class Phone < ActiveRecord::Base + # enum :phone_number_type, { home: 0, office: 1, mobile: 2 } + # + # with_options presence: true do + # validates :phone_number_type, inclusion: { in: Phone.phone_number_types.keys } + # end + # end + # + # When the block argument is omitted, the decorated Object instance is returned: + # + # module MyStyledHelpers + # def styled + # with_options style: "color: red;" + # end + # end + # + # styled.link_to "I'm red", "/" + # # => I'm red + # + # styled.button_tag "I'm red too!" + # # => + # + # source://activesupport//lib/active_support/core_ext/object/with_options.rb#92 + def with_options(options, &block); end +end + +# source://activesupport//lib/active_support/core_ext/object/json.rb#236 +class Pathname + # source://activesupport//lib/active_support/core_ext/object/json.rb#237 + def as_json(options = T.unsafe(nil)); end +end + +module Process + extend ::SQLite3::ForkSafety::CoreExt + extend ::ActiveSupport::ForkTracker::CoreExt + + class << self + # source://activesupport//lib/active_support/fork_tracker.rb#6 + def _fork; end + end +end + +# source://activesupport//lib/active_support/core_ext/object/json.rb#257 +class Process::Status + # source://activesupport//lib/active_support/core_ext/object/json.rb#258 + def as_json(options = T.unsafe(nil)); end +end + +# source://activesupport//lib/active_support/core_ext/object/json.rb#157 +class Range + include ::ActiveSupport::RangeWithFormat + include ::ActiveSupport::CompareWithRange + include ::Enumerable + + # source://activesupport//lib/active_support/core_ext/range/compare_range.rb#16 + def ===(value); end + + # source://activesupport//lib/active_support/core_ext/object/json.rb#158 + def as_json(options = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/core_ext/range/compare_range.rb#41 + def include?(value); end + + # Compare two ranges and see if they overlap each other + # (1..5).overlap?(4..6) # => true + # (1..5).overlap?(7..9) # => false + # + # @raise [TypeError] + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/range/overlap.rb#39 + def overlaps?(_arg0); end + + # Returns the sole item in the range. If there are no items, or more + # than one item, raises Enumerable::SoleItemExpectedError. + # + # (1..1).sole # => 1 + # (2..1).sole # => Enumerable::SoleItemExpectedError: no item found + # (..1).sole # => Enumerable::SoleItemExpectedError: infinite range cannot represent a sole item + # + # source://activesupport//lib/active_support/core_ext/range/sole.rb#10 + def sole; end + + # Optimize range sum to use arithmetic progression if a block is not given and + # we have a range of numeric values. + # + # source://activesupport//lib/active_support/core_ext/enumerable.rb#253 + def sum(initial_value = T.unsafe(nil)); end +end + +# source://activesupport//lib/active_support/core_ext/object/json.rb#139 +class Regexp + # source://activesupport//lib/active_support/core_ext/object/json.rb#140 + def as_json(options = T.unsafe(nil)); end + + # Returns +true+ if the regexp has the multiline flag set. + # + # (/./).multiline? # => false + # (/./m).multiline? # => true + # + # Regexp.new(".").multiline? # => false + # Regexp.new(".", Regexp::MULTILINE).multiline? # => true + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/regexp.rb#11 + def multiline?; end +end + +# source://activesupport//lib/active_support/core_ext/securerandom.rb#5 +module SecureRandom + class << self + # source://activesupport//lib/active_support/core_ext/securerandom.rb#45 + def base36(n = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/core_ext/securerandom.rb#20 + def base58(n = T.unsafe(nil)); end + end +end + +# source://activesupport//lib/active_support/core_ext/securerandom.rb#7 +SecureRandom::BASE36_ALPHABET = T.let(T.unsafe(nil), Array) + +# source://activesupport//lib/active_support/core_ext/securerandom.rb#6 +SecureRandom::BASE58_ALPHABET = T.let(T.unsafe(nil), Array) + +# source://activesupport//lib/active_support/core_ext/object/duplicable.rb#62 +module Singleton + mixes_in_class_methods ::Singleton::SingletonClassMethods + + # Singleton instances are not duplicable: + # + # Class.new.include(Singleton).instance.dup # TypeError (can't dup instance of singleton + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/object/duplicable.rb#66 + def duplicable?; end +end + +# String inflections define new methods on the String class to transform names for different purposes. +# For instance, you can figure out the name of a table from the name of a class. +# +# 'ScaleScore'.tableize # => "scale_scores" +# +# source://activesupport//lib/active_support/core_ext/object/blank.rb#135 +class String + include ::Comparable + + # Enables more predictable duck-typing on String-like classes. See Object#acts_like?. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/string/behavior.rb#5 + def acts_like_string?; end + + # source://activesupport//lib/active_support/core_ext/object/json.rb#99 + def as_json(options = T.unsafe(nil)); end + + # If you pass a single integer, returns a substring of one character at that + # position. The first character of the string is at position 0, the next at + # position 1, and so on. If a range is supplied, a substring containing + # characters at offsets given by the range is returned. In both cases, if an + # offset is negative, it is counted from the end of the string. Returns +nil+ + # if the initial offset falls outside the string. Returns an empty string if + # the beginning of the range is greater than the end of the string. + # + # str = "hello" + # str.at(0) # => "h" + # str.at(1..3) # => "ell" + # str.at(-2) # => "l" + # str.at(-2..-1) # => "lo" + # str.at(5) # => nil + # str.at(5..-1) # => "" + # + # If a Regexp is given, the matching portion of the string is returned. + # If a String is given, that given string is returned if it occurs in + # the string. In both cases, +nil+ is returned if there is no match. + # + # str = "hello" + # str.at(/lo/) # => "lo" + # str.at(/ol/) # => nil + # str.at("lo") # => "lo" + # str.at("ol") # => nil + # + # source://activesupport//lib/active_support/core_ext/string/access.rb#29 + def at(position); end + + # A string is blank if it's empty or contains whitespaces only: + # + # ''.blank? # => true + # ' '.blank? # => true + # "\t\n\r".blank? # => true + # ' blah '.blank? # => false + # + # Unicode whitespace is supported: + # + # "\u00a0".blank? # => true + # + # @return [true, false] + # + # source://activesupport//lib/active_support/core_ext/object/blank.rb#153 + def blank?; end + + # By default, +camelize+ converts strings to UpperCamelCase. If the argument to camelize + # is set to :lower then camelize produces lowerCamelCase. + # + # +camelize+ will also convert '/' to '::' which is useful for converting paths to namespaces. + # + # 'active_record'.camelize # => "ActiveRecord" + # 'active_record'.camelize(:lower) # => "activeRecord" + # 'active_record/errors'.camelize # => "ActiveRecord::Errors" + # 'active_record/errors'.camelize(:lower) # => "activeRecord::Errors" + # + # See ActiveSupport::Inflector.camelize. + # + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#111 + def camelcase(first_letter = T.unsafe(nil)); end + + # By default, +camelize+ converts strings to UpperCamelCase. If the argument to camelize + # is set to :lower then camelize produces lowerCamelCase. + # + # +camelize+ will also convert '/' to '::' which is useful for converting paths to namespaces. + # + # 'active_record'.camelize # => "ActiveRecord" + # 'active_record'.camelize(:lower) # => "activeRecord" + # 'active_record/errors'.camelize # => "ActiveRecord::Errors" + # 'active_record/errors'.camelize(:lower) # => "activeRecord::Errors" + # + # See ActiveSupport::Inflector.camelize. + # + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#101 + def camelize(first_letter = T.unsafe(nil)); end + + # Creates a class name from a plural table name like \Rails does for table names to models. + # Note that this returns a string and not a class. (To convert to an actual class + # follow +classify+ with +constantize+.) + # + # 'ham_and_eggs'.classify # => "HamAndEgg" + # 'posts'.classify # => "Post" + # + # See ActiveSupport::Inflector.classify. + # + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#239 + def classify; end + + # +constantize+ tries to find a declared constant with the name specified + # in the string. It raises a NameError when the name is not in CamelCase + # or is not initialized. + # + # 'Module'.constantize # => Module + # 'Class'.constantize # => Class + # 'blargle'.constantize # => NameError: wrong constant name blargle + # + # See ActiveSupport::Inflector.constantize. + # + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#73 + def constantize; end + + # Replaces underscores with dashes in the string. + # + # 'puni_puni'.dasherize # => "puni-puni" + # + # See ActiveSupport::Inflector.dasherize. + # + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#148 + def dasherize; end + + # Removes the rightmost segment from the constant expression in the string. + # + # 'Net::HTTP'.deconstantize # => "Net" + # '::Net::HTTP'.deconstantize # => "::Net" + # 'String'.deconstantize # => "" + # '::String'.deconstantize # => "" + # ''.deconstantize # => "" + # + # See ActiveSupport::Inflector.deconstantize. + # + # See also +demodulize+. + # + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#177 + def deconstantize; end + + # Removes the module part from the constant expression in the string. + # + # 'ActiveSupport::Inflector::Inflections'.demodulize # => "Inflections" + # 'Inflections'.demodulize # => "Inflections" + # '::Inflections'.demodulize # => "Inflections" + # ''.demodulize # => '' + # + # See ActiveSupport::Inflector.demodulize. + # + # See also +deconstantize+. + # + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#162 + def demodulize; end + + # Converts the first character to lowercase. + # + # 'If they enjoyed The Matrix'.downcase_first # => "if they enjoyed The Matrix" + # 'I'.downcase_first # => "i" + # ''.downcase_first # => "" + # + # See ActiveSupport::Inflector.downcase_first. + # + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#284 + def downcase_first; end + + # source://activesupport//lib/active_support/core_ext/string/starts_ends_with.rb#5 + def ends_with?(*_arg0); end + + # The inverse of String#include?. Returns true if the string + # does not include the other string. + # + # "hello".exclude? "lo" # => false + # "hello".exclude? "ol" # => true + # "hello".exclude? ?h # => false + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/string/exclude.rb#10 + def exclude?(string); end + + # Returns the first character. If a limit is supplied, returns a substring + # from the beginning of the string until it reaches the limit value. If the + # given limit is greater than or equal to the string length, returns a copy of self. + # + # str = "hello" + # str.first # => "h" + # str.first(1) # => "h" + # str.first(2) # => "he" + # str.first(0) # => "" + # str.first(6) # => "hello" + # + # source://activesupport//lib/active_support/core_ext/string/access.rb#78 + def first(limit = T.unsafe(nil)); end + + # Creates a foreign key name from a class name. + # +separate_class_name_and_id_with_underscore+ sets whether + # the method should put '_' between the name and 'id'. + # + # 'Message'.foreign_key # => "message_id" + # 'Message'.foreign_key(false) # => "messageid" + # 'Admin::Post'.foreign_key # => "post_id" + # + # See ActiveSupport::Inflector.foreign_key. + # + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#297 + def foreign_key(separate_class_name_and_id_with_underscore = T.unsafe(nil)); end + + # Returns a substring from the given position to the end of the string. + # If the position is negative, it is counted from the end of the string. + # + # str = "hello" + # str.from(0) # => "hello" + # str.from(3) # => "lo" + # str.from(-2) # => "lo" + # + # You can mix it with +to+ method and do fun things like: + # + # str = "hello" + # str.from(0).to(-1) # => "hello" + # str.from(1).to(-2) # => "ell" + # + # source://activesupport//lib/active_support/core_ext/string/access.rb#46 + def from(position); end + + # Marks a string as trusted safe. It will be inserted into HTML with no + # additional escaping performed. It is your responsibility to ensure that the + # string contains no malicious content. This method is equivalent to the + # +raw+ helper in views. It is recommended that you use +sanitize+ instead of + # this method. It should never be called on user input. + # + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#232 + def html_safe; end + + # Capitalizes the first word, turns underscores into spaces, and (by default) strips a + # trailing '_id' if present. + # Like +titleize+, this is meant for creating pretty output. + # + # The capitalization of the first word can be turned off by setting the + # optional parameter +capitalize+ to false. + # By default, this parameter is true. + # + # The trailing '_id' can be kept and capitalized by setting the + # optional parameter +keep_id_suffix+ to true. + # By default, this parameter is false. + # + # 'employee_salary'.humanize # => "Employee salary" + # 'author_id'.humanize # => "Author" + # 'author_id'.humanize(capitalize: false) # => "author" + # '_id'.humanize # => "Id" + # 'author_id'.humanize(keep_id_suffix: true) # => "Author id" + # + # See ActiveSupport::Inflector.humanize. + # + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#262 + def humanize(capitalize: T.unsafe(nil), keep_id_suffix: T.unsafe(nil)); end + + # Converts String to a TimeWithZone in the current zone if Time.zone or Time.zone_default + # is set, otherwise converts String to a Time via String#to_time + # + # source://activesupport//lib/active_support/core_ext/string/zones.rb#9 + def in_time_zone(zone = T.unsafe(nil)); end + + # Indents the lines in the receiver: + # + # < + # def some_method + # some_code + # end + # + # The second argument, +indent_string+, specifies which indent string to + # use. The default is +nil+, which tells the method to make a guess by + # peeking at the first indented line, and fall back to a space if there is + # none. + # + # " foo".indent(2) # => " foo" + # "foo\n\t\tbar".indent(2) # => "\t\tfoo\n\t\t\t\tbar" + # "foo".indent(2, "\t") # => "\t\tfoo" + # + # While +indent_string+ is typically one space or tab, it may be any string. + # + # The third argument, +indent_empty_lines+, is a flag that says whether + # empty lines should be indented. Default is false. + # + # "foo\n\nbar".indent(2) # => " foo\n\n bar" + # "foo\n\nbar".indent(2, nil, true) # => " foo\n \n bar" + # + # source://activesupport//lib/active_support/core_ext/string/indent.rb#42 + def indent(amount, indent_string = T.unsafe(nil), indent_empty_lines = T.unsafe(nil)); end + + # Same as +indent+, except it indents the receiver in-place. + # + # Returns the indented string, or +nil+ if there was nothing to indent. + # + # source://activesupport//lib/active_support/core_ext/string/indent.rb#7 + def indent!(amount, indent_string = T.unsafe(nil), indent_empty_lines = T.unsafe(nil)); end + + # Wraps the current string in the ActiveSupport::StringInquirer class, + # which gives you a prettier way to test for equality. + # + # env = 'production'.inquiry + # env.production? # => true + # env.development? # => false + # + # source://activesupport//lib/active_support/core_ext/string/inquiry.rb#13 + def inquiry; end + + # Returns +true+ if string has utf_8 encoding. + # + # utf_8_str = "some string".encode "UTF-8" + # iso_str = "some string".encode "ISO-8859-1" + # + # utf_8_str.is_utf8? # => true + # iso_str.is_utf8? # => false + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/string/multibyte.rb#57 + def is_utf8?; end + + # Returns the last character of the string. If a limit is supplied, returns a substring + # from the end of the string until it reaches the limit value (counting backwards). If + # the given limit is greater than or equal to the string length, returns a copy of self. + # + # str = "hello" + # str.last # => "o" + # str.last(1) # => "o" + # str.last(2) # => "lo" + # str.last(0) # => "" + # str.last(6) # => "hello" + # + # source://activesupport//lib/active_support/core_ext/string/access.rb#92 + def last(limit = T.unsafe(nil)); end + + # == Multibyte proxy + # + # +mb_chars+ is a multibyte safe proxy for string methods. + # + # It creates and returns an instance of the ActiveSupport::Multibyte::Chars class which + # encapsulates the original string. A Unicode safe version of all the String methods are defined on this proxy + # class. If the proxy class doesn't respond to a certain method, it's forwarded to the encapsulated string. + # + # >> "lj".mb_chars.upcase.to_s + # # => "LJ" + # + # NOTE: Ruby 2.4 and later support native Unicode case mappings: + # + # >> "lj".upcase + # # => "LJ" + # + # == \Method chaining + # + # All the methods on the Chars proxy which normally return a string will return a Chars object. This allows + # method chaining on the result of any of these methods. + # + # name.mb_chars.reverse.length # => 12 + # + # == Interoperability and configuration + # + # The Chars object tries to be as interchangeable with String objects as possible: sorting and comparing between + # String and Char work like expected. The bang! methods change the internal string representation in the Chars + # object. Interoperability problems can be resolved easily with a +to_s+ call. + # + # For more information about the methods defined on the Chars proxy see ActiveSupport::Multibyte::Chars. For + # information about how to change the default Multibyte behavior see ActiveSupport::Multibyte. + # + # source://activesupport//lib/active_support/core_ext/string/multibyte.rb#37 + def mb_chars; end + + # Replaces special characters in a string so that it may be used as part of a 'pretty' URL. + # + # If the optional parameter +locale+ is specified, + # the word will be parameterized as a word of that language. + # By default, this parameter is set to nil and it will use + # the configured I18n.locale. + # + # class Person + # def to_param + # "#{id}-#{name.parameterize}" + # end + # end + # + # @person = Person.find(1) + # # => # + # + # <%= link_to(@person.name, person_path) %> + # # => Donald E. Knuth + # + # To preserve the case of the characters in a string, use the +preserve_case+ argument. + # + # class Person + # def to_param + # "#{id}-#{name.parameterize(preserve_case: true)}" + # end + # end + # + # @person = Person.find(1) + # # => # + # + # <%= link_to(@person.name, person_path) %> + # # => Donald E. Knuth + # + # See ActiveSupport::Inflector.parameterize. + # + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#215 + def parameterize(separator: T.unsafe(nil), preserve_case: T.unsafe(nil), locale: T.unsafe(nil)); end + + # Returns the plural form of the word in the string. + # + # If the optional parameter +count+ is specified, + # the singular form will be returned if count == 1. + # For any other value of +count+ the plural will be returned. + # + # If the optional parameter +locale+ is specified, + # the word will be pluralized as a word of that language. + # By default, this parameter is set to :en. + # You must define your own inflection rules for languages other than English. + # + # 'post'.pluralize # => "posts" + # 'octopus'.pluralize # => "octopi" + # 'sheep'.pluralize # => "sheep" + # 'words'.pluralize # => "words" + # 'the blue mailman'.pluralize # => "the blue mailmen" + # 'CamelOctopus'.pluralize # => "CamelOctopi" + # 'apple'.pluralize(1) # => "apple" + # 'apple'.pluralize(2) # => "apples" + # 'ley'.pluralize(:es) # => "leyes" + # 'ley'.pluralize(1, :es) # => "ley" + # + # See ActiveSupport::Inflector.pluralize. + # + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#35 + def pluralize(count = T.unsafe(nil), locale = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/object/blank.rb#165 + def present?; end + + # Returns a new string with all occurrences of the patterns removed. + # str = "foo bar test" + # str.remove(" test") # => "foo bar" + # str.remove(" test", /bar/) # => "foo " + # str # => "foo bar test" + # + # source://activesupport//lib/active_support/core_ext/string/filters.rb#32 + def remove(*patterns); end + + # Alters the string by removing all occurrences of the patterns. + # str = "foo bar test" + # str.remove!(" test", /bar/) # => "foo " + # str # => "foo " + # + # source://activesupport//lib/active_support/core_ext/string/filters.rb#40 + def remove!(*patterns); end + + # +safe_constantize+ tries to find a declared constant with the name specified + # in the string. It returns +nil+ when the name is not in CamelCase + # or is not initialized. + # + # 'Module'.safe_constantize # => Module + # 'Class'.safe_constantize # => Class + # 'blargle'.safe_constantize # => nil + # + # See ActiveSupport::Inflector.safe_constantize. + # + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#86 + def safe_constantize; end + + # The reverse of +pluralize+, returns the singular form of a word in a string. + # + # If the optional parameter +locale+ is specified, + # the word will be singularized as a word of that language. + # By default, this parameter is set to :en. + # You must define your own inflection rules for languages other than English. + # + # 'posts'.singularize # => "post" + # 'octopi'.singularize # => "octopus" + # 'sheep'.singularize # => "sheep" + # 'word'.singularize # => "word" + # 'the blue mailmen'.singularize # => "the blue mailman" + # 'CamelOctopi'.singularize # => "CamelOctopus" + # 'leyes'.singularize(:es) # => "ley" + # + # See ActiveSupport::Inflector.singularize. + # + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#60 + def singularize(locale = T.unsafe(nil)); end + + # Returns the string, first removing all whitespace on both ends of + # the string, and then changing remaining consecutive whitespace + # groups into one space each. + # + # Note that it handles both ASCII and Unicode whitespace. + # + # %{ Multi-line + # string }.squish # => "Multi-line string" + # " foo bar \n \t boo".squish # => "foo bar boo" + # + # source://activesupport//lib/active_support/core_ext/string/filters.rb#13 + def squish; end + + # Performs a destructive squish. See String#squish. + # str = " foo bar \n \t boo" + # str.squish! # => "foo bar boo" + # str # => "foo bar boo" + # + # source://activesupport//lib/active_support/core_ext/string/filters.rb#21 + def squish!; end + + # source://activesupport//lib/active_support/core_ext/string/starts_ends_with.rb#4 + def starts_with?(*_arg0); end + + # Strips indentation in heredocs. + # + # For example in + # + # if options[:usage] + # puts <<-USAGE.strip_heredoc + # This command does such and such. + # + # Supported options are: + # -h This message + # ... + # USAGE + # end + # + # the user would see the usage message aligned against the left margin. + # + # Technically, it looks for the least indented non-empty line + # in the whole string, and removes that amount of leading whitespace. + # + # source://activesupport//lib/active_support/core_ext/string/strip.rb#22 + def strip_heredoc; end + + # Creates the name of a table like \Rails does for models to table names. This method + # uses the +pluralize+ method on the last word in the string. + # + # 'RawScaledScorer'.tableize # => "raw_scaled_scorers" + # 'ham_and_egg'.tableize # => "ham_and_eggs" + # 'fancyCategory'.tableize # => "fancy_categories" + # + # See ActiveSupport::Inflector.tableize. + # + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#227 + def tableize; end + + # Capitalizes all the words and replaces some characters in the string to create + # a nicer looking title. +titleize+ is meant for creating pretty output. It is not + # used in the \Rails internals. + # + # The trailing '_id','Id'.. can be kept and capitalized by setting the + # optional parameter +keep_id_suffix+ to true. + # By default, this parameter is false. + # + # 'man from the boondocks'.titleize # => "Man From The Boondocks" + # 'x-men: the last stand'.titleize # => "X Men: The Last Stand" + # 'string_ending_with_id'.titleize(keep_id_suffix: true) # => "String Ending With Id" + # + # See ActiveSupport::Inflector.titleize. + # + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#129 + def titlecase(keep_id_suffix: T.unsafe(nil)); end + + # Capitalizes all the words and replaces some characters in the string to create + # a nicer looking title. +titleize+ is meant for creating pretty output. It is not + # used in the \Rails internals. + # + # The trailing '_id','Id'.. can be kept and capitalized by setting the + # optional parameter +keep_id_suffix+ to true. + # By default, this parameter is false. + # + # 'man from the boondocks'.titleize # => "Man From The Boondocks" + # 'x-men: the last stand'.titleize # => "X Men: The Last Stand" + # 'string_ending_with_id'.titleize(keep_id_suffix: true) # => "String Ending With Id" + # + # See ActiveSupport::Inflector.titleize. + # + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#126 + def titleize(keep_id_suffix: T.unsafe(nil)); end + + # Returns a substring from the beginning of the string to the given position. + # If the position is negative, it is counted from the end of the string. + # + # str = "hello" + # str.to(0) # => "h" + # str.to(3) # => "hell" + # str.to(-2) # => "hell" + # + # You can mix it with +from+ method and do fun things like: + # + # str = "hello" + # str.from(0).to(-1) # => "hello" + # str.from(1).to(-2) # => "ell" + # + # source://activesupport//lib/active_support/core_ext/string/access.rb#63 + def to(position); end + + # Converts a string to a Date value. + # + # "1-1-2012".to_date # => Sun, 01 Jan 2012 + # "01/01/2012".to_date # => Sun, 01 Jan 2012 + # "2012-12-13".to_date # => Thu, 13 Dec 2012 + # "12/13/2012".to_date # => ArgumentError: invalid date + # + # source://activesupport//lib/active_support/core_ext/string/conversions.rb#47 + def to_date; end + + # Converts a string to a DateTime value. + # + # "1-1-2012".to_datetime # => Sun, 01 Jan 2012 00:00:00 +0000 + # "01/01/2012 23:59:59".to_datetime # => Sun, 01 Jan 2012 23:59:59 +0000 + # "2012-12-13 12:50".to_datetime # => Thu, 13 Dec 2012 12:50:00 +0000 + # "12/13/2012".to_datetime # => ArgumentError: invalid date + # + # source://activesupport//lib/active_support/core_ext/string/conversions.rb#57 + def to_datetime; end + + # Converts a string to a Time value. + # The +form+ can be either +:utc+ or +:local+ (default +:local+). + # + # The time is parsed using Time.parse method. + # If +form+ is +:local+, then the time is in the system timezone. + # If the date part is missing then the current date is used and if + # the time part is missing then it is assumed to be 00:00:00. + # + # "13-12-2012".to_time # => 2012-12-13 00:00:00 +0100 + # "06:12".to_time # => 2012-12-13 06:12:00 +0100 + # "2012-12-13 06:12".to_time # => 2012-12-13 06:12:00 +0100 + # "2012-12-13T06:12".to_time # => 2012-12-13 06:12:00 +0100 + # "2012-12-13T06:12".to_time(:utc) # => 2012-12-13 06:12:00 UTC + # "12/13/2012".to_time # => ArgumentError: argument out of range + # "1604326192".to_time # => ArgumentError: argument out of range + # + # source://activesupport//lib/active_support/core_ext/string/conversions.rb#22 + def to_time(form = T.unsafe(nil)); end + + # Truncates a given +text+ to length truncate_to if +text+ is longer than truncate_to: + # + # 'Once upon a time in a world far far away'.truncate(27) + # # => "Once upon a time in a wo..." + # + # Pass a string or regexp :separator to truncate +text+ at a natural break: + # + # 'Once upon a time in a world far far away'.truncate(27, separator: ' ') + # # => "Once upon a time in a..." + # + # 'Once upon a time in a world far far away'.truncate(27, separator: /\s/) + # # => "Once upon a time in a..." + # + # The last characters will be replaced with the :omission string (defaults to "..."). + # The total length will not exceed truncate_to unless both +text+ and :omission + # are longer than truncate_to: + # + # 'And they found that many people were sleeping better.'.truncate(25, omission: '... (continued)') + # # => "And they f... (continued)" + # + # 'And they found that many people were sleeping better.'.truncate(4, omission: '... (continued)') + # # => "... (continued)" + # + # source://activesupport//lib/active_support/core_ext/string/filters.rb#70 + def truncate(truncate_to, options = T.unsafe(nil)); end + + # Truncates +text+ to at most truncate_to bytes in length without + # breaking string encoding by splitting multibyte characters or breaking + # grapheme clusters ("perceptual characters") by truncating at combining + # characters. + # + # >> "🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪".size + # # => 20 + # >> "🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪".bytesize + # # => 80 + # >> "🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪".truncate_bytes(20) + # # => "🔪🔪🔪🔪…" + # + # The truncated text ends with the :omission string, defaulting + # to "…", for a total length not exceeding truncate_to. + # + # Raises +ArgumentError+ when the bytesize of :omission exceeds truncate_to. + # + # source://activesupport//lib/active_support/core_ext/string/filters.rb#101 + def truncate_bytes(truncate_to, omission: T.unsafe(nil)); end + + # Truncates a given +text+ after a given number of words (words_count): + # + # 'Once upon a time in a world far far away'.truncate_words(4) + # # => "Once upon a time..." + # + # Pass a string or regexp :separator to specify a different separator of words: + # + # 'Once
    upon
    a
    time
    in
    a
    world'.truncate_words(5, separator: '
    ') + # # => "Once
    upon
    a
    time
    in..." + # + # The last characters will be replaced with the :omission string (defaults to "..."): + # + # 'And they found that many people were sleeping better.'.truncate_words(5, omission: '... (continued)') + # # => "And they found that many... (continued)" + # + # source://activesupport//lib/active_support/core_ext/string/filters.rb#142 + def truncate_words(words_count, options = T.unsafe(nil)); end + + # The reverse of +camelize+. Makes an underscored, lowercase form from the expression in the string. + # + # +underscore+ will also change '::' to '/' to convert namespaces to paths. + # + # 'ActiveModel'.underscore # => "active_model" + # 'ActiveModel::Errors'.underscore # => "active_model/errors" + # + # See ActiveSupport::Inflector.underscore. + # + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#139 + def underscore; end + + # Converts the first character to uppercase. + # + # 'what a Lovely Day'.upcase_first # => "What a Lovely Day" + # 'w'.upcase_first # => "W" + # ''.upcase_first # => "" + # + # See ActiveSupport::Inflector.upcase_first. + # + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#273 + def upcase_first; end +end + +# source://activesupport//lib/active_support/core_ext/object/blank.rb#136 +String::BLANK_RE = T.let(T.unsafe(nil), Regexp) + +# source://activesupport//lib/active_support/core_ext/object/blank.rb#137 +String::ENCODED_BLANKS = T.let(T.unsafe(nil), Concurrent::Map) + +# source://activesupport//lib/active_support/core_ext/object/json.rb#74 +class Struct + include ::Enumerable + + # source://activesupport//lib/active_support/core_ext/object/json.rb#75 + def as_json(options = T.unsafe(nil)); end +end + +# source://activesupport//lib/active_support/core_ext/object/blank.rb#123 +class Symbol + include ::Comparable + + # source://activesupport//lib/active_support/core_ext/object/json.rb#105 + def as_json(options = T.unsafe(nil)); end + + # A Symbol is blank if it's empty: + # + # :''.blank? # => true + # :symbol.blank? # => false + # + # source://activesupport//lib/active_support/core_ext/object/blank.rb#128 + def blank?; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/object/blank.rb#130 + def present?; end +end + +class Thread + # source://activesupport//lib/active_support/isolated_execution_state.rb#7 + def active_support_execution_state; end + + # source://activesupport//lib/active_support/isolated_execution_state.rb#7 + def active_support_execution_state=(_arg0); end +end + +# source://activesupport//lib/active_support/core_ext/thread/backtrace/location.rb#3 +class Thread::Backtrace::Location + # source://activesupport//lib/active_support/core_ext/thread/backtrace/location.rb#4 + def spot(ex); end +end + +# source://activesupport//lib/active_support/core_ext/object/blank.rb#186 +class Time + include ::Comparable + include ::DateAndTime::Zones + include ::DateAndTime::Calculations + include ::DateAndTime::Compatibility + + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#298 + def +(other); end + + # Time#- can also be used to determine the number of seconds between two Time instances. + # We're layering on additional behavior so that ActiveSupport::TimeWithZone instances + # are coerced into values that Time#- will recognize + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#308 + def -(other); end + + # Layers additional behavior on Time#<=> so that DateTime and ActiveSupport::TimeWithZone instances + # can be chronologically compared with a Time + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#338 + def <=>(other); end + + # Duck-types as a Time-like class. See Object#acts_like?. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/time/acts_like.rb#7 + def acts_like_time?; end + + # Uses Date to provide precise Time calculations for years, months, and days + # according to the proleptic Gregorian calendar. The +options+ parameter + # takes a hash with any of these keys: :years, :months, + # :weeks, :days, :hours, :minutes, + # :seconds. + # + # Time.new(2015, 8, 1, 14, 35, 0).advance(seconds: 1) # => 2015-08-01 14:35:01 -0700 + # Time.new(2015, 8, 1, 14, 35, 0).advance(minutes: 1) # => 2015-08-01 14:36:00 -0700 + # Time.new(2015, 8, 1, 14, 35, 0).advance(hours: 1) # => 2015-08-01 15:35:00 -0700 + # Time.new(2015, 8, 1, 14, 35, 0).advance(days: 1) # => 2015-08-02 14:35:00 -0700 + # Time.new(2015, 8, 1, 14, 35, 0).advance(weeks: 1) # => 2015-08-08 14:35:00 -0700 + # + # Just like Date#advance, increments are applied in order of time units from + # largest to smallest. This order can affect the result around the end of a + # month. + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#194 + def advance(options); end + + # Returns a new Time representing the time a number of seconds ago, this is basically a wrapper around the Numeric extension + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#220 + def ago(seconds); end + + # source://activesupport//lib/active_support/core_ext/object/json.rb#201 + def as_json(options = T.unsafe(nil)); end + + # Returns a new Time representing the start of the day (0:00) + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#236 + def at_beginning_of_day; end + + # Returns a new Time representing the start of the hour (x:00) + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#263 + def at_beginning_of_hour; end + + # Returns a new Time representing the start of the minute (x:xx:00) + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#279 + def at_beginning_of_minute; end + + # Returns a new Time representing the end of the day, 23:59:59.999999 + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#257 + def at_end_of_day; end + + # Returns a new Time representing the end of the hour, x:59:59.999999 + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#273 + def at_end_of_hour; end + + # Returns a new Time representing the end of the minute, x:xx:59.999999 + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#288 + def at_end_of_minute; end + + # Returns a new Time representing the middle of the day (12:00) + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#244 + def at_midday; end + + # Returns a new Time representing the middle of the day (12:00) + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#246 + def at_middle_of_day; end + + # Returns a new Time representing the start of the day (0:00) + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#235 + def at_midnight; end + + # Returns a new Time representing the middle of the day (12:00) + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#245 + def at_noon; end + + # Returns a new Time representing the start of the day (0:00) + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#231 + def beginning_of_day; end + + # Returns a new Time representing the start of the hour (x:00) + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#260 + def beginning_of_hour; end + + # Returns a new Time representing the start of the minute (x:xx:00) + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#276 + def beginning_of_minute; end + + # No Time is blank: + # + # Time.now.blank? # => false + # + # @return [false] + # + # source://activesupport//lib/active_support/core_ext/object/blank.rb#192 + def blank?; end + + # Returns a new Time where one or more of the elements have been changed according + # to the +options+ parameter. The time options (:hour, :min, + # :sec, :usec, :nsec) reset cascadingly, so if only + # the hour is passed, then minute, sec, usec, and nsec is set to 0. If the hour + # and minute is passed, then sec, usec, and nsec is set to 0. The +options+ parameter + # takes a hash with any of these keys: :year, :month, :day, + # :hour, :min, :sec, :usec, :nsec, + # :offset. Pass either :usec or :nsec, not both. + # + # Time.new(2012, 8, 29, 22, 35, 0).change(day: 1) # => Time.new(2012, 8, 1, 22, 35, 0) + # Time.new(2012, 8, 29, 22, 35, 0).change(year: 1981, day: 1) # => Time.new(1981, 8, 1, 22, 35, 0) + # Time.new(2012, 8, 29, 22, 35, 0).change(year: 1981, hour: 0) # => Time.new(1981, 8, 29, 0, 0, 0) + # + # @raise [ArgumentError] + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#123 + def change(options); end + + # Layers additional behavior on Time#<=> so that DateTime and ActiveSupport::TimeWithZone instances + # can be chronologically compared with a Time + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#322 + def compare_with_coercion(other); end + + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#337 + def compare_without_coercion(_arg0); end + + # Returns a new Time representing the end of the day, 23:59:59.999999 + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#249 + def end_of_day; end + + # Returns a new Time representing the end of the hour, x:59:59.999999 + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#266 + def end_of_hour; end + + # Returns a new Time representing the end of the minute, x:xx:59.999999 + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#282 + def end_of_minute; end + + # Layers additional behavior on Time#eql? so that ActiveSupport::TimeWithZone instances + # can be eql? to an equivalent Time + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#348 + def eql?(other); end + + # Layers additional behavior on Time#eql? so that ActiveSupport::TimeWithZone instances + # can be eql? to an equivalent Time + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#342 + def eql_with_coercion(other); end + + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#347 + def eql_without_coercion(_arg0); end + + # Returns a formatted string of the offset from UTC, or an alternative + # string if the time zone is already UTC. + # + # Time.local(2000).formatted_offset # => "-06:00" + # Time.local(2000).formatted_offset(false) # => "-0600" + # + # source://activesupport//lib/active_support/core_ext/time/conversions.rb#69 + def formatted_offset(colon = T.unsafe(nil), alternate_utc_string = T.unsafe(nil)); end + + # Returns a new Time representing the time a number of seconds since the instance time + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#228 + def in(seconds); end + + # Returns a new Time representing the middle of the day (12:00) + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#242 + def midday; end + + # Returns a new Time representing the middle of the day (12:00) + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#239 + def middle_of_day; end + + # Returns a new Time representing the start of the day (0:00) + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#234 + def midnight; end + + # Time#- can also be used to determine the number of seconds between two Time instances. + # We're layering on additional behavior so that ActiveSupport::TimeWithZone instances + # are coerced into values that Time#- will recognize + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#313 + def minus_with_coercion(other); end + + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#300 + def minus_with_duration(other); end + + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#317 + def minus_without_coercion(other); end + + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#307 + def minus_without_duration(_arg0); end + + # Returns a new time the specified number of days in the future. + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#356 + def next_day(days = T.unsafe(nil)); end + + # Returns a new time the specified number of months in the future. + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#366 + def next_month(months = T.unsafe(nil)); end + + # Returns a new time the specified number of years in the future. + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#376 + def next_year(years = T.unsafe(nil)); end + + # Returns a new Time representing the middle of the day (12:00) + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#243 + def noon; end + + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#290 + def plus_with_duration(other); end + + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#297 + def plus_without_duration(_arg0); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/object/blank.rb#196 + def present?; end + + # Returns a new time the specified number of days ago. + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#351 + def prev_day(days = T.unsafe(nil)); end + + # Returns a new time the specified number of months ago. + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#361 + def prev_month(months = T.unsafe(nil)); end + + # Returns a new time the specified number of years ago. + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#371 + def prev_year(years = T.unsafe(nil)); end + + # Aliased to +xmlschema+ for compatibility with +DateTime+ + # + # source://activesupport//lib/active_support/core_ext/time/conversions.rb#74 + def rfc3339(*_arg0); end + + # Returns the fraction of a second as a +Rational+ + # + # Time.new(2012, 8, 29, 0, 0, 0.5).sec_fraction # => (1/2) + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#107 + def sec_fraction; end + + # Returns the number of seconds since 00:00:00. + # + # Time.new(2012, 8, 29, 0, 0, 0).seconds_since_midnight # => 0.0 + # Time.new(2012, 8, 29, 12, 34, 56).seconds_since_midnight # => 45296.0 + # Time.new(2012, 8, 29, 23, 59, 59).seconds_since_midnight # => 86399.0 + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#91 + def seconds_since_midnight; end + + # Returns the number of seconds until 23:59:59. + # + # Time.new(2012, 8, 29, 0, 0, 0).seconds_until_end_of_day # => 86399 + # Time.new(2012, 8, 29, 12, 34, 56).seconds_until_end_of_day # => 41103 + # Time.new(2012, 8, 29, 23, 59, 59).seconds_until_end_of_day # => 0 + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#100 + def seconds_until_end_of_day; end + + # Returns a new Time representing the time a number of seconds since the instance time + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#225 + def since(seconds); end + + # Converts to a formatted string. See DATE_FORMATS for built-in formats. + # + # This method is aliased to to_formatted_s. + # + # time = Time.now # => 2007-01-18 06:10:17 -06:00 + # + # time.to_fs(:time) # => "06:10" + # time.to_formatted_s(:time) # => "06:10" + # + # time.to_fs(:db) # => "2007-01-18 06:10:17" + # time.to_fs(:number) # => "20070118061017" + # time.to_fs(:short) # => "18 Jan 06:10" + # time.to_fs(:long) # => "January 18, 2007 06:10" + # time.to_fs(:long_ordinal) # => "January 18th, 2007 06:10" + # time.to_fs(:rfc822) # => "Thu, 18 Jan 2007 06:10:17 -0600" + # time.to_fs(:rfc2822) # => "Thu, 18 Jan 2007 06:10:17 -0600" + # time.to_fs(:iso8601) # => "2007-01-18T06:10:17-06:00" + # + # == Adding your own time formats to +to_fs+ + # You can add your own formats to the Time::DATE_FORMATS hash. + # Use the format name as the hash key and either a strftime string + # or Proc instance that takes a time argument as the value. + # + # # config/initializers/time_formats.rb + # Time::DATE_FORMATS[:month_and_year] = '%B %Y' + # Time::DATE_FORMATS[:short_ordinal] = ->(time) { time.strftime("%B #{time.day.ordinalize}") } + # + # source://activesupport//lib/active_support/core_ext/time/conversions.rb#62 + def to_formatted_s(format = T.unsafe(nil)); end + + # Converts to a formatted string. See DATE_FORMATS for built-in formats. + # + # This method is aliased to to_formatted_s. + # + # time = Time.now # => 2007-01-18 06:10:17 -06:00 + # + # time.to_fs(:time) # => "06:10" + # time.to_formatted_s(:time) # => "06:10" + # + # time.to_fs(:db) # => "2007-01-18 06:10:17" + # time.to_fs(:number) # => "20070118061017" + # time.to_fs(:short) # => "18 Jan 06:10" + # time.to_fs(:long) # => "January 18, 2007 06:10" + # time.to_fs(:long_ordinal) # => "January 18th, 2007 06:10" + # time.to_fs(:rfc822) # => "Thu, 18 Jan 2007 06:10:17 -0600" + # time.to_fs(:rfc2822) # => "Thu, 18 Jan 2007 06:10:17 -0600" + # time.to_fs(:iso8601) # => "2007-01-18T06:10:17-06:00" + # + # == Adding your own time formats to +to_fs+ + # You can add your own formats to the Time::DATE_FORMATS hash. + # Use the format name as the hash key and either a strftime string + # or Proc instance that takes a time argument as the value. + # + # # config/initializers/time_formats.rb + # Time::DATE_FORMATS[:month_and_year] = '%B %Y' + # Time::DATE_FORMATS[:short_ordinal] = ->(time) { time.strftime("%B #{time.day.ordinalize}") } + # + # source://activesupport//lib/active_support/core_ext/time/conversions.rb#55 + def to_fs(format = T.unsafe(nil)); end + + # Return +self+. + # + # source://activesupport//lib/active_support/core_ext/time/compatibility.rb#9 + def to_time; end + + class << self + # Overriding case equality method so that it returns true for ActiveSupport::TimeWithZone instances + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#18 + def ===(other); end + + # Layers additional behavior on Time.at so that ActiveSupport::TimeWithZone and DateTime + # instances can be used when called with a single argument + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#60 + def at(time_or_number, *args, **_arg2); end + + # Layers additional behavior on Time.at so that ActiveSupport::TimeWithZone and DateTime + # instances can be used when called with a single argument + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#45 + def at_with_coercion(time_or_number, *args, **_arg2); end + + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#59 + def at_without_coercion(time, subsec = T.unsafe(nil), unit = T.unsafe(nil), in: T.unsafe(nil)); end + + # Returns Time.zone.now when Time.zone or config.time_zone are set, otherwise just returns Time.now. + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#39 + def current; end + + # Returns the number of days in the given month. + # If no year is specified, it will use the current year. + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#24 + def days_in_month(month, year = T.unsafe(nil)); end + + # Returns the number of days in the given year. + # If no year is specified, it will use the current year. + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#34 + def days_in_year(year = T.unsafe(nil)); end + + # Returns a TimeZone instance matching the time zone provided. + # Accepts the time zone in any format supported by Time.zone=. + # Returns +nil+ for invalid time zones. + # + # Time.find_zone "America/New_York" # => # + # Time.find_zone "NOT-A-TIMEZONE" # => nil + # + # source://activesupport//lib/active_support/core_ext/time/zones.rb#93 + def find_zone(time_zone); end + + # Returns a TimeZone instance matching the time zone provided. + # Accepts the time zone in any format supported by Time.zone=. + # Raises an +ArgumentError+ for invalid time zones. + # + # Time.find_zone! "America/New_York" # => # + # Time.find_zone! "EST" # => # + # Time.find_zone! -5.hours # => # + # Time.find_zone! nil # => nil + # Time.find_zone! false # => false + # Time.find_zone! "NOT-A-TIMEZONE" # => ArgumentError: Invalid Timezone: NOT-A-TIMEZONE + # + # source://activesupport//lib/active_support/core_ext/time/zones.rb#81 + def find_zone!(time_zone); end + + # Creates a +Time+ instance from an RFC 3339 string. + # + # Time.rfc3339('1999-12-31T14:00:00-10:00') # => 2000-01-01 00:00:00 -1000 + # + # If the time or offset components are missing then an +ArgumentError+ will be raised. + # + # Time.rfc3339('1999-12-31') # => ArgumentError: invalid date + # + # @raise [ArgumentError] + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#69 + def rfc3339(str); end + + # Allows override of Time.zone locally inside supplied block; + # resets Time.zone to existing value when done. + # + # class ApplicationController < ActionController::Base + # around_action :set_time_zone + # + # private + # def set_time_zone + # Time.use_zone(current_user.timezone) { yield } + # end + # end + # + # NOTE: This won't affect any ActiveSupport::TimeWithZone + # objects that have already been created, e.g. any model timestamp + # attributes that have been read before the block will remain in + # the application's default timezone. + # + # source://activesupport//lib/active_support/core_ext/time/zones.rb#61 + def use_zone(time_zone); end + + # Returns the TimeZone for the current request, if this has been set (via Time.zone=). + # If Time.zone has not been set for the current request, returns the TimeZone specified in config.time_zone. + # + # source://activesupport//lib/active_support/core_ext/time/zones.rb#14 + def zone; end + + # Sets Time.zone to a TimeZone object for the current request/thread. + # + # This method accepts any of the following: + # + # * A \Rails TimeZone object. + # * An identifier for a \Rails TimeZone object (e.g., "Eastern \Time (US & Canada)", -5.hours). + # * A +TZInfo::Timezone+ object. + # * An identifier for a +TZInfo::Timezone+ object (e.g., "America/New_York"). + # + # Here's an example of how you might set Time.zone on a per request basis and reset it when the request is done. + # current_user.time_zone just needs to return a string identifying the user's preferred time zone: + # + # class ApplicationController < ActionController::Base + # around_action :set_time_zone + # + # def set_time_zone + # if logged_in? + # Time.use_zone(current_user.time_zone) { yield } + # else + # yield + # end + # end + # end + # + # source://activesupport//lib/active_support/core_ext/time/zones.rb#41 + def zone=(time_zone); end + + # Returns the value of attribute zone_default. + # + # source://activesupport//lib/active_support/core_ext/time/zones.rb#10 + def zone_default; end + + # Sets the attribute zone_default + # + # @param value the value to set the attribute zone_default to. + # + # source://activesupport//lib/active_support/core_ext/time/zones.rb#10 + def zone_default=(_arg0); end + end +end + +# source://activesupport//lib/active_support/core_ext/time/calculations.rb#14 +Time::COMMON_YEAR_DAYS_IN_MONTH = T.let(T.unsafe(nil), Array) + +# source://activesupport//lib/active_support/core_ext/time/conversions.rb#8 +Time::DATE_FORMATS = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/core_ext/object/blank.rb#80 +class TrueClass + # source://activesupport//lib/active_support/core_ext/object/json.rb#81 + def as_json(options = T.unsafe(nil)); end + + # +true+ is not blank: + # + # true.blank? # => false + # + # @return [false] + # + # source://activesupport//lib/active_support/core_ext/object/blank.rb#86 + def blank?; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/object/blank.rb#90 + def present?; end + + # Returns +self+. + # + # source://activesupport//lib/active_support/core_ext/object/to_query.rb#33 + def to_param; end +end + +# source://activesupport//lib/active_support/core_ext/object/json.rb#230 +class URI::Generic + # source://activesupport//lib/active_support/core_ext/object/json.rb#231 + def as_json(options = T.unsafe(nil)); end +end diff --git a/sorbet/rbi/gems/addressable@2.8.8.rbi b/sorbet/rbi/gems/addressable@2.8.8.rbi new file mode 100644 index 0000000..0258e2b --- /dev/null +++ b/sorbet/rbi/gems/addressable@2.8.8.rbi @@ -0,0 +1,1404 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `addressable` gem. +# Please instead update this file by running `bin/tapioca gem addressable`. + + +# Addressable is a library for processing links and URIs. +# +# source://addressable//lib/addressable/version.rb#22 +module Addressable; end + +# source://addressable//lib/addressable/idna/pure.rb#21 +module Addressable::IDNA + class << self + # source://addressable//lib/addressable/idna/pure.rb#117 + def _deprecated_unicode_normalize_kc(value); end + + # Converts from a Unicode internationalized domain name to an ASCII + # domain name as described in RFC 3490. + # + # source://addressable//lib/addressable/idna/pure.rb#62 + def to_ascii(input); end + + # Converts from an ASCII domain name to a Unicode internationalized + # domain name as described in RFC 3490. + # + # source://addressable//lib/addressable/idna/pure.rb#88 + def to_unicode(input); end + + # @deprecated Use {String#unicode_normalize(:nfkc)} instead + # + # source://addressable//lib/addressable/idna/pure.rb#112 + def unicode_normalize_kc(*args, **_arg1, &block); end + + private + + # source://addressable//lib/addressable/idna/pure.rb#135 + def lookup_unicode_lowercase(codepoint); end + + # Bias adaptation method + # + # source://addressable//lib/addressable/idna/pure.rb#4703 + def punycode_adapt(delta, numpoints, firsttime); end + + # @return [Boolean] + # + # source://addressable//lib/addressable/idna/pure.rb#4671 + def punycode_basic?(codepoint); end + + # source://addressable//lib/addressable/idna/pure.rb#4549 + def punycode_decode(punycode); end + + # Returns the numeric value of a basic codepoint + # (for use in representing integers) in the range 0 to + # base - 1, or PUNYCODE_BASE if codepoint does not represent a value. + # + # source://addressable//lib/addressable/idna/pure.rb#4689 + def punycode_decode_digit(codepoint); end + + # @return [Boolean] + # + # source://addressable//lib/addressable/idna/pure.rb#4676 + def punycode_delimiter?(codepoint); end + + # source://addressable//lib/addressable/idna/pure.rb#4428 + def punycode_encode(unicode); end + + # source://addressable//lib/addressable/idna/pure.rb#4681 + def punycode_encode_digit(d); end + + # Unicode aware downcase method. + # + # @api private + # @param input [String] The input string. + # @return [String] The downcased result. + # + # source://addressable//lib/addressable/idna/pure.rb#127 + def unicode_downcase(input); end + end +end + +# source://addressable//lib/addressable/idna/pure.rb#4398 +Addressable::IDNA::ACE_MAX_LENGTH = T.let(T.unsafe(nil), Integer) + +# This module is loosely based on idn_actionmailer by Mick Staugaard, +# the unicode library by Yoshida Masato, and the punycode implementation +# by Kazuhiro Nishiyama. Most of the code was copied verbatim, but +# some reformatting was done, and some translation from C was done. +# +# Without their code to work from as a base, we'd all still be relying +# on the presence of libidn. Which nobody ever seems to have installed. +# +# Original sources: +# http://github.com/staugaard/idn_actionmailer +# http://www.yoshidam.net/Ruby.html#unicode +# http://rubyforge.org/frs/?group_id=2550 +# +# source://addressable//lib/addressable/idna/pure.rb#35 +Addressable::IDNA::ACE_PREFIX = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/idna/pure.rb#4387 +Addressable::IDNA::COMPOSITION_TABLE = T.let(T.unsafe(nil), Hash) + +# source://addressable//lib/addressable/idna/pure.rb#4400 +Addressable::IDNA::PUNYCODE_BASE = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#4404 +Addressable::IDNA::PUNYCODE_DAMP = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#4407 +Addressable::IDNA::PUNYCODE_DELIMITER = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#4405 +Addressable::IDNA::PUNYCODE_INITIAL_BIAS = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#4406 +Addressable::IDNA::PUNYCODE_INITIAL_N = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#4409 +Addressable::IDNA::PUNYCODE_MAXINT = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#4411 +Addressable::IDNA::PUNYCODE_PRINT_ASCII = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/idna/pure.rb#4403 +Addressable::IDNA::PUNYCODE_SKEW = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#4402 +Addressable::IDNA::PUNYCODE_TMAX = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#4401 +Addressable::IDNA::PUNYCODE_TMIN = T.let(T.unsafe(nil), Integer) + +# Input is invalid. +# +# source://addressable//lib/addressable/idna/pure.rb#4422 +class Addressable::IDNA::PunycodeBadInput < ::StandardError; end + +# Output would exceed the space provided. +# +# source://addressable//lib/addressable/idna/pure.rb#4424 +class Addressable::IDNA::PunycodeBigOutput < ::StandardError; end + +# Input needs wider integers to process. +# +# source://addressable//lib/addressable/idna/pure.rb#4426 +class Addressable::IDNA::PunycodeOverflow < ::StandardError; end + +# source://addressable//lib/addressable/idna/pure.rb#151 +Addressable::IDNA::UNICODE_DATA = T.let(T.unsafe(nil), Hash) + +# source://addressable//lib/addressable/idna/pure.rb#145 +Addressable::IDNA::UNICODE_DATA_CANONICAL = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#143 +Addressable::IDNA::UNICODE_DATA_COMBINING_CLASS = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#146 +Addressable::IDNA::UNICODE_DATA_COMPATIBILITY = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#144 +Addressable::IDNA::UNICODE_DATA_EXCLUSION = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#148 +Addressable::IDNA::UNICODE_DATA_LOWERCASE = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#149 +Addressable::IDNA::UNICODE_DATA_TITLECASE = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#147 +Addressable::IDNA::UNICODE_DATA_UPPERCASE = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#4397 +Addressable::IDNA::UNICODE_MAX_LENGTH = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#37 +Addressable::IDNA::UTF8_REGEX = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/idna/pure.rb#48 +Addressable::IDNA::UTF8_REGEX_MULTIBYTE = T.let(T.unsafe(nil), Regexp) + +# This is an implementation of a URI parser based on +# RFC 3986, +# RFC 3987. +# +# source://addressable//lib/addressable/uri.rb#31 +class Addressable::URI + # Creates a new uri object from component parts. + # + # @option [String, + # @option [String, + # @option [String, + # @option [String, + # @option [String, + # @option [String, + # @option [String, + # @option [String, + # @option [String, + # @option [String, + # @param [String, [Hash] a customizable set of options + # @return [Addressable::URI] The constructed URI object. + # + # source://addressable//lib/addressable/uri.rb#830 + def initialize(options = T.unsafe(nil)); end + + # Joins two URIs together. + # + # @param The [String, Addressable::URI, #to_str] URI to join with. + # @return [Addressable::URI] The joined URI. + # + # source://addressable//lib/addressable/uri.rb#1982 + def +(uri); end + + # Returns true if the URI objects are equal. This method + # normalizes both URIs before doing the comparison. + # + # @param uri [Object] The URI to compare. + # @return [TrueClass, FalseClass] true if the URIs are equivalent, false + # otherwise. + # + # source://addressable//lib/addressable/uri.rb#2239 + def ==(uri); end + + # Returns true if the URI objects are equal. This method + # normalizes both URIs before doing the comparison, and allows comparison + # against Strings. + # + # @param uri [Object] The URI to compare. + # @return [TrueClass, FalseClass] true if the URIs are equivalent, false + # otherwise. + # + # source://addressable//lib/addressable/uri.rb#2217 + def ===(uri); end + + # Determines if the URI is absolute. + # + # @return [TrueClass, FalseClass] true if the URI is absolute. false + # otherwise. + # + # source://addressable//lib/addressable/uri.rb#1879 + def absolute?; end + + # The authority component for this URI. + # Combines the user, password, host, and port components. + # + # @return [String] The authority component. + # + # source://addressable//lib/addressable/uri.rb#1234 + def authority; end + + # Sets the authority component for this URI. + # + # @param new_authority [String, #to_str] The new authority component. + # + # source://addressable//lib/addressable/uri.rb#1274 + def authority=(new_authority); end + + # The basename, if any, of the file in the path component. + # + # @return [String] The path's basename. + # + # source://addressable//lib/addressable/uri.rb#1588 + def basename; end + + # The default port for this URI's scheme. + # This method will always returns the default port for the URI's scheme + # regardless of the presence of an explicit port in the URI. + # + # @return [Integer] The default port. + # + # source://addressable//lib/addressable/uri.rb#1454 + def default_port; end + + # This method allows you to make several changes to a URI simultaneously, + # which separately would cause validation errors, but in conjunction, + # are valid. The URI will be revalidated as soon as the entire block has + # been executed. + # + # @param block [Proc] A set of operations to perform on a given URI. + # + # source://addressable//lib/addressable/uri.rb#2396 + def defer_validation; end + + # Creates a URI suitable for display to users. If semantic attacks are + # likely, the application should try to detect these and warn the user. + # See RFC 3986, + # section 7.6 for more information. + # + # @return [Addressable::URI] A URI suitable for display purposes. + # + # source://addressable//lib/addressable/uri.rb#2201 + def display_uri; end + + # Returns the public suffix domain for this host. + # + # @example + # Addressable::URI.parse("http://www.example.co.uk").domain # => "example.co.uk" + # + # source://addressable//lib/addressable/uri.rb#1225 + def domain; end + + # Clones the URI object. + # + # @return [Addressable::URI] The cloned URI. + # + # source://addressable//lib/addressable/uri.rb#2271 + def dup; end + + # Determines if the URI is an empty string. + # + # @return [TrueClass, FalseClass] Returns true if empty, false otherwise. + # + # source://addressable//lib/addressable/uri.rb#2333 + def empty?; end + + # source://addressable//lib/addressable/uri.rb#2406 + def encode_with(coder); end + + # Returns true if the URI objects are equal. This method + # does NOT normalize either URI before doing the comparison. + # + # @param uri [Object] The URI to compare. + # @return [TrueClass, FalseClass] true if the URIs are equivalent, false + # otherwise. + # + # source://addressable//lib/addressable/uri.rb#2253 + def eql?(uri); end + + # The extname, if any, of the file in the path component. + # Empty string if there is no extension. + # + # @return [String] The path's extname. + # + # source://addressable//lib/addressable/uri.rb#1598 + def extname; end + + # The fragment component for this URI. + # + # @return [String] The fragment component. + # + # source://addressable//lib/addressable/uri.rb#1810 + def fragment; end + + # Sets the fragment component for this URI. + # + # @param new_fragment [String, #to_str] The new fragment component. + # + # source://addressable//lib/addressable/uri.rb#1835 + def fragment=(new_fragment); end + + # Freeze URI, initializing instance variables. + # + # @return [Addressable::URI] The frozen URI object. + # + # source://addressable//lib/addressable/uri.rb#870 + def freeze; end + + # A hash value that will make a URI equivalent to its normalized + # form. + # + # @return [Integer] A hash of the URI. + # + # source://addressable//lib/addressable/uri.rb#2263 + def hash; end + + # The host component for this URI. + # + # @return [String] The host component. + # + # source://addressable//lib/addressable/uri.rb#1120 + def host; end + + # Sets the host component for this URI. + # + # @param new_host [String, #to_str] The new host component. + # + # source://addressable//lib/addressable/uri.rb#1156 + def host=(new_host); end + + # This method is same as URI::Generic#host except + # brackets for IPv6 (and 'IPvFuture') addresses are removed. + # + # @return [String] The hostname for this URI. + # @see Addressable::URI#host + # + # source://addressable//lib/addressable/uri.rb#1178 + def hostname; end + + # This method is same as URI::Generic#host= except + # the argument can be a bare IPv6 address (or 'IPvFuture'). + # + # @param new_hostname [String, #to_str] The new hostname for this URI. + # @see Addressable::URI#host= + # + # source://addressable//lib/addressable/uri.rb#1190 + def hostname=(new_hostname); end + + # The inferred port component for this URI. + # This method will normalize to the default port for the URI's scheme if + # the port isn't explicitly specified in the URI. + # + # @return [Integer] The inferred port component. + # + # source://addressable//lib/addressable/uri.rb#1440 + def inferred_port; end + + # source://addressable//lib/addressable/uri.rb#2417 + def init_with(coder); end + + # Returns a String representation of the URI object's state. + # + # @return [String] The URI object's state, as a String. + # + # source://addressable//lib/addressable/uri.rb#2384 + def inspect; end + + # Determines if the scheme indicates an IP-based protocol. + # + # @return [TrueClass, FalseClass] true if the scheme indicates an IP-based protocol. + # false otherwise. + # + # source://addressable//lib/addressable/uri.rb#1855 + def ip_based?; end + + # Joins two URIs together. + # + # @param The [String, Addressable::URI, #to_str] URI to join with. + # @return [Addressable::URI] The joined URI. + # + # source://addressable//lib/addressable/uri.rb#1889 + def join(uri); end + + # Destructive form of join. + # + # @param The [String, Addressable::URI, #to_str] URI to join with. + # @return [Addressable::URI] The joined URI. + # @see Addressable::URI#join + # + # source://addressable//lib/addressable/uri.rb#1992 + def join!(uri); end + + # Merges a URI with a Hash of components. + # This method has different behavior from join. Any + # components present in the hash parameter will override the + # original components. The path component is not treated specially. + # + # @param The [Hash, Addressable::URI, #to_hash] components to merge with. + # @return [Addressable::URI] The merged URI. + # @see Hash#merge + # + # source://addressable//lib/addressable/uri.rb#2007 + def merge(hash); end + + # Destructive form of merge. + # + # @param The [Hash, Addressable::URI, #to_hash] components to merge with. + # @return [Addressable::URI] The merged URI. + # @see Addressable::URI#merge + # + # source://addressable//lib/addressable/uri.rb#2072 + def merge!(uri); end + + # Returns a normalized URI object. + # + # NOTE: This method does not attempt to fully conform to specifications. + # It exists largely to correct other people's failures to read the + # specifications, and also to deal with caching issues since several + # different URIs may represent the same resource and should not be + # cached multiple times. + # + # @return [Addressable::URI] The normalized URI. + # + # source://addressable//lib/addressable/uri.rb#2164 + def normalize; end + + # Destructively normalizes this URI object. + # + # @return [Addressable::URI] The normalized URI. + # @see Addressable::URI#normalize + # + # source://addressable//lib/addressable/uri.rb#2190 + def normalize!; end + + # The authority component for this URI, normalized. + # + # @return [String] The authority component, normalized. + # + # source://addressable//lib/addressable/uri.rb#1252 + def normalized_authority; end + + # The fragment component for this URI, normalized. + # + # @return [String] The fragment component, normalized. + # + # source://addressable//lib/addressable/uri.rb#1816 + def normalized_fragment; end + + # The host component for this URI, normalized. + # + # @return [String] The host component, normalized. + # + # source://addressable//lib/addressable/uri.rb#1126 + def normalized_host; end + + # The password component for this URI, normalized. + # + # @return [String] The password component, normalized. + # + # source://addressable//lib/addressable/uri.rb#1002 + def normalized_password; end + + # The path component for this URI, normalized. + # + # @return [String] The path component, normalized. + # + # source://addressable//lib/addressable/uri.rb#1535 + def normalized_path; end + + # The port component for this URI, normalized. + # + # @return [Integer] The port component, normalized. + # + # source://addressable//lib/addressable/uri.rb#1392 + def normalized_port; end + + # The query component for this URI, normalized. + # + # @return [String] The query component, normalized. + # + # source://addressable//lib/addressable/uri.rb#1613 + def normalized_query(*flags); end + + # The scheme component for this URI, normalized. + # + # @return [String] The scheme component, normalized. + # + # source://addressable//lib/addressable/uri.rb#896 + def normalized_scheme; end + + # The normalized combination of components that represent a site. + # Combines the scheme, user, password, host, and port components. + # Primarily useful for HTTP and HTTPS. + # + # For example, "http://example.com/path?query" would have a + # site value of "http://example.com". + # + # @return [String] The normalized components that identify a site. + # + # source://addressable//lib/addressable/uri.rb#1485 + def normalized_site; end + + # The user component for this URI, normalized. + # + # @return [String] The user component, normalized. + # + # source://addressable//lib/addressable/uri.rb#947 + def normalized_user; end + + # The userinfo component for this URI, normalized. + # + # @return [String] The userinfo component, normalized. + # + # source://addressable//lib/addressable/uri.rb#1068 + def normalized_userinfo; end + + # Omits components from a URI. + # + # @example + # uri = Addressable::URI.parse("http://example.com/path?query") + # #=> # + # uri.omit(:scheme, :authority) + # #=> # + # @param *components [Symbol] The components to be omitted. + # @return [Addressable::URI] The URI with components omitted. + # + # source://addressable//lib/addressable/uri.rb#2297 + def omit(*components); end + + # Destructive form of omit. + # + # @param *components [Symbol] The components to be omitted. + # @return [Addressable::URI] The URI with components omitted. + # @see Addressable::URI#omit + # + # source://addressable//lib/addressable/uri.rb#2324 + def omit!(*components); end + + # The origin for this URI, serialized to ASCII, as per + # RFC 6454, section 6.2. + # + # @return [String] The serialized origin. + # + # source://addressable//lib/addressable/uri.rb#1314 + def origin; end + + # Sets the origin for this URI, serialized to ASCII, as per + # RFC 6454, section 6.2. This assignment will reset the `userinfo` + # component. + # + # @param new_origin [String, #to_str] The new origin component. + # + # source://addressable//lib/addressable/uri.rb#1333 + def origin=(new_origin); end + + # The password component for this URI. + # + # @return [String] The password component. + # + # source://addressable//lib/addressable/uri.rb#996 + def password; end + + # Sets the password component for this URI. + # + # @param new_password [String, #to_str] The new password component. + # + # source://addressable//lib/addressable/uri.rb#1025 + def password=(new_password); end + + # The path component for this URI. + # + # @return [String] The path component. + # + # source://addressable//lib/addressable/uri.rb#1528 + def path; end + + # Sets the path component for this URI. + # + # @param new_path [String, #to_str] The new path component. + # + # source://addressable//lib/addressable/uri.rb#1567 + def path=(new_path); end + + # The port component for this URI. + # This is the port number actually given in the URI. This does not + # infer port numbers from default values. + # + # @return [Integer] The port component. + # + # source://addressable//lib/addressable/uri.rb#1386 + def port; end + + # Sets the port component for this URI. + # + # @param new_port [String, Integer, #to_s] The new port component. + # + # source://addressable//lib/addressable/uri.rb#1408 + def port=(new_port); end + + # The query component for this URI. + # + # @return [String] The query component. + # + # source://addressable//lib/addressable/uri.rb#1607 + def query; end + + # Sets the query component for this URI. + # + # @param new_query [String, #to_str] The new query component. + # + # source://addressable//lib/addressable/uri.rb#1641 + def query=(new_query); end + + # Converts the query component to a Hash value. + # + # @example + # Addressable::URI.parse("?one=1&two=2&three=3").query_values + # #=> {"one" => "1", "two" => "2", "three" => "3"} + # Addressable::URI.parse("?one=two&one=three").query_values(Array) + # #=> [["one", "two"], ["one", "three"]] + # Addressable::URI.parse("?one=two&one=three").query_values(Hash) + # #=> {"one" => "three"} + # Addressable::URI.parse("?").query_values + # #=> {} + # Addressable::URI.parse("").query_values + # #=> nil + # @param return_type [Class] The return type desired. Value must be either + # `Hash` or `Array`. + # @return [Hash, Array, nil] The query string parsed as a Hash or Array + # or nil if the query string is blank. + # + # source://addressable//lib/addressable/uri.rb#1672 + def query_values(return_type = T.unsafe(nil)); end + + # Sets the query component for this URI from a Hash object. + # An empty Hash or Array will result in an empty query string. + # + # @example + # uri.query_values = {:a => "a", :b => ["c", "d", "e"]} + # uri.query + # # => "a=a&b=c&b=d&b=e" + # uri.query_values = [['a', 'a'], ['b', 'c'], ['b', 'd'], ['b', 'e']] + # uri.query + # # => "a=a&b=c&b=d&b=e" + # uri.query_values = [['a', 'a'], ['b', ['c', 'd', 'e']]] + # uri.query + # # => "a=a&b=c&b=d&b=e" + # uri.query_values = [['flag'], ['key', 'value']] + # uri.query + # # => "flag&key=value" + # @param new_query_values [Hash, #to_hash, Array] The new query values. + # + # source://addressable//lib/addressable/uri.rb#1723 + def query_values=(new_query_values); end + + # Determines if the URI is relative. + # + # @return [TrueClass, FalseClass] true if the URI is relative. false + # otherwise. + # + # source://addressable//lib/addressable/uri.rb#1869 + def relative?; end + + # The HTTP request URI for this URI. This is the path and the + # query string. + # + # @return [String] The request URI required for an HTTP request. + # + # source://addressable//lib/addressable/uri.rb#1774 + def request_uri; end + + # Sets the HTTP request URI for this URI. + # + # @param new_request_uri [String, #to_str] The new HTTP request URI. + # + # source://addressable//lib/addressable/uri.rb#1786 + def request_uri=(new_request_uri); end + + # Returns the shortest normalized relative form of this URI that uses the + # supplied URI as a base for resolution. Returns an absolute URI if + # necessary. This is effectively the opposite of route_to. + # + # @param uri [String, Addressable::URI, #to_str] The URI to route from. + # @return [Addressable::URI] The normalized relative URI that is equivalent to the original URI. + # + # source://addressable//lib/addressable/uri.rb#2085 + def route_from(uri); end + + # Returns the shortest normalized relative form of the supplied URI that + # uses this URI as a base for resolution. Returns an absolute URI if + # necessary. This is effectively the opposite of route_from. + # + # @param uri [String, Addressable::URI, #to_str] The URI to route to. + # @return [Addressable::URI] The normalized relative URI that is equivalent to the supplied URI. + # + # source://addressable//lib/addressable/uri.rb#2150 + def route_to(uri); end + + # The scheme component for this URI. + # + # @return [String] The scheme component. + # + # source://addressable//lib/addressable/uri.rb#890 + def scheme; end + + # Sets the scheme component for this URI. + # + # @param new_scheme [String, #to_str] The new scheme component. + # + # source://addressable//lib/addressable/uri.rb#917 + def scheme=(new_scheme); end + + # The combination of components that represent a site. + # Combines the scheme, user, password, host, and port components. + # Primarily useful for HTTP and HTTPS. + # + # For example, "http://example.com/path?query" would have a + # site value of "http://example.com". + # + # @return [String] The components that identify a site. + # + # source://addressable//lib/addressable/uri.rb#1467 + def site; end + + # Sets the site value for this URI. + # + # @param new_site [String, #to_str] The new site value. + # + # source://addressable//lib/addressable/uri.rb#1506 + def site=(new_site); end + + # Returns the top-level domain for this host. + # + # @example + # Addressable::URI.parse("http://www.example.co.uk").tld # => "co.uk" + # + # source://addressable//lib/addressable/uri.rb#1207 + def tld; end + + # Sets the top-level domain for this URI. + # + # @param new_tld [String, #to_str] The new top-level domain. + # + # source://addressable//lib/addressable/uri.rb#1215 + def tld=(new_tld); end + + # Returns a Hash of the URI components. + # + # @return [Hash] The URI as a Hash of components. + # + # source://addressable//lib/addressable/uri.rb#2367 + def to_hash; end + + # Converts the URI to a String. + # + # @return [String] The URI's String representation. + # + # source://addressable//lib/addressable/uri.rb#2341 + def to_s; end + + # Converts the URI to a String. + # URI's are glorified Strings. Allow implicit conversion. + # + # @return [String] The URI's String representation. + # + # source://addressable//lib/addressable/uri.rb#2361 + def to_str; end + + # The user component for this URI. + # + # @return [String] The user component. + # + # source://addressable//lib/addressable/uri.rb#941 + def user; end + + # Sets the user component for this URI. + # + # @param new_user [String, #to_str] The new user component. + # + # source://addressable//lib/addressable/uri.rb#970 + def user=(new_user); end + + # The userinfo component for this URI. + # Combines the user and password components. + # + # @return [String] The userinfo component. + # + # source://addressable//lib/addressable/uri.rb#1052 + def userinfo; end + + # Sets the userinfo component for this URI. + # + # @param new_userinfo [String, #to_str] The new userinfo component. + # + # source://addressable//lib/addressable/uri.rb#1091 + def userinfo=(new_userinfo); end + + protected + + # Converts the string to be UTF-8 if it is not already UTF-8 + # + # @api private + # + # source://addressable//lib/addressable/uri.rb#2561 + def force_utf8_encoding_if_needed(str); end + + # Resets composite values for the entire URI + # + # @api private + # + # source://addressable//lib/addressable/uri.rb#2552 + def remove_composite_values; end + + # Replaces the internal state of self with the specified URI's state. + # Used in destructive operations to avoid massive code repetition. + # + # @param uri [Addressable::URI] The URI to replace self with. + # @return [Addressable::URI] self. + # + # source://addressable//lib/addressable/uri.rb#2519 + def replace_self(uri); end + + # Splits path string with "/" (slash). + # It is considered that there is empty string after last slash when + # path ends with slash. + # + # @param path [String] The path to split. + # @return [Array] An array of parts of path. + # + # source://addressable//lib/addressable/uri.rb#2542 + def split_path(path); end + + # Ensures that the URI is valid. + # + # source://addressable//lib/addressable/uri.rb#2476 + def validate; end + + private + + # Resets instance variables + # + # @api private + # + # source://addressable//lib/addressable/uri.rb#2573 + def reset_ivs; end + + class << self + # Converts a path to a file scheme URI. If the path supplied is + # relative, it will be returned as a relative URI. If the path supplied + # is actually a non-file URI, it will parse the URI as if it had been + # parsed with Addressable::URI.parse. Handles all of the + # various Microsoft-specific formats for specifying paths. + # + # @example + # base = Addressable::URI.convert_path("/absolute/path/") + # uri = Addressable::URI.convert_path("relative/path") + # (base + uri).to_s + # #=> "file:///absolute/path/relative/path" + # + # Addressable::URI.convert_path( + # "c:\\windows\\My Documents 100%20\\foo.txt" + # ).to_s + # #=> "file:///c:/windows/My%20Documents%20100%20/foo.txt" + # + # Addressable::URI.convert_path("http://example.com/").to_s + # #=> "http://example.com/" + # @param path [String, Addressable::URI, #to_str] Typically a String path to a file or directory, but + # will return a sensible return value if an absolute URI is supplied + # instead. + # @return [Addressable::URI] The parsed file scheme URI or the original URI if some other URI + # scheme was provided. + # + # source://addressable//lib/addressable/uri.rb#292 + def convert_path(path); end + + # Percent encodes any special characters in the URI. + # + # @param return_type [Class] The type of object to return. + # This value may only be set to String or + # Addressable::URI. All other values are invalid. Defaults + # to String. + # @param uri [String, Addressable::URI, #to_str] The URI to encode. + # @return [String, Addressable::URI] The encoded URI. + # The return type is determined by the return_type + # parameter. + # + # source://addressable//lib/addressable/uri.rb#616 + def encode(uri, return_type = T.unsafe(nil)); end + + # Percent encodes a URI component. + # + # '9' to be percent encoded. If a Regexp is passed, the + # value /[^b-zB-Z0-9]/ would have the same effect. A set of + # useful String values may be found in the + # Addressable::URI::CharacterClasses module. The default + # value is the reserved plus unreserved character classes specified in + # RFC 3986. + # + # @example + # Addressable::URI.encode_component("simple/example", "b-zB-Z0-9") + # => "simple%2Fex%61mple" + # Addressable::URI.encode_component("simple/example", /[^b-zB-Z0-9]/) + # => "simple%2Fex%61mple" + # Addressable::URI.encode_component( + # "simple/example", Addressable::URI::CharacterClasses::UNRESERVED + # ) + # => "simple%2Fexample" + # @param character_class [String, Regexp] The characters which are not percent encoded. If a String + # is passed, the String must be formatted as a regular + # expression character class. (Do not include the surrounding square + # brackets.) For example, "b-zB-Z0-9" would cause + # everything but the letters 'b' through 'z' and the numbers '0' through + # @param component [String, #to_str] The URI component to encode. + # @param upcase_encoded [Regexp] A string of characters that may already be percent encoded, and whose + # encodings should be upcased. This allows normalization of percent + # encodings for characters not included in the + # character_class. + # @return [String] The encoded component. + # + # source://addressable//lib/addressable/uri.rb#403 + def encode_component(component, character_class = T.unsafe(nil), upcase_encoded = T.unsafe(nil)); end + + # Percent encodes any special characters in the URI. + # + # @param return_type [Class] The type of object to return. + # This value may only be set to String or + # Addressable::URI. All other values are invalid. Defaults + # to String. + # @param uri [String, Addressable::URI, #to_str] The URI to encode. + # @return [String, Addressable::URI] The encoded URI. + # The return type is determined by the return_type + # parameter. + # + # source://addressable//lib/addressable/uri.rb#651 + def escape(uri, return_type = T.unsafe(nil)); end + + # Percent encodes a URI component. + # + # '9' to be percent encoded. If a Regexp is passed, the + # value /[^b-zB-Z0-9]/ would have the same effect. A set of + # useful String values may be found in the + # Addressable::URI::CharacterClasses module. The default + # value is the reserved plus unreserved character classes specified in + # RFC 3986. + # + # @example + # Addressable::URI.encode_component("simple/example", "b-zB-Z0-9") + # => "simple%2Fex%61mple" + # Addressable::URI.encode_component("simple/example", /[^b-zB-Z0-9]/) + # => "simple%2Fex%61mple" + # Addressable::URI.encode_component( + # "simple/example", Addressable::URI::CharacterClasses::UNRESERVED + # ) + # => "simple%2Fexample" + # @param character_class [String, Regexp] The characters which are not percent encoded. If a String + # is passed, the String must be formatted as a regular + # expression character class. (Do not include the surrounding square + # brackets.) For example, "b-zB-Z0-9" would cause + # everything but the letters 'b' through 'z' and the numbers '0' through + # @param component [String, #to_str] The URI component to encode. + # @param upcase_encoded [Regexp] A string of characters that may already be percent encoded, and whose + # encodings should be upcased. This allows normalization of percent + # encodings for characters not included in the + # character_class. + # @return [String] The encoded component. + # + # source://addressable//lib/addressable/uri.rb#446 + def escape_component(component, character_class = T.unsafe(nil), upcase_encoded = T.unsafe(nil)); end + + # Encodes a set of key/value pairs according to the rules for the + # application/x-www-form-urlencoded MIME type. + # + # @param form_values [#to_hash, #to_ary] The form values to encode. + # @param sort [TrueClass, FalseClass] Sort the key/value pairs prior to encoding. + # Defaults to false. + # @return [String] The encoded value. + # + # source://addressable//lib/addressable/uri.rb#740 + def form_encode(form_values, sort = T.unsafe(nil)); end + + # Decodes a String according to the rules for the + # application/x-www-form-urlencoded MIME type. + # + # @param encoded_value [String, #to_str] The form values to decode. + # @return [Array] The decoded values. + # This is not a Hash because of the possibility for + # duplicate keys. + # + # source://addressable//lib/addressable/uri.rb#793 + def form_unencode(encoded_value); end + + # Converts an input to a URI. The input does not have to be a valid + # URI — the method will use heuristics to guess what URI was intended. + # This is not standards-compliant, merely user-friendly. + # + # @param hints [Hash] A Hash of hints to the heuristic parser. + # Defaults to {:scheme => "http"}. + # @param uri [String, Addressable::URI, #to_str] The URI string to parse. + # No parsing is performed if the object is already an + # Addressable::URI. + # @return [Addressable::URI] The parsed URI. + # + # source://addressable//lib/addressable/uri.rb#191 + def heuristic_parse(uri, hints = T.unsafe(nil)); end + + # Returns an array of known ip-based schemes. These schemes typically + # use a similar URI form: + # //:@:/ + # + # source://addressable//lib/addressable/uri.rb#1369 + def ip_based_schemes; end + + # Joins several URIs together. + # + # @example + # base = "http://example.com/" + # uri = Addressable::URI.parse("relative/path") + # Addressable::URI.join(base, uri) + # #=> # + # @param *uris [String, Addressable::URI, #to_str] The URIs to join. + # @return [Addressable::URI] The joined URI. + # + # source://addressable//lib/addressable/uri.rb#343 + def join(*uris); end + + # Normalizes the encoding of a URI component. + # + # @example + # Addressable::URI.normalize_component("simpl%65/%65xampl%65", "b-zB-Z") + # => "simple%2Fex%61mple" + # Addressable::URI.normalize_component( + # "simpl%65/%65xampl%65", /[^b-zB-Z]/ + # ) + # => "simple%2Fex%61mple" + # Addressable::URI.normalize_component( + # "simpl%65/%65xampl%65", + # Addressable::URI::CharacterClasses::UNRESERVED + # ) + # => "simple%2Fexample" + # Addressable::URI.normalize_component( + # "one%20two%2fthree%26four", + # "0-9a-zA-Z &/", + # "/" + # ) + # => "one two%2Fthree&four" + # @param character_class [String, Regexp] The characters which are not percent encoded. If a String + # is passed, the String must be formatted as a regular + # expression character class. (Do not include the surrounding square + # brackets.) For example, "b-zB-Z0-9" would cause + # everything but the letters 'b' through 'z' and the numbers '0' + # through '9' to be percent encoded. If a Regexp is passed, + # the value /[^b-zB-Z0-9]/ would have the same effect. A + # set of useful String values may be found in the + # Addressable::URI::CharacterClasses module. The default + # value is the reserved plus unreserved character classes specified in + # RFC 3986. + # @param component [String, #to_str] The URI component to encode. + # @param leave_encoded [String] When character_class is a String then + # leave_encoded is a string of characters that should remain + # percent encoded while normalizing the component; if they appear percent + # encoded in the original component, then they will be upcased ("%2f" + # normalized to "%2F") but otherwise left alone. + # @return [String] The normalized component. + # + # source://addressable//lib/addressable/uri.rb#552 + def normalize_component(component, character_class = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end + + # Resolves paths to their simplest form. + # + # @param path [String] The path to normalize. + # @return [String] The normalized path. + # + # source://addressable//lib/addressable/uri.rb#2440 + def normalize_path(path); end + + # Normalizes the encoding of a URI. Characters within a hostname are + # not percent encoded to allow for internationalized domain names. + # + # @param return_type [Class] The type of object to return. + # This value may only be set to String or + # Addressable::URI. All other values are invalid. Defaults + # to String. + # @param uri [String, Addressable::URI, #to_str] The URI to encode. + # @return [String, Addressable::URI] The encoded URI. + # The return type is determined by the return_type + # parameter. + # + # source://addressable//lib/addressable/uri.rb#671 + def normalized_encode(uri, return_type = T.unsafe(nil)); end + + # Returns a URI object based on the parsed string. + # + # @param uri [String, Addressable::URI, #to_str] The URI string to parse. + # No parsing is performed if the object is already an + # Addressable::URI. + # @return [Addressable::URI] The parsed URI. + # + # source://addressable//lib/addressable/uri.rb#114 + def parse(uri); end + + # Returns a hash of common IP-based schemes and their default port + # numbers. Adding new schemes to this hash, as necessary, will allow + # for better URI normalization. + # + # source://addressable//lib/addressable/uri.rb#1376 + def port_mapping; end + + # Unencodes any percent encoded characters within a URI component. + # This method may be used for unencoding either components or full URIs, + # however, it is recommended to use the unencode_component + # alias when unencoding components. + # + # @param leave_encoded [String] A string of characters to leave encoded. If a percent encoded character + # in this list is encountered then it will remain percent encoded. + # @param return_type [Class] The type of object to return. + # This value may only be set to String or + # Addressable::URI. All other values are invalid. Defaults + # to String. + # @param uri [String, Addressable::URI, #to_str] The URI or component to unencode. + # @return [String, Addressable::URI] The unencoded component or URI. + # The return type is determined by the return_type + # parameter. + # + # source://addressable//lib/addressable/uri.rb#472 + def unencode(uri, return_type = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end + + # Unencodes any percent encoded characters within a URI component. + # This method may be used for unencoding either components or full URIs, + # however, it is recommended to use the unencode_component + # alias when unencoding components. + # + # @param leave_encoded [String] A string of characters to leave encoded. If a percent encoded character + # in this list is encountered then it will remain percent encoded. + # @param return_type [Class] The type of object to return. + # This value may only be set to String or + # Addressable::URI. All other values are invalid. Defaults + # to String. + # @param uri [String, Addressable::URI, #to_str] The URI or component to unencode. + # @return [String, Addressable::URI] The unencoded component or URI. + # The return type is determined by the return_type + # parameter. + # + # source://addressable//lib/addressable/uri.rb#502 + def unencode_component(uri, return_type = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end + + # Unencodes any percent encoded characters within a URI component. + # This method may be used for unencoding either components or full URIs, + # however, it is recommended to use the unencode_component + # alias when unencoding components. + # + # @param leave_encoded [String] A string of characters to leave encoded. If a percent encoded character + # in this list is encountered then it will remain percent encoded. + # @param return_type [Class] The type of object to return. + # This value may only be set to String or + # Addressable::URI. All other values are invalid. Defaults + # to String. + # @param uri [String, Addressable::URI, #to_str] The URI or component to unencode. + # @return [String, Addressable::URI] The unencoded component or URI. + # The return type is determined by the return_type + # parameter. + # + # source://addressable//lib/addressable/uri.rb#501 + def unescape(uri, return_type = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end + + # Unencodes any percent encoded characters within a URI component. + # This method may be used for unencoding either components or full URIs, + # however, it is recommended to use the unencode_component + # alias when unencoding components. + # + # @param leave_encoded [String] A string of characters to leave encoded. If a percent encoded character + # in this list is encountered then it will remain percent encoded. + # @param return_type [Class] The type of object to return. + # This value may only be set to String or + # Addressable::URI. All other values are invalid. Defaults + # to String. + # @param uri [String, Addressable::URI, #to_str] The URI or component to unencode. + # @return [String, Addressable::URI] The unencoded component or URI. + # The return type is determined by the return_type + # parameter. + # + # source://addressable//lib/addressable/uri.rb#503 + def unescape_component(uri, return_type = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end + end +end + +# Container for the character classes specified in +# RFC 3986. +# +# Note: Concatenated and interpolated `String`s are not affected by the +# `frozen_string_literal` directive and must be frozen explicitly. +# +# Interpolated `String`s *were* frozen this way before Ruby 3.0: +# https://bugs.ruby-lang.org/issues/17104 +# +# source://addressable//lib/addressable/uri.rb#46 +module Addressable::URI::CharacterClasses; end + +# source://addressable//lib/addressable/uri.rb#47 +Addressable::URI::CharacterClasses::ALPHA = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/uri.rb#57 +Addressable::URI::CharacterClasses::AUTHORITY = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/uri.rb#48 +Addressable::URI::CharacterClasses::DIGIT = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/uri.rb#60 +Addressable::URI::CharacterClasses::FRAGMENT = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/uri.rb#49 +Addressable::URI::CharacterClasses::GEN_DELIMS = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/uri.rb#56 +Addressable::URI::CharacterClasses::HOST = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/uri.rb#58 +Addressable::URI::CharacterClasses::PATH = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/uri.rb#54 +Addressable::URI::CharacterClasses::PCHAR = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/uri.rb#59 +Addressable::URI::CharacterClasses::QUERY = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/uri.rb#51 +Addressable::URI::CharacterClasses::RESERVED = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/uri.rb#53 +Addressable::URI::CharacterClasses::RESERVED_AND_UNRESERVED = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/uri.rb#55 +Addressable::URI::CharacterClasses::SCHEME = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/uri.rb#50 +Addressable::URI::CharacterClasses::SUB_DELIMS = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/uri.rb#52 +Addressable::URI::CharacterClasses::UNRESERVED = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/uri.rb#72 +module Addressable::URI::CharacterClassesRegexps; end + +# source://addressable//lib/addressable/uri.rb#73 +Addressable::URI::CharacterClassesRegexps::AUTHORITY = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#74 +Addressable::URI::CharacterClassesRegexps::FRAGMENT = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#75 +Addressable::URI::CharacterClassesRegexps::HOST = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#76 +Addressable::URI::CharacterClassesRegexps::PATH = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#77 +Addressable::URI::CharacterClassesRegexps::QUERY = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#78 +Addressable::URI::CharacterClassesRegexps::RESERVED = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#79 +Addressable::URI::CharacterClassesRegexps::RESERVED_AND_UNRESERVED = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#80 +Addressable::URI::CharacterClassesRegexps::SCHEME = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#81 +Addressable::URI::CharacterClassesRegexps::UNRESERVED = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#85 +Addressable::URI::EMPTY_STR = T.let(T.unsafe(nil), String) + +# Raised if something other than a uri is supplied. +# +# source://addressable//lib/addressable/uri.rb#34 +class Addressable::URI::InvalidURIError < ::StandardError; end + +# source://addressable//lib/addressable/uri.rb#2598 +module Addressable::URI::NONE; end + +# source://addressable//lib/addressable/uri.rb#1530 +Addressable::URI::NORMPATH = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#63 +module Addressable::URI::NormalizeCharacterClasses; end + +# source://addressable//lib/addressable/uri.rb#68 +Addressable::URI::NormalizeCharacterClasses::FRAGMENT = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#64 +Addressable::URI::NormalizeCharacterClasses::HOST = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#66 +Addressable::URI::NormalizeCharacterClasses::PCHAR = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#69 +Addressable::URI::NormalizeCharacterClasses::QUERY = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#67 +Addressable::URI::NormalizeCharacterClasses::SCHEME = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#65 +Addressable::URI::NormalizeCharacterClasses::UNRESERVED = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#2427 +Addressable::URI::PARENT = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/uri.rb#89 +Addressable::URI::PORT_MAPPING = T.let(T.unsafe(nil), Hash) + +# source://addressable//lib/addressable/uri.rb#2429 +Addressable::URI::RULE_2A = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#2430 +Addressable::URI::RULE_2B_2C = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#2431 +Addressable::URI::RULE_2D = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#2432 +Addressable::URI::RULE_PREFIXED_PARENT = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#2426 +Addressable::URI::SELF_REF = T.let(T.unsafe(nil), String) + +# Tables used to optimize encoding operations in `self.encode_component` +# and `self.normalize_component` +# +# source://addressable//lib/addressable/uri.rb#360 +Addressable::URI::SEQUENCE_ENCODING_TABLE = T.let(T.unsafe(nil), Array) + +# source://addressable//lib/addressable/uri.rb#364 +Addressable::URI::SEQUENCE_UPCASED_PERCENT_ENCODING_TABLE = T.let(T.unsafe(nil), Array) + +# source://addressable//lib/addressable/uri.rb#84 +Addressable::URI::SLASH = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/uri.rb#87 +Addressable::URI::URIREGEX = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/version.rb#23 +module Addressable::VERSION; end + +# source://addressable//lib/addressable/version.rb#24 +Addressable::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/version.rb#25 +Addressable::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/version.rb#28 +Addressable::VERSION::STRING = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/version.rb#26 +Addressable::VERSION::TINY = T.let(T.unsafe(nil), Integer) diff --git a/sorbet/rbi/gems/ast@2.4.3.rbi b/sorbet/rbi/gems/ast@2.4.3.rbi new file mode 100644 index 0000000..c05e587 --- /dev/null +++ b/sorbet/rbi/gems/ast@2.4.3.rbi @@ -0,0 +1,586 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `ast` gem. +# Please instead update this file by running `bin/tapioca gem ast`. + + +# {AST} is a library for manipulating abstract syntax trees. +# +# It embraces immutability; each AST node is inherently frozen at +# creation, and updating a child node requires recreating that node +# and its every parent, recursively. +# This is a design choice. It does create some pressure on +# garbage collector, but completely eliminates all concurrency +# and aliasing problems. +# +# See also {AST::Node}, {AST::Processor::Mixin} and {AST::Sexp} for +# additional recommendations and design patterns. +# +# source://ast//lib/ast.rb#13 +module AST; end + +# Node is an immutable class, instances of which represent abstract +# syntax tree nodes. It combines semantic information (i.e. anything +# that affects the algorithmic properties of a program) with +# meta-information (line numbers or compiler intermediates). +# +# Notes on inheritance +# ==================== +# +# The distinction between semantics and metadata is important. Complete +# semantic information should be contained within just the {#type} and +# {#children} of a Node instance; in other words, if an AST was to be +# stripped of all meta-information, it should remain a valid AST which +# could be successfully processed to yield a result with the same +# algorithmic properties. +# +# Thus, Node should never be inherited in order to define methods which +# affect or return semantic information, such as getters for `class_name`, +# `superclass` and `body` in the case of a hypothetical `ClassNode`. The +# correct solution is to use a generic Node with a {#type} of `:class` +# and three children. See also {Processor} for tips on working with such +# ASTs. +# +# On the other hand, Node can and should be inherited to define +# application-specific metadata (see also {#initialize}) or customize the +# printing format. It is expected that an application would have one or two +# such classes and use them across the entire codebase. +# +# The rationale for this pattern is extensibility and maintainability. +# Unlike static ones, dynamic languages do not require the presence of a +# predefined, rigid structure, nor does it improve dispatch efficiency, +# and while such a structure can certainly be defined, it does not add +# any value but incurs a maintaining cost. +# For example, extending the AST even with a transformation-local +# temporary node type requires making globally visible changes to +# the codebase. +# +# source://ast//lib/ast/node.rb#40 +class AST::Node + # Constructs a new instance of Node. + # + # The arguments `type` and `children` are converted with `to_sym` and + # `to_a` respectively. Additionally, the result of converting `children` + # is frozen. While mutating the arguments is generally considered harmful, + # the most common case is to pass an array literal to the constructor. If + # your code does not expect the argument to be frozen, use `#dup`. + # + # The `properties` hash is passed to {#assign_properties}. + # + # @return [Node] a new instance of Node + # + # source://ast//lib/ast/node.rb#72 + def initialize(type, children = T.unsafe(nil), properties = T.unsafe(nil)); end + + # Concatenates `array` with `children` and returns the resulting node. + # + # @return [AST::Node] + # + # source://ast//lib/ast/node.rb#172 + def +(array); end + + # Appends `element` to `children` and returns the resulting node. + # + # @return [AST::Node] + # + # source://ast//lib/ast/node.rb#181 + def <<(element); end + + # Compares `self` to `other`, possibly converting with `to_ast`. Only + # `type` and `children` are compared; metadata is deliberately ignored. + # + # @return [Boolean] + # + # source://ast//lib/ast/node.rb#153 + def ==(other); end + + # Appends `element` to `children` and returns the resulting node. + # + # @return [AST::Node] + # + # source://ast//lib/ast/node.rb#177 + def append(element); end + + # Returns the children of this node. + # The returned value is frozen. + # The to_a alias is useful for decomposing nodes concisely. + # For example: + # + # node = s(:gasgn, :$foo, s(:integer, 1)) + # var_name, value = *node + # p var_name # => :$foo + # p value # => (integer 1) + # + # @return [Array] + # + # source://ast//lib/ast/node.rb#56 + def children; end + + # Nodes are already frozen, so there is no harm in returning the + # current node as opposed to initializing from scratch and freezing + # another one. + # + # @return self + # + # source://ast//lib/ast/node.rb#118 + def clone; end + + # Concatenates `array` with `children` and returns the resulting node. + # + # @return [AST::Node] + # + # source://ast//lib/ast/node.rb#168 + def concat(array); end + + # Enables matching for Node, where type is the first element + # and the children are remaining items. + # + # @return [Array] + # + # source://ast//lib/ast/node.rb#253 + def deconstruct; end + + # Nodes are already frozen, so there is no harm in returning the + # current node as opposed to initializing from scratch and freezing + # another one. + # + # @return self + # + # source://ast//lib/ast/node.rb#115 + def dup; end + + # Test if other object is equal to + # + # @param other [Object] + # @return [Boolean] + # + # source://ast//lib/ast/node.rb#85 + def eql?(other); end + + # Returns the precomputed hash value for this node + # + # @return [Integer] + # + # source://ast//lib/ast/node.rb#61 + def hash; end + + # Converts `self` to a s-expression ruby string. + # The code return will recreate the node, using the sexp module s() + # + # @param indent [Integer] Base indentation level. + # @return [String] + # + # source://ast//lib/ast/node.rb#211 + def inspect(indent = T.unsafe(nil)); end + + # Returns the children of this node. + # The returned value is frozen. + # The to_a alias is useful for decomposing nodes concisely. + # For example: + # + # node = s(:gasgn, :$foo, s(:integer, 1)) + # var_name, value = *node + # p var_name # => :$foo + # p value # => (integer 1) + # + # @return [Array] + # + # source://ast//lib/ast/node.rb#57 + def to_a; end + + # @return [AST::Node] self + # + # source://ast//lib/ast/node.rb#229 + def to_ast; end + + # Converts `self` to a pretty-printed s-expression. + # + # @param indent [Integer] Base indentation level. + # @return [String] + # + # source://ast//lib/ast/node.rb#204 + def to_s(indent = T.unsafe(nil)); end + + # Converts `self` to a pretty-printed s-expression. + # + # @param indent [Integer] Base indentation level. + # @return [String] + # + # source://ast//lib/ast/node.rb#187 + def to_sexp(indent = T.unsafe(nil)); end + + # Converts `self` to an Array where the first element is the type as a Symbol, + # and subsequent elements are the same representation of its children. + # + # @return [Array] + # + # source://ast//lib/ast/node.rb#237 + def to_sexp_array; end + + # Returns the type of this node. + # + # @return [Symbol] + # + # source://ast//lib/ast/node.rb#43 + def type; end + + # Returns a new instance of Node where non-nil arguments replace the + # corresponding fields of `self`. + # + # For example, `Node.new(:foo, [ 1, 2 ]).updated(:bar)` would yield + # `(bar 1 2)`, and `Node.new(:foo, [ 1, 2 ]).updated(nil, [])` would + # yield `(foo)`. + # + # If the resulting node would be identical to `self`, does nothing. + # + # @param children [Array, nil] + # @param properties [Hash, nil] + # @param type [Symbol, nil] + # @return [AST::Node] + # + # source://ast//lib/ast/node.rb#133 + def updated(type = T.unsafe(nil), children = T.unsafe(nil), properties = T.unsafe(nil)); end + + protected + + # By default, each entry in the `properties` hash is assigned to + # an instance variable in this instance of Node. A subclass should define + # attribute readers for such variables. The values passed in the hash + # are not frozen or whitelisted; such behavior can also be implemented + # by subclassing Node and overriding this method. + # + # @return [nil] + # + # source://ast//lib/ast/node.rb#98 + def assign_properties(properties); end + + # Returns `@type` with all underscores replaced by dashes. This allows + # to write symbol literals without quotes in Ruby sources and yet have + # nicely looking s-expressions. + # + # @return [String] + # + # source://ast//lib/ast/node.rb#264 + def fancy_type; end + + private + + # source://ast//lib/ast/node.rb#107 + def original_dup; end +end + +# This class includes {AST::Processor::Mixin}; however, it is +# deprecated, since the module defines all of the behaviors that +# the processor includes. Any new libraries should use +# {AST::Processor::Mixin} instead of subclassing this. +# +# @deprecated Use {AST::Processor::Mixin} instead. +# +# source://ast//lib/ast/processor.rb#8 +class AST::Processor + include ::AST::Processor::Mixin +end + +# The processor module is a module which helps transforming one +# AST into another. In a nutshell, the {#process} method accepts +# a {Node} and dispatches it to a handler corresponding to its +# type, and returns a (possibly) updated variant of the node. +# +# The processor module has a set of associated design patterns. +# They are best explained with a concrete example. Let's define a +# simple arithmetic language and an AST format for it: +# +# Terminals (AST nodes which do not have other AST nodes inside): +# +# * `(integer )`, +# +# Nonterminals (AST nodes with other nodes as children): +# +# * `(add )`, +# * `(multiply )`, +# * `(divide )`, +# * `(negate )`, +# * `(store )`: stores value of `` +# into a variable named ``, +# * `(load )`: loads value of a variable named +# ``, +# * `(each ...)`: computes each of the ``s and +# prints the result. +# +# All AST nodes have the same Ruby class, and therefore they don't +# know how to traverse themselves. (A solution which dynamically +# checks the type of children is possible, but is slow and +# error-prone.) So, a class including the module which knows how +# to traverse the entire tree should be defined. Such classes +# have a handler for each nonterminal node which recursively +# processes children nodes: +# +# require 'ast' +# +# class ArithmeticsProcessor +# include AST::Processor::Mixin +# # This method traverses any binary operators such as (add) +# # or (multiply). +# def process_binary_op(node) +# # Children aren't decomposed automatically; it is +# # suggested to use Ruby multiple assignment expansion, +# # as it is very convenient here. +# left_expr, right_expr = *node +# +# # AST::Node#updated won't change node type if nil is +# # passed as a first argument, which allows to reuse the +# # same handler for multiple node types using `alias' +# # (below). +# node.updated(nil, [ +# process(left_expr), +# process(right_expr) +# ]) +# end +# alias_method :on_add, :process_binary_op +# alias_method :on_multiply, :process_binary_op +# alias_method :on_divide, :process_binary_op +# +# def on_negate(node) +# # It is also possible to use #process_all for more +# # compact code if every child is a Node. +# node.updated(nil, process_all(node)) +# end +# +# def on_store(node) +# expr, variable_name = *node +# +# # Note that variable_name is not a Node and thus isn't +# # passed to #process. +# node.updated(nil, [ +# process(expr), +# variable_name +# ]) +# end +# +# # (load) is effectively a terminal node, and so it does +# # not need an explicit handler, as the following is the +# # default behavior. Essentially, for any nodes that don't +# # have a defined handler, the node remains unchanged. +# def on_load(node) +# nil +# end +# +# def on_each(node) +# node.updated(nil, process_all(node)) +# end +# end +# +# Let's test our ArithmeticsProcessor: +# +# include AST::Sexp +# expr = s(:add, s(:integer, 2), s(:integer, 2)) +# +# p ArithmeticsProcessor.new.process(expr) == expr # => true +# +# As expected, it does not change anything at all. This isn't +# actually very useful, so let's now define a Calculator, which +# will compute the expression values: +# +# # This Processor folds nonterminal nodes and returns an +# # (integer) terminal node. +# class ArithmeticsCalculator < ArithmeticsProcessor +# def compute_op(node) +# # First, node children are processed and then unpacked +# # to local variables. +# nodes = process_all(node) +# +# if nodes.all? { |node| node.type == :integer } +# # If each of those nodes represents a literal, we can +# # fold this node! +# values = nodes.map { |node| node.children.first } +# AST::Node.new(:integer, [ +# yield(values) +# ]) +# else +# # Otherwise, we can just leave the current node in the +# # tree and only update it with processed children +# # nodes, which can be partially folded. +# node.updated(nil, nodes) +# end +# end +# +# def on_add(node) +# compute_op(node) { |left, right| left + right } +# end +# +# def on_multiply(node) +# compute_op(node) { |left, right| left * right } +# end +# end +# +# Let's check: +# +# p ArithmeticsCalculator.new.process(expr) # => (integer 4) +# +# Excellent, the calculator works! Now, a careful reader could +# notice that the ArithmeticsCalculator does not know how to +# divide numbers. What if we pass an expression with division to +# it? +# +# expr_with_division = \ +# s(:add, +# s(:integer, 1), +# s(:divide, +# s(:add, s(:integer, 8), s(:integer, 4)), +# s(:integer, 3))) # 1 + (8 + 4) / 3 +# +# folded_expr_with_division = ArithmeticsCalculator.new.process(expr_with_division) +# p folded_expr_with_division +# # => (add +# # (integer 1) +# # (divide +# # (integer 12) +# # (integer 3))) +# +# As you can see, the expression was folded _partially_: the inner +# `(add)` node which could be computed was folded to +# `(integer 12)`, the `(divide)` node is left as-is because there +# is no computing handler for it, and the root `(add)` node was +# also left as it is because some of its children were not +# literals. +# +# Note that this partial folding is only possible because the +# _data_ format, i.e. the format in which the computed values of +# the nodes are represented, is the same as the AST itself. +# +# Let's extend our ArithmeticsCalculator class further. +# +# class ArithmeticsCalculator +# def on_divide(node) +# compute_op(node) { |left, right| left / right } +# end +# +# def on_negate(node) +# # Note how #compute_op works regardless of the operator +# # arity. +# compute_op(node) { |value| -value } +# end +# end +# +# Now, let's apply our renewed ArithmeticsCalculator to a partial +# result of previous evaluation: +# +# p ArithmeticsCalculator.new.process(expr_with_division) # => (integer 5) +# +# Five! Excellent. This is also pretty much how CRuby 1.8 executed +# its programs. +# +# Now, let's do some automated bug searching. Division by zero is +# an error, right? So if we could detect that someone has divided +# by zero before the program is even run, that could save some +# debugging time. +# +# class DivisionByZeroVerifier < ArithmeticsProcessor +# class VerificationFailure < Exception; end +# +# def on_divide(node) +# # You need to process the children to handle nested divisions +# # such as: +# # (divide +# # (integer 1) +# # (divide (integer 1) (integer 0)) +# left, right = process_all(node) +# +# if right.type == :integer && +# right.children.first == 0 +# raise VerificationFailure, "Ouch! This code divides by zero." +# end +# end +# +# def divides_by_zero?(ast) +# process(ast) +# false +# rescue VerificationFailure +# true +# end +# end +# +# nice_expr = \ +# s(:divide, +# s(:add, s(:integer, 10), s(:integer, 2)), +# s(:integer, 4)) +# +# p DivisionByZeroVerifier.new.divides_by_zero?(nice_expr) +# # => false. Good. +# +# bad_expr = \ +# s(:add, s(:integer, 10), +# s(:divide, s(:integer, 1), s(:integer, 0))) +# +# p DivisionByZeroVerifier.new.divides_by_zero?(bad_expr) +# # => true. WHOOPS. DO NOT RUN THIS. +# +# Of course, this won't detect more complex cases... unless you +# use some partial evaluation before! The possibilites are +# endless. Have fun. +# +# source://ast//lib/ast/processor/mixin.rb#240 +module AST::Processor::Mixin + # Default handler. Does nothing. + # + # @param node [AST::Node] + # @return [AST::Node, nil] + # + # source://ast//lib/ast/processor/mixin.rb#284 + def handler_missing(node); end + + # Dispatches `node`. If a node has type `:foo`, then a handler + # named `on_foo` is invoked with one argument, the `node`; if + # there isn't such a handler, {#handler_missing} is invoked + # with the same argument. + # + # If the handler returns `nil`, `node` is returned; otherwise, + # the return value of the handler is passed along. + # + # @param node [AST::Node, nil] + # @return [AST::Node, nil] + # + # source://ast//lib/ast/processor/mixin.rb#251 + def process(node); end + + # {#process}es each node from `nodes` and returns an array of + # results. + # + # @param nodes [Array] + # @return [Array] + # + # source://ast//lib/ast/processor/mixin.rb#274 + def process_all(nodes); end +end + +# This simple module is very useful in the cases where one needs +# to define deeply nested ASTs from Ruby code, for example, in +# tests. It should be used like this: +# +# describe YourLanguage do +# include ::AST::Sexp +# +# it "should correctly parse expressions" do +# YourLanguage.parse("1 + 2 * 3").should == +# s(:add, +# s(:integer, 1), +# s(:multiply, +# s(:integer, 2), +# s(:integer, 3))) +# end +# end +# +# This way the amount of boilerplate code is greatly reduced. +# +# source://ast//lib/ast/sexp.rb#20 +module AST::Sexp + # Creates a {Node} with type `type` and children `children`. + # Note that the resulting node is of the type AST::Node and not a + # subclass. + # This would not pose a problem with comparisons, as {Node#==} + # ignores metadata. + # + # source://ast//lib/ast/sexp.rb#26 + def s(type, *children); end +end diff --git a/sorbet/rbi/gems/base64@0.3.0.rbi b/sorbet/rbi/gems/base64@0.3.0.rbi new file mode 100644 index 0000000..e8543fc --- /dev/null +++ b/sorbet/rbi/gems/base64@0.3.0.rbi @@ -0,0 +1,545 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `base64` gem. +# Please instead update this file by running `bin/tapioca gem base64`. + + +# \Module \Base64 provides methods for: +# +# - \Encoding a binary string (containing non-ASCII characters) +# as a string of printable ASCII characters. +# - Decoding such an encoded string. +# +# \Base64 is commonly used in contexts where binary data +# is not allowed or supported: +# +# - Images in HTML or CSS files, or in URLs. +# - Email attachments. +# +# A \Base64-encoded string is about one-third larger that its source. +# See the {Wikipedia article}[https://en.wikipedia.org/wiki/Base64] +# for more information. +# +# This module provides three pairs of encode/decode methods. +# Your choices among these methods should depend on: +# +# - Which character set is to be used for encoding and decoding. +# - Whether "padding" is to be used. +# - Whether encoded strings are to contain newlines. +# +# Note: Examples on this page assume that the including program has executed: +# +# require 'base64' +# +# == \Encoding Character Sets +# +# A \Base64-encoded string consists only of characters from a 64-character set: +# +# - ('A'..'Z'). +# - ('a'..'z'). +# - ('0'..'9'). +# - =, the 'padding' character. +# - Either: +# - %w[+ /]: +# {RFC-2045-compliant}[https://datatracker.ietf.org/doc/html/rfc2045]; +# _not_ safe for URLs. +# - %w[- _]: +# {RFC-4648-compliant}[https://datatracker.ietf.org/doc/html/rfc4648]; +# safe for URLs. +# +# If you are working with \Base64-encoded strings that will come from +# or be put into URLs, you should choose this encoder-decoder pair +# of RFC-4648-compliant methods: +# +# - Base64.urlsafe_encode64 and Base64.urlsafe_decode64. +# +# Otherwise, you may choose any of the pairs in this module, +# including the pair above, or the RFC-2045-compliant pairs: +# +# - Base64.encode64 and Base64.decode64. +# - Base64.strict_encode64 and Base64.strict_decode64. +# +# == Padding +# +# \Base64-encoding changes a triplet of input bytes +# into a quartet of output characters. +# +# Padding in Encode Methods +# +# Padding -- extending an encoded string with zero, one, or two trailing +# = characters -- is performed by methods Base64.encode64, +# Base64.strict_encode64, and, by default, Base64.urlsafe_encode64: +# +# Base64.encode64('s') # => "cw==\n" +# Base64.strict_encode64('s') # => "cw==" +# Base64.urlsafe_encode64('s') # => "cw==" +# Base64.urlsafe_encode64('s', padding: false) # => "cw" +# +# When padding is performed, the encoded string is always of length 4n, +# where +n+ is a non-negative integer: +# +# - Input bytes of length 3n generate unpadded output characters +# of length 4n: +# +# # n = 1: 3 bytes => 4 characters. +# Base64.strict_encode64('123') # => "MDEy" +# # n = 2: 6 bytes => 8 characters. +# Base64.strict_encode64('123456') # => "MDEyMzQ1" +# +# - Input bytes of length 3n+1 generate padded output characters +# of length 4(n+1), with two padding characters at the end: +# +# # n = 1: 4 bytes => 8 characters. +# Base64.strict_encode64('1234') # => "MDEyMw==" +# # n = 2: 7 bytes => 12 characters. +# Base64.strict_encode64('1234567') # => "MDEyMzQ1Ng==" +# +# - Input bytes of length 3n+2 generate padded output characters +# of length 4(n+1), with one padding character at the end: +# +# # n = 1: 5 bytes => 8 characters. +# Base64.strict_encode64('12345') # => "MDEyMzQ=" +# # n = 2: 8 bytes => 12 characters. +# Base64.strict_encode64('12345678') # => "MDEyMzQ1Njc=" +# +# When padding is suppressed, for a positive integer n: +# +# - Input bytes of length 3n generate unpadded output characters +# of length 4n: +# +# # n = 1: 3 bytes => 4 characters. +# Base64.urlsafe_encode64('123', padding: false) # => "MDEy" +# # n = 2: 6 bytes => 8 characters. +# Base64.urlsafe_encode64('123456', padding: false) # => "MDEyMzQ1" +# +# - Input bytes of length 3n+1 generate unpadded output characters +# of length 4n+2, with two padding characters at the end: +# +# # n = 1: 4 bytes => 6 characters. +# Base64.urlsafe_encode64('1234', padding: false) # => "MDEyMw" +# # n = 2: 7 bytes => 10 characters. +# Base64.urlsafe_encode64('1234567', padding: false) # => "MDEyMzQ1Ng" +# +# - Input bytes of length 3n+2 generate unpadded output characters +# of length 4n+3, with one padding character at the end: +# +# # n = 1: 5 bytes => 7 characters. +# Base64.urlsafe_encode64('12345', padding: false) # => "MDEyMzQ" +# # m = 2: 8 bytes => 11 characters. +# Base64.urlsafe_encode64('12345678', padding: false) # => "MDEyMzQ1Njc" +# +# Padding in Decode Methods +# +# All of the \Base64 decode methods support (but do not require) padding. +# +# \Method Base64.decode64 does not check the size of the padding: +# +# Base64.decode64("MDEyMzQ1Njc") # => "01234567" +# Base64.decode64("MDEyMzQ1Njc=") # => "01234567" +# Base64.decode64("MDEyMzQ1Njc==") # => "01234567" +# +# \Method Base64.strict_decode64 strictly enforces padding size: +# +# Base64.strict_decode64("MDEyMzQ1Njc") # Raises ArgumentError +# Base64.strict_decode64("MDEyMzQ1Njc=") # => "01234567" +# Base64.strict_decode64("MDEyMzQ1Njc==") # Raises ArgumentError +# +# \Method Base64.urlsafe_decode64 allows padding in the encoded string, +# which if present, must be correct: +# see {Padding}[Base64.html#module-Base64-label-Padding], above: +# +# Base64.urlsafe_decode64("MDEyMzQ1Njc") # => "01234567" +# Base64.urlsafe_decode64("MDEyMzQ1Njc=") # => "01234567" +# Base64.urlsafe_decode64("MDEyMzQ1Njc==") # Raises ArgumentError. +# +# == Newlines +# +# An encoded string returned by Base64.encode64 or Base64.urlsafe_encode64 +# has an embedded newline character +# after each 60-character sequence, and, if non-empty, at the end: +# +# # No newline if empty. +# encoded = Base64.encode64("\x00" * 0) +# encoded.index("\n") # => nil +# +# # Newline at end of short output. +# encoded = Base64.encode64("\x00" * 1) +# encoded.size # => 4 +# encoded.index("\n") # => 4 +# +# # Newline at end of longer output. +# encoded = Base64.encode64("\x00" * 45) +# encoded.size # => 60 +# encoded.index("\n") # => 60 +# +# # Newlines embedded and at end of still longer output. +# encoded = Base64.encode64("\x00" * 46) +# encoded.size # => 65 +# encoded.rindex("\n") # => 65 +# encoded.split("\n").map {|s| s.size } # => [60, 4] +# +# The string to be encoded may itself contain newlines, +# which are encoded as \Base64: +# +# # Base64.encode64("\n\n\n") # => "CgoK\n" +# s = "This is line 1\nThis is line 2\n" +# Base64.encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" +# +# source://base64//lib/base64.rb#184 +module Base64 + private + + # :call-seq: + # Base64.decode(encoded_string) -> decoded_string + # + # Returns a string containing the decoding of an RFC-2045-compliant + # \Base64-encoded string +encoded_string+: + # + # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" + # Base64.decode64(s) # => "This is line 1\nThis is line 2\n" + # + # Non-\Base64 characters in +encoded_string+ are ignored; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # these include newline characters and characters - and /: + # + # Base64.decode64("\x00\n-_") # => "" + # + # Padding in +encoded_string+ (even if incorrect) is ignored: + # + # Base64.decode64("MDEyMzQ1Njc") # => "01234567" + # Base64.decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.decode64("MDEyMzQ1Njc==") # => "01234567" + # + # source://base64//lib/base64.rb#247 + def decode64(str); end + + # :call-seq: + # Base64.encode64(string) -> encoded_string + # + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +string+. + # + # Per RFC 2045, the returned string may contain the URL-unsafe characters + # + or /; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.encode64("\xFB\xEF\xBE") # => "++++\n" + # Base64.encode64("\xFF\xFF\xFF") # => "////\n" + # + # The returned string may include padding; + # see {Padding}[Base64.html#module-Base64-label-Padding] above. + # + # Base64.encode64('*') # => "Kg==\n" + # + # The returned string ends with a newline character, and if sufficiently long + # will have one or more embedded newline characters; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.encode64('*') # => "Kg==\n" + # Base64.encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq\nKg==\n" + # + # The string to be encoded may itself contain newlines, + # which will be encoded as ordinary \Base64: + # + # Base64.encode64("\n\n\n") # => "CgoK\n" + # s = "This is line 1\nThis is line 2\n" + # Base64.encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" + # + # source://base64//lib/base64.rb#222 + def encode64(bin); end + + # :call-seq: + # Base64.strict_decode64(encoded_string) -> decoded_string + # + # Returns a string containing the decoding of an RFC-2045-compliant + # \Base64-encoded string +encoded_string+: + # + # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK" + # Base64.strict_decode64(s) # => "This is line 1\nThis is line 2\n" + # + # Non-\Base64 characters in +encoded_string+ are not allowed; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # these include newline characters and characters - and /: + # + # Base64.strict_decode64("\n") # Raises ArgumentError + # Base64.strict_decode64('-') # Raises ArgumentError + # Base64.strict_decode64('_') # Raises ArgumentError + # + # Padding in +encoded_string+, if present, must be correct: + # + # Base64.strict_decode64("MDEyMzQ1Njc") # Raises ArgumentError + # Base64.strict_decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.strict_decode64("MDEyMzQ1Njc==") # Raises ArgumentError + # + # source://base64//lib/base64.rb#309 + def strict_decode64(str); end + + # :call-seq: + # Base64.strict_encode64(string) -> encoded_string + # + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +string+. + # + # Per RFC 2045, the returned string may contain the URL-unsafe characters + # + or /; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.strict_encode64("\xFB\xEF\xBE") # => "++++\n" + # Base64.strict_encode64("\xFF\xFF\xFF") # => "////\n" + # + # The returned string may include padding; + # see {Padding}[Base64.html#module-Base64-label-Padding] above. + # + # Base64.strict_encode64('*') # => "Kg==\n" + # + # The returned string will have no newline characters, regardless of its length; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.strict_encode64('*') # => "Kg==" + # Base64.strict_encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg==" + # + # The string to be encoded may itself contain newlines, + # which will be encoded as ordinary \Base64: + # + # Base64.strict_encode64("\n\n\n") # => "CgoK" + # s = "This is line 1\nThis is line 2\n" + # Base64.strict_encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK" + # + # source://base64//lib/base64.rb#282 + def strict_encode64(bin); end + + # :call-seq: + # Base64.urlsafe_decode64(encoded_string) -> decoded_string + # + # Returns the decoding of an RFC-4648-compliant \Base64-encoded string +encoded_string+: + # + # +encoded_string+ may not contain non-Base64 characters; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.urlsafe_decode64('+') # Raises ArgumentError. + # Base64.urlsafe_decode64('/') # Raises ArgumentError. + # Base64.urlsafe_decode64("\n") # Raises ArgumentError. + # + # Padding in +encoded_string+, if present, must be correct: + # see {Padding}[Base64.html#module-Base64-label-Padding], above: + # + # Base64.urlsafe_decode64("MDEyMzQ1Njc") # => "01234567" + # Base64.urlsafe_decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.urlsafe_decode64("MDEyMzQ1Njc==") # Raises ArgumentError. + # + # source://base64//lib/base64.rb#369 + def urlsafe_decode64(str); end + + # :call-seq: + # Base64.urlsafe_encode64(string) -> encoded_string + # + # Returns the RFC-4648-compliant \Base64-encoding of +string+. + # + # Per RFC 4648, the returned string will not contain the URL-unsafe characters + # + or /, + # but instead may contain the URL-safe characters + # - and _; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.urlsafe_encode64("\xFB\xEF\xBE") # => "----" + # Base64.urlsafe_encode64("\xFF\xFF\xFF") # => "____" + # + # By default, the returned string may have padding; + # see {Padding}[Base64.html#module-Base64-label-Padding], above: + # + # Base64.urlsafe_encode64('*') # => "Kg==" + # + # Optionally, you can suppress padding: + # + # Base64.urlsafe_encode64('*', padding: false) # => "Kg" + # + # The returned string will have no newline characters, regardless of its length; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.urlsafe_encode64('*') # => "Kg==" + # Base64.urlsafe_encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg==" + # + # source://base64//lib/base64.rb#343 + def urlsafe_encode64(bin, padding: T.unsafe(nil)); end + + class << self + # :call-seq: + # Base64.decode(encoded_string) -> decoded_string + # + # Returns a string containing the decoding of an RFC-2045-compliant + # \Base64-encoded string +encoded_string+: + # + # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" + # Base64.decode64(s) # => "This is line 1\nThis is line 2\n" + # + # Non-\Base64 characters in +encoded_string+ are ignored; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # these include newline characters and characters - and /: + # + # Base64.decode64("\x00\n-_") # => "" + # + # Padding in +encoded_string+ (even if incorrect) is ignored: + # + # Base64.decode64("MDEyMzQ1Njc") # => "01234567" + # Base64.decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.decode64("MDEyMzQ1Njc==") # => "01234567" + # + # source://base64//lib/base64.rb#247 + def decode64(str); end + + # :call-seq: + # Base64.encode64(string) -> encoded_string + # + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +string+. + # + # Per RFC 2045, the returned string may contain the URL-unsafe characters + # + or /; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.encode64("\xFB\xEF\xBE") # => "++++\n" + # Base64.encode64("\xFF\xFF\xFF") # => "////\n" + # + # The returned string may include padding; + # see {Padding}[Base64.html#module-Base64-label-Padding] above. + # + # Base64.encode64('*') # => "Kg==\n" + # + # The returned string ends with a newline character, and if sufficiently long + # will have one or more embedded newline characters; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.encode64('*') # => "Kg==\n" + # Base64.encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq\nKg==\n" + # + # The string to be encoded may itself contain newlines, + # which will be encoded as ordinary \Base64: + # + # Base64.encode64("\n\n\n") # => "CgoK\n" + # s = "This is line 1\nThis is line 2\n" + # Base64.encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" + # + # source://base64//lib/base64.rb#222 + def encode64(bin); end + + # :call-seq: + # Base64.strict_decode64(encoded_string) -> decoded_string + # + # Returns a string containing the decoding of an RFC-2045-compliant + # \Base64-encoded string +encoded_string+: + # + # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK" + # Base64.strict_decode64(s) # => "This is line 1\nThis is line 2\n" + # + # Non-\Base64 characters in +encoded_string+ are not allowed; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # these include newline characters and characters - and /: + # + # Base64.strict_decode64("\n") # Raises ArgumentError + # Base64.strict_decode64('-') # Raises ArgumentError + # Base64.strict_decode64('_') # Raises ArgumentError + # + # Padding in +encoded_string+, if present, must be correct: + # + # Base64.strict_decode64("MDEyMzQ1Njc") # Raises ArgumentError + # Base64.strict_decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.strict_decode64("MDEyMzQ1Njc==") # Raises ArgumentError + # + # source://base64//lib/base64.rb#309 + def strict_decode64(str); end + + # :call-seq: + # Base64.strict_encode64(string) -> encoded_string + # + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +string+. + # + # Per RFC 2045, the returned string may contain the URL-unsafe characters + # + or /; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.strict_encode64("\xFB\xEF\xBE") # => "++++\n" + # Base64.strict_encode64("\xFF\xFF\xFF") # => "////\n" + # + # The returned string may include padding; + # see {Padding}[Base64.html#module-Base64-label-Padding] above. + # + # Base64.strict_encode64('*') # => "Kg==\n" + # + # The returned string will have no newline characters, regardless of its length; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.strict_encode64('*') # => "Kg==" + # Base64.strict_encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg==" + # + # The string to be encoded may itself contain newlines, + # which will be encoded as ordinary \Base64: + # + # Base64.strict_encode64("\n\n\n") # => "CgoK" + # s = "This is line 1\nThis is line 2\n" + # Base64.strict_encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK" + # + # source://base64//lib/base64.rb#282 + def strict_encode64(bin); end + + # :call-seq: + # Base64.urlsafe_decode64(encoded_string) -> decoded_string + # + # Returns the decoding of an RFC-4648-compliant \Base64-encoded string +encoded_string+: + # + # +encoded_string+ may not contain non-Base64 characters; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.urlsafe_decode64('+') # Raises ArgumentError. + # Base64.urlsafe_decode64('/') # Raises ArgumentError. + # Base64.urlsafe_decode64("\n") # Raises ArgumentError. + # + # Padding in +encoded_string+, if present, must be correct: + # see {Padding}[Base64.html#module-Base64-label-Padding], above: + # + # Base64.urlsafe_decode64("MDEyMzQ1Njc") # => "01234567" + # Base64.urlsafe_decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.urlsafe_decode64("MDEyMzQ1Njc==") # Raises ArgumentError. + # + # source://base64//lib/base64.rb#369 + def urlsafe_decode64(str); end + + # :call-seq: + # Base64.urlsafe_encode64(string) -> encoded_string + # + # Returns the RFC-4648-compliant \Base64-encoding of +string+. + # + # Per RFC 4648, the returned string will not contain the URL-unsafe characters + # + or /, + # but instead may contain the URL-safe characters + # - and _; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.urlsafe_encode64("\xFB\xEF\xBE") # => "----" + # Base64.urlsafe_encode64("\xFF\xFF\xFF") # => "____" + # + # By default, the returned string may have padding; + # see {Padding}[Base64.html#module-Base64-label-Padding], above: + # + # Base64.urlsafe_encode64('*') # => "Kg==" + # + # Optionally, you can suppress padding: + # + # Base64.urlsafe_encode64('*', padding: false) # => "Kg" + # + # The returned string will have no newline characters, regardless of its length; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.urlsafe_encode64('*') # => "Kg==" + # Base64.urlsafe_encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg==" + # + # source://base64//lib/base64.rb#343 + def urlsafe_encode64(bin, padding: T.unsafe(nil)); end + end +end + +# source://base64//lib/base64.rb#186 +Base64::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/bcrypt@3.1.20.rbi b/sorbet/rbi/gems/bcrypt@3.1.20.rbi new file mode 100644 index 0000000..201afe6 --- /dev/null +++ b/sorbet/rbi/gems/bcrypt@3.1.20.rbi @@ -0,0 +1,275 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `bcrypt` gem. +# Please instead update this file by running `bin/tapioca gem bcrypt`. + + +# A Ruby library implementing OpenBSD's bcrypt()/crypt_blowfish algorithm for +# hashing passwords. +# +# source://bcrypt//lib/bcrypt.rb#3 +module BCrypt; end + +# A Ruby wrapper for the bcrypt() C extension calls and the Java calls. +# +# source://bcrypt//lib/bcrypt/engine.rb#3 +class BCrypt::Engine + class << self + # Autodetects the cost from the salt string. + # + # source://bcrypt//lib/bcrypt/engine.rb#129 + def autodetect_cost(salt); end + + # Returns the cost factor which will result in computation times less than +upper_time_limit_in_ms+. + # + # Example: + # + # BCrypt::Engine.calibrate(200) #=> 10 + # BCrypt::Engine.calibrate(1000) #=> 12 + # + # # should take less than 200ms + # BCrypt::Password.create("woo", :cost => 10) + # + # # should take less than 1000ms + # BCrypt::Password.create("woo", :cost => 12) + # + # source://bcrypt//lib/bcrypt/engine.rb#119 + def calibrate(upper_time_limit_in_ms); end + + # Returns the cost factor that will be used if one is not specified when + # creating a password hash. Defaults to DEFAULT_COST if not set. + # + # source://bcrypt//lib/bcrypt/engine.rb#32 + def cost; end + + # Set a default cost factor that will be used if one is not specified when + # creating a password hash. + # + # Example: + # + # BCrypt::Engine::DEFAULT_COST #=> 12 + # BCrypt::Password.create('secret').cost #=> 12 + # + # BCrypt::Engine.cost = 8 + # BCrypt::Password.create('secret').cost #=> 8 + # + # # cost can still be overridden as needed + # BCrypt::Password.create('secret', :cost => 6).cost #=> 6 + # + # source://bcrypt//lib/bcrypt/engine.rb#49 + def cost=(cost); end + + # Generates a random salt with a given computational cost. + # + # source://bcrypt//lib/bcrypt/engine.rb#81 + def generate_salt(cost = T.unsafe(nil)); end + + # Given a secret and a valid salt (see BCrypt::Engine.generate_salt) calculates + # a bcrypt() password hash. Secrets longer than 72 bytes are truncated. + # + # source://bcrypt//lib/bcrypt/engine.rb#55 + def hash_secret(secret, salt, _ = T.unsafe(nil)); end + + # Returns true if +salt+ is a valid bcrypt() salt, false if not. + # + # @return [Boolean] + # + # source://bcrypt//lib/bcrypt/engine.rb#98 + def valid_salt?(salt); end + + # Returns true if +secret+ is a valid bcrypt() secret, false if not. + # + # @return [Boolean] + # + # source://bcrypt//lib/bcrypt/engine.rb#103 + def valid_secret?(secret); end + + private + + # source://bcrypt//lib/bcrypt.rb#12 + def __bc_crypt(_arg0, _arg1); end + + # source://bcrypt//lib/bcrypt.rb#12 + def __bc_salt(_arg0, _arg1, _arg2); end + end +end + +# The default computational expense parameter. +# +# source://bcrypt//lib/bcrypt/engine.rb#5 +BCrypt::Engine::DEFAULT_COST = T.let(T.unsafe(nil), Integer) + +# The maximum cost supported by the algorithm. +# +# source://bcrypt//lib/bcrypt/engine.rb#9 +BCrypt::Engine::MAX_COST = T.let(T.unsafe(nil), Integer) + +# Maximum possible size of bcrypt() salts. +# +# source://bcrypt//lib/bcrypt/engine.rb#19 +BCrypt::Engine::MAX_SALT_LENGTH = T.let(T.unsafe(nil), Integer) + +# Maximum possible size of bcrypt() secrets. +# Older versions of the bcrypt library would truncate passwords longer +# than 72 bytes, but newer ones do not. We truncate like the old library for +# forward compatibility. This way users upgrading from Ubuntu 18.04 to 20.04 +# will not have their user passwords invalidated, for example. +# A max secret length greater than 255 leads to bcrypt returning nil. +# https://github.com/bcrypt-ruby/bcrypt-ruby/issues/225#issuecomment-875908425 +# +# source://bcrypt//lib/bcrypt/engine.rb#17 +BCrypt::Engine::MAX_SECRET_BYTESIZE = T.let(T.unsafe(nil), Integer) + +# The minimum cost supported by the algorithm. +# +# source://bcrypt//lib/bcrypt/engine.rb#7 +BCrypt::Engine::MIN_COST = T.let(T.unsafe(nil), Integer) + +# source://bcrypt//lib/bcrypt/error.rb#3 +class BCrypt::Error < ::StandardError; end + +# source://bcrypt//lib/bcrypt/error.rb#6 +module BCrypt::Errors; end + +# The cost parameter provided to bcrypt() is invalid. +# +# source://bcrypt//lib/bcrypt/error.rb#15 +class BCrypt::Errors::InvalidCost < ::BCrypt::Error; end + +# The hash parameter provided to bcrypt() is invalid. +# +# source://bcrypt//lib/bcrypt/error.rb#12 +class BCrypt::Errors::InvalidHash < ::BCrypt::Error; end + +# The salt parameter provided to bcrypt() is invalid. +# +# source://bcrypt//lib/bcrypt/error.rb#9 +class BCrypt::Errors::InvalidSalt < ::BCrypt::Error; end + +# The secret parameter provided to bcrypt() is invalid. +# +# source://bcrypt//lib/bcrypt/error.rb#18 +class BCrypt::Errors::InvalidSecret < ::BCrypt::Error; end + +# A password management class which allows you to safely store users' passwords and compare them. +# +# Example usage: +# +# include BCrypt +# +# # hash a user's password +# @password = Password.create("my grand secret") +# @password #=> "$2a$12$C5.FIvVDS9W4AYZ/Ib37YuWd/7ozp1UaMhU28UKrfSxp2oDchbi3K" +# +# # store it safely +# @user.update_attribute(:password, @password) +# +# # read it back +# @user.reload! +# @db_password = Password.new(@user.password) +# +# # compare it after retrieval +# @db_password == "my grand secret" #=> true +# @db_password == "a paltry guess" #=> false +# +# source://bcrypt//lib/bcrypt/password.rb#23 +class BCrypt::Password < ::String + # Initializes a BCrypt::Password instance with the data from a stored hash. + # + # @return [Password] a new instance of Password + # + # source://bcrypt//lib/bcrypt/password.rb#55 + def initialize(raw_hash); end + + # Compares a potential secret against the hash. Returns true if the secret is the original secret, false otherwise. + # + # Comparison edge case/gotcha: + # + # secret = "my secret" + # @password = BCrypt::Password.create(secret) + # + # @password == secret # => True + # @password == @password # => False + # @password == @password.to_s # => False + # @password.to_s == @password # => True + # @password.to_s == @password.to_s # => True + # + # source://bcrypt//lib/bcrypt/password.rb#76 + def ==(secret); end + + # The hash portion of the stored password hash. + # + # source://bcrypt//lib/bcrypt/password.rb#25 + def checksum; end + + # The cost factor used to create the hash. + # + # source://bcrypt//lib/bcrypt/password.rb#31 + def cost; end + + # Compares a potential secret against the hash. Returns true if the secret is the original secret, false otherwise. + # + # Comparison edge case/gotcha: + # + # secret = "my secret" + # @password = BCrypt::Password.create(secret) + # + # @password == secret # => True + # @password == @password # => False + # @password == @password.to_s # => False + # @password.to_s == @password # => True + # @password.to_s == @password.to_s # => True + # + # source://bcrypt//lib/bcrypt/password.rb#79 + def is_password?(secret); end + + # The salt of the store password hash (including version and cost). + # + # source://bcrypt//lib/bcrypt/password.rb#27 + def salt; end + + # The version of the bcrypt() algorithm used to create the hash. + # + # source://bcrypt//lib/bcrypt/password.rb#29 + def version; end + + private + + # call-seq: + # split_hash(raw_hash) -> version, cost, salt, hash + # + # Splits +h+ into version, cost, salt, and hash and returns them in that order. + # + # source://bcrypt//lib/bcrypt/password.rb#92 + def split_hash(h); end + + # Returns true if +h+ is a valid hash. + # + # @return [Boolean] + # + # source://bcrypt//lib/bcrypt/password.rb#84 + def valid_hash?(h); end + + class << self + # Hashes a secret, returning a BCrypt::Password instance. Takes an optional :cost option, which is a + # logarithmic variable which determines how computational expensive the hash is to calculate (a :cost of + # 4 is twice as much work as a :cost of 3). The higher the :cost the harder it becomes for + # attackers to try to guess passwords (even if a copy of your database is stolen), but the slower it is to check + # users' passwords. + # + # Example: + # + # @password = BCrypt::Password.create("my secret", :cost => 13) + # + # @raise [ArgumentError] + # + # source://bcrypt//lib/bcrypt/password.rb#43 + def create(secret, options = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://bcrypt//lib/bcrypt/password.rb#49 + def valid_hash?(h); end + end +end diff --git a/sorbet/rbi/gems/bcrypt_pbkdf@1.1.2.rbi b/sorbet/rbi/gems/bcrypt_pbkdf@1.1.2.rbi new file mode 100644 index 0000000..78730b1 --- /dev/null +++ b/sorbet/rbi/gems/bcrypt_pbkdf@1.1.2.rbi @@ -0,0 +1,36 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `bcrypt_pbkdf` gem. +# Please instead update this file by running `bin/tapioca gem bcrypt_pbkdf`. + + +# source://bcrypt_pbkdf//lib/bcrypt_pbkdf.rb#8 +module BCryptPbkdf + class << self + # generates a key from a password + salt returning a string with keylen bytes + # that can be used as cryptographic key. + # + # Remember to get a good random salt of at least 16 bytes. Using a higher + # rounds count will increase the cost of an exhaustive search but will also + # make derivation proportionally slower. + # + # Example: + # rounds = 10 + # keylen = 64 + # @key = BCryptPbkdf.key("my secret", "my salt", keylen, rounds) + # + # source://bcrypt_pbkdf//lib/bcrypt_pbkdf.rb#20 + def key(pass, salt, keylen, rounds); end + end +end + +class BCryptPbkdf::Engine + class << self + # source://bcrypt_pbkdf//lib/bcrypt_pbkdf.rb#5 + def __bc_crypt_hash(_arg0, _arg1); end + + # source://bcrypt_pbkdf//lib/bcrypt_pbkdf.rb#5 + def __bc_crypt_pbkdf(_arg0, _arg1, _arg2, _arg3); end + end +end diff --git a/sorbet/rbi/gems/benchmark@0.5.0.rbi b/sorbet/rbi/gems/benchmark@0.5.0.rbi new file mode 100644 index 0000000..8531eef --- /dev/null +++ b/sorbet/rbi/gems/benchmark@0.5.0.rbi @@ -0,0 +1,637 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `benchmark` gem. +# Please instead update this file by running `bin/tapioca gem benchmark`. + + +# The Benchmark module provides methods to measure and report the time +# used to execute Ruby code. +# +# * Measure the time to construct the string given by the expression +# "a"*1_000_000_000: +# +# require 'benchmark' +# +# puts Benchmark.measure { "a"*1_000_000_000 } +# +# On my machine (OSX 10.8.3 on i5 1.7 GHz) this generates: +# +# 0.350000 0.400000 0.750000 ( 0.835234) +# +# This report shows the user CPU time, system CPU time, the total time +# (sum of user CPU time, system CPU time, children's user CPU time, +# and children's system CPU time), and the elapsed real time. The unit +# of time is seconds. +# +# * Do some experiments sequentially using the #bm method: +# +# require 'benchmark' +# +# n = 5000000 +# Benchmark.bm do |x| +# x.report { for i in 1..n; a = "1"; end } +# x.report { n.times do ; a = "1"; end } +# x.report { 1.upto(n) do ; a = "1"; end } +# end +# +# The result: +# +# user system total real +# 1.010000 0.000000 1.010000 ( 1.014479) +# 1.000000 0.000000 1.000000 ( 0.998261) +# 0.980000 0.000000 0.980000 ( 0.981335) +# +# * Continuing the previous example, put a label in each report: +# +# require 'benchmark' +# +# n = 5000000 +# Benchmark.bm(7) do |x| +# x.report("for:") { for i in 1..n; a = "1"; end } +# x.report("times:") { n.times do ; a = "1"; end } +# x.report("upto:") { 1.upto(n) do ; a = "1"; end } +# end +# +# The result: +# +# user system total real +# for: 1.010000 0.000000 1.010000 ( 1.015688) +# times: 1.000000 0.000000 1.000000 ( 1.003611) +# upto: 1.030000 0.000000 1.030000 ( 1.028098) +# +# * The times for some benchmarks depend on the order in which items +# are run. These differences are due to the cost of memory +# allocation and garbage collection. To avoid these discrepancies, +# the #bmbm method is provided. For example, to compare ways to +# sort an array of floats: +# +# require 'benchmark' +# +# array = (1..1000000).map { rand } +# +# Benchmark.bmbm do |x| +# x.report("sort!") { array.dup.sort! } +# x.report("sort") { array.dup.sort } +# end +# +# The result: +# +# Rehearsal ----------------------------------------- +# sort! 1.490000 0.010000 1.500000 ( 1.490520) +# sort 1.460000 0.000000 1.460000 ( 1.463025) +# -------------------------------- total: 2.960000sec +# +# user system total real +# sort! 1.460000 0.000000 1.460000 ( 1.460465) +# sort 1.450000 0.010000 1.460000 ( 1.448327) +# +# * Report statistics of sequential experiments with unique labels, +# using the #benchmark method: +# +# require 'benchmark' +# include Benchmark # we need the CAPTION and FORMAT constants +# +# n = 5000000 +# Benchmark.benchmark(CAPTION, 7, FORMAT, ">total:", ">avg:") do |x| +# tf = x.report("for:") { for i in 1..n; a = "1"; end } +# tt = x.report("times:") { n.times do ; a = "1"; end } +# tu = x.report("upto:") { 1.upto(n) do ; a = "1"; end } +# [tf+tt+tu, (tf+tt+tu)/3] +# end +# +# The result: +# +# user system total real +# for: 0.950000 0.000000 0.950000 ( 0.952039) +# times: 0.980000 0.000000 0.980000 ( 0.984938) +# upto: 0.950000 0.000000 0.950000 ( 0.946787) +# >total: 2.880000 0.000000 2.880000 ( 2.883764) +# >avg: 0.960000 0.000000 0.960000 ( 0.961255) +# +# source://benchmark//lib/benchmark.rb#123 +module Benchmark + private + + # Invokes the block with a Benchmark::Report object, which + # may be used to collect and report on the results of individual + # benchmark tests. Reserves +label_width+ leading spaces for + # labels on each line. Prints +caption+ at the top of the + # report, and uses +format+ to format each line. + # (Note: +caption+ must contain a terminating newline character, + # see the default Benchmark::Tms::CAPTION for an example.) + # + # Returns an array of Benchmark::Tms objects. + # + # If the block returns an array of + # Benchmark::Tms objects, these will be used to format + # additional lines of output. If +labels+ parameter are + # given, these are used to label these extra lines. + # + # _Note_: Other methods provide a simpler interface to this one, and are + # suitable for nearly all benchmarking requirements. See the examples in + # Benchmark, and the #bm and #bmbm methods. + # + # Example: + # + # require 'benchmark' + # include Benchmark # we need the CAPTION and FORMAT constants + # + # n = 5000000 + # Benchmark.benchmark(CAPTION, 7, FORMAT, ">total:", ">avg:") do |x| + # tf = x.report("for:") { for i in 1..n; a = "1"; end } + # tt = x.report("times:") { n.times do ; a = "1"; end } + # tu = x.report("upto:") { 1.upto(n) do ; a = "1"; end } + # [tf+tt+tu, (tf+tt+tu)/3] + # end + # + # Generates: + # + # user system total real + # for: 0.970000 0.000000 0.970000 ( 0.970493) + # times: 0.990000 0.000000 0.990000 ( 0.989542) + # upto: 0.970000 0.000000 0.970000 ( 0.972854) + # >total: 2.930000 0.000000 2.930000 ( 2.932889) + # >avg: 0.976667 0.000000 0.976667 ( 0.977630) + # + # source://benchmark//lib/benchmark.rb#171 + def benchmark(caption = T.unsafe(nil), label_width = T.unsafe(nil), format = T.unsafe(nil), *labels); end + + # A simple interface to the #benchmark method, #bm generates sequential + # reports with labels. +label_width+ and +labels+ parameters have the same + # meaning as for #benchmark. + # + # require 'benchmark' + # + # n = 5000000 + # Benchmark.bm(7) do |x| + # x.report("for:") { for i in 1..n; a = "1"; end } + # x.report("times:") { n.times do ; a = "1"; end } + # x.report("upto:") { 1.upto(n) do ; a = "1"; end } + # end + # + # Generates: + # + # user system total real + # for: 0.960000 0.000000 0.960000 ( 0.957966) + # times: 0.960000 0.000000 0.960000 ( 0.960423) + # upto: 0.950000 0.000000 0.950000 ( 0.954864) + # + # source://benchmark//lib/benchmark.rb#216 + def bm(label_width = T.unsafe(nil), *labels, &blk); end + + # Sometimes benchmark results are skewed because code executed + # earlier encounters different garbage collection overheads than + # that run later. #bmbm attempts to minimize this effect by running + # the tests twice, the first time as a rehearsal in order to get the + # runtime environment stable, the second time for + # real. GC.start is executed before the start of each of + # the real timings; the cost of this is not included in the + # timings. In reality, though, there's only so much that #bmbm can + # do, and the results are not guaranteed to be isolated from garbage + # collection and other effects. + # + # Because #bmbm takes two passes through the tests, it can + # calculate the required label width. + # + # require 'benchmark' + # + # array = (1..1000000).map { rand } + # + # Benchmark.bmbm do |x| + # x.report("sort!") { array.dup.sort! } + # x.report("sort") { array.dup.sort } + # end + # + # Generates: + # + # Rehearsal ----------------------------------------- + # sort! 1.440000 0.010000 1.450000 ( 1.446833) + # sort 1.440000 0.000000 1.440000 ( 1.448257) + # -------------------------------- total: 2.890000sec + # + # user system total real + # sort! 1.460000 0.000000 1.460000 ( 1.458065) + # sort 1.450000 0.000000 1.450000 ( 1.455963) + # + # #bmbm yields a Benchmark::Job object and returns an array of + # Benchmark::Tms objects. + # + # source://benchmark//lib/benchmark.rb#258 + def bmbm(width = T.unsafe(nil)); end + + # Returns the time used to execute the given block as a + # Benchmark::Tms object. Takes +label+ option. + # + # require 'benchmark' + # + # n = 1000000 + # + # time = Benchmark.measure do + # n.times { a = "1" } + # end + # puts time + # + # Generates: + # + # 0.220000 0.000000 0.220000 ( 0.227313) + # + # source://benchmark//lib/benchmark.rb#303 + def measure(label = T.unsafe(nil)); end + + # Returns the elapsed real time used to execute the given block. + # The unit of time is milliseconds. + # + # Benchmark.ms { "a" * 1_000_000_000 } + # #=> 509.8029999935534 + # + # source://benchmark//lib/benchmark.rb#335 + def ms; end + + # Returns the elapsed real time used to execute the given block. + # The unit of time is seconds. + # + # Benchmark.realtime { "a" * 1_000_000_000 } + # #=> 0.5098029999935534 + # + # source://benchmark//lib/benchmark.rb#322 + def realtime; end + + class << self + # Invokes the block with a Benchmark::Report object, which + # may be used to collect and report on the results of individual + # benchmark tests. Reserves +label_width+ leading spaces for + # labels on each line. Prints +caption+ at the top of the + # report, and uses +format+ to format each line. + # (Note: +caption+ must contain a terminating newline character, + # see the default Benchmark::Tms::CAPTION for an example.) + # + # Returns an array of Benchmark::Tms objects. + # + # If the block returns an array of + # Benchmark::Tms objects, these will be used to format + # additional lines of output. If +labels+ parameter are + # given, these are used to label these extra lines. + # + # _Note_: Other methods provide a simpler interface to this one, and are + # suitable for nearly all benchmarking requirements. See the examples in + # Benchmark, and the #bm and #bmbm methods. + # + # Example: + # + # require 'benchmark' + # include Benchmark # we need the CAPTION and FORMAT constants + # + # n = 5000000 + # Benchmark.benchmark(CAPTION, 7, FORMAT, ">total:", ">avg:") do |x| + # tf = x.report("for:") { for i in 1..n; a = "1"; end } + # tt = x.report("times:") { n.times do ; a = "1"; end } + # tu = x.report("upto:") { 1.upto(n) do ; a = "1"; end } + # [tf+tt+tu, (tf+tt+tu)/3] + # end + # + # Generates: + # + # user system total real + # for: 0.970000 0.000000 0.970000 ( 0.970493) + # times: 0.990000 0.000000 0.990000 ( 0.989542) + # upto: 0.970000 0.000000 0.970000 ( 0.972854) + # >total: 2.930000 0.000000 2.930000 ( 2.932889) + # >avg: 0.976667 0.000000 0.976667 ( 0.977630) + # + # source://benchmark//lib/benchmark.rb#341 + def benchmark(caption = T.unsafe(nil), label_width = T.unsafe(nil), format = T.unsafe(nil), *labels); end + + # A simple interface to the #benchmark method, #bm generates sequential + # reports with labels. +label_width+ and +labels+ parameters have the same + # meaning as for #benchmark. + # + # require 'benchmark' + # + # n = 5000000 + # Benchmark.bm(7) do |x| + # x.report("for:") { for i in 1..n; a = "1"; end } + # x.report("times:") { n.times do ; a = "1"; end } + # x.report("upto:") { 1.upto(n) do ; a = "1"; end } + # end + # + # Generates: + # + # user system total real + # for: 0.960000 0.000000 0.960000 ( 0.957966) + # times: 0.960000 0.000000 0.960000 ( 0.960423) + # upto: 0.950000 0.000000 0.950000 ( 0.954864) + # + # source://benchmark//lib/benchmark.rb#341 + def bm(label_width = T.unsafe(nil), *labels, &blk); end + + # Sometimes benchmark results are skewed because code executed + # earlier encounters different garbage collection overheads than + # that run later. #bmbm attempts to minimize this effect by running + # the tests twice, the first time as a rehearsal in order to get the + # runtime environment stable, the second time for + # real. GC.start is executed before the start of each of + # the real timings; the cost of this is not included in the + # timings. In reality, though, there's only so much that #bmbm can + # do, and the results are not guaranteed to be isolated from garbage + # collection and other effects. + # + # Because #bmbm takes two passes through the tests, it can + # calculate the required label width. + # + # require 'benchmark' + # + # array = (1..1000000).map { rand } + # + # Benchmark.bmbm do |x| + # x.report("sort!") { array.dup.sort! } + # x.report("sort") { array.dup.sort } + # end + # + # Generates: + # + # Rehearsal ----------------------------------------- + # sort! 1.440000 0.010000 1.450000 ( 1.446833) + # sort 1.440000 0.000000 1.440000 ( 1.448257) + # -------------------------------- total: 2.890000sec + # + # user system total real + # sort! 1.460000 0.000000 1.460000 ( 1.458065) + # sort 1.450000 0.000000 1.450000 ( 1.455963) + # + # #bmbm yields a Benchmark::Job object and returns an array of + # Benchmark::Tms objects. + # + # source://benchmark//lib/benchmark.rb#341 + def bmbm(width = T.unsafe(nil)); end + + # Returns the time used to execute the given block as a + # Benchmark::Tms object. Takes +label+ option. + # + # require 'benchmark' + # + # n = 1000000 + # + # time = Benchmark.measure do + # n.times { a = "1" } + # end + # puts time + # + # Generates: + # + # 0.220000 0.000000 0.220000 ( 0.227313) + # + # source://benchmark//lib/benchmark.rb#341 + def measure(label = T.unsafe(nil)); end + + # Returns the elapsed real time used to execute the given block. + # The unit of time is milliseconds. + # + # Benchmark.ms { "a" * 1_000_000_000 } + # #=> 509.8029999935534 + # + # source://benchmark//lib/benchmark.rb#341 + def ms; end + + # Returns the elapsed real time used to execute the given block. + # The unit of time is seconds. + # + # Benchmark.realtime { "a" * 1_000_000_000 } + # #=> 0.5098029999935534 + # + # source://benchmark//lib/benchmark.rb#341 + def realtime; end + end +end + +# A Job is a sequence of labelled blocks to be processed by the +# Benchmark.bmbm method. It is of little direct interest to the user. +# +# source://benchmark//lib/benchmark.rb#347 +class Benchmark::Job + # Returns an initialized Job instance. + # Usually, one doesn't call this method directly, as new + # Job objects are created by the #bmbm method. + # +width+ is a initial value for the label offset used in formatting; + # the #bmbm method passes its +width+ argument to this constructor. + # + # @return [Job] a new instance of Job + # + # source://benchmark//lib/benchmark.rb#355 + def initialize(width); end + + # Registers the given label and block pair in the job list. + # + # @raise [ArgumentError] + # + # source://benchmark//lib/benchmark.rb#363 + def item(label = T.unsafe(nil), &blk); end + + # An array of 2-element arrays, consisting of label and block pairs. + # + # source://benchmark//lib/benchmark.rb#375 + def list; end + + # Registers the given label and block pair in the job list. + # + # @raise [ArgumentError] + # + # source://benchmark//lib/benchmark.rb#372 + def report(label = T.unsafe(nil), &blk); end + + # Length of the widest label in the #list. + # + # source://benchmark//lib/benchmark.rb#378 + def width; end +end + +# This class is used by the Benchmark.benchmark and Benchmark.bm methods. +# It is of little direct interest to the user. +# +# source://benchmark//lib/benchmark.rb#385 +class Benchmark::Report + # Returns an initialized Report instance. + # Usually, one doesn't call this method directly, as new + # Report objects are created by the #benchmark and #bm methods. + # +width+ and +format+ are the label offset and + # format string used by Tms#format. + # + # @return [Report] a new instance of Report + # + # source://benchmark//lib/benchmark.rb#393 + def initialize(width = T.unsafe(nil), format = T.unsafe(nil)); end + + # An array of Benchmark::Tms objects representing each item. + # + # source://benchmark//lib/benchmark.rb#412 + def format; end + + # Prints the +label+ and measured time for the block, + # formatted by +format+. See Tms#format for the + # formatting rules. + # + # source://benchmark//lib/benchmark.rb#402 + def item(label = T.unsafe(nil), *format, &blk); end + + # An array of Benchmark::Tms objects representing each item. + # + # source://benchmark//lib/benchmark.rb#412 + def list; end + + # Prints the +label+ and measured time for the block, + # formatted by +format+. See Tms#format for the + # formatting rules. + # + # source://benchmark//lib/benchmark.rb#409 + def report(label = T.unsafe(nil), *format, &blk); end + + # An array of Benchmark::Tms objects representing each item. + # + # source://benchmark//lib/benchmark.rb#412 + def width; end +end + +# A data object, representing the times associated with a benchmark +# measurement. +# +# source://benchmark//lib/benchmark.rb#421 +class Benchmark::Tms + # Returns an initialized Tms object which has + # +utime+ as the user CPU time, +stime+ as the system CPU time, + # +cutime+ as the children's user CPU time, +cstime+ as the children's + # system CPU time, +real+ as the elapsed real time and +label+ as the label. + # + # @return [Tms] a new instance of Tms + # + # source://benchmark//lib/benchmark.rb#456 + def initialize(utime = T.unsafe(nil), stime = T.unsafe(nil), cutime = T.unsafe(nil), cstime = T.unsafe(nil), real = T.unsafe(nil), label = T.unsafe(nil)); end + + # Returns a new Tms object obtained by memberwise multiplication + # of the individual times for this Tms object by +x+. + # + # source://benchmark//lib/benchmark.rb#504 + def *(x); end + + # Returns a new Tms object obtained by memberwise summation + # of the individual times for this Tms object with those of the +other+ + # Tms object. + # This method and #/() are useful for taking statistics. + # + # source://benchmark//lib/benchmark.rb#491 + def +(other); end + + # Returns a new Tms object obtained by memberwise subtraction + # of the individual times for the +other+ Tms object from those of this + # Tms object. + # + # source://benchmark//lib/benchmark.rb#498 + def -(other); end + + # Returns a new Tms object obtained by memberwise division + # of the individual times for this Tms object by +x+. + # This method and #+() are useful for taking statistics. + # + # source://benchmark//lib/benchmark.rb#511 + def /(x); end + + # Returns a new Tms object whose times are the sum of the times for this + # Tms object, plus the time required to execute the code block (+blk+). + # + # source://benchmark//lib/benchmark.rb#465 + def add(&blk); end + + # An in-place version of #add. + # Changes the times of this Tms object by making it the sum of the times + # for this Tms object, plus the time required to execute + # the code block (+blk+). + # + # source://benchmark//lib/benchmark.rb#475 + def add!(&blk); end + + # System CPU time of children + # + # source://benchmark//lib/benchmark.rb#439 + def cstime; end + + # User CPU time of children + # + # source://benchmark//lib/benchmark.rb#436 + def cutime; end + + # Returns the contents of this Tms object as + # a formatted string, according to a +format+ string + # like that passed to Kernel.format. In addition, #format + # accepts the following extensions: + # + # %u:: Replaced by the user CPU time, as reported by Tms#utime. + # %y:: Replaced by the system CPU time, as reported by Tms#stime (Mnemonic: y of "s*y*stem") + # %U:: Replaced by the children's user CPU time, as reported by Tms#cutime + # %Y:: Replaced by the children's system CPU time, as reported by Tms#cstime + # %t:: Replaced by the total CPU time, as reported by Tms#total + # %r:: Replaced by the elapsed real time, as reported by Tms#real + # %n:: Replaced by the label string, as reported by Tms#label (Mnemonic: n of "*n*ame") + # + # If +format+ is not given, FORMAT is used as default value, detailing the + # user, system, total and real elapsed time. + # + # source://benchmark//lib/benchmark.rb#530 + def format(format = T.unsafe(nil), *args); end + + # Label + # + # source://benchmark//lib/benchmark.rb#448 + def label; end + + # Elapsed real time + # + # source://benchmark//lib/benchmark.rb#442 + def real; end + + # System CPU time + # + # source://benchmark//lib/benchmark.rb#433 + def stime; end + + # Returns a new 6-element array, consisting of the + # label, user CPU time, system CPU time, children's + # user CPU time, children's system CPU time and elapsed + # real time. + # + # source://benchmark//lib/benchmark.rb#555 + def to_a; end + + # Returns a hash containing the same data as `to_a`. + # + # source://benchmark//lib/benchmark.rb#562 + def to_h; end + + # Same as #format. + # + # source://benchmark//lib/benchmark.rb#545 + def to_s; end + + # Total time, that is +utime+ + +stime+ + +cutime+ + +cstime+ + # + # source://benchmark//lib/benchmark.rb#445 + def total; end + + # User CPU time + # + # source://benchmark//lib/benchmark.rb#430 + def utime; end + + protected + + # Returns a new Tms object obtained by memberwise operation +op+ + # of the individual times for this Tms object with those of the other + # Tms object (+x+). + # + # +op+ can be a mathematical operation such as +, -, + # *, / + # + # source://benchmark//lib/benchmark.rb#583 + def memberwise(op, x); end +end + +# source://benchmark//lib/benchmark.rb#125 +Benchmark::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/better_html@2.2.0.rbi b/sorbet/rbi/gems/better_html@2.2.0.rbi new file mode 100644 index 0000000..4b23d23 --- /dev/null +++ b/sorbet/rbi/gems/better_html@2.2.0.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `better_html` gem. +# Please instead update this file by running `bin/tapioca gem better_html`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/bigdecimal@3.3.1.rbi b/sorbet/rbi/gems/bigdecimal@3.3.1.rbi new file mode 100644 index 0000000..e2a5ccf --- /dev/null +++ b/sorbet/rbi/gems/bigdecimal@3.3.1.rbi @@ -0,0 +1,381 @@ +# typed: false + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `bigdecimal` gem. +# Please instead update this file by running `bin/tapioca gem bigdecimal`. + + +# source://bigdecimal//lib/bigdecimal.rb#13 +class BigDecimal < ::Numeric + # source://bigdecimal//lib/bigdecimal.rb#10 + def %(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def *(_arg0); end + + # call-seq: + # self ** other -> bigdecimal + # + # Returns the \BigDecimal value of +self+ raised to power +other+: + # + # b = BigDecimal('3.14') + # b ** 2 # => 0.98596e1 + # b ** 2.0 # => 0.98596e1 + # b ** Rational(2, 1) # => 0.98596e1 + # + # Related: BigDecimal#power. + # + # source://bigdecimal//lib/bigdecimal.rb#77 + def **(y); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def +(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def +@; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def -(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def -@; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def /(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def <(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def <=(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def <=>(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def ==(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def ===(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def >(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def >=(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def _decimal_shift(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def _dump(*_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def abs; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def add(_arg0, _arg1); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def ceil(*_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def clone; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def coerce(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def div(*_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def divmod(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def dup; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def eql?(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def exponent; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def finite?; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def fix; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def floor(*_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def frac; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def hash; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def infinite?; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def inspect; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def modulo(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def mult(_arg0, _arg1); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def n_significant_digits; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def nan?; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def nonzero?; end + + # call-seq: + # power(n) + # power(n, prec) + # + # Returns the value raised to the power of n. + # + # Also available as the operator **. + # + # source://bigdecimal//lib/bigdecimal.rb#97 + def power(y, prec = T.unsafe(nil)); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def precision; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def precision_scale; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def precs; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def quo(*_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def remainder(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def round(*_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def scale; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def sign; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def split; end + + # Returns the square root of the value. + # + # Result has at least prec significant digits. + # + # @raise [FloatDomainError] + # + # source://bigdecimal//lib/bigdecimal.rb#211 + def sqrt(prec); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def sub(_arg0, _arg1); end + + # call-seq: + # a.to_d -> bigdecimal + # + # Returns self. + # + # require 'bigdecimal/util' + # + # d = BigDecimal("3.14") + # d.to_d # => 0.314e1 + # + # source://bigdecimal//lib/bigdecimal/util.rb#110 + def to_d; end + + # call-seq: + # a.to_digits -> string + # + # Converts a BigDecimal to a String of the form "nnnnnn.mmm". + # This method is deprecated; use BigDecimal#to_s("F") instead. + # + # require 'bigdecimal/util' + # + # d = BigDecimal("3.14") + # d.to_digits # => "3.14" + # + # source://bigdecimal//lib/bigdecimal/util.rb#90 + def to_digits; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def to_f; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def to_i; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def to_int; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def to_r; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def to_s(format = T.unsafe(nil)); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def truncate(*_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def zero?; end + + class << self + # source://bigdecimal//lib/bigdecimal.rb#10 + def _load(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def double_fig; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def interpret_loosely(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def limit(*_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def mode(*_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def save_exception_mode; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def save_limit; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def save_rounding_mode; end + end +end + +# source://bigdecimal//lib/bigdecimal.rb#14 +module BigDecimal::Internal + class << self + # Coerce x to BigDecimal with the specified precision. + # TODO: some methods (example: BigMath.exp) require more precision than specified to coerce. + # + # @raise [ArgumentError] + # + # source://bigdecimal//lib/bigdecimal.rb#18 + def coerce_to_bigdecimal(x, prec, method_name); end + + # source://bigdecimal//lib/bigdecimal.rb#30 + def coerce_validate_prec(prec, method_name, accept_zero: T.unsafe(nil)); end + + # source://bigdecimal//lib/bigdecimal.rb#50 + def infinity_computation_result; end + + # source://bigdecimal//lib/bigdecimal.rb#57 + def nan_computation_result; end + end +end + +BigDecimal::VERSION = T.let(T.unsafe(nil), String) + +# Core BigMath methods for BigDecimal (log, exp) are defined here. +# Other methods (sin, cos, atan) are defined in 'bigdecimal/math.rb'. +# +# source://bigdecimal//lib/bigdecimal.rb#237 +module BigMath + class << self + # call-seq: + # BigMath.exp(decimal, numeric) -> BigDecimal + # + # Computes the value of e (the base of natural logarithms) raised to the + # power of +decimal+, to the specified number of digits of precision. + # + # If +decimal+ is infinity, returns Infinity. + # + # If +decimal+ is NaN, returns NaN. + # + # source://bigdecimal//lib/bigdecimal.rb#328 + def exp(x, prec); end + + # call-seq: + # BigMath.log(decimal, numeric) -> BigDecimal + # + # Computes the natural logarithm of +decimal+ to the specified number of + # digits of precision, +numeric+. + # + # If +decimal+ is zero or negative, raises Math::DomainError. + # + # If +decimal+ is positive infinity, returns Infinity. + # + # If +decimal+ is NaN, returns NaN. + # + # @raise [Math::DomainError] + # + # source://bigdecimal//lib/bigdecimal.rb#251 + def log(x, prec); end + + private + + # source://bigdecimal//lib/bigdecimal.rb#306 + def _exp_taylor(x, prec); end + end +end + +# source://bigdecimal//lib/bigdecimal/util.rb#141 +class Complex < ::Numeric + # call-seq: + # cmp.to_d -> bigdecimal + # cmp.to_d(precision) -> bigdecimal + # + # Returns the value as a BigDecimal. + # If the imaginary part is not +0+, an error is raised + # + # The +precision+ parameter is used to determine the number of + # significant digits for the result. When +precision+ is set to +0+, + # the number of digits to represent the float being converted is determined + # automatically. + # The default +precision+ is +0+. + # + # require 'bigdecimal' + # require 'bigdecimal/util' + # + # Complex(0.1234567, 0).to_d(4) # => 0.1235e0 + # Complex(Rational(22, 7), 0).to_d(3) # => 0.314e1 + # Complex(1, 1).to_d # raises ArgumentError + # + # See also Kernel.BigDecimal. + # + # source://bigdecimal//lib/bigdecimal/util.rb#164 + def to_d(precision = T.unsafe(nil)); end +end + +# source://bigdecimal//lib/bigdecimal/util.rb#116 +class Rational < ::Numeric + # call-seq: + # rat.to_d(precision) -> bigdecimal + # + # Returns the value as a BigDecimal. + # + # The +precision+ parameter is used to determine the number of + # significant digits for the result. When +precision+ is set to +0+, + # the number of digits to represent the float being converted is determined + # automatically. + # The default +precision+ is +0+. + # + # require 'bigdecimal' + # require 'bigdecimal/util' + # + # Rational(22, 7).to_d(3) # => 0.314e1 + # + # See also Kernel.BigDecimal. + # + # source://bigdecimal//lib/bigdecimal/util.rb#135 + def to_d(precision = T.unsafe(nil)); end +end diff --git a/sorbet/rbi/gems/bindex@0.8.1.rbi b/sorbet/rbi/gems/bindex@0.8.1.rbi new file mode 100644 index 0000000..8d9e143 --- /dev/null +++ b/sorbet/rbi/gems/bindex@0.8.1.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `bindex` gem. +# Please instead update this file by running `bin/tapioca gem bindex`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/bootsnap@1.19.0.rbi b/sorbet/rbi/gems/bootsnap@1.19.0.rbi new file mode 100644 index 0000000..6ab70b4 --- /dev/null +++ b/sorbet/rbi/gems/bootsnap@1.19.0.rbi @@ -0,0 +1,924 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `bootsnap` gem. +# Please instead update this file by running `bin/tapioca gem bootsnap`. + + +# source://bootsnap//lib/bootsnap/version.rb#3 +module Bootsnap + extend ::Bootsnap + + # @return [Boolean] + # + # source://bootsnap//lib/bootsnap/bundler.rb#6 + def bundler?; end + + private + + # source://bootsnap//lib/bootsnap/compile_cache/iseq.rb#3 + def instrumentation_enabled=(_arg0); end + + class << self + # source://bootsnap//lib/bootsnap.rb#44 + def _instrument(event, path); end + + # source://bootsnap//lib/bootsnap.rb#139 + def absolute_path?(path); end + + # source://bootsnap//lib/bootsnap.rb#85 + def default_setup; end + + # source://bootsnap//lib/bootsnap.rb#37 + def instrumentation=(callback); end + + # source://bootsnap//lib/bootsnap/compile_cache/iseq.rb#3 + def instrumentation_enabled=(_arg0); end + + # source://bootsnap//lib/bootsnap.rb#24 + def log!; end + + # source://bootsnap//lib/bootsnap.rb#14 + def log_stats!; end + + # Returns the value of attribute logger. + # + # source://bootsnap//lib/bootsnap.rb#12 + def logger; end + + # source://bootsnap//lib/bootsnap.rb#28 + def logger=(logger); end + + # Allow the C extension to redefine `rb_get_path` without warning. + # Allow the C extension to redefine `rb_get_path` without warning. + # + # source://bootsnap//lib/bootsnap.rb#147 + def rb_get_path(_arg0); end + + # source://bootsnap//lib/bootsnap.rb#48 + def setup(cache_dir:, development_mode: T.unsafe(nil), load_path_cache: T.unsafe(nil), ignore_directories: T.unsafe(nil), readonly: T.unsafe(nil), revalidation: T.unsafe(nil), compile_cache_iseq: T.unsafe(nil), compile_cache_yaml: T.unsafe(nil), compile_cache_json: T.unsafe(nil)); end + + # source://bootsnap//lib/bootsnap.rb#81 + def unload_cache!; end + + private + + # source://bootsnap//lib/bootsnap.rb#161 + def bool_env(key, default: T.unsafe(nil)); end + + # @return [Boolean] + # + # source://bootsnap//lib/bootsnap.rb#157 + def enabled?(key); end + end +end + +# source://bootsnap//lib/bootsnap/compile_cache.rb#4 +module Bootsnap::CompileCache + class << self + # source://bootsnap//lib/bootsnap/compile_cache.rb#12 + def setup(cache_dir:, iseq:, yaml:, json: T.unsafe(nil), readonly: T.unsafe(nil), revalidation: T.unsafe(nil)); end + + # @return [Boolean] + # + # source://bootsnap//lib/bootsnap/compile_cache.rb#41 + def supported?; end + end +end + +# source://bootsnap//lib/bootsnap/compile_cache.rb#10 +class Bootsnap::CompileCache::Error < ::StandardError; end + +# source://bootsnap//lib/bootsnap/compile_cache/iseq.rb#8 +module Bootsnap::CompileCache::ISeq + class << self + # Returns the value of attribute cache_dir. + # + # source://bootsnap//lib/bootsnap/compile_cache/iseq.rb#10 + def cache_dir; end + + # source://bootsnap//lib/bootsnap/compile_cache/iseq.rb#12 + def cache_dir=(cache_dir); end + + # source://bootsnap//lib/bootsnap/compile_cache/iseq.rb#103 + def compile_option_updated; end + + # source://bootsnap//lib/bootsnap/compile_cache/iseq.rb#63 + def fetch(path, cache_dir: T.unsafe(nil)); end + + # source://bootsnap//lib/bootsnap/compile_cache/iseq.rb#80 + def input_to_output(_data, _kwargs); end + + # source://bootsnap//lib/bootsnap/compile_cache/iseq.rb#45 + def input_to_storage(_, path); end + + # source://bootsnap//lib/bootsnap/compile_cache/iseq.rb#110 + def install!(cache_dir); end + + # source://bootsnap//lib/bootsnap/compile_cache/iseq.rb#72 + def precompile(path); end + + # source://bootsnap//lib/bootsnap/compile_cache/iseq.rb#52 + def storage_to_output(binary, _args); end + + # @return [Boolean] + # + # source://bootsnap//lib/bootsnap/compile_cache/iseq.rb#16 + def supported?; end + end +end + +# source://bootsnap//lib/bootsnap/compile_cache/iseq.rb#84 +module Bootsnap::CompileCache::ISeq::InstructionSequenceMixin + # source://bootsnap//lib/bootsnap/compile_cache/iseq.rb#97 + def compile_option=(hash); end + + # source://bootsnap//lib/bootsnap/compile_cache/iseq.rb#85 + def load_iseq(path); end +end + +module Bootsnap::CompileCache::Native + private + + # source://bootsnap//lib/bootsnap/compile_cache/iseq.rb#3 + def compile_option_crc32=(_arg0); end + + # source://bootsnap//lib/bootsnap/compile_cache/iseq.rb#3 + def fetch(_arg0, _arg1, _arg2, _arg3); end + + # source://bootsnap//lib/bootsnap/compile_cache/iseq.rb#3 + def precompile(_arg0, _arg1, _arg2); end + + # source://bootsnap//lib/bootsnap/compile_cache/iseq.rb#3 + def readonly=(_arg0); end + + # source://bootsnap//lib/bootsnap/compile_cache/iseq.rb#3 + def revalidation=(_arg0); end + + class << self + # source://bootsnap//lib/bootsnap/compile_cache/iseq.rb#3 + def compile_option_crc32=(_arg0); end + + # source://bootsnap//lib/bootsnap/compile_cache/iseq.rb#3 + def fetch(_arg0, _arg1, _arg2, _arg3); end + + # source://bootsnap//lib/bootsnap/compile_cache/iseq.rb#3 + def precompile(_arg0, _arg1, _arg2); end + + # source://bootsnap//lib/bootsnap/compile_cache/iseq.rb#3 + def readonly=(_arg0); end + + # source://bootsnap//lib/bootsnap/compile_cache/iseq.rb#3 + def revalidation=(_arg0); end + end +end + +# source://bootsnap//lib/bootsnap/compile_cache.rb#5 +Bootsnap::CompileCache::UNCOMPILABLE = T.let(T.unsafe(nil), BasicObject) + +# source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#7 +module Bootsnap::CompileCache::YAML + class << self + # Returns the value of attribute cache_dir. + # + # source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#20 + def cache_dir; end + + # source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#22 + def cache_dir=(cache_dir); end + + # Returns the value of attribute implementation. + # + # source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#20 + def implementation; end + + # source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#57 + def init!; end + + # source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#36 + def install!(cache_dir); end + + # Returns the value of attribute msgpack_factory. + # + # source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#19 + def msgpack_factory; end + + # Sets the attribute msgpack_factory + # + # @param value the value to set the attribute msgpack_factory to. + # + # source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#19 + def msgpack_factory=(_arg0); end + + # source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#124 + def patch; end + + # source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#26 + def precompile(path); end + + # source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#128 + def strict_load(payload); end + + # Psych coerce strings to `Encoding.default_internal` but Message Pack only support + # UTF-8, US-ASCII and BINARY. So if Encoding.default_internal is set to anything else + # we can't safely use the cache + # + # @return [Boolean] + # + # source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#45 + def supported_internal_encoding?; end + + # Returns the value of attribute supported_options. + # + # source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#19 + def supported_options; end + + # Sets the attribute supported_options + # + # @param value the value to set the attribute supported_options to. + # + # source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#19 + def supported_options=(_arg0); end + end +end + +# source://bootsnap//lib/bootsnap/setup.rb#5 +class Bootsnap::CompileCache::YAML::NoTagsVisitor < ::Psych::Visitors::NoAliasRuby + # source://bootsnap//lib/bootsnap/setup.rb#5 + def visit(target); end +end + +# source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#264 +module Bootsnap::CompileCache::YAML::Psych3 + extend ::Bootsnap::CompileCache::YAML::Psych3 + + # source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#289 + def input_to_output(data, kwargs); end + + # source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#267 + def input_to_storage(contents, _); end + + # source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#279 + def storage_to_output(data, kwargs); end +end + +# source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#293 +module Bootsnap::CompileCache::YAML::Psych3::Patch + # source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#294 + def load_file(path, *args, **_arg2); end + + # source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#314 + def unsafe_load_file(path, *args, **_arg2); end +end + +# source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#139 +module Bootsnap::CompileCache::YAML::Psych4 + extend ::Bootsnap::CompileCache::YAML::Psych4 + + # source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#142 + def input_to_storage(contents, _); end +end + +# source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#221 +module Bootsnap::CompileCache::YAML::Psych4::Patch + # source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#222 + def load_file(path, *args, **_arg2); end + + # source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#242 + def unsafe_load_file(path, *args, **_arg2); end +end + +# source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#181 +module Bootsnap::CompileCache::YAML::Psych4::SafeLoad + extend ::Bootsnap::CompileCache::YAML::Psych4::SafeLoad + + # source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#216 + def input_to_output(data, kwargs); end + + # source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#184 + def input_to_storage(contents, _); end + + # source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#201 + def storage_to_output(data, kwargs); end +end + +# source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#150 +module Bootsnap::CompileCache::YAML::Psych4::UnsafeLoad + extend ::Bootsnap::CompileCache::YAML::Psych4::UnsafeLoad + + # source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#176 + def input_to_output(data, kwargs); end + + # source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#153 + def input_to_storage(contents, _); end + + # source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#165 + def storage_to_output(data, kwargs); end +end + +# source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#11 +Bootsnap::CompileCache::YAML::SUPPORTED_INTERNAL_ENCODINGS = T.let(T.unsafe(nil), Array) + +# source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#8 +class Bootsnap::CompileCache::YAML::Uncompilable < ::StandardError; end + +# source://bootsnap//lib/bootsnap/compile_cache/yaml.rb#9 +class Bootsnap::CompileCache::YAML::UnsupportedTags < ::Bootsnap::CompileCache::YAML::Uncompilable; end + +# source://bootsnap//lib/bootsnap/explicit_require.rb#4 +module Bootsnap::ExplicitRequire + class << self + # source://bootsnap//lib/bootsnap/explicit_require.rb#17 + def from_archdir(feature); end + + # source://bootsnap//lib/bootsnap/explicit_require.rb#13 + def from_rubylibdir(feature); end + + # source://bootsnap//lib/bootsnap/explicit_require.rb#9 + def from_self(feature); end + + # Given a set of gems, run a block with the LOAD_PATH narrowed to include + # only core ruby source paths and these gems -- that is, roughly, + # temporarily remove all gems not listed in this call from the LOAD_PATH. + # + # This is useful before bootsnap is fully-initialized to load gems that it + # depends on, without forcing full LOAD_PATH traversals. + # + # source://bootsnap//lib/bootsnap/explicit_require.rb#27 + def with_gems(*gems); end + end +end + +# source://bootsnap//lib/bootsnap/explicit_require.rb#5 +Bootsnap::ExplicitRequire::ARCHDIR = T.let(T.unsafe(nil), String) + +# source://bootsnap//lib/bootsnap/explicit_require.rb#7 +Bootsnap::ExplicitRequire::DLEXT = T.let(T.unsafe(nil), String) + +# source://bootsnap//lib/bootsnap/explicit_require.rb#6 +Bootsnap::ExplicitRequire::RUBYLIBDIR = T.let(T.unsafe(nil), String) + +# source://bootsnap//lib/bootsnap.rb#9 +class Bootsnap::InvalidConfiguration < ::StandardError; end + +# source://bootsnap//lib/bootsnap/load_path_cache.rb#4 +module Bootsnap::LoadPathCache + class << self + # Returns the value of attribute enabled. + # + # source://bootsnap//lib/bootsnap/load_path_cache.rb#28 + def enabled?; end + + # Returns the value of attribute load_path_cache. + # + # source://bootsnap//lib/bootsnap/load_path_cache.rb#27 + def load_path_cache; end + + # Returns the value of attribute loaded_features_index. + # + # source://bootsnap//lib/bootsnap/load_path_cache.rb#27 + def loaded_features_index; end + + # source://bootsnap//lib/bootsnap/load_path_cache.rb#31 + def setup(cache_path:, development_mode:, ignore_directories:, readonly: T.unsafe(nil)); end + + # @return [Boolean] + # + # source://bootsnap//lib/bootsnap/load_path_cache.rb#56 + def supported?; end + + # source://bootsnap//lib/bootsnap/load_path_cache.rb#48 + def unload!; end + end +end + +# source://bootsnap//lib/bootsnap/load_path_cache.rb#22 +Bootsnap::LoadPathCache::CACHED_EXTENSIONS = T.let(T.unsafe(nil), Array) + +# source://bootsnap//lib/bootsnap/load_path_cache/cache.rb#7 +class Bootsnap::LoadPathCache::Cache + # @return [Cache] a new instance of Cache + # + # source://bootsnap//lib/bootsnap/load_path_cache/cache.rb#10 + def initialize(store, path_obj, development_mode: T.unsafe(nil)); end + + # Try to resolve this feature to an absolute path without traversing the + # loadpath. + # + # source://bootsnap//lib/bootsnap/load_path_cache/cache.rb#56 + def find(feature); end + + # What is the path item that contains the dir as child? + # e.g. given "/a/b/c/d" exists, and the path is ["/a/b"], load_dir("c/d") + # is "/a/b". + # + # source://bootsnap//lib/bootsnap/load_path_cache/cache.rb#22 + def load_dir(dir); end + + # source://bootsnap//lib/bootsnap/load_path_cache/cache.rb#116 + def push_paths(sender, *paths); end + + # source://bootsnap//lib/bootsnap/load_path_cache/cache.rb#122 + def reinitialize(path_obj = T.unsafe(nil)); end + + # source://bootsnap//lib/bootsnap/load_path_cache/cache.rb#110 + def unshift_paths(sender, *paths); end + + private + + # @return [Boolean] + # + # source://bootsnap//lib/bootsnap/load_path_cache/cache.rb#135 + def dir_changed?; end + + # source://bootsnap//lib/bootsnap/load_path_cache/cache.rb#180 + def expand_path(feature); end + + # source://bootsnap//lib/bootsnap/load_path_cache/cache.rb#211 + def maybe_append_extension(feature); end + + # source://bootsnap//lib/bootsnap/load_path_cache/cache.rb#188 + def now; end + + # source://bootsnap//lib/bootsnap/load_path_cache/cache.rb#145 + def push_paths_locked(*paths); end + + # source://bootsnap//lib/bootsnap/load_path_cache/cache.rb#207 + def search_index(feature); end + + # @return [Boolean] + # + # source://bootsnap//lib/bootsnap/load_path_cache/cache.rb#184 + def stale?; end + + # source://bootsnap//lib/bootsnap/load_path_cache/cache.rb#239 + def try_ext(feature); end + + # source://bootsnap//lib/bootsnap/load_path_cache/cache.rb#219 + def try_index(feature); end + + # source://bootsnap//lib/bootsnap/load_path_cache/cache.rb#163 + def unshift_paths_locked(*paths); end +end + +# seconds +# +# source://bootsnap//lib/bootsnap/load_path_cache/cache.rb#8 +Bootsnap::LoadPathCache::Cache::AGE_THRESHOLD = T.let(T.unsafe(nil), Integer) + +# { 'enumerator' => nil, 'enumerator.so' => nil, ... } +# +# source://bootsnap//lib/bootsnap/load_path_cache/cache.rb#32 +Bootsnap::LoadPathCache::Cache::BUILTIN_FEATURES = T.let(T.unsafe(nil), Hash) + +# source://bootsnap//lib/bootsnap/load_path_cache/cache.rb#27 +Bootsnap::LoadPathCache::Cache::TRUFFLERUBY_LIB_DIR_PREFIX = T.let(T.unsafe(nil), T.untyped) + +# source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#5 +module Bootsnap::LoadPathCache::ChangeObserver + class << self + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#65 + def register(arr, observer); end + + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#74 + def unregister(arr); end + end +end + +# source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#6 +module Bootsnap::LoadPathCache::ChangeObserver::ArrayMixin + # For each method that adds items to one end or another of the array + # (<<, push, unshift, concat), override that method to also notify the + # observer of the change. + # + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#10 + def <<(entry); end + + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#51 + def []=(*args, &block); end + + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#19 + def append(*entries); end + + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#51 + def clear(*args, &block); end + + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#62 + def clone; end + + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#51 + def collect!(*args, &block); end + + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#51 + def compact!(*args, &block); end + + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#27 + def concat(entries); end + + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#51 + def delete(*args, &block); end + + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#51 + def delete_at(*args, &block); end + + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#51 + def delete_if(*args, &block); end + + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#58 + def dup; end + + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#51 + def fill(*args, &block); end + + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#51 + def flatten!(*args, &block); end + + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#51 + def insert(*args, &block); end + + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#51 + def keep_if(*args, &block); end + + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#51 + def map!(*args, &block); end + + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#51 + def pop(*args, &block); end + + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#25 + def prepend(*entries); end + + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#15 + def push(*entries); end + + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#51 + def reject!(*args, &block); end + + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#51 + def replace(*args, &block); end + + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#51 + def reverse!(*args, &block); end + + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#51 + def rotate!(*args, &block); end + + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#51 + def select!(*args, &block); end + + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#51 + def shift(*args, &block); end + + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#51 + def shuffle!(*args, &block); end + + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#51 + def slice!(*args, &block); end + + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#51 + def sort!(*args, &block); end + + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#51 + def sort_by!(*args, &block); end + + # uniq! keeps the first occurrence of each path, otherwise preserving + # order, preserving the effective load path + # + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#34 + def uniq!(*args); end + + # source://bootsnap//lib/bootsnap/load_path_cache/change_observer.rb#21 + def unshift(*entries); end +end + +# source://bootsnap//lib/bootsnap/load_path_cache.rb#16 +Bootsnap::LoadPathCache::DLEXT = T.let(T.unsafe(nil), String) + +# This is nil on linux and darwin, but I think it's '.o' on some other +# platform. I'm not really sure which, but it seems better to replicate +# ruby's semantics as faithfully as possible. +# +# source://bootsnap//lib/bootsnap/load_path_cache.rb#20 +Bootsnap::LoadPathCache::DLEXT2 = T.let(T.unsafe(nil), T.untyped) + +# source://bootsnap//lib/bootsnap/load_path_cache.rb#11 +Bootsnap::LoadPathCache::DL_EXTENSIONS = T.let(T.unsafe(nil), Array) + +# source://bootsnap//lib/bootsnap/load_path_cache.rb#7 +Bootsnap::LoadPathCache::DOT_RB = T.let(T.unsafe(nil), String) + +# source://bootsnap//lib/bootsnap/load_path_cache.rb#8 +Bootsnap::LoadPathCache::DOT_SO = T.let(T.unsafe(nil), String) + +# source://bootsnap//lib/bootsnap/load_path_cache.rb#5 +Bootsnap::LoadPathCache::FALLBACK_SCAN = T.let(T.unsafe(nil), BasicObject) + +# LoadedFeaturesIndex partially mirrors an internal structure in ruby that +# we can't easily obtain an interface to. +# +# This works around an issue where, without bootsnap, *ruby* knows that it +# has already required a file by its short name (e.g. require 'bundler') if +# a new instance of bundler is added to the $LOAD_PATH which resolves to a +# different absolute path. This class makes bootsnap smart enough to +# realize that it has already loaded 'bundler', and not just +# '/path/to/bundler'. +# +# If you disable LoadedFeaturesIndex, you can see the problem this solves by: +# +# 1. `require 'a'` +# 2. Prepend a new $LOAD_PATH element containing an `a.rb` +# 3. `require 'a'` +# +# Ruby returns false from step 3. +# With bootsnap but with no LoadedFeaturesIndex, this loads two different +# `a.rb`s. +# With bootsnap and with LoadedFeaturesIndex, this skips the second load, +# returning false like ruby. +# +# source://bootsnap//lib/bootsnap/load_path_cache/loaded_features_index.rb#26 +class Bootsnap::LoadPathCache::LoadedFeaturesIndex + # @return [LoadedFeaturesIndex] a new instance of LoadedFeaturesIndex + # + # source://bootsnap//lib/bootsnap/load_path_cache/loaded_features_index.rb#27 + def initialize; end + + # source://bootsnap//lib/bootsnap/load_path_cache/loaded_features_index.rb#72 + def cursor(short); end + + # source://bootsnap//lib/bootsnap/load_path_cache/loaded_features_index.rb#78 + def identify(short, cursor); end + + # @return [Boolean] + # + # source://bootsnap//lib/bootsnap/load_path_cache/loaded_features_index.rb#68 + def key?(feature); end + + # We've optimized for initialize and register to be fast, and purge to be tolerable. + # If access patterns make this not-okay, we can lazy-invert the LFI on + # first purge and work from there. + # + # source://bootsnap//lib/bootsnap/load_path_cache/loaded_features_index.rb#54 + def purge(feature); end + + # source://bootsnap//lib/bootsnap/load_path_cache/loaded_features_index.rb#61 + def purge_multi(features); end + + # There is a relatively uncommon case where we could miss adding an + # entry: + # + # If the user asked for e.g. `require 'bundler'`, and we went through the + # `FALLBACK_SCAN` pathway in `kernel_require.rb` and therefore did not + # pass `long` (the full expanded absolute path), then we did are not able + # to confidently add the `bundler.rb` form to @lfi. + # + # We could either: + # + # 1. Just add `bundler.rb`, `bundler.so`, and so on, which is close but + # not quite right; or + # 2. Inspect $LOADED_FEATURES upon return from yield to find the matching + # entry. + # + # source://bootsnap//lib/bootsnap/load_path_cache/loaded_features_index.rb#105 + def register(short, long); end + + private + + # Might Ruby automatically search for this extension if + # someone tries to 'require' the file without it? E.g. Ruby + # will implicitly try 'x.rb' if you ask for 'x'. + # + # This is complex and platform-dependent, and the Ruby docs are a little + # handwavy about what will be tried when and in what order. + # So optimistically pretend that all known elidable extensions + # will be tried on all platforms, and that people are unlikely + # to name files in a way that assumes otherwise. + # (E.g. It's unlikely that someone will know that their code + # will _never_ run on MacOS, and therefore think they can get away + # with calling a Ruby file 'x.dylib.rb' and then requiring it as 'x.dylib'.) + # + # See . + # + # @return [Boolean] + # + # source://bootsnap//lib/bootsnap/load_path_cache/loaded_features_index.rb#146 + def extension_elidable?(feature); end + + # source://bootsnap//lib/bootsnap/load_path_cache/loaded_features_index.rb#150 + def strip_extension_if_elidable(feature); end +end + +# source://bootsnap//lib/bootsnap/load_path_cache/loaded_features_index.rb#129 +Bootsnap::LoadPathCache::LoadedFeaturesIndex::STRIP_EXTENSION = T.let(T.unsafe(nil), Regexp) + +# source://bootsnap//lib/bootsnap/load_path_cache/path.rb#7 +class Bootsnap::LoadPathCache::Path + # @return [Path] a new instance of Path + # + # source://bootsnap//lib/bootsnap/load_path_cache/path.rb#24 + def initialize(path, real: T.unsafe(nil)); end + + # Return a list of all the requirable files and all of the subdirectories + # of this +Path+. + # + # source://bootsnap//lib/bootsnap/load_path_cache/path.rb#59 + def entries_and_dirs(store); end + + # source://bootsnap//lib/bootsnap/load_path_cache/path.rb#82 + def expanded_path; end + + # True if the path exists, but represents a non-directory object + # + # @return [Boolean] + # + # source://bootsnap//lib/bootsnap/load_path_cache/path.rb#47 + def non_directory?; end + + # Returns the value of attribute path. + # + # source://bootsnap//lib/bootsnap/load_path_cache/path.rb#22 + def path; end + + # @return [Boolean] + # + # source://bootsnap//lib/bootsnap/load_path_cache/path.rb#53 + def relative?; end + + # A path is considered 'stable' if it is part of a Gem.path or the ruby + # distribution. When adding or removing files in these paths, the cache + # must be cleared before the change will be noticed. + # + # @return [Boolean] + # + # source://bootsnap//lib/bootsnap/load_path_cache/path.rb#11 + def stable?; end + + # source://bootsnap//lib/bootsnap/load_path_cache/path.rb#29 + def to_realpath; end + + # A path is considered volatile if it doesn't live under a Gem.path or + # the ruby distribution root. These paths are scanned for new additions + # more frequently. + # + # @return [Boolean] + # + # source://bootsnap//lib/bootsnap/load_path_cache/path.rb#18 + def volatile?; end + + private + + # last time a directory was modified in this subtree. +dirs+ should be a + # list of relative paths to directories under +path+. e.g. for /a/b and + # /a/b/c, pass ('/a/b', ['c']) + # + # source://bootsnap//lib/bootsnap/load_path_cache/path.rb#99 + def latest_mtime(path, dirs); end + + # (expensive) returns [entries, dirs] + # + # source://bootsnap//lib/bootsnap/load_path_cache/path.rb#92 + def scan!; end + + # source://bootsnap//lib/bootsnap/load_path_cache/path.rb#123 + def stability; end +end + +# Built-in ruby lib stuff doesn't change, but things can occasionally be +# installed into sitedir, which generally lives under rubylibdir. +# +# source://bootsnap//lib/bootsnap/load_path_cache/path.rb#120 +Bootsnap::LoadPathCache::Path::RUBY_LIBDIR = T.let(T.unsafe(nil), String) + +# source://bootsnap//lib/bootsnap/load_path_cache/path.rb#121 +Bootsnap::LoadPathCache::Path::RUBY_SITEDIR = T.let(T.unsafe(nil), String) + +# a Path can be either stable of volatile, depending on how frequently we +# expect its contents may change. Stable paths aren't rescanned nearly as +# often. +# +# source://bootsnap//lib/bootsnap/load_path_cache/path.rb#115 +Bootsnap::LoadPathCache::Path::STABLE = T.let(T.unsafe(nil), Symbol) + +# source://bootsnap//lib/bootsnap/load_path_cache/path.rb#116 +Bootsnap::LoadPathCache::Path::VOLATILE = T.let(T.unsafe(nil), Symbol) + +# source://bootsnap//lib/bootsnap/load_path_cache/path_scanner.rb#7 +module Bootsnap::LoadPathCache::PathScanner + class << self + # source://bootsnap//lib/bootsnap/load_path_cache/path_scanner.rb#23 + def call(path); end + + # Returns the value of attribute ignored_directories. + # + # source://bootsnap//lib/bootsnap/load_path_cache/path_scanner.rb#21 + def ignored_directories; end + + # Sets the attribute ignored_directories + # + # @param value the value to set the attribute ignored_directories to. + # + # source://bootsnap//lib/bootsnap/load_path_cache/path_scanner.rb#21 + def ignored_directories=(_arg0); end + + # source://bootsnap//lib/bootsnap/load_path_cache/path_scanner.rb#69 + def os_path(path); end + + # source://bootsnap//lib/bootsnap/load_path_cache/path_scanner.rb#49 + def walk(absolute_dir_path, relative_dir_path, &block); end + end +end + +# source://bootsnap//lib/bootsnap/load_path_cache/path_scanner.rb#10 +Bootsnap::LoadPathCache::PathScanner::ALTERNATIVE_NATIVE_EXTENSIONS_PATTERN = T.let(T.unsafe(nil), Regexp) + +# source://bootsnap//lib/bootsnap/load_path_cache/path_scanner.rb#12 +Bootsnap::LoadPathCache::PathScanner::BUNDLE_PATH = T.let(T.unsafe(nil), String) + +# source://bootsnap//lib/bootsnap/load_path_cache/path_scanner.rb#9 +Bootsnap::LoadPathCache::PathScanner::NORMALIZE_NATIVE_EXTENSIONS = T.let(T.unsafe(nil), TrueClass) + +# source://bootsnap//lib/bootsnap/load_path_cache/path_scanner.rb#8 +Bootsnap::LoadPathCache::PathScanner::REQUIRABLE_EXTENSIONS = T.let(T.unsafe(nil), Array) + +# source://bootsnap//lib/bootsnap/load_path_cache.rb#9 +Bootsnap::LoadPathCache::SLASH = T.let(T.unsafe(nil), String) + +# source://bootsnap//lib/bootsnap/load_path_cache/store.rb#9 +class Bootsnap::LoadPathCache::Store + # @return [Store] a new instance of Store + # + # source://bootsnap//lib/bootsnap/load_path_cache/store.rb#16 + def initialize(store_path, readonly: T.unsafe(nil)); end + + # @raise [SetOutsideTransactionNotAllowed] + # + # source://bootsnap//lib/bootsnap/load_path_cache/store.rb#28 + def fetch(key); end + + # source://bootsnap//lib/bootsnap/load_path_cache/store.rb#24 + def get(key); end + + # @raise [SetOutsideTransactionNotAllowed] + # + # source://bootsnap//lib/bootsnap/load_path_cache/store.rb#40 + def set(key, value); end + + # @raise [NestedTransactionError] + # + # source://bootsnap//lib/bootsnap/load_path_cache/store.rb#49 + def transaction; end + + private + + # source://bootsnap//lib/bootsnap/load_path_cache/store.rb#66 + def commit_transaction; end + + # source://bootsnap//lib/bootsnap/load_path_cache/store.rb#112 + def default_data; end + + # source://bootsnap//lib/bootsnap/load_path_cache/store.rb#95 + def dump_data; end + + # source://bootsnap//lib/bootsnap/load_path_cache/store.rb#73 + def load_data; end + + # source://bootsnap//lib/bootsnap/load_path_cache/store.rb#61 + def mark_for_mutation!; end + + # source://bootsnap//lib/bootsnap/load_path_cache/store.rb#116 + def mkdir_p(path); end +end + +# source://bootsnap//lib/bootsnap/load_path_cache/store.rb#11 +Bootsnap::LoadPathCache::Store::CURRENT_VERSION = T.let(T.unsafe(nil), String) + +# source://bootsnap//lib/bootsnap/load_path_cache/store.rb#13 +class Bootsnap::LoadPathCache::Store::NestedTransactionError < ::StandardError; end + +# source://bootsnap//lib/bootsnap/load_path_cache/store.rb#14 +class Bootsnap::LoadPathCache::Store::SetOutsideTransactionNotAllowed < ::StandardError; end + +# source://bootsnap//lib/bootsnap/load_path_cache/store.rb#10 +Bootsnap::LoadPathCache::Store::VERSION_KEY = T.let(T.unsafe(nil), String) + +# source://bootsnap//lib/bootsnap/version.rb#4 +Bootsnap::VERSION = T.let(T.unsafe(nil), String) + +# source://bootsnap//lib/bootsnap/load_path_cache/core_ext/kernel_require.rb#3 +module Kernel + private + + # source://bootsnap//lib/bootsnap/load_path_cache/core_ext/kernel_require.rb#6 + def require(path); end + + # source://bootsnap//lib/bootsnap/load_path_cache/core_ext/kernel_require.rb#4 + def require_without_bootsnap(name); end +end + +module Psych + extend ::Bootsnap::CompileCache::YAML::Psych4::Patch +end + +class RubyVM::InstructionSequence + extend ::RequireHooks::LoadIseq + extend ::Bootsnap::CompileCache::ISeq::InstructionSequenceMixin +end diff --git a/sorbet/rbi/gems/brakeman@7.1.1.rbi b/sorbet/rbi/gems/brakeman@7.1.1.rbi new file mode 100644 index 0000000..508e1de --- /dev/null +++ b/sorbet/rbi/gems/brakeman@7.1.1.rbi @@ -0,0 +1,228 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `brakeman` gem. +# Please instead update this file by running `bin/tapioca gem brakeman`. + + +# source://brakeman//lib/brakeman/version.rb#1 +module Brakeman + class << self + # source://brakeman//lib/brakeman.rb#594 + def add_external_checks(options); end + + # source://brakeman//lib/brakeman.rb#600 + def check_for_missing_checks(included_checks, excluded_checks, enabled_checks); end + + # Compare JSON output from a previous scan and return the diff of the two scans + # + # @raise [ArgumentError] + # + # source://brakeman//lib/brakeman.rb#505 + def compare(options); end + + # source://brakeman//lib/brakeman.rb#193 + def config_file(custom_location, app_path); end + + # source://brakeman//lib/brakeman.rb#500 + def debug(message); end + + # source://brakeman//lib/brakeman.rb#610 + def debug=(val); end + + # Default set of options + # + # source://brakeman//lib/brakeman.rb#200 + def default_options; end + + # Output configuration to YAML + # + # source://brakeman//lib/brakeman.rb#360 + def dump_config(options); end + + # source://brakeman//lib/brakeman.rb#386 + def ensure_latest; end + + # source://brakeman//lib/brakeman.rb#566 + def filter_warnings(tracker, options); end + + # Determine output formats based on options[:output_formats] + # or options[:output_files] + # + # source://brakeman//lib/brakeman.rb#232 + def get_output_formats(options); end + + # Returns an array of alert fingerprints for any ignored warnings without + # notes found in the specified ignore file (if it exists). + # + # source://brakeman//lib/brakeman.rb#556 + def ignore_file_entries_with_empty_notes(file); end + + # Output list of checks (for `-k` option) + # + # source://brakeman//lib/brakeman.rb#338 + def list_checks(options); end + + # source://brakeman//lib/brakeman.rb#528 + def load_brakeman_dependency(name, allow_fail = T.unsafe(nil)); end + + # Load options from YAML file + # + # source://brakeman//lib/brakeman.rb#145 + def load_options(line_options); end + + # source://brakeman//lib/brakeman.rb#496 + def notify(message); end + + # source://brakeman//lib/brakeman.rb#614 + def quiet=(val); end + + # Rescan a subset of files in a Rails application. + # + # A full scan must have been run already to use this method. + # The returned Tracker object from Brakeman.run is used as a starting point + # for the rescan. + # + # Options may be given as a hash with the same values as Brakeman.run. + # Note that these options will be merged into the Tracker. + # + # This method returns a RescanReport object with information about the scan. + # However, the Tracker object will also be modified as the scan is run. + # + # source://brakeman//lib/brakeman.rb#485 + def rescan(tracker, files, options = T.unsafe(nil)); end + + # Run Brakeman scan. Returns Tracker object. + # + # Options: + # + # * :app_path - path to root of Rails app (required) + # * :additional_checks_path - array of additional directories containing additional out-of-tree checks to run + # * :additional_libs_path - array of additional application relative lib directories (ex. app/mailers) to process + # * :assume_all_routes - assume all methods are routes (default: true) + # * :check_arguments - check arguments of methods (default: true) + # * :collapse_mass_assignment - report unprotected models in single warning (default: false) + # * :combine_locations - combine warning locations (default: true) + # * :config_file - configuration file + # * :escape_html - escape HTML by default (automatic) + # * :exit_on_error - only affects Commandline module (default: true) + # * :exit_on_warn - only affects Commandline module (default: true) + # * :github_repo - github repo to use for file links (user/repo[/path][@ref]) + # * :highlight_user_input - highlight user input in reported warnings (default: true) + # * :html_style - path to CSS file + # * :ignore_model_output - consider models safe (default: false) + # * :index_libs - add libraries to call index (default: true) + # * :interprocedural - limited interprocedural processing of method calls (default: false) + # * :message_limit - limit length of messages + # * :min_confidence - minimum confidence (0-2, 0 is highest) + # * :output_files - files for output + # * :output_formats - formats for output (:to_s, :to_tabs, :to_csv, :to_html) + # * :parallel_checks - run checks in parallel (default: true) + # * :parser_timeout - set timeout for parsing an individual file (default: 10 seconds) + # * :print_report - if no output file specified, print to stdout (default: false) + # * :quiet - suppress most messages (default: true) + # * :rails3 - force Rails 3 mode (automatic) + # * :rails4 - force Rails 4 mode (automatic) + # * :rails5 - force Rails 5 mode (automatic) + # * :rails6 - force Rails 6 mode (automatic) + # * :report_routes - show found routes on controllers (default: false) + # * :run_checks - array of checks to run (run all if not specified) + # * :safe_methods - array of methods to consider safe + # * :show_ignored - Display warnings that are usually ignored + # * :sql_safe_methods - array of sql sanitization methods to consider safe + # * :skip_libs - do not process lib/ directory (default: false) + # * :skip_vendor - do not process vendor/ directory (default: true) + # * :skip_checks - checks not to run (run all if not specified) + # * :absolute_paths - show absolute path of each file (default: false) + # * :summary_only - only output summary section of report for plain/table (:summary_only, :no_summary, true) + # + # Alternatively, just supply a path as a string. + # + # source://brakeman//lib/brakeman.rb#81 + def run(options); end + + # Run a scan. Generally called from Brakeman.run instead of directly. + # + # source://brakeman//lib/brakeman.rb#395 + def scan(options); end + + # Sets up options for run, checks given application path + # + # source://brakeman//lib/brakeman.rb#104 + def set_options(options); end + + private + + # source://brakeman//lib/brakeman.rb#285 + def get_formats_from_output_files(output_files); end + + # source://brakeman//lib/brakeman.rb#251 + def get_formats_from_output_format(output_format); end + + # source://brakeman//lib/brakeman.rb#321 + def get_github_url(options); end + + # source://brakeman//lib/brakeman.rb#439 + def write_report_to_files(tracker, output_files); end + + # source://brakeman//lib/brakeman.rb#457 + def write_report_to_formats(tracker, output_formats); end + end +end + +# source://brakeman//lib/brakeman.rb#181 +Brakeman::CONFIG_FILES = T.let(T.unsafe(nil), Array) + +# source://brakeman//lib/brakeman.rb#618 +class Brakeman::DependencyError < ::RuntimeError; end + +# Exit code returned when an ignored warning has no note and +# --ensure-ignore-notes is set +# +# source://brakeman//lib/brakeman.rb#25 +Brakeman::Empty_Ignore_Note_Exit_Code = T.let(T.unsafe(nil), Integer) + +# Exit code returned when errors were found and the --exit-on-error +# option is set +# +# source://brakeman//lib/brakeman.rb#21 +Brakeman::Errors_Found_Exit_Code = T.let(T.unsafe(nil), Integer) + +# source://brakeman//lib/brakeman.rb#621 +class Brakeman::MissingChecksError < ::RuntimeError; end + +# Exit code returned when user requests non-existent checks +# +# source://brakeman//lib/brakeman.rb#17 +Brakeman::Missing_Checks_Exit_Code = T.let(T.unsafe(nil), Integer) + +# source://brakeman//lib/brakeman.rb#620 +class Brakeman::NoApplication < ::RuntimeError; end + +# source://brakeman//lib/brakeman.rb#619 +class Brakeman::NoBrakemanError < ::RuntimeError; end + +# Exit code returned when no Rails application is detected +# +# source://brakeman//lib/brakeman.rb#11 +Brakeman::No_App_Found_Exit_Code = T.let(T.unsafe(nil), Integer) + +# Exit code returned when brakeman was outdated +# +# source://brakeman//lib/brakeman.rb#14 +Brakeman::Not_Latest_Version_Exit_Code = T.let(T.unsafe(nil), Integer) + +# Exit code returned when at least one obsolete ignore entry is present +# and `--ensure-no-obsolete-ignore-entries` is set. +# +# source://brakeman//lib/brakeman.rb#29 +Brakeman::Obsolete_Ignore_Entries_Exit_Code = T.let(T.unsafe(nil), Integer) + +# source://brakeman//lib/brakeman/version.rb#2 +Brakeman::Version = T.let(T.unsafe(nil), String) + +# This exit code is used when warnings are found and the --exit-on-warn +# option is set +# +# source://brakeman//lib/brakeman.rb#8 +Brakeman::Warnings_Found_Exit_Code = T.let(T.unsafe(nil), Integer) diff --git a/sorbet/rbi/gems/builder@3.3.0.rbi b/sorbet/rbi/gems/builder@3.3.0.rbi new file mode 100644 index 0000000..177ba9a --- /dev/null +++ b/sorbet/rbi/gems/builder@3.3.0.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `builder` gem. +# Please instead update this file by running `bin/tapioca gem builder`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/capybara@3.40.0.rbi b/sorbet/rbi/gems/capybara@3.40.0.rbi new file mode 100644 index 0000000..6630810 --- /dev/null +++ b/sorbet/rbi/gems/capybara@3.40.0.rbi @@ -0,0 +1,9601 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `capybara` gem. +# Please instead update this file by running `bin/tapioca gem capybara`. + + +# source://capybara//lib/capybara/session/config.rb#5 +module Capybara + extend ::Capybara::DSL + + class << self + # Parse raw html into a document using Nokogiri, and adjust textarea contents as defined by the spec. + # + # @param html [String] The raw html + # @return [Nokogiri::HTML::Document] HTML document + # + # source://capybara//lib/capybara.rb#390 + def HTML(html); end + + # Add a new selector to Capybara. Selectors can be used by various methods in Capybara + # to find certain elements on the page in a more convenient way. For example adding a + # selector to find certain table rows might look like this: + # + # Capybara.add_selector(:row) do + # xpath { |num| ".//tbody/tr[#{num}]" } + # end + # + # This makes it possible to use this selector in a variety of ways: + # + # find(:row, 3) + # page.find('table#myTable').find(:row, 3).text + # page.find('table#myTable').has_selector?(:row, 3) + # within(:row, 3) { expect(page).to have_content('$100.000') } + # + # Here is another example: + # + # Capybara.add_selector(:id) do + # xpath { |id| XPath.descendant[XPath.attr(:id) == id.to_s] } + # end + # + # Note that this particular selector already ships with Capybara. + # + # @param name [Symbol] The name of the selector to add + # @yield A block executed in the context of the new {Capybara::Selector} + # + # source://capybara//lib/capybara.rb#182 + def add_selector(name, **options, &block); end + + # source://capybara//lib/capybara.rb#45 + def allow_gumbo(*args, **_arg1, &block); end + + # source://capybara//lib/capybara.rb#45 + def allow_gumbo=(*args, **_arg1, &block); end + + # See {Capybara.configure} + # + # source://capybara//lib/capybara.rb#58 + def always_include_port(*args, **_arg1, &block); end + + # source://capybara//lib/capybara.rb#58 + def always_include_port=(*args, **_arg1, &block); end + + # See {Capybara.configure} + # + # source://capybara//lib/capybara.rb#45 + def app(*args, **_arg1, &block); end + + # source://capybara//lib/capybara.rb#45 + def app=(*args, **_arg1, &block); end + + # See {Capybara.configure} + # + # source://capybara//lib/capybara.rb#58 + def app_host(*args, **_arg1, &block); end + + # source://capybara//lib/capybara.rb#58 + def app_host=(*args, **_arg1, &block); end + + # source://capybara//lib/capybara.rb#58 + def asset_host(*args, **_arg1, &block); end + + # source://capybara//lib/capybara.rb#58 + def asset_host=(*args, **_arg1, &block); end + + # source://capybara//lib/capybara.rb#58 + def automatic_label_click(*args, **_arg1, &block); end + + # source://capybara//lib/capybara.rb#58 + def automatic_label_click=(*args, **_arg1, &block); end + + # source://capybara//lib/capybara.rb#58 + def automatic_reload(*args, **_arg1, &block); end + + # source://capybara//lib/capybara.rb#58 + def automatic_reload=(*args, **_arg1, &block); end + + # Configure Capybara to suit your needs. + # + # Capybara.configure do |config| + # config.run_server = false + # config.app_host = 'http://www.google.com' + # end + # + # #### Configurable options + # + # - **use_html5_parsing** (Boolean = `false`) - When Nokogiri >= 1.12.0 or `nokogumbo` is installed, whether HTML5 parsing will be used for HTML strings. + # - **always_include_port** (Boolean = `false`) - Whether the Rack server's port should automatically be inserted into every visited URL + # unless another port is explicitly specified. + # - **app_host** (String, `nil`) - The default host to use when giving a relative URL to visit, must be a valid URL e.g. `http://www.example.com`. + # - **asset_host** (String = `nil`) - Where dynamic assets are hosted - will be prepended to relative asset locations if present. + # - **automatic_label_click** (Boolean = `false`) - Whether {Capybara::Node::Element#choose Element#choose}, {Capybara::Node::Element#check Element#check}, + # {Capybara::Node::Element#uncheck Element#uncheck} will attempt to click the associated `